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 in Visual Baisc 6 help using Cats/Atts 1

Status
Not open for further replies.

ctully

IS-IT--Management
Oct 7, 2004
7
CA
I am trying to create a utility that will load documents to Livelink and then a assign a category and associated attributes to the loaded document.

I am at the point where the document is loaded and I have the nodeid, but I cannot seem to get the code that will assign the attribute to work. Does anyone have any sample of code that will do this (i.e. knowing a nodeid, assign cat/atts to an object)?

Thanks
 
what I think you will have to do psuedo code.You cannot use
AddDocument but you will have to use CreateObjectEx if you wanted category and attribute manipulation

Code:
LL_CreateObjectEx( volumeID, objectID, LAPI_DOCUMENTS.OBJECTTYPE, LAPI_DOCUMENTS.DOCUMENTSUBTYPE, catName, createInfo, objInfo );
createInfo is a LLVALUE obj with three assocs This is in the LAPI docs.I do not have a VB sample but I do have a java sample you could use.
createinfo.Categories is the assoc you need to populate for the call to work,so should createinfo.request,createinfo.requiredattributes come into play when your livelink sytem has addditional or system attributes which are different from the normal cats and atts
mail me at appoos@hotmail.com if you want the java sample.Also I do not know how you are designing ,but are a you allowing inheritance of the category etc,which version of it and so on


Always acknowledge a fault. This will throw those in authority off their guard and give you an opportunity to commit more.
Mark Twain

appnair

 
I actually would prefer to add the cats/atts as a second step after the document is added to livelink suing the AddObject function. Knowing the node id, what functions can then be called to locate a category, apply it to the object and assign the attribute values?
 
here you go
Code:
Long     LL_SetObjectAttributesEx( _
                   ByVal       session      as     Long, _
                   ByVal       objID        as     Long, _
                   ByVal       catVersion   as     Long )

catVersion a value object of type Assoc (initialized using the ValueAlloc function) that contains the category attribute values set by this function.

Always acknowledge a fault. This will throw those in authority off their guard and give you an opportunity to commit more.
Mark Twain

appnair

 
I think I am getting close. I can assign a cat and atts. However, when I run the following code, the diplayname is always returned as empty. Any ideas?


lstatus = LL_ValueAlloc(DocInfo)
lstatus = LL_ValueSetAssoc(DocInfo)
lstatus = LL_AssocSetInteger(DocInfo, "ID", lNewNodeID)
lstatus = LL_ValueAlloc(CatList)
lstatus = LL_ListObjectCategoryIDs(DMSSession, DocInfo, CatList)

lstatus = LL_ValueGetLength(CatList, lCatCount)
MsgBox "Category Count: " + str(lCatCount)
If lCatCount > 0 Then
lstatus = LL_ValueAlloc(CatInfo)
index = 0
lstatus = LL_ValueGetIndexValue(CatList, indexCatInfo)
lstatus = LL_ValueGetLength(CatInfo, lCatLen)

If lCatLen > 0 Then
lstatus = LL_AssocGetString(CatInfo, "DisplayName", fieldvalue, 256, lCatLen)
DisplayName = Left(fieldvalue, lCatLen)
MsgBox "Display Name: " + (DisplayName)

....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top