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!

Strucked in fetching Name and dataid for large number of objects

Status
Not open for further replies.

dheeya

IS-IT--Management
Jul 8, 2014
12
US
Hello everyone,

I am able to fetch list of object name and data id using ListObjects, This works if the folder has about 35000 objects.

But i have 70000 objects under a folder. My LAPI code struck and not giving any results.
Can anybody got such kind of issue. Any workaround please.

Below is my code

import com.opentext.api.LAPI_DOCUMENTS;
import com.opentext.api.LLNameEnumeration;
import com.opentext.api.LLSession;
import com.opentext.api.LLValue;
public class ObjID {
// public static final int MAX_SIZE = 100;
public static void main (String argv[]) {

try {
//Create a new Livelink Session
LLSession session;
session = new LLSession ("xx.com", 5000,"", "Admin", "Admin", null);
int objID = 34211244;

int volID = 0;
String viewName = null;
String queryStr= null;
LAPI_DOCUMENTS doc = new LAPI_DOCUMENTS(session);
LLValue children = new LLValue().setAssoc();
LLValue childrenNumber = new LLValue().setAssoc();

if (doc.ListObjects(volID, objID, viewName,queryStr , 0, children) == 0)
{

for (int i = 0; i < children.toValue("NAME").size(); i++)
{
System.out.println(children.toValue("NAME").toValue(i) + "|" + children.toValue("ID").toValue(i) );

}
}
}
catch (Throwable e) {
System.err.println(e.getMessage());
e.printStackTrace(System.err);
}
}
}
 
I am not sure I understand your situation but ListObjects will not do recursive things you have to do the recursion.if I assume that you have flat folder with a dataid of 12345 that contains 100000 objects sitting there no subfolders,you can outside of livelink use a tool that queries the database
for e.g select max(dataid),min(dataid) from DTREE where parentid=12345 note you can use webnodes also instead of dtree

then since you know that the enumeration has to happen between the lower and the higher bound your listObjects could be

nt volID = 0;
String viewName = "DTREE";
String queryStr= "where dataid >= 123456 and dataid <(add 10000 to the lower) ";
LAPI_DOCUMENTS doc = new LAPI_DOCUMENTS(session);
LLValue children = new LLValue().setAssoc();
LLValue childrenNumber = new LLValue().setAssoc();

if (doc.ListObjects(volID, objID, viewName,queryStr , 0, children) == 0)
{

simply put LAPI does not do pagination but webservices does,so it serves you right not wanting to change to the newer stuff from OT.
I have not tested any of these myself but listobjects call will do anything that is valid sql on the webnodes or dtree .Hence the idea


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
 
Hi Dheeya,

Even i am new to LAPI programing. Accoring to me you are facing the prblem because of for (int i = 0; i < children.toValue("NAME").size(); i++). According to me the int can hold value till 32k. Please try for (long i = 0; i < children.toValue("NAME").size(); i++) once and let me also know the Result.

Thanks & Regards
Bharath
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top