Package org.opencms.gwt.client.seo
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
A widget used for editing the alias list of a page.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classA 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
FieldsModifier and TypeFieldDescriptionprotected static CmsAliasMessagesThe alias messages.protected static intStatic variable used to generate new ids.static final I_CmsInputCssThe CSS bundle for input widgets.The callback which is normally used for validation of the site paths.protected booleanA flag used to keep track of whether the last validation had any errors.protected org.opencms.util.CmsUUIDThe 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
ConstructorsConstructorDescriptionCmsAliasList(org.opencms.util.CmsUUID structureId, List<org.opencms.gwt.shared.alias.CmsAliasBean> aliases) Creates a new widget instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAlias(org.opencms.gwt.shared.alias.CmsAliasBean alias) Adds the controls for a single alias to the widget.voidClears the validation error flag.protected com.google.gwt.user.client.ui.PushButtonCreates the button used for adding new aliases.protected com.google.gwt.user.client.ui.PushButtonCreates the button used for deleting aliases.protected com.google.gwt.user.client.ui.PushButtoncreateIconButton(String icon) Creates an icon button for editing aliases.protected com.google.gwt.user.client.ui.LabelcreateLabel(String text) Creates a label for this widget.protected CmsSelectBoxCreates the select box for selecting alias modes.protected CmsTextBoxCreates 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.booleanChecks whether there have been validation errors since the validation errors were cleared the last time.voidInitializes the alias controls.protected voidonChangePath(CmsAliasList.AliasControls controls) This method is called when an alias path changes.voidSimplified method to perform a full validation of the aliases in the list and execute an action afterwards.voidvalidateAliases(org.opencms.util.CmsUUID uuid, Map<String, String> aliasPaths, com.google.gwt.user.client.rpc.AsyncCallback<Map<String, String>> callback) Validates aliases.protected voidvalidateFull(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 voidvalidateSingle(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, setWidgetMethods 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, unsinkEventsMethods 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
-
Field Details
-
INPUT_CSS
The CSS bundle for input widgets. -
aliasMessages
The alias messages. -
idCounter
Static variable used to generate new ids. -
m_defaultValidationHandler
protected com.google.gwt.user.client.rpc.AsyncCallback<Map<String,String>> m_defaultValidationHandlerThe callback which is normally used for validation of the site paths. -
m_hasValidationErrors
A flag used to keep track of whether the last validation had any errors. -
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 editedaliases- the aliases being edited
-
-
Method Details
-
clearValidationErrors
Clears the validation error flag. -
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
Checks whether there have been validation errors since the validation errors were cleared the last time.- Returns:
- true if there were validation errors
-
init
Initializes the alias controls.- Parameters:
aliases- the existing aliases
-
validate
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 validaliasPaths- a map from id strings to alias pathscallback- the callback which should be called with the validation results
-
createAddButton
Creates the button used for adding new aliases.- Returns:
- the new button
-
createDeleteButton
Creates the button used for deleting aliases.- Returns:
- the new button
-
createIconButton
Creates an icon button for editing aliases.- Parameters:
icon- the icon css class to use- Returns:
- the new icon button
-
createLabel
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
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 idsitePaths- the map from ids to alias site pathserrorCallback- 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 idsitePaths- the site pathsnewSitePath- the new site patherrorCallback- on error callback