Class CmsUserEditDialog

  • All Implemented Interfaces:
    com.vaadin.event.ContextClickEvent.ContextClickNotifier, com.vaadin.event.LayoutEvents.LayoutClickNotifier, com.vaadin.event.MethodEventSource, com.vaadin.server.ClientConnector, com.vaadin.server.Sizeable, com.vaadin.shared.Connector, com.vaadin.ui.Component, com.vaadin.ui.ComponentContainer, com.vaadin.ui.HasComponents, com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.Layout, com.vaadin.ui.Layout.AlignmentHandler, com.vaadin.ui.Layout.MarginHandler, com.vaadin.ui.Layout.SpacingHandler, java.io.Serializable, java.lang.Iterable<com.vaadin.ui.Component>, I_CmsPasswordFetcher

    public class CmsUserEditDialog
    extends CmsBasicDialog
    implements I_CmsPasswordFetcher
    Class for the dialog to edit user settings.

    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector

        com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
      • Nested classes/interfaces inherited from interface com.vaadin.ui.Component

        com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener
      • Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents

        com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener
      • Nested classes/interfaces inherited from interface com.vaadin.ui.Layout

        com.vaadin.ui.Layout.AlignmentHandler, com.vaadin.ui.Layout.MarginHandler, com.vaadin.ui.Layout.SpacingHandler
      • Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable

        com.vaadin.server.Sizeable.Unit
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean m_visSites
      Visible sites?
      • Fields inherited from class com.vaadin.ui.AbstractOrderedLayout

        ALIGNMENT_DEFAULT, components
      • Fields inherited from class com.vaadin.ui.AbstractComponent

        DESIGN_ATTR_PLAIN_TEXT
      • Fields inherited from interface com.vaadin.server.Sizeable

        SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void fetchPassword​(java.lang.String password)
      Fetches password.
      protected static void iniRole​(CmsObject cms, java.lang.String ou, com.vaadin.ui.ComboBox<CmsRole> roleComboBox, org.apache.commons.logging.Log log)
      Initialized the role ComboBox.
      protected static void iniRole​(CmsObject cms, java.lang.String ou, com.vaadin.v7.ui.ComboBox roleComboBox, org.apache.commons.logging.Log log)
      Initialized the role ComboBox (vaadin-v7-version).
      protected static void iniRole​(CmsObject cms, java.lang.String ou, com.vaadin.v7.ui.ComboBox roleComboBox, org.apache.commons.logging.Log log, boolean includeNoRoleEntry)
      Initialized the role ComboBox (vaadin-v7-version).
      protected boolean isNewUser()
      Checks if a new user should be created.
      protected boolean isPasswordMismatchingConfirm()
      m_next Is password not matching to confirm field?
      protected boolean isPasswordValid()
      Validates the password fields.
      protected boolean isRootSiteSelected()
      Checks if currently the root site is chosen as start site.
      protected boolean isSiteNull()
      Checks if the chosen site is valid.
      protected boolean isSitePathValid()
      Checks if the given path is valid resource in site.
      protected boolean isStartViewAvailableOnRoot()
      Checks if the currently chosen start view is visible for root site.
      protected boolean isValid()
      Checks if all fields are valid.
      protected void save()
      Saves the canged user data.
      protected static void sendMail​(CmsObject cms, java.lang.String password, CmsUser user, boolean newUser, boolean changePassword)
      Sends an email to the user.
      protected static void sendMail​(CmsObject cms, java.lang.String password, CmsUser user, java.lang.String ou, boolean newUser, boolean changePassword)
      Sends an email to the user.
      protected void setButtonVisibility()
      Sets the visibility of the buttons.
      protected void setEmailBox()
      En/Diables the email box.
      protected void setupStartFolder​(java.lang.String startFolder)
      Sets the start folder depending on current set site field.
      protected void setupValidators()
      Sets up the validators.
      protected void switchTab()
      Switches to the next tab.
      protected boolean userAlreadyExists​(java.lang.String username)
      Checks if given user exists.
      • Methods inherited from class com.vaadin.ui.VerticalLayout

        addComponentsAndExpand, getState, getState
      • Methods inherited from class com.vaadin.ui.AbstractOrderedLayout

        addComponent, addComponent, addComponentAsFirst, addLayoutClickListener, getComponent, getComponentAlignment, getComponentCount, getComponentIndex, getCustomAttributes, getDefaultComponentAlignment, getExpandRatio, getMargin, isSpacing, iterator, removeComponent, removeLayoutClickListener, replaceComponent, setComponentAlignment, setDefaultComponentAlignment, setExpandRatio, setMargin, setMargin, setSpacing, writeDesign
      • Methods inherited from class com.vaadin.ui.AbstractLayout

        readMargin, writeMargin
      • Methods inherited from class com.vaadin.ui.AbstractComponentContainer

        addComponentAttachListener, addComponentDetachListener, addComponents, fireComponentAttachEvent, fireComponentDetachEvent, getComponentIterator, moveComponentsFrom, removeAllComponents, removeComponentAttachListener, removeComponentDetachListener, setHeight, setWidth
      • Methods inherited from class com.vaadin.ui.AbstractComponent

        addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidthFull, setWidthUndefined
      • Methods inherited from class com.vaadin.server.AbstractClientConnector

        addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.vaadin.server.ClientConnector

        addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
      • Methods inherited from interface com.vaadin.ui.Component

        addListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible
      • Methods inherited from interface com.vaadin.ui.ComponentContainer

        addComponents, getComponentIterator, moveComponentsFrom, removeAllComponents
      • Methods inherited from interface com.vaadin.shared.Connector

        getConnectorId
      • Methods inherited from interface com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier

        addComponentAttachListener, addComponentDetachListener, removeComponentAttachListener, removeComponentDetachListener
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface com.vaadin.server.Sizeable

        getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefined
    • Field Detail

      • m_visSites

        protected boolean m_visSites
        Visible sites?
    • Constructor Detail

      • CmsUserEditDialog

        public CmsUserEditDialog​(CmsObject cms,
                                 CmsUUID userId,
                                 com.vaadin.ui.Window window,
                                 CmsAccountsApp app)
        public constructor.

        Parameters:
        cms - CmsObject
        userId - id of user
        window - to be closed
        app - account app instance
      • CmsUserEditDialog

        public CmsUserEditDialog​(CmsObject cms,
                                 com.vaadin.ui.Window window,
                                 java.lang.String ou,
                                 CmsAccountsApp app)
        public constructor for new user case.

        Parameters:
        cms - CmsObject
        window - Window
        ou - organizational unit
        app - accounts app instance
    • Method Detail

      • iniRole

        protected static void iniRole​(CmsObject cms,
                                      java.lang.String ou,
                                      com.vaadin.ui.ComboBox<CmsRole> roleComboBox,
                                      org.apache.commons.logging.Log log)
        Initialized the role ComboBox. (Vaadin 8 version)

        Parameters:
        cms - CmsObject
        ou - to load roles for
        roleComboBox - ComboBox
        log - LOG
      • iniRole

        protected static void iniRole​(CmsObject cms,
                                      java.lang.String ou,
                                      com.vaadin.v7.ui.ComboBox roleComboBox,
                                      org.apache.commons.logging.Log log)
        Initialized the role ComboBox (vaadin-v7-version).

        Parameters:
        cms - CmsObject
        ou - to load roles for
        roleComboBox - ComboBox
        log - LOG
      • iniRole

        protected static void iniRole​(CmsObject cms,
                                      java.lang.String ou,
                                      com.vaadin.v7.ui.ComboBox roleComboBox,
                                      org.apache.commons.logging.Log log,
                                      boolean includeNoRoleEntry)
        Initialized the role ComboBox (vaadin-v7-version).

        Parameters:
        cms - CmsObject
        ou - to load roles for
        roleComboBox - ComboBox
        log - LOG
        includeNoRoleEntry - with noRole entry?
      • sendMail

        protected static void sendMail​(CmsObject cms,
                                       java.lang.String password,
                                       CmsUser user,
                                       boolean newUser,
                                       boolean changePassword)
        Sends an email to the user.

        Parameters:
        cms - CmsObject
        password - of the user
        user - user to send mail to
        newUser - flag indicates if user is new
        changePassword - has the user to change password?
      • sendMail

        protected static void sendMail​(CmsObject cms,
                                       java.lang.String password,
                                       CmsUser user,
                                       java.lang.String ou,
                                       boolean newUser,
                                       boolean changePassword)
        Sends an email to the user.

        Parameters:
        cms - CmsObject
        password - of the user
        user - user to send mail to
        ou - name
        newUser - flag indicates if user is new
        changePassword - has the user to change password?
      • isNewUser

        protected boolean isNewUser()
        Checks if a new user should be created.

        Returns:
        true, if create user function
      • isPasswordMismatchingConfirm

        protected boolean isPasswordMismatchingConfirm()
        m_next Is password not matching to confirm field?

        Returns:
        true, if password not equal to confirm
      • isPasswordValid

        protected boolean isPasswordValid()
        Validates the password fields.

        Returns:
        true if password is valid (and confirm field matches password field).

      • isRootSiteSelected

        protected boolean isRootSiteSelected()
        Checks if currently the root site is chosen as start site.

        Returns:
        true if root site was selected
      • isSiteNull

        protected boolean isSiteNull()
        Checks if the chosen site is valid.

        Returns:
        true if site is null
      • isSitePathValid

        protected boolean isSitePathValid()
        Checks if the given path is valid resource in site.

        Returns:
        true if the resource is valid
      • isStartViewAvailableOnRoot

        protected boolean isStartViewAvailableOnRoot()
        Checks if the currently chosen start view is visible for root site.

        Returns:
        true if app is available for root site
      • isValid

        protected boolean isValid()
        Checks if all fields are valid. If not the tab of the first invalid field gets chosen.

        Returns:
        true, if everything is ok
      • save

        protected void save()
        Saves the canged user data.

      • setButtonVisibility

        protected void setButtonVisibility()
        Sets the visibility of the buttons.

      • setEmailBox

        protected void setEmailBox()
        En/Diables the email box.

      • setupStartFolder

        protected void setupStartFolder​(java.lang.String startFolder)
        Sets the start folder depending on current set site field.

        Parameters:
        startFolder - default value or null
      • setupValidators

        protected void setupValidators()
        Sets up the validators.

      • switchTab

        protected void switchTab()
        Switches to the next tab.
      • userAlreadyExists

        protected boolean userAlreadyExists​(java.lang.String username)
        Checks if given user exists.

        Parameters:
        username - to check
        Returns:
        boolean