|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.avm.util.AVMUtil
org.alfresco.wcm.util.WCMUtil
public class WCMUtil
Helper methods and constants related to WCM directories, paths and store name manipulation.
Field Summary | |
---|---|
static java.lang.String |
DIR_ROOT
|
static java.lang.String |
LOCK_KEY_STORE_NAME
|
protected static java.util.regex.Pattern |
PATTERN_ILLEGAL_SEQUENCE
Matches character sequences that must be escaped in a compound store name. |
static java.lang.String |
ROLE_CONTENT_CONTRIBUTOR
|
static java.lang.String |
ROLE_CONTENT_MANAGER
|
static java.lang.String |
ROLE_CONTENT_PUBLISHER
|
static java.lang.String |
ROLE_CONTENT_REVIEWER
|
protected static java.lang.String |
SPACE_ICON_WEBSITE
|
protected static java.lang.String |
STORE_PREVIEW
|
protected static java.lang.String |
STORE_SEPARATOR
|
protected static java.lang.String |
STORE_WORKFLOW
|
static java.lang.String |
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 |
Constructor Summary | |
---|---|
WCMUtil()
|
Method Summary | |
---|---|
static java.lang.String |
buildSandboxRootPath(java.lang.String storeName)
Returns the root path for the specified sandbox name * eg. |
protected static java.lang.String |
buildStagingPreviewStoreName(java.lang.String storeId)
Returns the preview store name for the specified store id. |
static java.lang.String |
buildStagingStoreName(java.lang.String wpStoreId)
Returns the main staging store name for the specified web project |
static java.lang.String |
buildStoreRootPath(java.lang.String storeName)
Returns the root path for the specified store name eg. |
static java.lang.String |
buildStoreWebappPath(java.lang.String storeName,
java.lang.String webApp)
Returns the root webapp path for the specified store and webapp name |
static java.lang.String |
buildUserMainStoreName(java.lang.String storeId,
java.lang.String userName)
Returns the user's main store name for a specific username |
protected static java.lang.String |
buildUserPreviewStoreName(java.lang.String storeId,
java.lang.String username)
Returns the preview store name for a specific username. |
protected static java.lang.String |
buildWorkflowMainStoreName(java.lang.String storeId,
java.lang.String workflowId)
Returns the store name for a specific workflow Id. |
protected static java.lang.String |
buildWorkflowPreviewStoreName(java.lang.String storeId,
java.lang.String workflowId)
Returns the preview store name for a specific workflow Id. |
static java.lang.String |
escapeStoreNameComponent(java.lang.String component)
Utility function for escaping part of a compound store name (delimited by STORE_SEPARATOR sequences). |
static java.lang.String |
getCommonWebApp(java.lang.String sbStoreId,
java.util.List storeRelativePaths)
|
protected static java.lang.String |
getCorrespondingMainStoreName(java.lang.String storeName)
Returns the corresponding main store name if this is a preview store name. |
static java.lang.String |
getCorrespondingPath(java.lang.String avmPath,
java.lang.String otherStoreName)
Returns the corresponding path in the store provided. |
protected static java.lang.String |
getCorrespondingPathInMainStore(java.lang.String avmPath)
Returns the corresponding path in the main store name if this is a path in a preview store. |
protected static java.lang.String |
getCorrespondingPathInPreviewStore(java.lang.String avmPath)
Returns the corresponding path in the preview store name if this is a path in a main store. |
protected static java.lang.String |
getCorrespondingPreviewStoreName(java.lang.String storeName)
Returns the corresponding preview store name if this is a main store name. |
protected static java.lang.String |
getSandboxPath(java.lang.String absoluteAVMPath)
Returns the path portion up the sandbox |
protected static java.lang.String |
getSandboxRelativePath(java.lang.String absoluteAVMPath)
Returns a path relative to the sandbox porition of the avm path. |
static java.lang.String |
getSandboxStoreId(java.lang.String avmPath)
Extracts the sandbox store id from the avm path |
static java.lang.String |
getStoreRelativePath(java.lang.String absoluteAVMPath)
Returns a path relative to the store portion of the avm path. |
static java.lang.String |
getUserName(java.lang.String storeName)
Extracts the username from the store name. |
static java.lang.String |
getWebapp(java.lang.String absoluteAVMPath)
Returns the webapp within the path |
protected static java.lang.String |
getWebappPath(java.lang.String absoluteAVMPath)
Returns the path portion up the webapp |
protected static java.lang.String |
getWebappRelativePath(java.lang.String absoluteAVMPath)
Returns a path relative to the webapp portion of the avm path. |
static java.lang.String |
getWebProject(AVMService avmService,
java.lang.String avmStoreName)
Returns web project store id for an AVM store name (or null for vanilla AVM store) |
static org.alfresco.service.cmr.repository.NodeRef |
getWebProjectNodeFromWebProjectStore(AVMService avmService,
java.lang.String wpStoreId)
|
static java.lang.String |
getWebProjectStoreId(java.lang.String storeName)
Extracts the web project store id from the (sandbox) store name |
static java.lang.String |
getWebProjectStoreIdFromPath(java.lang.String avmPath)
Extracts the web project store id from the avm path For example, if the avm path is: teststore--admin:/www/ROOT then the web project id is: teststore |
static java.lang.String |
getWorkflowId(java.lang.String storeName)
Extracts the workflow id |
protected static boolean |
isLocalhostDeployedStore(java.lang.String wpStoreId,
java.lang.String storeName)
http://wiki.alfresco.com/wiki/WCM_Deployment_Features#Debugging_.26_Testing Examples of locally deployed store names for web project "MyWebProj" are: MyWebProjlive MyWebProj--adminlive Note: if web project "MyWebProjlive" is pre-created then should be possible to browse staging: http://wiki.alfresco.com/wiki/WCM_Deployment_Features#Deployed_Runtime |
protected static boolean |
isPreviewStore(java.lang.String storeName)
Indicates whether the store name describes a preview store. |
static boolean |
isStagingStore(java.lang.String storeName)
Indicates whether the store name describes a staging store. |
static boolean |
isUserStore(java.lang.String storeName)
Indicates whether the store name describes a user store. |
protected static boolean |
isWorkflowStore(java.lang.String storeName)
Indicates whether the store name describes a workflow store. |
protected static java.util.List |
listWebUserRefs(org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.repository.NodeRef wpNodeRef,
boolean preLoad)
|
protected static java.util.Map |
listWebUsers(org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.repository.NodeRef wpNodeRef)
|
static java.lang.String |
lookupStoreDNS(AVMService avmService,
java.lang.String store)
|
protected static void |
removeAllVServerWebapps(org.alfresco.mbeans.VirtServerRegistry vServerRegistry,
java.lang.String path,
boolean force)
Removal notification on all the virtualisation server webapp as required by the specified path |
protected static void |
removeVServerWebapp(org.alfresco.mbeans.VirtServerRegistry vServerRegistry,
java.lang.String path,
boolean force)
Removal notification on the virtualisation server webapp as required for the specified path |
static void |
updateVServerWebapp(org.alfresco.mbeans.VirtServerRegistry vServerRegistry,
java.lang.String path,
boolean force)
Update notification on the virtualisation server webapp as required for the specified path |
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 |
---|
protected static final java.lang.String STORE_SEPARATOR
protected static final java.util.regex.Pattern PATTERN_ILLEGAL_SEQUENCE
protected static final java.lang.String STORE_WORKFLOW
protected static final java.lang.String STORE_PREVIEW
public static final java.lang.String DIR_ROOT
protected static final java.lang.String SPACE_ICON_WEBSITE
public static final java.lang.String LOCK_KEY_STORE_NAME
public static final java.lang.String ROLE_CONTENT_MANAGER
public static final java.lang.String ROLE_CONTENT_PUBLISHER
public static final java.lang.String ROLE_CONTENT_CONTRIBUTOR
public static final java.lang.String ROLE_CONTENT_REVIEWER
public static final java.lang.String WORKFLOW_SUBMITDIRECT_NAME
Constructor Detail |
---|
public WCMUtil()
Method Detail |
---|
public static java.lang.String getSandboxStoreId(java.lang.String avmPath)
avmPath
- an absolute avm path
public static java.lang.String getWebProjectStoreId(java.lang.String storeName)
For example, if the (sandbox) store name is: teststore--admin then the web project store id is: teststore
Note: Although the staging sandbox store name is currently equivalent to the web project store id, it should be derived using 'buildStagingStoreName'.
storeName
- the sandbox store id
public static java.lang.String getWebProjectStoreIdFromPath(java.lang.String avmPath)
avmPath
- an absolute avm path
protected static boolean isPreviewStore(java.lang.String storeName)
storeName
- the store name
protected static boolean isLocalhostDeployedStore(java.lang.String wpStoreId, java.lang.String storeName)
storeName
-
protected static boolean isWorkflowStore(java.lang.String storeName)
storeName
- the store name
public static boolean isUserStore(java.lang.String storeName)
storeName
- the store name
public static boolean isStagingStore(java.lang.String storeName)
storeName
- the store name
public static java.lang.String getUserName(java.lang.String storeName)
storeName
- the store name
public static java.lang.String getWorkflowId(java.lang.String storeName)
storeName
-
protected static java.lang.String getCorrespondingMainStoreName(java.lang.String storeName)
storeName
- the preview store name.
java.lang.IllegalArgumentException
- if this is not a preview store name.protected static java.lang.String getCorrespondingPreviewStoreName(java.lang.String storeName)
storeName
- the main store name.
java.lang.IllegalArgumentException
- if this is not a main store name.protected static java.lang.String getCorrespondingPathInMainStore(java.lang.String avmPath)
avmPath
- an avm path within the main store.
java.lang.IllegalArgumentException
- if this is not a path within the preview store.protected static java.lang.String getCorrespondingPathInPreviewStore(java.lang.String avmPath)
avmPath
- an avm path within the main store.
java.lang.IllegalArgumentException
- if this is not a path within the preview store.public static java.lang.String getCorrespondingPath(java.lang.String avmPath, java.lang.String otherStoreName)
avmPath
- an avm pathotherStore
- the other store name to return the corresponding path for
public static final java.lang.String escapeStoreNameComponent(java.lang.String component)
component
- the component
public static java.lang.String buildStagingStoreName(java.lang.String wpStoreId)
wpStoreId
- web project store id to build staging store name for
protected static java.lang.String buildStagingPreviewStoreName(java.lang.String storeId)
storeId
- store id to build preview store name for
public static java.lang.String buildUserMainStoreName(java.lang.String storeId, java.lang.String userName)
storeId
- store id to build user store name forusername
- of the user to build store name for
protected static java.lang.String buildUserPreviewStoreName(java.lang.String storeId, java.lang.String username)
storeId
- store id to build user preview store name forusername
- of the user to build preview store name for
protected static java.lang.String buildWorkflowMainStoreName(java.lang.String storeId, java.lang.String workflowId)
storeId
- store id to build workflow store name forworkflowId
- of the user to build workflow store name for
protected static java.lang.String buildWorkflowPreviewStoreName(java.lang.String storeId, java.lang.String workflowId)
storeId
- store id to build preview workflow store name forworkflowId
- of the user to build preview workflow store name for
public static java.lang.String buildStoreRootPath(java.lang.String storeName)
storeName
- store to build root path for
public static java.lang.String buildSandboxRootPath(java.lang.String storeName)
storeName
- store to build root sandbox path for
public static java.lang.String buildStoreWebappPath(java.lang.String storeName, java.lang.String webApp)
storeName
- store to build root webapp path forwebapp
- webapp folder name
public static java.lang.String lookupStoreDNS(AVMService avmService, java.lang.String store)
public static org.alfresco.service.cmr.repository.NodeRef getWebProjectNodeFromWebProjectStore(AVMService avmService, java.lang.String wpStoreId)
public static java.lang.String getWebProject(AVMService avmService, java.lang.String avmStoreName)
public static java.lang.String getStoreRelativePath(java.lang.String absoluteAVMPath)
absoluteAVMPath
- an absolute path within the avm
protected static java.lang.String getWebappRelativePath(java.lang.String absoluteAVMPath)
absoluteAVMPath
- an absolute path within the avm
public static java.lang.String getWebapp(java.lang.String absoluteAVMPath)
absoluteAVMPath
- the path from which to extract the webapp name
protected static java.lang.String getWebappPath(java.lang.String absoluteAVMPath)
absoluteAVMPath
- the path from which to extract the webapp path
protected static java.lang.String getSandboxRelativePath(java.lang.String absoluteAVMPath)
absoluteAVMPath
- an absolute path within the avm
protected static java.lang.String getSandboxPath(java.lang.String absoluteAVMPath)
absoluteAVMPath
- the path from which to extract the sandbox path
protected static java.util.Map listWebUsers(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef wpNodeRef)
protected static java.util.List listWebUserRefs(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef wpNodeRef, boolean preLoad)
public static void updateVServerWebapp(org.alfresco.mbeans.VirtServerRegistry vServerRegistry, java.lang.String path, boolean force)
path
- Path to match againstforce
- True to force update of server even if path does not matchprotected static void removeAllVServerWebapps(org.alfresco.mbeans.VirtServerRegistry vServerRegistry, java.lang.String path, boolean force)
path
- Path to match againstforce
- True to force update of server even if path does not matchprotected static void removeVServerWebapp(org.alfresco.mbeans.VirtServerRegistry vServerRegistry, java.lang.String path, boolean force)
path
- Path to match againstforce
- True to force update of server even if path does not matchpublic static java.lang.String getCommonWebApp(java.lang.String sbStoreId, java.util.List storeRelativePaths)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |