Class CmsAliasList

java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
org.opencms.gwt.client.seo.CmsAliasList
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget

public class CmsAliasList extends com.google.gwt.user.client.ui.Composite
A widget used for editing the alias list of a page.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected class 
    A helper class which encapsulates the input widgets for a single alias.

    Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject

    com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static CmsAliasMessages
    The alias messages.
    protected static int
    Static variable used to generate new ids.
    static final I_CmsInputCss
    The CSS bundle for input widgets.
    protected com.google.gwt.user.client.rpc.AsyncCallback<Map<String,String>>
    The callback which is normally used for validation of the site paths.
    protected boolean
    A flag used to keep track of whether the last validation had any errors.
    protected org.opencms.util.CmsUUID
    The structure id of the page for which the aliases are being edited.

    Fields inherited from class com.google.gwt.user.client.ui.UIObject

    DEBUG_ID_PREFIX
  • Constructor Summary

    Constructors
    Constructor
    Description
    CmsAliasList(org.opencms.util.CmsUUID structureId, List<org.opencms.gwt.shared.alias.CmsAliasBean> aliases)
    Creates a new widget instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAlias(org.opencms.gwt.shared.alias.CmsAliasBean alias)
    Adds the controls for a single alias to the widget.
    void
    Clears the validation error flag.
    protected com.google.gwt.user.client.ui.PushButton
    Creates the button used for adding new aliases.
    protected com.google.gwt.user.client.ui.PushButton
    Creates the button used for deleting aliases.
    protected com.google.gwt.user.client.ui.PushButton
    Creates an icon button for editing aliases.
    protected com.google.gwt.user.client.ui.Label
    Creates a label for this widget.
    protected CmsSelectBox
    Creates the select box for selecting alias modes.
    protected CmsTextBox
    Creates a text box for entering an alias path.
    List<org.opencms.gwt.shared.alias.CmsAliasBean>
    Gets a list of the changed aliases.
    Gets a map of the current alias site paths, with the alias controls ids as the keys.
    boolean
    Checks whether there have been validation errors since the validation errors were cleared the last time.
    void
    init(List<org.opencms.gwt.shared.alias.CmsAliasBean> aliases)
    Initializes the alias controls.
    protected void
    This method is called when an alias path changes.
    void
    validate(Runnable nextAction)
    Simplified method to perform a full validation of the aliases in the list and execute an action afterwards.
    void
    validateAliases(org.opencms.util.CmsUUID uuid, Map<String,String> aliasPaths, com.google.gwt.user.client.rpc.AsyncCallback<Map<String,String>> callback)
    Validates aliases.
    protected void
    validateFull(org.opencms.util.CmsUUID structureId, Map<String,String> sitePaths, com.google.gwt.user.client.rpc.AsyncCallback<Map<String,String>> errorCallback)
    Performs a validation of the current list of aliases in the widget.
    protected void
    validateSingle(org.opencms.util.CmsUUID structureId, Map<String,String> sitePaths, String newSitePath, com.google.gwt.user.client.rpc.AsyncCallback<String> errorCallback)
    Validation method used when adding a new alias.

    Methods inherited from class com.google.gwt.user.client.ui.Composite

    claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget

    Methods inherited from class com.google.gwt.user.client.ui.Widget

    addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents

    Methods inherited from class com.google.gwt.user.client.ui.UIObject

    addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • INPUT_CSS

      public static final I_CmsInputCss INPUT_CSS
      The CSS bundle for input widgets.
    • aliasMessages

      protected static CmsAliasMessages aliasMessages
      The alias messages.
    • idCounter

      protected static int idCounter
      Static variable used to generate new ids.
    • m_defaultValidationHandler

      protected com.google.gwt.user.client.rpc.AsyncCallback<Map<String,String>> m_defaultValidationHandler
      The callback which is normally used for validation of the site paths.
    • m_hasValidationErrors

      protected boolean m_hasValidationErrors
      A flag used to keep track of whether the last validation had any errors.
    • m_structureId

      protected org.opencms.util.CmsUUID m_structureId
      The structure id of the page for which the aliases are being edited.
  • Constructor Details

    • CmsAliasList

      public CmsAliasList(org.opencms.util.CmsUUID structureId, List<org.opencms.gwt.shared.alias.CmsAliasBean> aliases)
      Creates a new widget instance.

      Parameters:
      structureId - the structure id of the page for which the aliases should be edited
      aliases - the aliases being edited
  • Method Details

    • addAlias

      public void addAlias(org.opencms.gwt.shared.alias.CmsAliasBean alias)
      Adds the controls for a single alias to the widget.

      Parameters:
      alias - the alias for which the controls should be added
    • clearValidationErrors

      public void clearValidationErrors()
      Clears the validation error flag.

    • getAliases

      public List<org.opencms.gwt.shared.alias.CmsAliasBean> getAliases()
      Gets a list of the changed aliases.

      Returns:
      a list of the aliases
    • getAliasPaths

      Gets a map of the current alias site paths, with the alias controls ids as the keys.

      Returns:
      a map from control ids to alias site paths
    • hasValidationErrors

      public boolean hasValidationErrors()
      Checks whether there have been validation errors since the validation errors were cleared the last time.

      Returns:
      true if there were validation errors
    • init

      public void init(List<org.opencms.gwt.shared.alias.CmsAliasBean> aliases)
      Initializes the alias controls.

      Parameters:
      aliases - the existing aliases
    • validate

      public void validate(Runnable nextAction)
      Simplified method to perform a full validation of the aliases in the list and execute an action afterwards.

      Parameters:
      nextAction - the action to execute after the validation finished
    • validateAliases

      public void validateAliases(org.opencms.util.CmsUUID uuid, Map<String,String> aliasPaths, com.google.gwt.user.client.rpc.AsyncCallback<Map<String,String>> callback)
      Validates aliases.
      Parameters:
      uuid - The structure id for which the aliases should be valid
      aliasPaths - a map from id strings to alias paths
      callback - the callback which should be called with the validation results
    • createAddButton

      protected com.google.gwt.user.client.ui.PushButton createAddButton()
      Creates the button used for adding new aliases.

      Returns:
      the new button
    • createDeleteButton

      protected com.google.gwt.user.client.ui.PushButton createDeleteButton()
      Creates the button used for deleting aliases.

      Returns:
      the new button
    • createIconButton

      protected com.google.gwt.user.client.ui.PushButton createIconButton(String icon)
      Creates an icon button for editing aliases.

      Parameters:
      icon - the icon css class to use
      Returns:
      the new icon button
    • createLabel

      protected com.google.gwt.user.client.ui.Label createLabel(String text)
      Creates a label for this widget.

      Parameters:
      text - the text to display in the label
      Returns:
      the created label
    • createSelectBox

      Creates the select box for selecting alias modes.

      Returns:
      the select box for selecting alias modes
    • createTextBox

      Creates a text box for entering an alias path.

      Returns:
      the new text box
    • onChangePath

      protected void onChangePath(CmsAliasList.AliasControls controls)
      This method is called when an alias path changes.

      Parameters:
      controls - the alias controls
    • validateFull

      protected void validateFull(org.opencms.util.CmsUUID structureId, Map<String,String> sitePaths, com.google.gwt.user.client.rpc.AsyncCallback<Map<String,String>> errorCallback)
      Performs a validation of the current list of aliases in the widget.

      Parameters:
      structureId - the resource's structure id
      sitePaths - the map from ids to alias site paths
      errorCallback - the callback to invoke when the validation finishes
    • validateSingle

      protected void validateSingle(org.opencms.util.CmsUUID structureId, Map<String,String> sitePaths, String newSitePath, com.google.gwt.user.client.rpc.AsyncCallback<String> errorCallback)
      Validation method used when adding a new alias.

      Parameters:
      structureId - the structure id
      sitePaths - the site paths
      newSitePath - the new site path
      errorCallback - on error callback