Skip navigation links


com.fatwire.assetapi.data
Interface AssetDataManager

All Known Implementing Classes:
AssetDataManagerImpl

public interface AssetDataManager

This interface is the primary access point for getting to Asset's data.

An asset data can be looked up either by its AssetId using AssetDataManager.read(List) or by using a Query in AssetDataManager.read(Query).

A Query is an abstract construct that defines user's request for asset's data. Query can be considered as an object representation of SQL.

Using Query one would be able to specify Condition (a set of matching criterion) to limit the assets returned as well as the sorting order in which the results are to be read.

A Query also limits the number of attributes to be retrieved. Limiting the Query to contain only a few attributes limits the amount of data that read into memory.

Query also contains an accessory set of properties, QueryProperties. QueryProperties can be used, among other things, to specify the type of query algorithm to use.

For more details about Query, its construct and limitations please see Query

Note: Only read methods are implemented in CS version 7.0. Methods for which implementation does not exist throw UnsupportedOperationException.


Method Summary
 void delete(java.util.List<AssetId> data)
          Deletes a given list of AssetIds from database.
 void insert(java.util.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 After the operation complete, the passed in AssetData in the list will be populated with the newly created Asset id
 AssetData newAssetData(java.lang.String assetTypeName, AssetData example)
          Creates an instance of AssetData (with copied instances of AttributeData from the example AssetData)
 MutableAssetData newAssetData(java.lang.String assetTypeName, java.lang.String subtype)
          Create an empty instance of AssetData with empty instance of AttributeData
 AttributeData newAttribiteData(java.lang.String attributeName, java.lang.String assetTypeName, java.lang.String subtype)
          Deprecated. Please use AssetDataManager.newAttributeData(String,String, String)
 AttributeData newAttributeData(AttributeDef attributeDef)
          Create an attributeData with an attribute definition specified
 AttributeData newAttributeData(java.lang.String attributeName, java.lang.String assetTypeName, java.lang.String subtype)
          Creates an empty instance of AttributeData (of appropriate type and default)
 java.lang.Iterable<AssetData> read(java.util.List<AssetId> ids)
          Reads asset data for all given AssetIds.
 java.lang.Iterable<AssetData> read(Query query)
          Reads all asset data that satisfies a given Query
 AssetData readAttributes(AssetId id, java.util.List<java.lang.String> attributeNames)
          Reads given set attribute data and returns an AssetData instance containing them.
 java.lang.Iterable<MutableAssetData> readForUpdate(java.util.List<AssetId> ids)
          NOTE: This method is not implemented yet.
 java.lang.Iterable<MutableAssetData> readForUpdate(Query query)
          Reads all asset data that satisfies a given Query and results in mutable results.
 void update(java.util.List<AssetData> data)
          Updates a given list of AssetData in the database.
 void update(java.util.List<AssetData> data, boolean keepCheckedOut)
          Updates a given list of AssetData in the database.

 

Method Detail

read

java.lang.Iterable<AssetData> read(Query query)
                                   throws AssetAccessException
Reads all asset data that satisfies a given Query
Parameters:
query - Query to be satisfied.
Returns:
Iterator of AssetData instances.
Throws:
AssetAccessException - is thrown when Query is invalid by the way of incorrect attributes or invalid operation given the choice of query algorithm. AssetAccessException also wraps any AssetExcptions thrown by the internal implementation.

readForUpdate

java.lang.Iterable<MutableAssetData> readForUpdate(Query query)
                                                   throws AssetAccessException
Reads all asset data that satisfies a given Query and results in mutable results.
Parameters:
query - Query to be satisfied.
Returns:
Iterator of MutableAssetData instances.
Throws:
AssetAccessException - is the layer specific failures and wraps other internal exceptions.

read

java.lang.Iterable<AssetData> read(java.util.List<AssetId> ids)
                                   throws AssetAccessException,
                                          AssetNotExistException
Reads asset data for all given AssetIds.
Parameters:
ids - List of AssetIds
Returns:
Iterator of AssetData instances belonging to AssetIds
Throws:
AssetAccessException - is thrown when any of the AssetIds passed in does not exist. AssetAccessException also wraps any AssetExcptions thrown by the internal implementation.
AssetNotExistException

readForUpdate

java.lang.Iterable<MutableAssetData> readForUpdate(java.util.List<AssetId> ids)
                                                   throws AssetAccessException,
                                                          AssetNotExistException
NOTE: This method is not implemented yet. Reads asset data for all given AssetIds and results in mutable results.
Parameters:
ids - List of AssetIds
Returns:
Iterator of MutableAssetData instances belonging to AssetIds
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.
AssetNotExistException

readAttributes

AssetData readAttributes(AssetId id,
                         java.util.List<java.lang.String> attributeNames)
                         throws AssetAccessException,
                                AssetNotExistException
Reads given set attribute data and returns an AssetData instance containing them.
Parameters:
id - AssetId to read attributes for
attributeNames - names of the attributes
Returns:
AssetData containing values for requested attributes.
Throws:
AssetAccessException - if thrown if the AssetId does not exist or attribute names passed are incorrect for the asset. AssetAccessException also wraps any AssetExcptions thrown by the internal implementation.
AssetNotExistException

insert

void insert(java.util.List<AssetData> data)
            throws AssetAccessException
Inserts a given List of AssetData instances in the database and new assets will be created with the data from the list After the operation complete, the passed in AssetData in the list will be populated with the newly created Asset id
Parameters:
data - AssetData to be inserted.
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

update

void update(java.util.List<AssetData> data)
            throws AssetAccessException
Updates a given list of AssetData in the database. Content Server will use the AssetId in AssetData objects to determine which Asset in Content Server to update. An AssetAccessException will be thrown if the AssetData passed in does not exist in Content Server
Parameters:
data - AssetData to be updated.
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

update

void update(java.util.List<AssetData> data,
            boolean keepCheckedOut)
            throws AssetAccessException
Updates a given list of AssetData in the database. Content Server will use the AssetId in AssetData objects to determine which Asset in Content Server to update. An AssetAccessException will be thrown if the AssetData passed in does not exist in Content Server
Parameters:
data - AssetData to be updated.
keepCheckedOut - do not checkin asset after save if revision tracked.
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

delete

void delete(java.util.List<AssetId> data)
            throws AssetAccessException
Deletes a given list of AssetIds from database. No assets will be deleted if one of them is being referenced.
Parameters:
data - AssetIds to be deleted.
Throws:
AssetAccessException - captures layer specific failures and wraps other internal exceptions.

newAttribiteData

AttributeData newAttribiteData(java.lang.String attributeName,
                               java.lang.String assetTypeName,
                               java.lang.String subtype)
Deprecated. Please use AssetDataManager.newAttributeData(String,String, String)
Creates an empty instance of AttributeData (of appropriate type and default)
Parameters:
attributeName - name of the attribute
assetTypeName - name of asset type
subtype - subtype of asset type.
Returns:
empty AttributeData for a given attribute name and attribute type.

newAttributeData

AttributeData newAttributeData(java.lang.String attributeName,
                               java.lang.String assetTypeName,
                               java.lang.String subtype)
Creates an empty instance of AttributeData (of appropriate type and default)
Parameters:
attributeName - name of the attribute
assetTypeName - name of asset type
subtype - subtype of asset type.
Returns:
empty AttributeData for a given attribute name and attribute type.

newAttributeData

AttributeData newAttributeData(AttributeDef attributeDef)
Create an attributeData with an attribute definition specified
Parameters:
attributeDef - the definition of the attribute
Returns:
the attribute data with empty value

newAssetData

AssetData newAssetData(java.lang.String assetTypeName,
                       AssetData example)
Creates an instance of AssetData (with copied instances of AttributeData from the example AssetData)
Parameters:
assetTypeName - name of the asset type
example - optional example AsetData the returned will be based on.
Returns:
an instance of AssetData

newAssetData

MutableAssetData newAssetData(java.lang.String assetTypeName,
                              java.lang.String subtype)
                              throws AssetAccessException
Create an empty instance of AssetData with empty instance of AttributeData
Parameters:
assetTypeName - the name of the assettype
subtype - the name of the aset subtype
Returns:
empty instance of AssetData
Throws:
AssetAccessException

Skip navigation links


Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.