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!

LAPI- folder creation 1

Status
Not open for further replies.

hanreb

Technical User
Jan 23, 2008
90
US
Hi,

In LAPI is there a way to create a directory structure dynamically.
For example, if we want to create subfolders may be 10 levels, is there an easy way to do it dynamically thru my LAPI program, rather than getting the volume id and object id at each level and repeating all the steps.

For e.g,
I want to create a directory structure(folder structure)

test
|
test1
|
test2
|
test3 and so on

so can we give something like test:test1:test2:test3 etc. in the createFolder command as a parameter, which will create the directory structure as described above.
Heard that some application which uses LAPI, uses this technique.
Looking forward to know how I could implement this.

Thanks,
Sunu
 
I don't think this is a lapi quality(however slapi and easylapi are two freebie modules that ou can download
and play with from KB).The create dir structure is a afeture of ObjectImporter.Object Importer is a set of XML files and a setting in it says crete dir structure if it does not exist.Synatax may not be entirely correct but for you to get an idea.

Code:
<node  type="folder" action="create">
<location>Enterpise:test:test1:test2</location>
<name>test3</name>
<categories >blah blah</category>
</node>
In this case if the setting "create Dir structure" is set then the code firts goes to Enterprise checks if test is available all colon:)) are folder separators in livelink and gives you the final thing.Liveink employs the recursive routine for you in oscript,I belive this can be done by writing a clever lapi function as well:)



Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 

Thank You appnair for the info.
I would really like to implement this.
So, the piece of code that you had put in is something to be written in a .xml file, right ???
Right now in my LAPI code, every time I am checking to see if the folder that I want to create exist if not, I create it, get the currently created folder's object id and create the next folder using createfolder.This seems to be really time consuming. I will look into KB, if I could get some info.
I really have some starting trouble, figuring out have to start implementing this in LAPI. If you have any more tips,please let me know.

Thanks for your continued help,
sunu
 
the object importer is a module that you purchase and put on the livelink server.it uses oscript not lapi

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Hi appnair,

I was just referring to the part in the previous thread where you said, "I belive this can be done by writing a clever lapi function as well:)".
So, there, did u mean to invoke object importer thru LAPI ?

I basically have a java program invoking LAPI functions.
Do you think I can implement this directory structure separated by colon:)) in my java program, in some way, I don't know that part, . Did u mean to invoke object importer thru LAPI.

Thanks,
Sunu

 
I think you misunderstood me.LAPI cannot be called to do any OI stuff.What I meant was you could write a java program that did this yourself.Your inputs could be
a string that indicates the location separated by a character probably colon.
Your function could then use the same,does the next folder exist ,No then let me create that and pass that objid to the next and so on,that is exactly what the OI code does under the covers.In my programming experience I had to do these kinds of things before so I don't think of it as a very heavy task....
I know this does not help you immediately but something to think about....

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Appnair,
Thanks again for responding back.
Yes, as you mentioned I was thinking that I could invoke OI function thru LAPI. I did not know that under the covers OI is doing the same task as we could do in LAPI like
get object id, create folder, get its object id and create the next folder,so on and so forth.

Now the main reason for all these questions is
I have a batch job running that will
1) create hierarchy of folders dynamically
2) upload a .pdf document into the specified folder,


The above job seems to take a long time to upload say 2000 docs it takes may be 10 hours,
so , do you have any idea what could be the performance issue here.
Thanks,
sunu
 
The reason why any document creation task looks long is because of several reasons.
a)You need to dedicate a LL server to do batch uploads.We had several dedicated OI servers.Otherwise your lapi code is probably in the queue while the others are doing stuff.
b)Your implemantation rules.How many categories per object created and how many leaves in each of the category.Typically you get 1 doc per second.As you attach a category say having five attributes 6 inserts into one table and 1 insert into another table with a lot of other inserts happeing in a lot of other tables.On top of it if the lapi user is not a sys privileged user the livelink will *CHECK* node creation at each and very transaction
c)My OI XML files were doing 1 doc per second it went to almost like 1 document in five seconds as more and more cats/atts were applied to it.Anyways the only good thing about OI is it runs under the "admin" context so there is no permissions checking.
d)Also touch base with your ll admin.When doing batch jobs the notifications subsystem swell and it leads to a bunch of irate users wo will complain of notification lateness.We had OT give us a patch so we could "EXCLUDE" certain folders from invoking a notificataion overload.

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
 
Thanks Again for your comments.
I really appreciate it.
Will look into the issue of dedicating an LLServer.

Thanks,
Sunu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top