Hi
I am desperately trying to display a document tree using LAPI from Java. I wrote a recursive method which traverses the tree. This works fine except for nodes with a subType of 'Project'. It seems as if these nodes do not have descendants.
However, when I use the XMLExport method to create an XML export of the document tree all descendants of the Project nodes are included. What I have noticed is that all the parentIds of the project node descendants are negative here.
Anyone has a glue why this is the case? How can I modify the method below to traverse also the project nodes?
Thanks
Bernd
I am desperately trying to display a document tree using LAPI from Java. I wrote a recursive method which traverses the tree. This works fine except for nodes with a subType of 'Project'. It seems as if these nodes do not have descendants.
However, when I use the XMLExport method to create an XML export of the document tree all descendants of the Project nodes are included. What I have noticed is that all the parentIds of the project node descendants are negative here.
Anyone has a glue why this is the case? How can I modify the method below to traverse also the project nodes?
Thanks
Bernd
Code:
private int parseTree( int parentId )
{
int nodesVisited = 0;
LLValue node = new LLValue();
documents.ListObjects( volumeID, parentId, "DTree",
null, LAPI_DOCUMENTS.PERM_FULL, node );
LLValueEnumeration enumVal = node.enumerateValues();
while( enumVal.hasMoreElements() )
{
LLValue element = (LLValue) enumVal.nextElement();
nodesVisited++;
String name = element.toString( "Name" );
int id = element.toInteger( "ID" );
int pid = element.toInteger( "ParentID" );
int subType = element.toInteger( "SubType" );
log.debug( name + " (id=" + id + ";pid=" + pid +
";type=" + subType + ")" );
nodesVisited += parseTree( id );
}
return nodesVisited;
}