org.alfresco.wcm.asset
Class AssetServiceImpl

java.lang.Object
  extended by org.alfresco.wcm.asset.AssetServiceImpl
All Implemented Interfaces:
AssetService

public class AssetServiceImpl
extends java.lang.Object
implements AssetService

Asset Service fundamental API.

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


Constructor Summary
AssetServiceImpl()
           
 
Method Summary
 void addAspect(AssetInfo asset, org.alfresco.service.namespace.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
 org.alfresco.service.cmr.repository.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
 org.alfresco.service.cmr.repository.ContentWriter createFileWebApp(java.lang.String sbStoreId, java.lang.String webApp, java.lang.String parentFolderPathRelativeToWebApp, 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
 org.alfresco.service.cmr.repository.ContentReader getContentReader(AssetInfo asset)
          Get content reader for given file asset, to allow file contents to be read
 org.alfresco.service.cmr.repository.ContentWriter getContentWriter(AssetInfo asset)
          Get content writer for given file asset, to allow file contents to be written or updated
 java.lang.String getLockOwner(AssetInfo asset)
          Runtime check to get lock (and owner) for asset - null if not locked
 boolean hasAspect(AssetInfo asset, org.alfresco.service.namespace.QName aspectName)
          True, if asset has given aspect applied
 boolean hasLockAccess(AssetInfo asset)
          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, org.alfresco.service.namespace.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 setAvmLockingService(AVMLockingService avmLockingService)
           
 void setAvmService(AVMService avmService)
           
 void setNodeService(org.alfresco.service.cmr.repository.NodeService avmNodeService)
           
 void setVirtServerRegistry(org.alfresco.mbeans.VirtServerRegistry virtServerRegistry)
           
 void updateAssetProperties(AssetInfo asset, java.util.Map properties)
          Update asset properties (will replace given set of properties, if they already exist)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetServiceImpl

public AssetServiceImpl()
Method Detail

setAvmService

public void setAvmService(AVMService avmService)

setAvmLockingService

public void setAvmLockingService(AVMLockingService avmLockingService)

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService avmNodeService)

setVirtServerRegistry

public void setVirtServerRegistry(org.alfresco.mbeans.VirtServerRegistry virtServerRegistry)

createFolderWebApp

public void createFolderWebApp(java.lang.String sbStoreId,
                               java.lang.String webApp,
                               java.lang.String parentFolderPathRelativeToWebApp,
                               java.lang.String name)
Description copied from interface: AssetService
Create folder within given sandbox and webApp

Specified by:
createFolderWebApp in interface AssetService

createFolder

public void createFolder(java.lang.String sbStoreId,
                         java.lang.String parentFolderPath,
                         java.lang.String name,
                         java.util.Map properties)
Description copied from interface: AssetService
Create folder within given sandbox

Specified by:
createFolder in interface AssetService

createFileWebApp

public org.alfresco.service.cmr.repository.ContentWriter createFileWebApp(java.lang.String sbStoreId,
                                                                          java.lang.String webApp,
                                                                          java.lang.String parentFolderPathRelativeToWebApp,
                                                                          java.lang.String name)
Description copied from interface: AssetService
Create (empty) file within given sandbox and webApp, return content writer for file contents

Specified by:
createFileWebApp in interface AssetService

createFile

public org.alfresco.service.cmr.repository.ContentWriter createFile(java.lang.String sbStoreId,
                                                                    java.lang.String parentFolderPath,
                                                                    java.lang.String name,
                                                                    java.util.Map properties)
Description copied from interface: AssetService
Create (empty) file within given sandbox, return content writer for file contents

Specified by:
createFile in interface AssetService

getContentWriter

public org.alfresco.service.cmr.repository.ContentWriter getContentWriter(AssetInfo asset)
Description copied from interface: AssetService
Get content writer for given file asset, to allow file contents to be written or updated

Specified by:
getContentWriter in interface AssetService

getContentReader

public org.alfresco.service.cmr.repository.ContentReader getContentReader(AssetInfo asset)
Description copied from interface: AssetService
Get content reader for given file asset, to allow file contents to be read

Specified by:
getContentReader in interface AssetService

getAssetWebApp

public AssetInfo getAssetWebApp(java.lang.String sbStoreId,
                                java.lang.String webApp,
                                java.lang.String pathRelativeToWebApp)
Description copied from interface: AssetService
Get asset (file or folder) for given sandbox, webApp and path (within webApp)

Returns null if the asset can not be found

Specified by:
getAssetWebApp in interface AssetService

getAssetWebApp

public AssetInfo getAssetWebApp(java.lang.String sbStoreId,
                                java.lang.String webApp,
                                java.lang.String pathRelativeToWebApp,
                                boolean includeDeleted)
Description copied from interface: AssetService
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

Specified by:
getAssetWebApp in interface AssetService

getAsset

public AssetInfo getAsset(java.lang.String sbStoreId,
                          java.lang.String path)
Description copied from interface: AssetService
Get asset (file or folder) for given sandbox and path

Returns null if the asset can not be found

Specified by:
getAsset in interface AssetService
Parameters:
sbStoreId - sandbox store id
path - asset path (eg. /www/avm_webapps/ROOT/myFile)
Returns:
AssetInfo asset info

getAsset

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

Returns null if the asset can not be found

Specified by:
getAsset in interface AssetService

getLockOwner

public java.lang.String getLockOwner(AssetInfo asset)
Description copied from interface: AssetService
Runtime check to get lock (and owner) for asset - null if not locked

Specified by:
getLockOwner in interface AssetService
Returns:
String lock owner (null if path not locked)

hasLockAccess

public boolean hasLockAccess(AssetInfo asset)
Description copied from interface: AssetService
Runtime check to check if the current user can perform (write) operations on the asset when locked

Specified by:
hasLockAccess in interface AssetService
Returns:
boolean true if current user has write access

updateAssetProperties

public void updateAssetProperties(AssetInfo asset,
                                  java.util.Map properties)
Description copied from interface: AssetService
Update asset properties (will replace given set of properties, if they already exist)

Specified by:
updateAssetProperties in interface AssetService

setAssetProperties

public void setAssetProperties(AssetInfo asset,
                               java.util.Map properties)
Description copied from interface: AssetService
Set asset properties (will replace all existing properties)

Specified by:
setAssetProperties in interface AssetService

addAspect

public void addAspect(AssetInfo asset,
                      org.alfresco.service.namespace.QName aspectName,
                      java.util.Map properties)
Description copied from interface: AssetService
Apply aspect to asset, with given properties (can be null)

Specified by:
addAspect in interface AssetService

removeAspect

public void removeAspect(AssetInfo asset,
                         org.alfresco.service.namespace.QName aspectName)
Description copied from interface: AssetService
Remove aspect from asset, and any related properties

Specified by:
removeAspect in interface AssetService

getAspects

public java.util.Set getAspects(AssetInfo asset)
Description copied from interface: AssetService
Get set of aspects applied to asset

Specified by:
getAspects in interface AssetService

hasAspect

public boolean hasAspect(AssetInfo asset,
                         org.alfresco.service.namespace.QName aspectName)
Description copied from interface: AssetService
True, if asset has given aspect applied

Specified by:
hasAspect in interface AssetService

getAssetProperties

public java.util.Map getAssetProperties(AssetInfo asset)
Description copied from interface: AssetService
Get asset properties

Specified by:
getAssetProperties in interface AssetService

listAssetsWebApp

public java.util.List listAssetsWebApp(java.lang.String sbStoreId,
                                       java.lang.String webApp,
                                       java.lang.String parentFolderPathRelativeToWebApp,
                                       boolean includeDeleted)
Description copied from interface: AssetService
List assets within given sandbox and webApp and path (within webApp), optionally include deleted

Specified by:
listAssetsWebApp in interface AssetService

listAssets

public java.util.List listAssets(java.lang.String sbStoreId,
                                 java.lang.String parentFolderPath,
                                 boolean includeDeleted)
Description copied from interface: AssetService
List assets within given sandbox and path, optionally include deleted

Specified by:
listAssets in interface AssetService

listAssets

public java.util.List listAssets(java.lang.String sbStoreId,
                                 int version,
                                 java.lang.String parentFolderPath,
                                 boolean includeDeleted)
Description copied from interface: AssetService
List assets within given sandbox version and path, optionally include deleted

Specified by:
listAssets in interface AssetService

deleteAsset

public void deleteAsset(AssetInfo asset)
Description copied from interface: AssetService
Delete asset

Specified by:
deleteAsset in interface AssetService

renameAsset

public AssetInfo renameAsset(AssetInfo asset,
                             java.lang.String newName)
Description copied from interface: AssetService
Rename asset

Specified by:
renameAsset in interface AssetService

moveAsset

public AssetInfo moveAsset(AssetInfo asset,
                           java.lang.String parentFolderPath)
Description copied from interface: AssetService
Move asset within sandbox

Specified by:
moveAsset in interface AssetService

copyAsset

public AssetInfo copyAsset(AssetInfo asset,
                           java.lang.String parentFolderPath)
Description copied from interface: AssetService
Copy asset(s) within sandbox

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

Specified by:
copyAsset in interface AssetService

bulkImport

public void bulkImport(java.lang.String sbStoreId,
                       java.lang.String parentFolderPath,
                       java.io.File zipFile,
                       boolean isHighByteZip)
Description copied from interface: AssetService
Bulk import assets into sandbox

Specified by:
bulkImport in interface AssetService


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