Class CmsContainerpageController
java.lang.Object
org.opencms.ade.containerpage.client.CmsContainerpageController
Data provider for the container-page editor. All data concerning the container-page is requested and maintained by this provider.
- Since:
- 8.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum which is used to control how elements are removed from the page.static interfaceWrapper for the event details object for custom page editor events.static interfaceVisitor interface used to process the current container content on the page.static interfaceInterface for classes that should be notified when container page elements are reloaded.protected classVisitor implementation which is used to gather the container contents for saving.static classThis visitor implementation checks whether there are other elements in the current page which correspond to the same VFS resource as a given container element.protected classVisitor implementation which is used to gather the container contents for saving. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe client side id/setting-hash seperator.static final StringCustom event name.static final StringCustom event name.static final StringCustom event name.static final StringCustom event name.static final StringCustom event name.static final StringCustom event name.static final StringCustom event name.static final StringCustom event name.static final StringCustom event name.static final StringCustom event name.The container element data.The new element data by resource type name.static final StringCSS class on the body to signal whether we are currently editing a group container.static final StringParameter name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a handler for container page events.protected voidaddElements(List<org.opencms.ade.containerpage.shared.CmsContainerElementData> elements) Adds the given element data to the element cache.protected voidaddElements(Map<String, org.opencms.ade.containerpage.shared.CmsContainerElementData> elements) Adds the given element data to the element cache.voidaddToFavoriteList(String clientId) Adds an element specified by it's id to the favorite list.voidaddToRecentList(String clientId, Runnable nextAction) Adds an element specified by it's id to the recent list.protected voidaskWhetherRemovedElementShouldBeDeleted(org.opencms.ade.containerpage.shared.CmsRemovedElementStatus status) Asks the user whether an element which has been removed should be deleted.voidcheckNewWidgetsAvailable(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.protected voidChecks that a removed can be possibly deleted and if so, asks the user if it should be deleted.voidcheckReuse(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.voidChecks for container elements that are no longer present within the DOM.voidcopyElement(String id, I_CmsSimpleCallback<org.opencms.util.CmsUUID> callback) Copies an element and asynchronously returns the structure id of the copy.voidcreateAndEditNewElement(CmsContainerPageElementPanel element, boolean inline) Creates a new resource for crag container elements with the status new and opens the content editor.voidcreateAndEditNewElement(CmsContainerPageElementPanel element, org.opencms.util.CmsUUID modelResourceStructureId) Creates a new resource for drag container elements with the status new and opens the content editor.Creates the details object for a custom page editor event based on the given container page element.voidcreateNewElement(CmsContainerPageElementPanel element, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.ade.containerpage.shared.CmsContainerElement> callback) Creates a new element.protected voidDisables option and toolbar buttons.voiddeleteElement(String elementId, String relatedElementId) Deletes an element from the VFS, removes it from all containers and the client side cache.voiddisableInlineEditing(CmsContainerPageElementPanel notThisOne) Disables the inline editing for all content elements but the given one.voidenableFavoriteEditing(boolean enable, I_CmsDNDController dndController) Enables the favorites editing drag and drop controller.voidexecuteCopyModelReplace(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.voidfireEvent(CmsContainerpageEvent event) Fires an event on the core event bus.static CmsContainerpageControllerget()Returns the data provider instance.protected List<CmsContainerPageElementPanel> getAllContainerPageElements(boolean includeGroupContents) Helper method to get all current container page elements.Returns all drag elements of the page.org.opencms.ade.containerpage.shared.CmsContainerElementDatagetCachedElement(String clientId) Returns the data for the requested element, ornullif the element has not been cached yet.org.opencms.ade.containerpage.shared.CmsContainerElementDatagetCachedNewElement(String resourceTypeName) Returns the data for the requested element, ornullif the element has not been cached yet.org.opencms.ade.containerpage.shared.CmsContainergetContainer(String containerName) Returns the container data of container with the given name.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.org.opencms.gwt.shared.CmsGalleryContainerInfoGets the container info to send to the gallery service.org.opencms.ade.containerpage.shared.rpc.I_CmsContainerpageServiceAsyncReturns the container-page RPC service.Returns theCmsContainerpageUtil.Returns the containers.getContainerTarget(String containerName) Returns the container drag target by name (HTML id attribute).Returns a map of the container drag targets.getContainerType(String containerName) Returns the type of container with the given name.Returns the XML content editor handler.protected org.opencms.gwt.shared.rpc.I_CmsCoreServiceAsyncReturns the core RPC service.static StringReturns the current URI.org.opencms.ade.containerpage.shared.CmsCntPageDatagetData()Returns the prefetched data.voidgetDeleteOptions(String clientId, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsDialogOptionsAndInfo> callback) Returns the delete options for the given content element.Gets the DND controller.Returns the drag and drop handler.voidgetEditOptions(String clientId, boolean isListElement, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsDialogOptionsAndInfo> callback) Returns the edit options for the given content element.voidgetElementForDragAndDropFromContainer(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.voidgetElements(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.voidgetElementSettingsConfig(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.org.opencms.ade.containerpage.shared.CmsElementViewInfoReturns the current element view.voidgetElementWithSettings(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.Returns the group-container element being edited.Returns the id of the currently edited group-container.protected A_CmsGroupEditorReturns the currently active group editor.Returns the container-page handler.longReturns the time off page load.protected StringReturns the content locale.Gets the lock error message.Returns the model group base element id.Collects all container elements which are model groups.voidgetNewElement(String resourceType, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsContainerElementData> callback) Returns the element data for a resource type representing a new element.voidgetNewOptions(String clientId, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsDialogOptionsAndInfo> callback) Fetches the options for creating a new element from the edit handler.protected List<org.opencms.ade.containerpage.shared.CmsContainer> Gets the page content for purposes of saving.protected List<org.opencms.ade.containerpage.shared.CmsContainer> Returns the containers of the page in their current state.protected StringReturns the request parameters of the displayed container-page.Produces the "return code", which is needed to return to the current page from the sitemap.org.opencms.ade.containerpage.shared.CmsContainergetSerializedContainer(String data) Returns the deserialized element data.org.opencms.ade.containerpage.shared.CmsContainerElementgetSerializedElement(String data) Returns the deserialized element data.static StringgetServerId(String clientId) Returns the server id for a given client element id.Gets the handler for small elements.org.opencms.ade.containerpage.shared.CmsElementViewInfoGets the view with the given id.voidhandleChangeTemplateContext(CmsContainerPageElementPanel element, String newValue) Handler that gets called when the template context setting of an element was changed by the user.voidAsks the user for confirmation before removing a container page element.voidhandleDelete(String clientId, String deleteOption, I_CmsSimpleCallback<Void> callback) Calls the edit handler to handle the delete action.booleanReturns if the selection button is active.protected booleanChecks if any of the containers are nested containers.booleanReturns if the page has changed.voidHides list collector direct edit buttons, if present.voidinit(CmsContainerpageHandler handler, CmsDNDHandler dndHandler, CmsContentEditorHandler contentEditorHandler, CmsContainerpageUtil containerpageUtil) Initializes the controller.voidinitializeSubContainers(CmsContainerPageElementPanel containerElement) Checks for element sub containers.static booleanChecks whether element removal should be confirmed.booleanisContainerEditable(I_CmsDropContainer dragParent) Returns if the given container is editable.booleanReturns the flag indicating that a content element is being edited.booleanReturns if this page displays a detail view.booleanChecks if the page editing features should be disabled.booleanReturns if a group-container is currently being edited.booleanisInlineEditable(CmsContainerPageElementPanel element, I_CmsDropContainer dragParent) Checks whether the given element should be inline editable.protected booleanisRootContainer(org.opencms.ade.containerpage.shared.CmsContainer container) Returns whether the given container is considered a root container.voidleaveUnsaved(String targetUri) Method to leave the page without saving.voidloadContextMenu(org.opencms.util.CmsUUID structureId, org.opencms.gwt.shared.CmsCoreData.AdeContext context) Loads the context menu entries.voidloadFavorites(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.voidloadRecent(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.voidlockContainerpage(I_CmsSimpleCallback<Boolean> callback) Locks the container-page.booleanmatchRootView(org.opencms.util.CmsUUID viewIdFromElement) Returns true if the view with the given view id and the current view have the same root view.voidonLockFail(String lockError) This method should be called when locking the page has failed.voidThis method should be called when locking the page has succeeded.voidHandler which is executed when the window closes.protected voidopenEditorForNewElement(CmsContainerPageElementPanel element, org.opencms.ade.containerpage.shared.CmsContainerElement newElementData, boolean inline) Opens the editor for the newly created element.voidprepareForEdit(String clientId, String editOption, I_CmsSimpleCallback<org.opencms.util.CmsUUID> callback) Calls the edit handler to prepare the given content element for editing.protected voidpreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event) Previews events.protected voidIterates over all the container contents and calls a visitor object with the visited containers/elements as parameters.voidReinitializes the buttons in the container element menus.voidRe-initializes the inline editing.voidreloadElements(String[] ids, Runnable callback) Reloads the content for the given element and all related elements.voidreloadElements(String[] ids, CmsContainerpageController.I_ReloadHandler callback) Reloads the content for the given element and all related elements.voidreloadElements(Collection<String> ids, Runnable callback) Reloads the content for the given elements and related elements.voidreloadElements(Collection<String> ids, CmsContainerpageController.I_ReloadHandler callback) Reloads the content for the given elements and related elements.voidreloadElementWithSettings(CmsContainerPageElementPanel elementWidget, String clientId, Map<String, String> settings, CmsContainerpageController.I_ReloadHandler reloadHandler) Reloads a container page element with a new set of settings.voidReloads the page.protected voidremoveContainerElements(String resourceId) Removes all container elements with the given id from all containers and the client side cache.voidremoveElement(CmsContainerPageElementPanel dragElement) Removes the given container element from its parent container.voidremoveElement(CmsContainerPageElementPanel dragElement, CmsContainerpageController.ElementRemoveMode removeMode) Removes the given container element from its parent container.replaceContainerElement(CmsContainerPageElementPanel containerElement, org.opencms.ade.containerpage.shared.CmsContainerElementData elementData) Replaces the given drag-element with the given container element.voidreplaceElement(CmsContainerPageElementPanel elementWidget, String elementId, Runnable callback) Replaces the given element with another content while keeping it's settings.voidreplaceElement(CmsContainerPageElementPanel elementWidget, String elementId, CmsContainerpageController.I_ReloadHandler handler) Replaces the given element with another content while keeping it's settings.booleanrequiresOptionBar(CmsContainerPageElementPanel element, I_CmsDropContainer dragParent) Checks whether the given element should display the option bar.voidResets all edit buttons an there positions.voidResets the container-page.voidsaveAndLeave(com.google.gwt.user.client.Command leaveCommand) Method to save and leave the page.voidsaveAndLeave(String targetUri) Method to save and leave the page.voidsaveClipboardTab(int tabIndex) Saves the clipboard tab index selected by the user.voidsaveContainerpage(Runnable... afterSaveActions) Saves the current state of the container-page.voidsaveFavoriteList(List<String> clientIds) Saves the favorite list.voidsaveGroupcontainer(org.opencms.ade.containerpage.shared.CmsGroupContainer groupContainer, CmsGroupContainerElementPanel groupContainerElement) Saves the group-container.voidsaveInheritContainer(org.opencms.ade.containerpage.shared.CmsInheritanceContainer inheritanceContainer, CmsGroupContainerElementPanel groupContainerElement) Saves the inheritance container.protected voidSchedules an update of the gallery data according to the current element view and the editable containers.voidsendDragFinished(com.google.gwt.dom.client.Element dragElement, com.google.gwt.dom.client.Element target, boolean isNew) Sends the ocDragFinished event.voidsendDragStarted(boolean isNew) Sends the ocDragStarted event.voidSends the custom 'ocElementAdded' event for added container elements.voidSends the custom 'ocElementDeleted' event for a deleted container element.voidsendElementEditedContent(CmsContainerPageElementPanel widget, elemental2.dom.Element replacedElement, boolean wasNew) Sends the custom 'ocElementEditedContent' event for an edited container element.voidsendElementEditedSettings(CmsContainerPageElementPanel widget, CmsContainerPageElementPanel replacedWidget) Sends the custom 'ocElementEditedSettings' event for an edited container element.voidSends the custom 'ocElementMoved' event for a moved container element.voidsetContentEditing(boolean isContentEditing) Sets the flag indicating that a content element is being edited.voidSets the DND controller.voidsetElementView(org.opencms.ade.containerpage.shared.CmsElementViewInfo viewInfo, Runnable nextAction) Sets the element view.voidsetModelGroupElementId(String modelGroupElementId) Sets the model group base element id.protected voidsetPageChanged(boolean changed, boolean unlock) Sets the page changed flag and initializes the window closing handler if necessary.voidsetPageChanged(Runnable... nextActions) Marks the page as changed.voidsetPreviewHandler(com.google.gwt.user.client.Event.NativePreviewHandler handler) Sets an alternative event preview handler.booleanshouldShowInContext(org.opencms.ade.containerpage.shared.CmsContainerElementData elementData) Method to determine whether a container element should be shown in the current template context.voidstartEditingGroupcontainer(CmsGroupContainerElementPanel groupContainer, boolean isElementGroup) Tells the controller that group-container editing has started.voidStarts the publish lock check.voidTells the controller that group-container editing has stopped.protected voidAsynchronously unlocks the container page.booleanunlockResource(org.opencms.util.CmsUUID structureId) Unlocks the given resource.voidUpdates he
-
Field Details
-
CLIENT_ID_SEPERATOR
The client side id/setting-hash seperator.- See Also:
-
EVENT_DRAG
Custom event name.- See Also:
-
EVENT_DRAG_FINISHED
Custom event name.- See Also:
-
EVENT_DRAG_STARTED
Custom event name.- See Also:
-
EVENT_ELEMENT_ADDED
Custom event name.- See Also:
-
EVENT_ELEMENT_DELETED
Custom event name.- See Also:
-
EVENT_ELEMENT_EDITED
Custom event name.- See Also:
-
EVENT_ELEMENT_EDITED_CONTENT
Custom event name.- See Also:
-
EVENT_ELEMENT_EDITED_SETTINGS
Custom event name.- See Also:
-
EVENT_ELEMENT_MODIFIED
Custom event name.- See Also:
-
EVENT_ELEMENT_MOVED
Custom event name.- See Also:
-
OC_EDITING_GROUPCONTAINER
CSS class on the body to signal whether we are currently editing a group container.- See Also:
-
PARAM_REMOVEMODE
Parameter name.- See Also:
-
m_elements
The container element data. All requested elements will be cached here. -
m_newElements
The new element data by resource type name.
-
-
Constructor Details
-
CmsContainerpageController
public CmsContainerpageController()Constructor.
-
-
Method Details
-
get
Returns the data provider instance.- Returns:
- the data provider
-
getCurrentUri
Returns the current URI.- Returns:
- the current URI
-
getServerId
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
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
Adds an element specified by it's id to the favorite list.- Parameters:
clientId- the element id
-
addToRecentList
Adds an element specified by it's id to the recent list.- Parameters:
clientId- the element idnextAction- 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 contentresultCallback- the callback for the result
-
checkReuse
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 statusaction- the action to execute after the reuse warning dialog is closed
-
cleanUpContainers
Checks for container elements that are no longer present within the DOM. -
copyElement
Copies an element and asynchronously returns the structure id of the copy.- Parameters:
id- the element idcallback- the callback for the result
-
createAndEditNewElement
Creates a new resource for crag container elements with the status new and opens the content editor.- Parameters:
element- the container elementinline-trueto 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 elementmodelResourceStructureId- the model resource structure id
-
createEventDetails
public CmsContainerpageController.I_EventDetails createEventDetails(CmsContainerPageElementPanel widget) 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 onlycallback- the callback to call with the result
-
deleteElement
Deletes an element from the VFS, removes it from all containers and the client side cache.- Parameters:
elementId- the element to deleterelatedElementId- 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
Enables the favorites editing drag and drop controller.- Parameters:
enable- iftruefavorites editing will enabled, otherwise disableddndController- the favorites editing drag and drop controller
-
fireEvent
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, ornullif 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, ornullif the element has not been cached yet.- Parameters:
resourceTypeName- the element resource type- Returns:
- the element data
-
getContainer
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
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 theCmsContainerpageUtil.- Returns:
- the containerpage-util
-
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
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
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 idcallback- 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 idisListElement- in case a list element, not a container element is about to be editedcallback- 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 idcontainerId- the id of the container from which the element is being draggedalwaysCopy-truein case reading data for a clipboard element used as a copy groupcallback- 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'scallback- 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 idcontainerId- the parent container idcallback- the call-back to execute with the requested data
-
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 elementsettings- the set of settingscallback- 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
nullif no editing is taking place
-
getHandler
Returns the container-page handler.- Returns:
- the container-page handler
-
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 namecallback- 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 elementcallback- 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
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 changednewValue- 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
Calls the edit handler to handle the delete action.- Parameters:
clientId- the content client iddeleteOption- the selected delete optioncallback- the callback to execute after the delete
-
hasActiveSelection
Returns if the selection button is active.- Returns:
trueif the selection button is active
-
hasPageChanged
Returns if the page has changed.- Returns:
trueif the page has changed
-
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 handlerdndHandler- the drag and drop handlercontentEditorHandler- the XML content editor handlercontainerpageUtil- the container-page utility
-
initializeSubContainers
Checks for element sub containers.- Parameters:
containerElement- the container element
-
isContainerEditable
Returns if the given container is editable.- Parameters:
dragParent- the parent container- Returns:
trueif the given container is editable
-
isContentEditing
Returns the flag indicating that a content element is being edited.- Returns:
- the flag indicating that a content element is being edited
-
isDetailPage
Returns if this page displays a detail view.- Returns:
trueif this page displays a detail view
-
isEditingDisabled
Checks if the page editing features should be disabled.- Returns:
- true if the page editing features should be disabled
-
isGroupcontainerEditing
Returns if a group-container is currently being edited.- Returns:
trueif 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 elementdragParent- the element parent- Returns:
trueif the element should be inline editable
-
leaveUnsaved
Method to leave the page without saving.- Parameters:
targetUri- the new URI to call
-
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
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
This method should be called when locking the page has failed.- Parameters:
lockError- the locking information
-
onLockSuccess
This method should be called when locking the page has succeeded. -
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 ideditOption- the selected edit optioncallback- the callback to execute
-
reinitializeButtons
Reinitializes the buttons in the container element menus. -
reInitInlineEditing
Re-initializes the inline editing. -
reloadElements
public void reloadElements(Collection<String> ids, CmsContainerpageController.I_ReloadHandler callback) Reloads the content for the given elements and related elements.- Parameters:
ids- the element idscallback- the callback to execute after the reload
-
reloadElements
Reloads the content for the given elements and related elements.- Parameters:
ids- the element idscallback- 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 idscallback- 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 idscallback- the callback to execute after the reload
-
reloadElementWithSettings
public void reloadElementWithSettings(CmsContainerPageElementPanel elementWidget, String clientId, Map<String, String> settings, CmsContainerpageController.I_ReloadHandler reloadHandler) Reloads a container page element with a new set of settings.- Parameters:
elementWidget- the widget of the container page element which should be reloadedclientId- the id of the container page element which should be reloadedsettings- the new set of settingsreloadHandler- the handler to call with the reloaded element
-
reloadPage
Reloads the page. -
removeElement
Removes the given container element from its parent container.- Parameters:
dragElement- the element to remove
-
removeElement
public void removeElement(CmsContainerPageElementPanel dragElement, CmsContainerpageController.ElementRemoveMode removeMode) Removes the given container element from its parent container.- Parameters:
dragElement- the element to removeremoveMode- the remove mode
-
replaceElement
public void replaceElement(CmsContainerPageElementPanel elementWidget, String elementId, CmsContainerpageController.I_ReloadHandler handler) Replaces the given element with another content while keeping it's settings.- Parameters:
elementWidget- the element to replaceelementId- the id of the replacing contentcallback- 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 replaceelementId- the id of the replacing contentcallback- 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 elementdragParent- the element parent- Returns:
trueif the given element should display the option bar
-
resetEditButtons
Resets all edit buttons an there positions. -
resetPage
Resets the container-page. -
saveAndLeave
Method to save and leave the page.- Parameters:
leaveCommand- the command to execute to leave the page
-
saveAndLeave
Method to save and leave the page.- Parameters:
targetUri- the new URI to call
-
saveClipboardTab
Saves the clipboard tab index selected by the user.- Parameters:
tabIndex- the tab index
-
saveContainerpage
Saves the current state of the container-page.- Parameters:
afterSaveActions- the actions to execute after saving
-
saveFavoriteList
Saves the favorite list.- Parameters:
clientIds- the client id's of the list's elements
-
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 elementtarget- the target elementisNew- true if the dragged element is new
-
sendDragStarted
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 elementreplacedElement- the element that was formerly on the page before the user edited itwasNew- true if the element was a new element before editing
-
sendElementEditedSettings
public void sendElementEditedSettings(CmsContainerPageElementPanel widget, CmsContainerPageElementPanel replacedWidget) Sends the custom 'ocElementEditedSettings' event for an edited container element.- Parameters:
widget- the container elementreplacedWidget- 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
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
-
setModelGroupElementId
Sets the model group base element id.- Parameters:
modelGroupElementId- the model group base element id
-
setPageChanged
Marks the page as changed.- Parameters:
nextActions- the actions to perform after the page has been marked as changed
-
setPreviewHandler
Sets an alternative event preview handler.- Parameters:
handler- the alternative preview handler to use
-
startEditingGroupcontainer
public void startEditingGroupcontainer(CmsGroupContainerElementPanel groupContainer, boolean isElementGroup) Tells the controller that group-container editing has started.- Parameters:
groupContainer- the group containerisElementGroup-trueif the group container is an element group and not an inheritance group
-
startPublishLockCheck
Starts the publish lock check. -
stopEditingGroupcontainer
Tells the controller that group-container editing has stopped. -
unlockResource
Unlocks the given resource.- Parameters:
structureId- the structure id of the resource to unlock- Returns:
trueif 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
-
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
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
Returns the core RPC service.- Returns:
- the core service
-
getGroupEditor
Returns the currently active group editor.- Returns:
- the currently active group editor
-
getLocale
Returns the content locale.- Returns:
- the content locale
-
getPageContent
Gets the page content for purposes of saving.- Returns:
- the page content
-
getPageState
Returns the containers of the page in their current state.- Returns:
- the containers of the page
-
getRequestParams
Returns the request parameters of the displayed container-page.- Returns:
- the request parameters
-
hasNestedContainers
Checks if any of the containers are nested containers.- Returns:
- true if there are nested containers
-
previewNativeEvent
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
Removes all container elements with the given id from all containers and the client side cache.- Parameters:
resourceId- the resource id
-
scheduleGalleryUpdate
Schedules an update of the gallery data according to the current element view and the editable containers. -
setPageChanged
Sets the page changed flag and initializes the window closing handler if necessary.- Parameters:
changed- iftruethe page has changedunlock- iftruethe page will be unlocked for unchanged pages
-
unlockContainerpage
Asynchronously unlocks the container page.
-