Class QueryRendererUtils
- java.lang.Object
-
- de.hybris.platform.cockpit.components.navigationarea.renderer.QueryRendererUtils
-
public class QueryRendererUtils extends java.lang.ObjectAuxiliary functionalities for
QueryRendererclass.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQueryRendererUtils.SavedQuerySharingModeDefinitions 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.StringbuildGroupMenuLabel(java.lang.String prefix, int totalUserCount)Build label for a group menu.java.lang.StringbuildGroupMenuLabel(java.lang.String prefix, int checkedUserCount, int totalUserCount)Build label for a group menu.intgetCheckedUserCount(UserGroupModel model, java.util.List<PrincipalModel> readUsers)Get total number of users directly assigned to a group defined throughmodeland (users) participating inreadUsersat the same time.java.lang.StringgetGroupMenuItemTooltip(java.lang.String groupName, int checkedUserCount, int totalUserCount, boolean allgroupMembersChecked)Create tooltip text for a group menu item.java.lang.StringgetSavedQueryDeleteLabel(QueryRendererUtils.SavedQuerySharingMode mode)Get a label for delete operation based on sharing mode.java.lang.StringgetSavedQueryRenameLabel(QueryRendererUtils.SavedQuerySharingMode mode)Get a label for rename operation based on sharing mode.QueryRendererUtils.SavedQuerySharingModegetSavedQuerySharingMode(UserModel user, CockpitSavedQueryModel query)Get saved query -querysharing mode foruser.intgetTotalUserCount(UserGroupModel model)Get total number of users directly assigned to a group defined throughmodel.booleanisUserExclusiveQuery(UserModel user, CockpitSavedQueryModel query)Verify whetheruserhas not shared thequery.booleanisUserReceivedSavedQuery(UserModel user, CockpitSavedQueryModel query)Verify whetheruserhas 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
modeland (users) participating inreadUsersat the same time.- Parameters:
model- - group modelreadUsers- - users with read access- Returns:
- total number of users directly assigned to a group defined through
modeland (users) participating inreadUsersat 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
userhas not shared thequery. Ifuseris the creator and has not shared thequerythentrueis returned,falseotherwise.- Parameters:
user- - a userquery- - a query to verify- Returns:
- information whether
userhas not shared thequery
-
isUserReceivedSavedQuery
public boolean isUserReceivedSavedQuery(UserModel user, CockpitSavedQueryModel query)
Verify whether
userhas received thequery. Ifuseris not the creator and has received thequerythentrueis returned,falseotherwise.- Parameters:
user- - a userquery- - a query to verify- Returns:
- information whether
userhas received thequery
-
getSavedQuerySharingMode
public QueryRendererUtils.SavedQuerySharingMode getSavedQuerySharingMode(UserModel user, CockpitSavedQueryModel query)
Get saved query -
querysharing 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
-
-