Configuring a server-side extension module: sample

You can use this sample code to develop server-side third-party modules for the left pane.

About this task

You must create the extension framework on the server-side and for the UI.

Procedure

  1. Copy the following sample code and paste it into a Java™ file.
    For example, EmptyModuleDataObjectFactory.java.
  2. Compile the Java file.
  3. Include the corresponding class file into the class path of the appsvr service, then restart the service.

Example

The following sample code illustrates how to use the enhanced Java API for the left pane extension framework. You must specify your specific string names where empty2, empty 1 are mentioned. This custom code can also use other Java APIs to interact with server objects such as a catalog and hierarchy. The EmptyModuleDataObjectFactory.java looks similar to the following code:
package com.lnp;

import com.ibm.pim.ui.leftpane.LeftPaneDataObjectFactory;
import com.ibm.pim.ui.leftpane.LeftPaneDataObject;

public class EmptyModuleDataObjectFactory implements LeftPaneDataObjectFactory {

public EmptyModuleDataObjectFactory(){}

public LeftPaneDataObject [] getDataObjects() {
String[] names =  {"empty2", "empty1"};
LeftPaneDataObject[] result = new MyCustomLeftPaneDataObject[names.length];
for (int i = 0, count = names.length; i < count; i++) {
result[i] = new MyCustomLeftPaneDataObject(names[i]);
}
return result;
}
}

class MyCustomLeftPaneDataObject implements LeftPaneDataObject {

private String m_name;

public MyCustomLeftPaneDataObject() {}

public MyCustomLeftPaneDataObject(String name) {
this.m_name = name;
}

public String getName() {
return this.m_name;
}
}