public final class CmsContainerpageController
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
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.
|
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.
|
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
CLIENT_ID_SEPERATOR
The client side id/setting-hash seperator.
|
protected java.util.List<CmsContainer> |
m_containerBeans
The list of beans for the containers on the current page.
|
protected java.util.Map<java.lang.String,CmsContainerElementData> |
m_elements
The container element data.
|
protected java.util.Map<java.lang.String,CmsContainerElementData> |
m_newElements
The new element data by resource type name.
|
static java.lang.String |
PARAM_REMOVEMODE
Parameter name.
|
构造器和说明 |
---|
CmsContainerpageController()
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addContainerpageEventHandler(I_CmsContainerpageEventHandler handler)
Adds a handler for container page events.
|
protected void |
addElements(java.util.List<CmsContainerElementData> elements)
Adds the given element data to the element cache.
|
protected void |
addElements(java.util.Map<java.lang.String,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 static void |
askWhetherRemovedElementShouldBeDeleted(CmsRemovedElementStatus status)
Asks the user whether an element which has been removed should be deleted.
|
void |
checkNewWidgetsAvailable(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 |
copyElement(java.lang.String id,
com.google.gwt.user.client.rpc.AsyncCallback<CmsUUID> asyncCallback)
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,
CmsUUID modelResourceStructureId)
Creates a new resource for crag container elements with the status new and opens the content editor.
|
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 |
fireEvent(CmsContainerpageEvent event)
Fires an event on the core event bus.
|
static CmsContainerpageController |
get()
Returns the data provider instance.
|
java.util.List<CmsContainerPageElementPanel> |
getAllDragElements()
Returns all drag elements of the page.
|
CmsContainerElementData |
getCachedElement(java.lang.String clientId)
Returns the data for the requested element, or
null if the element has not been cached yet. |
CmsContainerElementData |
getCachedNewElement(java.lang.String resourceTypeName)
Returns the data for the requested element, or
null if the element has not been cached yet. |
CmsContainerJso |
getContainer(java.lang.String containerName)
Returns the container data of container with the given name.
|
I_CmsContainerpageServiceAsync |
getContainerpageService()
Returns the container-page RPC service.
|
CmsContainerpageUtil |
getContainerpageUtil()
Returns the
CmsContainerpageUtil . |
java.util.Map<java.lang.String,CmsContainerJso> |
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 I_CmsCoreServiceAsync |
getCoreService()
Returns the core RPC service.
|
static java.lang.String |
getCurrentUri()
Returns the current URI.
|
CmsCntPageData |
getData()
Returns the prefetched data.
|
CmsCompositeDNDController |
getDndController()
Gets the DND controller.
|
CmsDNDHandler |
getDndHandler()
Returns the drag and drop handler.
|
void |
getElement(java.lang.String clientId,
I_CmsSimpleCallback<CmsContainerElementData> callback)
Requests the data for a container element specified by the client id.
|
void |
getElements(java.util.Set<java.lang.String> clientIds,
I_CmsSimpleCallback<java.util.Map<java.lang.String,CmsContainerElementData>> callback)
Requests the data for container elements specified by the client id.
|
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.
|
protected java.lang.String |
getLocale()
Returns the content locale.
|
java.lang.String |
getLockErrorMessage()
Gets the lock error message.
|
void |
getNewElement(java.lang.String resourceType,
I_CmsSimpleCallback<CmsContainerElementData> callback)
Returns the element data for a resource type representing a new element.
|
protected java.util.List<CmsContainer> |
getPageContent()
Gets the page content for purposes of saving.
|
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.
|
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.
|
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.
|
boolean |
hasActiveSelection()
Returns if the selection button is active.
|
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.
|
static boolean |
isConfirmRemove()
Checks whether element removal should be confirmed.
|
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.
|
void |
leaveUnsaved(java.lang.String targetUri)
Method to leave the page without saving.
|
void |
loadContextMenu(CmsUUID structureId,
CmsCoreData.AdeContext context)
Loads the context menu entries.
|
void |
loadFavorites(I_CmsSimpleCallback<java.util.List<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<CmsContainerElementData>> callback)
Loads the recent list and adds the elements to the recent list widget of the tool-bar menu.
|
boolean |
lockContainerpage()
Locks the container-page.
|
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,
CmsContainerElement newElementData,
boolean inline)
Opens the editor for the newly created element.
|
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 |
reInitInlineEditing()
Re-initializes the inline editing.
|
void |
reloadElements(java.lang.String[] ids)
Reloads the content for the given element and all related elements.
|
void |
reloadElementWithSettings(CmsContainerPageElementPanel elementWidget,
java.lang.String clientId,
java.util.Map<java.lang.String,java.lang.String> settings,
com.google.gwt.user.client.rpc.AsyncCallback<CmsContainerPageElementPanel> afterReloadAction)
Reloads a container page element with a new set of settings.
|
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,
CmsContainerpageController.ElementRemoveMode removeMode)
Removes the given container element from its parent container.
|
CmsContainerPageElementPanel |
replaceContainerElement(CmsContainerPageElementPanel containerElement,
CmsContainerElementData elementData)
Replaces the given drag-element with the given container element.
|
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 |
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(CmsGroupContainer groupContainer,
CmsGroupContainerElementPanel groupContainerElement)
Saves the group-container.
|
void |
saveInheritContainer(CmsInheritanceContainer inheritanceContainer,
CmsGroupContainerElementPanel groupContainerElement)
Saves the inheritance container.
|
void |
setContentEditing(boolean isContentEditing)
Sets the flag indicating that a content element is being edited.
|
void |
setDndController(CmsCompositeDNDController dnd)
Sets the DND controller.
|
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.
|
void |
setToolbarVisible(boolean visible)
Writes the tool-bar visibility into the session cache.
|
boolean |
shouldShowInContext(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 |
stopEditingGroupcontainer()
Tells the controller that group-container editing has stopped.
|
protected void |
syncSaveContainerpage()
Saves the container-page in a synchronized RPC call.
|
protected void |
unlockContainerpage()
Unlocks the container-page in a synchronized RPC call.
|
boolean |
unlockResource(CmsUUID structureId)
Unlocks the given resource.
|
public static final java.lang.String CLIENT_ID_SEPERATOR
public static final java.lang.String PARAM_REMOVEMODE
protected java.util.List<CmsContainer> m_containerBeans
protected java.util.Map<java.lang.String,CmsContainerElementData> m_elements
protected java.util.Map<java.lang.String,CmsContainerElementData> m_newElements
public static CmsContainerpageController get()
public static java.lang.String getCurrentUri()
public static java.lang.String getServerId(java.lang.String clientId)
clientId
- the client id including an optional element settings hashpublic static boolean isConfirmRemove()
protected static void askWhetherRemovedElementShouldBeDeleted(CmsRemovedElementStatus status)
status
- the status of the removed elementpublic void addContainerpageEventHandler(I_CmsContainerpageEventHandler handler)
handler
- the handler to addpublic void addToFavoriteList(java.lang.String clientId)
clientId
- the element idpublic void addToRecentList(java.lang.String clientId, java.lang.Runnable nextAction)
clientId
- the element idnextAction
- the action to execute after the element has been addedpublic void checkNewWidgetsAvailable(CmsUUID structureId, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> resultCallback)
structureId
- the structure id of the contentresultCallback
- the callback for the resultpublic void copyElement(java.lang.String id, com.google.gwt.user.client.rpc.AsyncCallback<CmsUUID> asyncCallback)
id
- the element idasyncCallback
- the callback for the resultpublic void createAndEditNewElement(CmsContainerPageElementPanel element, boolean inline)
element
- the container elementinline
- true
to open the inline editor for the given element if availablepublic void createAndEditNewElement(CmsContainerPageElementPanel element, CmsUUID modelResourceStructureId)
element
- the container elementmodelResourceStructureId
- the model resource structure idpublic void deleteElement(java.lang.String elementId, java.lang.String relatedElementId)
elementId
- the element to deleterelatedElementId
- related element to reload after the element has been deletedpublic void disableInlineEditing(CmsContainerPageElementPanel notThisOne)
notThisOne
- the content element not to disablepublic void enableFavoriteEditing(boolean enable, I_CmsDNDController dndController)
enable
- if true
favorites editing will enabled, otherwise disableddndController
- the favorites editing drag and drop controllerpublic void fireEvent(CmsContainerpageEvent event)
event
- the event to firepublic java.util.List<CmsContainerPageElementPanel> getAllDragElements()
public CmsContainerElementData getCachedElement(java.lang.String clientId)
null
if the element has not been cached yet.clientId
- the element idpublic CmsContainerElementData getCachedNewElement(java.lang.String resourceTypeName)
null
if the element has not been cached yet.resourceTypeName
- the element resource typepublic CmsContainerJso getContainer(java.lang.String containerName)
containerName
- the container namepublic I_CmsContainerpageServiceAsync getContainerpageService()
public CmsContainerpageUtil getContainerpageUtil()
CmsContainerpageUtil
.public java.util.Map<java.lang.String,CmsContainerJso> getContainers()
public CmsContainerPageContainer getContainerTarget(java.lang.String containerName)
containerName
- the container namepublic java.util.Map<java.lang.String,CmsContainerPageContainer> getContainerTargets()
public java.lang.String getContainerType(java.lang.String containerName)
containerName
- the container namepublic CmsContentEditorHandler getContentEditorHandler()
public CmsCntPageData getData()
public CmsCompositeDNDController getDndController()
public CmsDNDHandler getDndHandler()
public void getElement(java.lang.String clientId, I_CmsSimpleCallback<CmsContainerElementData> callback)
clientId
- the element idcallback
- the call-back to execute with the requested datapublic void getElements(java.util.Set<java.lang.String> clientIds, I_CmsSimpleCallback<java.util.Map<java.lang.String,CmsContainerElementData>> callback)
clientIds
- the element id'scallback
- the call-back to execute with the requested datapublic CmsGroupContainerElementPanel getGroupcontainer()
public java.lang.String getGroupcontainerId()
null
if no editing is taking placepublic CmsContainerpageHandler getHandler()
public java.lang.String getLockErrorMessage()
public void getNewElement(java.lang.String resourceType, I_CmsSimpleCallback<CmsContainerElementData> callback)
resourceType
- the resource type namecallback
- the callback to execute with the new element datapublic java.lang.String getReturnCode()
public CmsContainerElement getSerializedElement(java.lang.String data) throws com.google.gwt.user.client.rpc.SerializationException
data
- the data to deserializecom.google.gwt.user.client.rpc.SerializationException
- if deserialization failspublic CmsSmallElementsHandler getSmallElementsHandler()
public void handleChangeTemplateContext(CmsContainerPageElementPanel element, java.lang.String newValue)
element
- the element whose template context setting was changednewValue
- the new value of the settingpublic void handleConfirmRemove(CmsContainerPageElementPanel element)
element
- the element for which the user should confirm the removalpublic boolean hasActiveSelection()
true
if the selection button is activepublic boolean hasPageChanged()
true
if the page has changedpublic void hideEditableListButtons()
public void init(CmsContainerpageHandler handler, CmsDNDHandler dndHandler, CmsContentEditorHandler contentEditorHandler, CmsContainerpageUtil containerpageUtil)
handler
- the container-page handlerdndHandler
- the drag and drop handlercontentEditorHandler
- the XML content editor handlercontainerpageUtil
- the container-page utilitypublic boolean isContentEditing()
public boolean isDetailPage()
true
if this page displays a detail viewpublic boolean isEditingDisabled()
public boolean isGroupcontainerEditing()
true
if a group-container is being editedpublic void leaveUnsaved(java.lang.String targetUri)
targetUri
- the new URI to callpublic void loadContextMenu(CmsUUID structureId, CmsCoreData.AdeContext context)
structureId
- the structure id of the resource to get the context menu entries forcontext
- the ade context (sitemap or containerpae)public void loadFavorites(I_CmsSimpleCallback<java.util.List<CmsContainerElementData>> callback)
callback
- the call-back to execute with the result datapublic void loadRecent(I_CmsSimpleCallback<java.util.List<CmsContainerElementData>> callback)
callback
- the call-back to execute with the result datapublic boolean lockContainerpage()
true
if page was locked successfullypublic void onLockFail(java.lang.String lockError)
lockError
- the locking informationpublic void onLockSuccess()
public void onWindowClose()
public void reInitInlineEditing()
public void reloadElements(java.lang.String[] ids)
Call this if the element content has changed.
ids
- the element id'spublic void reloadElementWithSettings(CmsContainerPageElementPanel elementWidget, java.lang.String clientId, java.util.Map<java.lang.String,java.lang.String> settings, com.google.gwt.user.client.rpc.AsyncCallback<CmsContainerPageElementPanel> afterReloadAction)
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 reloadedpublic void removeElement(CmsContainerPageElementPanel dragElement, CmsContainerpageController.ElementRemoveMode removeMode)
dragElement
- the element to removeremoveMode
- the remove modepublic CmsContainerPageElementPanel replaceContainerElement(CmsContainerPageElementPanel containerElement, CmsContainerElementData elementData) throws java.lang.Exception
containerElement
- the container element to replaceelementData
- the new element datajava.lang.Exception
- if something goes wrongpublic void resetEditButtons()
public void resetPage()
public void saveAndLeave(com.google.gwt.user.client.Command leaveCommand)
leaveCommand
- the command to execute to leave the pagepublic void saveAndLeave(java.lang.String targetUri)
targetUri
- the new URI to callpublic void saveContainerpage(java.lang.Runnable... afterSaveActions)
afterSaveActions
- the actions to execute after savingpublic void saveFavoriteList(java.util.List<java.lang.String> clientIds)
clientIds
- the client id's of the list's elementspublic void saveGroupcontainer(CmsGroupContainer groupContainer, CmsGroupContainerElementPanel groupContainerElement)
groupContainer
- the group-container data to savegroupContainerElement
- the group-container widgetpublic void saveInheritContainer(CmsInheritanceContainer inheritanceContainer, CmsGroupContainerElementPanel groupContainerElement)
inheritanceContainer
- the inheritance container data to savegroupContainerElement
- the group container widgetpublic void setContentEditing(boolean isContentEditing)
isContentEditing
- the flag indicating that a content element is being editedpublic void setDndController(CmsCompositeDNDController dnd)
dnd
- the new DND controllerpublic void setPageChanged(java.lang.Runnable... nextActions)
nextActions
- the actions to perform after the page has been marked as changedpublic void setToolbarVisible(boolean visible)
visible
- true
if the tool-bar is visiblepublic boolean shouldShowInContext(CmsContainerElementData elementData)
elementData
- the element datapublic void startEditingGroupcontainer(CmsGroupContainerElementPanel groupContainer, boolean isElementGroup)
groupContainer
- the group containerisElementGroup
- true
if the group container is an element group and not an inheritance grouppublic void stopEditingGroupcontainer()
public boolean unlockResource(CmsUUID structureId)
structureId
- the structure id of the resource to unlocktrue
if the resource was unlocked successfullyprotected void addElements(java.util.List<CmsContainerElementData> elements)
elements
- the element dataprotected void addElements(java.util.Map<java.lang.String,CmsContainerElementData> elements)
elements
- the element dataprotected void checkReferencesToRemovedElement(java.lang.String id)
id
- the client id of the elementprotected void deactivateOnClosing()
protected I_CmsCoreServiceAsync getCoreService()
protected A_CmsGroupEditor getGroupEditor()
protected java.lang.String getLocale()
protected java.util.List<CmsContainer> getPageContent()
protected java.lang.String getRequestParams()
protected void openEditorForNewElement(CmsContainerPageElementPanel element, CmsContainerElement newElementData, boolean inline)
element
- the container elementnewElementData
- the new element datainline
- true
to open the inline editor for the given element if availableprotected void previewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event)
event
- the native eventprotected void processPageContent(CmsContainerpageController.I_PageContentVisitor visitor)
visitor
- the visitor which the container elements should be passed toprotected void removeContainerElements(java.lang.String resourceId)
resourceId
- the resource idprotected void setPageChanged(boolean changed, boolean unlock)
changed
- if true
the page has changedunlock
- if true
the page will be unlocked for unchanged pagesprotected void syncSaveContainerpage()
protected void unlockContainerpage()