com.fatwire.gst.foundation.facade.assetapi.asset
Class MappedAssetAccessTemplate<T>

java.lang.Object
  extended by com.fatwire.gst.foundation.facade.assetapi.AssetAccessTemplate
      extended by com.fatwire.gst.foundation.facade.assetapi.asset.MappedAssetAccessTemplate<T>
Direct Known Subclasses:
ScatteredAssetAccessTemplate, TemplateAssetAccess

public class MappedAssetAccessTemplate<T>
extends AssetAccessTemplate

Author:
Dolf Dijkstra

Field Summary
protected  COM.FutureTense.Interfaces.ICS ics
           
protected  AssetMapper<T> mapper
           
 
Constructor Summary
MappedAssetAccessTemplate(COM.FutureTense.Interfaces.ICS ics, AssetMapper<T> mapper)
           
 
Method Summary
 com.fatwire.assetapi.data.AssetId currentId()
           
 Iterable<T> query(com.fatwire.assetapi.query.Query query)
          Queries the asset repository with the provided query.
 Iterable<T> query(String assetType, String subType, String query)
          Queries for a list of scattered assets.
 Iterable<T> query(String assetType, String subType, String query, String... attributes)
          Queries for a list of scattered assets.
 T read(com.fatwire.assetapi.data.AssetId id)
           
 T read(com.fatwire.assetapi.data.AssetId id, String... attributes)
          Reads the attributes of an asset.
 Collection<com.fatwire.assetapi.data.AssetId> readAssociatedAssetIds(String associationType)
          Reads the list of associated assets based on the current c and cid cs variables.
 Collection<T> readAssociatedAssets(com.fatwire.assetapi.data.AssetId id, String associationType)
          Reads the associated assets of an asset and returns them as a ScatteredAsset.
 Collection<T> readAssociatedAssets(com.fatwire.assetapi.data.AssetId id, String associationType, String... attributes)
          Reads the associated assets of an asset and returns them as a ScatteredAsset.
 T readCurrent()
          Reads the asset attributes of the asset identified by the current c and cid variables on the ics scope.
 T readCurrent(String... attributes)
          Reads the mentioned asset attributes of the asset identified by the current c and cid variables on the ics scope.
 Collection<com.fatwire.assetapi.data.AssetId> readParentAssetIds(com.fatwire.assetapi.data.AssetId id, String... associationName)
          Read the assets that are parents of the current asset given the specified association name or names.
 Collection<com.fatwire.assetapi.data.AssetId> readParentAssetIds(String... associationName)
          Read the assets that are parents of the current asset given the specified association name or names.
 
Methods inherited from class com.fatwire.gst.foundation.facade.assetapi.AssetAccessTemplate
createAssetId, createAssetId, createNameQuery, findByName, findByName, getAssetDataManager, query, query, readAsset, readAsset, readAsset, readAsset, readAsset, readAsset, readAsset, readAsset, readAsset, readAsset, readAssets, readAssets, readAssets, readAssociatedAssetIds, readAssociatedAssets, readSite, readSiteInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapper

protected final AssetMapper<T> mapper

ics

protected final COM.FutureTense.Interfaces.ICS ics
Constructor Detail

MappedAssetAccessTemplate

public MappedAssetAccessTemplate(COM.FutureTense.Interfaces.ICS ics,
                                 AssetMapper<T> mapper)
Parameters:
ics -
Method Detail

read

public T read(com.fatwire.assetapi.data.AssetId id)
Parameters:
id -
Returns:
the mapped object

read

public T read(com.fatwire.assetapi.data.AssetId id,
              String... attributes)
Reads the attributes of an asset.

Parameters:
id -
attributes -
Returns:
the mapped object

readAssociatedAssets

public Collection<T> readAssociatedAssets(com.fatwire.assetapi.data.AssetId id,
                                          String associationType)
Reads the associated assets of an asset and returns them as a ScatteredAsset. This takes care of the asset read operation of the associated assets.

Parameters:
id -
associationType -
Returns:
the assets from the associations.

readAssociatedAssetIds

public Collection<com.fatwire.assetapi.data.AssetId> readAssociatedAssetIds(String associationType)
Reads the list of associated assets based on the current c and cid cs variables.

Parameters:
associationType -
Returns:
the assets from the associations.

readParentAssetIds

public Collection<com.fatwire.assetapi.data.AssetId> readParentAssetIds(com.fatwire.assetapi.data.AssetId id,
                                                                        String... associationName)
Read the assets that are parents of the current asset given the specified association name or names. Note this can result in an unknown dependency

Parameters:
id - the child asset
associationName - the association name or names to be used to filter parent query.
Returns:
collection of parents; never null.

readParentAssetIds

public Collection<com.fatwire.assetapi.data.AssetId> readParentAssetIds(String... associationName)
Read the assets that are parents of the current asset given the specified association name or names. Note this can result in an unknown dependency

Parameters:
associationName - the association name or names to be used to filter parent query.
Returns:
collection of parents; never null.

readAssociatedAssets

public Collection<T> readAssociatedAssets(com.fatwire.assetapi.data.AssetId id,
                                          String associationType,
                                          String... attributes)
Reads the associated assets of an asset and returns them as a ScatteredAsset. This takes care of the asset read operation of the associated assets. The returned ScatteredAssets are only loaded with the mentioned attributes.

Parameters:
id - the parent asset
associationType - the name of the association or '-' for an unnamed association
attributes - the list of attributes to load
Returns:
the assets from the associations.

readCurrent

public T readCurrent()
Reads the asset attributes of the asset identified by the current c and cid variables on the ics scope.

Returns:
the mapped object

currentId

public com.fatwire.assetapi.data.AssetId currentId()

readCurrent

public T readCurrent(String... attributes)
Reads the mentioned asset attributes of the asset identified by the current c and cid variables on the ics scope.

Parameters:
attributes -
Returns:
the mapped object

query

public Iterable<T> query(com.fatwire.assetapi.query.Query query)
Queries the asset repository with the provided query.

Parameters:
query -
Returns:
Iterable of mapped objects

query

public Iterable<T> query(String assetType,
                         String subType,
                         String query)
Queries for a list of scattered assets.

Sample queries are:


query

public Iterable<T> query(String assetType,
                         String subType,
                         String query,
                         String... attributes)
Queries for a list of scattered assets. Only the mentioned attributes are returned.

Parameters:
assetType -
subType -
query -
attributes -
Returns:
a Iterable of mapped objects


Copyright © 2010-2013 Oracle Corporation. All Rights Reserved.