Class GroupDao


  • public class GroupDao
    extends AbstractDao
    Provides a DAO for the Group entity.
    See Also:
    Group
    • Constructor Detail

      • GroupDao

        public GroupDao()
    • Method Detail

      • getGroupForPK

        public Group getGroupForPK​(Object id)
        Return the group with the specified OID
        Parameters:
        id - the OID
        Returns:
        the matching group, or null if not found
      • loadDefaultGroups

        public void loadDefaultGroups()
        Load the list of pre-defined groups, unless they already exist.
      • getGroupForName

        public Group getGroupForName​(String name)
        Return the group with the specified name
        Parameters:
        name - the group name
        Returns:
        the matching group
      • getGroupList

        public List<Group> getGroupList​(String keyword)
        Return the list of groups matching the specified search criteria, ordered by group name.
        Parameters:
        keyword - the search keyword
        Returns:
        the list of matching groups
      • getGroupList

        public List<Group> getGroupList​(String keyword,
                                        String type)
        Return the list of groups matching the specified search criteria, ordered by group name
        Parameters:
        keyword - the search keyword
        type - the group type filter
        Returns:
        the list of matching groups
        Since:
        4.1.0
      • getGroupList

        public List<Group> getGroupList()
        The list of all groups ordered by group name
        Returns:
        the list of groups
      • getFormGroupList

        public List<Group> getFormGroupList()
        The list of all groups ordered by group name
        Returns:
        the list of groups
      • getJobGroupList

        public List<Group> getJobGroupList()
        The list of all job groups ordered by group name
        Returns:
        the list of groups
        Since:
        17.10.0
      • getGroupsForUser

        public List<Group> getGroupsForUser​(UserAccount userAccount,
                                            String groupType)
        Return the list of form groups that a user is a member of.
        Parameters:
        userAccount - the non-null user account
        groupType - type of group, i.e. Form, Job, etc
        Returns:
        the list of groups for the user
        Since:
        19.05.0
      • getNewFormGroupsForUser

        public List<Group> getNewFormGroupsForUser​(UserAccount userAccount)
        Return the list of new form groups that a user is a member of.
        Parameters:
        userAccount - the non-null user account
        Returns:
        the list of groups for the user
        Since:
        3.6.0
      • getSavedFormGroupsForUser

        public List<Group> getSavedFormGroupsForUser​(UserAccount userAccount)
        Return the list of saved form groups that a user is a member of.
        Parameters:
        userAccount - the non-null user account
        Returns:
        the list of groups for the user
        Since:
        3.6.0
      • getCompletedFormGroupsForUser

        public List<Group> getCompletedFormGroupsForUser​(UserAccount userAccount)
        Return the list of completed form groups that a user is a member of.
        Parameters:
        userAccount - the non-null user account
        Returns:
        the list of groups for the user
        Since:
        3.6.0
      • addGroupsToSubmission

        public boolean addGroupsToSubmission​(Collection<String> groupNames,
                                             Submission submission)
        Add the specified groups to the submission. If any of the specified groups are not configured to 'Form Share With Group' then it will not be added to the submission group.

        Please note this method will note commit database changes.

        Parameters:
        groupNames - the names of the groups to add to the submission (required)
        submission - the submission object to add the groups to (required)
        Returns:
        true if one or more submission groups was added to the submission, or false otherwise
        Since:
        3.6.5
      • addGroupToSubmission

        public void addGroupToSubmission​(Group group,
                                         Submission submission)
        Add the specified group to the submission.

        Please note this method will note commit database changes.

        Parameters:
        group - the form group to add to the submission (required)
        submission - the submission object to add the group to (required)
        Since:
        4.0.0
      • createUpdateFormGroup

        public Group createUpdateFormGroup​(String groupName,
                                           String description,
                                           boolean formWorkGroupFlag,
                                           boolean newFormFlag,
                                           boolean savedFormFlag,
                                           boolean completedFormFlag)
        Create a Form Group for the given name and group attributes.

        Please note this method will note commit database changes.

        Parameters:
        groupName - the name of the group (required)
        description - the group description
        formWorkGroupFlag - the form work group flag
        newFormFlag - the new form access control flag
        savedFormFlag - the saved form/task access control flag
        completedFormFlag - the completed forms access control flag
        Returns:
        the created or updated form group
        Since:
        4.0.0