Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
How to get the ObjectID from the name of the folder in LAPI
Mahesh_Pinnamaneni
Any idea how can we get the ObjectId from the name of the folder or document via LAPI???
Find more posts tagged with
Comments
Appu_Nair
Mahesh, Name is dtree.name and objid is dtree.dataid.In lapi there is not really a function that will give you that.However look at the callGetObjectIDByNickname( String nickname, LLValue objectID )I believe nicknames are unique in the database.I would test this by creating a folder called "Myfolder" in one pparentid and another folder called "Myfolder" in another parentid and use the GetObjectIDByNickname to see if you are getting unique values.By default the nickname for any object is the stringified objectidOther wise a search or LR that looks for select name,dataid from dtree where name ="your name" should give you stuff but how can you reconcile whether or not it is the dataid that you are looking for
Mahesh_Pinnamaneni
Yes, I mean the dtree.dataid. I need to pass the Foldername and parent id if it accepts and i should get the dataid of that folder.it is quite unfortunate that we don't have this function in LAPI.
Appu_Nair
so can't you use livelink search,lapi search or serachxmlapi.all of them would take scope as your parentid albeit as a name and search on whatever you are searching for and give you its dataid?
Carsten_Kulms
Message from Carsten Kulms via eLinkYou can use the "queryStr" parameter of the ListObjects function.----8<--------8<--------8<--------8<----queryStr the limiting criteria defining a subset of child objects toreturn; it should be structured as the condition of a valid SQL WHEREclause, using any of the defined column names (either from the standardreturn RecArray or the custom view specified by the viewName parameter);to return all child objects, specify a NULL value (0 for C++; VBNULLSTRING for Visual Basic; NULL for Java) ----8=--------8=--------8=--------8=----[Livelink API Developer's Reference Guide: Library API]Attached you find a small Java tool(*) to play with the ListObjectsfunction and its various parameters.E.g. to retrieve the data of a node with the name "NAME" under theparent folder with the id 1234 you would call it as follows>java ListObjects -ho {host} -po {port} -u {user} -pa {pwd} -node 1234-vol 0 -where "Name='NAME'"----(*) DISCLAIMER: PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHEREXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THEENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITHYOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALLNECESSARY SERVICING, REPAIR OR CORRECTION.