Hi,
I was wondering if there was a way to get the entire list of ParentNodeIds (all the way up to the enterprise node) for a given NodeId with a single call. Right now I get it using recursive calls but this is time-consuming.
Thanks
Not that I’m aware of, but if theitem is indexed, the OTLocation region in the search index will store the fullparentage as DataIDs up to the root node, separated by spaces.
-- Kyle
I'm afraid that Kyle is right. You may want to create a feature request to have DocumentManagement.getNodePath(int nodeId) implemented in the next version. (getNodeByPathgetNodeByPath.getNodeByPath(int rootId, string[] path) is already there.)
Actually, I'm going to implement exactly this getNodePath for the product CLM Services for SharePoint in its Livelink module. I want to have it in a single Livelink call not to issue multiple calls over the network. The OTLocation looks like a nifty workaround. Is it possible to get the value of this region in OScript if I know the nodeId without involving the full-blown search query? Would it be faster than climbing the node three by DAPI? Thanks. It will be problem if the index is not up-to-date but still, an interesting option to consider.
--- Ferda
If you can’t guarantee that an itemhas been indexed by the time you query the system, then the search workaroundwon’t help here.
Remember, the node could be excluded fromindexing or stuck in the data flow…
The only way to get data out of the indexis via a search, so knowing the node ID #, a search against OTDataID:# wouldtarget just that node.
For a very large number of nodes meeting acertain criteria (e.g., within a volume or below a certain folder), a searchcould return this quicker than individual calls, provided your searcharchitecture is up to par.
However, we also have DB tables likeDTreeAncestors that, if properly populated (there were issues with olderversions of the Recommender module), could be used to very quickly obtain theparents via a SQL query, as that table is a flattened view of node hierarchy.
I would have recommended using aLiveReport to query DTreeAncestors for you, but unfortunately, the currentrelease of EWS does not support the execution of LiveReports.
_________________________________________Kyle SwidrovichPrincipal Search / SDK Product SpecialistLivelink Escalations Support TeamOpen Text Corporation275 Frank Tompa Dr.Waterloo, ON, CANADAPhone : +1-800-540-7292Online: http://support.opentext.com_________________________________________
DtreeAncestor is not a solution for this problem, because youdon’t know the order of the parents.
It is ideal to determine if a node is the parent of anothernode, but not to determine the path.
Creating your own web Service wrapper around the LLNode.NodeFullPathfunction is probably the best.
Hans
From: eLink Entry: Enterprise Web Services 9.7.1Forum [mailto:otdnenterprisewebservices971forum@elinkkc.opentext.com] Sent: Dienstag, 20. April 2010 21:13To: eLink RecipientSubject: RE RE How to get hierarchy of ParentNodeIds for a given NodeId
RE RE How to get hierarchy of ParentNodeIds for a given NodeId
Posted by kswidrov (Swidrovich, Kyle) On 2010/04/20 15:12
If you can’t guarantee that an item has been indexed by the time you query the system, then the search workaround won’t help here.
Remember, the node could be excluded from indexing or stuck in the data flow…
The only way to get data out of the index is via a search, so knowing the node ID #, a search against OTDataID:# would target just that node.
For a very large number of nodes meeting a certain criteria (e.g., within a volume or below a certain folder), a search could return this quicker than individual calls, provided your search architecture is up to par.
However, we also have DB tables like DTreeAncestors that, if properly populated (there were issues with older versions of the Recommender module), could be used to very quickly obtain the parents via a SQL query, as that table is a flattened view of node hierarchy.
I would have recommended using a LiveReport to query DTreeAncestors for you, but unfortunately, the current release of EWS does not support the execution of LiveReports.
_________________________________________ Kyle Swidrovich Principal Search / SDK Product Specialist Livelink Escalations Support Team Open Text Corporation 275 Frank Tompa Dr. Waterloo, ON, CANADA Phone : +1-800-540-7292 Online: http://support.opentext.com _________________________________________
[To post a comment, use the normal reply function]
Topic:
How to get hierarchy of ParentNodeIds for a given NodeId
Forum:
Enterprise Web Services 9.7.1 Forum
Livelink Server:
knowledge-wlweb01
Hmm, it looks like that the search would not be the right (reliable) way for this. Thanks for the extra informaton about the search - I will come handy at the right time.Thanks for the hint about the LLNode.NodeFullPath. (I should sieve through the LLNode myself next time...) I'm going to base my method on it. You will be able to use it if you install CLM Services 10.3 :-) --- Ferda
I've logged a feature request to implement a method like LLNode.NodeFullPath() as part of the DocumentManagement service.
Thanks,
Scott
Thanks for the tips everybody. Have resorted to using the DB for the time being.
Scott, thanks for adding it as a formal request of the DocumentService.
Try this, if using Oracle:
select dataid, name, sys_connect_by_path(name,':') as "Path" from DTree start with parentid=2000 connect by prior dataid=parentid