public class CmsAccountsApp extends A_CmsWorkplaceApp implements I_CmsPrincipalSelect
A_CmsWorkplaceApp.NavEntry| Modifier and Type | Field and Description |
|---|---|
protected com.vaadin.ui.Button |
m_addElementButton
Button to add an element.
|
protected CmsObject |
m_cms
CmsObject.
|
protected CmsInfoButton |
m_infoButton
vaadin component.
|
protected com.vaadin.ui.Button |
m_newButton
vaadin component.
|
protected com.vaadin.ui.Button |
m_toggleButtonGroups
vaadin component.
|
protected com.vaadin.ui.Button |
m_toggleButtonRole
vaadin component.
|
protected com.vaadin.ui.Button |
m_toggleButtonUser
vaadin component.
|
static java.lang.String |
STATE_SEPERATOR
State seperator.
|
m_infoLayout, m_rootLayout, m_uiContext, PARAM_ASSIGN, PARAM_SEPARATOR| Constructor and Description |
|---|
CmsAccountsApp()
constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
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(java.lang.String group)
Checks if group members can be removed from the given OU.
|
boolean |
checkAddGroup(CmsUser principal,
java.util.Set<java.lang.String> data)
Checks if a set of groups can be added to a user.
|
boolean |
checkRemoveGroups(CmsUser principal,
java.util.Set<java.lang.String> items)
Checks if a user can be removed from a set of groups.
|
protected I_CmsFilterableTable |
createGroupTable(java.lang.String path,
CmsAccountsApp cmsAccountsApp,
I_CmsOuTreeType type,
boolean toggle)
Creates a table for displaying groups.
|
protected I_CmsFilterableTable |
createOUTable(java.lang.String ou)
Creates the overview table for the given OU.
|
protected I_CmsFilterableTable |
createRoleTable(java.lang.String ou)
Creates the role table for the given OU.
|
protected I_CmsFilterableTable |
createUserTable(java.lang.String ou,
CmsUUID groupID,
I_CmsOuTreeType type,
boolean showAll,
CmsAccountsApp cmsAccountsApp)
Creates user table for a specific group or role.
|
protected I_CmsFilterableTable |
createUserTable(java.lang.String ou,
I_CmsOuTreeType type,
CmsAccountsApp cmsAccountsApp,
boolean buttonPressed)
Creates the user table for an OU.
|
void |
fillGroupItem(com.vaadin.v7.data.Item item,
CmsGroup group,
java.util.List<CmsGroup> indirects)
Fills the container item representing a group.
|
protected void |
filterTable(java.lang.String text)
Filters table.
|
protected java.util.List<com.vaadin.ui.Button> |
getAdditionalButtons()
Gets the additional buttons to display.
|
java.lang.String |
getAppId()
Gets the app id.
|
com.vaadin.v7.data.util.IndexedContainer |
getAvailableGroupsContainerWithout(CmsObject cms,
java.lang.String ouFqn,
java.lang.String propCaption,
java.lang.String propIcon,
java.lang.String propOu,
java.util.List<CmsGroup> groupsOfUser,
java.util.function.Function<CmsGroup,CmsCssIcon> iconProvider)
Gets a data container for the groups available to be added to a user, excluding some groups.
|
protected java.util.LinkedHashMap<java.lang.String,java.lang.String> |
getBreadCrumbForState(java.lang.String state)
Returns the current bread crumb entries in an ordered map.
|
protected com.vaadin.ui.Component |
getComponentForState(java.lang.String state)
Returns the app component for the given state.
|
protected java.lang.String |
getElementName(org.opencms.ui.apps.user.CmsAccountsApp.CmsStateBean stateBean)
Gets the group-, role-, or ou name.
|
protected java.util.List<CmsUser> |
getFullUser(java.util.List<CmsUser> users)
Gets the full user List including additionInfos.
|
CmsGroupEditParameters |
getGroupEditParameters(CmsGroup group)
Gets the group edit parameters for a given group.
|
CmsCssIcon |
getGroupIcon(CmsGroup group)
Gets the icon for a group.
|
static CmsResourceInfo |
getOUInfo(CmsOrganizationalUnit ou)
Creates info panel for OUs.
|
static CmsResourceInfo |
getPrincipalInfo(I_CmsPrincipal principal)
Creates info panel for principals.
|
protected java.util.List<A_CmsWorkplaceApp.NavEntry> |
getSubNavEntries(java.lang.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 |
getTreeTypeProvider()
Gets the tree type provider.
|
CmsUserEditParameters |
getUserEditParameters(CmsUser user)
Gets the user edit parameters.
|
com.vaadin.v7.data.util.IndexedContainer |
getUserGroupsEditorContainer(CmsUser user,
java.lang.String propName,
java.lang.String propIcon,
java.lang.String propStatus)
Gets the container for the groups of an user for the purpose of editing them.
|
java.util.List<CmsUser> |
getUsersWithoutAdditionalInfo(CmsObject cms,
I_CmsOuTreeType type,
java.lang.String ou,
boolean recursive)
Gets list of users for organizational unit.
|
protected java.util.List<CmsUser> |
getVisibleUser()
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(java.lang.String ou)
Checks if the given OU is manageable.
|
boolean |
isParentOfManagableOU(java.lang.String name)
Checks if given ou is parent of a managable ou.
|
protected void |
openNewDialog()
Opens a dialog for a new item (ou, group or user).
|
void |
openSubView(java.lang.String state,
boolean updateState)
Opens the requested sub view.
|
org.opencms.ui.apps.user.CmsAccountsApp.CmsStateBean |
parseState(java.lang.String state,
java.lang.String baseOU)
Parses a given state string to state bean.
|
java.util.List<CmsGroup> |
readGroupsForOu(CmsObject cms,
java.lang.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 |
setType(java.lang.String type)
Sets the type of principal.
|
void |
update(java.lang.String ou,
I_CmsOuTreeType type,
CmsUUID groupID)
Updates the app state.
|
void |
update(java.lang.String ou,
I_CmsOuTreeType type,
CmsUUID roleOrGroupID,
java.lang.String filter)
Updates the app state.
|
addParamToState, addSubNavEntry, getLastPathLevel, getOfflineCmsObject, getParamFromState, getParamsFromState, onStateChange, setBreadCrumbEntries, updateBreadCrumb, updateSubNavpublic static java.lang.String STATE_SEPERATOR
protected com.vaadin.ui.Button m_addElementButton
protected CmsInfoButton m_infoButton
protected com.vaadin.ui.Button m_newButton
protected com.vaadin.ui.Button m_toggleButtonGroups
protected com.vaadin.ui.Button m_toggleButtonRole
protected com.vaadin.ui.Button m_toggleButtonUser
public CmsAccountsApp()
public static CmsResourceInfo getOUInfo(CmsOrganizationalUnit ou)
ou - to get panel forpublic static CmsResourceInfo getPrincipalInfo(I_CmsPrincipal principal)
principal - to get info panel forpublic void addGroupContainerProperties(com.vaadin.v7.data.util.IndexedContainer container)
container - the container to updatepublic void addUserContainerProperties(com.vaadin.v7.data.util.IndexedContainer container)
container - the container to updatepublic boolean canEditUser(CmsUUID id)
id - the id of the userpublic boolean canRemoveGroupMemebers(java.lang.String group)
group - the group namepublic boolean checkAddGroup(CmsUser principal, java.util.Set<java.lang.String> data)
principal - the userdata - the set of names of groups to checkpublic boolean checkRemoveGroups(CmsUser principal, java.util.Set<java.lang.String> items)
principal - the useritems - the names of groups to checkpublic void fillGroupItem(com.vaadin.v7.data.Item item, CmsGroup group, java.util.List<CmsGroup> indirects)
item - the itemgroup - the groupindirects - the indirect groupspublic java.lang.String getAppId()
public com.vaadin.v7.data.util.IndexedContainer getAvailableGroupsContainerWithout(CmsObject cms, java.lang.String ouFqn, java.lang.String propCaption, java.lang.String propIcon, java.lang.String propOu, java.util.List<CmsGroup> groupsOfUser, java.util.function.Function<CmsGroup,CmsCssIcon> iconProvider)
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 providerpublic CmsGroupEditParameters getGroupEditParameters(CmsGroup group)
group - a grouppublic CmsCssIcon getGroupIcon(CmsGroup group)
group - the grouppublic CmsUserEditParameters getUserEditParameters(CmsUser user)
user - the userpublic com.vaadin.v7.data.util.IndexedContainer getUserGroupsEditorContainer(CmsUser user, java.lang.String propName, java.lang.String propIcon, java.lang.String propStatus)
user - the userpropName - the property for the namepropIcon - the property for the iconpropStatus - the property for the statuspublic java.util.List<CmsUser> getUsersWithoutAdditionalInfo(CmsObject cms, I_CmsOuTreeType type, java.lang.String ou, boolean recursive) throws CmsException
cms - the CMS contextou - the OU pathrecursive - true if users from other OUs should be retrievedCmsException - if something goes wrongpublic void handlePrincipal(I_CmsPrincipal principal)
I_CmsPrincipalSelecthandlePrincipal in interface I_CmsPrincipalSelectprincipal - which were selectedI_CmsPrincipalSelect.handlePrincipal(org.opencms.security.I_CmsPrincipal)public void initUI(I_CmsAppUIContext context)
I_CmsWorkplaceAppUse the context to add the app's components to the UI.
initUI in interface I_CmsWorkplaceAppinitUI in class A_CmsWorkplaceAppcontext - the UI contextA_CmsWorkplaceApp.initUI(org.opencms.ui.apps.I_CmsAppUIContext)public boolean isOUManagable(java.lang.String ou)
ou - to checkpublic boolean isParentOfManagableOU(java.lang.String name)
name - to checkpublic void openSubView(java.lang.String state, boolean updateState)
A_CmsWorkplaceAppopenSubView in class A_CmsWorkplaceAppstate - the stateupdateState - true to update the state URL tokenA_CmsWorkplaceApp.openSubView(java.lang.String, boolean)public org.opencms.ui.apps.user.CmsAccountsApp.CmsStateBean parseState(java.lang.String state, java.lang.String baseOU)
state - to be readbaseOU - baseOupublic java.util.List<CmsGroup> readGroupsForOu(CmsObject cms, java.lang.String ou, I_CmsOuTreeType type, boolean subOus) throws CmsException
cms - the CMS contextou - the OU pathtype - the tree typesubOus - true if groups for sub-OUs should be readCmsException - if something goes wrongpublic void reload()
public void setType(java.lang.String type)
I_CmsPrincipalSelectsetType in interface I_CmsPrincipalSelecttype - of principalI_CmsPrincipalSelect.setType(java.lang.String)public void update(java.lang.String ou, I_CmsOuTreeType type, CmsUUID groupID)
ou - to be openedtype - to be openedgroupID - to be openend(may be null)public void update(java.lang.String ou, I_CmsOuTreeType type, CmsUUID roleOrGroupID, java.lang.String filter)
ou - to be openedtype - to be openedroleOrGroupID - to be openend(may be null)filter - filter stringprotected I_CmsFilterableTable createGroupTable(java.lang.String path, CmsAccountsApp cmsAccountsApp, I_CmsOuTreeType type, boolean toggle)
path - the pathcmsAccountsApp - the app instancetype - the tree typetoggle - the value of the 'sub-OU' toggleprotected I_CmsFilterableTable createOUTable(java.lang.String ou)
ou - the OU pathprotected I_CmsFilterableTable createRoleTable(java.lang.String ou)
ou - the OU pathprotected I_CmsFilterableTable createUserTable(java.lang.String ou, CmsUUID groupID, I_CmsOuTreeType type, boolean showAll, CmsAccountsApp cmsAccountsApp)
ou - the OU pathgroupID - the group idtype - the tree typeshowAll - true if all users should be showncmsAccountsApp - the app instanceprotected I_CmsFilterableTable createUserTable(java.lang.String ou, I_CmsOuTreeType type, CmsAccountsApp cmsAccountsApp, boolean buttonPressed)
ou - the OU pathtype - the tree typecmsAccountsApp - the app instancebuttonPressed - true if toggle button for users is activeprotected void filterTable(java.lang.String text)
"
text - for filterprotected java.util.List<com.vaadin.ui.Button> getAdditionalButtons()
protected java.util.LinkedHashMap<java.lang.String,java.lang.String> getBreadCrumbForState(java.lang.String state)
A_CmsWorkplaceAppgetBreadCrumbForState in class A_CmsWorkplaceAppstate - the current stateA_CmsWorkplaceApp.getBreadCrumbForState(java.lang.String)protected com.vaadin.ui.Component getComponentForState(java.lang.String state)
A_CmsWorkplaceAppgetComponentForState in class A_CmsWorkplaceAppstate - the state to renderA_CmsWorkplaceApp.getComponentForState(java.lang.String)protected java.lang.String getElementName(org.opencms.ui.apps.user.CmsAccountsApp.CmsStateBean stateBean)
stateBean - to be read outprotected java.util.List<CmsUser> getFullUser(java.util.List<CmsUser> users)
users - user listprotected java.util.List<A_CmsWorkplaceApp.NavEntry> getSubNavEntries(java.lang.String state)
A_CmsWorkplaceAppgetSubNavEntries in class A_CmsWorkplaceAppstate - the stateA_CmsWorkplaceApp.getSubNavEntries(java.lang.String)protected com.vaadin.ui.Button getToggleButton(org.opencms.ui.apps.user.CmsAccountsApp.CmsStateBean stateBean)
stateBean - to be read outprotected I_CmsTreeTypeProvider getTreeTypeProvider()
protected java.util.List<CmsUser> getVisibleUser()
protected void handleSetTable(com.vaadin.ui.Component component)
component - the table that is displayedprotected void openNewDialog()