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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Folder Listings, need more efficient way

Status
Not open for further replies.

jdbolt

Programmer
Aug 10, 2005
89
CA
I recently wrote a Java test class which uses the ListObjects to get the file structure of a perticular area in LiveLink we use for storing approved project document.

At the moment I use the following sudo code:

For all folders in level 1 do

Get ObjectID

For all folders in Folder with ObjectID do

Get ObjectID

For all folders in Folder with ObjectID do

Get number files in folder

End for

End For

End for


Structure:



Level1 - (Archive)

- Level2.1 (Classes of documents; requirements, design docs etc)

- Level3.1.1 - Folder for each project

- This is where a class of document for a project is stored

- Level3.1.2

- Level3.1.n

- Level2.2

- More Folders

- Level2.n



We are ISO certified hence the rigid structure, just wondering if there was a more efficient way of doing this instead of embedding the for loops, at the moment it takes a VERY long time ( we are talking a minute +.

For instance can you use GListObjects() but specify how deep you want the results to be returned, i.e 4 iterations deep.

Projects and document classes are being added all the time and so I cant just miss out the first four for loops.

Anyhelp would be great!
 
The API provides support for you to call it against your view in livelink.Usually the iterations are performed on dtree
Code:
public  int  ListObjects(
                 int         volumeID,
                 int         objectID,
                 String      viewName,
                 String      queryStr,
                 int         permissions,
                 LLValue     children )
So I think if you had database expertise inhouse you could define your view and manipulate the result set.Also if you dinot know in the querystr you can apply a where condition in code it will be something like
(2001.1234,"dtree","subtype=0",0,children)


Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Ok, its a pretty big company I work for and company politics being what they are they wont let me touch the database on livelive, this is quite a small rpject I am working on.

if (doc.ListObjects(parentDirVolumeID,
parentDirObjectID,
"WebNodes",
"SubType=0", // Folder Type
LAPI_DOCUMENTS.PERM_SEE,
childDirs) == 0) {

I currently use that, is there no other method which allows you to, for instance have an input paremeter such as 'depth=3'?
 
No that is not a valid call.So you are using webnodes view here.Do you think you could make use of the psuedo column
"level" as we generally do in Oracle.I don't know how to do it just thinking out loud
In the worst case write a recursive routine yourself that gets out when it hits the level you want.

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
It seems to work for me, I have just found out about the XMLExport function, seems to work a little quicker, and the XML format will make display the information a little easier.
 
Apologize I didn't realize that you were evaluating the function call to zero.ChildDirs is your variable for holding output I reckon which in iteslf would be a llvalue object.XMLexport is also a good option.I believe you can specify levels and what not with it.Great job,good luck

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top