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
Problems to use LL_CreateObjectEx for Docs with required attributes
Thomas_Blume
I have to create documents they inherit categories with required attributes. So I can't use AddDocument, because the parameters objectInfo and versionInfo are OutPut-Parameters. So you can't pass attribute infos. Is that right?LLSTATUS LL_AddDocument( LLSESSION session, LLLONG parentVolID, LLLONG parentID, LLCSTR name, LLFILE filePath, LLVALUE objectInfo, LLVALUE versionInfo );If so you have to use LL_CreateObjectEx. In case of documents you have to call it with the following parameters.This example adds a document in the EnterpriseWS if I don't have required attributes. "node_in" could have a CatVersion-datastructure."lCatVersion" is the same datastructure with the Category-Info you need for "LL_SetObjectAttributesEx(session, lObjFolderObject, lCatVersion)" for example LL_ValueAlloc extendedData LL_ValueAlloc node_in LL_ValueAlloc Request LL_ValueAlloc RequiredAttributes LL_ValueAlloc objects LL_ValueAlloc tmp1 LL_ValueAlloc tmp2 status = LL_ValueSetAssocInArgs(node_in) status = LL_ValueSetAssocInArgs(extendedData) status = LL_ValueSetAssocInArgs(Request) status = LL_ValueSetAssocInArgs(RequiredAttributes)status = LL_CreateObjectEx(session, -2000, 2000, LL_VERSIONOBJECTTYPE, LL_DOCUMENTSUBTYPE, "Document Ex", node_in, tmp2)I have already worked with categories on folders. But I couldn't find a way to add the CatVersion-datastructure to the "node_in" object for the document. These both calls don't work. Who can help?LL_AssocSetAssoc(RequiredAttributes, lCatVersion)LL_AssocSetAssoc(node_in, lCatVersion)Thank you in advance
Find more posts tagged with
Comments
Steve_Piatt_(spiatt_(Delete)_891610)
In your situation, you need to deal with the createInfo.categories instead of createInfo.requiredAttributes. I believe the createInfo.requiredAttributes is for the old 8.1.5 style categories not the 9.x cats&atts. Just keep in mind that you need to work with a list of catVersions. See the documentation for for CreateObjectEx. 'Set up the categories list to contain the catVersion struct If (status = LL_OK) Then status = LL_ValueSetList(categories) End If If (status = LL_OK) Then status = LL_ValueSetLength(categories, 1) End If If (status = LL_OK) Then status = LL_ListSetValue(categories, 0, catVersion) End If ' Set the categories List in the createInfo assoc If (status = LL_OK) Then status = LL_AssocSetValue(createInfo, "categories", categories) End If