[转]Finding a query in UCM using the query builder

published by Yannick on 9 February, 2011 - 11:24

I often need to look at the documentation to find the correct syntax for the query language provided in UCM. This is used when you want to integrate UCM with for example ADF or WebCenter and use the RIDC API. If you want to find documents, you use the GET_SEARCH_RESULT service. This service requires a queryString as parameter.
UCM has its own query language and I often need to find the correct syntax.
Luckely for us, there is a tool that we can use to build the query and just copy/paste this into our application.

First make sure you are logged in to UCM.
Open the search page and press the show advanced options on the right:

This will show a textarea that show you the complete query. For example I want to find all the pdf's containing "Oracle" in the title:

You now can use this query in the RIDC API:

  1. binder.putLocal("IdcService", "GET_SEARCH_RESULTS");

  2. binder.putLocal("QueryText", "dDocTitle `Oracle` dExtension `pdf`");

  3. binder.putLocal("ResultCount", "1");

  4. ServiceResponse response = idcClient.sendRequest(userContext, binder);

  5. DataBinder serverBinder = response.getResponseAsBinder();

  6. binder = response.getResponseAsBinder();

  7. DataResultSet resultSet = binder.getResultSet("SearchResults");

  8. for (DataObject dataObject : resultSet.getRows()) {

  9. System.out.println(dataObject.get("dDocTitle"));

  10. }

As you see, the syntax is different from what you are used to in regular databases.
It is also very important to know that the fields in the queryText are case sensitive so dDocName will work but ddocname will not work.
The special `sign is also important to put around a string. If you try to add " or ', it also won't work. You need to use ` instead.

你可能感兴趣的:([转]Finding a query in UCM using the query builder)