Package org.opencms.gwt
Class CmsGwtService
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
- All Implemented Interfaces:
com.google.gwt.user.server.rpc.SerializationPolicyProvider,Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
- Direct Known Subclasses:
CmsContainerpageService,CmsContentService,CmsCoreService,CmsGalleryService,CmsLogService,CmsMessagesService,CmsPostUploadDialogService,CmsPreviewService,CmsPublishService,CmsSerialDateService,CmsUgcEditService,CmsUploadService,CmsVfsService,CmsVfsSitemapService
Wrapper for GWT services served through OpenCms.
- Since:
- 8.0.0
- See Also:
-
Field Summary
Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
perThreadRequest, perThreadResponse -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks the permissions of the current user to match the required security level.protected voidClears the objects stored in thread local.protected com.google.gwt.user.server.rpc.SerializationPolicydoGetSerializationPolicy(javax.servlet.http.HttpServletRequest request, String moduleBaseURL, String strongName) We do not want that the server goes to fetch files from the servlet context.protected voidprotected CmsLockActionRecordensureLock(String sitepath) Locks the given resource with a temporary, if not already locked by the current user.protected CmsLockActionRecordensureLock(CmsResource resource) Locks the given resource with a temporary, if not already locked by the current user.protected CmsLockActionRecordensureLock(CmsResource resource, boolean shallow) Locks the given resource with a temporary, if not already locked by the current user.protected CmsLockActionRecordensureLock(CmsUUID structureId) Locks the given resource with a temporary, if not already locked by the current user.protected voidEnsures that the user session is still valid.voidLogs and re-throws the given exception for RPC responses.Returns the current cms context.protected Map<String, CmsProperty> getPropertiesByName(List<CmsProperty> properties) Converts a list of properties to a map.javax.servlet.http.HttpServletRequestReturns the current request.javax.servlet.http.HttpServletResponseReturns the current response.booleanReturns whether the current request is a broadcast call.voidvoidvoidLogs the given exception.voidservice(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) voidSets that the current request is a broadcast call.voidSets the current cms context.voidsetContext(CmsGwtServiceContext context) Sets the service context.voidsetRequest(javax.servlet.http.HttpServletRequest request) Sets the current request.voidsetResponse(javax.servlet.http.HttpServletResponse response) Sets the current response.protected voidtryUnlock(CmsResource resource) Tries to unlock a resource.Methods 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
-
Constructor Details
-
CmsGwtService
public CmsGwtService()Constructor.
-
-
Method Details
-
checkPermissions
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.
- Parameters:
cms- the current cms object- Throws:
CmsRoleViolationException- if the security level can not be satisfied
-
error
Logs and re-throws the given exception for RPC responses.- Parameters:
t- the exception- Throws:
CmsRpcException- the converted exception
-
getCmsObject
Returns the current cms context.- Returns:
- the current cms context
-
getRequest
Returns the current request.- Returns:
- the current request
- See Also:
-
getResponse
Returns the current response.- Returns:
- the current response
- See Also:
-
isBroadcastCall
Returns whether the current request is a broadcast call.- Returns:
trueif the current request is a broadcast call
-
log
- Overrides:
login classjavax.servlet.GenericServlet- See Also:
-
log
- Overrides:
login classjavax.servlet.GenericServlet- See Also:
-
logError
Logs the given exception.- Parameters:
t- the exception to log
-
service
public void service(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws javax.servlet.ServletException, IOException - Specified by:
servicein interfacejavax.servlet.Servlet- Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException- See Also:
-
setBroadcastPoll
Sets that the current request is a broadcast call. -
setCms
Sets the current cms context.- Parameters:
cms- the current cms context to set
-
setContext
Sets the service context.- Parameters:
context- the new service context
-
setRequest
Sets the current request.- Parameters:
request- the request to set
-
setResponse
Sets the current response.- Parameters:
response- the response to set
-
clearThreadStorage
Clears the objects stored in thread local. -
doGetSerializationPolicy
protected com.google.gwt.user.server.rpc.SerializationPolicy doGetSerializationPolicy(javax.servlet.http.HttpServletRequest request, String moduleBaseURL, String strongName) We do not want that the server goes to fetch files from the servlet context.- Overrides:
doGetSerializationPolicyin classcom.google.gwt.user.server.rpc.RemoteServiceServlet- See Also:
-
doUnexpectedFailure
- Overrides:
doUnexpectedFailurein classcom.google.gwt.user.server.rpc.AbstractRemoteServiceServlet- See Also:
-
ensureLock
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
-
ensureLock
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 lockshallow- true if we only want a shallow lock- Returns:
- the assigned lock
- Throws:
CmsException- if the resource could not be locked
-
ensureLock
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:
structureId- the structure id of the resource- Returns:
- the assigned lock
- Throws:
CmsException- if something goes wrong
-
ensureLock
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:
sitepath- the site-path of the resource to lock- Returns:
- the assigned lock
- Throws:
CmsException- if the resource could not be locked
-
ensureSession
Ensures that the user session is still valid.- Throws:
CmsException- if the current user is the guest user
-
getPropertiesByName
Converts a list of properties to a map.- Parameters:
properties- the list of properties- Returns:
- a map from property names to properties
-
tryUnlock
Tries to unlock a resource.- Parameters:
resource- the resource to unlock
-