[转]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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值