AnsweredAssumed Answered

HELP:Why same folders are in app and others in cm namespace?

Question asked by rafpgn on Feb 4, 2008
I'm encountering problems with lucene queries because i have not understood
Why same folders are in app namespace and why other folders are in the cm namespace ?

For example i have created 5 folders under Guest Home folder : A , B , C, D, E

so i dont understand why with the following lucene query i didnt get any results :


results :
    query = PATH:"/app:company_home/app:guest_home/app:A"
    rows è null
    Exception in thread "main" java.lang.NullPointerException
       at org.alfresco.sample.webservice.LuceneQuery1.main(
and why with the second query i get the information on the folder A :

results :
This is the complete code :

package org.alfresco.sample.webservice;

import org.alfresco.webservice.repository.*;
import org.alfresco.webservice.types.*;
import org.alfresco.webservice.util.*;

import org.alfresco.webservice.util.*;

//import org.alfresco.webservice.util.Constants;
public class LuceneQuery1
    public static void main(String[] args) throws Exception
          RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
          Store store=null;
          Query query=null;
          boolean includeMetadata=false;
          store=new Store("workspace","SpacesStore");
          String queryStr="PATH:\"/app:company_home/app:guest_home/cm:A\"";

          //String queryStr="PATH:\"/app:company_home/app:guest_home/app:A\"";
          query=new Query(Constants.QUERY_LANG_LUCENE,queryStr);
          System.out.println("query = "+query.getStatement().toString());
          QueryResult queryResult =repositoryService.query(store,query,includeMetadata);
             System.out.println("queryResult è null");
          ResultSet resultSet = queryResult.getResultSet();
             System.out.println("resultSet è null");
          ResultSetRow[] rows = resultSet.getRows();
             System.out.println("rows è null");
          System.out.println("numero di righe:"+rows.length);
          for (int x = 0; x < rows.length; x++)
             ResultSetRow row = rows[x];
             NamedValue[] columns = row.getColumns();
                  for (int y = 0; y < columns.length; y++)
                     System.out.println("row " + x + ": "
                        + row.getColumns(y).getName() + " = "
                        + row.getColumns(y).getValue());
                  ResultSetRowNode node = row.getNode();

Thanks in advance.