Help with dealing with document parts in Java API

105 views
Skip to first unread message

dovver

unread,
Nov 9, 2006, 5:08:51 AM11/9/06
to IBM Content Manager
My problem is this, I have a class file that retrieves scanned images
from the DataStore, some of these are in multiple parts. I can grab
each part individually and ship them off to icmviewer but I'd like to
be able to ship all the parts straight into one icmviewer. Say if
there's 4 parts to a document my code opens 4 icmviewers, this is
annoying. Here's a code snippet from what I'm using at the moment.

dsICM = new DKDatastoreICM();

dsICM.connect("ICMNLSDB", user, pass, "");

String query = "/'PBTRUST'[@ITEMID = \""+itemId+"\"]";

DKNVPair options[] = new DKNVPair[3];
options[0] = new DKNVPair(DKConstant.DK_CM_PARM_MAX_RESULTS, "1");
options[1] = new DKNVPair(DKConstant.DK_CM_PARM_RETRIEVE, new
Integer(DKConstant.DK_CM_CONTENT_ATTRONLY));
options[2] = new DKNVPair(DKConstant.DK_CM_PARM_END, null);

dkResultSetCursor cursor = dsICM.execute(query,
DKConstantICM.DK_CM_XQPE_QL_TYPE, options);

DKDDO ddo, part;
DKPidICM apid;
DKLobICM lob;
short dataid;
DKParts dkParts;
dkIterator iter;

while((ddo = cursor.fetchNext()) != null)
{
ddo.retrieve();
dataid = ddo.dataId(DKConstant.DK_CM_NAMESPACE_ATTR,
DKConstant.DK_CM_DKPARTS);
dkParts = (DKParts)ddo.getData(dataid);
iter = dkParts.createIterator();

while(iter.more())
{
part = (DKDDO)iter.next();
apid = (DKPidICM)part.getPidObject();
lob = new DKLobICM(dsICM);
lob.setPidObject(apid);
lob.retrieve();
lob.setInstanceOpenHandler("c:\\program
files\\ibm\\cm82\\client\\icmviewer.exe", true);
lob.open();
}
}


As you can see, this will open an instance of icmviewer for each part,
I'm just lost on how to join these parts together into one document, it

makes it harder that I'm having to code this in notepad as we don't
have a Java IDE at my work and are not allowed to use freeware IDE's.

And help would be much appreciated.

Reply all
Reply to author
Forward
0 new messages