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
Procedure
- Copy the following sample code and paste it into a Java™ file. For example,
EmptyModuleDataObjectFactory.java. - Compile the Java file.
- Include the corresponding class file into the class path
of the
appsvrservice, then restart the service.
Example
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;
}
}