Class CmsContainerpageController

java.lang.Object
org.opencms.ade.containerpage.client.CmsContainerpageController

public final class CmsContainerpageController extends Object
Data provider for the container-page editor. All data concerning the container-page is requested and maintained by this provider.

Since:
8.0.0
  • Field Details

  • Constructor Details

  • Method Details

    • get

      Returns the data provider instance.

      Returns:
      the data provider
    • getCurrentUri

      public static String getCurrentUri()
      Returns the current URI.

      Returns:
      the current URI
    • getServerId

      public static String getServerId(String clientId)
      Returns the server id for a given client element id.

      Parameters:
      clientId - the client id including an optional element settings hash
      Returns:
      the server id
    • isConfirmRemove

      public static boolean isConfirmRemove()
      Checks whether element removal should be confirmed.

      Returns:
      true if element removal should be confirmed
    • addContainerpageEventHandler

      Adds a handler for container page events.

      Parameters:
      handler - the handler to add
    • addToFavoriteList

      public void addToFavoriteList(String clientId)
      Adds an element specified by it's id to the favorite list.

      Parameters:
      clientId - the element id
    • addToRecentList

      public void addToRecentList(String clientId, Runnable nextAction)
      Adds an element specified by it's id to the recent list.

      Parameters:
      clientId - the element id
      nextAction - the action to execute after the element has been added
    • checkNewWidgetsAvailable

      public void checkNewWidgetsAvailable(org.opencms.util.CmsUUID structureId, com.google.gwt.user.client.rpc.AsyncCallback<Boolean> resultCallback)
      Checks whether GWT widgets are available for all fields of a content.

      Parameters:
      structureId - the structure id of the content
      resultCallback - the callback for the result
    • checkReuse

      public void checkReuse(CmsContainerPageElementPanel elementWidget, Runnable action)
      Checks reuse status of a container element, then shows a warning dialog if it is reused, and finally executes an action.
      Parameters:
      elementWidget - the container element for which to check the reuse status
      action - the action to execute after the reuse warning dialog is closed
    • cleanUpContainers

      public void cleanUpContainers()
      Checks for container elements that are no longer present within the DOM.

    • copyElement

      public void copyElement(String id, I_CmsSimpleCallback<org.opencms.util.CmsUUID> callback)
      Copies an element and asynchronously returns the structure id of the copy.

      Parameters:
      id - the element id
      callback - the callback for the result
    • createAndEditNewElement

      public void createAndEditNewElement(CmsContainerPageElementPanel element, boolean inline)
      Creates a new resource for crag container elements with the status new and opens the content editor.

      Parameters:
      element - the container element
      inline - true to open the inline editor for the given element if available
    • createAndEditNewElement

      public void createAndEditNewElement(CmsContainerPageElementPanel element, org.opencms.util.CmsUUID modelResourceStructureId)
      Creates a new resource for drag container elements with the status new and opens the content editor.

      Parameters:
      element - the container element
      modelResourceStructureId - the model resource structure id
    • createEventDetails

      Creates the details object for a custom page editor event based on the given container page element.
      Parameters:
      widget - a container page element
      Returns:
      the event details object
    • createNewElement

      public void createNewElement(CmsContainerPageElementPanel element, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.ade.containerpage.shared.CmsContainerElement> callback)
      Creates a new element.

      Parameters:
      element - the widget belonging to the element which is currently in memory only
      callback - the callback to call with the result
    • deleteElement

      public void deleteElement(String elementId, String relatedElementId)
      Deletes an element from the VFS, removes it from all containers and the client side cache.

      Parameters:
      elementId - the element to delete
      relatedElementId - related element to reload after the element has been deleted
    • disableInlineEditing

      Disables the inline editing for all content elements but the given one.

      Parameters:
      notThisOne - the content element not to disable
    • 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
    • executeCopyModelReplace

      public void executeCopyModelReplace(String originalElementId, com.google.gwt.dom.client.Element modelGroupParent, org.opencms.ade.containerpage.shared.CmsContainerElementData elementData)
      Replaces all element instances of the original element with the new element within the former copy model.

      Parameters:
      originalElementId - the original element id
      modelGroupParent - the model group parent element
      elementData - the replace element data
    • fireEvent

      public void fireEvent(CmsContainerpageEvent event)
      Fires an event on the core event bus.

      Parameters:
      event - the event to fire
    • getAllDragElements

      Returns all drag elements of the page.

      Returns:
      the drag elements
    • getCachedElement

      public org.opencms.ade.containerpage.shared.CmsContainerElementData getCachedElement(String clientId)
      Returns the data for the requested element, or null if the element has not been cached yet.

      Parameters:
      clientId - the element id
      Returns:
      the element data
    • getCachedNewElement

      public org.opencms.ade.containerpage.shared.CmsContainerElementData getCachedNewElement(String resourceTypeName)
      Returns the data for the requested element, or null if the element has not been cached yet.

      Parameters:
      resourceTypeName - the element resource type
      Returns:
      the element data
    • getContainer

      public org.opencms.ade.containerpage.shared.CmsContainer getContainer(String containerName)
      Returns the container data of container with the given name.
      Parameters:
      containerName - the container name
      Returns:
      the container data
    • getContainerElementWidgetForElement

      public com.google.common.base.Optional<CmsContainerPageElementPanel> getContainerElementWidgetForElement(com.google.gwt.dom.client.Element element)
      Gets the container element widget to which the given element belongs, or Optional.absent if none could be found.

      Parameters:
      element - the element for which the container element widget should be found
      Returns:
      the container element widget, or Optional.absent if none can be found
    • getContainerInfoForGalleries

      public org.opencms.gwt.shared.CmsGalleryContainerInfo getContainerInfoForGalleries()
      Gets the container info to send to the gallery service.
      Returns:
      the container info to send to the gallery service
    • getContainerpageService

      public org.opencms.ade.containerpage.shared.rpc.I_CmsContainerpageServiceAsync getContainerpageService()
      Returns the container-page RPC service.

      Returns:
      the container-page service
    • getContainerpageUtil

      Returns:
      the containerpage-util
    • getContainers

      public Map<String,org.opencms.ade.containerpage.shared.CmsContainer> getContainers()
      Returns the containers.

      Returns:
      the containers
    • getContainerTarget

      Returns the container drag target by name (HTML id attribute).

      Parameters:
      containerName - the container name
      Returns:
      the drag target
    • getContainerTargets

      Returns a map of the container drag targets.

      Returns:
      the drag targets
    • getContainerType

      public String getContainerType(String containerName)
      Returns the type of container with the given name.

      Parameters:
      containerName - the container name
      Returns:
      the container type
    • getContentEditorHandler

      Returns the XML content editor handler.

      Returns:
      the XML content editor handler
    • getData

      public org.opencms.ade.containerpage.shared.CmsCntPageData getData()
      Returns the prefetched data.

      Returns:
      the prefetched data
    • getDeleteOptions

      public void getDeleteOptions(String clientId, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsDialogOptionsAndInfo> callback)
      Returns the delete options for the given content element.

      Parameters:
      clientId - the content id
      callback - the callback to execute
    • getDndController

      Gets the DND controller.

      Returns:
      the DND controller
    • getDndHandler

      Returns the drag and drop handler.

      Returns:
      the drag and drop handler
    • getEditOptions

      public void getEditOptions(String clientId, boolean isListElement, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsDialogOptionsAndInfo> callback)
      Returns the edit options for the given content element.

      Parameters:
      clientId - the content id
      isListElement - in case a list element, not a container element is about to be edited
      callback - the callback to execute
    • getElementForDragAndDropFromContainer

      public void getElementForDragAndDropFromContainer(String clientId, String containerId, boolean alwaysCopy, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsContainerElementData> callback)
      Requests the data for a container element specified by the client id for drag and drop from a container. The data will be provided to the given call-back function.

      Parameters:
      clientId - the element id
      containerId - the id of the container from which the element is being dragged
      alwaysCopy - true in case reading data for a clipboard element used as a copy group
      callback - the call-back to execute with the requested data
    • getElements

      public void getElements(Set<String> clientIds, I_CmsSimpleCallback<Map<String,org.opencms.ade.containerpage.shared.CmsContainerElementData>> callback)
      Requests the data for container elements specified by the client id. The data will be provided to the given call-back function.

      Parameters:
      clientIds - the element id's
      callback - the call-back to execute with the requested data
    • getElementSettingsConfig

      public void getElementSettingsConfig(String clientId, String containerId, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsElementSettingsConfig> callback)
      Requests the element settings config data for a container element specified by the client id. The data will be provided to the given call-back function.

      Parameters:
      clientId - the element id
      containerId - the parent container id
      callback - the call-back to execute with the requested data
    • getElementView

      public org.opencms.ade.containerpage.shared.CmsElementViewInfo getElementView()
      Returns the current element view.

      Returns:
      the current element view
    • getElementWithSettings

      public void getElementWithSettings(String clientId, Map<String,String> settings, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsContainerElementData> callback)
      Retrieves a container element with a given set of settings.

      Parameters:
      clientId - the id of the container element
      settings - the set of settings
      callback - the callback which should be executed when the element has been loaded
    • getGroupcontainer

      Returns the group-container element being edited.

      Returns:
      the group-container
    • getGroupcontainerId

      Returns the id of the currently edited group-container.

      Returns:
      the group-container id, or null if no editing is taking place
    • getHandler

      Returns the container-page handler.

      Returns:
      the container-page handler
    • getLoadTime

      public long getLoadTime()
      Returns the time off page load.

      Returns:
      the time stamp
    • getLockErrorMessage

      Gets the lock error message.

      Returns:
      the lock error message
    • getModelGroupElementId

      Returns the model group base element id.

      Returns:
      the model group base element id
    • getModelGroups

      Collects all container elements which are model groups.

      Returns:
      the list of model group container elements
    • getNewElement

      public void getNewElement(String resourceType, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsContainerElementData> callback)
      Returns the element data for a resource type representing a new element.

      Parameters:
      resourceType - the resource type name
      callback - the callback to execute with the new element data
    • getNewOptions

      public void getNewOptions(String clientId, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsDialogOptionsAndInfo> callback)
      Fetches the options for creating a new element from the edit handler.

      Parameters:
      clientId - the client id of the element
      callback - the callback which is called with the result
    • getReturnCode

      Produces the "return code", which is needed to return to the current page from the sitemap.

      Returns:
      the return code
    • getSerializedContainer

      public org.opencms.ade.containerpage.shared.CmsContainer getSerializedContainer(String data) throws com.google.gwt.user.client.rpc.SerializationException
      Returns the deserialized element data.

      Parameters:
      data - the data to deserialize
      Returns:
      the container element
      Throws:
      com.google.gwt.user.client.rpc.SerializationException - if deserialization fails
    • getSerializedElement

      public org.opencms.ade.containerpage.shared.CmsContainerElement getSerializedElement(String data) throws com.google.gwt.user.client.rpc.SerializationException
      Returns the deserialized element data.

      Parameters:
      data - the data to deserialize
      Returns:
      the container element
      Throws:
      com.google.gwt.user.client.rpc.SerializationException - if deserialization fails
    • getSmallElementsHandler

      Gets the handler for small elements.

      Returns:
      the small elements handler
    • getView

      public org.opencms.ade.containerpage.shared.CmsElementViewInfo getView(String value)
      Gets the view with the given id.

      Parameters:
      value - the view id as a string
      Returns:
      the view with the given id, or null if no such view is available
    • handleChangeTemplateContext

      Handler that gets called when the template context setting of an element was changed by the user.

      Parameters:
      element - the element whose template context setting was changed
      newValue - the new value of the setting
    • handleConfirmRemove

      Asks the user for confirmation before removing a container page element.

      Parameters:
      element - the element for which the user should confirm the removal
    • handleDelete

      public void handleDelete(String clientId, String deleteOption, I_CmsSimpleCallback<Void> callback)
      Calls the edit handler to handle the delete action.

      Parameters:
      clientId - the content client id
      deleteOption - the selected delete option
      callback - the callback to execute after the delete
    • hasActiveSelection

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

      Returns:
      true if the selection button is active
    • hasPageChanged

      public boolean hasPageChanged()
      Returns if the page has changed.

      Returns:
      true if the page has changed
    • hideEditableListButtons

      public void hideEditableListButtons()
      Hides list collector direct edit buttons, if present.

    • init

      public void init(CmsContainerpageHandler handler, CmsDNDHandler dndHandler, CmsContentEditorHandler contentEditorHandler, CmsContainerpageUtil containerpageUtil)
      Initializes the controller.

      Parameters:
      handler - the container-page handler
      dndHandler - the drag and drop handler
      contentEditorHandler - the XML content editor handler
      containerpageUtil - the container-page utility
    • initializeSubContainers

      public void initializeSubContainers(CmsContainerPageElementPanel containerElement)
      Checks for element sub containers.

      Parameters:
      containerElement - the container element
    • isContainerEditable

      public boolean isContainerEditable(I_CmsDropContainer dragParent)
      Returns if the given container is editable.

      Parameters:
      dragParent - the parent container
      Returns:
      true if the given container is editable
    • isContentEditing

      public boolean isContentEditing()
      Returns the flag indicating that a content element is being edited.

      Returns:
      the flag indicating that a content element is being edited
    • isDetailPage

      public boolean isDetailPage()
      Returns if this page displays a detail view.

      Returns:
      true if this page displays a detail view
    • isEditingDisabled

      public boolean isEditingDisabled()
      Checks if the page editing features should be disabled.

      Returns:
      true if the page editing features should be disabled
    • isGroupcontainerEditing

      public boolean isGroupcontainerEditing()
      Returns if a group-container is currently being edited.

      Returns:
      true if a group-container is being edited
    • isInlineEditable

      public boolean isInlineEditable(CmsContainerPageElementPanel element, I_CmsDropContainer dragParent)
      Checks whether the given element should be inline editable.

      Parameters:
      element - the element
      dragParent - the element parent
      Returns:
      true if the element should be inline editable
    • leaveUnsaved

      public void leaveUnsaved(String targetUri)
      Method to leave the page without saving.

      Parameters:
      targetUri - the new URI to call
    • loadContextMenu

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

      Parameters:
      structureId - the structure id of the resource to get the context menu entries for
      context - the ade context (sitemap or containerpae)
    • loadFavorites

      public void loadFavorites(I_CmsSimpleCallback<List<org.opencms.ade.containerpage.shared.CmsContainerElementData>> callback)
      Loads the favorite list and adds the elements to the favorite list widget of the tool-bar menu.

      Parameters:
      callback - the call-back to execute with the result data
    • loadRecent

      public void loadRecent(I_CmsSimpleCallback<List<org.opencms.ade.containerpage.shared.CmsContainerElementData>> callback)
      Loads the recent list and adds the elements to the recent list widget of the tool-bar menu.

      Parameters:
      callback - the call-back to execute with the result data
    • lockContainerpage

      Locks the container-page.

      Parameters:
      callback - the callback to execute
    • matchRootView

      public boolean matchRootView(org.opencms.util.CmsUUID viewIdFromElement)
      Returns true if the view with the given view id and the current view have the same root view.

      Parameters:
      viewIdFromElement - the id of a view
      Returns:
      true if the root view of the id matches the root view of the current view
    • onLockFail

      public void onLockFail(String lockError)
      This method should be called when locking the page has failed.

      Parameters:
      lockError - the locking information
    • onLockSuccess

      public void onLockSuccess()
      This method should be called when locking the page has succeeded.

    • onWindowClose

      public void onWindowClose()
      Handler which is executed when the window closes.

    • prepareForEdit

      public void prepareForEdit(String clientId, String editOption, I_CmsSimpleCallback<org.opencms.util.CmsUUID> callback)
      Calls the edit handler to prepare the given content element for editing.

      Parameters:
      clientId - the element id
      editOption - the selected edit option
      callback - the callback to execute
    • reinitializeButtons

      public void reinitializeButtons()
      Reinitializes the buttons in the container element menus.

    • reInitInlineEditing

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

    • reloadElements

      Reloads the content for the given elements and related elements.
      Parameters:
      ids - the element ids
      callback - the callback to execute after the reload
    • reloadElements

      public void reloadElements(Collection<String> ids, Runnable callback)
      Reloads the content for the given elements and related elements.
      Parameters:
      ids - the element ids
      callback - the callback to execute after the reload
    • reloadElements

      Reloads the content for the given element and all related elements.

      Call this if the element content has changed.

      Parameters:
      ids - the element ids
      callback - the callback to execute after the reload
    • reloadElements

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

      Call this if the element content has changed.

      Parameters:
      ids - the element ids
      callback - the callback to execute after the reload
    • reloadElementWithSettings

      Reloads a container page element with a new set of settings.

      Parameters:
      elementWidget - the widget of the container page element which should be reloaded
      clientId - the id of the container page element which should be reloaded
      settings - the new set of settings
      reloadHandler - the handler to call with the reloaded element
    • reloadPage

      public void reloadPage()
      Reloads the page.

    • removeElement

      public void removeElement(CmsContainerPageElementPanel dragElement)
      Removes the given container element from its parent container.

      Parameters:
      dragElement - the element to remove
    • removeElement

      Removes the given container element from its parent container.

      Parameters:
      dragElement - the element to remove
      removeMode - the remove mode
    • replaceContainerElement

      public CmsContainerPageElementPanel replaceContainerElement(CmsContainerPageElementPanel containerElement, org.opencms.ade.containerpage.shared.CmsContainerElementData elementData) throws Exception
      Replaces the given drag-element with the given container element.

      Parameters:
      containerElement - the container element to replace
      elementData - the new element data
      Returns:
      the container element which replaced the old one
      Throws:
      Exception - if something goes wrong
    • replaceElement

      Replaces the given element with another content while keeping it's settings.

      Parameters:
      elementWidget - the element to replace
      elementId - the id of the replacing content
      callback - the callback to execute after the element is replaced
    • replaceElement

      public void replaceElement(CmsContainerPageElementPanel elementWidget, String elementId, Runnable callback)
      Replaces the given element with another content while keeping it's settings.

      Parameters:
      elementWidget - the element to replace
      elementId - the id of the replacing content
      callback - the callback to execute after the element is replaced
    • requiresOptionBar

      public boolean requiresOptionBar(CmsContainerPageElementPanel element, I_CmsDropContainer dragParent)
      Checks whether the given element should display the option bar.

      Parameters:
      element - the element
      dragParent - the element parent
      Returns:
      true if the given element should display the option bar
    • resetEditButtons

      public void resetEditButtons()
      Resets all edit buttons an there positions.

    • resetPage

      public void resetPage()
      Resets the container-page.

    • saveAndLeave

      public void saveAndLeave(com.google.gwt.user.client.Command leaveCommand)
      Method to save and leave the page.

      Parameters:
      leaveCommand - the command to execute to leave the page
    • saveAndLeave

      public void saveAndLeave(String targetUri)
      Method to save and leave the page.

      Parameters:
      targetUri - the new URI to call
    • saveClipboardTab

      public void saveClipboardTab(int tabIndex)
      Saves the clipboard tab index selected by the user.

      Parameters:
      tabIndex - the tab index
    • saveContainerpage

      public void saveContainerpage(Runnable... afterSaveActions)
      Saves the current state of the container-page.

      Parameters:
      afterSaveActions - the actions to execute after saving
    • saveFavoriteList

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

      Parameters:
      clientIds - the client id's of the list's elements
    • saveGroupcontainer

      public void saveGroupcontainer(org.opencms.ade.containerpage.shared.CmsGroupContainer groupContainer, CmsGroupContainerElementPanel groupContainerElement)
      Saves the group-container.

      Parameters:
      groupContainer - the group-container data to save
      groupContainerElement - the group-container widget
    • saveInheritContainer

      public void saveInheritContainer(org.opencms.ade.containerpage.shared.CmsInheritanceContainer inheritanceContainer, CmsGroupContainerElementPanel groupContainerElement)
      Saves the inheritance container.

      Parameters:
      inheritanceContainer - the inheritance container data to save
      groupContainerElement - the group container widget
    • sendDragFinished

      public void sendDragFinished(com.google.gwt.dom.client.Element dragElement, com.google.gwt.dom.client.Element target, boolean isNew)
      Sends the ocDragFinished event.
      Parameters:
      dragElement - the drag element
      target - the target element
      isNew - true if the dragged element is new
    • sendDragStarted

      public void sendDragStarted(boolean isNew)
      Sends the ocDragStarted event.
      Parameters:
      isNew - true if the user started dragging a new element
    • sendElementAdded

      Sends the custom 'ocElementAdded' event for added container elements.
      Parameters:
      widget - the container element
    • sendElementDeleted

      Sends the custom 'ocElementDeleted' event for a deleted container element.
      Parameters:
      details - the event details
    • sendElementEditedContent

      public void sendElementEditedContent(CmsContainerPageElementPanel widget, elemental2.dom.Element replacedElement, boolean wasNew)
      Sends the custom 'ocElementEditedContent' event for an edited container element.
      Parameters:
      widget - the container element
      replacedElement - the element that was formerly on the page before the user edited it
      wasNew - true if the element was a new element before editing
    • sendElementEditedSettings

      Sends the custom 'ocElementEditedSettings' event for an edited container element.
      Parameters:
      widget - the container element
      replacedWidget - the former container element that has now been replaced with 'widget'
    • sendElementMoved

      Sends the custom 'ocElementMoved' event for a moved container element.
      Parameters:
      widget - the container element
    • setContentEditing

      public void setContentEditing(boolean isContentEditing)
      Sets the flag indicating that a content element is being edited.

      Parameters:
      isContentEditing - the flag indicating that a content element is being edited
    • setDndController

      Sets the DND controller.

      Parameters:
      dnd - the new DND controller
    • setElementView

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

      Parameters:
      viewInfo - the element view
      nextAction - the action to execute after setting the view
    • setModelGroupElementId

      public void setModelGroupElementId(String modelGroupElementId)
      Sets the model group base element id.

      Parameters:
      modelGroupElementId - the model group base element id
    • setPageChanged

      public void setPageChanged(Runnable... nextActions)
      Marks the page as changed.

      Parameters:
      nextActions - the actions to perform after the page has been marked as changed
    • setPreviewHandler

      public void setPreviewHandler(com.google.gwt.user.client.Event.NativePreviewHandler handler)
      Sets an alternative event preview handler.
      Parameters:
      handler - the alternative preview handler to use
    • shouldShowInContext

      public boolean shouldShowInContext(org.opencms.ade.containerpage.shared.CmsContainerElementData elementData)
      Method to determine whether a container element should be shown in the current template context.

      Parameters:
      elementData - the element data
      Returns:
      true if the element should be shown
    • startEditingGroupcontainer

      public void startEditingGroupcontainer(CmsGroupContainerElementPanel groupContainer, boolean isElementGroup)
      Tells the controller that group-container editing has started.

      Parameters:
      groupContainer - the group container
      isElementGroup - true if the group container is an element group and not an inheritance group
    • startPublishLockCheck

      public void startPublishLockCheck()
      Starts the publish lock check.
    • stopEditingGroupcontainer

      Tells the controller that group-container editing has stopped.

    • unlockResource

      public boolean unlockResource(org.opencms.util.CmsUUID structureId)
      Unlocks the given resource.

      Parameters:
      structureId - the structure id of the resource to unlock
      Returns:
      true if the resource was unlocked successfully
    • updateButtonsForCurrentView

      Updates he
    • addElements

      protected void addElements(List<org.opencms.ade.containerpage.shared.CmsContainerElementData> elements)
      Adds the given element data to the element cache.

      Parameters:
      elements - the element data
    • addElements

      protected void addElements(Map<String,org.opencms.ade.containerpage.shared.CmsContainerElementData> elements)
      Adds the given element data to the element cache.

      Parameters:
      elements - the element data
    • askWhetherRemovedElementShouldBeDeleted

      protected void askWhetherRemovedElementShouldBeDeleted(org.opencms.ade.containerpage.shared.CmsRemovedElementStatus status)
      Asks the user whether an element which has been removed should be deleted.

      Parameters:
      status - the status of the removed element
    • checkReferencesToRemovedElement

      Checks that a removed can be possibly deleted and if so, asks the user if it should be deleted.

      Parameters:
      id - the client id of the element
    • deactivateOnClosing

      protected void deactivateOnClosing()
      Disables option and toolbar buttons.

    • getAllContainerPageElements

      protected List<CmsContainerPageElementPanel> getAllContainerPageElements(boolean includeGroupContents)
      Helper method to get all current container page elements.

      Parameters:
      includeGroupContents - true if the contents of group containers should also be included
      Returns:
      the list of current container page elements
    • getCoreService

      protected org.opencms.gwt.shared.rpc.I_CmsCoreServiceAsync getCoreService()
      Returns the core RPC service.

      Returns:
      the core service
    • getGroupEditor

      Returns the currently active group editor.

      Returns:
      the currently active group editor
    • getLocale

      protected String getLocale()
      Returns the content locale.

      Returns:
      the content locale
    • getPageContent

      protected List<org.opencms.ade.containerpage.shared.CmsContainer> getPageContent()
      Gets the page content for purposes of saving.

      Returns:
      the page content
    • getPageState

      protected List<org.opencms.ade.containerpage.shared.CmsContainer> getPageState()
      Returns the containers of the page in their current state.

      Returns:
      the containers of the page
    • getRequestParams

      protected String getRequestParams()
      Returns the request parameters of the displayed container-page.

      Returns:
      the request parameters
    • hasNestedContainers

      protected boolean hasNestedContainers()
      Checks if any of the containers are nested containers.

      Returns:
      true if there are nested containers
    • isRootContainer

      protected boolean isRootContainer(org.opencms.ade.containerpage.shared.CmsContainer container)
      Returns whether the given container is considered a root container.

      Parameters:
      container - the container to check
      Returns:
      true if the given container is a root container
    • openEditorForNewElement

      protected void openEditorForNewElement(CmsContainerPageElementPanel element, org.opencms.ade.containerpage.shared.CmsContainerElement newElementData, boolean inline)
      Opens the editor for the newly created element.

      Parameters:
      element - the container element
      newElementData - the new element data
      inline - true to open the inline editor for the given element if available
    • previewNativeEvent

      protected void previewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event)
      Previews events. Shows the leaving page dialog, if the page has changed and an anchor has been clicked.

      Also triggers an element view change on 'Ctrl+E'.

      Parameters:
      event - the native event
    • processPageContent

      Iterates over all the container contents and calls a visitor object with the visited containers/elements as parameters.
      Parameters:
      visitor - the visitor which the container elements should be passed to
    • removeContainerElements

      protected void removeContainerElements(String resourceId)
      Removes all container elements with the given id from all containers and the client side cache.

      Parameters:
      resourceId - the resource id
    • scheduleGalleryUpdate

      protected void scheduleGalleryUpdate()
      Schedules an update of the gallery data according to the current element view and the editable containers.

    • setPageChanged

      protected void setPageChanged(boolean changed, boolean unlock)
      Sets the page changed flag and initializes the window closing handler if necessary.

      Parameters:
      changed - if true the page has changed
      unlock - if true the page will be unlocked for unchanged pages
    • unlockContainerpage

      protected void unlockContainerpage()
      Asynchronously unlocks the container page.