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 Details

  • Constructor Details

  • Method Details

    • activateSelection

      public void activateSelection()
      Activates the selection button.

    • addToFavorites

      public void addToFavorites(CmsListItem listItem)
      Adds the given list item widget to the favorite list widget.

      Parameters:
      listItem - the list item
    • addToFavorites

      public void addToFavorites(String clientId)
      Adds the element with the given id to the favorite list.

      Parameters:
      clientId - the client id
    • addToRecent

      public void addToRecent(CmsListItem listItem)
      Adds the given list item widget to the recent list widget.

      Parameters:
      listItem - the list item
    • addToRecent

      public void addToRecent(String clientId)
      Adds the element with the given id to the favorite list.

      Parameters:
      clientId - the client id
    • changeTemplateContextManually

      public void changeTemplateContextManually(String cookieName, String value)
      Switches the template context.

      Parameters:
      cookieName - the cookie name
      value - 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 content
      asyncCallback - 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 resource
      name - the label
      checked - true if checkbox should be displayed
      action - 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

      public void deactivateCurrentButton()
      De-activates the current button.

    • deactivateMenuButton

      public void deactivateMenuButton()
      De-activates menu button.

    • deactivateSelection

      public void deactivateSelection()
      Deactivates the selection.

    • disableToolbarButtons

      public void 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

      public void enableFavoriteEditing(boolean enable, I_CmsDNDController dndController)
      Enables the favorites editing drag and drop controller.

      Parameters:
      enable - if true favorites editing will enabled, otherwise disabled
      dndController - the favorites editing drag and drop controller
    • enableToolbarButtons

      public void 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 returns true on success. If not successful a warning should be displayed.

      Parameters:
      structureId - the structure id of the resource to lock
      callback - 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

      public void gotoSitemap()
      Leaves the current page and opens the site-map.

    • hasActiveSelection

      public boolean hasActiveSelection()
      Returns if the selection button is active.

      Returns:
      true if the selection button is active
    • hideMenu

      public void hideMenu()
      Hides any open menu.

    • hidePageOverlay

      public void 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 server
      structureId - the structure id of the resource for which the context menu entries should be generated
    • leavePage

      public void leavePage(com.google.gwt.user.client.Command leavingCommand)
      Call to leave the page. Will open save/leave/cancel dialog if page contains any changes.

      Parameters:
      leavingCommand - the page leaving command
    • leavePage

      public void leavePage(String target)
      Call to leave the page. Will open save/leave/cancel dialog if page contains any changes.

      Parameters:
      target - the target
    • loadContextMenu

      public void loadContextMenu(org.opencms.util.CmsUUID structureId, org.opencms.gwt.shared.CmsCoreData.AdeContext context)
      Loads the context menu entries for a given URI.

      Parameters:
      structureId - the structure id of the resource for which the context menu should be loaded
      context - the ade context (sitemap or containerpage)
    • loadFavorites

      public void loadFavorites()
      Loads the favorite list from the server and adds it's items to the clip-board.

    • loadRecent

      public void loadRecent()
      Loads the recent list from the server and adds it's items to the clip-board.

    • onLockFail

      public void onLockFail(String errorMessage)
      Should be called when locking the container page failed.

      Parameters:
      errorMessage - the locking information
    • onSiteOrProjectChange

      public void onSiteOrProjectChange(String sitePath, String serverLink)
      Description copied from interface: I_CmsActionHandler
      Called when site and or project have been changed.

      Parameters:
      sitePath - the site path to the target resource
      serverLink - 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 edit
      inline - true to open the inline editor for the given element if available
      wasNew - true in case this is a newly created element not previously edited
    • openEditorForNewListContent

      public 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.
      Parameters:
      option - the type option selected by the user
      reloadId - the id of the element to be reloaded after editing
      postCreateHandler - the post-create handler (for assigning categories or similar)
    • openElementsInfo

      public void openElementsInfo()
      Opens the elements info dialog.

    • openListAddDialog

      public void openListAddDialog(org.opencms.util.CmsUUID structureId, String listAddMetadata)
      Opens the dialog for adding a new list content.
      Parameters:
      structureId - the structure id of the container element
      listAddMetadata - 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 widget
      modelResources - the available resource models
    • refreshResource

      public void refreshResource(org.opencms.util.CmsUUID structureId)
      Description copied from interface: I_CmsActionHandler
      Reloads the resource edited.

      Parameters:
      structureId - the structure id of the resource to lock
      See Also:
    • reInitInlineEditing

      public void reInitInlineEditing()
      Re-initializes the inline editing.

    • reloadElements

      public void reloadElements(String[] elementIds, Runnable callback)
      Reloads the content for the given element and all related elements.

      Parameters:
      elementIds - the element id's
      callback - the callback to execute after reloading
    • removeElement

      Removes the given container-page element.

      Parameters:
      element - the element
    • removeElement

      Removes the given container-page element.

      Parameters:
      element - the element
      removeMode - 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 replace
      elementId - the id of the replacing content
      callback - the callback to execute after replacing the element
    • resetEditableListButtons

      public void resetEditableListButtons()
      Shows list collector direct edit buttons (old direct edit style), if present.

    • resetPage

      public void resetPage()
      Resets the container-page to it's previous state.

    • saveFavoriteList

      public void saveFavoriteList(List<String> clientIds)
      Saves the favorite list.

      Parameters:
      clientIds - the client id's of the list's elements
      See Also:
    • savePage

      public void savePage()
      Saves the current state of the container-page.

    • setActiveButton

      public void setActiveButton(I_CmsToolbarButton button)
      Sets the currently active tool-bar button.

      Parameters:
      button - the button
    • setEditButtonsVisible

      public void setEditButtonsVisible(boolean visible)
      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

      public void showPageOverlay()
      Shows a page overlay preventing user actions.

    • showPreview

      public void showPreview(int buttonLeft)
      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

      public void showPublishDialog()
      Shows the publish dialog.

    • transformSingleEntry

      public I_CmsContextMenuEntry transformSingleEntry(org.opencms.util.CmsUUID structureId, org.opencms.gwt.shared.CmsContextMenuEntryBean menuEntryBean)
      Description copied from class: A_CmsToolbarHandler
      Creates a single context menu entry from a context menu entry bean.

      Overrides:
      transformSingleEntry in class A_CmsToolbarHandler
      Parameters:
      structureId - the structure id of the resource
      menuEntryBean - the context menu entry bean
      Returns:
      the created context menu entry
      See Also:
    • unlockResource

      public void unlockResource(org.opencms.util.CmsUUID structureId)
      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, returns null 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 id
      action - 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
    • decorateMenuEntry

      protected void decorateMenuEntry(CmsContextMenuEntry entry, String name, boolean checked)
      Fills in label and checkbox of a menu entry.

      Parameters:
      entry - the menu entry
      name - the label
      checked - true if checkbox should be shown
    • getLockErrorMessage

      protected String getLockErrorMessage(org.opencms.gwt.shared.CmsLockInfo lockInfo)
      Helper method for getting the error message for a locking error.

      Parameters:
      lockInfo - the lock information
      Returns:
      the error message
    • getLockErrorTitle

      protected String getLockErrorTitle(org.opencms.gwt.shared.CmsLockInfo lockInfo)
      Helper method for getting the error message box title for a locking error.

      Parameters:
      lockInfo - the lock information
      Returns:
      the error message box title
    • openPublish

      protected void openPublish()
      Opens the publish dialog without changes check.

    • setElementView

      protected void setElementView(org.opencms.ade.containerpage.shared.CmsElementViewInfo elementView, Runnable nextAction)
      Sets the element view.

      Parameters:
      elementView - the element view
      nextAction - the action to execute after setting the view