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
Assign a category to a folder
Alexis_Degaine
Here is my code to assign a category to a folder.LLSession session = new LLSession(serverPmed, 2099, null, admLog, admPass); LAPI_DOCUMENTS doc = new LAPI_DOCUMENTS(session); LLValue catID = new LLValue().setAssocNotSet(); LLValue catVersion = new LLValue().setAssocNotSet(); int status0 = 0, status1 = 0,status2 = 0; //Retrieve the category ID status0 = doc.GetObjectIDByNickname(Integer.toString(97417847), catID); if(status0!=0) { System.out.println("Status0 : "+status0); System.out.println(session.getStatus()); System.out.println(session.getStatusMessage()); } //Retrieve the category version status1 = doc.FetchCategoryVersion(catID,catVersion); if(status1!=0) { System.out.println("Status1 : "+status1); System.out.println(session.getStatus()); System.out.println(session.getStatusMessage()); } //Set the category status2 = doc.SetObjectAttributes(-2000,97416523,catID); if(status2!=0) { System.out.println("Status2 : "+status2); System.out.println(session.getStatus()); System.out.println(session.getStatusMessage()); }When I execute it, the following error messages are displayed :Status1 : -2147482647-2147482647Argument: catID (catID) was the wrong typeStatus2 : -2147482647-2147482647Argument: Attributes (Attributes) was the wrong typeI don't understand why catID is the wrong type because the ccode can be compiled and the function is called.Thank you in advance for any help.
Find more posts tagged with
Comments
Appu_Nair
do take a look at this OT sample
https://knowledge.opentext.com/knowledge/llisapi.dll?func=ll&objId=12032536&objAction=ArticleView&viewType=1I
think you ares ending catid as integer in your callstatus1 = doc.FetchCategoryVersion(catID,catVersion);whereas the prototype expects an assoc .Your definition is right but the doc.GetObjectIDByNickname returns catid as in integer.Try following the OT sample