AnsweredAssumed Answered

Search for a Node

Question asked by luisg on Jun 26, 2009
Latest reply on Sep 7, 2009 by luisg
Hi there
I'm trying to do a Web Service that can get the path for a Node. I did this:

protected static ResultSet getResultSpace(String idNode){
      ResultSet result = null;
      String searchQuery = "@\\{http\\://\\}name:\"" + idNode+ "\"";
      Query query = new Query();
        try {
            QueryResult resultQuery = WebServiceFactory.getRepositoryService().query(STORE, query, false);
            result = resultQuery.getResultSet();
            //imprime os resultados
            ResultSetRow[] rows = result.getRows();
        catch(Exception e){}
        return result;

All the folders in Alfresco have different names.
The thing is, if I search for a Node with name 'id123', I will get some nodes I dont want. eg: 'id', '123', 'id123456'.
The method I create return all the results that have, as sub-string, the given string, but I just want the space with full name equals to the given string, so I will ALWAYS get 1 result.

One more thing…
With this method I get a path like this:
from the resultSetRow.path.
How can I get this path as: /app:company_home/cm:folderX/… ?

Can somebody help me?


Can you help me?