Class Workspace

    • Field Detail

      • WORKSPACE_DELETION_CONTROLLER_CTXT

        public static final java.lang.String WORKSPACE_DELETION_CONTROLLER_CTXT
        See Also:
        Constant Field Values
      • COLLABORATIVESPACE_CLASSNAME

        public static final java.lang.String COLLABORATIVESPACE_CLASSNAME
        See Also:
        Constant Field Values
      • PORTALJSPCOLLECTION_CLASSNAME

        public static final java.lang.String PORTALJSPCOLLECTION_CLASSNAME
        See Also:
        Constant Field Values
      • LAST_QUOTA_NOTIFICATION_DATE

        public static final java.lang.String LAST_QUOTA_NOTIFICATION_DATE
        See Also:
        Constant Field Values
      • title

        protected java.lang.String title
      • titleML

        protected java.util.HashMap<java.lang.String,​java.lang.String> titleML
      • order

        protected int order
      • administrators

        protected java.util.ArrayList<Member> administrators
      • administratorsDBID

        protected java.util.ArrayList<java.lang.String> administratorsDBID
      • typeMap

        protected java.util.HashMap<java.lang.Class<?>,​java.lang.Object> typeMap
      • wfByInstanceMap

        protected java.util.HashMap<java.lang.Class<?>,​java.lang.Boolean> wfByInstanceMap
      • instanceWorkflowIdMap

        protected java.util.HashMap<java.lang.Class<?>,​java.util.Set<java.lang.String>> instanceWorkflowIdMap
      • instanceWorkflowGroupMap

        protected java.util.HashMap<java.lang.Class<?>,​java.util.Set<java.lang.String>> instanceWorkflowGroupMap
      • roleMap

        protected java.util.HashMap<java.lang.String,​WKRole> roleMap
      • catSet

        protected java.util.HashSet<Category> catSet
      • isModel

        protected boolean isModel
      • isClosed

        protected boolean isClosed
      • language

        protected java.lang.String language
      • defaultGroup

        protected Group defaultGroup
      • isIncomingMailEnabled

        protected boolean isIncomingMailEnabled
      • incomingMailLocalPart

        protected java.lang.String incomingMailLocalPart
      • alertThreshold

        protected int alertThreshold
      • quota

        protected long quota
      • useDefaultQuota

        protected boolean useDefaultQuota
      • groupSet

        protected transient java.util.TreeSet<Group> groupSet
      • pubSet

        protected transient java.util.TreeSet<Publication> pubSet
      • classPubSetMap

        protected transient java.util.HashMap<java.lang.Class<?>,​java.util.Set<Publication>> classPubSetMap
      • lastQuotaNotificationDate

        protected transient long lastQuotaNotificationDate
      • collaborativeSpaceClass

        protected transient java.lang.Class<?> collaborativeSpaceClass
      • collaborativeSpace

        protected transient java.lang.ref.WeakReference<PortletCollection> collaborativeSpace
      • PARENT_WORKSPACE_PARAMNAME

        public static java.lang.String PARENT_WORKSPACE_PARAMNAME
      • WORKSPACE_MODEL_ICON

        public static final java.lang.String WORKSPACE_MODEL_ICON
        See Also:
        Constant Field Values
      • WORKSPACE_CLOSED_ICON

        public static final java.lang.String WORKSPACE_CLOSED_ICON
        See Also:
        Constant Field Values
      • WORKSPACE_CS_ICON

        public static final java.lang.String WORKSPACE_CS_ICON
        See Also:
        Constant Field Values
      • WORKSPACE_CS_MODEL_ICON

        public static final java.lang.String WORKSPACE_CS_MODEL_ICON
        See Also:
        Constant Field Values
      • WORKSPACE_CS_CLOSED_ICON

        public static final java.lang.String WORKSPACE_CS_CLOSED_ICON
        See Also:
        Constant Field Values
      • WORKSPACE_MODEL_CLOSED_ICON

        public static final java.lang.String WORKSPACE_MODEL_CLOSED_ICON
        See Also:
        Constant Field Values
      • ALL_WORKSPACE_ICON

        public static final java.lang.String ALL_WORKSPACE_ICON
        See Also:
        Constant Field Values
      • cachedHomeData

        protected transient Data cachedHomeData
      • cachedHomePortal

        protected transient boolean cachedHomePortal
    • Constructor Detail

      • Workspace

        public Workspace()
      • Workspace

        public Workspace​(Workspace other)
    • Method Detail

      • checkWrite

        public ControllerStatus checkWrite​(int op,
                                           Member mbr,
                                           boolean checkIntegrity,
                                           java.util.Map context)
        Description copied from class: Data
        Checks if the given write operation can be performed
        Overrides:
        checkWrite in class Data
        Parameters:
        op - the operation (OP_CREATE, OP_UPDATE, ...)
        mbr - the member which requests the write operation
        checkIntegrity - if true, requires the constraints integrity to be checked
        context - a map which contains context parameters (may be null)
        Returns:
        a ControllerStatus
      • getRootWorkspaces

        public static java.util.Set<Workspace> getRootWorkspaces​(java.util.Comparator<Workspace> comparator)
        All Workspaces with no parent, sorted with comparator if not null.
        Parameters:
        comparator - the comparator
        Returns:
        All orphean WS
        Since:
        jcms-7.0.0
      • getRootWorkspaces

        public static java.util.Set<Workspace> getRootWorkspaces​(java.util.Comparator<Workspace> comparator,
                                                                 Member loggedMember)
        All Workspaces with no parent the loggedMember in parameter belongs to, sorted with comparator if not null.
        Parameters:
        comparator - the comparator
        loggedMember - the loggedMember
        Returns:
        All orphean WS, as seen for loggedMember
        Since:
        jcms-7.0.0
      • getParent

        public Workspace getParent​(Member loggedMember)
        Get the Parent workspace from the one in parameter, if loggedMember is not null, the WS is return only if he is worker of it.
        Parameters:
        loggedMember - the logged member
        Returns:
        The Parent WS if loggedMember is worker of it
      • setDefaultGroup

        public void setDefaultGroup​(Group defaultGroup)
        Set the default group for this workspace.
        Parameters:
        defaultGroup - the default group.
        Since:
        jcms-7.0.0
      • getDefaultGroup

        public Group getDefaultGroup()
        Returns the default group for this workspace. If there is no default group, returns the group with lesser DataRight.
        Returns:
        the default group for this workspace.
        Since:
        jcms-7.0.0
      • getDefaultGroup

        public Group getDefaultGroup​(boolean search)
        Returns the default group for this workspace.
        Parameters:
        search - if true and if there is no default group, returns the group with lesser DataRight.
        Returns:
        the default group for this workspace.
        Since:
        jcms-7.0.0
      • getSubWorkspaces

        public java.util.Set<Workspace> getSubWorkspaces()
        Gives the set of all WS just under the ws in parameter.
        Returns:
        All children ws in a Set.
      • getSubWorkspaces

        public java.util.Set<Workspace> getSubWorkspaces​(Member loggedMember)
        Return the workspaces just under the workspace in parameter. If the loggedMember parameter is not null, only workspaces for which the loggedMember is worker are returned.
        Parameters:
        loggedMember - Only Workspaces for which the loggedMember is Worker are returned
        Returns:
        All the ws sons of the workspace in parameter for which the loggedMember is worker.
      • getAllSubWorkspaces

        public java.util.Set<Workspace> getAllSubWorkspaces()
        Return all the descendant Workspaces of the current Workspace.
        Returns:
        All descendant Workspaces in a Set.
      • getAllSubWorkspaces

        public java.util.Set<Workspace> getAllSubWorkspaces​(Member loggedMember)
        Return all the descendant Workspaces of the current Workspace.
        If the loggedMember parameter is not null, only Workspaces for which the Member is Worker are returned.
        Parameters:
        loggedMember - Only Workspaces for which this Member is Worker are returned
        Returns:
        All the descendant Workspaces of the current Workspace for which the loggedMember is Worker.
      • getTreeParent

        public Workspace getTreeParent()
        Description copied from interface: TreeNode
        Returns parent of the current node
        Specified by:
        getTreeParent in interface TreeNode
        Returns:
        TreeNode parent Node
      • isTreeLeaf

        public boolean isTreeLeaf()
        Description copied from interface: TreeNode
        Returns boolean true if the TreeNode is a leaf
        Specified by:
        isTreeLeaf in interface TreeNode
        Returns:
        boolean indicating if node is leaf or node
      • isTreeNode

        public boolean isTreeNode()
        Description copied from interface: TreeNode
        Returns boolean true if the TreeNode is a node
        Specified by:
        isTreeNode in interface TreeNode
        Returns:
        boolean indicating if node is leaf or node
      • getTreeRoot

        public TreeNode getTreeRoot()
        Description copied from interface: TreeNode
        Returns the root of the current node
        Specified by:
        getTreeRoot in interface TreeNode
        Returns:
        TreeNode root Node
      • getTreeChildren

        public java.util.Collection<? extends TreeNode> getTreeChildren()
        Description copied from interface: TreeNode
        Returns a Collection of TreeNode children of the current node
        Specified by:
        getTreeChildren in interface TreeNode
        Returns:
        Collection of TreeNode
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Data
      • exportXmlField

        public void exportXmlField​(java.lang.StringBuffer sb,
                                   int indentLevel)
        Description copied from class: Data
        Fills the given StringBuffer with Xml export of fields of this data.
        Overrides:
        exportXmlField in class Data
        Parameters:
        sb - the StringBuffer
        indentLevel - the indent level
      • toCSV

        public java.lang.String toCSV​(java.lang.String lang)
        Returns a CSV view of this object
        Overrides:
        toCSV in class Data
        Parameters:
        lang - the output language
        Returns:
        a CSV view of this object
        Since:
        jcms-5.0.0
      • getCSVHeader

        public static java.lang.String getCSVHeader​(java.lang.String lang)
        Returns the CSV header of this object
        Parameters:
        lang - the output language
        Returns:
        the CSV header of this object
        Since:
        jcms-5.0.0
      • getIcon

        public java.lang.String getIcon()
        Returns the image path icon for the given workspace
        Returns:
        String image relative path
        Since:
        jcms-5.5.0
      • getDataIcon

        public java.lang.String getDataIcon()
        Description copied from class: Data
        Returns source information for the icon associated to this Data, either a relative path or sprite classes name.

        If this method behavior has not been overriden by subclass, the default icon can be declared using property types.{Type}.icon, where {Type} is the short class name of the type concerned.

        • Either by specifying a relative image path :
          types.Article.icon: images/jalios/icon/abstract.gif 
        • or else by using a sprite icon :
          types.Article.icon: ss_sprite ss_date
        Overrides:
        getDataIcon in class Data
        Returns:
        a relative path (eg images/jalios/icon/abstract.gif) or sprite classes name (eg ss_sprite ss_date).
        See Also:
        Data.getDataIconHtml(String)
      • flushHomeUrl

        public void flushHomeUrl()
        Reset the cache of the home category. Should only be called by category, publication and workspace listeners
      • getHomePortal

        public PortalInterface getHomePortal()
        Retrieves the home portal for current Workspace by searching through its PortalInterface which could be a Portal, a PortalJspCollection or a CollaborativeSpace
        Returns:
        the home portal of current Workspace
        Since:
        jcms-9.0.0
      • getHomeUrl

        public java.lang.String getHomeUrl​(java.util.Locale userLocale)
        Returns the home url for the given workspace calculated from portal categories that belongs to workspace
        Parameters:
        userLocale - the user local
        Returns:
        String
      • getHomeUrlVisitor

        protected Category getHomeUrlVisitor​(java.util.Collection<Category> collect,
                                             java.util.Set<Publication> portalSet)
        Internal methods to check home url
        Parameters:
        collect - a collection of category to check
        portalSet - the portal set
        Returns:
        Category the hoem category
      • isWorkspaceCat

        public boolean isWorkspaceCat​(Category cat)
        Checks if the given category is a workspace category or a descendent of worspace categories.
        Parameters:
        cat - the child category
        Returns:
        true if the given category is a workspace category or a descendent of worspace categories.
        Since:
        jcms 4.1
      • getFirstWorkspaceCat

        public Category getFirstWorkspaceCat​(Category cat)
        Returns first workspace category mathching (or parent) given category.
        Parameters:
        cat - the child category
        Returns:
        category the workspace category.
        Since:
        jcms 5.7.4
      • getAllWorkspaceSet

        public static java.util.Set<Workspace> getAllWorkspaceSet()
        Returns a Set with all workspace, model or not. CAUTION: DO NOT alter the returned set, clone prior modification.
        Returns:
        Set of Workspace
        Since:
        jcms-5.5.0
      • getAllWorkspaceSet

        public static java.util.Set<Workspace> getAllWorkspaceSet​(Member member)
        Returns a Set of workspace, for the given member. If the Member is an Admin return all workspace (model or not) If member is not null return workspace's member otherwise return empty TreeSet.
        Parameters:
        member - the working member
        Returns:
        Set of Workspace
        Since:
        jcms-5.5.0
      • getAllWorkspaceSetWithoutModel

        public static java.util.Set<Workspace> getAllWorkspaceSetWithoutModel()
        Returns a Set with all workspace without workspace model.
        Returns:
        Set of Workspace
        Since:
        jcms-5.5.0
      • getAllWorkspaceSetModel

        public static java.util.Set<Workspace> getAllWorkspaceSetModel()
        Returns a Set with all workspace model.
        Returns:
        Set of Workspace
        Since:
        jcms-5.5.0
      • getAllWorkingWorkspaceSet

        public static java.util.SortedSet<Workspace> getAllWorkingWorkspaceSet​(Member loggedMember,
                                                                               JcmsContext jcmsContext)
        Gives the list of workspaces for which the current loggedMember is a worker.
        Parameters:
        loggedMember - the current logged member
        jcmsContext - the current jcmsContext
        Returns:
        the sorted, regarding to the title in the current language, set of workspace for which the logged member is worker
      • getWorkflow

        public Workflow getWorkflow​(java.lang.Class clazz)
        Find the Worflow associated to the given class. This method also check for super class.
        Parameters:
        clazz - the class
        Returns:
        the workflow linked to the given class.
        Since:
        jcms-4.1
        See Also:
        getWorkflow(Class, boolean)
      • getWorkflow

        public Workflow getWorkflow​(java.lang.Class<?> clazz,
                                    boolean checkSuperclass)
        Find the Worflow associated to the given class or one of it's super class. Since jcms-5.5.0, the workflow stored in the typeMap may be a String or a WSTypeEntry
        Parameters:
        clazz - the target class
        checkSuperclass - should check super class
        Returns:
        the workflow linked to the given class.
        Since:
        jcms-4.1
        See Also:
        getWorkflow(Class)
      • getWSTypeEntry

        public WSTypeEntry getWSTypeEntry​(java.lang.Class clazz)
        Returns a WSTypeEntry describing custom properties for a given type in a given workspace. WARNING: If Workspace doesn't handle a WSTypeEntry for this class it will return a fake WSTypeEntry.
        Parameters:
        clazz - the target class
        Returns:
        WSTypeEntry the type description or null if it doesn't exists
        Since:
        jcms-5.5.0
      • getWSTypeEntry

        public WSTypeEntry getWSTypeEntry​(java.lang.String className)
        Returns a WSTypeEntry describing custom properties for a given type in a given workspace. WARNING: If Workspace doesn't handle a WSTypeEntry for this class it will return a fake WSTypeEntry.
        Parameters:
        className - the target class name
        Returns:
        WSTypeEntry the type description or null if it doesn't exists
        Since:
        jcms-5.5.0
      • getTypeLabel

        public java.lang.String getTypeLabel​(java.lang.Class clazz,
                                             java.lang.String lang)
        Returns the label for the given type (class) in the given language.
        Parameters:
        clazz - the class
        lang - the language
        Returns:
        the label for the given type in the given language.
      • getTypeDescription

        public java.lang.String getTypeDescription​(java.lang.Class clazz,
                                                   java.lang.String lang)
        Returns the description for the given type (class) in the given language.
        Parameters:
        clazz - the class
        lang - the language
        Returns:
        the description for the given type (class) in the given language.
      • hasWorkflow

        public boolean hasWorkflow​(java.lang.Class clazz)
        Check if the type is linked to a workflow for this workspace
        Parameters:
        clazz - the class to check
        Returns:
        true if the type is linked to a workflow
        Since:
        jcms-4.1
      • getTypeSet

        public java.util.Set<java.lang.Class<?>> getTypeSet()
        Returns a Set of all visible types
        Returns:
        a Set of all visible types (String)
        Since:
        jcms-4.1
      • getSubTypeSet

        public <T> java.util.Set<java.lang.Class<? extends T>> getSubTypeSet​(java.lang.Class<T> clazz,
                                                                             Member mbr)
        Returns a set of types used in this Workspace, extending the given class and that the given member can publish.
        Parameters:
        clazz - the class
        mbr - the member
        Returns:
        a set of types used in this Workspace, extending the given class and that the given member can publish.
        Since:
        jcms-9.0.0
      • getSubTypeSet

        public <T> java.util.Set<java.lang.Class<? extends T>> getSubTypeSet​(java.lang.Class<T> clazz,
                                                                             Member mbr,
                                                                             java.util.Map<java.lang.String,​?> contextMap)
        Returns a set of types used in this Workspace, extending the given class and that the given member can publish.
        Parameters:
        clazz - the class
        mbr - the member
        contextMap - an optional context map providing information on publish request context, may be null
        Returns:
        a set of types used in this Workspace, extending the given class and that the given member can publish.
        Since:
        jcms-10.0.6 / JCMS-8882
      • getSubTypeSet

        public <T> java.util.Set<java.lang.Class<? extends T>> getSubTypeSet​(java.lang.Class<T> clazz)
        Returns a set of types used in this Workspace, extending the given class.
        Parameters:
        clazz - the class
        Returns:
        a set of types used in this Workspace, extending the given class.
        Since:
        jcms-10.0.5
      • canPublish

        public boolean canPublish​(java.lang.Class clazz)
        Checks if the given class can be published in this workspace.
        Parameters:
        clazz - the Class for which publication authorization should be verified
        Returns:
        true if the given class can be published in this workspace
        Since:
        jcms-4.1
      • getWorkflowSet

        public java.util.Set<Workflow> getWorkflowSet()
        Returns a Set of all workflow used by calling getWorkflow(clazz,false) on all clazz.
        Returns:
        a Set of all workflow used
        Since:
        jcms-4.1
      • setTypeWorkflow

        public void setTypeWorkflow​(java.lang.Class<?> clazz,
                                    Workflow wf)
        Link a Workflow to a given Class. Warning since jcms-5.5.0 Workspace may use a WSTypeEntry. You may also use setWSTypeEntry(Class,WSTypeEntry) If the given class is linked to a WSTypeEntry then this method will throw a RuntimeException.
        Parameters:
        clazz - the clazz to link
        wf - the workflow to link
        Since:
        jcms-5.5.0
        See Also:
        setWSTypeEntry(Class, WSTypeEntry)
      • setWSTypeEntry

        public boolean setWSTypeEntry​(java.lang.Class<?> clazz,
                                      WSTypeEntry wste)
        Link a WSTypeEntry to a given Class. If WSTypeEntry.isSameProperties() than channel properties then do not store the WSTypeEntry. Warning: Caller must create, update or delete the WSTypeEntry this method is only a convenient setter
        Parameters:
        clazz - the clazz to link
        wste - the WSTypeEntry to link with
        Returns:
        boolean true if the WSTypeEntry is used or false if it is same
        Since:
        jcms-5.5.0
      • getPublicationSet

        public java.util.Set<Publication> getPublicationSet​(Workflow workflow)
        Return all publication for a given Workflow
        Parameters:
        workflow - the workflow
        Returns:
        a Set of publication
        Since:
        jcms-4.1
      • getPublicationSet

        public java.util.Set<Publication> getPublicationSet​(Workflow workflow,
                                                            boolean specialState)
        Return all the publication in/not a special state for the given Workflow
        Parameters:
        workflow - the workflow
        specialState - the state
        Returns:
        a Set of publication
        Since:
        jcms-4.1
      • getPubSet

        public java.util.TreeSet<Publication> getPubSet()
        Returns:
        Returns the pubSet.
        Since:
        jcms-4.1
      • updatePubSet

        public void updatePubSet​(Publication pub,
                                 boolean add)
        Update pubSet index
        Parameters:
        pub - the publication to be added or removed
        add - add if true, remove if false
        Since:
        jcms-5.0.1
      • getClassPubSetMap

        public java.util.HashMap<java.lang.Class<?>,​java.util.Set<Publication>> getClassPubSetMap()
        Returns:
        map(class, pubSet)
        Since:
        jcms-4.1
      • getPublicationSet

        public <T extends Publication> java.util.Set<T> getPublicationSet​(java.lang.Class<?> clazz,
                                                                          boolean specialState)
        Return all the publication in/not a special state for the given class
        Type Parameters:
        T - a Publication type
        Parameters:
        clazz - the class
        specialState - the state
        Returns:
        a Set of publication
        Since:
        jcms-4.1
      • getPublicationSet

        public <T extends Publication> java.util.Set<T> getPublicationSet​(java.lang.Class<?> clazz)
        Return all publication for a given Clazz
        Type Parameters:
        T - a Publication type
        Parameters:
        clazz - the class
        Returns:
        a Set of publication
        Since:
        jcms-4.1
      • getWFRole

        public WFRole getWFRole​(WKRole wkRole)
        Returns the WFRole bound to the given WKRole.
        Parameters:
        wkRole - the WKRole to look for.
        Returns:
        the WFRole bound to the given WKRole.
        Since:
        jcms-5.0.5
      • getRole

        public WKRole getRole​(WFRole wfRole)
        Get the WKRole linked to a WFRole for a given Workflow
        Parameters:
        wfRole - the role
        Returns:
        WKRole associated to the given WFRole
        Since:
        jcms-4.1
      • setRole

        public void setRole​(WFRole wfRole,
                            WKRole wkRole)
        Binds a WKRole to a WFRole
        Parameters:
        wfRole - the WFRole
        wkRole - the WKRole
        Since:
        jcms-5.5.0
      • getRole

        public WKRole getRole​(java.lang.String wfRoleId)
        Get the WKRole linked to a WFRole for a given Workflow
        Parameters:
        wfRoleId - the role id
        Returns:
        WKRole associated to the given WFRole
        Since:
        jcms-4.1
      • hasWKRole

        public boolean hasWKRole​(java.lang.String wfRoleId)
        Check if a WKRole exists in this workspace for the specified WFRole id
        Parameters:
        wfRoleId - the id of the WFRole to check
        Returns:
        true if the wfRoleID have associated WKRole
        Since:
        jcms-4.1
      • hasWKRole

        public boolean hasWKRole​(WFRole wfRole)
        Check if a WKRole exists in this workspace for the specified WFRole
        Parameters:
        wfRole - the WFRole to check
        Returns:
        true if the wfRole have associated WKRole
        Since:
        jcms-4.1
      • getWFRoleIdSet

        public java.util.Set<java.lang.String> getWFRoleIdSet()
        Return a set of all WFRoleId
        Returns:
        a set of WFRoleId
        Since:
        jcms-4.1
      • getWFRoleSet

        public java.util.Set<WFRole> getWFRoleSet()
        Return a set of all WFRole
        Returns:
        a set of WFRole
        Since:
        jcms-4.1
      • getWKRoleSet

        public java.util.Set<WKRole> getWKRoleSet()
        Return a set of all WKRole
        Returns:
        a set of WKRole
        Since:
        jcms-4.1
      • getWKRoleSet

        public java.util.Set<WKRole> getWKRoleSet​(Workflow wf)
        Return all the WKRole for a given Workflow
        Parameters:
        wf - the workflow
        Returns:
        a Set of WKRole
        Since:
        jcms-4.1
      • getWKRoleSet

        public java.util.Set<WKRole> getWKRoleSet​(java.lang.Class clazz)
        Return all the WKRole for a given Class
        Parameters:
        clazz - the class
        Returns:
        a Set of WKRole
        Since:
        jcms-4.1
      • linkRole

        public void linkRole​(WFRole wfRole,
                             WKRole wkRole)
        Link into the workspace a WFRole to a WKRole
        Parameters:
        wfRole - the WFRole
        wkRole - the WKRole
        Since:
        jcms-4.1
      • isAdmin

        public boolean isAdmin​(Member member)
        Check if the member is an administrator of the workspace or of the channel
        Parameters:
        member - the member
        Returns:
        true if the member is an administrator
        Since:
        jcms-4.1
      • isMember

        public boolean isMember​(Member member)
        Returns true if the given member belongs tho this workspace.
        Parameters:
        member - the member
        Returns:
        true if the given member belongs tho this workspace.
        Since:
        jcms-7.1.0
      • getComparator

        public static java.util.Comparator<Workspace> getComparator​(java.lang.String str,
                                                                    boolean reverse)
        Deprecated.
        Since:
        jcms-5.0.0
      • getNameComparator

        public static java.util.Comparator<Workspace> getNameComparator​(java.lang.String lang)
        Returns a new Comparator instance to compare workspace based on their title.
        Parameters:
        lang - the language in which to compare workspace
        Returns:
        a new NameComparator instance
        Since:
        jcms-5.6.1
      • getOrderComparator

        public static java.util.Comparator<Workspace> getOrderComparator​(java.lang.String lang)
        Returns a new Comparator instance to compare workspace based on their order.
        Parameters:
        lang - the language in which to compare workspaces'title when order is the same.
        Returns:
        a new OrderComparator instance
        Since:
        jcms-5.6.1
      • getGroupSizeComparator

        public static java.util.Comparator<Workspace> getGroupSizeComparator​(java.lang.String lang)
        Returns a new Comparator instance to compare workspace based on the number of groups in each workspace.
        Parameters:
        lang - the language in which to compare workspaces'title when number of groups is the same.
        Returns:
        a new GroupSizeComparator instance
        Since:
        jcms-5.6.1
      • getMemberSizeComparator

        public static java.util.Comparator<Workspace> getMemberSizeComparator​(java.lang.String lang)
        Returns a new Comparator instance to compare workspace based on the number of members in each workspace.
        Parameters:
        lang - the language in which to compare workspaces'title when number of members is the same.
        Returns:
        a new MemberSizeComparator instance
        Since:
        jcms-5.6.1
      • getFavoriteComparator

        public static java.util.Comparator<Workspace> getFavoriteComparator​(Member mbr,
                                                                            java.lang.String lang)
        Returns a new Comparator instance to compare workspace based on member engagement.

        Parameters:
        mbr - the member
        lang - the language in which to compare workspaces' title as default order criteria.
        Returns:
        a new Workspace.FavoriteComparator instance
        Since:
        jcms-9.0.0
        See Also:
        Workspace.FavoriteComparator
      • getActiveWorkspaceSelector

        public static DataSelector getActiveWorkspaceSelector()
        Returns the selector for active Workspaces (Not a model, and not closed)
        Returns:
        the selector to filter active workspaces
        Since:
        jcms-10.0.0
      • getMemberSet

        public java.util.Set<Member> getMemberSet()
        Deprecated.
        since JCMS-5751, use AllMemberQueryHandler
        Returns a set of members that belongs to groups of this workspace. This method only returns Member (no DBMember).
        Returns:
        a new Set containing all members of this Workspace
      • getMemberSet

        public java.util.Set<Member> getMemberSet​(boolean includeDBMember)
        Deprecated.
        since JCMS-5751, use AllMemberQueryHandler
        Returns a set of members that belongs to groups of this workspace.
        Parameters:
        includeDBMember - if true it includes for DBMember (up to HibernateManager.getDefaultMaxResults()).
        Returns:
        a new Set containing all members of this Workspace
        Since:
        jcms-7.0.0
      • getMemberCount

        public int getMemberCount​(boolean includeDBMember)
        Returns the member count for this workspace.
        Parameters:
        includeDBMember - if true it includes for DBMember.
        Returns:
        the member count for this workspace.
        Since:
        jcms-8.0.0
      • hasDBMember

        public boolean hasDBMember()
        Returns true if DBMembers belong to this workspace
        Returns:
        true if DBMembers belong to this workspace
        Since:
        jcms-7.1.1
      • invalidateHasDBMember

        public void invalidateHasDBMember()
        Invalidate the cache for hasDBMember method.
        Since:
        jcms-7.1.1
      • setSessionWorkspace

        public static void setSessionWorkspace​(javax.servlet.http.HttpSession session,
                                               Workspace workspace)
        Set the given workspace to the session.
        Parameters:
        session - the session
        workspace - the workspace
        Since:
        jcms-4.1
      • getSessionWorkspace

        public static Workspace getSessionWorkspace​(javax.servlet.http.HttpSession session)
        Get the workspace stored in the session
        Parameters:
        session - the session
        Returns:
        the workspace in the session
        Since:
        jcms-4.1
      • setRequestWorkspace

        public static void setRequestWorkspace​(javax.servlet.http.HttpServletRequest request,
                                               Workspace workspace)
        Set the given workspace to the request.
        Parameters:
        request - the request
        workspace - the workspace
        Since:
        jcms-5.0
      • getRequestWorkspace

        public static Workspace getRequestWorkspace​(javax.servlet.http.HttpServletRequest request)
        Get the workspace stored in the request
        Parameters:
        request - the request
        Returns:
        the workspace in the request
        Since:
        jcms-5.0
      • getDataName

        public java.lang.String getDataName​(java.lang.String language)
        Description copied from class: Data
        Return the name of this Data, every sub class Data which will be displayed to user should implements this method already.
        • The Title (multi-language) for a Publication.
        • The Name (multi-language) for a Category.
        • The Name for a Group, a Member.
        • The Title (multi-language) for a Workspace.
        Can be seen as a smart multi-language toString(), but never returning null.
        Default behaviour is to return toFullString() of Data or empty string if toFullString is null.
        Overrides:
        getDataName in class Data
        Parameters:
        language - the language in which to return the name if multilang available for the data.
        Returns:
        title of Workspace in given language or empty String if not specified.
        Since:
        jcms-5.1
        See Also:
        getTitle(String), Data.getDataName(String)
      • getTitle

        public java.lang.String getTitle​(java.lang.String lang)
        Get the value of title bound to the given language.
        Parameters:
        lang - the language to get the title
        Returns:
        title in the given language.
        Since:
        jcms-4.1
      • getTitle

        public java.lang.String getTitle​(java.lang.String lang,
                                         boolean useDefault)
        Get the value of title bound to the given language.
        Parameters:
        lang - the language to get the title
        useDefault - should main language used as default language if title does not exist in the given language
        Returns:
        title in the given language.
        Since:
        jcms-4.1
      • getTitle

        public java.lang.String getTitle()
        Get the value of title.
        Returns:
        Value of title.
        Since:
        jcms-4.1
      • setTitle

        public void setTitle​(java.lang.String v)
        Set the value of title.
        Parameters:
        v - Value to assign to title.
        Since:
        jcms-4.1
      • getTitleML

        public java.util.HashMap<java.lang.String,​java.lang.String> getTitleML()
        Retrieve the HashMap containing the titles of this Workspace in language other than the main site language.
        Returns:
        an HashMap of String.
        Since:
        jcms-4.1
      • setTitleML

        public void setTitleML​(java.util.HashMap<java.lang.String,​java.lang.String> v)
        Set the HashMap containing the titles of this Workspace in language other than the main site language.
        Parameters:
        v - Value to assign to titleML.
        Since:
        jcms-4.1
      • setTitle

        public void setTitle​(java.lang.String lang,
                             java.lang.String value)
        Convenient method to set the value of the title field in any language (default site language or any other).
        This method will set the proper field value (setTitle(String) or setTitleML(HashMap)) depending on the specified language.
        Parameters:
        lang - the language (ISO 639 code) in which to set the value
        value - the value to set.
        Since:
        jcms-10.0.1
        See Also:
        setTitle(String), setTitleML(HashMap)
      • isModel

        public boolean isModel()
        Getter for model
        Returns:
        model is workspace is a model
      • setModel

        public void setModel​(boolean model)
        Setter for model
        Parameters:
        model - is workspace is a model
      • isClosed

        public boolean isClosed()
        Getter for isClosed. Is a workspace is closed, no contribution, no modification on groups are allowed.
        Returns:
        isClosed is workspace is Closed For Contribution
      • setClosed

        public void setClosed​(boolean closed)
        Setter for isClosed
        Parameters:
        closed - to close this workspace for contribution
      • isOpen

        public boolean isOpen()
      • getRoleMap

        public java.util.HashMap<java.lang.String,​WKRole> getRoleMap()
        Getter of RoleMap
        Returns:
        the association: Workflow / WfRoleSet
        Since:
        jcms-4.1
      • setRoleMap

        public void setRoleMap​(java.util.HashMap<java.lang.String,​WKRole> roleMap)
        Setter of RoleMap
        Parameters:
        roleMap - the RoleMap
        Since:
        jcms-4.1
      • getTypeMap

        public java.util.HashMap<java.lang.Class<?>,​java.lang.Object> getTypeMap()
        Getter of TypeMap
        Returns:
        a Map Class / Workflow Id
        Since:
        jcms-4.1
      • setTypeMap

        public void setTypeMap​(java.util.HashMap<java.lang.Class<?>,​java.lang.Object> typeMap)
        Setter of TypeMap
        Parameters:
        typeMap - the TypeMap
        Since:
        jcms-4.1
      • getOrder

        public int getOrder()
        Returns:
        Returns the order.
        Since:
        jcms-4.1
      • setOrder

        public void setOrder​(int order)
        Parameters:
        order - The order to set.
        Since:
        jcms-4.1
      • getGroupSet

        public java.util.TreeSet<Group> getGroupSet()
        Returns:
        Returns the groupSet.
        Since:
        jcms-4.1
      • updateGroupSet

        public void updateGroupSet​(Group grp,
                                   boolean add)
        Update the groupSet index
        Parameters:
        grp - the group to be added or removed
        add - add if true, remove if false
        Since:
        jcms-5.0.1
      • getAdministrators

        public java.util.ArrayList<Member> getAdministrators()
        Retrieve administrators of this workspace (including DBMember).

        Returns:
        Returns the administrators.
        CAUTION: DO NOT alter the returned List, clone prior modification.
        Since:
        jcms-4.1
        See Also:
        getAdministrators(boolean)
      • getAdministrators

        public java.util.ArrayList<Member> getAdministrators​(boolean queryDB)
        Retrieve administrators of this workspace.

        Including or not DBMember.

        Parameters:
        queryDB - whether to query Database to retrieve any DBMember specified as administrators of this workspace
        Returns:
        an ArrayList of Members, may return null and may contains null value when queryDB is set to false
        Since:
        JCMS-6331
      • setAdministrators

        public void setAdministrators​(java.util.ArrayList<Member> administrators)
        Parameters:
        administrators - The administrators to set.
        Since:
        jcms-4.1
      • setAdministratorsDBID

        public void setAdministratorsDBID​(java.util.ArrayList<java.lang.String> dbMbrIds)
        Set the ids of DBMember to configure as administrators of this workspace.
        Parameters:
        dbMbrIds - an ArrayList of DBMember ids, may be null
        Since:
        JCMS-6331
        See Also:
        setAdministrators(ArrayList)
      • getAdministratorsDBID

        public java.util.ArrayList<java.lang.String> getAdministratorsDBID()
        Retrieve the ids of DBMember configured as administrators of this workspace.
        Returns:
        an ArrayList of DBMember ids, may be null
        Since:
        JCMS-6331
        See Also:
        getAdministrators()
      • splitHybridCollections

        protected void splitHybridCollections​(Data previousData)
        Description copied from class: Data
        This method must be overrided by sub-classes that are persisted in JStore and that have hybrid collection/array.
        Overrides:
        splitHybridCollections in class Data
        Parameters:
        previousData - the previous data (provided for update only)
      • cleanHybridCollections

        protected void cleanHybridCollections()
        Description copied from class: Data
        This method must be overrided by sub-classes that are persisted in JStore and that have hybrid collection/array.
        Overrides:
        cleanHybridCollections in class Data
      • getCatSet

        public java.util.HashSet<Category> getCatSet()
        Returns:
        Returns the catSet.
        Since:
        jcms-4.1
      • setCatSet

        public void setCatSet​(java.util.HashSet<Category> catSet)
        Parameters:
        catSet - The catSet to set.
        Since:
        jcms-4.1
      • getTagRoot

        public Category getTagRoot()
        Returns:
        the tag root.
        Since:
        jcms-7.1.0
      • setTagRoot

        public void setTagRoot​(Category tagRoot)
        Parameters:
        tagRoot - the tag root to set.
        Since:
        jcms-7.1.0
      • getLanguage

        public java.lang.String getLanguage()
        Returns:
        Returns the main Language of the workspace if it is specified. null otherwise.
        Since:
        jcms-5.7.3
      • setLanguage

        public void setLanguage​(java.lang.String language)
        Parameters:
        language - The language to set.
        Since:
        jcms-5.7.3
      • getParent

        public Workspace getParent()
        Returns:
        Returns the parent Workspace of the current workspace if it has one. null otherwise.
        Since:
        jcms-7.0.0
      • setParent

        public void setParent​(Workspace parent)
        Parameters:
        parent - The parent workspace to set.
        Since:
        jcms-7.0.0
      • isIncomingMailEnabled

        public boolean isIncomingMailEnabled()
        Returns:
        true if the incoming mail is enabled in this Workspace.
        Since:
        jcms-9.0.0
      • setIncomingMailEnabled

        public void setIncomingMailEnabled​(boolean enable)
        Parameters:
        enable - true to enable the incoming mail in this Workspace.
        Since:
        jcms-9.0.0
      • getIncomingMailLocalPart

        public java.lang.String getIncomingMailLocalPart()
        Returns:
        the localPart of the incoming E-mail address.
        Since:
        jcms-9.0.0
      • getIncomingMailDefaultLocalPart

        public java.lang.String getIncomingMailDefaultLocalPart()
        Returns:
        a default, generated, not already used, incoming Mail LocalPart, built on Workspace's title in its main language.
        Since:
        jcms-9.0.0
      • setIncomingMailLocalPart

        public void setIncomingMailLocalPart​(java.lang.String localPart)
        Parameters:
        localPart - the incoming Mail Address' localPart to set
        Since:
        jcms-9.0.0
      • getIncomingAddress

        public java.lang.String getIncomingAddress​(Member member)
        Computes an incoming e-mail for given Member.

        Output is like:

        "space_email+mbr_authkey@server.com"
        Parameters:
        member - the member for who generate the E-mail address.
        Returns:
        an incoming Email address for this Workspace and Member, or null if incoming mail is disabled.
        Since:
        jcms-9.0.0
        See Also:
        MailManager.getIncomingAddress(String, Member, String)
      • getIncomingAddress

        public java.lang.String getIncomingAddress​(Member member,
                                                   boolean useLabel)
        Computes an incoming e-mail for given Member.

        If label is used, output is like:

        "Space title <space_email+mbr_authkey@server.com>"

        Else, output is like:
        "space_email+mbr_authkey@server.com"
        Parameters:
        member - the member for who generate the E-mail address.
        useLabel - weither to use Workspace title as label.
        Returns:
        an incoming Email address for this Workspace and Member, or null if incoming mail is disabled.
        Since:
        jcms-9.0.0
        See Also:
        MailManager.getIncomingAddress(String, Member, String)
      • checkIntegrity

        public ControllerStatus checkIntegrity()
        Checks whether or not data integrity constraints are respected.
        Overrides:
        checkIntegrity in class Data
        Returns:
        a ControllerStatus
        Since:
        jcms-5.0.0
      • checkMember

        public ControllerStatus checkMember​(int op,
                                            Member mbr,
                                            java.util.Map context)
        Checks if the given member can perform the given operation.
        Overrides:
        checkMember in class Data
        Parameters:
        op - the operation (OP_CREATE, OP_UPDATE, ...)
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Returns:
        a ControllerStatus
        Since:
        jcms-5.0.0
      • checkCreate

        public ControllerStatus checkCreate​(Member mbr,
                                            java.util.Map context)
        Checks if the creation can be performed
        Overrides:
        checkCreate in class Data
        Parameters:
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Returns:
        a ControllerStatus
        Since:
        jcms-5.0.0
      • checkUpdate

        public ControllerStatus checkUpdate​(Member mbr,
                                            java.util.Map context)
        Checks if the update can be performed
        Overrides:
        checkUpdate in class Data
        Parameters:
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Returns:
        a ControllerStatus
        Since:
        jcms-5.0.0
      • checkDelete

        public ControllerStatus checkDelete​(Member mbr,
                                            java.util.Map context)
        Checks if the deletion can be performed
        Overrides:
        checkDelete in class Data
        Parameters:
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Returns:
        a ControllerStatus
        Since:
        jcms-5.0.0
      • performDelete

        public void performDelete​(Member mbr,
                                  java.util.Map context)
        Performs data deletion
        Overrides:
        performDelete in class Data
        Parameters:
        mbr - the member which requests the write operation
        context - a map which contains context parameters (may be null)
        Since:
        jcms-5.0.0
      • getCatSet

        public java.util.Set<Category> getCatSet​(Member mbr)
        Gives the root categories for this Workspace, that the given member may read.
        Parameters:
        mbr - the member. May be null.
        Returns:
        a sub set of getCatSet()
        Since:
        JCMS-6.1
      • exportXmlRelated

        protected void exportXmlRelated​(java.lang.StringBuffer sb,
                                        java.lang.String related,
                                        int indentLevel)
        Overrides:
        exportXmlRelated in class Data
      • isCollaborativeSpace

        public boolean isCollaborativeSpace()
        Returns true if this workspace is a CollaborativeSpace (i.e. generated with the Collaborative Spaces Plugin).
        Returns:
        true if this workspace is a CollaborativeSpace (i.e. generated with the Collaborative Spaces Plugin).
        Since:
        jcms-6.1.0
      • getCollaborativeSpace

        public PortletCollection getCollaborativeSpace()
        Returns the CollaborativeSpace associated to this workspace (or null if none).
        Returns:
        the CollaborativeSpace associated to this workspace (or null if none).
        Since:
        jcms-10.0.5
      • isFavorite

        public boolean isFavorite​(Member member)
        Returns true if this workspace is a favorite workspace for given Member.
        Parameters:
        member - the member
        Returns:
        true if this workspace is a favorite workspace for given Member.
        Since:
        jcms-10.0.0
      • getFileSizeMap

        public ObjectLongTreeMap getFileSizeMap​(boolean refresh)
        Returns the map file size for each content-type. To improve the performances, the map is cached unless it is requested to refresh it.

        This method retrieve the underlying ObjectLongTreeMap which is NOT thread safe.
        Always synchronize iteration or modification on the returned map.

        Parameters:
        refresh - if true refresh the map
        Returns:
        the map file size for each content-type.
        Since:
        jcms-7.0.0
      • getFileAnalyzer

        public WorkspaceFileSizeResult getFileAnalyzer​(boolean refresh)
        returns WorkspaceFileSizeResult instance associated with this workspace. Note that as file analyze is down asynchronously, this method should returns null if an analyze is in progress (or if refresh is asked). In this case, user should ask getCurrentAnalyzerThread() to retrieve the analyze thread. getCompleteness() method on the thread can be used to know the state of the thread.
        Parameters:
        refresh - force to ignore data previously present in cache
        Returns:
        WorkspaceFileSizeResult instance associated with this workspace or null if an analyze is in progress (or if refresh is asked).
      • getCurrentAnalyzerThread

        public FileAnalyzerThread getCurrentAnalyzerThread()
        Return the current analyzer thread if analyze is in progress
        Returns:
        the FileAnalyzerThread or null if no analyze is running
      • handleFileAnalyzeEnd

        public void handleFileAnalyzeEnd​(WorkspaceFileSizeResult fileAnalyzer)
        This method is called when global file analyzer has end
        Parameters:
        fileAnalyzer - the file analyzer
      • getWfByInstanceMap

        public java.util.HashMap<java.lang.Class<?>,​java.lang.Boolean> getWfByInstanceMap()
      • setWfByInstanceMap

        public void setWfByInstanceMap​(java.util.HashMap<java.lang.Class<?>,​java.lang.Boolean> wfByInstanceMap)
      • getInstanceWorkflowIdMap

        public java.util.HashMap<java.lang.Class<?>,​java.util.Set<java.lang.String>> getInstanceWorkflowIdMap()
      • setInstanceWorkflowIdMap

        public void setInstanceWorkflowIdMap​(java.util.HashMap<java.lang.Class<?>,​java.util.Set<java.lang.String>> instanceWorkflowIdMap)
      • getInstanceWorkflowGroupMap

        public java.util.HashMap<java.lang.Class<?>,​java.util.Set<java.lang.String>> getInstanceWorkflowGroupMap()
      • setInstanceWorkflowGroupMap

        public void setInstanceWorkflowGroupMap​(java.util.HashMap<java.lang.Class<?>,​java.util.Set<java.lang.String>> instanceWorkflowGroupMap)
      • getAlertThreshold

        public int getAlertThreshold()
      • setAlertThreshold

        public void setAlertThreshold​(int alertThreshold)
      • getQuota

        public long getQuota()
      • setQuota

        public void setQuota​(long quota)
      • getLastQuotaNotificationDate

        public long getLastQuotaNotificationDate()
      • setLastQuotaNotificationDate

        public void setLastQuotaNotificationDate​(long lastQuotaNotificationDate)
      • setQuotaAlert

        public void setQuotaAlert​(QuotaElement quotaAlert)
      • getUseDefaultQuota

        public boolean getUseDefaultQuota()
      • setUseDefaultQuota

        public void setUseDefaultQuota​(boolean useDefaultQuota)
      • setMainPortal

        public void setMainPortal​(PortalInterface mainPortal)
      • canBeReadBy

        public boolean canBeReadBy​(Member member,
                                   boolean searchInGroups,
                                   RightInfo rightInfo)
        Description copied from class: Data
        Checks if the specified member is authorized to read this Data.
        Overrides:
        canBeReadBy in class Data
        Parameters:
        member - the member to check (may be null for anonymous user)
        searchInGroups - set to true to check for read right authorization using Member's group(s).
        rightInfo - a RightInfo instance in which explanation of read right authorization acceptance or refusal will be indicated. Value is required and cannot be null.
        Returns:
        true if the member can read this Data, false otherwise
      • internalCanBeReadBy

        protected boolean internalCanBeReadBy​(Member member,
                                              boolean searchInGroups,
                                              RightInfo rightInfo)
      • getOtherWorkspaceContentList

        public java.util.List<Content> getOtherWorkspaceContentList​(Member mbr,
                                                                    int firstResult,
                                                                    int maxResults)
        Returns the list of contents of other workspaces shared in this workspace.
        Parameters:
        mbr - the member (to filter according the read rights)
        firstResult - the first result
        maxResults - the max results
        Returns:
        the list of contents of other workspaces shared in this workspace.
        Since:
        jcms-10.0.2
      • getSharedContentList

        public java.util.List<Content> getSharedContentList​(Member mbr,
                                                            int firstResult,
                                                            int maxResults)
        Returns the list of content of this workspace shared with other workspaces.
        Parameters:
        mbr - the member (to filter according the read rights)
        firstResult - the first result
        maxResults - the max results
        Returns:
        the list of content of this workspace shared with other workspaces.
        Since:
        jcms-10.0.2