cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the NodeRef of Company Home/承認後

nicolasraoul
Star Contributor
Star Contributor
Hello,

I want to get a NodeRef to my "Company Home/承認後" directory. So I wrote:

StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");

ResultSet rs = searchService.query(storeRef, SearchService.LANGUAGE_XPATH,
   "/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1....");

NodeRef my = rs.getNodeRef(0);

But the resultset only contains one noderef: the root "/". Not the directory I indicated in the query.
What am I doing wrong?
Note: Even if I remplace 承認後 by its equivalent \u627f\u8a8d\u5f8c, same result.
2 REPLIES 2

nicolasraoul
Star Contributor
Star Contributor
I switched from XPath to Lucene and now it works. I don't know what I was doing wrong.

            ResultSet resultSet = searchService.query(new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore") ,
             SearchService.LANGUAGE_LUCENE, "PATH:\"/app:company_home/cm:承認後\"");
       try
       {
           if (resultSet.length() == 0)
           {
               throw new AlfrescoRuntimeException("Didn't find 承認後");
           }
           destinationWalker = resultSet.getNodeRef(0);
       }
       finally
       {
          resultSet.close();
       }

jeyaa
Champ in-the-making
Champ in-the-making
Hi,
I have a problem in my query,
My query is retriving the archived nodes. So that If am manipulating with that node, the error saying that
Node does not exist: workspace://SpacesStore/6452d70d-56e9-4197-a1b9-9fccb702288e

My Query is
"@cm\\:modified:["+tdate+" TO "+fdate+"]"

I am unable to find the solution. So please help me in this issue.


Thanks,
Jeya