Home
Extended ECM
API, SDK, REST and Web Services
How to find a folder ID from a folder path
Gaurav_Sharma
Hi, I want to find the folder ID ( Livelink ID ) from a folder path ( which is a string ). I cant find a function or any utility which I can use to do the same. Please let me know if anyone has any suggestions.Regards,Gaurav
Find more posts tagged with
Comments
Appu_Nair
Are you saying that you have something likeEnterprise:Folder Level 1::Folder Level 2:Folder Level 3and you want to find out the objid of Folder Level 3 is this what you are trying to do ?if so if you do a search(lapi,xml search or standard search) for Folder level 3 you will get the objid with the parentage at least in xmlsearchapi.Run a test to find if the parentage matches your string and that should be it.I am sure xml has lots of built in bells and whistles to match things up.If you can somehow restrict the scope of the search you may probably eliminate a lot of false positives such as Folder Level 3 existing in many containers.Essenially "name","dataid" in dtree is what you are after and that has parentid in it,so again you go a level up ask dtree for that parentid's name all the way until you expend it.You will also find some irregularities when you encounter folders inside projects also.What database is you running on.This can be made fairly easily by a datbase function andd from lapi you can then call it as a LR too.
Gaurav_Sharma
Hi, yea, this is what I am looking for, I know the path, eg, Enterprise\XYZ\ABC I need to know the object ID of ABC. Using search I cant always be sure if I have the right ID ( there could be multiple folders there ). The database is oracle, how can that help ? please if you could explain on it.Thanks,Gaurav
Appu_Nair
Attached is a very simple java file which does (well I did not test it extensively)You run this like thisC:\javalapi>java GetNodeIDFromEnterprise Enterprise:Folder1:Folder2:Folder3:Folder4:Folder5:Folder6Enterpise workspace is called*** Enterprise Proceed with finding the childrenThis folder: Folder1 has a OBJID:214804This folder: Folder2 has a OBJID:214805This folder: Folder3 has a OBJID:214919This folder: Folder4 has a OBJID:214920This folder: Folder5 has a OBJID:214921This folder: Folder6 has a OBJID:214922DISCLAIMER// DISCLAIMER: PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED// OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS// TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE// PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,// REPAIR OR CORRECTION.WILL NOT WORK WITHIN COMPOUND DOCUMENTS,PROJECTS THAT MAY HAVE NEGATIVE DATAID'S AND VOLUMES