AnsweredAssumed Answered

How to set/get multiple-value property programmatically?

Question asked by llin on Sep 20, 2007
Latest reply on Nov 6, 2007 by rulo
Hello,

My data model has a property with multiple values:

<property name="tal:software">
   <type>d:text</type>
   <multiple>true</multiple>
   <constraints>
      <constraint ref="tal:softwareList" />
   </constraints>
</property>

How can I save those property values into Alfresco using my application? I also have problem with getting those values in Alfresco to my application? The following code from Alfresco SDK examples, works with normal properties, but not for property with multiple values.

Query query = new Query(Constants.QUERY_LANG_LUCENE, queryString );
QueryResult queryResult = getRepositoryService().query(LilacConstants.STORE, query, false);
ResultSet resultSet = queryResult.getResultSet();
ResultSetRow[] rows = resultSet.getRows();

for(ResultSetRow row : rows) {
for (NamedValue namedValue : row.getColumns()) {
         if (namedValue.getName().endsWith(Constants.PROP_NAME) == true) {
                 contentResult.setName(namedValue.getValue());
         }
…..


The above "tal:software" property is not inside "NamedValue", so I can't get them into my application.

Any idea or suggestion? Thanks a lot.


Ally

Outcomes