Class QueryRendererUtils


  • public class QueryRendererUtils
    extends java.lang.Object

    Auxiliary functionalities for QueryRenderer class.

    • Constructor Detail

      • QueryRendererUtils

        public QueryRendererUtils()
    • Method Detail

      • getTotalUserCount

        public int getTotalUserCount​(UserGroupModel model)

        Get total number of users directly assigned to a group defined through model.

        Parameters:
        model - - group model
        Returns:
        total number of users directly assigned to a group defined through model
      • getCheckedUserCount

        public int getCheckedUserCount​(UserGroupModel model,
                                       java.util.List<PrincipalModel> readUsers)

        Get total number of users directly assigned to a group defined through model and (users) participating in readUsers at the same time.

        Parameters:
        model - - group model
        readUsers - - users with read access
        Returns:
        total number of users directly assigned to a group defined through model and (users) participating in readUsers at the same time
      • buildGroupMenuLabel

        public java.lang.String buildGroupMenuLabel​(java.lang.String prefix,
                                                    int checkedUserCount,
                                                    int totalUserCount)

        Build label for a group menu.

         Menu structure:  (/)
         

        Parameters:
        prefix - - fixed prefix in label
        checkedUserCount - - number of checked users in menu (having read access) within current group
        totalUserCount - - total number of users directly assigned to a current group
      • buildGroupMenuLabel

        public java.lang.String buildGroupMenuLabel​(java.lang.String prefix,
                                                    int totalUserCount)

        Build label for a group menu.

         Menu structure:  ()
         

        Parameters:
        prefix - - fixed prefix in label
        totalUserCount - - total number of users directly assigned to a current group
      • getGroupMenuItemTooltip

        public java.lang.String getGroupMenuItemTooltip​(java.lang.String groupName,
                                                        int checkedUserCount,
                                                        int totalUserCount,
                                                        boolean allgroupMembersChecked)

        Create tooltip text for a group menu item.

        Parameters:
        groupName - - group name
        checkedUserCount - - number of checked users in menu (having read access) within current group
        totalUserCount - - total number of users directly assigned to a current group
        allgroupMembersChecked - - allgroupMembers is checked
      • isUserExclusiveQuery

        public boolean isUserExclusiveQuery​(UserModel user,
                                            CockpitSavedQueryModel query)

        Verify whether user has not shared the query. If user is the creator and has not shared the query then true is returned, false otherwise.

        Parameters:
        user - - a user
        query - - a query to verify
        Returns:
        information whether user has not shared the query
      • isUserReceivedSavedQuery

        public boolean isUserReceivedSavedQuery​(UserModel user,
                                                CockpitSavedQueryModel query)

        Verify whether user has received the query. If user is not the creator and has received the query then true is returned, false otherwise.

        Parameters:
        user - - a user
        query - - a query to verify
        Returns:
        information whether user has received the query
      • getSavedQueryDeleteLabel

        public java.lang.String getSavedQueryDeleteLabel​(QueryRendererUtils.SavedQuerySharingMode mode)

        Get a label for delete operation based on sharing mode.

        Parameters:
        mode - - sharing mode
        Returns:
        a label for delete operation
      • getSavedQueryRenameLabel

        public java.lang.String getSavedQueryRenameLabel​(QueryRendererUtils.SavedQuerySharingMode mode)

        Get a label for rename operation based on sharing mode.

        Parameters:
        mode - - sharing mode
        Returns:
        a label for rename operation