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
Nested ClassesModifier and TypeClassDescriptionprotected classHelper class for representing information about a lock. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe path of the JSP used to download aliases.static final StringThe path to the JSP used to upload aliases.static final StringThe show model edit confirm dialog attribute name.Properties to remove from the copied template when creating a new sitemap entry.static final StringThe galleries folder name.static final StringThe 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddAliasImportResult(List<CmsAliasImportResult> results) Adds an alias import result.voidchangeCategory(String entryPoint, CmsUUID id, String title, String name) Sets the name and title of the given category.voidChecks the permissions of the current user to match the required security level.voidcreateCategory(String entryPoint, CmsUUID id, String title, String name) Creates a new category.static CmsClientPropertycreateClientProperty(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.voiddisableModelPage(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.LockInfoensureLockAndGetInfo(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 CmsSitemapDataFetches the sitemap data.prepareReloadSitemap(CmsUUID rootId, CmsSitemapData.EditorMode mode) Prepares sitemap reloading for the given sitemap root.voidremoveModelPage(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 CmsSitemapChangesaveInternal(String entryPoint, CmsSitemapChange change) Internal method for saving a sitemap.voidsavePropertiesForLocaleCompareMode(CmsUUID id, String newUrlName, List<CmsPropertyModification> propertyChanges, boolean editedName) Saves the changed properties in locale comparison mode.voidsaveSitemapAttributes(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.voidsetEditorMode(CmsSitemapData.EditorMode editorMode) Sets the editor mode in the current user session.voidupdateAliasEditorStatus(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, tryUnlockMethods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet
checkPermutationStrongName, getCodeServerPolicyUrl, getRequestModuleBasePath, getSerializationPolicy, init, loadPolicyFromCodeServer, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processCall, processPost, shouldCompressResponseMethods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
doPost, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContentMethods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, serviceMethods 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_CmsSitemapServiceSets the name and title of the given category.- Specified by:
changeCategoryin 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:CmsGwtServiceChecks 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:
checkPermissionsin 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_CmsSitemapServiceCreates a new category.- Specified by:
createCategoryin 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_CmsSitemapServiceCreates a new gallery folder.- Specified by:
createNewGalleryFolderin 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_CmsSitemapServiceCreates a new model page.- Specified by:
createNewModelPagein 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-trueto 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_CmsSitemapServiceCreates a sub-sitemap of the given sitemap starting from the given entry.- Specified by:
createSubSitemapin 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_CmsSitemapServiceSets the disabled flag of a model page within the current sitemap configuration.- Specified by:
disableModelPagein 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_CmsSitemapServiceLoads the data for the attribute editor dialog and locks the sitemap configuration.- Specified by:
editAttributeDatain 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_CmsSitemapServiceGets the alias import results from the server.- Specified by:
getAliasImportResultin 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_CmsSitemapServiceGets the initial data for the bulk alias editor.- Specified by:
getAliasTablein interfaceI_CmsSitemapService- Returns:
- the initial data for the alias editor
- Throws:
CmsRpcException- if something goes wrong- See Also:
-
getCategoryData
Description copied from interface:I_CmsSitemapServiceGets the category data for the given entry point.- Specified by:
getCategoryDatain 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_CmsSitemapServiceReturns the sitemap children for the given path.- Specified by:
getChildrenin 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_CmsSitemapServiceReturns the gallery data to this sub site.- Specified by:
getGalleryDatain interfaceI_CmsSitemapService- Parameters:
entryPointUri- the sub site folder- Returns:
- the gallery data to this sub site
- See Also:
-
getModelInfos
Description copied from interface:I_CmsSitemapServiceGets the model pages for the given structure id of the sitemap root folder.- Specified by:
getModelInfosin 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_CmsSitemapServiceLoads the model page data for the "add" menu.- Specified by:
getNewElementInfoin 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_CmsSitemapServiceFetches the link for a resource selected in the sitemap editor.- Specified by:
getResourceLinkin 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_CmsSitemapServiceLoads the data needed by the property editor in the locale comparison view.- Specified by:
loadPropertyDataForLocaleCompareViewin 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_CmsSitemapServiceMerges a sub-sitemap into it's parent sitemap.- Specified by:
mergeSubSitemapin 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_CmsSitemapServiceReturns the initialization data for the given sitemap.- Specified by:
prefetchin 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_CmsSitemapServiceRemoves a model page from the current sitemap configuration.- Specified by:
removeModelPagein 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_CmsSitemapServiceSaves the changed properties in locale comparison mode.- Specified by:
savePropertiesForLocaleCompareModein 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_CmsSitemapServiceSaves the data from the sitemap attribute editor dialog to the sitemap configuration.- Specified by:
saveSitemapAttributesin interfaceI_CmsSitemapService- Parameters:
rootId- the root IDattributes- the sitemap attributes- Throws:
CmsRpcException- if something goes wrong- See Also:
-
setDefaultModel
Description copied from interface:I_CmsSitemapServiceSets the default model page for the given sub-sitemap, returns the updated model info.- Specified by:
setDefaultModelin 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_CmsSitemapServiceUpdates the alias editor status.This is used to keep two users from editing the alias table for a site root concurrently.
- Specified by:
updateAliasEditorStatusin 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
-