Follow our tutorial to get started with OnDemand Web Enablement Kit (ODWEK) for IBM Content Manager OnDemand.
What is ODWEK:
ODWEK provides a programming interface that can be used for searching and retrieval of documents from Content Manager OnDemand servers.
ODWEK allows users to access data that is stored in an IBM Content Manager OnDemand server with IBM Content Navigator or a user-written program.
IBM Content Manager OnDemand Web Enablement Kit components:
ODWEK is made up of a programming interface and viewer software listed as following:
- The ODWEK Javaâ„¢ Application Programming Interface (Java API). (Servlet and CGIÂ development with ODWEK are deprecated and thus not listed here)
- The IBM Content Manager OnDemand Advanced Function Presentation (AFP) Web Viewer.
- The IBM Content Manager OnDemand Image Web Viewer.
- Java Line Data Viewer. Users can use the Java Line Data Viewer to view line data documents from a web browser.
ODWEK in Action:
Installing ODWEK is out of the scope for this topic, you may find the details for hardware requirements and steps for installation on documents available on ibm.com
We will focus here on setting up the dev environment on Windows system for ODWEK using eclipse or IBM Rational Application Developer.
1. It is recommended to place the ODWEK program files directory in the Windows PATHenvironment variable. By default, this directory is, C:\Program Files\IBM\OnDemand Web Enablement Kit.
2. In ODWEK V8.5.0 and newer on Windows, a 32-bit and 64-bit ODWEK Java API shared library is provided. The dependent ICU libraries used for code page conversion are located in the lib32 and lib64 ODWEK subdirectories. You must either place the subdirectory in the Windows PATH or move the respective files to a directory referenced by the Windows PATH (such as the ODWEK program files directory).
3. 32-bit ODWEK ICU files:
lib32/icudt44.dll lib32/icuin44.dll lib32/icuio44.dll lib32/icuuc44.dll lib32/icule44.dll lib32/iculx44.dll
64-bit ODWEK ICU files:
lib64/icudt44.dll lib64/icuin44.dll lib64/icuio44.dll lib64/icuuc44.dll lib64/icule44.dll lib64/iculx44.dll
4. Include ODApi.jar to your Java project and that’s it. You can now use ODWEK Java API in your programs. You must import the com.ibm.edms.od package into your ODWEK application.
IBM Content Manager OnDemand Web Enablement Kit functions:
ODWEK provides an interface to implement functions to do tasks like change a user’s password,search for a document, retrieve a document, add annotation, define search criteria, update document etc.
Sample Program:
Here I am putting an example source code for Java application. This example demonstrates the logon process, search for document(s) based on some criteria and then finally logoff. As the main purpose of this program is just to provide a quick working example, I have not done proper exception handling or logging.
import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; import com.ibm.edms.od.*; public class MySampleODApp {   public static void main(String[] args) throws Exception {     ODServer server;     ODConfig odConfig = new ODConfig();     server = new ODServer(odConfig );     server.setConnectType(ODConstant.CONNECT_TYPE_TCPIP);     server.setServerName( "NAME_OF_OD_SERVER");     server.setPort("PORT_INT_VALUE");     server.setUserId( "USERID" );     server.setPassword( "PASSWORD" );     server.initialize( "MySampleODApp" );     server.logon( );    //Print the folder names     Enumeration en1 = server.getFolderNames();     while (en1.hasMoreElements()) {      System.out.println("Folders :: " + (en1.nextElement()));     }     ODFolder folder = server.openFolder("STMT-FOLDER"); //If you already know the value use it directly. If not, you can get it from above code     Enumeration en = folder.getCriteria();     while (en.hasMoreElements()) {      System.out.println("ODCriteria :: "     + ((ODCriteria) en.nextElement()).getName());     }     ODCriteria odCriteriaClientId = folder.getCriteria("CustomerID"); //If you already know the value use it directly. If not, you can get it from above code     odCriteriaClientId.setOperator(ODConstant.OPEqual);     odCriteriaClientId.setSearchValue("CUST_ID_TO_SEARCH");     folder.search(); //Here we do the search based on folder and criteria defined in earlier steps.     Vector searchResults = folder.search(); for(int i=0;i<searchResults.size();i++){     Hashtable temp = searchResults.get(i).getDisplayValuesTable();     System.out.println("Found the document :: " + temp); //Getting all criteria info on document     }     //Clean Up     System.out.println( "Logging off..." );     server.logoff( );     server.terminate( );   } }
Happy Coding!![/vc_column_text][vc_empty_space height=”70px”][vc_column_text]