Class CmsContainerpageHandler
java.lang.Object
org.opencms.gwt.client.ui.A_CmsToolbarHandler
org.opencms.ade.containerpage.client.CmsContainerpageHandler
- All Implemented Interfaces:
I_CmsActionHandler
,I_CmsContextMenuHandler
,I_CmsToolbarHandler
The container-page handler.
- Since:
- 8.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Runnable
Action which does nothing.protected CmsContainerpageController
The container-page controller.protected CmsContainerpageEditor
The container-page editor. -
Constructor Summary
ConstructorDescriptionCmsContainerpageHandler
(CmsContainerpageController controller, CmsContainerpageEditor editor) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Activates the selection button.void
addToFavorites
(String clientId) Adds the element with the given id to the favorite list.void
addToFavorites
(CmsListItem listItem) Adds the given list item widget to the favorite list widget.void
addToRecent
(String clientId) Adds the element with the given id to the favorite list.void
addToRecent
(CmsListItem listItem) Adds the given list item widget to the recent list widget.void
changeTemplateContextManually
(String cookieName, String value) Switches the template context.void
checkNewWidgetsAvailable
(org.opencms.util.CmsUUID structureId, com.google.gwt.user.client.rpc.AsyncCallback<Boolean> asyncCallback) Checks whether GWT widgets are available for all fields of a content.protected I_CmsContextMenuEntry
Creates the element view selection menu entry, returnsnull
in case no other views available.protected CmsContextMenuEntry
createRawMenuEntry
(org.opencms.util.CmsUUID structureId, Runnable action) Creates a menu entry based on a structure id and action without anything else.createSimpleContextMenuEntry
(org.opencms.util.CmsUUID structureId, String name, boolean checked, Runnable action) Creates a context menu entry.protected I_CmsContextMenuEntry
createTemplateContextSelectionMenuEntry
(org.opencms.util.CmsUUID structureId) Creates the template context selection entry for the context menu.protected I_CmsContextMenuEntry
Creates the context menu entry for enabling or disabling editing of small elements.protected I_CmsContextMenuEntry
Creates the view online entry, if an online link is available.Creates a select box used to switch between views from the gallery dialog.void
De-activates the current button.void
De-activates menu button.void
Deactivates the selection.protected void
decorateMenuEntry
(CmsContextMenuEntry entry, String name, boolean checked) Fills in label and checkbox of a menu entry.void
Deactivates all toolbar buttons.void
editElementSettings
(CmsContainerPageElementPanel elementWidget) Starts the property editor for the given container element.void
enableFavoriteEditing
(boolean enable, I_CmsDNDController dndController) Enables the favorites editing drag and drop controller.void
Enables the toolbar buttons.void
ensureLockOnResource
(org.opencms.util.CmsUUID structureId, I_CmsSimpleCallback<Boolean> callback) Tries to lock the given resource and returnstrue
on success.Returns the currently active button (may be null).Returns the available context menu commands as a map by class name.Returns the context type.Returns the editor handler.protected String
getLockErrorMessage
(org.opencms.gwt.shared.CmsLockInfo lockInfo) Helper method for getting the error message for a locking error.protected String
getLockErrorTitle
(org.opencms.gwt.shared.CmsLockInfo lockInfo) Helper method for getting the error message box title for a locking error.void
Leaves the current page and opens the site-map.boolean
Returns if the selection button is active.void
hideMenu()
Hides any open menu.void
Removes page overlay if present.void
insertContextMenu
(List<org.opencms.gwt.shared.CmsContextMenuEntryBean> menuBeans, org.opencms.util.CmsUUID structureId) Inserts the context menu.void
leavePage
(com.google.gwt.user.client.Command leavingCommand) Call to leave the page.void
Call to leave the page.void
loadContextMenu
(org.opencms.util.CmsUUID structureId, org.opencms.gwt.shared.CmsCoreData.AdeContext context) Loads the context menu entries for a given URI.void
Loads the favorite list from the server and adds it's items to the clip-board.void
Loads the recent list from the server and adds it's items to the clip-board.void
onLockFail
(String errorMessage) Should be called when locking the container page failed.void
onSiteOrProjectChange
(String sitePath, String serverLink) Called when site and or project have been changed.void
openEditorForElement
(CmsContainerPageElementPanel element, boolean inline, boolean wasNew) Opens the edit dialog for the specified element.void
openEditorForNewListContent
(org.opencms.gwt.shared.CmsListElementCreationOption option, String reloadId, String postCreateHandler) Triggers creation/editing of a new content after an option has been selected.void
Opens the elements info dialog.void
openListAddDialog
(org.opencms.util.CmsUUID structureId, String listAddMetadata) Opens the dialog for adding a new list content.void
Opens the lock report for the given element.void
openModelResourceSelect
(CmsContainerPageElementPanel element, List<org.opencms.gwt.shared.CmsModelResourceInfo> modelResources) Opens the model select dialog for the given new element.protected void
Opens the publish dialog without changes check.void
refreshResource
(org.opencms.util.CmsUUID structureId) Reloads the resource edited.void
Re-initializes the inline editing.void
reloadElements
(String[] elementIds, Runnable callback) Reloads the content for the given element and all related elements.void
Removes the given container-page element.void
removeElement
(CmsContainerPageElementPanel element, CmsContainerpageController.ElementRemoveMode removeMode) Removes the given container-page element.void
replaceElement
(CmsContainerPageElementPanel element, String elementId, Runnable callback) Replaces the given element with another content while keeping it's settings.void
Shows list collector direct edit buttons (old direct edit style), if present.void
Resets the container-page to it's previous state.void
saveFavoriteList
(List<String> clientIds) Saves the favorite list.void
savePage()
Saves the current state of the container-page.void
setActiveButton
(I_CmsToolbarButton button) Sets the currently active tool-bar button.void
setEditButtonsVisible
(boolean visible) Sets the edit button visible.protected void
setElementView
(org.opencms.ade.containerpage.shared.CmsElementViewInfo elementView, Runnable nextAction) Sets the element view.void
Shows resource information for a given element.void
Shows a page overlay preventing user actions.void
showPreview
(int buttonLeft) Toggles the tool-bars visibility.void
Shows the publish dialog.transformSingleEntry
(org.opencms.util.CmsUUID structureId, org.opencms.gwt.shared.CmsContextMenuEntryBean menuEntryBean) Creates a single context menu entry from a context menu entry bean.void
unlockResource
(org.opencms.util.CmsUUID structureId) Unlocks the resource if appropriate.void
updateClipboard
(Map<String, org.opencms.ade.containerpage.shared.CmsContainerElementData> elements) Updates the clip board elements is necessary.Methods inherited from class org.opencms.gwt.client.ui.A_CmsToolbarHandler
transformEntries
-
Field Details
-
DO_NOTHING
Action which does nothing. -
m_controller
The container-page controller. -
m_editor
The container-page editor.
-
-
Constructor Details
-
CmsContainerpageHandler
public CmsContainerpageHandler(CmsContainerpageController controller, CmsContainerpageEditor editor) Constructor.- Parameters:
controller
- the container-page controllereditor
- the container-page editor
-
-
Method Details
-
activateSelection
Activates the selection button. -
addToFavorites
Adds the given list item widget to the favorite list widget.- Parameters:
listItem
- the list item
-
addToFavorites
Adds the element with the given id to the favorite list.- Parameters:
clientId
- the client id
-
addToRecent
Adds the given list item widget to the recent list widget.- Parameters:
listItem
- the list item
-
addToRecent
Adds the element with the given id to the favorite list.- Parameters:
clientId
- the client id
-
changeTemplateContextManually
Switches the template context.- Parameters:
cookieName
- the cookie namevalue
- the new template context
-
checkNewWidgetsAvailable
public void checkNewWidgetsAvailable(org.opencms.util.CmsUUID structureId, com.google.gwt.user.client.rpc.AsyncCallback<Boolean> asyncCallback) Checks whether GWT widgets are available for all fields of a content.- Parameters:
structureId
- the structure id of the contentasyncCallback
- the callback for the result
-
createSimpleContextMenuEntry
public CmsContextMenuEntry createSimpleContextMenuEntry(org.opencms.util.CmsUUID structureId, String name, boolean checked, Runnable action) Creates a context menu entry.- Parameters:
structureId
- structure id of the resourcename
- the labelchecked
- true if checkbox should be displayedaction
- the action to execute- Returns:
- the menu entry
-
createViewSelectorForGalleryDialog
Creates a select box used to switch between views from the gallery dialog.- Returns:
- the created select box
-
deactivateCurrentButton
De-activates the current button. -
deactivateMenuButton
De-activates menu button. -
deactivateSelection
Deactivates the selection. -
disableToolbarButtons
Deactivates all toolbar buttons. -
editElementSettings
Starts the property editor for the given container element.- Parameters:
elementWidget
- the container element widget for which the properties should be edited
-
enableFavoriteEditing
Enables the favorites editing drag and drop controller.- Parameters:
enable
- iftrue
favorites editing will enabled, otherwise disableddndController
- the favorites editing drag and drop controller
-
enableToolbarButtons
Enables the toolbar buttons. -
ensureLockOnResource
public void ensureLockOnResource(org.opencms.util.CmsUUID structureId, I_CmsSimpleCallback<Boolean> callback) Description copied from interface:I_CmsContextMenuHandler
Tries to lock the given resource and returnstrue
on success. If not successful a warning should be displayed.- Parameters:
structureId
- the structure id of the resource to lockcallback
- the callback to execute- See Also:
-
getActiveButton
Description copied from interface:I_CmsToolbarHandler
Returns the currently active button (may be null).- Returns:
- the currently active button
- See Also:
-
getContextMenuCommands
Description copied from interface:I_CmsContextMenuHandler
Returns the available context menu commands as a map by class name.- Returns:
- the available context menu commands as a map by class name
- See Also:
-
getContextType
Description copied from interface:I_CmsContextMenuHandler
Returns the context type.- Returns:
- the context type
- See Also:
-
getEditorHandler
Description copied from interface:I_CmsContextMenuHandler
Returns the editor handler.- Returns:
- the editor handler
- See Also:
-
gotoSitemap
Leaves the current page and opens the site-map. -
hasActiveSelection
Returns if the selection button is active.- Returns:
true
if the selection button is active
-
hideMenu
Hides any open menu. -
hidePageOverlay
Removes page overlay if present. -
insertContextMenu
public void insertContextMenu(List<org.opencms.gwt.shared.CmsContextMenuEntryBean> menuBeans, org.opencms.util.CmsUUID structureId) Inserts the context menu.- Parameters:
menuBeans
- the menu beans from the serverstructureId
- the structure id of the resource for which the context menu entries should be generated
-
leavePage
Call to leave the page. Will open save/leave/cancel dialog if page contains any changes.- Parameters:
leavingCommand
- the page leaving command
-
leavePage
Call to leave the page. Will open save/leave/cancel dialog if page contains any changes.- Parameters:
target
- the target
-
loadFavorites
Loads the favorite list from the server and adds it's items to the clip-board. -
loadRecent
Loads the recent list from the server and adds it's items to the clip-board. -
onLockFail
Should be called when locking the container page failed.- Parameters:
errorMessage
- the locking information
-
onSiteOrProjectChange
Description copied from interface:I_CmsActionHandler
Called when site and or project have been changed.- Parameters:
sitePath
- the site path to the target resourceserverLink
- the server link to the resource- See Also:
-
openEditorForElement
public void openEditorForElement(CmsContainerPageElementPanel element, boolean inline, boolean wasNew) Opens the edit dialog for the specified element.- Parameters:
element
- the element to editinline
-true
to open the inline editor for the given element if availablewasNew
-true
in case this is a newly created element not previously edited
-
openElementsInfo
Opens the elements info dialog. -
openListAddDialog
Opens the dialog for adding a new list content.- Parameters:
structureId
- the structure id of the container elementlistAddMetadata
- the list-add metadata read from the container element
-
openLockReportForElement
Opens the lock report for the given element.- Parameters:
element
- the element
-
openModelResourceSelect
public void openModelResourceSelect(CmsContainerPageElementPanel element, List<org.opencms.gwt.shared.CmsModelResourceInfo> modelResources) Opens the model select dialog for the given new element.- Parameters:
element
- the element widgetmodelResources
- the available resource models
-
refreshResource
Description copied from interface:I_CmsActionHandler
Reloads the resource edited.- Parameters:
structureId
- the structure id of the resource to lock- See Also:
-
reInitInlineEditing
Re-initializes the inline editing. -
reloadElements
Reloads the content for the given element and all related elements.- Parameters:
elementIds
- the element id'scallback
- the callback to execute after reloading
-
removeElement
Removes the given container-page element.- Parameters:
element
- the element
-
removeElement
public void removeElement(CmsContainerPageElementPanel element, CmsContainerpageController.ElementRemoveMode removeMode) Removes the given container-page element.- Parameters:
element
- the elementremoveMode
- the element remove mode
-
replaceElement
public void replaceElement(CmsContainerPageElementPanel element, String elementId, Runnable callback) Replaces the given element with another content while keeping it's settings.- Parameters:
element
- the element to replaceelementId
- the id of the replacing contentcallback
- the callback to execute after replacing the element
-
resetEditableListButtons
Shows list collector direct edit buttons (old direct edit style), if present. -
resetPage
Resets the container-page to it's previous state. -
saveFavoriteList
Saves the favorite list.- Parameters:
clientIds
- the client id's of the list's elements- See Also:
-
savePage
Saves the current state of the container-page. -
setActiveButton
Sets the currently active tool-bar button.- Parameters:
button
- the button
-
setEditButtonsVisible
Sets the edit button visible.- Parameters:
visible
- the visibility
-
showElementInfo
Shows resource information for a given element.- Parameters:
element
- the element for which to show the information
-
showPageOverlay
Shows a page overlay preventing user actions. -
showPreview
Toggles the tool-bars visibility.- Parameters:
buttonLeft
- the selection button absolute left position, needed to show the leave preview button in the same location
-
showPublishDialog
Shows the publish dialog. -
unlockResource
Description copied from interface:I_CmsContextMenuHandler
Unlocks the resource if appropriate.- Parameters:
structureId
- the structure id of the resource to lock- See Also:
-
updateClipboard
public void updateClipboard(Map<String, org.opencms.ade.containerpage.shared.CmsContainerElementData> elements) Updates the clip board elements is necessary.- Parameters:
elements
- the elements data
-
createElementViewSelectionMenuEntry
Creates the element view selection menu entry, returnsnull
in case no other views available.- Returns:
- the menu entry
-
createRawMenuEntry
protected CmsContextMenuEntry createRawMenuEntry(org.opencms.util.CmsUUID structureId, Runnable action) Creates a menu entry based on a structure id and action without anything else.- Parameters:
structureId
- the structure idaction
- the action for the menu entry- Returns:
- the new menu entry
-
createTemplateContextSelectionMenuEntry
protected I_CmsContextMenuEntry createTemplateContextSelectionMenuEntry(org.opencms.util.CmsUUID structureId) Creates the template context selection entry for the context menu.- Parameters:
structureId
- the structure id of the page- Returns:
- the new context menu entry
-
createToggleEditSmallElementsMenuEntry
Creates the context menu entry for enabling or disabling editing of small elements.- Returns:
- the created context menu entry
-
createViewOnlineEntry
Creates the view online entry, if an online link is available.- Returns:
- the menu entry or null, if not available
-
openPublish
Opens the publish dialog without changes check.
-