Class CmsSitemapController
java.lang.Object
org.opencms.ade.sitemap.client.control.CmsSitemapController
- All Implemented Interfaces:
org.opencms.ade.sitemap.shared.I_CmsSitemapController
public class CmsSitemapController
extends Object
implements org.opencms.ade.sitemap.shared.I_CmsSitemapController
Sitemap editor controller.
- Since:
- 8.0.0
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<org.opencms.util.CmsUUID,
org.opencms.ade.detailpage.CmsDetailPageInfo> A map of *all* detail page info beans, indexed by page id.protected org.opencms.ade.sitemap.shared.CmsSitemapData
The sitemap data.protected org.opencms.ade.sitemap.shared.CmsDetailPageTable
The detail page table.protected com.google.gwt.event.shared.SimpleEventBus
The event bus.static final String
The name to use for new entries. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.gwt.event.shared.HandlerRegistration
Adds a new change event handler.void
addDetailPageInfo
(org.opencms.ade.detailpage.CmsDetailPageInfo info) Adds a new detail page information bean.com.google.gwt.event.shared.HandlerRegistration
addLoadHandler
(I_CmsSitemapLoadHandler handler) Adds a new load event handler.void
Adds a handler for property changes caused by user edits.void
addToNavigation
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry) Adds the entry to the navigation.protected void
applyChange
(org.opencms.ade.sitemap.shared.CmsSitemapChange change) Fires a sitemap change event.void
bump
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry) Makes the given sitemap entry the default detail page for its detail page type.void
changeCategory
(org.opencms.util.CmsUUID id, String title, String name) Changes the given category.void
Clears the deleted clip-board list and commits the change.void
Clears the modified clip-board list and commits the change.protected void
commitChange
(org.opencms.ade.sitemap.shared.CmsSitemapChange change, com.google.gwt.user.client.Command callback) Adds a change to the queue.void
create
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry newEntry, org.opencms.util.CmsUUID parentId, int resourceTypeId, org.opencms.util.CmsUUID copyResourceId, String parameter, boolean isNewSitemap) Registers a new sitemap entry.void
createCategory
(org.opencms.util.CmsUUID id, String title, String name) Creates a new category.void
createNewGallery
(org.opencms.util.CmsUUID parentId, int galleryTypeId, String title) Creates a new gallery folder of the given type.void
createNewModelPage
(String title, String description, org.opencms.util.CmsUUID copyId, boolean isModelGroup) Creates a new model page.void
createSitemapSubEntry
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry parent, String sitemapFolderType) Creates a new sub-entry which is a subsitemap.void
createSitemapSubEntry
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry newEntry, org.opencms.util.CmsUUID parentId, String sitemapType) Creates a sitemap folder.void
createSubEntry
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry parent) Creates a new sub-entry of an existing sitemap entry.void
createSubEntry
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry parent, org.opencms.util.CmsUUID structureId) Creates a new sub-entry of an existing sitemap entry.void
createSubEntry
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry newEntry, org.opencms.util.CmsUUID parentId, org.opencms.util.CmsUUID structureId) Registers a new sitemap entry.void
createSubSitemap
(org.opencms.util.CmsUUID entryId) Creates a sub-sitemap from the subtree of the current sitemap starting at the given entry.void
Deletes the given entry and all its descendants.void
deleteCategory
(org.opencms.util.CmsUUID id) Deletes a category.void
disableModelPage
(org.opencms.util.CmsUUID id, boolean disable) Disables the given model page entry within the configuration.void
edit
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry, List<org.opencms.gwt.shared.property.CmsPropertyModification> propertyChanges, CmsReloadMode reloadStatus) Edits the given sitemap entry.void
editAndChangeName
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry, String newUrlName, List<org.opencms.gwt.shared.property.CmsPropertyModification> propertyChanges, boolean keepNewStatus, CmsReloadMode reloadStatus) Edits an entry and changes its URL name.static void
editPropertiesForLocaleCompareMode
(org.opencms.ade.sitemap.shared.CmsLocaleComparePropertyData data, org.opencms.util.CmsUUID ownId, org.opencms.util.CmsUUID defaultFileId, String noEditReason) Opens the property editor for locale compare mode.void
ensureUniqueName
(String parentFolder, String newName, I_CmsSimpleCallback<String> callback) Ensure the uniqueness of a given URL-name within the children of the given parent folder.void
ensureUniqueName
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry parent, String newName, I_CmsSimpleCallback<String> callback) Ensure the uniqueness of a given URL-name within the children of the given parent site-map entry.void
executePropertyModification
(org.opencms.gwt.shared.property.CmsPropertyModification propMod) Applies the given property modification.org.opencms.ade.sitemap.shared.CmsSitemapCategoryData
Gets the category data.protected org.opencms.ade.sitemap.shared.CmsSitemapChange
getChangeForEdit
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry, List<org.opencms.gwt.shared.property.CmsPropertyModification> propertyChanges) Creates a change object for an edit operation.void
getChildren
(org.opencms.util.CmsUUID entryId, boolean setOpen, boolean continueIfParentNotLoaded, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry> callback) Retrieves the child entries of the given node from the server.void
getChildren
(org.opencms.util.CmsUUID entryId, boolean setOpen, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry> callback) Retrieves the child entries of the given node from the server.org.opencms.ade.sitemap.shared.CmsSitemapData
getData()
Returns the sitemap data.org.opencms.ade.detailpage.CmsDetailPageInfo
getDetailPageInfo
(org.opencms.util.CmsUUID id) Returns the detail page info for a given entry id.org.opencms.ade.sitemap.shared.CmsDetailPageTable
Returns the detail page table.getEffectiveProperty
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry, String name) Gets the effective value of a property value for a sitemap entry.org.opencms.gwt.shared.property.CmsClientProperty
getEffectivePropertyObject
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry, String name) Gets the value of a property which is effective at a given sitemap entry.Map<org.opencms.util.CmsUUID,
org.opencms.ade.sitemap.shared.CmsClientSitemapEntry> getEntriesById
(Collection<org.opencms.util.CmsUUID> ids) Returns all entries with an id from a given list.org.opencms.ade.sitemap.shared.CmsClientSitemapEntry
Returns the tree entry with the given path.org.opencms.ade.sitemap.shared.CmsClientSitemapEntry
getEntryById
(org.opencms.util.CmsUUID id) Finds an entry by id.protected String
Returns the URI of the current sitemap.org.opencms.ade.sitemap.shared.CmsGalleryType
getGalleryType
(Integer typeId) Returns the gallery type with the given id.getInheritedProperty
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry, String name) Gets the value for a property which a sitemap entry would inherit if it didn't have its own properties.org.opencms.gwt.shared.property.CmsClientProperty
getInheritedPropertyObject
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry, String name) Gets the property object which would be inherited by a sitemap entry.List<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry>
getLoadedDescendants
(String path) Returns a list of all descendant sitemap entries of a given path which have already been loaded on the client.getNoEditReason
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry) Returns the no edit reason ornull
if editing is allowed.getNoEditReason
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry, boolean checkChildLocks) Returns the no edit reason ornull
if editing is allowed.org.opencms.ade.sitemap.shared.CmsClientSitemapEntry
getParentEntry
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry) Returns the parent entry of a sitemap entry, or null if it is the root entry.protected String
Helper method for getting the full path of a sitemap entry whose URL name is being edited.getPropertiesForId
(org.opencms.util.CmsUUID id) Gets the properties for a given structure id.org.opencms.ade.sitemap.shared.rpc.I_CmsSitemapServiceAsync
Returns the sitemap service instance.protected org.opencms.gwt.shared.rpc.I_CmsVfsServiceAsync
Returns the sitemap service instance.void
Leaves the current sitemap to open the parent sitemap.void
hideInNavigation
(org.opencms.util.CmsUUID entryId) Hides the entry within the site navigation.protected void
Initializes the detail page information.boolean
isDetailPage
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry) Checks whether this entry belongs to a detail page.boolean
isDetailPage
(org.opencms.util.CmsUUID id) Returns true if the id is the id of a detail page.boolean
Checks if the current sitemap is editable.boolean
isHiddenProperty
(String propertyName) Checks whether a string is the name of a hidden property.boolean
Returns true if the locale comparison mode is enabled.boolean
Checks if the given site path is the sitemap root.void
leaveEditor
(String target) Ask to save the page before leaving, if necessary.void
loadCategories
(boolean openLocalCategories, org.opencms.util.CmsUUID openItemId) Loads and displays the category data.void
Loads all available galleries for the current sub site.void
Loads the model pages.void
loadNewElementInfo
(com.google.gwt.user.client.rpc.AsyncCallback<Void> callback) Loads the new element info.void
Loads all entries on the given path.void
loadPath
(String sitePath, boolean continueIfNotLoaded, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry> callback) Loads all entries on the given path.void
loadPath
(String sitePath, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry> callback) Loads the sitemap entry for the given site path.protected void
makeNewEntry
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry parent, I_CmsSimpleCallback<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry> callback) Creates a new client sitemap entry bean to use for the RPC call which actually creates the entry on the server side.void
mergeSubSitemap
(org.opencms.util.CmsUUID entryId) Merges a subsitemap at the given id back into this sitemap.void
Moves the given sitemap entry with all its descendants to the new position.void
openPropertyDialogForVaadin
(org.opencms.util.CmsUUID structureId, org.opencms.util.CmsUUID rootId) Opens the property dialog for the locale comparison mode.void
openSiteMap
(String sitePath) Opens the site-map specified.void
openSiteMap
(String sitePath, boolean siteChange) Opens the site-map specified.void
Recomputes properties for all sitemap entries.protected void
recomputeProperties
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry) Recomputes the properties for a client sitemap entry.void
refreshRoot
(com.google.gwt.user.client.rpc.AsyncCallback<Void> callback) Refreshes the root entry.void
registerEntry
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry) void
registerPathChange
(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry, String oldPath) void
removeFromNavigation
(org.opencms.util.CmsUUID entryId) Removes the entry with the given site-path from navigation.void
removeModelPage
(org.opencms.util.CmsUUID id, com.google.gwt.user.client.rpc.AsyncCallback<Void> asyncCallback) Removes a model page from the sitemap's configuration.replaceProperties
(org.opencms.util.CmsUUID id, Map<String, org.opencms.gwt.shared.property.CmsClientProperty> properties) static <A,
B> B safeLookup
(Map<A, B> map, A key) Helper method for looking up a value in a map which may be null.void
setEditorModeInSession
(org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode editorMode) Sets the editor mode in the user session.void
showInNavigation
(org.opencms.util.CmsUUID entryId) Shows a formerly hidden entry in the navigation.void
Undeletes the resource with the given structure id.void
updateEntry
(String sitePath) Updates the given entry.void
updateEntry
(org.opencms.util.CmsUUID entryId) Updates the given entry.void
updateEntry
(org.opencms.util.CmsUUID entryId, com.google.gwt.user.client.rpc.AsyncCallback<Void> callback) Updates the given entry.void
updateSingleEntry
(org.opencms.util.CmsUUID entryId) Updates the given entry only, not evaluating any child changes.
-
Field Details
-
NEW_ENTRY_NAME
The name to use for new entries.- See Also:
-
m_allDetailPageInfos
protected Map<org.opencms.util.CmsUUID,org.opencms.ade.detailpage.CmsDetailPageInfo> m_allDetailPageInfosA map of *all* detail page info beans, indexed by page id. -
m_data
The sitemap data. -
m_detailPageTable
The detail page table. -
m_eventBus
The event bus.
-
-
Constructor Details
-
CmsSitemapController
public CmsSitemapController()Constructor.
-
-
Method Details
-
safeLookup
Helper method for looking up a value in a map which may be null.- Type Parameters:
A
- the key typeB
- the value type- Parameters:
map
- the map (which may be null)key
- the map key- Returns:
- the value of the map at the given key, or null if the map is null
-
addChangeHandler
public com.google.gwt.event.shared.HandlerRegistration addChangeHandler(I_CmsSitemapChangeHandler handler) Adds a new change event handler.- Parameters:
handler
- the handler to add- Returns:
- the handler registration
-
addDetailPageInfo
Adds a new detail page information bean.- Parameters:
info
- the detail page information bean to add
-
addLoadHandler
public com.google.gwt.event.shared.HandlerRegistration addLoadHandler(I_CmsSitemapLoadHandler handler) Adds a new load event handler.- Parameters:
handler
- the handler to add- Returns:
- the handler registration
-
addPropertyUpdateHandler
Adds a handler for property changes caused by user edits.- Parameters:
handler
- a new handler for property updates caused by the user
-
changeCategory
Changes the given category.- Parameters:
id
- the category idtitle
- the new category titlename
- the new category name
-
clearDeletedList
Clears the deleted clip-board list and commits the change. -
clearModifiedList
Clears the modified clip-board list and commits the change. -
createCategory
Creates a new category.- Parameters:
id
- the parent category id, or the null uuid for a new top-level categorytitle
- the title of the categoryname
- the name of the category
-
createNewGallery
Creates a new gallery folder of the given type.- Parameters:
parentId
- the parent folder idgalleryTypeId
- the folder type idtitle
- the folder title
-
createNewModelPage
public void createNewModelPage(String title, String description, org.opencms.util.CmsUUID copyId, boolean isModelGroup) Creates a new model page.- Parameters:
title
- the title of the model pagedescription
- the description of the model pagecopyId
- the structure id of the resource which should be used as a copy model for the new pageisModelGroup
- in case of a model group page
-
createSubSitemap
Creates a sub-sitemap from the subtree of the current sitemap starting at the given entry.- Parameters:
entryId
- the id of the entry
-
delete
Deletes the given entry and all its descendants.- Parameters:
sitePath
- the site path of the entry to delete
-
deleteCategory
Deletes a category.- Parameters:
id
- the id of the category
-
disableModelPage
Disables the given model page entry within the configuration.- Parameters:
id
- the entry iddisable
-true
to disable the entry
-
ensureUniqueName
public void ensureUniqueName(String parentFolder, String newName, I_CmsSimpleCallback<String> callback) Ensure the uniqueness of a given URL-name within the children of the given parent folder.- Parameters:
parentFolder
- the parent foldernewName
- the proposed namecallback
- the callback to execute
-
getCategoryData
Gets the category data.- Returns:
- the category data
-
getChildren
public void getChildren(org.opencms.util.CmsUUID entryId, boolean setOpen, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry> callback) Retrieves the child entries of the given node from the server.- Parameters:
entryId
- the entry idsetOpen
- if the entry should be openedcallback
- the callback to execute after the children have been loaded
-
getChildren
public void getChildren(org.opencms.util.CmsUUID entryId, boolean setOpen, boolean continueIfParentNotLoaded, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry> callback) Retrieves the child entries of the given node from the server.- Parameters:
entryId
- the entry idsetOpen
- if the entry should be openedcontinueIfParentNotLoaded
- if false, and the entry identified by the id has not been loaded, stop; else store the entry in memorycallback
- the callback to execute after the children have been loaded
-
getData
Returns the sitemap data.- Returns:
- the sitemap data
-
getDetailPageInfo
Returns the detail page info for a given entry id.- Parameters:
id
- a sitemap entry id- Returns:
- the detail page info for that id
-
getDetailPageTable
Returns the detail page table.- Returns:
- the detail page table
-
getEntriesById
public Map<org.opencms.util.CmsUUID,org.opencms.ade.sitemap.shared.CmsClientSitemapEntry> getEntriesById(Collection<org.opencms.util.CmsUUID> ids) Returns all entries with an id from a given list.- Parameters:
ids
- a list of sitemap entry ids- Returns:
- all entries whose id is contained in the id list
-
getEntry
Returns the tree entry with the given path.- Parameters:
entryPath
- the path to look for- Returns:
- the tree entry with the given path, or
null
if not found
-
getEntryById
public org.opencms.ade.sitemap.shared.CmsClientSitemapEntry getEntryById(org.opencms.util.CmsUUID id) Finds an entry by id.- Parameters:
id
- the id of the entry to find- Returns:
- the found entry, or null if the entry wasn't found
-
getGalleryType
Returns the gallery type with the given id.- Parameters:
typeId
- the type id- Returns:
- the gallery type
-
getLoadedDescendants
Returns a list of all descendant sitemap entries of a given path which have already been loaded on the client.- Parameters:
path
- the path for which the descendants should be collected- Returns:
- the list of descendant sitemap entries
-
getPropertiesForId
public Map<String,org.opencms.gwt.shared.property.CmsClientProperty> getPropertiesForId(org.opencms.util.CmsUUID id) Gets the properties for a given structure id.- Specified by:
getPropertiesForId
in interfaceorg.opencms.ade.sitemap.shared.I_CmsSitemapController
- Parameters:
id
- the structure id of a sitemap entry- Returns:
- the properties for that structure id
-
getService
Returns the sitemap service instance.- Returns:
- the sitemap service instance
-
gotoParentSitemap
Leaves the current sitemap to open the parent sitemap. -
isDetailPage
Returns true if the id is the id of a detail page.- Parameters:
id
- the sitemap entry id- Returns:
- true if the id is the id of a detail page entry
-
isEditable
Checks if the current sitemap is editable.- Returns:
true
if the current sitemap is editable
-
isHiddenProperty
Checks whether a string is the name of a hidden property.A hidden property is a property which should not appear in the property editor because it requires special treatment.
- Parameters:
propertyName
- the property name which should be checked- Returns:
- true if the argument is the name of a hidden property
-
isLocaleComparisonEnabled
Returns true if the locale comparison mode is enabled.- Returns:
- true if the locale comparison mode is enabled
-
isRoot
Checks if the given site path is the sitemap root.- Parameters:
sitePath
- the site path to check- Returns:
true
if the given site path is the sitemap root
-
leaveEditor
Ask to save the page before leaving, if necessary.- Parameters:
target
- the leaving target
-
loadCategories
Loads and displays the category data.- Parameters:
openLocalCategories
- true if the local category tree should be openedopenItemId
- the id of the item to open
-
loadGalleries
Loads all available galleries for the current sub site. -
loadModelPages
Loads the model pages. -
loadNewElementInfo
Loads the new element info.- Parameters:
callback
- the callback to call when done
-
loadPath
Loads all entries on the given path.- Parameters:
sitePath
- the site path
-
loadPath
public void loadPath(String sitePath, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry> callback) Loads the sitemap entry for the given site path.- Parameters:
sitePath
- the site pathcallback
- the callback
-
loadPath
public void loadPath(String sitePath, boolean continueIfNotLoaded, com.google.gwt.user.client.rpc.AsyncCallback<org.opencms.ade.sitemap.shared.CmsClientSitemapEntry> callback) Loads all entries on the given path.- Parameters:
sitePath
- the site pathcontinueIfNotLoaded
- parameter passed to getChildrencallback
- the callback to execute when done
-
mergeSubSitemap
Merges a subsitemap at the given id back into this sitemap.- Parameters:
entryId
- the id of the sub sitemap entry
-
openPropertyDialogForVaadin
public void openPropertyDialogForVaadin(org.opencms.util.CmsUUID structureId, org.opencms.util.CmsUUID rootId) Opens the property dialog for the locale comparison mode.- Parameters:
structureId
- the structure id of the sitemap entry to editrootId
- the structure id of the resource comparing to the tree root in sitemap compare mode
-
openSiteMap
Opens the site-map specified.- Parameters:
sitePath
- the site path to the site-map folder
-
openSiteMap
Opens the site-map specified.- Parameters:
sitePath
- the site path to the site-map foldersiteChange
- in case the site was changed
-
recomputeProperties
Recomputes properties for all sitemap entries. -
refreshRoot
Refreshes the root entry.- Parameters:
callback
- the callback to call after the entry has been refreshed
-
removeModelPage
public void removeModelPage(org.opencms.util.CmsUUID id, com.google.gwt.user.client.rpc.AsyncCallback<Void> asyncCallback) Removes a model page from the sitemap's configuration.- Parameters:
id
- the structure id of the model pageasyncCallback
- the callback to call when done
-
replaceProperties
public Map<String,org.opencms.gwt.shared.property.CmsClientProperty> replaceProperties(org.opencms.util.CmsUUID id, Map<String, org.opencms.gwt.shared.property.CmsClientProperty> properties) - Specified by:
replaceProperties
in interfaceorg.opencms.ade.sitemap.shared.I_CmsSitemapController
- See Also:
-
I_CmsSitemapController.replaceProperties(org.opencms.util.CmsUUID, java.util.Map)
-
undelete
Undeletes the resource with the given structure id.- Parameters:
entryId
- the entry idsitePath
- the site-path
-
updateEntry
Updates the given entry.- Parameters:
entryId
- the entry id
-
updateEntry
public void updateEntry(org.opencms.util.CmsUUID entryId, com.google.gwt.user.client.rpc.AsyncCallback<Void> callback) Updates the given entry.- Parameters:
entryId
- the entry idcallback
- the callback to call after the entry has been updated
-
updateEntry
Updates the given entry.- Parameters:
sitePath
- the entry sitepath
-
updateSingleEntry
Updates the given entry only, not evaluating any child changes.- Parameters:
entryId
- the entry id
-
getEntryPoint
Returns the URI of the current sitemap.- Returns:
- the URI of the current sitemap
-
getVfsService
Returns the sitemap service instance.- Returns:
- the sitemap service instance
-
initDetailPageInfos
Initializes the detail page information.