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
FieldsModifier and TypeFieldDescriptionstatic final RunnableAction which does nothing.protected CmsContainerpageControllerThe container-page controller.protected CmsContainerpageEditorThe container-page editor. -
Constructor Summary
ConstructorsConstructorDescriptionCmsContainerpageHandler(CmsContainerpageController controller, CmsContainerpageEditor editor) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidActivates the selection button.voidaddToFavorites(String clientId) Adds the element with the given id to the favorite list.voidaddToFavorites(CmsListItem listItem) Adds the given list item widget to the favorite list widget.voidaddToRecent(String clientId) Adds the element with the given id to the favorite list.voidaddToRecent(CmsListItem listItem) Adds the given list item widget to the recent list widget.voidchangeTemplateContextManually(String cookieName, String value) Switches the template context.voidcheckNewWidgetsAvailable(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_CmsContextMenuEntryCreates the element view selection menu entry, returnsnullin case no other views available.protected CmsContextMenuEntrycreateRawMenuEntry(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_CmsContextMenuEntrycreateTemplateContextSelectionMenuEntry(org.opencms.util.CmsUUID structureId) Creates the template context selection entry for the context menu.protected I_CmsContextMenuEntryCreates the context menu entry for enabling or disabling editing of small elements.protected I_CmsContextMenuEntryCreates the view online entry, if an online link is available.Creates a select box used to switch between views from the gallery dialog.voidDe-activates the current button.voidDe-activates menu button.voidDeactivates the selection.protected voiddecorateMenuEntry(CmsContextMenuEntry entry, String name, boolean checked) Fills in label and checkbox of a menu entry.voidDeactivates all toolbar buttons.voideditElementSettings(CmsContainerPageElementPanel elementWidget) Starts the property editor for the given container element.voidenableFavoriteEditing(boolean enable, I_CmsDNDController dndController) Enables the favorites editing drag and drop controller.voidEnables the toolbar buttons.voidensureLockOnResource(org.opencms.util.CmsUUID structureId, I_CmsSimpleCallback<Boolean> callback) Tries to lock the given resource and returnstrueon 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 StringgetLockErrorMessage(org.opencms.gwt.shared.CmsLockInfo lockInfo) Helper method for getting the error message for a locking error.protected StringgetLockErrorTitle(org.opencms.gwt.shared.CmsLockInfo lockInfo) Helper method for getting the error message box title for a locking error.voidLeaves the current page and opens the site-map.booleanReturns if the selection button is active.voidhideMenu()Hides any open menu.voidRemoves page overlay if present.voidinsertContextMenu(List<org.opencms.gwt.shared.CmsContextMenuEntryBean> menuBeans, org.opencms.util.CmsUUID structureId) Inserts the context menu.voidleavePage(com.google.gwt.user.client.Command leavingCommand) Call to leave the page.voidCall to leave the page.voidloadContextMenu(org.opencms.util.CmsUUID structureId, org.opencms.gwt.shared.CmsCoreData.AdeContext context) Loads the context menu entries for a given URI.voidLoads the favorite list from the server and adds it's items to the clip-board.voidLoads the recent list from the server and adds it's items to the clip-board.voidonLockFail(String errorMessage) Should be called when locking the container page failed.voidonSiteOrProjectChange(String sitePath, String serverLink) Called when site and or project have been changed.voidopenEditorForElement(CmsContainerPageElementPanel element, boolean inline, boolean wasNew) Opens the edit dialog for the specified element.voidopenEditorForNewListContent(org.opencms.gwt.shared.CmsListElementCreationOption option, String reloadId, String postCreateHandler) Triggers creation/editing of a new content after an option has been selected.voidOpens the elements info dialog.voidopenListAddDialog(org.opencms.util.CmsUUID structureId, String listAddMetadata) Opens the dialog for adding a new list content.voidOpens the lock report for the given element.voidopenModelResourceSelect(CmsContainerPageElementPanel element, List<org.opencms.gwt.shared.CmsModelResourceInfo> modelResources) Opens the model select dialog for the given new element.protected voidOpens the publish dialog without changes check.voidrefreshResource(org.opencms.util.CmsUUID structureId) Reloads the resource edited.voidRe-initializes the inline editing.voidreloadElements(String[] elementIds, Runnable callback) Reloads the content for the given element and all related elements.voidRemoves the given container-page element.voidremoveElement(CmsContainerPageElementPanel element, CmsContainerpageController.ElementRemoveMode removeMode) Removes the given container-page element.voidreplaceElement(CmsContainerPageElementPanel element, String elementId, Runnable callback) Replaces the given element with another content while keeping it's settings.voidShows list collector direct edit buttons (old direct edit style), if present.voidResets the container-page to it's previous state.voidsaveFavoriteList(List<String> clientIds) Saves the favorite list.voidsavePage()Saves the current state of the container-page.voidsetActiveButton(I_CmsToolbarButton button) Sets the currently active tool-bar button.voidsetEditButtonsVisible(boolean visible) Sets the edit button visible.protected voidsetElementView(org.opencms.ade.containerpage.shared.CmsElementViewInfo elementView, Runnable nextAction) Sets the element view.voidShows resource information for a given element.voidShows a page overlay preventing user actions.voidshowPreview(int buttonLeft) Toggles the tool-bars visibility.voidShows 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.voidunlockResource(org.opencms.util.CmsUUID structureId) Unlocks the resource if appropriate.voidupdateClipboard(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- iftruefavorites 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_CmsContextMenuHandlerTries to lock the given resource and returnstrueon 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_CmsToolbarHandlerReturns the currently active button (may be null).- Returns:
- the currently active button
- See Also:
-
getContextMenuCommands
Description copied from interface:I_CmsContextMenuHandlerReturns 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_CmsContextMenuHandlerReturns the context type.- Returns:
- the context type
- See Also:
-
getEditorHandler
Description copied from interface:I_CmsContextMenuHandlerReturns 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:
trueif 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_CmsActionHandlerCalled 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-trueto open the inline editor for the given element if availablewasNew-truein 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_CmsActionHandlerReloads 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_CmsContextMenuHandlerUnlocks 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, returnsnullin 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.
-