Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the Object id of list of folders

Status
Not open for further replies.

dheeya

IS-IT--Management
Jul 8, 2014
12
US
Hi ..

Can anyone suggest a method to fetch the object id of list of folders using LAPI.
I am having parentid "123456" and i have 10000's of folders under that. I have a name list of folders for those i need object ids.

Thanks!
 
Hi Dheeya,
These are some useful qureis for you

Select * from dtree where parentid='123456';

Insted of star(*) you can keep Dataid,Name inorder to get the list of folders inside this parentid

Select Dataid,Name from dtree where parentid='123456';


If you want to find the list folders in Livelink with similar name

Select * from dtree where parentid='123456' and name='foldername';
this will list all the folders below that parent id with that folder name

Regards,
Gopi
 
Thanks much Gopi !

Do you have any idea how to fetch data id of child elements using LAPI
 
Yes Appunair,

I tried using ListObject,

[highlight #D3D7CF] int docID = 434697472;
int volID = 0;
LAPI_DOCUMENTS dok = new LAPI_DOCUMENTS(session);
LLValue children = new LLValue().setAssoc();
LLValue childrenNumber = new LLValue().setAssoc();

dok.ListObjects(volID, docID, null, null, 0 , children);
dok.GetNumberOfObjects(volID,docID,childrenNumber);

System.out.println(children);[/highlight]
This is resulting me

V{<VOLUMEID,ID,PARENTID,USERID,GROUPID,USERPERM,GROUPPERM,WORLDPERM,SYSTEMPERM,PERMID,NAME,TYPE,SUBTYPE,COMMENT,CATEGORY,CREATEDATE,MODIFYDATE,EXATT1,RESERVED,RESERVEDBY,RESERVEDDATE,ORDERING,CHILDCOUNT,VERSIONNUM,ASSIGNEDTO,STATUS,PRIORITY,GIF,CATALOG,EXTENDEDDATA,FILENAME,FILETYPE,DATASIZE,RESSIZE,MIMETYPE,OWNERNAME,ORIGINDATAID,MAJOR,EXPORT,POPI,SHORTCUT,Permissions,MinorMimeType,rimsDocDate,rimsEssential,rimsOfficial,rimsRSI,rimsStatus,rimsStatusDate,ClassID>
<-2001,[highlight #FCE94F]441560349[/highlight],434697472,90620684,90749363,258207,258207,128,16777215,?,[highlight #FCE94F]00242973[/highlight],?,0,?,?,D/2013/2/3:12:56:30,D/2013/3/21:3:14:39,?,0,0,?,?,7,0,?,?,?,?,0,A<1,?,shortcut=fr_00242973>,?,?,?,?,?,admin_user,0,?,?,tt,fr_00242973,258207,?,205673,N,0,NO,CT,20130221,442589006>


I have 100000's of objects under the parent folder. i need only object name --> data id .

Can you advice if there is any way to fetch these values alone.
Or shall i extract using regEx

Thanks!
 
I am not sure I understand your problem.Livelink is a hierarchical arrangement of nodes see example

Enterprise(usually 2000)
My Folder(12345)
My second folder(35678)
if you use a SQL tool then if you join dtree and dtreeancestors you will be able to walk top dowm or bottom up.

LAPI is not a report generating tool saay you found that objectid 35678 then you could do an operation on it like copy,delete etc.


If you do ListObjects(2000) in my example you will get the record of 12345 and will not get 35678 as the listobjects will not recurse.
You have to write the recursion.Nobody uses lapi for the last two years or so hence you will find more efficient ways of node manipulation travesring etc if you use
web services.The LLvalue header you prited is a nmae value pair of a view(dtree) for that object.


If your db is oracle then you can simply join dtree and dtreeanscestors or even use Oracle's recursion
SQLserver has something called CTE's that will do recursion.

select name,dataid,subtype from dtree connect by prior dataid=parentid start with 2000 (saying from memory google connect by prior)



Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Yes but it is way more complicated to use Lapi list objects in a reporting project.
Sounds overkill when such a requirement can be gotten very easily via a straight sql query.
I could be mistaken because you might be doing node manipulation as well.For what its worth


Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Yes you are right,
Unfortunately we din't got sql access.

Anyways thanks for your guidance :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top