cancel
Showing results for 
Search instead for 
Did you mean: 

Search all documents at user Home space

ribz33
Champ on-the-rise
Champ on-the-rise
Hi,
i want to reproduce my_docs template with web services but i dont succeed to find good query with Lucene.
Im not expert with lucene query if someone can help me…

At the moment i had tried this :

private static final Store STORE = new Store(Constants.WORKSPACE_STORE, "SpacesStore");



Query query = new Query(  Constants.QUERY_LANG_LUCENE, PATH:\"/app:user_home/*\"");
QueryResult queryResult = repositoryService.query(STORE, query, false);

But i dont understand i have a document in this space and i dont see it !

If someone can help me, i dont understand well how to navigate in repository with WebServices.
I had read already that :
http://wiki.alfresco.com/wiki/Repository_Web_Service
http://wiki.alfresco.com/wiki/Web_Service_Data_Types
http://wiki.alfresco.com/wiki/Search

There is other good documentation ?

If someone have an idea to do good query its would be nice Smiley Happy
2 REPLIES 2

sam69
Champ in-the-making
Champ in-the-making
I don't really know XPath, but I think your problem is on the XPath expression. Are you sure of your '/' ?

If you can't make it work, you can use the method queryChildren if you have the ref of the user home…

I did not test this code, but it should work…

// Get the ref of the user_home :
RepositoryServiceSoapBindingStub repositoryService = this.getWebServiceFactory().getRepositoryService();
Reference reference = new Reference(new Store(Constants.WORKSPACE_STORE, "SpacesStore"), null, "/app:company_home/*[@cm:name=\"" + user_home + "\"]");
Predicate predicate = new Predicate(new Reference[] { reference }, null, null);
Node[] nodes = repositoryService.get(predicate);
Reference ref = nodes[0].getReference();
// Get all the children of the user_home space
this.getWebServiceFactory().getRepositoryService().queryChildren(ref);

ribz33
Champ on-the-rise
Champ on-the-rise
ok thx i will try this Smiley Very Happy