Package org.opencms.ui.apps.user
Class CmsAccountsApp
java.lang.Object
org.opencms.ui.apps.A_CmsWorkplaceApp
org.opencms.ui.apps.user.CmsAccountsApp
- All Implemented Interfaces:
I_CmsWorkplaceApp
,I_CmsPrincipalSelect
App for the OU Management.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencms.ui.apps.A_CmsWorkplaceApp
A_CmsWorkplaceApp.NavEntry
-
Field Summary
Modifier and TypeFieldDescriptionprotected com.vaadin.ui.Button
Button to add an element.protected CmsObject
CmsObject.protected com.vaadin.ui.Button
Toolbar button for CSV import/export in OUs.protected CmsInfoButton
vaadin component.protected com.vaadin.ui.Button
vaadin component.protected com.vaadin.ui.Button
vaadin component.protected com.vaadin.ui.Button
vaadin component.protected com.vaadin.ui.Button
vaadin component.static String
State seperator.Fields inherited from class org.opencms.ui.apps.A_CmsWorkplaceApp
m_infoLayout, m_rootLayout, m_uiContext, PARAM_ASSIGN, PARAM_SEPARATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addGroupContainerProperties
(com.vaadin.v7.data.util.IndexedContainer container) Adds additional properties for groups to a container.void
addUserContainerProperties
(com.vaadin.v7.data.util.IndexedContainer container) Adds additional properties for users to a container.boolean
canEditUser
(CmsUUID id) Checks if the given user is editable.boolean
canRemoveGroupMemebers
(String group) Checks if group members can be removed from the given OU.boolean
checkAddGroup
(CmsUser principal, Set<String> data) Checks if a set of groups can be added to a user.boolean
checkRemoveGroups
(CmsUser principal, Set<String> items) Checks if a user can be removed from a set of groups.protected I_CmsFilterableTable
createGroupTable
(String path, CmsAccountsApp cmsAccountsApp, I_CmsOuTreeType type, boolean toggle) Creates a table for displaying groups.protected I_CmsFilterableTable
createOUTable
(String ou) Creates the overview table for the given OU.protected I_CmsFilterableTable
Creates the role table for the given OU.protected I_CmsFilterableTable
createUserTable
(String ou, I_CmsOuTreeType type, CmsAccountsApp cmsAccountsApp, boolean buttonPressed) Creates the user table for an OU.protected I_CmsFilterableTable
createUserTable
(String ou, CmsUUID groupID, I_CmsOuTreeType type, boolean showAll, CmsAccountsApp cmsAccountsApp) Creates user table for a specific group or role.void
fillGroupItem
(com.vaadin.v7.data.Item item, CmsGroup group, List<CmsGroup> indirects) Fills the container item representing a group.protected void
filterTable
(String text) Filters table.protected List<com.vaadin.ui.Button>
Gets the additional buttons to display.getAppId()
Gets the app id.com.vaadin.v7.data.util.IndexedContainer
getAvailableGroupsContainerWithout
(CmsObject cms, String ouFqn, String propCaption, String propIcon, String propOu, List<CmsGroup> groupsOfUser, Function<CmsGroup, CmsCssIcon> iconProvider) Gets a data container for the groups available to be added to a user, excluding some groups.protected LinkedHashMap<String,
String> getBreadCrumbForState
(String state) Returns the current bread crumb entries in an ordered map.protected com.vaadin.ui.Component
getComponentForState
(String state) Returns the app component for the given state.protected String
getElementName
(org.opencms.ui.apps.user.CmsAccountsApp.CmsStateBean stateBean) Gets the group-, role-, or ou name.getFullUser
(List<CmsUser> users) Gets the full user List including additionInfos.getGroupEditParameters
(CmsGroup group) Gets the group edit parameters for a given group.getGroupIcon
(CmsGroup group) Gets the icon for a group.static CmsResourceInfo
Creates info panel for OUs.Gets the cache for the password reset states.static CmsResourceInfo
getPrincipalInfo
(I_CmsPrincipal principal) Creates info panel for principals.protected List<A_CmsWorkplaceApp.NavEntry>
getSubNavEntries
(String state) Returns the sub navigation entries.protected com.vaadin.ui.Button
getToggleButton
(org.opencms.ui.apps.user.CmsAccountsApp.CmsStateBean stateBean) Get the current toggle button.protected I_CmsTreeTypeProvider
Gets the tree type provider.getUserEditParameters
(CmsUser user) Gets the user edit parameters.com.vaadin.v7.data.util.IndexedContainer
getUserGroupsEditorContainer
(CmsUser user, String propName, String propIcon, String propStatus) Gets the container for the groups of an user for the purpose of editing them.getUsersWithoutAdditionalInfo
(CmsObject cms, I_CmsOuTreeType type, String ou, boolean recursive) Gets list of users for organizational unit.Gets all currently visible user.void
handlePrincipal
(I_CmsPrincipal principal) Handles a selected principal.protected void
handleSetTable
(com.vaadin.ui.Component component) Called when new table is shown.void
initUI
(I_CmsAppUIContext context) Within this method the app UI should be initialized.boolean
isOUManagable
(String ou) Checks if the given OU is manageable.boolean
isParentOfManagableOU
(String name) Checks if given ou is parent of a managable ou.protected void
Opens a dialog for a new item (ou, group or user).void
openSubView
(String state, boolean updateState) Opens the requested sub view.org.opencms.ui.apps.user.CmsAccountsApp.CmsStateBean
parseState
(String state, String baseOU) Parses a given state string to state bean.readGroupsForOu
(CmsObject cms, String ou, I_CmsOuTreeType type, boolean subOus) Reads the list of groups for an organizational unit.void
reload()
Reloads the app with current state.void
update
(String ou, I_CmsOuTreeType type, CmsUUID groupID) Updates the app state.void
update
(String ou, I_CmsOuTreeType type, CmsUUID roleOrGroupID, String filter) Updates the app state.Methods inherited from class org.opencms.ui.apps.A_CmsWorkplaceApp
addParamToState, addSubNavEntry, getLastPathLevel, getOfflineCmsObject, getParamFromState, getParamsFromState, onStateChange, removeParamsFromState, setBreadCrumbEntries, updateBreadCrumb, updateSubNav
-
Field Details
-
STATE_SEPERATOR
State seperator. -
m_addElementButton
Button to add an element. -
m_cms
CmsObject. -
m_importExport
Toolbar button for CSV import/export in OUs. -
m_infoButton
vaadin component. -
m_newButton
vaadin component. -
m_toggleButtonGroups
vaadin component. -
m_toggleButtonRole
vaadin component. -
m_toggleButtonUser
vaadin component.
-
-
Constructor Details
-
CmsAccountsApp
public CmsAccountsApp()constructor.
-
-
Method Details
-
getOUInfo
Creates info panel for OUs.- Parameters:
ou
- to get panel for- Returns:
- CmsResourceInfo
-
getPrincipalInfo
Creates info panel for principals.- Parameters:
principal
- to get info panel for- Returns:
- CmsResourceInfo
-
addGroupContainerProperties
Adds additional properties for groups to a container.- Parameters:
container
- the container to update
-
addUserContainerProperties
Adds additional properties for users to a container.- Parameters:
container
- the container to update
-
canEditUser
Checks if the given user is editable.- Parameters:
id
- the id of the user- Returns:
- true if the user is editable
-
canRemoveGroupMemebers
Checks if group members can be removed from the given OU.- Parameters:
group
- the group name- Returns:
- true if group members can be removed from the given OU
-
checkAddGroup
Checks if a set of groups can be added to a user.- Parameters:
principal
- the userdata
- the set of names of groups to check- Returns:
- true if the groups can be added to the user
-
checkRemoveGroups
Checks if a user can be removed from a set of groups.- Parameters:
principal
- the useritems
- the names of groups to check- Returns:
- true if the user can be removed from the group
-
fillGroupItem
Fills the container item representing a group.- Parameters:
item
- the itemgroup
- the groupindirects
- the indirect groups
-
getAppId
Gets the app id.- Returns:
- the app id
-
getAvailableGroupsContainerWithout
public com.vaadin.v7.data.util.IndexedContainer getAvailableGroupsContainerWithout(CmsObject cms, String ouFqn, String propCaption, String propIcon, String propOu, List<CmsGroup> groupsOfUser, Function<CmsGroup, CmsCssIcon> iconProvider) Gets a data container for the groups available to be added to a user, excluding some groups.- Parameters:
cms
- the current CMS contextouFqn
- the OU for which to get the groupspropCaption
- the property for the captionpropIcon
- the property for the iconpropOu
- the property for the OUgroupsOfUser
- the groups to excludeiconProvider
- the icon provider- Returns:
- the container with the group data
-
getGroupEditParameters
Gets the group edit parameters for a given group.- Parameters:
group
- a group- Returns:
- the group edit parameters for the group
-
getGroupIcon
Gets the icon for a group.- Parameters:
group
- the group- Returns:
- the icon for the group
-
getPasswordResetStateCache
Gets the cache for the password reset states.The cache keys are user ids.
- Returns:
- the cache for the password reset states
-
getUserEditParameters
Gets the user edit parameters.- Parameters:
user
- the user- Returns:
- the user edit parameters
-
getUserGroupsEditorContainer
public com.vaadin.v7.data.util.IndexedContainer getUserGroupsEditorContainer(CmsUser user, String propName, String propIcon, String propStatus) Gets the container for the groups of an user for the purpose of editing them.- Parameters:
user
- the userpropName
- the property for the namepropIcon
- the property for the iconpropStatus
- the property for the status- Returns:
- the container with the user groups
-
getUsersWithoutAdditionalInfo
public List<CmsUser> getUsersWithoutAdditionalInfo(CmsObject cms, I_CmsOuTreeType type, String ou, boolean recursive) throws CmsException Gets list of users for organizational unit.- Parameters:
cms
- the CMS contextou
- the OU pathrecursive
- true if users from other OUs should be retrieved- Returns:
- the list of users, without their additional info
- Throws:
CmsException
- if something goes wrong
-
handlePrincipal
Description copied from interface:I_CmsPrincipalSelect
Handles a selected principal.- Specified by:
handlePrincipal
in interfaceI_CmsPrincipalSelect
- Parameters:
principal
- which were selected- See Also:
-
initUI
Description copied from interface:I_CmsWorkplaceApp
Within this method the app UI should be initialized.Use the context to add the app's components to the UI.
- Specified by:
initUI
in interfaceI_CmsWorkplaceApp
- Overrides:
initUI
in classA_CmsWorkplaceApp
- Parameters:
context
- the UI context- See Also:
-
isOUManagable
Checks if the given OU is manageable.- Parameters:
ou
- to check- Returns:
- true if user is allowed to manage ou
-
isParentOfManagableOU
Checks if given ou is parent of a managable ou.- Parameters:
name
- to check- Returns:
- boolean
-
openSubView
Description copied from class:A_CmsWorkplaceApp
Opens the requested sub view.- Overrides:
openSubView
in classA_CmsWorkplaceApp
- Parameters:
state
- the stateupdateState
-true
to update the state URL token- See Also:
-
parseState
Parses a given state string to state bean.- Parameters:
state
- to be readbaseOU
- baseOu- Returns:
- CmsStateBean
-
readGroupsForOu
public List<CmsGroup> readGroupsForOu(CmsObject cms, String ou, I_CmsOuTreeType type, boolean subOus) throws CmsException Reads the list of groups for an organizational unit.- Parameters:
cms
- the CMS contextou
- the OU pathtype
- the tree typesubOus
- true if groups for sub-OUs should be read- Returns:
- the list of groups for the OU
- Throws:
CmsException
- if something goes wrong
-
reload
Reloads the app with current state. -
update
Updates the app state.- Parameters:
ou
- to be openedtype
- to be openedgroupID
- to be openend(may be null)
-
update
Updates the app state.- Parameters:
ou
- to be openedtype
- to be openedroleOrGroupID
- to be openend(may be null)filter
- filter string
-
createGroupTable
protected I_CmsFilterableTable createGroupTable(String path, CmsAccountsApp cmsAccountsApp, I_CmsOuTreeType type, boolean toggle) Creates a table for displaying groups.- Parameters:
path
- the pathcmsAccountsApp
- the app instancetype
- the tree typetoggle
- the value of the 'sub-OU' toggle- Returns:
- the table
-
createOUTable
Creates the overview table for the given OU.- Parameters:
ou
- the OU path- Returns:
- the overview table for the given OU
-
createRoleTable
Creates the role table for the given OU.- Parameters:
ou
- the OU path- Returns:
- the role table for the given OU
-
createUserTable
protected I_CmsFilterableTable createUserTable(String ou, CmsUUID groupID, I_CmsOuTreeType type, boolean showAll, CmsAccountsApp cmsAccountsApp) Creates user table for a specific group or role.- Parameters:
ou
- the OU pathgroupID
- the group idtype
- the tree typeshowAll
- true if all users should be showncmsAccountsApp
- the app instance- Returns:
- the user table
-
createUserTable
protected I_CmsFilterableTable createUserTable(String ou, I_CmsOuTreeType type, CmsAccountsApp cmsAccountsApp, boolean buttonPressed) Creates the user table for an OU.- Parameters:
ou
- the OU pathtype
- the tree typecmsAccountsApp
- the app instancebuttonPressed
- true if toggle button for users is active- Returns:
- the user table
-
filterTable
Filters table."
- Parameters:
text
- for filter
-
getAdditionalButtons
Gets the additional buttons to display.- Returns:
- the additional buttons to display
-
getBreadCrumbForState
Description copied from class:A_CmsWorkplaceApp
Returns the current bread crumb entries in an ordered map.- Specified by:
getBreadCrumbForState
in classA_CmsWorkplaceApp
- Parameters:
state
- the current state- Returns:
- bread crumb entry name by state, in case the state is empty, the entry will be disabled
- See Also:
-
getComponentForState
Description copied from class:A_CmsWorkplaceApp
Returns the app component for the given state.- Specified by:
getComponentForState
in classA_CmsWorkplaceApp
- Parameters:
state
- the state to render- Returns:
- the app component
- See Also:
-
getElementName
Gets the group-, role-, or ou name.- Parameters:
stateBean
- to be read out- Returns:
- Name
-
getFullUser
Gets the full user List including additionInfos.- Parameters:
users
- user list- Returns:
- List of user
-
getToggleButton
protected com.vaadin.ui.Button getToggleButton(org.opencms.ui.apps.user.CmsAccountsApp.CmsStateBean stateBean) Get the current toggle button.- Parameters:
stateBean
- to be read out- Returns:
- Button
-
getTreeTypeProvider
Gets the tree type provider.- Returns:
- the tree type provider
-
getVisibleUser
Gets all currently visible user.- Returns:
- List of CmsUser
-
handleSetTable
Called when new table is shown.- Parameters:
component
- the table that is displayed
-
openNewDialog
Opens a dialog for a new item (ou, group or user).
-