|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AssetDao
The Asset Data Access Object is the interface providing access to asset and asset type related data.
Method Summary | |
---|---|
boolean |
delete(AssetId assetId, MessageCollectors.DeleteAssetsMessageCollector collector) Deletes an asset. |
java.util.List<AssetId> |
delete(java.util.List<AssetId> assetIds, MessageCollectors.DeleteAssetsMessageCollector collector) Deletes a list of assets identified by the asset identifiers in assetsToDelete . |
boolean |
exists(AssetId assetId) Returns true if an asset exists. |
AssetTypeDef |
getDefinition(java.lang.String type, java.lang.String subType) Returns the asset type definition object for a specified asset type. |
java.util.List<AssetId> |
getFlexDefinitions(java.lang.String assetType, long site) Returns the List of definition asset identifiers for the given Flex asset type and site. |
java.util.List<AssetId> |
getReferences(AssetId assetId) Returns a list of asset identifiers for all assets which reference a given asset. |
java.util.List<SiteBean> |
getSitesInWhichEnabled(java.lang.String userName, java.lang.String assetType) Returns the list of sites for which the given asset type is enabled. |
java.util.List<SiteBean> |
getSitesInWhichShared(AssetId assetId) Returns the list of sites in which an asset is shared. |
java.util.List<java.lang.String> |
getSubTypes(java.lang.String assetType, long site) Returns the List of subtypes for the given asset type and site. |
AssetData |
newAsset(AssetTypeDef assetTypeDef) Returns an empty asset data instance for a given asset type. |
AssetData |
read(AssetId assetId) Returns the data associated with an asset. |
AssetData |
read(AssetId assetId, java.util.List<java.lang.String> fields) Returns the data associated with an asset, retrieving only a subset of the available fields. |
java.util.List<AssetId> |
removeReferences(AssetId assetId, java.util.List<AssetId> references, MessageCollectors.RemoveReferenceMessageCollector collector) Removes the references of an asset. |
AssetSaveStatusBean |
save(AssetData assetData, MessageCollectors.SaveAssetsMessageCollector collector) Saves the data associated with an asset. |
boolean |
share(AssetId assetId, java.util.List<java.lang.Long> sites) Shares an asset with all the sites in the specified list. |
Methods inherited from interface com.fatwire.services.dao.DataAccessObject |
---|
getResponse, getService, setService |
Method Detail |
---|
boolean exists(AssetId assetId) throws DataAccessException
Returns true
if an asset exists.
assetId
- the identifier for the asset.true
if an asset exists.ServiceException
- wraps any exception underlying the service call.DataAccessException
AssetTypeDef getDefinition(java.lang.String type, java.lang.String subType) throws DataAccessException
Returns the asset type definition object for a specified asset type.
The asset type argument has the optional sub-type attribute which is optional for Assetmaker asset types and mandatory for Flex asset types.type,
- String the asset type for which the type definition is to be retrieved.subType,
- String the asset sub type for which the type definition is to be retrieved.DataAccessException
- wraps any underlying exception caused during data access.AssetData newAsset(AssetTypeDef assetTypeDef) throws DataAccessException
assetTypeDef
- asset type definition to use in creating the empty asset data object.AssetData
instance.DataAccessException
- wraps any underlying exception caused during data access.AssetData read(AssetId assetId) throws DataAccessException
assetId
- the identifier of the asset whose data is to be retrieved.DataAccessException
- wraps any underlying exception caused during data access.AssetData read(AssetId assetId, java.util.List<java.lang.String> fields) throws DataAccessException
Returns the data associated with an asset, retrieving only a subset of the available fields.
If the list contains fields which are not available in the asset definition, those fields are ignored. This method should be preferred overAssetDao.read(AssetId)
if it is only required to read only specific fields of the asset.assetId
- the identifier of the asset whose data is to be retrieved.fields
- the list of fields which are to be retrieved.DataAccessException
- wraps any underlying exception caused during data access.AssetSaveStatusBean save(AssetData assetData, MessageCollectors.SaveAssetsMessageCollector collector) throws DataAccessException
true
if the asset has changed as a result of this save.assetData
- the data associated with the asset to save.true
if the asset has changed as a result of this save, false
otherwise.DataAccessException
- wraps any underlying exception caused during data access.boolean delete(AssetId assetId, MessageCollectors.DeleteAssetsMessageCollector collector) throws DataAccessException
assetId
- the identifier of the asset to delete.true
if delete was successful, false
otherwise.DataAccessException
- wraps any underlying exception caused during data access.java.util.List<AssetId> delete(java.util.List<AssetId> assetIds, MessageCollectors.DeleteAssetsMessageCollector collector) throws DataAccessException
assetsToDelete
. This method is used primarily for bulk delete of assets. This method should be safe i.e., it should fail to delete an asset if there are integrity constraints (for example, references by other assets).assetIds
- the list containing identifiers of the assets to delete.DataAccessException
- wraps any underlying exception caused during data access.java.util.List<AssetId> getReferences(AssetId assetId) throws DataAccessException
assetId
- the identifier for the asset whose references are to be retrieved.DataAccessException
- wraps any underlying exception caused during data access.java.util.List<AssetId> removeReferences(AssetId assetId, java.util.List<AssetId> references, MessageCollectors.RemoveReferenceMessageCollector collector) throws DataAccessException
assetId
- identifier of the asset to delete.references
- list containing identifiers of assets referencing asset
.DataAccessException
- wraps any underlying exception caused during data access.java.util.List<SiteBean> getSitesInWhichEnabled(java.lang.String userName, java.lang.String assetType) throws DataAccessException
type
- the asset type which should be enabled in the list of sites returned.DataAccessException
- wraps any underlying exception caused during data access.java.util.List<SiteBean> getSitesInWhichShared(AssetId assetId) throws DataAccessException
assetId
- identifier of the asset which should be shared in the list of sites returned.DataAccessException
- wraps any underlying exception caused during data access.boolean share(AssetId assetId, java.util.List<java.lang.Long> sites) throws DataAccessException
assetId
- identifier of the asset to share.sites
- list of sites with which asset
is to be shared.true
if the asset could successfully be shared across all specified sites.DataAccessException
- wraps any underlying exception caused during data access.java.util.List<java.lang.String> getSubTypes(java.lang.String assetType, long site) throws DataAccessException
Returns the List of subtypes for the given asset type and site.
If the specified type is a Flex asset type, the returned list will contain the available definitions as the sub-types.type
- the asset type for which to retrieve the list of sub types in the specified site (the type returned by TypeBean.getType()
is considered).site
- the site in which to search for the subtypes.DataAccessException
- wraps any underlying exception caused during data access.java.util.List<AssetId> getFlexDefinitions(java.lang.String assetType, long site) throws DataAccessException
Returns the List of definition asset identifiers for the given Flex asset type and site.
This is relevant for Flex asset types only because the Flex asset type definitions (sub-types) are also in-turn assets. If the specified type is not a flex asset type, then the list returned isnull
.type
- the flex asset type for which the definitions are to be retrieved.site
- the site in which to search for the definitions.DataAccessException
- wraps any underlying exception caused during data access.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.