public interface AssetReader
A reader that allows user to read asset information in a simplified way AssetReader provides the ability for a user to retrieve an Asset information in a unified way for all asset types. The reader allows user retrieving asset information by specifying an AssetId or an AssetType/name pair. It further allows user to retrieve nested asset information using grammar or another AssetReader The results returned from AssetReader.read() method is a Map, which contains the requested asset information in a Map format. Sample code snippet:
Map data = new AssetReaderImpl(new AssetFacadeImpl(ics))
.forAsset( assetId )
.select( "name, description, AssociatedAssetOne.(name, description, body)" )
.levelOfChildren(2)
.selectImmediateOnlyParents(true)
.useAssetReader( "Content_P", null, new AssetReaderImpl(new AssetFacadeImpl(ics)).selectAll(true) )
.includeLinks(true)
.includeBlobLinks(true)
.includeFeatures(true)
.forLocale("en_US")
.evaluateEmbeddedLinks(true)
.read();
| Modifier and Type | Method and Description |
|---|---|
AssetReader |
addAssetLinkInfo(LinkInfo linkInfo)
Adds a LinkInfo object for building a link for the read asset
|
AssetReader |
addAssetLinkInfos(List<LinkInfo> linkInfos)
Adds a list of LinkInfo objects for building a link for the read asset
|
AssetReader |
addBlobLinkInfo(BlobLinkInfo blobLinkMaker)
Adds a default BlobLinkInfo object for building blob links contained in the asset for all fields without a specific BlobLinkInfo object specified
|
AssetReader |
addBlobLinkInfo(String field, BlobLinkInfo blobLinkMaker)
Adds a BlobLinkInfo object for building blob links contained in the asset for given field
|
AssetReader |
evaluateEmbeddedLinks(boolean evaluate)
Specifies whether or not to evaluate the embeddedLinks in the value returned
|
AssetReader |
filterForDate(Date date)
Filter the assets by date; This is used together with the startdate and enddate in the asset, if the asset has a startdate and/or enddate, we will use the passed in date to filter, if the date passed in does not fall in between the startdate and enddate in asset, the asset will not be returned
|
AssetReader |
forAsset(AssetId assetId)
specify the asset by an AssetId
|
AssetReader |
forAsset(String assettype, Long assetid)
specify the asset type, id of the interested asset
|
AssetReader |
forAssetName(String assetType, String assetName)
Specify the asset by name; There is always chance that several assets with same name exists in Sites.
|
AssetReader |
forLocale(String locale)
Specify interested Locale for the asset.
|
AssetReader |
forLocale(String locale, String dimensionSet)
Specify interested Locale for the asset and a DimensionSet filter to obtain asset translation.
|
AssetReader |
forSite(String siteName)
specify the sitename the AssetReader is working upon
|
AssetReader |
immediateOnlyAttributes(boolean immediateOnlyAttributes)
Specifies whether or not to retrieve immediate-only attributes for flex assets/parents
|
AssetReader |
includeFeatures(boolean includeFeatures)
specify whether to include the Asset features like AssetType, subtype, dimensions and such in the asset map
|
AssetReader |
includeLinks(boolean includeLink)
indicate whether to include a Link in the returned Object; when set yes, the AssetReader will retrieve the Webreference (Vanity Urls) defined in the asset and return the first one in the list as _link_ in the returned Object
|
AssetReader |
includeLinksForBlobs(boolean includeBlobLinks)
indicate whether to include a Link in the returned Object; when set yes, the AssetReader will retrieve the Webreference (Vanity Urls) defined in the Blob and return the first one in the list as [BlobAttributeName]_link_ in the returned Object
|
AssetReader |
levelOfChildren(int level)
Specify the level of flex children to bring back in the children list if the asset is an flex parent
|
Map |
read()
Read the asset bean with information specified.
|
AssetReader |
select(String attributes)
Specify a list of attributes to retrieve
|
AssetReader |
selectAll(boolean all)
indicate wehther all the attributes are needed
|
AssetReader |
selectImmediateOnlyParents(boolean immediateOnly)
Indicate whether parents will be selected and what attributes will be selected
|
AssetReader |
selectParents(String parentDefName)
Indicate to select a parent of certain definition
|
AssetReader |
useAssetReader(String assettype, String subtype, AssetReader assetReader)
Specify an AssetReader to use for flex children, flex parent of specified assettype and subtype
|
AssetReader forAsset(String assettype, Long assetid)
assettype - the asset typeassetid - the asset idAssetReader forAsset(AssetId assetId)
assetId - the asset idAssetReader forAssetName(String assetType, String assetName)
assetType - the asset typeassetName - the asset nameAssetReader levelOfChildren(int level)
level - int number of children to bring backAssetReader useAssetReader(String assettype, String subtype, AssetReader assetReader)
assettype - the asset typesubtype - the asset subtypeassetReader - the assetReaderAssetReader forSite(String siteName)
siteName - the String sitenameAssetReader select(String attributes)
attributes - list of asset attributesAssetReader forLocale(String locale)
forLocale(locale, dimensionSet).locale - the name of the Locale, which is the Dimension asset name you defined for Locale DimensionSetAssetReader forLocale(String locale, String dimensionSet)
forLocale(locale). If dimensionSet is null the call is same as forLocale(locale)locale - the name of the Locale, which is the Dimension asset name you defined for Locale DimensionSetdimensionSet - name of the DimensionSet to be usedAssetReader filterForDate(Date date)
date - the date on which the asset is interested in; null means filter is not neededAssetReader selectAll(boolean all)
all - true indicate all attribues will be retrieved; false otherwiseAssetReader addAssetLinkInfo(LinkInfo linkInfo)
linkInfo - a LinkInfoAssetReader addAssetLinkInfos(List<LinkInfo> linkInfos)
linkInfos - LinkInfoAssetReader addBlobLinkInfo(String field, BlobLinkInfo blobLinkMaker)
field - the field to use this BlobLinkInfoblobLinkMaker - a BlobLinkInfoAssetReader addBlobLinkInfo(BlobLinkInfo blobLinkMaker)
blobLinkMaker - a BlobLinkInfoAssetReader includeLinks(boolean includeLink)
includeLink - boolean to indicate whether to include the default link from Webreference; default is falseAssetReader includeLinksForBlobs(boolean includeBlobLinks)
includeBlobLinks - boolean to indicate whether to include the default links from Webreference for the Blob attributes; default is falseAssetReader selectImmediateOnlyParents(boolean immediateOnly)
immediateOnly - indicate whether to select immediate parents only or all the parentsAssetReader selectParents(String parentDefName)
parentDefName - the parent definition name to selectAssetReader includeFeatures(boolean includeFeatures)
includeFeatures - true indicates that features will be included in asset map, false otherwiseAssetReader evaluateEmbeddedLinks(boolean evaluate)
evaluate - true indicate the values will be evaluated before return, false otherwiseAssetReader immediateOnlyAttributes(boolean immediateOnlyAttributes)
immediateOnlyAttributes - true indicate only immediate attributes will be retrieved, false otherwiseMap read() throws AssetAccessException
AssetAccessException - an AssetAccessException