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
FieldsModifier 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.CmsSitemapDataThe sitemap data.protected org.opencms.ade.sitemap.shared.CmsDetailPageTableThe detail page table.protected com.google.gwt.event.shared.SimpleEventBusThe event bus.static final StringThe name to use for new entries. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gwt.event.shared.HandlerRegistrationAdds a new change event handler.voidaddDetailPageInfo(org.opencms.ade.detailpage.CmsDetailPageInfo info) Adds a new detail page information bean.com.google.gwt.event.shared.HandlerRegistrationaddLoadHandler(I_CmsSitemapLoadHandler handler) Adds a new load event handler.voidAdds a handler for property changes caused by user edits.voidaddToNavigation(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry) Adds the entry to the navigation.protected voidapplyChange(org.opencms.ade.sitemap.shared.CmsSitemapChange change) Fires a sitemap change event.voidbump(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry) Makes the given sitemap entry the default detail page for its detail page type.voidchangeCategory(org.opencms.util.CmsUUID id, String title, String name) Changes the given category.voidClears the deleted clip-board list and commits the change.voidClears the modified clip-board list and commits the change.protected voidcommitChange(org.opencms.ade.sitemap.shared.CmsSitemapChange change, com.google.gwt.user.client.Command callback) Adds a change to the queue.voidcreate(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.voidcreateCategory(org.opencms.util.CmsUUID id, String title, String name) Creates a new category.voidcreateNewGallery(org.opencms.util.CmsUUID parentId, int galleryTypeId, String title) Creates a new gallery folder of the given type.voidcreateNewModelPage(String title, String description, org.opencms.util.CmsUUID copyId, boolean isModelGroup) Creates a new model page.voidcreateSitemapSubEntry(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry parent, String sitemapFolderType) Creates a new sub-entry which is a subsitemap.voidcreateSitemapSubEntry(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry newEntry, org.opencms.util.CmsUUID parentId, String sitemapType) Creates a sitemap folder.voidcreateSubEntry(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry parent) Creates a new sub-entry of an existing sitemap entry.voidcreateSubEntry(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry parent, org.opencms.util.CmsUUID structureId) Creates a new sub-entry of an existing sitemap entry.voidcreateSubEntry(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry newEntry, org.opencms.util.CmsUUID parentId, org.opencms.util.CmsUUID structureId) Registers a new sitemap entry.voidcreateSubSitemap(org.opencms.util.CmsUUID entryId) Creates a sub-sitemap from the subtree of the current sitemap starting at the given entry.voidDeletes the given entry and all its descendants.voiddeleteCategory(org.opencms.util.CmsUUID id) Deletes a category.voiddisableModelPage(org.opencms.util.CmsUUID id, boolean disable) Disables the given model page entry within the configuration.voidedit(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry, List<org.opencms.gwt.shared.property.CmsPropertyModification> propertyChanges, CmsReloadMode reloadStatus) Edits the given sitemap entry.voideditAndChangeName(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 voideditPropertiesForLocaleCompareMode(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.voidensureUniqueName(String parentFolder, String newName, I_CmsSimpleCallback<String> callback) Ensure the uniqueness of a given URL-name within the children of the given parent folder.voidensureUniqueName(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.voidexecutePropertyModification(org.opencms.gwt.shared.property.CmsPropertyModification propMod) Applies the given property modification.org.opencms.ade.sitemap.shared.CmsSitemapCategoryDataGets the category data.protected org.opencms.ade.sitemap.shared.CmsSitemapChangegetChangeForEdit(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry, List<org.opencms.gwt.shared.property.CmsPropertyModification> propertyChanges) Creates a change object for an edit operation.voidgetChildren(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.voidgetChildren(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.CmsSitemapDatagetData()Returns the sitemap data.org.opencms.ade.detailpage.CmsDetailPageInfogetDetailPageInfo(org.opencms.util.CmsUUID id) Returns the detail page info for a given entry id.org.opencms.ade.sitemap.shared.CmsDetailPageTableReturns 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.CmsClientPropertygetEffectivePropertyObject(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.CmsClientSitemapEntryReturns the tree entry with the given path.org.opencms.ade.sitemap.shared.CmsClientSitemapEntrygetEntryById(org.opencms.util.CmsUUID id) Finds an entry by id.protected StringReturns the URI of the current sitemap.org.opencms.ade.sitemap.shared.CmsGalleryTypegetGalleryType(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.CmsClientPropertygetInheritedPropertyObject(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 ornullif editing is allowed.getNoEditReason(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry, boolean checkChildLocks) Returns the no edit reason ornullif editing is allowed.org.opencms.ade.sitemap.shared.CmsClientSitemapEntrygetParentEntry(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry) Returns the parent entry of a sitemap entry, or null if it is the root entry.protected StringHelper 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_CmsSitemapServiceAsyncReturns the sitemap service instance.protected org.opencms.gwt.shared.rpc.I_CmsVfsServiceAsyncReturns the sitemap service instance.voidLeaves the current sitemap to open the parent sitemap.voidhideInNavigation(org.opencms.util.CmsUUID entryId) Hides the entry within the site navigation.protected voidInitializes the detail page information.booleanisDetailPage(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry) Checks whether this entry belongs to a detail page.booleanisDetailPage(org.opencms.util.CmsUUID id) Returns true if the id is the id of a detail page.booleanChecks if the current sitemap is editable.booleanisHiddenProperty(String propertyName) Checks whether a string is the name of a hidden property.booleanReturns true if the locale comparison mode is enabled.booleanChecks if the given site path is the sitemap root.voidleaveEditor(String target) Ask to save the page before leaving, if necessary.voidloadCategories(boolean openLocalCategories, org.opencms.util.CmsUUID openItemId) Loads and displays the category data.voidLoads all available galleries for the current sub site.voidLoads the model pages.voidloadNewElementInfo(com.google.gwt.user.client.rpc.AsyncCallback<Void> callback) Loads the new element info.voidLoads all entries on the given path.voidloadPath(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.voidloadPath(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 voidmakeNewEntry(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.voidmergeSubSitemap(org.opencms.util.CmsUUID entryId) Merges a subsitemap at the given id back into this sitemap.voidMoves the given sitemap entry with all its descendants to the new position.voidopenPropertyDialogForVaadin(org.opencms.util.CmsUUID structureId, org.opencms.util.CmsUUID rootId) Opens the property dialog for the locale comparison mode.voidopenSiteMap(String sitePath) Opens the site-map specified.voidopenSiteMap(String sitePath, boolean siteChange) Opens the site-map specified.voidRecomputes properties for all sitemap entries.protected voidrecomputeProperties(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry) Recomputes the properties for a client sitemap entry.voidrefreshRoot(com.google.gwt.user.client.rpc.AsyncCallback<Void> callback) Refreshes the root entry.voidregisterEntry(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry) voidregisterPathChange(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry, String oldPath) voidremoveFromNavigation(org.opencms.util.CmsUUID entryId) Removes the entry with the given site-path from navigation.voidremoveModelPage(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.voidsetEditorModeInSession(org.opencms.ade.sitemap.shared.CmsSitemapData.EditorMode editorMode) Sets the editor mode in the user session.voidshowInNavigation(org.opencms.util.CmsUUID entryId) Shows a formerly hidden entry in the navigation.voidUndeletes the resource with the given structure id.voidupdateEntry(String sitePath) Updates the given entry.voidupdateEntry(org.opencms.util.CmsUUID entryId) Updates the given entry.voidupdateEntry(org.opencms.util.CmsUUID entryId, com.google.gwt.user.client.rpc.AsyncCallback<Void> callback) Updates the given entry.voidupdateSingleEntry(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-trueto 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
nullif 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:
getPropertiesForIdin 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:
trueif 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:
trueif 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:
replacePropertiesin interfaceorg.opencms.ade.sitemap.shared.I_CmsSitemapController- See Also:
-
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.