Class QueryRendererUtils
- java.lang.Object
-
- de.hybris.platform.cockpit.components.navigationarea.renderer.QueryRendererUtils
-
public class QueryRendererUtils extends java.lang.Object
Auxiliary functionalities for
QueryRenderer
class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QueryRendererUtils.SavedQuerySharingMode
Definitions of Saved Query sharing modes
-
Constructor Summary
Constructors Constructor Description QueryRendererUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
buildGroupMenuLabel(java.lang.String prefix, int totalUserCount)
Build label for a group menu.java.lang.String
buildGroupMenuLabel(java.lang.String prefix, int checkedUserCount, int totalUserCount)
Build label for a group menu.int
getCheckedUserCount(UserGroupModel model, java.util.List<PrincipalModel> readUsers)
Get total number of users directly assigned to a group defined throughmodel
and (users) participating inreadUsers
at the same time.java.lang.String
getGroupMenuItemTooltip(java.lang.String groupName, int checkedUserCount, int totalUserCount, boolean allgroupMembersChecked)
Create tooltip text for a group menu item.java.lang.String
getSavedQueryDeleteLabel(QueryRendererUtils.SavedQuerySharingMode mode)
Get a label for delete operation based on sharing mode.java.lang.String
getSavedQueryRenameLabel(QueryRendererUtils.SavedQuerySharingMode mode)
Get a label for rename operation based on sharing mode.QueryRendererUtils.SavedQuerySharingMode
getSavedQuerySharingMode(UserModel user, CockpitSavedQueryModel query)
Get saved query -query
sharing mode foruser
.int
getTotalUserCount(UserGroupModel model)
Get total number of users directly assigned to a group defined throughmodel
.boolean
isUserExclusiveQuery(UserModel user, CockpitSavedQueryModel query)
Verify whetheruser
has not shared thequery
.boolean
isUserReceivedSavedQuery(UserModel user, CockpitSavedQueryModel query)
Verify whetheruser
has received thequery
.
-
-
-
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 inreadUsers
at the same time.- Parameters:
model
- - group modelreadUsers
- - users with read access- Returns:
- total number of users directly assigned to a group defined through
model
and (users) participating inreadUsers
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 labelcheckedUserCount
- - number of checked users in menu (having read access) within current grouptotalUserCount
- - 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 labeltotalUserCount
- - 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 namecheckedUserCount
- - number of checked users in menu (having read access) within current grouptotalUserCount
- - total number of users directly assigned to a current groupallgroupMembersChecked
- - allgroupMembers is checked
-
isUserExclusiveQuery
public boolean isUserExclusiveQuery(UserModel user, CockpitSavedQueryModel query)
Verify whether
user
has not shared thequery
. Ifuser
is the creator and has not shared thequery
thentrue
is returned,false
otherwise.- Parameters:
user
- - a userquery
- - a query to verify- Returns:
- information whether
user
has not shared thequery
-
isUserReceivedSavedQuery
public boolean isUserReceivedSavedQuery(UserModel user, CockpitSavedQueryModel query)
Verify whether
user
has received thequery
. Ifuser
is not the creator and has received thequery
thentrue
is returned,false
otherwise.- Parameters:
user
- - a userquery
- - a query to verify- Returns:
- information whether
user
has received thequery
-
getSavedQuerySharingMode
public QueryRendererUtils.SavedQuerySharingMode getSavedQuerySharingMode(UserModel user, CockpitSavedQueryModel query)
Get saved query -
query
sharing mode foruser
.- Parameters:
user
- - a userquery
- - a query- Returns:
- saved query sharing mode
-
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
-
-