您的位置:首页 > 产品设计 > UI/UE

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

2011-05-27 09:47 447 查看
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:
binder.putLocal("IdcService", "GET_SEARCH_RESULTS");

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

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

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

DataBinder serverBinder = response.getResponseAsBinder();

binder = response.getResponseAsBinder();

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

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

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

}

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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐