Package org.opencms.ade.sitemap
Class CmsVfsSitemapService
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
com.google.gwt.user.server.rpc.RemoteServiceServlet
org.opencms.gwt.CmsGwtService
org.opencms.ade.sitemap.CmsVfsSitemapService
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService
,com.google.gwt.user.server.rpc.SerializationPolicyProvider
,Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
,I_CmsSitemapService
Handles all RPC services related to the vfs sitemap.
- Since:
- 8.0.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
Helper class for representing information about a lock. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The path of the JSP used to download aliases.static final String
The path to the JSP used to upload aliases.static final String
The show model edit confirm dialog attribute name.Properties to remove from the copied template when creating a new sitemap entry.static final String
The galleries folder name.static final String
The configuration key for the functionDetail attribute in the container.info property.Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
perThreadRequest, perThreadResponse
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
addAliasImportResult
(List<CmsAliasImportResult> results) Adds an alias import result.void
changeCategory
(String entryPoint, CmsUUID id, String title, String name) Sets the name and title of the given category.void
Checks the permissions of the current user to match the required security level.void
createCategory
(String entryPoint, CmsUUID id, String title, String name) Creates a new category.static CmsClientProperty
createClientProperty
(CmsProperty prop, boolean preserveOrigin) Creates a client property bean from a server-side property.createNewGalleryFolder
(String parentFolder, String title, int folderTypeId) Creates a new gallery folder.createNewModelPage
(String entryPointUri, String title, String description, CmsUUID copyId, boolean isModelGroup) Creates a new model page.createSubSitemap
(CmsUUID entryId) Creates a sub-sitemap of the given sitemap starting from the given entry.void
disableModelPage
(String baseUri, CmsUUID modelPageId, boolean disabled) Sets the disabled flag of a model page within the current sitemap configuration.editAttributeData
(CmsUUID rootId) Loads the data for the attribute editor dialog and locks the sitemap configuration.protected CmsVfsSitemapService.LockInfo
ensureLockAndGetInfo
(CmsResource resource) Locks the given resource with a temporary, if not already locked by the current user.getAliasImportResult
(String resultKey) Gets the alias import results from the server.Gets the initial data for the bulk alias editor.getCategoryData
(String entryPoint) Gets the category data for the given entry point.getChildren
(String entryPointUri, CmsUUID entryId, int levels) Returns the sitemap children for the given path.getGalleryData
(String entryPointUri) Returns the gallery data to this sub site.getModelInfos
(CmsUUID rootId) Gets the model pages for the given structure id of the sitemap root folder.getNewElementInfo
(String entryPointUri) Loads the model page data for the "add" menu.getResourceLink
(CmsUUID baseId, String sitePath) Fetches the link for a resource selected in the sitemap editor.loadPropertyDataForLocaleCompareView
(CmsUUID id, CmsUUID rootId) Loads the data needed by the property editor in the locale comparison view.mergeSubSitemap
(String entryPoint, CmsUUID subSitemapId) Merges a sub-sitemap into it's parent sitemap.Returns the initialization data for the given sitemap.static CmsSitemapData
Fetches the sitemap data.prepareReloadSitemap
(CmsUUID rootId, CmsSitemapData.EditorMode mode) Prepares sitemap reloading for the given sitemap root.void
removeModelPage
(String entryPointUri, CmsUUID id) Removes a model page from the current sitemap configuration.save
(String entryPoint, CmsSitemapChange change) Saves the change to the given sitemap.saveAliases
(CmsAliasSaveValidationRequest saveRequest) Saves the aliases for the bulk alias editor.protected CmsSitemapChange
saveInternal
(String entryPoint, CmsSitemapChange change) Internal method for saving a sitemap.void
savePropertiesForLocaleCompareMode
(CmsUUID id, String newUrlName, List<CmsPropertyModification> propertyChanges, boolean editedName) Saves the changed properties in locale comparison mode.void
saveSitemapAttributes
(CmsUUID rootId, Map<String, String> attributes) Saves the data from the sitemap attribute editor dialog to the sitemap configuration.setDefaultModel
(CmsUUID rootId, CmsUUID modelId) Sets the default model page for the given sub-sitemap, returns the updated model info.void
setEditorMode
(CmsSitemapData.EditorMode editorMode) Sets the editor mode in the current user session.void
updateAliasEditorStatus
(boolean editing) Updates the alias editor status.validateAliases
(CmsAliasEditValidationRequest validationRequest) Validates the aliases for the bulk alias editor.validateRewriteAliases
(CmsRewriteAliasValidationRequest validationRequest) Validates rewrite aliases.Methods inherited from class org.opencms.gwt.CmsGwtService
clearThreadStorage, doGetSerializationPolicy, doUnexpectedFailure, ensureLock, ensureLock, ensureLock, ensureLock, ensureSession, error, getCmsObject, getPropertiesByName, getRequest, getResponse, isBroadcastCall, log, log, logError, service, setBroadcastPoll, setCms, setContext, setRequest, setResponse, tryUnlock
Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet
checkPermutationStrongName, getCodeServerPolicyUrl, getRequestModuleBasePath, getSerializationPolicy, init, loadPolicyFromCodeServer, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processCall, processPost, shouldCompressResponse
Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
doPost, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContent
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init
-
Field Details
-
ALIAS_DOWNLOAD_PATH
The path of the JSP used to download aliases.- See Also:
-
ALIAS_IMPORT_PATH
The path to the JSP used to upload aliases.- See Also:
-
ATTR_SHOW_MODEL_EDIT_CONFIRM
The show model edit confirm dialog attribute name.- See Also:
-
FILTER_PROPERTIES
Properties to remove from the copied template when creating a new sitemap entry. -
GALLERIES_FOLDER_NAME
The galleries folder name.- See Also:
-
KEY_FUNCTION_DETAIL
The configuration key for the functionDetail attribute in the container.info property.- See Also:
-
-
Constructor Details
-
CmsVfsSitemapService
public CmsVfsSitemapService()
-
-
Method Details
-
addAliasImportResult
Adds an alias import result.- Parameters:
results
- the list of alias import results to add- Returns:
- the key to retrieve the alias import results
-
createClientProperty
Creates a client property bean from a server-side property.- Parameters:
prop
- the property from which to create the client propertypreserveOrigin
- if true, the origin will be copied into the new object- Returns:
- the new client property
-
prefetch
public static CmsSitemapData prefetch(javax.servlet.http.HttpServletRequest request, String sitemapUri) throws CmsRpcException Fetches the sitemap data.- Parameters:
request
- the current requestsitemapUri
- the site relative path- Returns:
- the sitemap data
- Throws:
CmsRpcException
- if something goes wrong
-
changeCategory
public void changeCategory(String entryPoint, CmsUUID id, String title, String name) throws CmsRpcException Description copied from interface:I_CmsSitemapService
Sets the name and title of the given category.- Specified by:
changeCategory
in interfaceI_CmsSitemapService
- Parameters:
entryPoint
- the current entry pointid
- the category idtitle
- the new titlename
- the new name- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
checkPermissions
Description copied from class:CmsGwtService
Checks the permissions of the current user to match the required security level.Note that the current request and response are not available yet.
Override if needed.
- Overrides:
checkPermissions
in classCmsGwtService
- Parameters:
cms
- the current cms object- Throws:
CmsRoleViolationException
- if the security level can not be satisfied- See Also:
-
createCategory
public void createCategory(String entryPoint, CmsUUID id, String title, String name) throws CmsRpcException Description copied from interface:I_CmsSitemapService
Creates a new category.- Specified by:
createCategory
in interfaceI_CmsSitemapService
- Parameters:
entryPoint
- the entry pointid
- the parent category idtitle
- the titlename
- the category name- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
createNewGalleryFolder
public CmsGalleryFolderEntry createNewGalleryFolder(String parentFolder, String title, int folderTypeId) throws CmsRpcException Description copied from interface:I_CmsSitemapService
Creates a new gallery folder.- Specified by:
createNewGalleryFolder
in interfaceI_CmsSitemapService
- Parameters:
parentFolder
- the parent folder pathtitle
- the title propertyfolderTypeId
- the resource type id- Returns:
- the new gallery folder data
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
createNewModelPage
public CmsModelPageEntry createNewModelPage(String entryPointUri, String title, String description, CmsUUID copyId, boolean isModelGroup) throws CmsRpcException Description copied from interface:I_CmsSitemapService
Creates a new model page.- Specified by:
createNewModelPage
in interfaceI_CmsSitemapService
- Parameters:
entryPointUri
- the uri of the entry pointtitle
- the title for the model pagedescription
- the description for the model pagecopyId
- the structure id of the resource to copy to create a new model page; if null, the model page is created as an empty container pageisModelGroup
-true
to create a new model group page- Returns:
- a bean representing the created model page
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
createSubSitemap
Description copied from interface:I_CmsSitemapService
Creates a sub-sitemap of the given sitemap starting from the given entry.- Specified by:
createSubSitemap
in interfaceI_CmsSitemapService
- Parameters:
entryId
- the structure id of the sitemap entry to create a sub sitemap of- Returns:
- the sub-sitemap creation result
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
disableModelPage
public void disableModelPage(String baseUri, CmsUUID modelPageId, boolean disabled) throws CmsRpcException Description copied from interface:I_CmsSitemapService
Sets the disabled flag of a model page within the current sitemap configuration.- Specified by:
disableModelPage
in interfaceI_CmsSitemapService
- Parameters:
baseUri
- the base uri for the current sitemapmodelPageId
- structure id of the model page to removedisabled
- the disabled flag- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
editAttributeData
Description copied from interface:I_CmsSitemapService
Loads the data for the attribute editor dialog and locks the sitemap configuration.- Specified by:
editAttributeData
in interfaceI_CmsSitemapService
- Parameters:
rootId
- the root ID of the current sitemap- Returns:
- the data for the attribute editor dialog
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
getAliasImportResult
Description copied from interface:I_CmsSitemapService
Gets the alias import results from the server.- Specified by:
getAliasImportResult
in interfaceI_CmsSitemapService
- Parameters:
resultKey
- the key which identifies the alias import results to get- Returns:
- the list of alias import results
- See Also:
-
getAliasTable
Description copied from interface:I_CmsSitemapService
Gets the initial data for the bulk alias editor.- Specified by:
getAliasTable
in interfaceI_CmsSitemapService
- Returns:
- the initial data for the alias editor
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
getCategoryData
Description copied from interface:I_CmsSitemapService
Gets the category data for the given entry point.- Specified by:
getCategoryData
in interfaceI_CmsSitemapService
- Parameters:
entryPoint
- the entry point- Returns:
- the category data
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
getChildren
public CmsClientSitemapEntry getChildren(String entryPointUri, CmsUUID entryId, int levels) throws CmsRpcException Description copied from interface:I_CmsSitemapService
Returns the sitemap children for the given path.- Specified by:
getChildren
in interfaceI_CmsSitemapService
- Parameters:
entryPointUri
- the URI of the sitemap entry pointentryId
- the entry idlevels
- the count of child levels to read- Returns:
- the sitemap children
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
getGalleryData
Description copied from interface:I_CmsSitemapService
Returns the gallery data to this sub site.- Specified by:
getGalleryData
in interfaceI_CmsSitemapService
- Parameters:
entryPointUri
- the sub site folder- Returns:
- the gallery data to this sub site
- See Also:
-
getModelInfos
Description copied from interface:I_CmsSitemapService
Gets the model pages for the given structure id of the sitemap root folder.- Specified by:
getModelInfos
in interfaceI_CmsSitemapService
- Parameters:
rootId
- structure id of a folder- Returns:
- the model pages available in the given folder
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
getNewElementInfo
Description copied from interface:I_CmsSitemapService
Loads the model page data for the "add" menu.- Specified by:
getNewElementInfo
in interfaceI_CmsSitemapService
- Parameters:
entryPointUri
- the entry point uri- Returns:
- the list of resource info beans for the model pages
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
getResourceLink
Description copied from interface:I_CmsSitemapService
Fetches the link for a resource selected in the sitemap editor.- Specified by:
getResourceLink
in interfaceI_CmsSitemapService
- Parameters:
baseId
- the structure id of the current sitemap root entrysitePath
- the site path of a resource- Returns:
- the link to the resource
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
loadPropertyDataForLocaleCompareView
public CmsLocaleComparePropertyData loadPropertyDataForLocaleCompareView(CmsUUID id, CmsUUID rootId) throws CmsRpcException Description copied from interface:I_CmsSitemapService
Loads the data needed by the property editor in the locale comparison view.- Specified by:
loadPropertyDataForLocaleCompareView
in interfaceI_CmsSitemapService
- Parameters:
id
- the id of the resource for which the property editor should be openedrootId
- the structure id of the resource which corresponds to the tree root in locale compare mode- Returns:
- the property data for locale comparison mode
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
mergeSubSitemap
public CmsSitemapChange mergeSubSitemap(String entryPoint, CmsUUID subSitemapId) throws CmsRpcException Description copied from interface:I_CmsSitemapService
Merges a sub-sitemap into it's parent sitemap.- Specified by:
mergeSubSitemap
in interfaceI_CmsSitemapService
- Parameters:
entryPoint
- the sitemap entry pointsubSitemapId
- the structure id of the sub sitemap folder- Returns:
- the result of the merge operation
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
prefetch
Description copied from interface:I_CmsSitemapService
Returns the initialization data for the given sitemap.- Specified by:
prefetch
in interfaceI_CmsSitemapService
- Parameters:
sitemapUri
- the site relative path- Returns:
- the initialization data
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
removeModelPage
Description copied from interface:I_CmsSitemapService
Removes a model page from the current sitemap configuration.- Specified by:
removeModelPage
in interfaceI_CmsSitemapService
- Parameters:
entryPointUri
- the base uri for the current sitemapid
- structure id of the model page to remove- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
savePropertiesForLocaleCompareMode
public void savePropertiesForLocaleCompareMode(CmsUUID id, String newUrlName, List<CmsPropertyModification> propertyChanges, boolean editedName) throws CmsRpcException Description copied from interface:I_CmsSitemapService
Saves the changed properties in locale comparison mode.- Specified by:
savePropertiesForLocaleCompareMode
in interfaceI_CmsSitemapService
- Parameters:
id
- the structure idnewUrlName
- the new URL namepropertyChanges
- the property changeseditedName
- true if the name was edited- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
saveSitemapAttributes
public void saveSitemapAttributes(CmsUUID rootId, Map<String, String> attributes) throws CmsRpcExceptionDescription copied from interface:I_CmsSitemapService
Saves the data from the sitemap attribute editor dialog to the sitemap configuration.- Specified by:
saveSitemapAttributes
in interfaceI_CmsSitemapService
- Parameters:
rootId
- the root IDattributes
- the sitemap attributes- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
setDefaultModel
Description copied from interface:I_CmsSitemapService
Sets the default model page for the given sub-sitemap, returns the updated model info.- Specified by:
setDefaultModel
in interfaceI_CmsSitemapService
- Parameters:
rootId
- structure id of the sub-sitemap root foldermodelId
- the id of the model page to set as default- Returns:
- the updated model info
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
updateAliasEditorStatus
Description copied from interface:I_CmsSitemapService
Updates the alias editor status.This is used to keep two users from editing the alias table for a site root concurrently.
- Specified by:
updateAliasEditorStatus
in interfaceI_CmsSitemapService
- Parameters:
editing
- true to indicate that the table is still being edited, false to indicate that the table isn't being edited anymore- See Also:
-
ensureLockAndGetInfo
protected CmsVfsSitemapService.LockInfo ensureLockAndGetInfo(CmsResource resource) throws CmsException Locks the given resource with a temporary, if not already locked by the current user. Will throw an exception if the resource could not be locked for the current user.- Parameters:
resource
- the resource to lock- Returns:
- the assigned lock
- Throws:
CmsException
- if the resource could not be locked
-