org.alfresco.wcm.sandbox
Class SandboxServiceImpl

java.lang.Object
  extended by org.alfresco.wcm.sandbox.SandboxServiceImpl
All Implemented Interfaces:
SandboxService

public class SandboxServiceImpl
extends java.lang.Object
implements SandboxService

Sandbox Service fundamental API.

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


Constructor Summary
SandboxServiceImpl()
           
 
Method Summary
 SandboxInfo createAuthorSandbox(java.lang.String wpStoreId)
          Create author/user sandbox within a web project for the current user
 SandboxInfo createAuthorSandbox(java.lang.String wpStoreId, java.lang.String userName)
          Create author/user sandbox within a web project for the given user
protected  org.alfresco.util.Pair createWorkflowSandbox(java.lang.String workflowName, java.util.Map workflowParams, java.lang.String stagingSandboxId, java.util.List srcPaths, java.util.Map expirationDates)
          Creates a workflow sandbox for all the submitted items
 void deleteSandbox(java.lang.String sbStoreId)
          Delete the sandbox
 SandboxInfo getAuthorSandbox(java.lang.String wpStoreId)
          Gets author/user sandbox info for the current user
 SandboxInfo getAuthorSandbox(java.lang.String wpStoreId, java.lang.String userName)
          Gets author/user sandbox info for the given user
 SandboxInfo getSandbox(java.lang.String sbStoreId)
          Get sandbox info
 SandboxInfo getStagingSandbox(java.lang.String wpStoreId)
          Gets staging sandbox info
 boolean isSandboxType(java.lang.String sbStoreId, org.alfresco.service.namespace.QName sandboxType)
          Return true if sandbox is visible to user and is of given type
 java.util.List listChanged(java.lang.String sbStoreId, java.lang.String relativePath, boolean includeDeleted)
          List changed assets for given sandbox path (eg.
 java.util.List listChanged(java.lang.String srcSandboxStoreId, java.lang.String srcRelativePath, java.lang.String dstSandboxStoreId, java.lang.String dstRelativePath, boolean includeDeleted)
          List changed (new/modified/deleted) assets between any two sandbox paths
 java.util.List listChangedAll(java.lang.String sbStoreId, boolean includeDeleted)
          List all changed assets for given sandbox (eg.
 java.util.List listChangedWebApp(java.lang.String sbStoreId, java.lang.String webApp, boolean includeDeleted)
          List changed assets for given sandbox and web app (eg.
 java.util.List listSandboxes(java.lang.String wpStoreId)
          List the available sandboxes for the current user and given web project
 java.util.List listSandboxes(java.lang.String wpStoreId, java.lang.String userName)
          List the available sandboxes for the given user and web project
 java.util.List listSnapshots(java.lang.String sbStoreId, boolean includeSystemGenerated)
          List all snapshots (sandbox versions) for the given sandbox (ie.
 java.util.List listSnapshots(java.lang.String sbStoreId, java.util.Date from, java.util.Date to, boolean includeSystemGenerated)
          List snapshots (sandbox versions) for the given sandbox between given dates (ie.
 void revert(java.lang.String sbStoreId, java.lang.String relativePath)
          Revert changed asset(s) for given sandbox path (eg.
 void revertAll(java.lang.String sbStoreId)
          Revert all changed assets for given sandbox (eg.
 void revertList(java.lang.String sbStoreId, java.util.List relativePaths)
          Revert list of changed assets for given sandbox (eg.
 void revertListAssets(java.lang.String sbStoreId, java.util.List assets)
          Revert list of changed assets for given sandbox (eg.
 void revertSnapshot(java.lang.String sbStoreId, int revertVersion)
          Revert sandbox to a specific snapshot version ID (ie.
 void revertWebApp(java.lang.String sbStoreId, java.lang.String webApp)
          Revert changed assets for given sandbox and web app (eg.
 void setAssetService(AssetService assetService)
           
 void setAvmLockingService(AVMLockingService avmLockingService)
           
 void setAvmService(AVMService avmService)
           
 void setAvmSyncService(AVMSyncService avmSyncService)
           
 void setNameMatcher(org.alfresco.util.NameMatcher nameMatcher)
           
 void setSandboxFactory(SandboxFactory sandboxFactory)
           
 void setTransactionService(TransactionService transactionService)
           
 void setVirtServerRegistry(org.alfresco.mbeans.VirtServerRegistry virtServerRegistry)
           
 void setWebProjectService(WebProjectService wpService)
           
 void setWorkflowService(WorkflowService workflowService)
           
protected  void startWorkflow(java.lang.String wpStoreId, java.lang.String sbStoreId, SandboxInfo wfSandboxInfo, java.lang.String webApp, java.lang.String workflowName, java.util.Map workflowParams, java.lang.String submitLabel, java.lang.String submitComment, java.util.Date launchDate, boolean autoDeploy)
          Starts the configured workflow to allow the submitted items to be link checked and reviewed.
 void submit(java.lang.String sbStoreId, java.lang.String relativePath, java.lang.String submitLabel, java.lang.String submitComment)
          Submit changed asset(s) for given sandbox path (eg.
 void submitAll(java.lang.String sbStoreId, java.lang.String submitLabel, java.lang.String submitComment)
          Submit all changed assets for given sandbox (eg.
 void submitList(java.lang.String sbStoreId, java.util.List relativePaths, java.lang.String submitLabel, java.lang.String submitComment)
          Submit list of changed assets for given sandbox (eg.
 void submitListAssets(java.lang.String sbStoreId, java.util.List relativePaths, java.lang.String workflowName, java.util.Map workflowParams, java.lang.String submitLabel, java.lang.String submitComment, java.util.Map expirationDates, java.util.Date launchDate, boolean autoDeploy)
          Submit list of changed assets for given sandbox (eg.
 void submitListAssets(java.lang.String sbStoreId, java.util.List assets, java.lang.String submitLabel, java.lang.String submitComment)
          Submit list of changed assets for given sandbox (eg.
 void submitWebApp(java.lang.String sbStoreId, java.lang.String webApp, java.lang.String submitLabel, java.lang.String submitComment)
          Submit changed assets for given sandbox and web app (eg.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SandboxServiceImpl

public SandboxServiceImpl()
Method Detail

setWebProjectService

public void setWebProjectService(WebProjectService wpService)

setSandboxFactory

public void setSandboxFactory(SandboxFactory sandboxFactory)

setAvmService

public void setAvmService(AVMService avmService)

setAvmLockingService

public void setAvmLockingService(AVMLockingService avmLockingService)

setAvmSyncService

public void setAvmSyncService(AVMSyncService avmSyncService)

setNameMatcher

public void setNameMatcher(org.alfresco.util.NameMatcher nameMatcher)

setVirtServerRegistry

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

setWorkflowService

public void setWorkflowService(WorkflowService workflowService)

setAssetService

public void setAssetService(AssetService assetService)

setTransactionService

public void setTransactionService(TransactionService transactionService)

createAuthorSandbox

public SandboxInfo createAuthorSandbox(java.lang.String wpStoreId)
Description copied from interface: SandboxService
Create author/user sandbox within a web project for the current user

If the author sandbox already exists for this web project then it will be returned

Specified by:
createAuthorSandbox in interface SandboxService
Parameters:
wpStoreId - web project store id
Returns:
SandboxInfo the created user sandbox info

createAuthorSandbox

public SandboxInfo createAuthorSandbox(java.lang.String wpStoreId,
                                       java.lang.String userName)
Description copied from interface: SandboxService
Create author/user sandbox within a web project for the given user

If the author sandbox already exists for this web project then it will be returned

Current user must be a content manager for the web project

Specified by:
createAuthorSandbox in interface SandboxService
Parameters:
wpStoreId - web project store id
userName - user name
Returns:
SandboxInfo the created user sandbox info

listSandboxes

public java.util.List listSandboxes(java.lang.String wpStoreId)
Description copied from interface: SandboxService
List the available sandboxes for the current user and given web project

Specified by:
listSandboxes in interface SandboxService
Parameters:
wpStoreId - web project store id
Returns:
List list of sandbox info

listSandboxes

public java.util.List listSandboxes(java.lang.String wpStoreId,
                                    java.lang.String userName)
Description copied from interface: SandboxService
List the available sandboxes for the given user and web project

Current user must be a content manager for the web project

Specified by:
listSandboxes in interface SandboxService
Parameters:
wpStoreId - web project store id
userName - user name
Returns:
List list of sandbox info

isSandboxType

public boolean isSandboxType(java.lang.String sbStoreId,
                             org.alfresco.service.namespace.QName sandboxType)
Description copied from interface: SandboxService
Return true if sandbox is visible to user and is of given type

eg. isSandboxType("test123--myusername", SandboxConstants.PROP_SANDBOX_AUTHOR_MAIN)

Specified by:
isSandboxType in interface SandboxService
Parameters:
sbStoreId - sandbox store id
sandboxType - sandbox type (see SandboxConstants)
Returns:
boolean true, if sandbox exists with given type

getSandbox

public SandboxInfo getSandbox(java.lang.String sbStoreId)
Description copied from interface: SandboxService
Get sandbox info

Specified by:
getSandbox in interface SandboxService
Parameters:
sbStoreId - sandbox store id
Returns:
SandboxInfo null if sandbox does not exist or is not visible to the current user

getAuthorSandbox

public SandboxInfo getAuthorSandbox(java.lang.String wpStoreId)
Description copied from interface: SandboxService
Gets author/user sandbox info for the current user

Returns null if the author sandbox can not be found

Specified by:
getAuthorSandbox in interface SandboxService
Parameters:
wpStoreId - web project store id
Returns:
SandboxInfo author sandbox info

getAuthorSandbox

public SandboxInfo getAuthorSandbox(java.lang.String wpStoreId,
                                    java.lang.String userName)
Description copied from interface: SandboxService
Gets author/user sandbox info for the given user

Returns null if the user sandbox can not be found

Current user must be a content manager for the web project

Specified by:
getAuthorSandbox in interface SandboxService
Parameters:
wpStoreId - web project store id
userName - userName
Returns:
SandboxInfo author sandbox info

getStagingSandbox

public SandboxInfo getStagingSandbox(java.lang.String wpStoreId)
Description copied from interface: SandboxService
Gets staging sandbox info

Returns null if the staging sandbox can not be found

Specified by:
getStagingSandbox in interface SandboxService
Parameters:
wpStoreId - web project store id
Returns:
SandboxInfo staging sandbox info

deleteSandbox

public void deleteSandbox(java.lang.String sbStoreId)
Description copied from interface: SandboxService
Delete the sandbox

If the sandbox does not exist, will log a warning and succeed

Current user must be a content manager for the web project (associated with the sandbox)

Specified by:
deleteSandbox in interface SandboxService
Parameters:
sbStoreId - sandbox store id

listChangedAll

public java.util.List listChangedAll(java.lang.String sbStoreId,
                                     boolean includeDeleted)
Description copied from interface: SandboxService
List all changed assets for given sandbox (eg. for user sandbox compared to staging sandbox)

Note: This will list all new/modified/deleted assets from the sandbox root directory (eg. /www/avm_webapps) - ie. across all web apps

Specified by:
listChangedAll in interface SandboxService
Parameters:
sbStoreId - sandbox store id
includeDeleted - if true, include deleted assets as well as new/modified assets
Returns:
List list of all changed assets

listChangedWebApp

public java.util.List listChangedWebApp(java.lang.String sbStoreId,
                                        java.lang.String webApp,
                                        boolean includeDeleted)
Description copied from interface: SandboxService
List changed assets for given sandbox and web app (eg. in user sandbox)

Note: This will list new/modified/deleted assets for the given web app

Specified by:
listChangedWebApp in interface SandboxService
Parameters:
sbStoreId - sandbox store id
webApp - web app to filter by
includeDeleted - if true, include deleted assets as well as new/modified assets
Returns:
List list of changed assets

listChanged

public java.util.List listChanged(java.lang.String sbStoreId,
                                  java.lang.String relativePath,
                                  boolean includeDeleted)
Description copied from interface: SandboxService
List changed assets for given sandbox path (eg. between user sandbox and staging sandbox)

Note: This will list new/modified/deleted assets from the directory and below. The destination path will be dervied.

Specified by:
listChanged in interface SandboxService
Parameters:
sbStoreId - sandbox store id
relativePath - relative path to filter by (eg. /www/avm_webapps/ROOT/MyFolderToList)
includeDeleted - if true, include deleted assets as well as new/modified assets
Returns:
List list of changed assets

listChanged

public java.util.List listChanged(java.lang.String srcSandboxStoreId,
                                  java.lang.String srcRelativePath,
                                  java.lang.String dstSandboxStoreId,
                                  java.lang.String dstRelativePath,
                                  boolean includeDeleted)
Description copied from interface: SandboxService
List changed (new/modified/deleted) assets between any two sandbox paths

Specified by:
listChanged in interface SandboxService
Parameters:
srcSandboxStoreId - source sandbox store id
srcRelativePath - source relative path to filter by (eg. /www/avm_webapps/ROOT/MyFolderToList)
dstSandboxStoreId - destination sandbox store id
dstRelativePath - destination relative path to filter by (eg. /www/avm_webapps/ROOT/MyFolderToList)
includeDeleted - if true, include deleted assets as well as new/modified assets
Returns:
List list of changed assets

submitAll

public void submitAll(java.lang.String sbStoreId,
                      java.lang.String submitLabel,
                      java.lang.String submitComment)
Description copied from interface: SandboxService
Submit all changed assets for given sandbox (eg. from user sandbox to staging sandbox)

Note: This will submit all new/modified/deleted assets from the sandbox root directory (eg. /www/avm_webapps) - ie. across all web apps

Specified by:
submitAll in interface SandboxService
Parameters:
sbStoreId - sandbox store id
submitLabel - label for submitted snapshot
submitComment - description for submitted snapshot

submitWebApp

public void submitWebApp(java.lang.String sbStoreId,
                         java.lang.String webApp,
                         java.lang.String submitLabel,
                         java.lang.String submitComment)
Description copied from interface: SandboxService
Submit changed assets for given sandbox and web app (eg. in user sandbox)

Note: This will submit new/modified/deleted assets for the given web app

Specified by:
submitWebApp in interface SandboxService
Parameters:
sbStoreId - sandbox store id
webApp - web app to filter by
submitLabel - label for submitted snapshot
submitComment - description for submitted snapshot

submit

public void submit(java.lang.String sbStoreId,
                   java.lang.String relativePath,
                   java.lang.String submitLabel,
                   java.lang.String submitComment)
Description copied from interface: SandboxService
Submit changed asset(s) for given sandbox path (eg. in user sandbox)

Note: This will submit new/modified/deleted asset(s) for given path (either file or directory and below)

Specified by:
submit in interface SandboxService
Parameters:
sbStoreId - sandbox store id
relativePath - relative path to filter by (eg. /www/avm_webapps or /www/avm_webapps/ROOT/MyFolderToSubmit)
submitLabel - label for submitted snapshot
submitComment - description for submitted snapshot

submitList

public void submitList(java.lang.String sbStoreId,
                       java.util.List relativePaths,
                       java.lang.String submitLabel,
                       java.lang.String submitComment)
Description copied from interface: SandboxService
Submit list of changed assets for given sandbox (eg. in user sandbox)

Specified by:
submitList in interface SandboxService
Parameters:
sbStoreId - sandbox store id
submitLabel - label for submitted snapshot
submitComment - description for submitted snapshot

submitListAssets

public void submitListAssets(java.lang.String sbStoreId,
                             java.util.List assets,
                             java.lang.String submitLabel,
                             java.lang.String submitComment)
Description copied from interface: SandboxService
Submit list of changed assets for given sandbox (eg. from user sandbox to staging sandbox)

Specified by:
submitListAssets in interface SandboxService
Parameters:
sbStoreId - sandbox store id
submitLabel - label for submitted snapshot
submitComment - description for submitted snapshot

submitListAssets

public void submitListAssets(java.lang.String sbStoreId,
                             java.util.List relativePaths,
                             java.lang.String workflowName,
                             java.util.Map workflowParams,
                             java.lang.String submitLabel,
                             java.lang.String submitComment,
                             java.util.Map expirationDates,
                             java.util.Date launchDate,
                             boolean autoDeploy)
Description copied from interface: SandboxService
Submit list of changed assets for given sandbox (eg. from user sandbox to staging sandbox) NOTE: for backwards compatibility - subject to change - hence deprecated for now

Specified by:
submitListAssets in interface SandboxService
Parameters:
sbStoreId - sandbox store id
workflowName - selected workflow name - if null, will use default submit direct workflow
workflowParams - configured workflow params
submitLabel - label for submitted snapshot
submitComment - description for submitted snapshot
expirationDates - optional map of for those assets set with an expiration date, or can be null (if no expiration dates)
launchDate - optional launch date
autoDeploy - if true then will auto-deploy on workflow approval

createWorkflowSandbox

protected org.alfresco.util.Pair createWorkflowSandbox(java.lang.String workflowName,
                                                       java.util.Map workflowParams,
                                                       java.lang.String stagingSandboxId,
                                                       java.util.List srcPaths,
                                                       java.util.Map expirationDates)
Creates a workflow sandbox for all the submitted items

Parameters:
context - Faces context

startWorkflow

protected void startWorkflow(java.lang.String wpStoreId,
                             java.lang.String sbStoreId,
                             SandboxInfo wfSandboxInfo,
                             java.lang.String webApp,
                             java.lang.String workflowName,
                             java.util.Map workflowParams,
                             java.lang.String submitLabel,
                             java.lang.String submitComment,
                             java.util.Date launchDate,
                             boolean autoDeploy)
Starts the configured workflow to allow the submitted items to be link checked and reviewed.


revertAll

public void revertAll(java.lang.String sbStoreId)
Description copied from interface: SandboxService
Revert all changed assets for given sandbox (eg. in user sandbox)

Note: This will revert all new/modified/deleted assets from the sandbox store root directory (eg. /www/avm_webapps) - ie. across all web apps

Specified by:
revertAll in interface SandboxService
Parameters:
sbStoreId - sandbox store id

revertWebApp

public void revertWebApp(java.lang.String sbStoreId,
                         java.lang.String webApp)
Description copied from interface: SandboxService
Revert changed assets for given sandbox and web app (eg. in user sandbox)

Note: This will revert new/modified/deleted assets for the given web app

Specified by:
revertWebApp in interface SandboxService
Parameters:
sbStoreId - sandbox store id
webApp - web app to filter by

revert

public void revert(java.lang.String sbStoreId,
                   java.lang.String relativePath)
Description copied from interface: SandboxService
Revert changed asset(s) for given sandbox path (eg. in user sandbox)

Note: This will revert new/modified/deleted asset(s) for given path (either file or directory and below)

Specified by:
revert in interface SandboxService
Parameters:
sbStoreId - sandbox store id
relativePath - relative path to filter by (eg. /www/avm_webapps/ROOT/MyFolderToRevert)

revertList

public void revertList(java.lang.String sbStoreId,
                       java.util.List relativePaths)
Description copied from interface: SandboxService
Revert list of changed assets for given sandbox (eg. in user sandbox)

Specified by:
revertList in interface SandboxService
Parameters:
sbStoreId - sandbox store id

revertListAssets

public void revertListAssets(java.lang.String sbStoreId,
                             java.util.List assets)
Description copied from interface: SandboxService
Revert list of changed assets for given sandbox (eg. in user sandbox)

Specified by:
revertListAssets in interface SandboxService
assets - list of assets

listSnapshots

public java.util.List listSnapshots(java.lang.String sbStoreId,
                                    boolean includeSystemGenerated)
Description copied from interface: SandboxService
List all snapshots (sandbox versions) for the given sandbox (ie. for staging sandbox)

Current user must be a content manager for the web project

Specified by:
listSnapshots in interface SandboxService
Parameters:
sbStoreId - staging sandbox store id
includeSystemGenerated - if false will ignore system generated snapshots else true to get all snapshots
Returns:
List list of sandbox versions

listSnapshots

public java.util.List listSnapshots(java.lang.String sbStoreId,
                                    java.util.Date from,
                                    java.util.Date to,
                                    boolean includeSystemGenerated)
Description copied from interface: SandboxService
List snapshots (sandbox versions) for the given sandbox between given dates (ie. for staging sandbox)

Current user must be a content manager for the web project

Specified by:
listSnapshots in interface SandboxService
Parameters:
sbStoreId - staging sandbox store id
from - from date
to - to date
includeSystemGenerated - if false will ignore system generated snapshots else true to get all snapshots
Returns:
List list of sandbox versions

revertSnapshot

public void revertSnapshot(java.lang.String sbStoreId,
                           int revertVersion)
Description copied from interface: SandboxService
Revert sandbox to a specific snapshot version ID (ie. for staging sandbox)

Current user must be a content manager for the web project

Specified by:
revertSnapshot in interface SandboxService
Parameters:
sbStoreId - staging sandbox store id
revertVersion - version


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