EC Client Customizing EC Client 客户化

EC Client Customizing   EC Client 客户化

The MCAD systems call CAD Connectors.The MCAD system delivers and receives data to and from Agile using I Ag I Parameter objects.There are three different ways to modify this dataflow:

MCAD 系统调用 CAD 连接器。MCAD 系统通过I Ag I Parameter 对象 提供数据给Agile并且获取Agile 数据.有如下三种方法修改这个数据流。

     Add your own ActionHandler to CAD Connector. 添加自己的ActionHandler 到CAD 连接器。

     Extend your own Connector from CAD Connector .扩展自己的连接器

      Extend your own Connector from CAD Connector and add your own ActionHandler to CAD Connector

      (combination of both steps above).扩展自己的连接器,并且添加自己的ActionHandler到连接器

1.To add your own ActionHandler: (添加自己的ActionHandler)

      1.Create your own JAVA class ,which extends CAXAction and implements ICAXAction.

        创建自己的java类,可以扩展CAXAction 并实现ICAXAction.

        Please see example of com.Agile.cax.custom.CustomAction in CustomConnector.jar.

        请参阅实例: com.Agile.custom.CustomAction 在CustomConnector.jar

       ICAXAction implements methods,called within the workflow of ,save and load processes.

       ICAXAction 实现方法,在保存和加载的过程。

       Here you can modify the behavior using pre-define entries.

       在这里你可以用预编译的实体修改行为。

   2.Create your own JAVA-jar-File,which contains your class. 创建自己的JAVA-jar-File 文件,包含自己的类。

    Compile and link against the CAXConnector.jar,CAXClient.jar,CaxAglDataTypes.jar,and AgileAPI.jar.

    编译和连接CAXConnctor.jar,CAXClient.jar,CaxAglDataTypes.jar,AgileAPI.jar

3.Ensure your jar-file and all needed sub-jars are contained in your java class path when the CAXClient is started. (确保自己的jar-file 以及所有需要用到的sub-jars 在CAXClient启动时都包含在 java class路径下)

   You can check cax_client.bat for that (你可以检查cax_client.bat 文件)

4.Register your ActionListener for CAXConnector in CAXClient.xml. (注册自己的ActionListener到CAXConnector 在CAXClient.xml文件中)

   If your class is com.Agile.cax.custom.CustomAction,the line looks like this:

   假如你的类是Agile.cax.custom.CustomAction,那么应该像如下:

   <drsExtension logicalName="com.Agile.cax.CAXConnector"

      className="com.Agile.cax.CAXConnector"

      actionHandler="com.Agile.cax.custom.CustomAction">

    After restart of CAXClient you see your registered handler in stdout.

   重启CAXClient 之后,可以看到注册了的handler 在标准输出。

2.To extend CAXConnector: (扩展CAXConnector)

    1.Create your own JAVA class,which extends CAXConnector.(创建自己的类,扩展CAXConnector)

      Please see the example of com.Agile.cax.custom.CustomConnector in CustomConnector.jar

     (请参考实例 com.Agile.cax.custom.CustomConnector 在CustomConnector.jar文件)

     This CAXConnector implements all methods which are called directly by MCAD .

     (这个CAXConnector 实现了所有MCAD直接调用的方法)

     Here you can modify the behavior by changing the dataflow or making a complete replacement of single methods (overloading).

     (在这里你可修改行为,通过修改数据流,或者完全替换某个方法)

      2.Please follow 1.1 and 1.2 for creating and using your jar file in CAXClient.

       (请按照1. 和1.2 指示的来创建和使用jar file 在CAXClient)

    3.Register your connector in CAXClient.xml by creating your own drsExtension tag (see CustomConnector for example).(注册连接器在CAXClient.xml 文件,通过创建自己的drsExtension 标签,查看CustomConnector实例)

    Assume you implemented your own Connector in class com.Agile.cax.custom.CustomConnector, then the lines look like this:

    (假定你实现了自己的连接器在类com.Agile.cax.custom.CustomConnector中,那么应该如下:)

    <drsExtension logicalName="com.Agile.cax.custom.CustomConnector"

     className="com.Agile.cax.custom.CustomConnector"></drsExtension>

4.Register your connector and the changed methods in CAXClient.xml.

   (注册你的连机器,并修改方法在CAXClient.xml文件)

   Each method called by MCAD has a name ,which is mapped to a JAVA class in XML:<classMapping

    methodName="symbolicName" className="containingClass">

    (每个被MCAD调用的方法都有一个名字,在XML文件中映射到一个JAVA类:<classMapping methodName="symbolicName" className="containingClass">)

   If you implemented your own method "searchObject" in your connector com.Agile.cax.custom.CustomConnector,the XML entry has to be modified like this:

(如果你实现了自己的方法 "searchObject" 在你的连接器com.Agile.cax.custom.CustomConnector ,XML的实体应该编辑成如下:)

   <classMapping methodName="searchObject" className="

     com.Agile.cax.custom.CustomConnector">

   The available methodName's are predefined and called by CAD .

    (这个可用的方法名是CAD预定义的,并且由CAD 调用的)

3.To extend CAXConnector and ActionHandler combined: (即扩展CAXConnector 又添加ActionHandler)

   1.In order to extend your own Connector and use an ActionHandler just combine the steps in 1 and 2 above.

    (为了扩展自己的连接器并且使用ActionHandler可以使用步骤1和步骤2)

ActionHandler only work for a CAXConnector and can only be registered there.

   (ActionHandler 只为一个CAXConnector工作,并且只能注册一个)

A "CustomConnector" may not have its own ActionHandler ,but you can register this ActionHandler at the CAXConnector Always first try to use own ActionHandlers instead of own Connectors,because making your own Connector is much more complex than making your own ActionHandler.

(一个CustomConnector 不可能有自己的ActionHandler,但是你可以注册这个ActionHandler 在CAXConnector 一直第一个使用自己的ActionHandler 替换自己的连接器,因为创建自己的Connector 比创建自己的ActionHandler 要复杂的多)

原文地址:https://www.cnblogs.com/leojun/p/1867612.html