Searchstate question - declarative vs java
Hello guys, we are running WebCenter SItes 11G R1, and we are trying to "migrate" some search declarative xml code, into the API:
From this:
<searchstate:create name="ss" op="and"/>
<searchstate:addhasancestorconstraint name="ss"
immediateonly="true"
assetid='<%=ics.GetVar("categoryId")%>'
assettype='<%=ics.GetVar("categoryType")%>'
bucket="ss2" />
<assetset:setsearchedassets name="foundProducts" constraint="ss" assettypes="product_C"/>
<assetset:getassetlist name="foundProducts" listvarname="productResultList" immediateonly="true"/>
<ics:listloop listname="productResultList">
…
…
</ics:listloop>
Into This API code:
SearchState ss = new Searchstate();
ss.addHasAncestorConstraint("ss2", ics.GetVar("categoryId"), <%=ics.GetVar("categoryType")%>, true);
AssetSet assetSet = new AssetSet(ics);
assetSet.setSearchedAssets("SideId?", "ILits", ss, true);