org.opencms.ade.sitemap
Class CmsVfsSitemapService

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
              extended by com.google.gwt.user.server.rpc.RemoteServiceServlet
                  extended by org.opencms.gwt.CmsGwtService
                      extended by org.opencms.ade.sitemap.CmsVfsSitemapService
All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService, com.google.gwt.user.server.rpc.SerializationPolicyProvider, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, I_CmsSitemapService

public class CmsVfsSitemapService
extends CmsGwtService
implements I_CmsSitemapService

Handles all RPC services related to the vfs sitemap.

Since:
8.0.0
See Also:
I_CmsSitemapService, I_CmsSitemapServiceAsync, Serialized Form

Nested Class Summary
protected  class CmsVfsSitemapService.LockInfo
          Helper class for representing information about a lock.
 
Field Summary
static java.lang.String ALIAS_DOWNLOAD_PATH
          The path of the JSP used to download aliases.
static java.lang.String ALIAS_IMPORT_PATH
          The path to the JSP used to upload aliases.
static java.lang.String KEY_FUNCTION_DETAIL
          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
CmsVfsSitemapService()
           
 
Method Summary
static java.lang.String addAliasImportResult(java.util.List<CmsAliasImportResult> results)
          Adds an alias import result.
protected  CmsBrokenLinkBean createSitemapBrokenLinkBean(CmsResource resource)
          Creates a "broken link" bean based on a resource.
 CmsSitemapChange createSubSitemap(CmsUUID entryId)
          Creates a sub-sitemap of the given sitemap starting from the given entry.
protected  CmsVfsSitemapService.LockInfo ensureLockAndGetInfo(CmsResource resource)
          Locks the given resource with a temporary, if not already locked by the current user.
 java.util.List<CmsAliasImportResult> getAliasImportResult(java.lang.String resultKey)
          Gets the alias import results from the server.
 CmsAliasInitialFetchResult getAliasTable()
          Gets the initial data for the bulk alias editor.
 CmsClientSitemapEntry getChildren(java.lang.String entryPointUri, CmsUUID entryId, int levels)
          Returns the sitemap children for the given path.
 CmsSitemapChange mergeSubSitemap(java.lang.String entryPoint, CmsUUID subSitemapId)
          Merges a sub-sitemap into it's parent sitemap.
static CmsSitemapData prefetch(javax.servlet.http.HttpServletRequest request, java.lang.String sitemapUri)
          Fetches the sitemap data.
 CmsSitemapData prefetch(java.lang.String sitemapUri)
          Returns the initialization data for the given sitemap.
 CmsSitemapChange save(java.lang.String entryPoint, CmsSitemapChange change)
          Saves the change to the given sitemap.
 CmsAliasEditValidationReply saveAliases(CmsAliasSaveValidationRequest saveRequest)
          Saves the aliases for the bulk alias editor.
protected  CmsSitemapChange saveInternal(java.lang.String entryPoint, CmsSitemapChange change)
          Internal method for saving a sitemap.
 CmsSitemapChange saveSync(java.lang.String entryPoint, CmsSitemapChange change)
          Saves the change to the given sitemap.
 void updateAliasEditorStatus(boolean editing)
          Updates the alias editor status.
 CmsAliasEditValidationReply validateAliases(CmsAliasEditValidationRequest validationRequest)
          Validates the aliases for the bulk alias editor.
 CmsRewriteAliasValidationReply validateRewriteAliases(CmsRewriteAliasValidationRequest validationRequest)
          Validates rewrite aliases.
 
Methods inherited from class org.opencms.gwt.CmsGwtService
checkPermissions, clearThreadStorage, doGetSerializationPolicy, doUnexpectedFailure, ensureLock, ensureLock, ensureLock, ensureSession, error, getCmsObject, getPropertiesByName, getRequest, getResponse, log, log, logError, service, setCms, setContext, setRequest, setResponse, tryUnlock
 
Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet
checkPermutationStrongName, getSerializationPolicy, onAfterResponseSerialized, onBeforeRequestDeserialized, 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, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIAS_DOWNLOAD_PATH

public static final java.lang.String ALIAS_DOWNLOAD_PATH
The path of the JSP used to download aliases.

See Also:
Constant Field Values

ALIAS_IMPORT_PATH

public static final java.lang.String ALIAS_IMPORT_PATH
The path to the JSP used to upload aliases.

See Also:
Constant Field Values

KEY_FUNCTION_DETAIL

public static final java.lang.String KEY_FUNCTION_DETAIL
The configuration key for the functionDetail attribute in the container.info property.

See Also:
Constant Field Values
Constructor Detail

CmsVfsSitemapService

public CmsVfsSitemapService()
Method Detail

addAliasImportResult

public static java.lang.String addAliasImportResult(java.util.List<CmsAliasImportResult> results)
Adds an alias import result.

Parameters:
results - the list of alias import results to add
Returns:
the key to retrieve the alias import results

prefetch

public static CmsSitemapData prefetch(javax.servlet.http.HttpServletRequest request,
                                      java.lang.String sitemapUri)
                               throws CmsRpcException
Fetches the sitemap data.

Parameters:
request - the current request
sitemapUri - the site relative path
Returns:
the sitemap data
Throws:
CmsRpcException - if something goes wrong

createSubSitemap

public CmsSitemapChange createSubSitemap(CmsUUID entryId)
                                  throws CmsRpcException
Description copied from interface: I_CmsSitemapService
Creates a sub-sitemap of the given sitemap starting from the given entry.

Specified by:
createSubSitemap in interface I_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:
I_CmsSitemapService.createSubSitemap(org.opencms.util.CmsUUID)

getAliasImportResult

public java.util.List<CmsAliasImportResult> getAliasImportResult(java.lang.String resultKey)
Description copied from interface: I_CmsSitemapService
Gets the alias import results from the server.

Specified by:
getAliasImportResult in interface I_CmsSitemapService
Parameters:
resultKey - the key which identifies the alias import results to get
Returns:
the list of alias import results
See Also:
I_CmsSitemapService.getAliasImportResult(java.lang.String)

getAliasTable

public CmsAliasInitialFetchResult getAliasTable()
                                         throws CmsRpcException
Description copied from interface: I_CmsSitemapService
Gets the initial data for the bulk alias editor.

Specified by:
getAliasTable in interface I_CmsSitemapService
Returns:
the initial data for the alias editor
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsSitemapService.getAliasTable()

getChildren

public CmsClientSitemapEntry getChildren(java.lang.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 interface I_CmsSitemapService
Parameters:
entryPointUri - the URI of the sitemap entry point
entryId - the entry id
levels - the count of child levels to read
Returns:
the sitemap children
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsSitemapService.getChildren(java.lang.String, org.opencms.util.CmsUUID, int)

mergeSubSitemap

public CmsSitemapChange mergeSubSitemap(java.lang.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 interface I_CmsSitemapService
Parameters:
entryPoint - the sitemap entry point
subSitemapId - the structure id of the sub sitemap folder
Returns:
the result of the merge operation
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsSitemapService.mergeSubSitemap(java.lang.String, org.opencms.util.CmsUUID)

prefetch

public CmsSitemapData prefetch(java.lang.String sitemapUri)
                        throws CmsRpcException
Description copied from interface: I_CmsSitemapService
Returns the initialization data for the given sitemap.

Specified by:
prefetch in interface I_CmsSitemapService
Parameters:
sitemapUri - the site relative path
Returns:
the initialization data
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsSitemapService.prefetch(java.lang.String)

save

public CmsSitemapChange save(java.lang.String entryPoint,
                             CmsSitemapChange change)
                      throws CmsRpcException
Description copied from interface: I_CmsSitemapService
Saves the change to the given sitemap.

Specified by:
save in interface I_CmsSitemapService
Parameters:
entryPoint - the sitemap URI
change - the change to save
Returns:
the updated change
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsSitemapService.save(java.lang.String, org.opencms.ade.sitemap.shared.CmsSitemapChange)

saveAliases

public CmsAliasEditValidationReply saveAliases(CmsAliasSaveValidationRequest saveRequest)
                                        throws CmsRpcException
Description copied from interface: I_CmsSitemapService
Saves the aliases for the bulk alias editor.

Specified by:
saveAliases in interface I_CmsSitemapService
Parameters:
saveRequest - the object containing the data to save
Returns:
the result of saving the aliases
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsSitemapService.saveAliases(org.opencms.gwt.shared.alias.CmsAliasSaveValidationRequest)

saveSync

public CmsSitemapChange saveSync(java.lang.String entryPoint,
                                 CmsSitemapChange change)
                          throws CmsRpcException
Description copied from interface: I_CmsSitemapService
Saves the change to the given sitemap.

Specified by:
saveSync in interface I_CmsSitemapService
Parameters:
entryPoint - the sitemap URI
change - the change to save
Returns:
the updated change
Throws:
CmsRpcException - if something goes wrong
See Also:
I_CmsSitemapService.saveSync(java.lang.String, org.opencms.ade.sitemap.shared.CmsSitemapChange)

updateAliasEditorStatus

public void updateAliasEditorStatus(boolean editing)
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 interface I_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:
I_CmsSitemapService.updateAliasEditorStatus(boolean)

validateAliases

public CmsAliasEditValidationReply validateAliases(CmsAliasEditValidationRequest validationRequest)
Description copied from interface: I_CmsSitemapService
Validates the aliases for the bulk alias editor.

Specified by:
validateAliases in interface I_CmsSitemapService
Parameters:
validationRequest - an object indicating the type of validation to perform
Returns:
the validation result
See Also:
I_CmsSitemapService.validateAliases(org.opencms.gwt.shared.alias.CmsAliasEditValidationRequest)

validateRewriteAliases

public CmsRewriteAliasValidationReply validateRewriteAliases(CmsRewriteAliasValidationRequest validationRequest)
Description copied from interface: I_CmsSitemapService
Validates rewrite aliases.

Specified by:
validateRewriteAliases in interface I_CmsSitemapService
Parameters:
validationRequest - the rewrite alias data to validate
Returns:
the validation result
See Also:
I_CmsSitemapService.validateRewriteAliases(org.opencms.gwt.shared.alias.CmsRewriteAliasValidationRequest)

createSitemapBrokenLinkBean

protected CmsBrokenLinkBean createSitemapBrokenLinkBean(CmsResource resource)
                                                 throws CmsException
Creates a "broken link" bean based on a resource.

Parameters:
resource - the resource
Returns:
the "broken link" bean with the data from the resource
Throws:
CmsException - if something goes wrong

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

saveInternal

protected CmsSitemapChange saveInternal(java.lang.String entryPoint,
                                        CmsSitemapChange change)
                                 throws CmsException
Internal method for saving a sitemap.

Parameters:
entryPoint - the URI of the sitemap to save
change - the change to save
Returns:
list of changed sitemap entries
Throws:
CmsException