java.lang.Object
de.hybris.platform.cockpit.components.navigationarea.renderer.QueryRendererUtils

public class QueryRendererUtils extends Object

Auxiliary functionalities for QueryRenderer class.

  • Constructor Details

    • QueryRendererUtils

      public QueryRendererUtils()
  • Method Details

    • 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, 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 String buildGroupMenuLabel(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 String buildGroupMenuLabel(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 String getGroupMenuItemTooltip(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
    • getSavedQuerySharingMode

      public QueryRendererUtils.SavedQuerySharingMode getSavedQuerySharingMode(UserModel user, CockpitSavedQueryModel query)

      Get saved query - query sharing mode for user.

      Parameters:
      user - - a user
      query - - a query
      Returns:
      saved query sharing mode
    • getSavedQueryDeleteLabel

      public 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 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