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

Merging Categories? 2

Status
Not open for further replies.

DrDDT

Technical User
Apr 6, 2005
88
NL
Hi!

We have several categories, with the same attribute 'country'.
In Livelink 8 we could search all the country attributes at once. In livelink 9 that's no longer possible.

To solve this I'd like to merge the categories into one category. What is the best way to do this?

We're currently on 9.2 but planning to upgrade to 9.7.1.
 
You can do multicategory searching in 9x, but for simplicity I'd recommend creating a short LAPI program to find all the documents with the existing Categories on them and then add the new "Country" category to these objects.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Thanks for the reply.

Is there any way to automate the multicategory search?
Users are used to one country field, that searches over all country attributes in all relevant categories.

For the merging part: Is there any way to do it without LAPI?
I can write livereports/webreports, but I'm no LAPI programmer.
 
If you know what the other categories are you should be able to create a search criteria to include those in your code.

You could perhaps amend the DB directly via a LiveReport, but I would STRONGLY advise against that as there could be lots of fallout.

As for WebReports or the specifics of the LAPI code, I'll leave others, who are more knowledgeable in those parts to provide more detail.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Hi,

Does anyone have example code I can use, preferable C?
I do have extensive Livelink knowledge, but I've never used LAPI before.
 
The code samples for LAPI are in the KB.Since you said C the closest I can think of is programmin in C++.I do most of my lapi work in Java and nowadays C# because they are almost identical.There are a lot of community example in java,C# and VB.NET in the communities website also.

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
 
Thanks,

I just managed to create some very basic Lapi code.

Another question:

How would I use Lapi to do the following:

1. Get all documents with certain categories applied.
2. For all found nodes, create new category
3. Fill new category with data from found category.

Can you do step 1 directly from LAPI, or would you use a Livereport, en use the results with the LAPI code?
 
1. Get all documents with certain categories applied
Run a sql report that goes something like this reaserch the filters correctly or create a view so that it will not hang your lapi program.

select id,defid,defvern from llattrdata where defid=<category you wantt to manipulate>

Check the table.If you write a LR here LAPI will give it back to you as a RecArray and you will waste time pasring thru it.The id that you get is the handle for the lapi document objects so you could do things like
doc.ChangeMyOldCtaegoryToNew......

For each nodeid found you should ask livelink what is the version applied it is the old version now.You should now call upgrade on the category object that has your country field added.So think of it as livelink giving you the structure that is sitting in the category volume.Now using your logic you should take each value of the attribute in the oldeversion add it on this new template with country.
If you are adding a new category then this is not needed.You should do a FetcVersion of the category and update the object info

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
 
Thanks for the help sofar.

I have a little trouble understanding the LAPI structure.
The (very few) code examples on the knowledge centre are not very helpfull for the beginner.

Are there any other sources for sample code, preferably C(++)?
 
this one at the KB is probably worth a look

It basically works like this and all lapi stuff works like this.

You need code to get into a livelink server.
To do anything with library objects such as add document,addctaegory etc you need a LAPI_Documents objects.
Similarly for doing workflow you need a different lapi object and for search or users & groups.

All the example is trying to show how you can manipulate a hardcode livelink document object 3947 to which a category object 4176.The cats atts sample that you will find in greg's site is creating a category object from scratch.

I would certainly download the free C# stuff from Microsoft or the free java as C++ is not something that I want to mess with.



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
 
Thanks for the help sofar.

I'll download C# express, and try using that.
Seems that C++ is not used very much anymore. It seemed like the logical choice to me since I initally learned programming in C(++)
 
well if it s a new livelink 9.7.1 you also have the option of coding in webservices as I am told that is the future.For the time being I 'm happy with LAPI and oscript.Will cross that bridge when the time comes

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top