@Exported public class AssetDataManagerImpl extends Object implements AssetDataManager
AssetDataManager implementation class
The class has two variant of read methods:
1. Read with a set of attribute names to retrieve specified
- in this case, attribute names are specified either directly in the method signature, for example readAttributes (AssetId id, List<String> attributeNames)
or in the query read(Query query). We consider the user is intending to read only the attribute specified (immediate only) and do not want to retrieve
the inherited data from parent.
2. Read with only id specified but no attribute names
- in this case, we assume that user wants all the attributes with inherited values.
AssetDataManagerImpl is the entry point for retrieving Content Server asset data and it defaults the
actual operation of reading the data to the specific strategies for each different asset types.
Each asset read strategy is an implementation of AssetDataReadStrategy interface and deal with a special
type of asset.
At the heart of all the read strategies is BasicAssetDataReadStrategy, which reads all the basic
asset types including some system asset types like Page, Collection, Query, Link, DimensionSet, and Dimension,
sample asset types including Article, Linkset , and Image, Asset Maker asset types, Flex Attributes,
Flex Parent definitions, Flex Definitions, Flex Filters, and the basic values of other asset types.
On top of BasicAssetReadStrategy, we have FlexAssetDataReadStrategy and several other asset
data read strategies to read other special asset types like Template, CSElement, AdvCols(Recommendation),
Promotions, HField, HistoryVals, ScalarVals.| Constructor and Description |
|---|
AssetDataManagerImpl(ICS ics) |
| Modifier and Type | Method and Description |
|---|---|
MutableAssetData |
deepCopy(AssetData example)
Creates a deep copy of an AssetData object, copying all the data.
|
void |
delete(List<AssetId> data)
Deletes a given list of AssetIds from database.
|
static AssetReader |
getAssetBuilder(ICS ics) |
void |
insert(List<AssetData> data)
Inserts a given List of AssetData instances in the database and new assets will be created with
the data from the list.
|
AssetData |
newAssetData(String assetTypeName,
AssetData example)
Creates an instance of AssetData (with copied instances of AttributeData from the example AssetData).
|
MutableAssetData |
newAssetData(String assetTypeName,
String subtype)
Create an empty instance of AssetData with empty instance of AttributeData.
|
AttributeData |
newAttribiteData(String attributeName,
String assetTypeName,
String subtype)
Creates an empty instance of AttributeData (of appropriate type and default).
|
AttributeData |
newAttributeData(AttributeDef attributeDef)
Create an attributeData with an attribute definition specified.
|
AttributeData |
newAttributeData(String attributeName,
String assetTypeName,
String subtype)
Creates an empty instance of AttributeData (of appropriate type and default).
|
Iterable<AssetData> |
read(List<AssetId> ids)
Reads asset data for all given
AssetIds. |
Iterable<AssetData> |
read(Query query)
Read a list of Asset Data that satisfy the query.
|
AssetData |
readAttributes(AssetId id,
List<String> attributeNames)
Reads given set attribute data and returns an AssetData instance containing them.
|
Iterable<MutableAssetData> |
readForUpdate(List<AssetId> ids)
Read a list of asset data to update.
|
Iterable<MutableAssetData> |
readForUpdate(Query query)
Reads all asset data that satisfies a given Query and results in mutable results.
|
void |
update(List<AssetData> data)
Updates a given list of AssetData in the database.
|
void |
update(List<AssetData> data,
boolean keepCheckedOut)
Updates a given list of AssetData in the database.
|
public AssetDataManagerImpl(ICS ics)
public static AssetReader getAssetBuilder(ICS ics)
public Iterable<AssetData> read(Query query) throws AssetAccessException
read in interface AssetDataManagerquery - the Query objectAssetAccessException - an AssetAccessException.public Iterable<MutableAssetData> readForUpdate(Query query) throws AssetAccessException
AssetDataManagerreadForUpdate in interface AssetDataManagerquery - Query to be satisfied.AssetAccessException - is the layer specific failures and wraps other internal exceptions.public Iterable<AssetData> read(List<AssetId> ids) throws AssetAccessException, AssetNotExistException
AssetDataManagerAssetIds.read in interface AssetDataManagerids - the list of asset ids to read.AssetAccessException - rethrown exception.AssetNotExistException - an AssetNotExistExceptionpublic Iterable<MutableAssetData> readForUpdate(List<AssetId> ids) throws AssetAccessException, AssetNotExistException
readForUpdate in interface AssetDataManagerids - The list of asset IDs to read.AssetAccessException - an AssetAccessException.AssetNotExistException - an AssetNotExistExceptionpublic AssetData readAttributes(AssetId id, List<String> attributeNames) throws AssetAccessException, AssetNotExistException
AssetDataManagerreadAttributes in interface AssetDataManagerid - AssetId to read attributes forattributeNames - Names of the attributesAssetAccessException - Is thrown if the AssetId does not exist or attribute names passed are incorrect
for the asset. AssetAccessException also wraps any AssetExceptions thrown by the internal implementation.AssetNotExistException - an AssetNotExistExceptionpublic void insert(List<AssetData> data) throws AssetAccessException
AssetDataManagerinsert in interface AssetDataManagerdata - AssetData to be inserted.AssetAccessException - Captures layer specific failures and wraps other internal exceptions.public void update(List<AssetData> data) throws AssetAccessException
AssetDataManagerupdate in interface AssetDataManagerdata - AssetData to be updated.AssetAccessException - Captures layer specific failures and wraps other internal exceptions.public void update(List<AssetData> data, boolean keepCheckedOut) throws AssetAccessException
AssetDataManagerupdate in interface AssetDataManagerdata - AssetData to be updated.keepCheckedOut - Do not check in asset after save if revision tracked.AssetAccessException - Captures layer specific failures and wraps other internal exceptions.public void delete(List<AssetId> data) throws AssetAccessException
AssetDataManagerdelete in interface AssetDataManagerdata - AssetIds to be deleted.AssetAccessException - Captures layer specific failures and wraps other internal exceptions.public AttributeData newAttribiteData(String attributeName, String assetTypeName, String subtype)
AssetDataManagernewAttribiteData in interface AssetDataManagerattributeName - Name of the attribute.assetTypeName - Name of asset type.subtype - Subtype of asset type.public AttributeData newAttributeData(String attributeName, String assetTypeName, String subtype)
AssetDataManagernewAttributeData in interface AssetDataManagerattributeName - Name of the attribute.assetTypeName - Name of asset type.subtype - Subtype of asset type.public AttributeData newAttributeData(AttributeDef attributeDef)
AssetDataManagernewAttributeData in interface AssetDataManagerattributeDef - The definition of the attribute.public MutableAssetData newAssetData(String assetTypeName, String subtype) throws AssetAccessException
AssetDataManagernewAssetData in interface AssetDataManagerassetTypeName - The name of the asset type.subtype - The name of the asset subtype.AssetAccessException - an AssetAccessExceptionpublic AssetData newAssetData(String assetTypeName, AssetData example)
AssetDataManagernewAssetData in interface AssetDataManagerassetTypeName - Name of the asset typeexample - Optional example AssetData the returned will be based on.public MutableAssetData deepCopy(AssetData example) throws AssetAccessException
example - The asset data where to copy the data from.AssetAccessException - Throws exception if error met creating the copy.