public final class WorkspaceManager
extends java.lang.Object
Workspace
that provides utility methods.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MAIL_PATTERN_INFO
An extraInfo that stores the Workspace Incoming Mail pattern if any.
|
static java.lang.String |
REVISION |
Modifier and Type | Method and Description |
---|---|
static boolean |
canReadWorkspace(Workspace workspace,
Member member) |
protected static void |
createDuplicateCategories(WorkspaceWizardContext context)
Duplicate all categories specified for the given WizardContext.
|
protected static void |
createGroups(WorkspaceWizardContext context)
Duplicate all groups specified for the given WizardContext.
|
protected static void |
createPortals(WorkspaceWizardContext context)
Duplicate all portals specified for the given WizardContext.
|
protected static boolean |
createWorkspace(WorkspaceWizardContext context)
Creates the workspace instance from the given model
|
static WorkspaceWizardContext |
deepDuplicate(Workspace model,
Member author,
java.lang.String prefix,
java.lang.String title)
Deprecated.
|
static WorkspaceWizardContext |
deepDuplicate(Workspace model,
Member author,
java.lang.String prefix,
java.lang.String title,
boolean collaborativeSpace)
Deprecated.
|
static WorkspaceWizardContext |
deepDuplicate(Workspace model,
Member author,
java.lang.String prefix,
java.lang.String title,
java.util.Map<java.lang.String,java.lang.String> titleML)
Deep duplicate the Workspace model using given configuration for duplication.
|
static WorkspaceWizardContext |
deepDuplicate(Workspace model,
Member author,
java.lang.String prefix,
java.lang.String title,
java.util.Map<java.lang.String,java.lang.String> titleML,
java.lang.String wsemail,
java.util.List adminList,
java.util.Collection typeCollec,
Category[] categories,
Group[] groups,
PortalInterface[] portals,
Workspace parent,
boolean collaborativeSpace)
Deep duplicate the Workspace model using given configuration for duplication.
|
static WorkspaceWizardContext |
deepDuplicate(Workspace model,
Member author,
java.lang.String prefix,
java.lang.String title,
java.util.Map<java.lang.String,java.lang.String> titleML,
java.lang.String wsemail,
java.util.List adminList,
java.util.Collection typeCollec,
java.util.Collection catCollec,
java.util.Collection groupCollec,
java.util.Collection portalCollec,
boolean collaborativeSpace)
Deep duplicate the Workspace model using given configuration for duplication.
|
static WorkspaceWizardContext |
deepDuplicate(Workspace model,
Member author,
java.lang.String prefix,
java.lang.String title,
java.util.Map<java.lang.String,java.lang.String> titleML,
java.lang.String wsemail,
java.util.List adminList,
java.util.Collection typeCollec,
java.util.Collection catCollec,
java.util.Collection groupCollec,
java.util.Collection portalCollec,
Workspace parent,
boolean collaborativeSpace)
Deep duplicate the Workspace model using given configuration for duplication.
|
static WorkspaceWizardContext |
deepDuplicate(Workspace model,
Member author,
java.lang.String prefix,
java.lang.String title,
java.util.Map<java.lang.String,java.lang.String> titleML,
Workspace parent,
boolean collaborativeSpace)
Deep duplicate the Workspace model using given configuration for duplication.
|
static WorkspaceWizardContext |
deepDuplicate(Workspace model,
Member author,
java.lang.String prefix,
java.lang.String title,
java.lang.String wsemail,
java.util.List adminList,
java.util.Collection typeCollec,
Category[] categories,
Group[] groups,
PortalInterface[] portals,
Workspace parent,
boolean collaborativeSpace)
Deprecated.
|
static WorkspaceWizardContext |
deepDuplicate(Workspace model,
Member author,
java.lang.String prefix,
java.lang.String title,
java.lang.String wsemail,
java.util.List adminList,
java.util.Collection typeCollec,
java.util.Collection catCollec,
java.util.Collection groupCollec,
java.util.Collection portalCollec,
boolean collaborativeSpace)
Deprecated.
|
static WorkspaceWizardContext |
deepDuplicate(Workspace model,
Member author,
java.lang.String prefix,
java.lang.String title,
java.lang.String wsemail,
java.util.List adminList,
java.util.Collection typeCollec,
java.util.Collection catCollec,
java.util.Collection groupCollec,
java.util.Collection portalCollec,
Workspace parent,
boolean collaborativeSpace)
Deprecated.
|
static WorkspaceWizardContext |
deepDuplicate(Workspace model,
Member author,
java.lang.String prefix,
java.lang.String title,
Workspace parent)
Deprecated.
|
static WorkspaceWizardContext |
deepDuplicate(Workspace model,
Member author,
java.lang.String prefix,
java.lang.String title,
Workspace parent,
boolean collaborativeSpace)
Deprecated.
|
static WorkspaceWizardContext |
deepDuplicate(WorkspaceWizardContext context)
Deep duplicate the Workspace model referenced by given WorkspaceWizardContext using
context configuration for duplication.
|
static java.util.Collection<java.lang.String> |
getAllIncomingMailLocalPart() |
static int |
getCollaborativeSpaceCount()
Returns the count of workspaces used as CollaborativeSpace.
|
static Workspace |
getIncomingMailLocalPartWorkspace(java.lang.String localPart) |
static java.lang.String |
getIncomingMailPattern(Workspace ws)
Computes the incoming mail pattern given the Workspace.
|
static int |
getNonCollaborativeWorkspaceCount()
Returns the count of workspaces which are not used as CollaborativeSpace.
|
static java.util.Set<Workspace> |
getOtherWorkspaceSet(Member member,
java.lang.String userLang,
java.util.Set<Workspace> workspaceToExcludeSet,
boolean belongsToWorkspace,
boolean isWorker,
boolean withPortal) |
static java.util.Set<Workspace> |
getSearchedWorkspaceSet(Member mbr,
java.lang.String userLang,
java.lang.String query,
boolean withPortal,
boolean showModel)
Returns the set of workspace which :
Matches the query
Is a model the member can work on
Has a portal (If withPortal is set to true)
And the member can read the portal
|
static void |
initIncomingMails()
If site incoming mail is enabled, initializes Workspaces' incoming mail Patterns.
|
static void |
updateIncomingMailPattern(Workspace workspace,
Workspace oldWorkspace)
Updates given Workspace incoming Mail Pattern in
IncomingMailListener .If oldWs is not null, checks if localPart changed. |
protected static void |
updateWorkspace(WorkspaceWizardContext context)
Update duplicated Workspace
Duplicate WSTypeEntry
Duplicate WKRoles
Instance Workflow Groups
|
public static final java.lang.String REVISION
public static final java.lang.String MAIL_PATTERN_INFO
@Deprecated public static WorkspaceWizardContext deepDuplicate(Workspace model, Member author, java.lang.String prefix, java.lang.String title)
model
- the Workspace to duplicateauthor
- the author of all duplicationprefix
- the prefix to use on all duplicated itemstitle
- the new workspace titlepublic static WorkspaceWizardContext deepDuplicate(Workspace model, Member author, java.lang.String prefix, java.lang.String title, java.util.Map<java.lang.String,java.lang.String> titleML)
model
- the Workspace to duplicateauthor
- the author of all duplicationprefix
- the prefix to use on all duplicated itemstitle
- the new workspace titletitleML
- the multilingual workspace titles@Deprecated public static WorkspaceWizardContext deepDuplicate(Workspace model, Member author, java.lang.String prefix, java.lang.String title, boolean collaborativeSpace)
model
- the Workspace to duplicateauthor
- the author of all duplicationprefix
- the prefix to use on all duplicated itemstitle
- the new workspace titlecollaborativeSpace
- tell if the duplication is to create a collaborative space@Deprecated public static WorkspaceWizardContext deepDuplicate(Workspace model, Member author, java.lang.String prefix, java.lang.String title, java.lang.String wsemail, java.util.List adminList, java.util.Collection typeCollec, java.util.Collection catCollec, java.util.Collection groupCollec, java.util.Collection portalCollec, boolean collaborativeSpace)
model
- the Workspace to duplicateauthor
- the author of all duplicationprefix
- the prefix to use on all duplicated itemstitle
- the workspace titlewsemail
- the workspace emailadminList
- a List of workspace administratorstypeCollec
- a Set of classes to define WSTypeEntry to retrieve from modelcatCollec
- Workspace root categories to duplicategroupCollec
- to duplicateportalCollec
- to duplicatecollaborativeSpace
- tell if the duplication is to create a collaborative spacepublic static WorkspaceWizardContext deepDuplicate(Workspace model, Member author, java.lang.String prefix, java.lang.String title, java.util.Map<java.lang.String,java.lang.String> titleML, java.lang.String wsemail, java.util.List adminList, java.util.Collection typeCollec, java.util.Collection catCollec, java.util.Collection groupCollec, java.util.Collection portalCollec, boolean collaborativeSpace)
model
- the Workspace to duplicateauthor
- the author of all duplicationprefix
- the prefix to use on all duplicated itemstitle
- the workspace titletitleML
- the multilingual workspace titleswsemail
- the workspace emailadminList
- a List of workspace administratorstypeCollec
- a Set of classes to define WSTypeEntry to retrieve from modelcatCollec
- Workspace root categories to duplicategroupCollec
- to duplicateportalCollec
- to duplicatecollaborativeSpace
- tell if the duplication is to create a collaborative space@Deprecated public static WorkspaceWizardContext deepDuplicate(Workspace model, Member author, java.lang.String prefix, java.lang.String title, Workspace parent)
model
- the Workspace to duplicateauthor
- the author of all duplicationprefix
- the prefix to use on all duplicated itemstitle
- the new workspace titleparent
- the parent workspace@Deprecated public static WorkspaceWizardContext deepDuplicate(Workspace model, Member author, java.lang.String prefix, java.lang.String title, Workspace parent, boolean collaborativeSpace)
model
- the Workspace to duplicateauthor
- the author of all duplicationprefix
- the prefix to use on all duplicated itemstitle
- the new workspace titleparent
- the parent workspacecollaborativeSpace
- tell if the duplication is to create a collaborative spacepublic static WorkspaceWizardContext deepDuplicate(Workspace model, Member author, java.lang.String prefix, java.lang.String title, java.util.Map<java.lang.String,java.lang.String> titleML, Workspace parent, boolean collaborativeSpace)
model
- the Workspace to duplicateauthor
- the author of all duplicationprefix
- the prefix to use on all duplicated itemstitle
- the new workspace titletitleML
- the multilingual workspace titlesparent
- the parent workspacecollaborativeSpace
- tell if the duplication is to create a collaborative space@Deprecated public static WorkspaceWizardContext deepDuplicate(Workspace model, Member author, java.lang.String prefix, java.lang.String title, java.lang.String wsemail, java.util.List adminList, java.util.Collection typeCollec, java.util.Collection catCollec, java.util.Collection groupCollec, java.util.Collection portalCollec, Workspace parent, boolean collaborativeSpace)
model
- the Workspace to duplicateauthor
- the author of all duplicationprefix
- the prefix to use on all duplicated itemstitle
- the workspace titlewsemail
- the workspace emailadminList
- a List of workspace administratorstypeCollec
- a Set of classes to define WSTypeEntry to retrieve from modelcatCollec
- Workspace root categories to duplicategroupCollec
- to duplicateparent
- the parent workspaceportalCollec
- to duplicatecollaborativeSpace
- tell if the duplication is to create a collaborative spacepublic static WorkspaceWizardContext deepDuplicate(Workspace model, Member author, java.lang.String prefix, java.lang.String title, java.util.Map<java.lang.String,java.lang.String> titleML, java.lang.String wsemail, java.util.List adminList, java.util.Collection typeCollec, java.util.Collection catCollec, java.util.Collection groupCollec, java.util.Collection portalCollec, Workspace parent, boolean collaborativeSpace)
model
- the Workspace to duplicateauthor
- the author of all duplicationprefix
- the prefix to use on all duplicated itemstitle
- the workspace titletitleML
- the multilingual workspace titleswsemail
- the workspace emailadminList
- a List of workspace administratorstypeCollec
- a Set of classes to define WSTypeEntry to retrieve from modelcatCollec
- Workspace root categories to duplicategroupCollec
- to duplicateparent
- the parent workspaceportalCollec
- to duplicatecollaborativeSpace
- tell if the duplication is to create a collaborative space@Deprecated public static WorkspaceWizardContext deepDuplicate(Workspace model, Member author, java.lang.String prefix, java.lang.String title, java.lang.String wsemail, java.util.List adminList, java.util.Collection typeCollec, Category[] categories, Group[] groups, PortalInterface[] portals, Workspace parent, boolean collaborativeSpace)
model
- the Workspace to duplicateauthor
- the author of all duplicationprefix
- the prefix to use on all duplicated itemstitle
- the workspace titlewsemail
- the workspace emailadminList
- a List of workspace administratorstypeCollec
- a Set of classes to define WSTypeEntry to retrieve from modelcategories
- Workspace root categories to duplicategroups
- to duplicateportals
- to duplicateparent
- the parent workspacecollaborativeSpace
- tell if the duplication is to create a collaborative spacepublic static WorkspaceWizardContext deepDuplicate(Workspace model, Member author, java.lang.String prefix, java.lang.String title, java.util.Map<java.lang.String,java.lang.String> titleML, java.lang.String wsemail, java.util.List adminList, java.util.Collection typeCollec, Category[] categories, Group[] groups, PortalInterface[] portals, Workspace parent, boolean collaborativeSpace)
model
- the Workspace to duplicateauthor
- the author of all duplicationprefix
- the prefix to use on all duplicated itemstitle
- the workspace titletitleML
- the multilingual workspace titleswsemail
- the workspace emailadminList
- a List of workspace administratorstypeCollec
- a Set of classes to define WSTypeEntry to retrieve from modelcategories
- Workspace root categories to duplicategroups
- to duplicateportals
- to duplicateparent
- the parent workspacecollaborativeSpace
- tell if the duplication is to create a collaborative spacepublic static WorkspaceWizardContext deepDuplicate(WorkspaceWizardContext context)
1. Create Workspace (Check create) 2.1 Create Category (no checks) => Map with previous categories 2.2 Update Workspace with categories (1) 3.1 Create Groups (no checks) => Link with workspace (1) and Map with previous groups 3.2 Update Groups (no checks) => Link with parents group (3.1) 3.3 Update Category (no checks) => Link with groups (3.1) for rights 4.1 Create PortalElement (no checks) => Map with previous portal element, workspace (1), groups (3.1), categories (1) 4.2 Recursive duplicate (no checks) 5.1 Create WSTypeEntry (no checks) => Link with categories (2), groups (3.1) 5.2 Create WKRole (not stored) => Link with groups (3.1) 5.3 Update Workspace (no checks) => Link with (5.1) and (5.2)
context
- the WorkspaceWizardContextprotected static void createDuplicateCategories(WorkspaceWizardContext context)
context
- the WizardContextprotected static boolean createWorkspace(WorkspaceWizardContext context)
context
- the WizardContextprotected static void createGroups(WorkspaceWizardContext context)
context
- the WizardContextprotected static void createPortals(WorkspaceWizardContext context)
context
- the WizardContextprotected static void updateWorkspace(WorkspaceWizardContext context)
context
- the WizardContextpublic static int getNonCollaborativeWorkspaceCount()
public static int getCollaborativeSpaceCount()
public static java.util.Collection<java.lang.String> getAllIncomingMailLocalPart()
public static Workspace getIncomingMailLocalPartWorkspace(java.lang.String localPart)
localPart
- the local part to retrieve the associated Workspace.public static java.lang.String getIncomingMailPattern(Workspace ws)
Example:
Given a Workspace which incoming mail local part is local-part
and site incoming mail suffix is @jcms.company.com,
the output will be: local-part\+.*@jcms.company.com
ws
- the Workspace to compute its incoming mail pattern.public static void initIncomingMails()
public static void updateIncomingMailPattern(Workspace workspace, Workspace oldWorkspace)
IncomingMailListener
.workspace
- the Workspace after update (must be null in delete case)oldWorkspace
- the Workspace before update (may be null in create case)IncomingMailListener.addMailPattern(String, IncomingMailCriteria)
public static java.util.Set<Workspace> getSearchedWorkspaceSet(Member mbr, java.lang.String userLang, java.lang.String query, boolean withPortal, boolean showModel)
mbr
- the Member
userLang
- the user languagewithPortal
- if set to true, only workspaces with a portal will be added to the setshowModel
- if set to true, models the member can work on will be displayed. If false, models will be removed from setSet
of Workspace
public static java.util.Set<Workspace> getOtherWorkspaceSet(Member member, java.lang.String userLang, java.util.Set<Workspace> workspaceToExcludeSet, boolean belongsToWorkspace, boolean isWorker, boolean withPortal)
userLang
- the current user languageworkspaceToExcludeSet
- the Set of Workspace
to exclude from setCopyright © 2001-2018 Jalios SA. All Rights Reserved.