|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AssetService
The Asset Service is the interface providing asset and asset type related services.
Method Summary | |
---|---|
AssetSaveStatusBean |
copy(AssetId source,
java.lang.String targetName)
Copies an asset and returns a new asset with the specified name by copying fields from the source asset and mutating field values as governed by the dimension object. |
boolean |
delete(AssetId assetId)
Deletes an asset. |
java.util.List<AssetId> |
delete(java.util.List<AssetId> assetIds)
Deletes a list of assets identified by the asset identifiers in assetsToDelete . |
boolean |
exists(AssetId assetId)
Returns true if an asset exists. |
AssetTypeDef |
getDefinition(AssetId assetId)
Returns the asset type definition object for a specified asset. |
AssetTypeDef |
getDefinition(TypeBean type)
Returns the asset type definition object for a specified asset type. |
java.util.List<AssetId> |
getFlexDefinitions(java.lang.String assetType,
java.lang.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 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<TypeBean> |
getSubtypes(java.lang.String assetType,
java.lang.Long site)
Returns the List of subtypes for the given asset type and site. |
java.util.List<AssetBean> |
mutateAsset(java.util.List<AssetBean> mutators)
Mutates asset data corresponding to the asset referenced by the specified asset bean according to the values provided in the mutators. |
AssetData |
newAsset(TypeBean type,
StartMenuBean startMenu)
Returns an empty asset data instance for a given asset type. |
AssetData |
read(AssetId assetId)
Returns data associated with asset. |
AssetData |
read(AssetId assetId,
java.util.List<java.lang.String> fields)
Returns a subset of the data associated with asset, retrieving only a subset of the available fields. |
java.util.List<AssetId> |
removeReferences(AssetId assetId,
java.util.List<AssetId> references)
Removes the references of an asset. |
AssetSaveStatusBean |
save(AssetData assetData)
Saves the data associated with an asset. |
java.lang.Boolean |
share(AssetId assetId,
java.util.List<java.lang.Long> sites)
Shares an asset with all the sites in the specified list. |
AssetSaveStatusBean |
translate(AssetId assetid,
java.lang.String targetName,
DimensionBean dimension)
Translates an asset and returns a new asset as governed by the specified dimension object. |
Methods inherited from interface com.fatwire.services.Service |
---|
getManager, getResponse, setManager |
Method Detail |
---|
AssetTypeDef getDefinition(TypeBean type) throws ServiceException
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
- the asset type and sub type, for which the type definition is to be
retrieved.
ServiceException
- wraps any exception underlying the service call.AssetTypeDef getDefinition(AssetId assetId) throws ServiceException
Returns the asset type definition object for a specified asset.
assetId
- the identifier for the asset whose type definition is to be retrieved.
ServiceException
- wraps any exception underlying the service call.AssetData newAsset(TypeBean type, StartMenuBean startMenu) throws ServiceException
Returns an empty asset data instance for a given asset type.
This method can be considered a starting point for creating a new asset for a specific asset type. The asset data will be populated with the default values set in the start menu, only if a non-nullstartMenu
is passed, and the start menu exists.
Note: While creating the start menu to be passed in the parameter, it
is necessary to make sure that the sub-type is populated correctly as per
the definition of TypeBean
.
type
- the asset type whose instance is to be created.startMenu
- the start menu corresponding to the asset type, set as null
to avoid setting default values.
ServiceException
TypeBean
AssetData read(AssetId assetId) throws ServiceException
Returns data associated with asset.
This method accepts an asset identifier. It reads the data associated with the asset and populates the data associated with that asset. If the asset is voided or if the asset does not exist, this method returnsnull
.
assetId
- the identifier of the asset to retrieve.
ServiceException
- wraps any exception underlying the service call.AssetData read(AssetId assetId, java.util.List<java.lang.String> fields) throws ServiceException
Returns a subset of the data associated with asset, retrieving only a subset of the available fields.
This method accepts an asset identifier. It reads the data associated with the asset and populates the data associated with that asset. If the asset is voided or if the asset does not exist, this method returnsnull
. If the list contains fields which are not available in
the asset definition, those fields are ignored.
This method should be preferred over AssetService.read(AssetId, List)
if
it is only required to read only specific fields of the asset.
assetId
- the identifier for the asset to load.fields
- the list of fields which are to be retrieved.
ServiceException
- wraps any exception underlying the service call.AssetSaveStatusBean save(AssetData assetData) throws ServiceException
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.
ServiceException
- wraps any exception underlying the service call.boolean delete(AssetId assetId) throws ServiceException
assetId
- the identifier of the asset to delete.
true
if delete was successful, false
otherwise.
ServiceException
- wraps any exception underlying the service call.java.util.List<AssetId> delete(java.util.List<AssetId> assetIds) throws ServiceException
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.
ServiceException
- wraps any exception underlying the service call.java.util.List<AssetId> getReferences(AssetId assetId) throws ServiceException
assetId
- the identifier for the asset whose references are to be retrieved.
ServiceException
- wraps any exception underlying the service call.java.util.List<AssetId> removeReferences(AssetId assetId, java.util.List<AssetId> references) throws ServiceException
assetId
- identifier of the asset to delete.references
- list containing identifiers of assets referencing asset
.
ServiceException
- wraps any exception underlying the service call.java.util.List<SiteBean> getSitesInWhichEnabled(java.lang.String assetType) throws ServiceException
type
- the asset type which should be enabled in the list of sites returned.
ServiceException
- wraps any exception underlying the service call.java.util.List<SiteBean> getSitesInWhichShared(AssetId assetId) throws ServiceException
assetId
- identifier of the asset which should be shared in the list of sites
returned.
ServiceException
- wraps any exception underlying the service call.java.lang.Boolean share(AssetId assetId, java.util.List<java.lang.Long> sites) throws ServiceException
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.
ServiceException
- wraps any exception underlying the service call.java.util.List<TypeBean> getSubtypes(java.lang.String assetType, java.lang.Long site) throws ServiceException
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.
TypeBean
containing type
as the
type, and the retrieved sub-types as the sub-type.
ServiceException
- wraps any exception underlying the service call.java.util.List<AssetId> getFlexDefinitions(java.lang.String assetType, java.lang.Long site) throws ServiceException
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.
ServiceException
- wraps any exception underlying the service call.AssetSaveStatusBean translate(AssetId assetid, java.lang.String targetName, DimensionBean dimension) throws ServiceException
Translates an asset and returns a new asset as governed by the specified dimension object.
source
- the asset from which the translation is to be made.targetName
- name of the target asset which is created by the translation process.dimension
- name of the dimension using which the translation has to be made.
ServiceException
- wraps any exception underlying the service call.java.util.List<AssetBean> mutateAsset(java.util.List<AssetBean> mutators) throws ServiceException
Mutates asset data corresponding to the asset referenced by the specified asset bean according to the values provided in the mutators.
The primary reason for this method is to provide partial data for an asset instead of anAssetData
object. It reads the asset
referenced in the mutator, updates the asset data according to the
mutator. If the data could not be updated for some assets, these assets
are added in returned list.
mutators
- list of asset data mutators.
AssetBean
instances for those assets which could
not be modified using their mutators.
ServiceException
- wraps any exception underlying the service call.AssetSaveStatusBean copy(AssetId source, java.lang.String targetName) throws ServiceException
Copies an asset and returns a new asset with the specified name by copying fields from the source asset and mutating field values as governed by the dimension object.
source
- the identifier for the asset.targetName
- name of the target asset which is created by the copy process.
ServiceException
- wraps any exception underlying the service call.boolean exists(AssetId assetId) throws ServiceException
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |