Thursday, February 2, 2012

IBM DB2 Content Manager Library Server Database ICMNLSDB linking table for custom reports

Tested on IBM DB2 Content Manager version 8.3 and 8.4.

IBM DB2 Content Manager's database ICMNLSDB can be used to fulfill different requirement like custom reporting or to change item links manually.

Though it is not recommended but, still, if a requirement occurs, feel free to use the database directly. (at your own risk).

ICMSTLINKS001001 is the name of the table that contains information about the heirarchical linking of the items.

Example:
Suppose there are two item types.
1. MyFolder       (Folder)
2. MyItem         (Folder or Document)

- An item is created having type MyFolder.
- Another item is created having type MyItem.
- MyFolder contains MyItem i.e. MyItem(Folder or Document) is inside MyFolder(Folder).

Assuming Item Types are simple and not complex.
- One table will be created for each Item Type. (something like ICMUXXXXXXX ... not important)
- One view will also be created for each Item Type. (like MyFolder001 and MyItem001, important)
- Each view will have a column named ITEMID


- ICMSTLINKS001001 table have two important columns TARGETITEMID and SOURCEITEMID
- A join can be made as below

select * from MyFolder001 folder
inner join ICMSTLINKS001001 link
on folder.ITEMID = link.SOURCEITEMID
inner join MyItem001 item
on link.TARGETITEMID = item.ITEMID

 
where
- MyFolder001 is source
- MyItem001 is target


I tried to keep this post as simple as possible. Ofcourse, there are other things to consider like version, link type e.t.c.

java.lang.IllegalArgumentException: FMC38009E MQSeries Workflow API Error : API Return Code : 142 Error Origin : FmcProfile.java:182 Error Message : FMC00142E Profile not found for configuration ''default''.

java.lang.IllegalArgumentException:
FMC38009E MQSeries Workflow API Error :
    API Return Code  : 142
    Error Origin     : FmcProfile.java:182
    Error Message    : FMC00142E Profile not found for configuration ''default''. 
    Nested Exception : None
    at com.ibm.workflow.api.Agent.getAgentImplClass(Agent.java:406)
    at com.ibm.workflow.api.Agent.setLocator(Agent.java:274)

Reason:
The fmcrc file cannot be found.

Solution:
fmcrc file and MQ library files should be in the same classloader.
e.g. If you have MQ library files in WEB-INF/lib folder, then fmcrc should be in WEB-INF/classes. If you are using Rational Application Developer (RAD) then keep it in src (Java Source) folder, RAD will copy it in WEB-INF/classes when you'll build the project.