Configuring third-party modules for the left pane
You can have a single-instance module or a multiple-instance module.
The user_leftPane.conf.xml follows this
syntax:
<leftPane>
List of left Pane modules with one module per line.
</leftPane>
where
the List of left pane modules with one module per line
consists of one or more
module elements, which are a specialized XML element. Each module must have a name attribute to
indicate the module name. You need to specify the name of the main UI JavaScript file, which resides in the
$TOP/public_html/user/js/module directory. This name must be the same as the
module name with the addition of the js
file extension. Single-instance modules
For single-instance modules, only the name attribute is required in the module element.Multiple-instance modules
For multiple-instance modules, the InstanceExplorerClass attribute is required. You use this attribute to provide the full class path of the custom implementation of LeftPaneDataObject. For example,<leftPane>
<module name="MyModule" /> <!-- single instance module -->
<module name="EmptyModule" InstanceExplorerClass="com.lnp.EmptyModuleDataObjectFactory" />
</leftPane>
Configuring a server-side extension module: sample
You can use this sample code to develop server-side third-party modules for the left pane. You must create the extension framework on the server-side and for the UI.- 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
appsvr
service, then restart the service.
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;
}
}
Sample for configuring a client-side UI module
You can use this sample code to develop client-side UI third-party modules for the left pane.- Copy the sample code below and to paste it into a JavaScript file. For example, EmptyModule.js.
- Place the EmptyModule.js file into the
$TOP/public_html/user/js/module folder. Note: Ensure that the name of the JavaScript file matches the module name as defined in the $TOP/etc/default/user_leftPane.conf.xml file.
EmptyModule, Module
are mentioned. The EmptyModule.js looks similar to the
following:/**
* @class
* @extends Module
*/
function EmptyModule()
{
EmptyModule.uber.constructor.call(this);
EmptyModule.instance = this;
}
// extends Module
Runtime.subclass(EmptyModule, Module);
EmptyModule.prototype.getTitle = function() {
return LeftPaneModuleLabels[UserDefinedLeftPaneModuleTypeEnum.EMPTYMODULE];
};
EmptyModule.prototype.renderContent = function () {
var userServer =
"<html><body></body></html>"
return userServer;
};
EmptyModule.prototype.refresh = function() {
};
EmptyModule.prototype.showCtxMenu = function(event, elementId, moduleId) {};
Incorporating external tools for globalization
You can incorporate external tools for globalization of labels.- Open the $TOP/public_html/user/user_jsp_include.jsp file.
- Provide your globalization label of module types.
dojo.require("dojo.colors");
dojo.requireLocalization("dojo", "colors");
var colors=dojo.i18n.getLocalization("dojo", "colors");
LeftPaneModuleLabels[UserDefinedLeftPaneModuleTypeEnum.EMPTYMODULE]= colors.aqua;