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
Need help adding attributes with multiple rows
Valerie_Beaver
We are loading documents and category/attribute data via LAPI. We have seen the code to add multiple rows of data to a set, but haven't figured out how to add rows to an attribute that is not part of a set. We have a a custom attribute, with Max Rows = 50, Default Rows = 1. Any examples would be greatly appreciated.Valerie @ Lockheed
Find more posts tagged with
Comments
Claudia_Meyer
Message from chris meyer via eLinkHi Valerie,If I understand your question correctly, you wish to assign a value to a multi-valued attribute that's not part of a set. Is that correct? Here's how I do it...I use a function to expand the list of multi-valued values. For example, if you wish to assign a value to index 50 but the default is 1, you need to add 49 blank values to your LLValue list. This is what I use: private LLValue explandLLValueList(LLValue attrValues, int index) { while ( attrValues.size() < index + 1 ) { attrValues.add(); } return attrValues; } private LLValue getAttributeLLValue(String attrName) throws LLObjectException { LLValue attrValues = new LLValue().setList(); if (getSession().getAttributes().AttrGetValues(catVersion, attrName, LAPI_ATTRIBUTES.ATTR_DATAVALUES, null, attrValues ) != 0) { throw new LLObjectException( this ); } return attrValues; }// and my function to assign a value to the attribute looks like this: public void setAttributeValue(String attrName, String value, int index) throws LLObjectException { // assertAttrValue(attrName, value, index); LLValue attrValues = getAttributeLLValue(attrName); attrValues = explandLLValueList(attrValues, index); attrValues.setString(index, value); setAttributeValues(attrName, attrValues); }There is some extra stuff in there related to my specific implementation (LLObjectException, assertAttrValue, etc.) that you can ignore.I hope this code snippet helps.chriseLink Discussion: LAPI Discussion wrote:>Need help adding attributes with multiple rows>Posted by USENFL01User3 on 07/23/2004 07:25 PM>>We are loading documents and category/attribute data via LAPI. We have seen the code to add multiple rows of data to a set, but haven't figured out how to add rows to an attribute that is not part of a set. We have a a custom attribute, with Max Rows = 50, Default Rows = 1. >>Any examples would be greatly appreciated.>>Valerie @ Lockheed>>[To reply to this thread, use your normal E-mail reply function.]>>============================================================>>Discussion: LAPI Discussion>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=765428&objAction=view>>Livelink
Server:>
https://knowledge.opentext.com/knowledge/livelink.exe>>>
; >-- --------------------------------------------------------------------------------Christopher Meyer, BMath, MScTechnical ConsultantOpen Text AGPh: +41 (0) 71 272 1500 Fax: +41 (0) 71 272 1515Email: cmeyer@opentext.com--------------------------------------------------------------------------------Join us for LinkUp Phoenix 2004!Open Text User ConferencePhoenix, Arizona, USANovember 15-18, 2004Find out why Open Text is the market leader in providing Enterprise Content Management (ECM) solutions.
http://linkup-phoenix.opentext.com
Valerie_Beaver
We are migrating data from another system to IDMS, loading the documents and data through LAPI. In the old system, we have comma delimited values in a single field that we need to load into IDMS into an attribute with mutliple rows. The default row = 1, max rows = 50. We are getting the first value to add OK. Do we need to add the document, add rows to the attributes, and then load the data? Or can we add a value to the attribute in row 1, and then another value for row 2?