IBM Support

Setting up Content Navigator for development in WebSphere Liberty

Technical Blog Post


Abstract

Setting up Content Navigator for development in WebSphere Liberty

Body

IBM Content Navigator (ICN) plug-in developers can set up ICN for development in IBM WebSphere Application Server Liberty Profile (Liberty).
ICN currently doesn't support Liberty in production but it can be used for development purposes and a big boost in productivity for plug-in development if Liberty verses a full WebSphere Application Server is used in Eclipse.
 
Here is a brief list of steps needed to set up ICN in Liberty followed by a more detailed explanation of these steps along with example settings.

 

  1. Install Eclipse and WebSphere Developer Tools
  1. Configure Liberty for ICN.
  1. Deploy ICN web application to Liberty.

 

Install Eclipse and WebSphere Developer Tools (WDT)

You can follow the article below to set up Eclipse and Liberty and continue to the next step.
 

 

Configure Liberty for ICN

There is no administrative console for Liberty but the Liberty Server Configuration Editor that comes with WDT can be used to configure Liberty for ICN.

 

LDAP User Registry

 
Here is an example of LDAP user registry you can reference for IBM Tivoli Directory Server.
 
<ldapRegistry id="icnLdap" realm="icnRealm" host="localhost" port="1389" ignoreCase="true" baseDN="o=icnsystem,dc=icn" ldapType="IBM Tivoli Directory Server" sslEnabled="false">
<idsFilters userFilter="(&amp;(cn=%v)(objectclass=person))" groupFilter="(&amp;(cn=%v)(|(objectclass=groupOfNames)(objectclass=groupOfUniqueNames) (objectclass=groupOfURLs)))" userIdMap="*:cn" groupIdMap="*:cn" bindDN="cn=icnBindUser,o=icnsystem,dc=icn" bindPassword="password" groupMemberIdMap="mycompany-allGroups:member;mycompany-allGroups:uniqueMember;groupOfNames:member;groupOfUniqueNames:uniqueMember">
</idsFilters>
</ldapRegistry>
 
You will need replace the values with the LDAP connection information relevant to your environment which you can retrieve by going to IBM WebSphere Application Server (WAS) where ICN is currently deployed.
 
Note: You can use the basic user registry instead of the LDAP user registry for development purposes.
 
 
<basicRegistry id="basic" realm="BasicRealm">
<user name="user1" password="password1" />
<user name="user2" password="password1" />
</basicRegistry>

 

Data Source

 
Here is an example of a data source you can reference for DB2.
 
<library id="3ptLibrary">
<file name="${env.3ptLibPath}/db2jcc4.jar" />
</library>
 
<dataSource id="icnDs" isolationLevel="TRANSACTION_READ_COMMITTED" jndiName="jdbc/CIWEBDS" type="javax.sql.ConnectionPoolDataSource">
<jdbcDriver libraryRef="3ptLibrary" />
<properties.db2.jcc databaseName="ICNDB" password="password" portNumber="50000" serverName="localhost" user="db2inst1" />
</dataSource>
 
You will need to replace the <properties.db2.jcc> property values with the DB connection information relevant to your environment which you can retrieve by going to WAS where ICN is currently deployed.

 

(IBM FileNet Content Manager) JAAS

 
Here is an example of JAAS settings you can use to connect to IBM FileNet Content Manager via WSI protocol.
 
<library id="3ptLibrary">
<file name="${env.3ptLibPath}/Jace.jar" />
</library>
 
<jaasLoginModule id="wsiLoginModule" className="com.filenet.api.util.WSILoginModule" controlFlag="REQUIRED" libraryRef="3ptLibrary" />
<jaasLoginContextEntry id="Navigator" name="Navigator" loginModuleRef="wsiLoginModule, hashtable, userNameAndPassword, certificate, token" />
<jaasLoginContextEntry id="FileNetP8WSI" name="FileNetP8WSI" loginModuleRef="wsiLoginModule, hashtable, userNameAndPassword, certificate, token" />
 
ICN currently doesn't support WSI protocol but it is much easier to set up than setting up IIOP protocol, if not impossible.

 

(IBM Content Manager) Path to 'cmgmt' directory

A directory that contains cmbcmenv.properties and other files needed to connect to IBM Content Manager repositories needs to be added to the class path.
 
<library id="3ptLibrary">
<folder dir="${env.3ptLibPath}/cmgmt" />
</library>
 
Note: This is not needed if the necessary files are already in navigator.war/WebContent/WEB-INF/classes directory.

 

(IBM Content Manager OnDemand) ODWEK Path

 
You can add ODApi.jar file to the class path as below.
 
<library id="3ptLibrary">
<file name="${env.odWekApiPath}/ODApi.jar" />
</library>
 
Other paths needed can be added by defining them in the server.env file.
 
 
For example, you can define a PATH environment variable as below on a 64-bit version of Windows.
 
PATH=/Program Files/IBM/OnDemand Web Enablement Kit/V9.0; /Program Files/IBM/OnDemand Web Enablement Kit/V9.0/lib64

 

Deploy ICN web application to Liberty

Here are the steps you can take to set up a web project in Eclipse and deploy to Liberty.
 
1. Import navigator.war file as a web project in Eclipse. 
 

Select File > Import in Eclipse to import a navigator.war file.

All files in the WAR file will be extracted to a web project in Eclipse.

 
2. (IBM FileNet Content Manager) Remove Jace.jar file from WebContent/WEB-INF/lib directory.
 

This is needed to avoid conflict with Jace.jar file referenced by the library used to set up JAAS.

 

<library id="3ptLibrary">

<file name="${env.3ptLibPath}/Jace.jar" />

</library>

 
3. (IBM FileNet Content Manager) Edit WebContent/ecm/widget/admin/TabRepository.js to enable WSI protocol.
 

this.protocol.set("disabled", true);

 

Find above line and replace it as below.

 

this.protocol.set("disabled", false);

 

This will let you create IBM FileNet Content Manager repositories with the WSI protocol from the ICN admin desktop.

 
4. Add the web project to Liberty.
 

Right-click on a Liberty server instance you configured, select Add and Remove..., and add the web project as Configured.

 

Note: You will also need to update the server configuration, server.xml, (again) to add a reference to third party JAR files needed for ICN as Liberty will overwrite following setting when you add a web project to the server.

 

<webApplication id="navigator" name="navigator" location="navigator.war" contextRoot="navigator">

<classloader commonLibraryRef="3ptLibrary" />

</webApplication>

 
Now you are ready to start the Liberty server and open ICN with the 'debug' parameter set to true as below.
 
 
It will be slow to load ICN first time as uncompressed versions of JavaScript files will be loaded with the 'debug' parameter set to true but useful for debugging JavaScript files and needed to pick up the change you made in step 3 to enable the WSI protocol.
 
Here is the full content of the server.xml and server.env files with the examples used in this article.
 
server.xml
 
<server description="ICN Liberty Server">
 
    <featureManager>
        <feature>appSecurity-2.0</feature>
        <feature>jdbc-4.1</feature>
        <feature>jsp-2.3</feature>
        <feature>jaxrs-2.0</feature>
        <feature>ldapRegistry-3.0</feature>
        <feature>localConnector-1.0</feature>
        <feature>ssl-1.0</feature>
    </featureManager>
 
    <keyStore id="defaultKeyStore" password="password" />
 
    <ldapRegistry id="icnLdap" realm="icnRealm" host="localhost" port="1389" ignoreCase="true" baseDN="o=icnsystem,dc=icn" ldapType="IBM Tivoli Directory Server" sslEnabled="false">
        <idsFilters userFilter="(&amp;(cn=%v)(objectclass=person))" groupFilter="(&amp;(cn=%v)(|(objectclass=groupOfNames)(objectclass=groupOfUniqueNames) (objectclass=groupOfURLs)))" userIdMap="*:cn" groupIdMap="*:cn" bindDN="cn=icnBindUser,o=icnsystem,dc=icn" bindPassword="password" groupMemberIdMap="mycompany-allGroups:member;mycompany-allGroups:uniqueMember;groupOfNames:member;groupOfUniqueNames:uniqueMember">
        </idsFilters>
    </ldapRegistry>
 
<!--
<basicRegistry id="basic" realm="BasicRealm">
    <user name="user1" password="password1" />
    <user name="user2" password="password1" />
</basicRegistry>
-->
 
    <library id="3ptLibrary">
        <file name="${env.3ptLibPath}/cm/db2jcc4.jar" />
        <folder dir="${env.3ptLibPath}/cm/cmgmt" />
        <file name="${env.3ptLibPath}/cm/cmbicmsdk81.jar" />
        <file name="${env.3ptLibPath}/cm/cmbutil81.jar" />
        <file name="${env.3ptLibPath}/cm/cmbutilicm81.jar" />
        <file name="${env.3ptLibPath}/p8/jace.jar" />
        <file name="${env.3ptLibPath}/p8/log4j-1.2.13.jar" />
        <file name="${env.3ptLibPath}/p8/pe.jar" />
        <file name="${env.3ptLibPath}/p8/stax-api.jar" />
        <file name="${env.3ptLibPath}/p8/xlxpScanner.jar" />
        <file name="${env.3ptLibPath}/p8/xlxpScannerUtils.jar" />
        <file name="${env.odwekApiPath}/ODApi.jar" />
    </library>
 
    <jaasLoginModule id="wsiLoginModule" className="com.filenet.api.util.WSILoginModule"
        controlFlag="REQUIRED" libraryRef="3ptLibrary" />
    <jaasLoginContextEntry id="Navigator" name="Navigator"
        loginModuleRef="wsiLoginModule, hashtable, userNameAndPassword, certificate, token" />
    <jaasLoginContextEntry id="FileNetP8WSI" name="FileNetP8WSI"
        loginModuleRef="wsiLoginModule, hashtable, userNameAndPassword, certificate, token" />
 
    <dataSource id="icnDs" isolationLevel="TRANSACTION_READ_COMMITTED" jndiName="jdbc/CIWEBDS"
        type="javax.sql.ConnectionPoolDataSource">
        <jdbcDriver libraryRef="3ptLibrary" />
        <properties.db2.jcc databaseName="ICNDB" password="password"
            portNumber="50000" serverName="localhost" user="db2inst1" />
    </dataSource>
 
    <httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9080" httpsPort="9443" />
    <httpEndpoint id="customHttpEndpoint" host="*" httpPort="80" httpsPort="443" />
 
    <webAppSecurity httpOnlyCookies="false" />
    <httpSession cookieHttpOnly="false" />
 
    <mimeTypes>
        <type>svg=image/svg+xml</type>
        <type>svgz=image/svg+xml</type>
    </mimeTypes>
 
    <applicationManager autoExpand="true" />
 
    <applicationMonitor updateTrigger="mbean" />
 
    <webApplication id="navigator" name="navigator" location="navigator.war" contextRoot="navigator">
        <classloader commonLibraryRef="3ptLibrary" />
    </webApplication>
 
</server>
 
server.env
 
3ptLibPath=/3pt/lib
odwekApiPath=/Program Files/IBM/OnDemand Web Enablement Kit/V9.0/api
PATH=/Program Files/IBM/OnDemand Web Enablement Kit/V9.0; /Program Files/IBM/OnDemand Web Enablement Kit/V9.0/lib64

 

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSCTJ4","label":"IBM Case Manager"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

UID

ibm11280980