cancel
Showing results for 
Search instead for 
Did you mean: 

more question about query

qoszhao
Champ in-the-making
Champ in-the-making
I built their web service client jar with updated url.
Created a project. Created a web service client based on there samples.
Added WSS4J, AXIS, XML Security lib, openSAML to the project.
Did a query using:

RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();  
           
            // searchValue=/cm:Test/cm:Test2/cm:jbivision.pdf
            Query query = new Query(QueryLanguageEnum.lucene, "PATH:\"/" + searchValue + "\"");
           // Query query = new Query(QueryLanguageEnum.lucene, "PATH:\"//.\"");
            QueryResult queryResult = repositoryService.query(STORE, query, true);

            //query = null; //Result = repositoryService.query(STORE, query, true);
            ResultSet result = queryResult.getResultSet();
           
            uri = result.getRows(0).getColumns(10).getValue();

It returned me only one result, seems this works..

What I am not clear is:

1) I used cm:/Test/cm:Test2 to represent /Test/Test2 directory, is this correct?
2) From the debugger, I saw queryResult Row0 Column10: source is the same as the location I get:
WorkSpace://SpacesStore/…..

is this the right one? How do I get the full URI path based on this?

3) I also noticed there is a contentUrl in Column4, is it something we need for the URI? Based on my observation, its value is different from the
file location.

Thanks.
2 REPLIES 2

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

I'll try and answer your questions for you …

1)  Yes the path cm:Test/cm:Test2 is correct.  All names in an XPath must be qualified by their namespace or well known prefix.

2)  I'm not entirly sure what you are asking here, but a property with a value Workspace://SpacesStore/1231-123-123 is the string representation of a node reference.  A node reference is how the server side API uniquely references a node.  It is like a Reference in web services.  The first part is the store protocol, the second the store identifier and the last the GUID of the node.

3)  Yes the URI you have spotted points to the download servlet and when issued will return the content of the node in question.  Look in ContentUtils.java in the web service client project for guidance on how to use this.

Hope this helps,
Roy

qoszhao
Champ in-the-making
Champ in-the-making
Thanks a lot Roy!