org.alfresco.wcm.sandbox
Class SandboxFactory

java.lang.Object
  extended by org.alfresco.repo.avm.util.AVMUtil
      extended by org.alfresco.wcm.util.WCMUtil
          extended by org.alfresco.wcm.sandbox.SandboxFactory

public final class SandboxFactory
extends WCMUtil

Helper factory to create WCM sandbox structures


Nested Class Summary
 class SandboxFactory.UserRoleWrapper
           
 
Field Summary
static java.lang.String[] PERMISSIONS
           
 
Fields inherited from class org.alfresco.wcm.util.WCMUtil
DIR_ROOT, LOCK_KEY_STORE_NAME, PATTERN_ILLEGAL_SEQUENCE, ROLE_CONTENT_CONTRIBUTOR, ROLE_CONTENT_MANAGER, ROLE_CONTENT_PUBLISHER, ROLE_CONTENT_REVIEWER, SPACE_ICON_WEBSITE, STORE_PREVIEW, STORE_SEPARATOR, STORE_WORKFLOW, WORKFLOW_SUBMITDIRECT_NAME
 
Fields inherited from class org.alfresco.repo.avm.util.AVMUtil
AVM_PATH_SEPARATOR, AVM_PATH_SEPARATOR_CHAR, AVM_STORE_SEPARATOR, AVM_STORE_SEPARATOR_CHAR, INITIAL_SNAPSHOT
 
Method Summary
 void addStagingAreaUser(java.lang.String storeId, java.lang.String authority, java.lang.String role)
           
 SandboxInfo createReadOnlyWorkflowSandbox(java.lang.String storeId)
          Create a read-only workflow sandbox for the named store.
 SandboxInfo createStagingSandbox(java.lang.String storeId, org.alfresco.service.cmr.repository.NodeRef webProjectNodeRef, java.lang.String branchStoreId)
          Create the staging sandbox for the named store.
 SandboxInfo createUserSandbox(java.lang.String storeId, java.util.List managers, java.lang.String username, java.lang.String role)
          Create a user sandbox for the named store.
 java.lang.String createUserWorkflowSandbox(java.lang.String stagingStore, java.lang.String userStore)
          Creates a workflow sandbox for the given user store.
 SandboxInfo createWorkflowSandbox(java.lang.String storeId)
          Create a workflow sandbox for the named store.
 void deleteSandbox(SandboxInfo sbInfo, boolean isSubmitDirectWorkflowSandbox, boolean removeLocks)
           
 void deleteSandbox(java.lang.String sbStoreId)
           
 void deleteSandbox(java.lang.String sbStoreId, boolean isSubmitDirectWorkflowSandbox)
           
 java.util.List listAllSandboxes(java.lang.String wpStoreId)
           
 java.util.List listAllSandboxes(java.lang.String wpStoreId, boolean includeWorkflowSandboxes, boolean includeLocalhostDeployed)
           
 void removeGroupsForStore(java.lang.String storeRoot)
           
 void removeSandboxManagers(java.lang.String storeId, java.util.List managersToRemove)
          Update the permissions for the list of sandbox managers applied to a user sandbox.
 void setAuthorityService(AuthorityService authorityService)
           
 void setAvmLockingService(AVMLockingService avmLockingService)
           
 void setAvmService(AVMService avmService)
           
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
           
 void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
           
 void setStagingPermissionMasks(java.lang.String storeId)
           
 void setVirtServerRegistry(org.alfresco.mbeans.VirtServerRegistry virtServerRegistry)
           
 void updateSandboxManagers(java.lang.String storeId, java.util.List managers)
          Update the permissions for the list of sandbox managers applied to a user sandbox.
 void updateSandboxRoles(java.lang.String wpStoreId, java.util.List usersToUpdate, java.util.Set permissionsList)
           
 
Methods inherited from class org.alfresco.wcm.util.WCMUtil
buildSandboxRootPath, buildStagingPreviewStoreName, buildStagingStoreName, buildStoreRootPath, buildStoreWebappPath, buildUserMainStoreName, buildUserPreviewStoreName, buildWorkflowMainStoreName, buildWorkflowPreviewStoreName, escapeStoreNameComponent, getCommonWebApp, getCorrespondingMainStoreName, getCorrespondingPath, getCorrespondingPathInMainStore, getCorrespondingPathInPreviewStore, getCorrespondingPreviewStoreName, getSandboxPath, getSandboxRelativePath, getSandboxStoreId, getStoreRelativePath, getUserName, getWebapp, getWebappPath, getWebappRelativePath, getWebProject, getWebProjectNodeFromWebProjectStore, getWebProjectStoreId, getWebProjectStoreIdFromPath, getWorkflowId, isLocalhostDeployedStore, isPreviewStore, isStagingStore, isUserStore, isWorkflowStore, listWebUserRefs, listWebUsers, lookupStoreDNS, removeAllVServerWebapps, removeVServerWebapp, updateVServerWebapp
 
Methods inherited from class org.alfresco.repo.avm.util.AVMUtil
addLeadingSlash, buildAVMPath, extendAVMPath, getStoreName, normalizePath, splitBase, splitPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERMISSIONS

public static final java.lang.String[] PERMISSIONS
Method Detail

setNodeService

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

setPermissionService

public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)

setAvmService

public void setAvmService(AVMService avmService)

setVirtServerRegistry

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

setAuthorityService

public void setAuthorityService(AuthorityService authorityService)

setAvmLockingService

public void setAvmLockingService(AVMLockingService avmLockingService)

createStagingSandbox

public SandboxInfo createStagingSandbox(java.lang.String storeId,
                                        org.alfresco.service.cmr.repository.NodeRef webProjectNodeRef,
                                        java.lang.String branchStoreId)
Create the staging sandbox for the named store. A staging sandbox is comprised of two stores, the first named 'storename-staging' with a preview store named 'storename-preview' layered over the staging store. Various store meta-data properties are set including: Identifier for store-types: .sandbox.staging.main and .sandbox.staging.preview Store-id: .sandbox-id. (unique across all stores in the sandbox) DNS: .dns. = Website Name: .website.name = website name

Parameters:
storeId - The store name to create the sandbox for.
webProjectNodeRef - The noderef for the webproject.
branchStoreId - The ID of the store to branch this staging store from.

setStagingPermissionMasks

public void setStagingPermissionMasks(java.lang.String storeId)

addStagingAreaUser

public void addStagingAreaUser(java.lang.String storeId,
                               java.lang.String authority,
                               java.lang.String role)

createUserSandbox

public SandboxInfo createUserSandbox(java.lang.String storeId,
                                     java.util.List managers,
                                     java.lang.String username,
                                     java.lang.String role)
Create a user sandbox for the named store. A user sandbox is comprised of two stores, the first named 'storename--username' layered over the staging store with a preview store named 'storename--username--preview' layered over the main store. Various store meta-data properties are set including: Identifier for store-types: .sandbox.author.main and .sandbox.author.preview Store-id: .sandbox-id. (unique across all stores in the sandbox) DNS: .dns. = Website Name: .website.name = website name

Parameters:
storeId - The store id to create the sandbox for
managers - The list of authorities who have ContentManager role in the website
username - Username of the user to create the sandbox for
role - Role permission for the user
Returns:
Summary information regarding the sandbox

createWorkflowSandbox

public SandboxInfo createWorkflowSandbox(java.lang.String storeId)
Create a workflow sandbox for the named store. Various store meta-data properties are set including: Identifier for store-types: .sandbox.workflow.main and .sandbox.workflow.preview Store-id: .sandbox-id. (unique across all stores in the sandbox) DNS: .dns. = Website Name: .website.name = website name

Parameters:
storeId - The id of the store to create a sandbox for
Returns:
Information about the sandbox

createReadOnlyWorkflowSandbox

public SandboxInfo createReadOnlyWorkflowSandbox(java.lang.String storeId)
Create a read-only workflow sandbox for the named store. Note: read-only means it's only safe to use in a workflow where the sandbox is not expected to be updated. The sandbox does not protected itself from writes. Note: this sandbox does not support the preview layer Note: a snapshot within this sandbox is NOT taken Various store meta-data properties are set including: Identifier for store-types: .sandbox.workflow.main and .sandbox.workflow.preview Store-id: .sandbox-id. (unique across all stores in the sandbox) DNS: .dns. = Website Name: .website.name = website name

Parameters:
storeId - The id of the store to create a sandbox for
Returns:
Information about the sandbox

createUserWorkflowSandbox

public java.lang.String createUserWorkflowSandbox(java.lang.String stagingStore,
                                                  java.lang.String userStore)
Creates a workflow sandbox for the given user store. This will create a workflow sandbox layered over the user's main store.

Parameters:
stagingStore - The name of the staging store the user sandbox is layered over
userStore - The name of the user store to create the workflow for
Returns:
The store name of the main store in the workflow sandbox

listAllSandboxes

public java.util.List listAllSandboxes(java.lang.String wpStoreId)

listAllSandboxes

public java.util.List listAllSandboxes(java.lang.String wpStoreId,
                                       boolean includeWorkflowSandboxes,
                                       boolean includeLocalhostDeployed)

deleteSandbox

public void deleteSandbox(java.lang.String sbStoreId)

deleteSandbox

public void deleteSandbox(java.lang.String sbStoreId,
                          boolean isSubmitDirectWorkflowSandbox)

deleteSandbox

public void deleteSandbox(SandboxInfo sbInfo,
                          boolean isSubmitDirectWorkflowSandbox,
                          boolean removeLocks)

updateSandboxManagers

public void updateSandboxManagers(java.lang.String storeId,
                                  java.util.List managers)
Update the permissions for the list of sandbox managers applied to a user sandbox.

Ensures that all managers in the list have full WRITE access to the specified user stores.

Parameters:
storeId - The store id of the sandbox to update
managers - The list of authorities who have ContentManager role in the web project

removeSandboxManagers

public void removeSandboxManagers(java.lang.String storeId,
                                  java.util.List managersToRemove)
Update the permissions for the list of sandbox managers applied to a user sandbox.

Ensures that all managers in the list have full WRITE access to the specified user stores.

Parameters:
storeId - The store id of the sandbox to update
managers - The list of authorities who have ContentManager role in the web project

updateSandboxRoles

public void updateSandboxRoles(java.lang.String wpStoreId,
                               java.util.List usersToUpdate,
                               java.util.Set permissionsList)

removeGroupsForStore

public void removeGroupsForStore(java.lang.String storeRoot)


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