Oracle WebCenter Sites (MOSC)

MOSC Banner

WebCenter Sites Query Content using API

edited Aug 29, 2012 2:02AM in Oracle WebCenter Sites (MOSC) 5 commentsAnswered
 Hi all,I have created a asset called "TVLContent" and for this asset, I created 2 attributes: "Question" and "Answer".
I need to create a query search using API, to get any content where "Question" or "Answer" attribute contains "Why".
I'm using the line code below, for searching, but doesn't work.

-----Code
Session ses = SessionFactory.getSession();
Condition c1 =ConditionFactory.createCondition("Question", OpTypeEnum.LIKE, "%Why%");
Condition c2 =ConditionFactory.createCondition("Answer", OpTypeEnum.LIKE, "%Why%" );
Query query = new SimpleQuery( "TVLContent", "FAQs", c1.or(c2) , Arrays.asList("name", "id", "Question", "Answer"));
query.getProperties().setIsBasicSearch(true);
AssetDataManager mgr = (AssetDataManager) ses.getManager(AssetDataManager.class.getName());
List<Long> firstResults = new ArrayList<Long>();

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center