Class CmsContainerpageController
- java.lang.Object
-
- org.opencms.ade.containerpage.client.CmsContainerpageController
-
public final class CmsContainerpageController extends java.lang.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsContainerpageController.ElementRemoveMode
Enum which is used to control how elements are removed from the page.static interface
CmsContainerpageController.I_PageContentVisitor
Visitor interface used to process the current container content on the page.protected class
CmsContainerpageController.PageStateVisitor
Visitor implementation which is used to gather the container contents for saving.static class
CmsContainerpageController.ReferenceCheckVisitor
This 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 class
CmsContainerpageController.SaveDataVisitor
Visitor implementation which is used to gather the container contents for saving.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLIENT_ID_SEPERATOR
The client side id/setting-hash seperator.protected java.util.Map<java.lang.String,org.opencms.ade.containerpage.shared.CmsContainerElementData>
m_elements
The container element data.protected java.util.Map<java.lang.String,org.opencms.ade.containerpage.shared.CmsContainerElementData>
m_newElements
The new element data by resource type name.static java.lang.String
PARAM_REMOVEMODE
Parameter name.
-
Constructor Summary
Constructors Constructor Description CmsContainerpageController()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContainerpageEventHandler(I_CmsContainerpageEventHandler handler)
Adds a handler for container page events.protected void
addElements(java.util.List<org.opencms.ade.containerpage.shared.CmsContainerElementData> elements)
Adds the given element data to the element cache.protected void
addElements(java.util.Map<java.lang.String,org.opencms.ade.containerpage.shared.CmsContainerElementData> elements)
Adds the given element data to the element cache.void
addToFavoriteList(java.lang.String clientId)
Adds an element specified by it's id to the favorite list.void
addToRecentList(java.lang.String clientId, java.lang.Runnable nextAction)
Adds an element specified by it's id to the recent list.protected void
askWhetherRemovedElementShouldBeDeleted(org.opencms.ade.containerpage.shared.CmsRemovedElementStatus status)
Asks the user whether an element which has been removed should be deleted.void
checkNewWidgetsAvailable(org.opencms.util.CmsUUID structureId, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> resultCallback)
Checks whether GWT widgets are available for all fields of a content.protected void
checkReferencesToRemovedElement(java.lang.String id)
Checks that a removed can be possibly deleted and if so, asks the user if it should be deleted.void
cleanUpContainers()
Checks for container elements that are no longer present within the DOM.void
copyElement(java.lang.String id, I_CmsSimpleCallback<org.opencms.util.CmsUUID> callback)
Copies an element and asynchronously returns the structure id of the copy.void
createAndEditNewElement(CmsContainerPageElementPanel element, boolean inline)
Creates a new resource for crag container elements with the status new and opens the content editor.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.void
createNewElement(CmsContainerPageElementPanel element, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.ade.containerpage.shared.CmsContainerElement> callback)
Creates a new element.protected void
deactivateOnClosing()
Disables option and toolbar buttons.void
deleteElement(java.lang.String elementId, java.lang.String relatedElementId)
Deletes an element from the VFS, removes it from all containers and the client side cache.void
disableInlineEditing(CmsContainerPageElementPanel notThisOne)
Disables the inline editing for all content elements but the given one.void
enableFavoriteEditing(boolean enable, I_CmsDNDController dndController)
Enables the favorites editing drag and drop controller.void
executeCopyModelReplace(java.lang.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.void
fireEvent(CmsContainerpageEvent event)
Fires an event on the core event bus.static CmsContainerpageController
get()
Returns the data provider instance.protected java.util.List<CmsContainerPageElementPanel>
getAllContainerPageElements(boolean includeGroupContents)
Helper method to get all current container page elements.java.util.List<CmsContainerPageElementPanel>
getAllDragElements()
Returns all drag elements of the page.org.opencms.ade.containerpage.shared.CmsContainerElementData
getCachedElement(java.lang.String clientId)
Returns the data for the requested element, ornull
if the element has not been cached yet.org.opencms.ade.containerpage.shared.CmsContainerElementData
getCachedNewElement(java.lang.String resourceTypeName)
Returns the data for the requested element, ornull
if the element has not been cached yet.org.opencms.ade.containerpage.shared.CmsContainer
getContainer(java.lang.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.CmsGalleryContainerInfo
getContainerInfoForGalleries()
Gets the container info to send to the gallery service.org.opencms.ade.containerpage.shared.rpc.I_CmsContainerpageServiceAsync
getContainerpageService()
Returns the container-page RPC service.CmsContainerpageUtil
getContainerpageUtil()
Returns theCmsContainerpageUtil
.java.util.Map<java.lang.String,org.opencms.ade.containerpage.shared.CmsContainer>
getContainers()
Returns the containers.CmsContainerPageContainer
getContainerTarget(java.lang.String containerName)
Returns the container drag target by name (HTML id attribute).java.util.Map<java.lang.String,CmsContainerPageContainer>
getContainerTargets()
Returns a map of the container drag targets.java.lang.String
getContainerType(java.lang.String containerName)
Returns the type of container with the given name.CmsContentEditorHandler
getContentEditorHandler()
Returns the XML content editor handler.protected org.opencms.gwt.shared.rpc.I_CmsCoreServiceAsync
getCoreService()
Returns the core RPC service.static java.lang.String
getCurrentUri()
Returns the current URI.org.opencms.ade.containerpage.shared.CmsCntPageData
getData()
Returns the prefetched data.void
getDeleteOptions(java.lang.String clientId, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsDialogOptionsAndInfo> callback)
Returns the delete options for the given content element.CmsCompositeDNDController
getDndController()
Gets the DND controller.CmsDNDHandler
getDndHandler()
Returns the drag and drop handler.void
getEditOptions(java.lang.String clientId, boolean isListElement, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsDialogOptionsAndInfo> callback)
Returns the edit options for the given content element.void
getElementForDragAndDropFromContainer(java.lang.String clientId, java.lang.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.void
getElements(java.util.Set<java.lang.String> clientIds, I_CmsSimpleCallback<java.util.Map<java.lang.String,org.opencms.ade.containerpage.shared.CmsContainerElementData>> callback)
Requests the data for container elements specified by the client id.void
getElementSettingsConfig(java.lang.String clientId, java.lang.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.CmsElementViewInfo
getElementView()
Returns the current element view.void
getElementWithSettings(java.lang.String clientId, java.util.Map<java.lang.String,java.lang.String> settings, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsContainerElementData> callback)
Retrieves a container element with a given set of settings.CmsGroupContainerElementPanel
getGroupcontainer()
Returns the group-container element being edited.java.lang.String
getGroupcontainerId()
Returns the id of the currently edited group-container.protected A_CmsGroupEditor
getGroupEditor()
Returns the currently active group editor.CmsContainerpageHandler
getHandler()
Returns the container-page handler.long
getLoadTime()
Returns the time off page load.protected java.lang.String
getLocale()
Returns the content locale.java.lang.String
getLockErrorMessage()
Gets the lock error message.java.lang.String
getModelGroupElementId()
Returns the model group base element id.java.util.List<CmsContainerPageElementPanel>
getModelGroups()
Collects all container elements which are model groups.void
getNewElement(java.lang.String resourceType, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsContainerElementData> callback)
Returns the element data for a resource type representing a new element.void
getNewOptions(java.lang.String clientId, I_CmsSimpleCallback<org.opencms.ade.containerpage.shared.CmsDialogOptionsAndInfo> callback)
Fetches the options for creating a new element from the edit handler.protected java.util.List<org.opencms.ade.containerpage.shared.CmsContainer>
getPageContent()
Gets the page content for purposes of saving.protected java.util.List<org.opencms.ade.containerpage.shared.CmsContainer>
getPageState()
Returns the containers of the page in their current state.protected java.lang.String
getRequestParams()
Returns the request parameters of the displayed container-page.java.lang.String
getReturnCode()
Produces the "return code", which is needed to return to the current page from the sitemap.org.opencms.ade.containerpage.shared.CmsContainer
getSerializedContainer(java.lang.String data)
Returns the deserialized element data.org.opencms.ade.containerpage.shared.CmsContainerElement
getSerializedElement(java.lang.String data)
Returns the deserialized element data.static java.lang.String
getServerId(java.lang.String clientId)
Returns the server id for a given client element id.CmsSmallElementsHandler
getSmallElementsHandler()
Gets the handler for small elements.org.opencms.ade.containerpage.shared.CmsElementViewInfo
getView(java.lang.String value)
Gets the view with the given id.void
handleChangeTemplateContext(CmsContainerPageElementPanel element, java.lang.String newValue)
Handler that gets called when the template context setting of an element was changed by the user.void
handleConfirmRemove(CmsContainerPageElementPanel element)
Asks the user for confirmation before removing a container page element.void
handleDelete(java.lang.String clientId, java.lang.String deleteOption, I_CmsSimpleCallback<java.lang.Void> callback)
Calls the edit handler to handle the delete action.boolean
hasActiveSelection()
Returns if the selection button is active.protected boolean
hasNestedContainers()
Checks if any of the containers are nested containers.boolean
hasPageChanged()
Returns if the page has changed.void
hideEditableListButtons()
Hides list collector direct edit buttons, if present.void
init(CmsContainerpageHandler handler, CmsDNDHandler dndHandler, CmsContentEditorHandler contentEditorHandler, CmsContainerpageUtil containerpageUtil)
Initializes the controller.void
initializeSubContainers(CmsContainerPageElementPanel containerElement)
Checks for element sub containers.static boolean
isConfirmRemove()
Checks whether element removal should be confirmed.boolean
isContainerEditable(I_CmsDropContainer dragParent)
Returns if the given container is editable.boolean
isContentEditing()
Returns the flag indicating that a content element is being edited.boolean
isDetailPage()
Returns if this page displays a detail view.boolean
isEditingDisabled()
Checks if the page editing features should be disabled.boolean
isGroupcontainerEditing()
Returns if a group-container is currently being edited.boolean
isInlineEditable(CmsContainerPageElementPanel element, I_CmsDropContainer dragParent)
Checks whether the given element should be inline editable.protected boolean
isRootContainer(org.opencms.ade.containerpage.shared.CmsContainer container)
Returns whether the given container is considered a root container.void
leaveUnsaved(java.lang.String targetUri)
Method to leave the page without saving.void
loadContextMenu(org.opencms.util.CmsUUID structureId, org.opencms.gwt.shared.CmsCoreData.AdeContext context)
Loads the context menu entries.void
loadFavorites(I_CmsSimpleCallback<java.util.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.void
loadRecent(I_CmsSimpleCallback<java.util.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.void
lockContainerpage(I_CmsSimpleCallback<java.lang.Boolean> callback)
Locks the container-page.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.void
onLockFail(java.lang.String lockError)
This method should be called when locking the page has failed.void
onLockSuccess()
This method should be called when locking the page has succeeded.void
onWindowClose()
Handler which is executed when the window closes.protected void
openEditorForNewElement(CmsContainerPageElementPanel element, org.opencms.ade.containerpage.shared.CmsContainerElement newElementData, boolean inline)
Opens the editor for the newly created element.void
prepareForEdit(java.lang.String clientId, java.lang.String editOption, I_CmsSimpleCallback<org.opencms.util.CmsUUID> callback)
Calls the edit handler to prepare the given content element for editing.protected void
previewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event)
Previews events.protected void
processPageContent(CmsContainerpageController.I_PageContentVisitor visitor)
Iterates over all the container contents and calls a visitor object with the visited containers/elements as parameters.void
reinitializeButtons()
Reinitializes the buttons in the container element menus.void
reInitInlineEditing()
Re-initializes the inline editing.void
reloadElements(java.lang.String[] ids, java.lang.Runnable callback)
Reloads the content for the given element and all related elements.void
reloadElements(java.util.Collection<java.lang.String> ids, java.lang.Runnable callback)
Reloads the content for the given elements and related elements.void
reloadElementWithSettings(CmsContainerPageElementPanel elementWidget, java.lang.String clientId, java.util.Map<java.lang.String,java.lang.String> settings, I_CmsSimpleCallback<CmsContainerPageElementPanel> afterReloadAction)
Reloads a container page element with a new set of settings.void
reloadPage()
Reloads the page.protected void
removeContainerElements(java.lang.String resourceId)
Removes all container elements with the given id from all containers and the client side cache.void
removeElement(CmsContainerPageElementPanel dragElement)
Removes the given container element from its parent container.void
removeElement(CmsContainerPageElementPanel dragElement, CmsContainerpageController.ElementRemoveMode removeMode)
Removes the given container element from its parent container.CmsContainerPageElementPanel
replaceContainerElement(CmsContainerPageElementPanel containerElement, org.opencms.ade.containerpage.shared.CmsContainerElementData elementData)
Replaces the given drag-element with the given container element.void
replaceElement(CmsContainerPageElementPanel elementWidget, java.lang.String elementId, java.lang.Runnable callback)
Replaces the given element with another content while keeping it's settings.boolean
requiresOptionBar(CmsContainerPageElementPanel element, I_CmsDropContainer dragParent)
Checks whether the given element should display the option bar.void
resetEditButtons()
Resets all edit buttons an there positions.void
resetPage()
Resets the container-page.void
saveAndLeave(com.google.gwt.user.client.Command leaveCommand)
Method to save and leave the page.void
saveAndLeave(java.lang.String targetUri)
Method to save and leave the page.void
saveClipboardTab(int tabIndex)
Saves the clipboard tab index selected by the user.void
saveContainerpage(java.lang.Runnable... afterSaveActions)
Saves the current state of the container-page.void
saveFavoriteList(java.util.List<java.lang.String> clientIds)
Saves the favorite list.void
saveGroupcontainer(org.opencms.ade.containerpage.shared.CmsGroupContainer groupContainer, CmsGroupContainerElementPanel groupContainerElement)
Saves the group-container.void
saveInheritContainer(org.opencms.ade.containerpage.shared.CmsInheritanceContainer inheritanceContainer, CmsGroupContainerElementPanel groupContainerElement)
Saves the inheritance container.protected void
scheduleGalleryUpdate()
Schedules an update of the gallery data according to the current element view and the editable containers.void
setContentEditing(boolean isContentEditing)
Sets the flag indicating that a content element is being edited.void
setDndController(CmsCompositeDNDController dnd)
Sets the DND controller.void
setElementView(org.opencms.ade.containerpage.shared.CmsElementViewInfo viewInfo, java.lang.Runnable nextAction)
Sets the element view.void
setModelGroupElementId(java.lang.String modelGroupElementId)
Sets the model group base element id.protected void
setPageChanged(boolean changed, boolean unlock)
Sets the page changed flag and initializes the window closing handler if necessary.void
setPageChanged(java.lang.Runnable... nextActions)
Marks the page as changed.boolean
shouldShowInContext(org.opencms.ade.containerpage.shared.CmsContainerElementData elementData)
Method to determine whether a container element should be shown in the current template context.void
startEditingGroupcontainer(CmsGroupContainerElementPanel groupContainer, boolean isElementGroup)
Tells the controller that group-container editing has started.void
startPublishLockCheck()
Starts the publish lock check.void
stopEditingGroupcontainer()
Tells the controller that group-container editing has stopped.protected void
unlockContainerpage()
Asynchronously unlocks the container page.boolean
unlockResource(org.opencms.util.CmsUUID structureId)
Unlocks the given resource.void
updateButtonsForCurrentView()
Updates he
-
-
-
Field Detail
-
CLIENT_ID_SEPERATOR
public static final java.lang.String CLIENT_ID_SEPERATOR
The client side id/setting-hash seperator.- See Also:
- Constant Field Values
-
PARAM_REMOVEMODE
public static final java.lang.String PARAM_REMOVEMODE
Parameter name.- See Also:
- Constant Field Values
-
m_elements
protected java.util.Map<java.lang.String,org.opencms.ade.containerpage.shared.CmsContainerElementData> m_elements
The container element data. All requested elements will be cached here.
-
m_newElements
protected java.util.Map<java.lang.String,org.opencms.ade.containerpage.shared.CmsContainerElementData> m_newElements
The new element data by resource type name.
-
-
Constructor Detail
-
CmsContainerpageController
public CmsContainerpageController()
Constructor.
-
-
Method Detail
-
get
public static CmsContainerpageController get()
Returns the data provider instance.- Returns:
- the data provider
-
getCurrentUri
public static java.lang.String getCurrentUri()
Returns the current URI.- Returns:
- the current URI
-
getServerId
public static java.lang.String getServerId(java.lang.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
public void addContainerpageEventHandler(I_CmsContainerpageEventHandler handler)
Adds a handler for container page events.- Parameters:
handler
- the handler to add
-
addToFavoriteList
public void addToFavoriteList(java.lang.String clientId)
Adds an element specified by it's id to the favorite list.- Parameters:
clientId
- the element id
-
addToRecentList
public void addToRecentList(java.lang.String clientId, java.lang.Runnable nextAction)
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<java.lang.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
-
cleanUpContainers
public void cleanUpContainers()
Checks for container elements that are no longer present within the DOM.
-
copyElement
public void copyElement(java.lang.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 idcallback
- 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 elementinline
-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 elementmodelResourceStructureId
- the model resource structure id
-
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
public void deleteElement(java.lang.String elementId, java.lang.String relatedElementId)
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
public void disableInlineEditing(CmsContainerPageElementPanel notThisOne)
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
- iftrue
favorites editing will enabled, otherwise disableddndController
- the favorites editing drag and drop controller
-
executeCopyModelReplace
public void executeCopyModelReplace(java.lang.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 idmodelGroupParent
- the model group parent elementelementData
- 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
public java.util.List<CmsContainerPageElementPanel> getAllDragElements()
Returns all drag elements of the page.- Returns:
- the drag elements
-
getCachedElement
public org.opencms.ade.containerpage.shared.CmsContainerElementData getCachedElement(java.lang.String clientId)
Returns the data for the requested element, ornull
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(java.lang.String resourceTypeName)
Returns the data for the requested element, ornull
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(java.lang.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
public CmsContainerpageUtil getContainerpageUtil()
Returns theCmsContainerpageUtil
.- Returns:
- the containerpage-util
-
getContainers
public java.util.Map<java.lang.String,org.opencms.ade.containerpage.shared.CmsContainer> getContainers()
Returns the containers.- Returns:
- the containers
-
getContainerTarget
public CmsContainerPageContainer getContainerTarget(java.lang.String containerName)
Returns the container drag target by name (HTML id attribute).- Parameters:
containerName
- the container name- Returns:
- the drag target
-
getContainerTargets
public java.util.Map<java.lang.String,CmsContainerPageContainer> getContainerTargets()
Returns a map of the container drag targets.- Returns:
- the drag targets
-
getContainerType
public java.lang.String getContainerType(java.lang.String containerName)
Returns the type of container with the given name.- Parameters:
containerName
- the container name- Returns:
- the container type
-
getContentEditorHandler
public CmsContentEditorHandler 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(java.lang.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
public CmsCompositeDNDController getDndController()
Gets the DND controller.- Returns:
- the DND controller
-
getDndHandler
public CmsDNDHandler getDndHandler()
Returns the drag and drop handler.- Returns:
- the drag and drop handler
-
getEditOptions
public void getEditOptions(java.lang.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(java.lang.String clientId, java.lang.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
-true
in 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(java.util.Set<java.lang.String> clientIds, I_CmsSimpleCallback<java.util.Map<java.lang.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(java.lang.String clientId, java.lang.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
public org.opencms.ade.containerpage.shared.CmsElementViewInfo getElementView()
Returns the current element view.- Returns:
- the current element view
-
getElementWithSettings
public void getElementWithSettings(java.lang.String clientId, java.util.Map<java.lang.String,java.lang.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
public CmsGroupContainerElementPanel getGroupcontainer()
Returns the group-container element being edited.- Returns:
- the group-container
-
getGroupcontainerId
public java.lang.String getGroupcontainerId()
Returns the id of the currently edited group-container.- Returns:
- the group-container id, or
null
if no editing is taking place
-
getHandler
public CmsContainerpageHandler 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
public java.lang.String getLockErrorMessage()
Gets the lock error message.- Returns:
- the lock error message
-
getModelGroupElementId
public java.lang.String getModelGroupElementId()
Returns the model group base element id.- Returns:
- the model group base element id
-
getModelGroups
public java.util.List<CmsContainerPageElementPanel> getModelGroups()
Collects all container elements which are model groups.- Returns:
- the list of model group container elements
-
getNewElement
public void getNewElement(java.lang.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(java.lang.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
public java.lang.String 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(java.lang.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(java.lang.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
public CmsSmallElementsHandler getSmallElementsHandler()
Gets the handler for small elements.- Returns:
- the small elements handler
-
getView
public org.opencms.ade.containerpage.shared.CmsElementViewInfo getView(java.lang.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
public void handleChangeTemplateContext(CmsContainerPageElementPanel element, java.lang.String newValue)
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
public void handleConfirmRemove(CmsContainerPageElementPanel element)
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(java.lang.String clientId, java.lang.String deleteOption, I_CmsSimpleCallback<java.lang.Void> callback)
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
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 handlerdndHandler
- the drag and drop handlercontentEditorHandler
- the XML content editor handlercontainerpageUtil
- 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 elementdragParent
- the element parent- Returns:
true
if the element should be inline editable
-
leaveUnsaved
public void leaveUnsaved(java.lang.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 forcontext
- the ade context (sitemap or containerpae)
-
loadFavorites
public void loadFavorites(I_CmsSimpleCallback<java.util.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<java.util.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
public void lockContainerpage(I_CmsSimpleCallback<java.lang.Boolean> callback)
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(java.lang.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(java.lang.String clientId, java.lang.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
public void reinitializeButtons()
Reinitializes the buttons in the container element menus.
-
reInitInlineEditing
public void reInitInlineEditing()
Re-initializes the inline editing.
-
reloadElements
public void reloadElements(java.util.Collection<java.lang.String> ids, java.lang.Runnable callback)
Reloads the content for the given elements and related elements.- Parameters:
ids
- the element idscallback
- the callback to execute after the reload
-
reloadElements
public void reloadElements(java.lang.String[] ids, java.lang.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 idscallback
- the callback to execute after the reload
-
reloadElementWithSettings
public void reloadElementWithSettings(CmsContainerPageElementPanel elementWidget, java.lang.String clientId, java.util.Map<java.lang.String,java.lang.String> settings, I_CmsSimpleCallback<CmsContainerPageElementPanel> afterReloadAction)
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 settingsafterReloadAction
- a callback which is executed after the element has been reloaded
-
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
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
-
replaceContainerElement
public CmsContainerPageElementPanel replaceContainerElement(CmsContainerPageElementPanel containerElement, org.opencms.ade.containerpage.shared.CmsContainerElementData elementData) throws java.lang.Exception
Replaces the given drag-element with the given container element.- Parameters:
containerElement
- the container element to replaceelementData
- the new element data- Returns:
- the container element which replaced the old one
- Throws:
java.lang.Exception
- if something goes wrong
-
replaceElement
public void replaceElement(CmsContainerPageElementPanel elementWidget, java.lang.String elementId, java.lang.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:
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(java.lang.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(java.lang.Runnable... afterSaveActions)
Saves the current state of the container-page.- Parameters:
afterSaveActions
- the actions to execute after saving
-
saveFavoriteList
public void saveFavoriteList(java.util.List<java.lang.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 savegroupContainerElement
- 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 savegroupContainerElement
- the group container widget
-
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
public void setDndController(CmsCompositeDNDController dnd)
Sets the DND controller.- Parameters:
dnd
- the new DND controller
-
setElementView
public void setElementView(org.opencms.ade.containerpage.shared.CmsElementViewInfo viewInfo, java.lang.Runnable nextAction)
Sets the element view.- Parameters:
viewInfo
- the element viewnextAction
- the action to execute after setting the view
-
setModelGroupElementId
public void setModelGroupElementId(java.lang.String modelGroupElementId)
Sets the model group base element id.- Parameters:
modelGroupElementId
- the model group base element id
-
setPageChanged
public void setPageChanged(java.lang.Runnable... nextActions)
Marks the page as changed.- Parameters:
nextActions
- the actions to perform after the page has been marked as changed
-
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 containerisElementGroup
-true
if the group container is an element group and not an inheritance group
-
startPublishLockCheck
public void startPublishLockCheck()
Starts the publish lock check.
-
stopEditingGroupcontainer
public void 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
public void updateButtonsForCurrentView()
Updates he
-
addElements
protected void addElements(java.util.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(java.util.Map<java.lang.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
protected void checkReferencesToRemovedElement(java.lang.String id)
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 java.util.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
protected A_CmsGroupEditor getGroupEditor()
Returns the currently active group editor.- Returns:
- the currently active group editor
-
getLocale
protected java.lang.String getLocale()
Returns the content locale.- Returns:
- the content locale
-
getPageContent
protected java.util.List<org.opencms.ade.containerpage.shared.CmsContainer> getPageContent()
Gets the page content for purposes of saving.- Returns:
- the page content
-
getPageState
protected java.util.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 java.lang.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 elementnewElementData
- the new element datainline
-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
protected void processPageContent(CmsContainerpageController.I_PageContentVisitor visitor)
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(java.lang.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
- iftrue
the page has changedunlock
- iftrue
the page will be unlocked for unchanged pages
-
unlockContainerpage
protected void unlockContainerpage()
Asynchronously unlocks the container page.
-
-