****************************************** ***START UPDATE 10/3/2016*****************
LAPI and its client installer has become very hard to find. Moreover clients written in LAPI in say Java/.NET will only work if your Livelink a.k.a Content Server is of version less than CS16.Readers who are new to LL programming is encouraged to read this to the approach and not to the exact lines of the code.What I mean is when you used to program in LAPI you were basically passing parameters to discrete calls by modelling it based on the webgui of livelink .SOAP based webservices called CWS is also the same,so if you do not try to do the task in the webgui and try to understand the business rules you will almost have no success in CWS too. OT is notorious for not putting fully functioning use cases and a walk through,so whenever possible I write code assuming the user has not worked in Livelink for X number of years and try to educate you all. Livelink,Content Server,Enterprise Server all of this has been Livelink’s marketing brand name changes over the years.CS i sused in many of the integrations like AGA, XECM, RMLINK and you know you are programming against livelink if you see a link that looks like this http(s)://somefriendlyURL/livelink.exe|cs.exe|llisapi.dll|cs.dll|livelink.In many places SAP/ SP /Exchange will be configured to talk to Archive Server and then they will use Livelink to read into archive server and turn that into LL objects for better presentment/RM and other aspects. The AGA product is moving away from LAPI(not sure totally or not) to REST API in LL.
**********************************************END UPDATE****************************
Recently a friend started doing some stuff in lapi and got extremely confused. So I wrote this to alleviate the confusion and some common business rules people forget when they are programming in Livelink albeit oscript, lapi or web services.
Category-A template object of subtype 131 which again is a versioned object. If you find one and open up it with ascii editor like textpad you will see a lot of Livelink geek speak which we call assocs (asosh…)
Why does Livelink need it? So that people can create easy to understand metadata templates and search on them without resorting to developers or sql based reporting. It is so easy to create re-usable search templates in Livelink.
If I change the category definition from a version that is 8 and added a new field that is mandatory can I work it in
it really depends on your prowess. The minute the category was changed and the person submitted the change a new version of the category was added, all your objects that were “TAGGED” with that metadata template has become obsolete. This is when you see the “UPGRADABLE” icon. You can do it form the folder or form the category object. It will take some time. There are some best practice documents in the KB.
Common problem is if the container has the old category and if you or a program tries to add a new document with that category. Regardless of version you want to use Livelink is adamant it will want to use the new version. So you could run into 2 major problems, you cannot put that document unless you upgrade the category on the folder, or even after upgrading you are not supplying the mandatory value. Folders newly created will not want to insist on the mandatoriness although it is something you can change.
I have written lapi and oscript routines to handle all these situations.
Can you create a Category Subtype with lapi- sure but most of the time administrators do the category creation/updation etc, most of the time programmers are entrusted with the data part or “APPLYING THE NEW VERSION OF THE CATEGORY TO EXISTING OBJECTS”
I cut and pasted this from the code I put there
/*
HUGE DISCLAIMER
THIS DOCUMENT IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS “AS IS”
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SAMPLE CODE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. BY USING THIS CODE YOU AGREE TO THE ABOVE TERMS.
*/
/* Appu Nair 10/16/2012
* Tested on Visual C# express on 64 bit Windows 7 against a Livelink 9.7.1 VM
* My project has been downgraded to .NET2.0 and I copied lapi dlls form another place
* I also added vjslib wjhich i found that I had installed here C:\Windows\Microsoft.NET\Framework\v2.0.50727\vjslib.dll
* Written to illustrate the user who was on this https://knowledge.opentext.com/knowledge/cs.dll/open/30474852
User wants to create a document and add 2 categories to it
Starting user’s please understand this a category object is a subtype=131 object which is a versioned object in Livelink
So when you look at a category in your system Assume the definition now contains something like ths.So in Livelink if you look at this category
*asuume it has a defid(dataid,objid) of 123456 and is version 210.Yes they took 209 attempts to come up with this category
*THIS PROGRAM DOES NOT CREATE THE CATEGORY OBJECT I DID THAT USING THE LIVELINK GUI.THIS IS ABOUT APPLYING A METADATA TEMPLATE TO OBJECTS
*IN LIVELINK SO PEOPLE CAN SEARCH ON IT LATER.
* My SAPCategory
* Name TEXT 32 CHARS
* AGE NUMBER
* GENDER TEXTPOPUP VALIDVALS={‘Male’,’FEMALE’}
*
* Assume your manager has asked you to
* make the category with a new TEXT field called ‘SAPCOSTCENTER’ and asked to make it manadatory.You did that and magically the new category version is
* now at 123456 version 215.
* My SAPCategory
* Name TEXT 32 CHARS
* AGE NUMBER
* GENDER TEXTPOPUP VALIDVALS={‘Male’,’FEMALE’}
* SAPCOSTCENTER TEXT mandatory 32 CHARS
*
* Now let’s look at it on run time. Livelink could care less if defaults were used when it encounters mandatoriness
* on folders or containers. The behaviour can be altered but no sane company does it.But Livelink will cry foul when this happens either from
* the gui or a program.
* Assume folder id called 109876 has the category version applied 123456:210 that is not upgraded. You say in your program to add a document with category
* 123456.Livelink once a category has been upgrded will force you to use the most current version. In this case your attempt will fail because it does not want
* you to create a document here with 123456:215 applied to a folder that has 123456:210.Moral of the story is if a category was upgraded it is the
* Livelink administrations job to make sure to pass it down to where it is used. Going by the same token if the sapcostcenter was mandatory and you
* did not supply an initial value you cannot get it to stick on the object. So more programming and intelligence need to be applied in your design
* In this e.g I will have another category with this characters
* MY IXOSCategory
* ArchiveID TEXT 6 CHARS
* DOcID NUMBER 64 chars
*
*/
If anybody was interested in the code that I developed for my friend it is here
“GOOD LAPI SNIPPETS FREE FOR REGISTERED USERS”
and under the link that says “How to Add more than One Category to a Object with LAPI”
Good post. I learn something totally new and challenging on websites
I stumbleupon on a daily basis. It’s always helpful to read content from other authors and practice something from
other web sites.
Hello to every body, it’s my first pay a visit
of this weblog; this blog contains amazing and genuinely good material
designed for readers.
It’s really a cool and useful piece of information. I’m happy that you shared
this helpful information with us. Please keep
us up to date like this. Thank you for sharing.