Home
Extended ECM
API, SDK, REST and Web Services
How to assign value to a attribute associated with "Set" in a category using Java LAPI
Anuradha_Deo_(PATCOM01User2_(Delete)_2735478)
I need to assign value to the particular attribute belonging to the set in a category using JAVA LAPI, How can I refer the attribute so that it reflects the associated "set" , I also need to have multiple rows belonging the same set associated with the document category. Attributes are of text Field and text popup type.if I use AttrSetValues() how will I pass information of the associated "set" with attribute.Please have a look at the Attached screen cam of the Category template on which I need to work using LAPI (Java).Here "Myset" is SET and Level1,Level2,Level3 are the attributes . I want to assign values to level1,level2,level3 in each row.
Find more posts tagged with
Comments
John_Shoun
This was very confusing to me for a while, but I was finally able to figure it out from the documentation. Now that I understand how it works it seems obvious, but it wasn't at first.Note to Open Text: some sample would have been very helpful. (This would be a good thing to include in the new examples discussion).Anyway, there is an argument to the method "setAttrValues" called "attrValuesPath". This is a list object. The first element is the name of the set and the second element is the row number for that attribute. The attribute name goes in "attrName" as usual.You example would look something like this (in Java):LAPI_ATTRIBUTES cats_atts = new LAPI_ATTIBUTES (session);cats_atts.AttrSetValues( catVersion, "Level1", LAPI_ATTRIBUTES.ATTR_DATAVALUES, "{'MySet', 0}", attrValList); I've shown the arguments as strings, but they would really need to be initialized LLValues.Attached is a more complete example from an XML parser that reads and loads attributes from an XML file and creates folders/loads documents.
eLink User
Message from David Slimmon via eLinkConsider it included - perfect example!Thanks!Regards,David___________________________________________O P E N T E X T C O R P O R A T I O NDavid Slimmon, M.L.I.S.Supervisor - Customer Support
https://knowledge.opentext.comdslimmon@opentext.com-----Original
Message-----This was very confusing to me for a while, but I was finally able to figureit out from the documentation. Now that I understand how it works it seemsobvious, but it wasn't at first.Note to Open Text: some sample would have been very helpful. (This would bea good thing to include in the new examples discussion).Anyway, there is an argument to the method "setAttrValues" called"attrValuesPath". This is a list object. The first element is the name ofthe set and the second element is the row number for that attribute. Theattribute name goes in "attrName" as usual.You example would look something like this (in Java):LAPI_ATTRIBUTES cats_atts = new LAPI_ATTIBUTES (session);cats_atts.AttrSetValues( catVersion, "Level1", LAPI_ATTRIBUTES.ATTR_DATAVALUES, "{'MySet', 0}", attrValList);I've shown the arguments as strings, but they would really need to beinitialized LLValues.Attached is a more complete example from an XML parser that reads and loadsattributes from an XML file and creates folders/loads documents.