org.alfresco.wcm.asset
Interface AssetService

All Known Implementing Classes:
AssetServiceImpl

@PublicService
public interface AssetService

Asset Service fundamental API.

This service API is designed to support the public facing Asset APIs.


Method Summary
 void addAspect(AssetInfo asset, QName aspectName, java.util.Map properties)
          Apply aspect to asset, with given properties (can be null)
 void bulkImport(java.lang.String sbStoreId, java.lang.String parentFolderPath, java.io.File zipFile, boolean isHighByteZip)
          Bulk import assets into sandbox
 AssetInfo copyAsset(AssetInfo asset, java.lang.String parentFolderPath)
          Copy asset(s) within sandbox
 ContentWriter createFile(java.lang.String sbStoreId, java.lang.String parentFolderPath, java.lang.String name, java.util.Map properties)
          Create (empty) file within given sandbox, return content writer for file contents
 ContentWriter createFileWebApp(java.lang.String sbStoreId, java.lang.String webApp, java.lang.String parentFolderPath, java.lang.String name)
          Create (empty) file within given sandbox and webApp, return content writer for file contents
 void createFolder(java.lang.String sbStoreId, java.lang.String parentFolderPath, java.lang.String name, java.util.Map properties)
          Create folder within given sandbox
 void createFolderWebApp(java.lang.String sbStoreId, java.lang.String webApp, java.lang.String parentFolderPathRelativeToWebApp, java.lang.String name)
          Create folder within given sandbox and webApp
 void deleteAsset(AssetInfo asset)
          Delete asset
 java.util.Set getAspects(AssetInfo asset)
          Get set of aspects applied to asset
 AssetInfo getAsset(java.lang.String sbStoreId, int version, java.lang.String path, boolean includeDeleted)
          Get asset (file or folder) for given sandbox version and path, optionally include deleted assets
 AssetInfo getAsset(java.lang.String sbStoreId, java.lang.String path)
          Get asset (file or folder) for given sandbox and path
 java.util.Map getAssetProperties(AssetInfo asset)
          Get asset properties
 AssetInfo getAssetWebApp(java.lang.String sbStoreId, java.lang.String webApp, java.lang.String pathRelativeToWebApp)
          Get asset (file or folder) for given sandbox, webApp and path (within webApp)
 AssetInfo getAssetWebApp(java.lang.String sbStoreId, java.lang.String webApp, java.lang.String pathRelativeToWebApp, boolean includeDeleted)
          Get asset (file or folder) for given sandbox, webApp and path (within webApp), optionally include deleted assets
 ContentReader getContentReader(AssetInfo fileAsset)
          Get content reader for given file asset, to allow file contents to be read
 ContentWriter getContentWriter(AssetInfo fileAsset)
          Get content writer for given file asset, to allow file contents to be written or updated
 java.lang.String getLockOwner(AssetInfo fileAsset)
          Runtime check to get lock (and owner) for asset - null if not locked
 boolean hasAspect(AssetInfo asset, QName aspectName)
          True, if asset has given aspect applied
 boolean hasLockAccess(AssetInfo fileAsset)
          Runtime check to check if the current user can perform (write) operations on the asset when locked
 java.util.List listAssets(java.lang.String sbStoreId, int version, java.lang.String parentFolderPath, boolean includeDeleted)
          List assets within given sandbox version and path, optionally include deleted
 java.util.List listAssets(java.lang.String sbStoreId, java.lang.String parentFolderPath, boolean includeDeleted)
          List assets within given sandbox and path, optionally include deleted
 java.util.List listAssetsWebApp(java.lang.String sbStoreId, java.lang.String webApp, java.lang.String parentFolderPathRelativeToWebApp, boolean includeDeleted)
          List assets within given sandbox and webApp and path (within webApp), optionally include deleted
 AssetInfo moveAsset(AssetInfo asset, java.lang.String parentFolderPath)
          Move asset within sandbox
 void removeAspect(AssetInfo asset, QName aspectName)
          Remove aspect from asset, and any related properties
 AssetInfo renameAsset(AssetInfo asset, java.lang.String newName)
          Rename asset
 void setAssetProperties(AssetInfo asset, java.util.Map properties)
          Set asset properties (will replace all existing properties)
 void updateAssetProperties(AssetInfo asset, java.util.Map properties)
          Update asset properties (will replace given set of properties, if they already exist)
 

Method Detail

createFolderWebApp

void createFolderWebApp(java.lang.String sbStoreId,
                        java.lang.String webApp,
                        java.lang.String parentFolderPathRelativeToWebApp,
                        java.lang.String name)
Create folder within given sandbox and webApp

Parameters:
sbStoreId -
webApp -
parentFolderPathRelativeToWebApp -
name -

createFolder

void createFolder(java.lang.String sbStoreId,
                  java.lang.String parentFolderPath,
                  java.lang.String name,
                  java.util.Map properties)
Create folder within given sandbox

Parameters:
sbStoreId -
parentFolderPath -
name -
properties -

createFileWebApp

ContentWriter createFileWebApp(java.lang.String sbStoreId,
                               java.lang.String webApp,
                               java.lang.String parentFolderPath,
                               java.lang.String name)
Create (empty) file within given sandbox and webApp, return content writer for file contents

Parameters:
sbStoreId -
webApp -
parentFolderPath -
name -
Returns:

createFile

ContentWriter createFile(java.lang.String sbStoreId,
                         java.lang.String parentFolderPath,
                         java.lang.String name,
                         java.util.Map properties)
Create (empty) file within given sandbox, return content writer for file contents

Parameters:
sbStoreId -
parentFolderPath -
name -
properties -
Returns:

getAssetWebApp

AssetInfo getAssetWebApp(java.lang.String sbStoreId,
                         java.lang.String webApp,
                         java.lang.String pathRelativeToWebApp)
Get asset (file or folder) for given sandbox, webApp and path (within webApp)

Returns null if the asset can not be found

Parameters:
sbStoreId -
webApp -
pathRelativeToWebApp -
Returns:

getAssetWebApp

AssetInfo getAssetWebApp(java.lang.String sbStoreId,
                         java.lang.String webApp,
                         java.lang.String pathRelativeToWebApp,
                         boolean includeDeleted)
Get asset (file or folder) for given sandbox, webApp and path (within webApp), optionally include deleted assets

Returns null if the asset can not be found

Parameters:
sbStoreId -
webApp -
pathRelativeToWebApp -
includeDeleted -
Returns:
AssetInfo asset info

getAsset

AssetInfo getAsset(java.lang.String sbStoreId,
                   java.lang.String path)
Get asset (file or folder) for given sandbox and path

Returns null if the asset can not be found

Parameters:
sbStoreId - sandbox store id
path - asset path (eg. /www/avm_webapps/ROOT/myFile)
Returns:
AssetInfo asset info

getAsset

AssetInfo getAsset(java.lang.String sbStoreId,
                   int version,
                   java.lang.String path,
                   boolean includeDeleted)
Get asset (file or folder) for given sandbox version and path, optionally include deleted assets

Returns null if the asset can not be found

Parameters:
sbStoreId -
version -
path -
includeDeleted -
Returns:
AssetInfo asset info

getContentWriter

ContentWriter getContentWriter(AssetInfo fileAsset)
Get content writer for given file asset, to allow file contents to be written or updated

Parameters:
asset -
Returns:

getContentReader

ContentReader getContentReader(AssetInfo fileAsset)
Get content reader for given file asset, to allow file contents to be read

Parameters:
asset -
Returns:

getAssetProperties

java.util.Map getAssetProperties(AssetInfo asset)
Get asset properties

Parameters:
asset -
Returns:

setAssetProperties

void setAssetProperties(AssetInfo asset,
                        java.util.Map properties)
Set asset properties (will replace all existing properties)

Parameters:
asset -
properties -

updateAssetProperties

void updateAssetProperties(AssetInfo asset,
                           java.util.Map properties)
Update asset properties (will replace given set of properties, if they already exist)

Parameters:
asset -
properties -

addAspect

void addAspect(AssetInfo asset,
               QName aspectName,
               java.util.Map properties)
Apply aspect to asset, with given properties (can be null)

Parameters:
asset -
aspectName -
properties -

removeAspect

void removeAspect(AssetInfo asset,
                  QName aspectName)
Remove aspect from asset, and any related properties

Parameters:
asset -
aspectName -

getAspects

java.util.Set getAspects(AssetInfo asset)
Get set of aspects applied to asset

Parameters:
asset -
Returns:
list of aspects

hasAspect

boolean hasAspect(AssetInfo asset,
                  QName aspectName)
True, if asset has given aspect applied

Parameters:
asset -
aspectName -
Returns:

listAssetsWebApp

java.util.List listAssetsWebApp(java.lang.String sbStoreId,
                                java.lang.String webApp,
                                java.lang.String parentFolderPathRelativeToWebApp,
                                boolean includeDeleted)
List assets within given sandbox and webApp and path (within webApp), optionally include deleted

Parameters:
sbStoreId -
webApp -
parentFolderPathRelativeToWebApp -
includeDeleted -
Returns:
list of assets

listAssets

java.util.List listAssets(java.lang.String sbStoreId,
                          java.lang.String parentFolderPath,
                          boolean includeDeleted)
List assets within given sandbox and path, optionally include deleted

Parameters:
sbStoreId -
parentFolderPath -
includeDeleted -
Returns:
list of assets

listAssets

java.util.List listAssets(java.lang.String sbStoreId,
                          int version,
                          java.lang.String parentFolderPath,
                          boolean includeDeleted)
List assets within given sandbox version and path, optionally include deleted

Parameters:
sbStoreId -
version -
parentFolderPath -
includeDeleted -
Returns:
list of assets

deleteAsset

void deleteAsset(AssetInfo asset)
Delete asset

Parameters:
asset -

renameAsset

AssetInfo renameAsset(AssetInfo asset,
                      java.lang.String newName)
Rename asset

Parameters:
asset -
newName -
Returns:
AssetInfo asset info

copyAsset

AssetInfo copyAsset(AssetInfo asset,
                    java.lang.String parentFolderPath)
Copy asset(s) within sandbox

Note: folder asset will be recursively copied Note: file asset(s) must have content

Parameters:
asset -
parentFolderPath -
Returns:
AssetInfo asset info

moveAsset

AssetInfo moveAsset(AssetInfo asset,
                    java.lang.String parentFolderPath)
Move asset within sandbox

Parameters:
asset -
parentFolderPath -
Returns:
AssetInfo asset info

bulkImport

void bulkImport(java.lang.String sbStoreId,
                java.lang.String parentFolderPath,
                java.io.File zipFile,
                boolean isHighByteZip)
Bulk import assets into sandbox

Parameters:
sbStoreId -
parentFolderPath -
zipFile -

getLockOwner

java.lang.String getLockOwner(AssetInfo fileAsset)
Runtime check to get lock (and owner) for asset - null if not locked

Parameters:
asset -
Returns:
String lock owner (null if path not locked)

hasLockAccess

boolean hasLockAccess(AssetInfo fileAsset)
Runtime check to check if the current user can perform (write) operations on the asset when locked

Parameters:
asset -
Returns:
boolean true if current user has write access


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.