Tutorials > Sales Center > Add a new search option in the IBM Sales Center

< Previous | Next >


Create a new plug-in

The IBM Sales Center consists of a set of eclipse plug-ins. In this step, you create a new plug-in to hold the custom code. By isolating your code in its own plug-in, we will be able to find the code and ensure that the customizations will not be overwritten by any fixpacks or migration to future versions.

In general, it is recommended that you create only one plug-in to contain the customizations. Over time, you might have several customizations that logically fall into separate plug-ins, in which case you can create more than one plug-in.

In Rational Application Developer, a plug-in is represented by a plug-in project.

Note that in step 2, you define dependencies for your new plug-in. Similar to import statements in a Java class, you need these dependency definitions to provide services or features required for the newly created plug-in. For example, com.ibm.commerce.telesales.widgets has the widget definitions and descriptor required for access to the widgets. You get a build error if do not define the dependency of plug-ins for the new project.

To create a new plug-in:


Procedure

  1. Create a new plug-in project:

    1. In the Sales Center development environment, select File > New > Plug-in Project.

    2. In the Project name field, enter myNewExtensionsPlugin.

    3. Select Create an OSGi bundle manifest for the plug-in.

    4. Leave other default values, click Next.

    5. Leave all default values then Finish.

    6. In the Package Explorer view, the myNewExtensionsPlugin project displays and in the Editor view, the plug-in opens ready for editing.

  2. Specify required plug-ins:

    1. In the Editor view, click the Dependencies tab.

    2. Click Add.

    3. Add the following required plug-ins, in addition to the two default plug-ins already listed:

      • com.ibm.commerce.telesales

      • com.ibm.commerce.telesales.widgets

      • com.ibm.commerce.telesales.core

      • com.ibm.commerce.telesales.core.impl

      • com.ibm.commerce.telesales.resources

      • com.ibm.commerce.telesales.ui

      • com.ibm.commerce.telesales.ui.impl

    4. Save the changes.

    5. Click the MANIFEST.MF tab, to view the following text. This text reflects the required plug-ins you added on the Dependencies tab:

      Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, com.ibm.commerce.telesales, com.ibm.commerce.telesales.widgets, com.ibm.commerce.telesales.core, com.ibm.commerce.telesales.core.impl, com.ibm.commerce.telesales.resources, com.ibm.commerce.telesales.ui, com.ibm.commerce.telesales.ui.impl
      

  3. Add the path to the system configurator (config.ini), the file in which you let Sales Center know which supplied extension points you plan to extend:

    1. In the Editor view, click the Extensions tab.

    2. Click Add.

    3. From the Available extension points list, select com.ibm.commerce.telesales.configurator and click Finish.

    4. In the All Extensions list, right-click com.ibm.commerce.telesales.configurator and select New > configurator.

    5. In the path field, change the default path myNewExtensionsPlugin.configurator1 to config.

    6. Save the changes.

    7. Click the plugin.xml tab to view the following text. This text reflects the required plug-ins you added in the Extensions tab:

      <extension point="com.ibm.commerce.telesales.configurator">
         
      <configurator path="config"/>
      </extension>
      

< Previous | Next >


+

Search Tips   |   Advanced Search