DAPI.GetNode('Sub Folder 1',projectNode) failed because
select * from DTree where ParentID=:A and Name=:B
does not work for projects as parentid = - dataid of project node... any workaround?
Thanks
Kevin
Hi,
Instead of DAPI.GetNode, use the GetNodeByID function of the DAPI class to get the desired project details.
DAPI.GetNodeByID ( prgCtx.DAPISess(), DAPI.BY_DATAID, <projectID>)
and if listing out the contents of your Project is what you want, have a look at the ListContents function of the DAPI class.
Thanks,
Pramod
I'm trying to locate a node within a project with full path from project (subtype 202) root.
For example:
Enterprise Workspace
My Project
Level One
Level Two
My doc
I'm trying to locate "My Doc" with this:
DAPI.GetNode('Level One:Level Two:My doc',projectNode)
Got an error, because DTREE.PARENTID of "Level One" is not DATAID of "My Project", but -DATAID.
Instead use the GetNode() like this:
DAPI.GetNode( 'My doc.docx', folderID )
where folderID is the DataID of the folder in which this document resides within which in your case will be the DataID of the Level Two folder. Get this using DAPI.GetNodeByID().
CS10 Update 9
The path from project root is the only information I have.
Yes I could list contents for project, then use path with first element removed, then use first level folders as start node,..... that's not a good solution, is it?
Given the nodeID of the project and the name, using the correct language and the name you can use the following query
SELECTwnm.DataID,wnm.NameFROM DBrowseAncestorsdba INNER JOIN WebNodesMeta_en_CA wnm ON dba.DataID= wnm.DataIDWHERE AncestorID = 216157 AND Name= 'qwerty'
In this case:
<![if !supportLists]>- <![endif]>216157 is the id of the project
<![if !supportLists]>- <![endif]>'qwerty' is the name being looked for
<![if !supportLists]>- <![endif]>WebNodesMeta_en_CA is the language specific metadata
This can return multiples so that needs to be checked
David
From: eLink Entry: Content Server Builder Forum [mailto:componentbuilder@elinkkc.opentext.com]Sent: Monday, April 29, 2013 6:43 PMTo: eLink RecipientSubject: Using DAPI.GetNode in a Project
Using DAPI.GetNode in a Project
Posted bypramod.mohandas@cognizant.com (Mohandas, Pramod) On 04-29-2013 18:42
DAPI.GetNode('My doc.docx', projectNode)
where projectNode is the DataID of the folder in which this document resides within which in your case will be the DataID of theLevel Two folder using DAPI.GetNodeByID().
[To post a comment, use the normal reply function]
Topic:
Forum:
Content Server Builder Forum
Content Server:
Knowledge Center
Hi David,
Your solution can find a folder named 'qwerty' in the given project root. As you said, it can yield multiple results ("my project : folder 1 : qwerty","my project : folder 1 : folder 2 : qwerty" etc). It then takes additional effort to get the one I want, not desirable performance wise. The input I have is path from project root that can uniquely locate the node within the project.
Guess my workaround has to be direct SQL to get direct children of the project, then use DAPI.GetNode from there?? Is DAPI.GetNode supposed to support project?
Read it
R.S. (Bob) Little
Waterloo
B2.236 (Mario Lemieux)
x. 2844
This email is confidential and legally privileged. If you are not the intended recipient, please notify me at the telephone number above or by reply email and delete this communication and any copies immediately. Thank you.
From: eLink Entry: Content Server Builder Forum [mailto:componentbuilder@elinkkc.opentext.com]Sent: April-29-13 6:15 PMTo: eLink RecipientSubject: Using DAPI.GetNode in a Project
Posted bypramod.mohandas@cognizant.com (Mohandas, Pramod) On 04-29-2013 18:12
Instead of DAPI.GetNode, use the GetNodeByIDfunction of the DAPI class to get the desired project details.
Volume objects like Projects, Compound Documents ( release and revision part ) are LLNODE constructs and are not known the deeper DAPI api. So if you have the project root, and do anything with it the DAPI layer can only see the sub projects in there since they are the only one as direct children.
That being said, there you can recognize that you are dealing with a project, flip the data and do the GetNode. In the end there will be work. I am sorry there is no simple answer. For the other calls, DAPI.ListNodes also needs the correct start point as well, the –ve of the project root.
As for the multiples, sure, but at the same time according to the DAPI.Getnode will only return the immediate child from the path provided it doesn’t go down multiple levels, it is relative from the path provided. At least that is what the docs indicate, would need to test and verify
DAPINODE GetNode(
String namePath,
DAPINODE startNode,
[Boolean autoExpand ] )
Retrieves as specified by name or relative path.
For example, get a child node named 'A' by specifying 'A' for namePath, or get a grandchild node named 'B', which is a child node of 'A', by specifying 'A:B' for namePath.
If you are wanting to traverse multiple levels then you are likely to get multiple hits. That was your original example.
From: eLink Entry: Content Server Builder Forum [mailto:componentbuilder@elinkkc.opentext.com]Sent: Tuesday, April 30, 2013 9:09 AMTo: eLink RecipientSubject: RE Using DAPI.GetNode in a Project
RE Using DAPI.GetNode in a Project
Posted bykevin@linkecm.com (Lin, Kevin) On 04-30-2013 09:02
ListNodes only returns direct children of the project root. I have a path that only DAPI.GetNode supports.
David,
Did the following test on CS10 update 9,
DAPI.GetNode('Level One:Level Two:My doc', normalFolder) => Worked
DAPI.GetNode('Level One:Level Two:My doc', projectNode) => Failed
Can we say this is bug?