My Oracle Support Banner

Assets Are Returned In Different Order When maxcount Is Set in assetset:getassetlist Tag (Doc ID 2262378.1)

Last updated on JULY 07, 2017

Applies to:

Oracle WebCenter Sites - Version to [Release FatWire]
Information in this document applies to any platform.


Use Case

Custom code is implemented to obtain an asset with the latest updateddate (or some custom date attribute, e.g. TestDate) from a list of assets of the same type.

Sample Setup

1. In FirstSiteII, created new Content_A attribute: TestDate, new Content_CD def, TestDateDef, and 5 new Content_C assets with different dates.

2. Created a Template (e.g. RenderAssetDate) to render the asset's date value.

3. Created another uncached Template to use the assetset:getassetlist to retrieve the list of assets and display the latest asset using customer code.

Sample Code

<listobject:create name="supportListobject" columns="attributetypename,attributename,direction"/>
<listobject:addrow name="supportListobject">
<listobject:argument name="attributetypename" value="Content_A"/>
<listobject:argument name="attributename" value="TestDate"/>
<listobject:argument name="direction" value="descending"/>
<listobject:tolist name="supportListobject" listvarname="listout"/>
<searchstate:create name="ss"/>
<assetset:setsearchedassets name="as" constraint="ss" assettypes="Content_C"/>
<assetset:getassetlist name="as" list="listout" listvarname="lPressRelease" maxcount="1" />
<ics:listloop listname="lPressRelease">
<ics:listget listname="lPressRelease" fieldname="assetid" output="assetid" />
<asset:load name="latestAsset" type="Content_C" objectid='<%=ics.GetVar("assetid")%>'/>
<asset:scatter name="latestAsset" prefix="check"/>
The latest asset is Content_C:<%=ics.GetVar("check:id")%> named <%=ics.GetVar("check:name")%> with TestDate <%=ics.GetVar("check:Attribute_TestDate")%><br/>




To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.