Instantiating the extension point for the advanced design search

After the plug-in is created for the advanced design search patterns, you must instantiate the com.ibm.pdp.maf.rpp.mafAdvancedSearchPattern extension point for each new pattern.

Procedure

  1. Open the plug-in that is dedicated to the advanced design search patterns from the Package Explorer view of the Plug-in Development perspective.
  2. Click the plugin.xml tab.
  3. Indicate the extension point: com.ibm.pdp.maf.rpp.mafAdvancedSearchPattern. Instantiate this extension point for each advanced search pattern.
  4. On the lines that follow each instantiation of the extension point, enter the following parameters:
    • id: Identifier of the advanced search pattern. It is used to manage the extension point internally. It is not displayed in the interface.
    • description: Label of the pattern. It is displayed in the interface. It can be converted.
    • designType: Design type that the pattern applies to. It is the extension of the entity. For example, dataunit is the extension that corresponds to the Data Structure entity. All the extensions are listed in Icons, extensions, and generation patterns of entities.
    • kind: Type of pattern that determines the number and the nature of the parameters displayed in the graphic interface. There are various kinds of patterns:
      • STRING. This kind of pattern contains the following parameters:
        • An expression from which the instances that match the search criterion are extracted. This parameter is displayed in the interface as the Search string field.
        • A Boolean for the management of the uppercase/lowercase letters. This parameter is displayed in the interface as the Case sensitive check box.
      • INTEGER. This kind of pattern contains the following parameters:
        • A whole number. This parameter is displayed in the interface as the Value field.
        • An operator that specifies the position in relation to this value (<, <=, =, >=, or >). This parameter is displayed in the interface as a drop-down list where the user must select an operator.
      • BOOLEAN. This kind of pattern does not contain any parameter. The interface contains a drop-down list with two values and the user must select one of them.
      • COMPOSITE. This kind of pattern contains multiple parameters whose keys and types are specified in the extension point instantiation. These parameters are displayed in the interface as a table with two columns: Parameter name and Parameter value.
    • class: Java class that receives the pattern parameters and applies them to the instances targeted by the pattern. This class contributes to the constitution of the result list.

Example

The following example illustrates the instantiation of the extension point for a STRING pattern.
<extension
         point="com.ibm.pdp.maf.rpp.mafAdvancedSearchPattern">
      <mafAdvancedSearchPattern
         id="programByPgmID"
         description="List of Programs by their COBOL Program ID"
         designType="pacprogram"
         kind="STRING"
         class="sample.ProgramByPgmID">
     </mafAdvancedSearchPattern>
   </extension>
The following example illustrates the instantiation of the extension point for an INTEGER pattern.
<extension
         point="com.ibm.pdp.maf.rpp.mafAdvancedSearchPattern">
      <mafAdvancedSearchPattern
         id="programByMacroCallNumber"
         description="List of Programs by their number of Macro calls"
         designType="pacprogram"
         kind="INTEGER"
         class="sample.ProgramByMacroCallNumber">
     </mafAdvancedSearchPattern>
   </extension>
The following example illustrates the instantiation of the extension point for a BOOLEAN pattern.
<extension
         point="com.ibm.pdp.maf.rpp.mafAdvancedSearchPattern">
      <mafAdvancedSearchPattern
         id="programNameEqualsPgmID"
         description="List of Programs whose names are identical to their COBOL Program ID"
         designType="pacprogram"
         kind="BOOLEAN"
         class="sample.ProgramNameEqualsPgmID">
      </mafAdvancedSearchPattern>
   </extension>
The following example illustrates the instantiation of the extension point for a COMPOSITE pattern.
<extension
         point="com.ibm.pdp.maf.rpp.mafAdvancedSearchPattern">
      <mafAdvancedSearchPattern
         id="programMultiCriteria"
         description="List of Programs according to multiple criteria"
         designType="pacprogram"
         kind="COMPOSITE"
         class="sample.ProgramMultiCriteria">
            <mafAdvancedSearchPatternParameter name="parameter1" javaType="String"/>
            <mafAdvancedSearchPatternParameter name="parameter2" javaType="Integer"/>
            <mafAdvancedSearchPatternParameter name="parameter3" javaType="Boolean"/>
      </mafAdvancedSearchPattern>
   </extension>

What to do next

You must implement the Java class of the pattern.

Feedback