cancel
Showing results for 
Search instead for 
Did you mean: 

[solved]Properties in NamedValue Null!

morpheus
Champ in-the-making
Champ in-the-making
I´m  getting NamedValue Objects like the Query2 example does, but the properties are null !!!
when i´m browsing through them with the webclient the title, name and decription is set !!!!

so behind which Constants.PROP….. is this information hidden ?

is there may be an conflict in the naming convention with the Constants class and the Properties of the web client ??

 
   ResultSetRow[] resultSetRow = queryResult.getResultSet().getRows();
      this.tmp = new Reference[resultSetRow.length];
      if(resultSetRow != null){
         // Iterate content items
         for (int i = 0; i < resultSetRow.length; i++) {
            ResultSetRow row = resultSetRow[i];
            if(row != null){
               // Get the properties of actual content item
               ContentItem contentResult = new ContentItem();
               for(NamedValue namedValue : row.getColumns()){
                  // IF FOLDER
                  if (namedValue.getName().endsWith(Constants.TYPE_FOLDER) == true) {
                     
                     contentResult.setType(true);
                     if (namedValue.getName().endsWith(Constants.PROP_TITLE) == true)
                             contentResult.setTitle(namedValue.getValue());
                          else if (namedValue.getName().endsWith(Constants.PROP_NAME) == true)
                             contentResult.setName(namedValue.getValue());
                          else if (namedValue.getName().endsWith(Constants.PROP_DESCRIPTION) == true)
                             contentResult.setDescription(namedValue.getValue());
                     }
                  // IF CONTENT
                  if (namedValue.getName().endsWith(Constants.TYPE_CONTENT) == true) {
                     
                     contentResult.setType(false);
                     if (namedValue.getName().endsWith(Constants.PROP_NAME) == true) {
                        contentResult.setName(namedValue.getValue());
                     }else if (namedValue.getName().endsWith(Constants.PROP_TITLE) == true) {
                        contentResult.setTitle(namedValue.getValue());
                     }   
                  }
               }
               this.tmp[i]= new Reference(store, row.getNode().getId(), null);
               contentResults.add(contentResult);
            }
         }         
      }
2 REPLIES 2

morpheus
Champ in-the-making
Champ in-the-making
i also now checked with tcpmon the soap message and there the strings are still there !! but when seaching through the resultset,while debugging the code, the  fields are null !!!
here an extract of the  soap message


<ns1:columns>
<ns1:name>{http://www.alfresco.org/model/content/1.0}name</ns1:name>
<ns1:isMultiValue>false</ns1:isMultiValue>
<ns1:value>motorhaube</ns1:value>
</ns1:columns>
<ns1:columns>
<ns1:name>{http://www.alfresco.org/model/content/1.0}title</ns1:name>
<ns1:isMultiValue>false</ns1:isMultiValue>
<ns1:value>&#xD6;ffnen der Motorhaube</ns1:value>
</ns1:columns>
<ns1:columns>
<ns1:name>{http://www.alfresco.org/model/content/1.0}description</ns1:name>
<ns1:isMultiValue>false</ns1:isMultiValue>
<ns1:value>Hier wird Schritt f&#xFC;r Schritt das &#xF6;ffnen der Motorhaube beschrieben</ns1:value>
</ns1:columns>
….

morpheus
Champ in-the-making
Champ in-the-making
ok i tricked myself, i thought the TYPE_FOLDER Constant could evaluate each time a colum is read,whether it is a folder or not but it doesn´t