Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Category Upgrade
Sherman_Mei_(GOLSAC01Admin_(Delete)_2489899)
We need to upgrade a Categories Attribute Item on individual livelink node object without affecting the node objects existing attribute value settings. We tried using UpgradeObjectCategory function and it does the upgrade for its attributes, but deleted existing attribute settings of its livelink node object.When we tried to upgrade the attributes using the "Upgrade" button in the live link GUI, it does the upgrade without afftecting the existing attribute settings. Does anyone have any suggestion how I might be able to do this using LAPI? Any help will be highly appreciated.ThanksSam
Find more posts tagged with
Comments
***_****_(citlon01admin_-_(deleted))
The following program is a sample of upgrading an individual document with a new category. 'Initialize the Livelink API. 'The LL_Initialize call initializes the Livelink API, and, in the process, verifies that the text 'definition files and *.dll files are of compatible versions. If initialization fails, an error message 'is printed and execution terminates. Otherwise, execution continues. lStatus = LL_Initialize(LL_HEADER_VERSION) If (lStatus <> LL_OK) Then MsgBox Date & " " & time & ": LL_Initialize Failed, Wrong header or DLL" End End If 'Allocate value objects. 'The value objects that will be used later in the program are allocated. '(Value objects are used extensively in Livelink to store many kinds of 'information. In this program they store the allocated session and Livelink 'Library object information.) If allocation fails, an error message is printed 'and execution terminates. Otherwise, execution continues. ' grab some value objects lStatus = LL_ValueAlloc(lMessage) If (lStatus <> LL_OK) Then MsgBox Date & " " & time & ": LL_ValueAlloc(lMessage) failed" End End If 'Allocate a session and connect to the Livelink server. 'Upon successful initialization, the LL_SessionAllocEx call allocates a session 'and attempts to connect to the Livelink server. If the connection cannot be made '( LL_SessionAllocEx does not return LL_OK), execution skips, 'where the connection error is retrieved by making the LL_SessionStatus call and 'is displayed. Otherwise, execution continues. ' Allocate our session 'lStatus = LL_SessionAllocEx(lSession, "K0013", 2099, "LIVELINKK0013", "Admin", "livelink", 0) lStatus = LL_SessionAllocEx(lSession, "K0013", 2099, "LIVELINKK0013", "Admin", "", 0) If (lStatus <> LL_OK) Then lStatus = LL_SessionStatus(lSession, siz, lMessage) If (lStatus <> LL_OK) Then lStatus = LL_ValueGetString(lMessage, buf, 255, siz) End End If End If Dim curCatID As Long lStatus = LL_ValueAlloc(curCatID) lStatus = LL_ValueSetAssoc(curCatID) lStatus = LL_AssocSetInteger(curCatID, "ID", 53108) ' the new category ' get the latest category format Dim catVersion As Long lStatus = LL_ValueAlloc(catVersion) lStatus = LL_FetchCategoryVersion(lSession, curCatID, catVersion) ' get the new categoryversion Dim objID As Long Dim catIDList As Long Dim catID As Long Dim upgradeInfo lStatus = LL_ValueAlloc(catIDList) lStatus = LL_ValueAlloc(objID) lStatus = LL_ValueAlloc(catID) lStatus = LL_ValueAlloc(upgradeInfo) ' the document ID lStatus = LL_ValueSetAssoc(objID) lStatus = LL_AssocSetInteger(objID, "ID", 64904) 'You can get the categoryIDs of documents using, Dim lCatDocVersion As Long lStatus = LL_ValueAlloc(lCatDocVersion) lStatus = LL_ValueSetAssocInArgs(catID) lStatus = LL_AssocSetInteger(catID, "ID", 53108) '# is the category ID. lStatus = LL_GetObjectAttributesEx(lSession, objID, catID, lCatDocVersion) ' get the document category data ' transfer the data from the document Dim DataAssocOut As Long ' Get the data out of the documents category lStatus = LL_ValueAlloc(DataAssocOut) lStatus = LL_AssocGetValue(lCatDocVersion, "data", DataAssocOut) ' put the document into the category upgrade assoc ' -catVersion ' - catID ' - DisplayName ' - ID ' - type ' - version ' - data ' set this from the original document ' - ID ' - Values ' - definition ' - Children ' - DisplayName ' - FixedRows ' - ID ' - MaxRows ' - Name ' - NextID ' - NumRows ' - Required ' - Type ' - ValueTemplate ' - ID ' - Values lStatus = LL_AssocSetValue(catVersion, "data", DataAssocOut) ' do not add a version to upgrade. lStatus = LL_ValueSetAssoc(upgradeInfo) lStatus = LL_AssocSetBoolean(upgradeInfo, "AddVersion", False) lStatus = LL_ListObjectCategoryIDs(lSession, objID, catIDList) ' get the category ID assocs that are on the object Dim intLength As Long lStatus = LL_ValueGetLength(catIDList, intLength) Dim i As Integer For i = 0 To intLength - 1 lStatus = LL_ListGetValue(catIDList, i, catID) lStatus = LL_UpgradeObjectCategory(lSession, objID, catID, catVersion, upgradeInfo) Next i