Class WKRole

    • Field Detail

      • groupList

        protected java.util.ArrayList<Group> groupList
      • memberList

        protected java.util.ArrayList<Member> memberList
      • roleWeight

        protected int[] roleWeight
      • roleWeightType

        protected boolean[] roleWeightType
      • isInvolvedAuthor

        protected boolean isInvolvedAuthor
      • isInvolvedManager

        protected boolean isInvolvedManager
      • openMode

        protected java.lang.String openMode
      • groupMode

        protected int groupMode
      • memberMode

        protected int memberMode
      • workspace

        protected transient Workspace workspace
      • memberSet

        protected transient java.util.Set<Member> memberSet
      • OPEN_MODE_ENABLED

        public static java.lang.String OPEN_MODE_ENABLED
      • OPEN_MODE_REQUIRED

        public static java.lang.String OPEN_MODE_REQUIRED
      • OPEN_MODE_DISABLED

        public static java.lang.String OPEN_MODE_DISABLED
    • Constructor Detail

      • WKRole

        public WKRole()
      • WKRole

        public WKRole​(WKRole other)
    • Method Detail

      • toFullString

        public java.lang.String toFullString()
        Overrides:
        toFullString in class Data
        Returns:
        a debug string
      • addMember

        public void addMember​(Member member)
        Convenient method to add a Member
        Parameters:
        member - the Member to add
        Since:
        jcms-4.1
      • addGroup

        public void addGroup​(Group grp,
                             int weight,
                             boolean type)
        Parameters:
        grp - the Group to add
        weight - the weight of the group
        type - the weight type of the group % or quantity
        Since:
        jcms-4.1
      • getWeightForGroup

        public int getWeightForGroup​(Group group)
        Return the value of the weight for a Group
        Parameters:
        group - A group
        Returns:
        the value of weight for this group
        Since:
        jcms-4.1
      • getWeightForGroup

        public int getWeightForGroup​(int pos)
        Return the value of the weight for a Group
        Parameters:
        pos - index of the group in the list
        Returns:
        the value of weight for this group
        Since:
        jcms-6.1
      • isPercentageForGroup

        public boolean isPercentageForGroup​(Group group)
        Parameters:
        group - the group
        Returns:
        true if the weight is a percentage, false instead
        Since:
        jcms-4.1
      • isPercentageForGroup

        public boolean isPercentageForGroup​(int pos)
        Parameters:
        pos - index of the group in the list
        Returns:
        true if the weight is a percentage, false instead
        Since:
        jcms-6.1
      • getExpectedWeight

        public int getExpectedWeight​(Group group,
                                     Publication pub)
        Gives the minimum of expected member for this group.
        Parameters:
        group - the group
        pub - the publication
        Returns:
        the minimum of member to set for this group in this role
        Since:
        JCMS-6.1
      • getExpectedWeight

        public int getExpectedWeight​(int groupIndex,
                                     Publication pub)
        Gives the minimum of expected member of the group corresponding to this index in the groupList of the given publication.
        Parameters:
        groupIndex - the index of the group in the groupList of the publication
        pub - the publication
        Returns:
        the minimum of member to set for this group in this role
        Since:
        JCMS-6.1
      • isInvolved

        public boolean isInvolved​(Member member,
                                  boolean searchInGroups)
        Check if the member is involved in the role or belongs to a groups involved in this Role
        Parameters:
        member - the member to check
        searchInGroups - if we should look in member groups
        Returns:
        true if member is involved to the role
        Since:
        jcms-4.1
      • isExplicitInvolved

        public boolean isExplicitInvolved​(Publication pub,
                                          Member member,
                                          boolean searchInGroups)
        Check if the member is explicitely involved in the role or belongs to a groups involved in this Role. Non explicit role involvement is when member is author of publication
        Parameters:
        pub - the publication to workOn or null if it is a global test
        member - the member to check
        searchInGroups - if we should look in member groups
        Returns:
        true if member is involved to the role
        Since:
        jcms-7.0.3
      • isInvolved

        public boolean isInvolved​(Publication pub,
                                  Member member,
                                  boolean searchInGroups)
        Check if the member is involved in the role or belongs to a groups involved in this Role
        Parameters:
        pub - the publication to workOn or null if it is a global test
        member - the member to check
        searchInGroups - if we should look in member groups
        Returns:
        true if member is involved to the role
        Since:
        jcms-4.1
      • isInvolved

        public boolean isInvolved​(Publication pub,
                                  Member member,
                                  boolean searchInGroups,
                                  boolean ignoreAuthorInvolvementAtCreation)
        Check if the member is involved in the role or belongs to a groups involved in this Role
        Parameters:
        pub - the publication to workOn or null if it is a global test
        member - the member to check
        searchInGroups - if we should look in member groups
        ignoreAuthorInvolvementAtCreation - true if the method should ignore unexplicit role due to author rights at creation (when pub is null)
        Returns:
        true if member is involved to the role
        Since:
        jcms-7.0.3
      • isInvolved

        public boolean isInvolved​(Group group)
        Check if the group is involved to this Role
        Parameters:
        group - the group
        Returns:
        true if group is involved to the role
        Since:
        jcms-4.1
      • getWorkerSet

        public java.util.Set<Member> getWorkerSet​(Publication pub,
                                                  boolean searchInGroups)
        Deprecated.
        Use new signature with publication class as third parameter to manage correctly creation process (pub == null)
        Returns a Set of Member that can work on the role.
        Parameters:
        pub - the publication (since the author must be added if he is involved in this role and the selected workers must have rights to read the publication)
        searchInGroups - if true add members from groups
        Returns:
        a Set of Member
        Since:
        jcms-4.1
      • getWorkerSet

        public java.util.Set<Member> getWorkerSet​(Publication pub,
                                                  boolean searchInGroups,
                                                  java.lang.Class<?> pubClass)
        Returns a Set of Member that can work on the role.
        Parameters:
        pub - the publication (since the author must be added if he is involved in this role and the selected workers must have rights to read the publication)
        searchInGroups - if true add members from groups
        pubClass - Class of the publication if pub is null (creation process)
        Returns:
        a Set of Member
        Since:
        jcms-7.0.3
      • getWFRole

        public WFRole getWFRole()
        Returns the WFRole bound to this WKRole.
        Returns:
        the WFRole bound to this WKRole.
        Since:
        jcms-5.0.5
      • getName

        public java.lang.String getName​(java.lang.String lang)
        Returns the localized name of the WFRole bound to this WKRole.
        Parameters:
        lang - the language.
        Returns:
        the localized name of the WFRole bound to this WKRole.
        Since:
        jcms-5.7.0
      • getWorkflow

        public Workflow getWorkflow()
        Returns the Workflow bound to this WKRole.
        Returns:
        the Workflow bound to this WKRole.
        Since:
        jcms-5.0.5
      • getWorkflowLabel

        public java.lang.String getWorkflowLabel​(java.lang.String lang)
        Returns the localized label of the workflow this WFRole is bound to.
        Parameters:
        lang - the language.
        Returns:
        the label of the workflow this WFRole is bound to.
        Since:
        jcms-5.7.0
      • getGroupList

        public java.util.ArrayList<Group> getGroupList()
        Returns:
        Returns the groupList.
      • setGroupList

        public void setGroupList​(java.util.ArrayList<Group> groupList)
        Parameters:
        groupList - The groupList to set.
      • getMemberList

        public java.util.ArrayList<Member> getMemberList()
        Returns:
        Returns the memberList.
      • setMemberList

        public void setMemberList​(java.util.ArrayList<Member> memberList)
        Parameters:
        memberList - The memberList to set.
      • getWorkspace

        public Workspace getWorkspace()
        Returns:
        Returns the workgroup.
      • setWorkspace

        public void setWorkspace​(Workspace workspace)
        Parameters:
        workspace - The workgroup to set.
      • getRoleWeight

        public int[] getRoleWeight()
        Returns:
        Returns the roleWeight.
      • setRoleWeight

        public void setRoleWeight​(int[] roleWeight)
        Parameters:
        roleWeight - The roleWeight to set.
      • getRoleWeightType

        public boolean[] getRoleWeightType()
        Returns:
        Returns the roleWeightType.
      • setRoleWeightType

        public void setRoleWeightType​(boolean[] roleWeightType)
        Parameters:
        roleWeightType - The roleWeightType to set.
      • isInvolvedAuthor

        public boolean isInvolvedAuthor()
        Returns:
        Returns the involveAuthor.
      • setInvolvedAuthor

        public void setInvolvedAuthor​(boolean involvedAuthor)
        Parameters:
        involvedAuthor - The involveAuthor to set.
      • isInvolvedManager

        public boolean isInvolvedManager()
        Returns:
        Returns the involvedManager.
      • setInvolvedManager

        public void setInvolvedManager​(boolean involvedManager)
        Parameters:
        involvedManager - The involvedManager to set.
      • getOpenMode

        public java.lang.String getOpenMode()
        Returns the openMode if this role is open (i.e. a writer can choose the validators).
        Returns:
        true if this role is open (i.e. a writer can choose the validators).
        Since:
        jcms-5.5.0
      • setOpenMode

        public void setOpenMode​(java.lang.String openMode)
        Set the value of open ("enabled", "disabled", "required").
        Parameters:
        openMode - the value to set
        Since:
        jcms-6.1
      • isOpen

        public static boolean isOpen​(WKRole role)
      • isOpenAndRequired

        public static boolean isOpenAndRequired​(WKRole role)
      • getGroupMode

        public int getGroupMode()
      • setGroupMode

        public void setGroupMode​(int groupMode)
      • getMemberMode

        public int getMemberMode()
      • setMemberMode

        public void setMemberMode​(int memberMode)
      • isMemberModeOR

        public boolean isMemberModeOR()
      • isMemberModeAND

        public boolean isMemberModeAND()
      • isGroupModeOR

        public boolean isGroupModeOR()
      • isGroupModeAND

        public boolean isGroupModeAND()
      • checkIntegrity

        public ControllerStatus checkIntegrity​(java.util.Map context)
        Description copied from class: Data
        Checks whether or not data integrity constraints are respected.
        Overrides:
        checkIntegrity in class Data
        Parameters:
        context - a map which contains context parameters (may be null)
        Returns:
        a ControllerStatus