Package wt.ixb.objectset

When an object is given to the export process, the ObjectSet application does the job of navigating through the object’s structure and collecting all of its related objects.

See:
          Description

Interface Summary
ObjectSetFilter This interface is the base for all object set filters.
ObjectSetGenerator This interface is the base for all object set generators.
ObjectSetHandler This interface is the base for object set generators and filters (See ObjectSetGenerator and ObjectSetFilter.
ObjectVisitor This interface specifies how to process the object during object strucutre navigation.
 

Class Summary
ExportPackage Simple wrapping class for WTHashSet.
ExportPriorityHelper  
ObjectSetFilterTemplate Class extends ObjectSetFilter interface with trivial implementations for most methods.- It can be used by application to make application less dependent of future extension of ObjectSetFilter interface.
ObjectSetGeneratorTemplate Class extends ObjectSetGenerator interface with trivial implementations for most methods.- It can be used by application to make application less dependent of future extension of ObjectSetGenerator interface.
ObjectSetHandlerTemplate Class extends ObjectSetHandler interface with trivial implementations for most methods.- It can be used by application to make application less dependent of future extension of ObjectSetHandler interface.
ObjectSetHelper  
ObjectSetHelper.ComputeObjectSetVisitor  
PagedObjectVisitor This is a base class for handling large size of objects during product structure navigation and export to avoid memory shortage problems.
WTHashSet  
 

Package wt.ixb.objectset Description

When an object is given to the export process, the ObjectSet application does the job of navigating through the object’s structure and collecting all of its related objects.

 

The definition of the navigation is taken from a set of XML files known as navigation‑rule files. Additionally, the ObjectSet application uses Java classes known as generators and filters to collect a set of objects that will be exported when simple navigation is not enough and some programming logic needs to be applied.

 

The navigation rule files reside in the folder Windchill\codebase\registry\ixb\object_set_handlers.

 

Navigating Rules: Generator and Filter

There are two types of navigating rules:

·        Generators are rules that are used by the application to traverse the object’s structure and get all of its objects to be exported, such as “uses”, “described by”, “reference”, etc.

·        Filters are rules that are applied to objects to be exported in order to exclude certain objects from the export process. For example, with “Filter By Time”, we can choose to export objects that were modified during a specified period. This is the only filter currently available OOTB.

 

Available GeneratorIds are defined in XML files in the folder WT_HOME\codebase\registry\ixb\object_set_handlers with the tag  <setGenerator>. A list of these Generator Ids can be obtained by calling to IXBHelper.service.getAllAvaiableGenerators(). The call returns all available Generators in the system.

IXBHelper.service.getGeneratorList() returns a list of Generators that will be displayed to the GUI for end-user selection. This helps to hide Generators that you don’t want the end-user to see. To hide these Generators, the XML files for these Generators should have the <display> tag set to false.

 

For example: a paragraph of XML file for WTPart:

(From “<Windchill>\codebase\registry\ixb\object_set_handlers\product_struct.xml”)

<setGenerator>

    <id>productStructureNavigator</id>

    <handler>

      wt.ixb.objectset.handlers.navigator.ProductStructureNavigator

    </handler>

    <dialogClassName>

      wt.clients.ixb.exp.NavigatorSearchDialog

    </dialogClassName>

    <localizedName>

      <localizedString>

            <class>wt.ixb.objectset.objectSetResource</class>

       <key>PRODUCT_STRUCTURE_NAME</key>

      </localizedString>

    </localizedName>

 

Tags:

 

<id>: Generator Id

<handler>: Navigator – Java class that helps navigating through the object structure. In the example, to navigate through WTPart structure.

<dialogClassName> : Java class of the dialog that must be called from the GUI to search the top-level object of this class in database (in this example, to search WTPart).

<localizedName> and its sub tags are for internationalization purpose. The string resource for displaying the Generator to the GUI will be defined in the .rbInfo file specified by localizedName/localizedString/class and its key in the .rbInfo file is  localizedName/localizedString/key.

 

If you don’t want this GeneratorId to be displayed to the GUI, but only to be used programmatically in your application, add the tag <display>false</display>, as follows:

 

<setGenerator>

    <id>productStructureNavigator</id>

    <display>false</display>

    <handler>

      wt.ixb.objectset.handlers.navigator.ProductStructureNavigator

    </handler>

   

 

·        Available Filter Id-s are defined in XML files in the folder Windchill\codebase\registry\ixb\object_set_handlers with the tag  <setFilter>. A list of these Filter Ids can be obtained by calling to IXBHelper.service.getAllAvaiableFilters(). It returns all available Filters in the system.

IXBHelper.service.getFilterList() returns a list of Filters that will be displayed to the GUI for user selection. This function help to hide filters which you don’t want the end user to see. To hide such Filters, set the value of the <display> tag to false in the XML files of these Filters.

 

Note: If the tag <display> is not specified, or set to true, the Generator will be included in the result of the method

 

ObjectSetHelper.getListOfObjectSetGenerators() and it will be displayed in the GUI. If the tag <display> is false, the Generator will not be included in the result of the method ObjectSetHelper.getListOfObjectSetGenerators(), and it will not be displayed to the GUI. To get all Generators in the system, use the method ObjectSetHelper.getAllAvaiableGenerators().

 

 

Object Navigation

The mechanism is an XML-rule-driven “navigator” of Windchill objects. Given a seed (top level) object the mechanism uses specified rules to navigate from object to object. The navigation can be performed through a DB link, a foreign key, or a specified method. Here is an example of rule definition of WTPart. The seed is a Folder object.

(From “<Windchill>\codebase\registry\ixb\object_set_handlers\product_struct.xml”)

<handler> wt.ixb.objectset.handlers.navigator.ProductStructureNavigator </handler>

<schema>

<rule>

   <for>wt.part.WTPart</for>

   <go>

     <byMethod>

         <method>navigateFromWTPartToDescribeByDoc</method> 

     </byMethod>

   </go>

</rule>

 

<rule>

   <for>wt.part.WTPartDescribeLink</for>

   <go>

     <fromForeignKey>

        <targetClass>wt.doc.WTDocument</targetClass>

        <getMethodName>getDescribedBy</getMethodName>

     </fromForeignKey>

   </go>

</rule>

 

</schema>

The example above shows both possible types of navigation: From WTPart, it navigates to wt.part.WTPartDescribeLink by a navigate method and from there using the method, getDescribedBy, to get the WTDocument that the WTPart is described by. Thus, non-trivial semantic steps can be made.

 

After collecting, the objects can be filtered out by a set of defined filters. The filter definition is stored in the same object set registry. Below is an example of a date/time filter:

(File: “<Windchill>\codebase\registry\ixb\object_set_handlers\ filter_by_time.xml”)

 

  <setFilter>

    <id>filterByTime</id>

    <handler>wt.ixb.objectset.handlers.FilterByTime</handler>

    <dialogClassName>

      wt.clients.ixb.exp.FilterByTimeDialog

    </dialogClassName>

    <localizedName>

      <localizedString>

            <class>wt.ixb.objectset.objectSetResource</class>

            <key>FILTER_BY_TIME_NAME</key>

      </localizedString>

    </localizedName>

    <parameters>

    </parameters>

  </setFilter>

 

The filtering mechanism, as well as the object collection are coupled with the export application at the level of StandardIXBService. They can be separated.


Adding New Navigators

 

To implement new Navigator, in most cases you will have to do the following steps:

 

1)      Implement the XML rule file describing the logic of the navigation. See WT_HOME\codebase\registry\ixb\object_set_handlers\product_struct.xml for an example.

2)      Implement a subclass of wt.ixb.objectset.handlers.navigator.GeneralNavigator. You may need to implement the following methods:

a.    public boolean canBeUsedAsTopLevelObject(Persistable obj)

b.    public String getTopLevelObjectLocalizedImage(Persistable obj)

Note: You must  implement all methods that are specified in the rule files. 

 

Such navigation methods take the object to navigate from as a parameter, and return Enumeration, which will be added to the export set. For example, if you specify the following rule:

    

     <byMethod>

         <method>navigateFromObject1ToObject2</method> 

     </byMethod>

 

Then, you must implement the following Java method:

 

public Enumeration navigateFromObject1ToObject2 (Persistable ob) throws WTException