public class CmsGwtService extends com.google.gwt.user.server.rpc.RemoteServiceServlet
Constructor and Description |
---|
CmsGwtService()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
checkPermissions(CmsObject cms)
Checks the permissions of the current user to match the required security level.
|
protected void |
clearThreadStorage()
Clears the objects stored in thread local.
|
protected com.google.gwt.user.server.rpc.SerializationPolicy |
doGetSerializationPolicy(javax.servlet.http.HttpServletRequest request,
java.lang.String moduleBaseURL,
java.lang.String strongName)
We do not want that the server goes to fetch files from the servlet context.
|
protected void |
doUnexpectedFailure(java.lang.Throwable e) |
protected CmsLockActionRecord |
ensureLock(CmsResource resource)
Locks the given resource with a temporary, if not already locked by the current user.
|
protected CmsLockActionRecord |
ensureLock(CmsUUID structureId)
Locks the given resource with a temporary, if not already locked by the current user.
|
protected CmsLockActionRecord |
ensureLock(java.lang.String sitepath)
Locks the given resource with a temporary, if not already locked by the current user.
|
protected void |
ensureSession()
Ensures that the user session is still valid.
|
void |
error(java.lang.Throwable t)
Logs and re-throws the given exception for RPC responses.
|
CmsObject |
getCmsObject()
Returns the current cms context.
|
protected java.util.Map<java.lang.String,CmsProperty> |
getPropertiesByName(java.util.List<CmsProperty> properties)
Converts a list of properties to a map.
|
javax.servlet.http.HttpServletRequest |
getRequest()
Returns the current request.
|
javax.servlet.http.HttpServletResponse |
getResponse()
Returns the current response.
|
void |
log(java.lang.String msg) |
void |
log(java.lang.String message,
java.lang.Throwable t) |
void |
logError(java.lang.Throwable t)
Logs the given exception.
|
void |
service(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response) |
void |
setCms(CmsObject cms)
Sets the current cms context.
|
void |
setContext(CmsGwtServiceContext context)
Sets the service context.
|
void |
setRequest(javax.servlet.http.HttpServletRequest request)
Sets the current request.
|
void |
setResponse(javax.servlet.http.HttpServletResponse response)
Sets the current response.
|
protected void |
tryUnlock(CmsResource resource)
Tries to unlock a resource.
|
checkPermutationStrongName, getCodeServerPolicyUrl, getRequestModuleBasePath, getSerializationPolicy, init, loadPolicyFromCodeServer, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processCall, processPost, shouldCompressResponse
doPost, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContent
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service
public CmsGwtService()
public void checkPermissions(CmsObject cms) throws CmsRoleViolationException
Note that the current request and response are not available yet.
Override if needed.
cms
- the current cms objectCmsRoleViolationException
- if the security level can not be satisfiedpublic void error(java.lang.Throwable t) throws CmsRpcException
t
- the exceptionCmsRpcException
- the converted exceptionpublic CmsObject getCmsObject()
public javax.servlet.http.HttpServletRequest getRequest()
AbstractRemoteServiceServlet.getThreadLocalRequest()
public javax.servlet.http.HttpServletResponse getResponse()
AbstractRemoteServiceServlet.getThreadLocalResponse()
public void log(java.lang.String msg)
log
in class javax.servlet.GenericServlet
GenericServlet.log(java.lang.String)
public void log(java.lang.String message, java.lang.Throwable t)
log
in class javax.servlet.GenericServlet
GenericServlet.log(java.lang.String, java.lang.Throwable)
public void logError(java.lang.Throwable t)
t
- the exception to logpublic void service(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws javax.servlet.ServletException, java.io.IOException
service
in interface javax.servlet.Servlet
service
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException
HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
public void setCms(CmsObject cms)
cms
- the current cms context to setpublic void setContext(CmsGwtServiceContext context)
context
- the new service contextpublic void setRequest(javax.servlet.http.HttpServletRequest request)
request
- the request to setpublic void setResponse(javax.servlet.http.HttpServletResponse response)
response
- the response to setprotected void clearThreadStorage()
protected com.google.gwt.user.server.rpc.SerializationPolicy doGetSerializationPolicy(javax.servlet.http.HttpServletRequest request, java.lang.String moduleBaseURL, java.lang.String strongName)
doGetSerializationPolicy
in class com.google.gwt.user.server.rpc.RemoteServiceServlet
RemoteServiceServlet.doGetSerializationPolicy(javax.servlet.http.HttpServletRequest, java.lang.String, java.lang.String)
protected void doUnexpectedFailure(java.lang.Throwable e)
doUnexpectedFailure
in class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
AbstractRemoteServiceServlet.doUnexpectedFailure(java.lang.Throwable)
protected CmsLockActionRecord ensureLock(CmsResource resource) throws CmsException
resource
- the resource to lockCmsException
- if the resource could not be lockedprotected CmsLockActionRecord ensureLock(CmsUUID structureId) throws CmsException
structureId
- the structure id of the resourceCmsException
- if something goes wrongprotected CmsLockActionRecord ensureLock(java.lang.String sitepath) throws CmsException
sitepath
- the site-path of the resource to lockCmsException
- if the resource could not be lockedprotected void ensureSession() throws CmsException
CmsException
- if the current user is the guest userprotected java.util.Map<java.lang.String,CmsProperty> getPropertiesByName(java.util.List<CmsProperty> properties)
properties
- the list of propertiesprotected void tryUnlock(CmsResource resource)
resource
- the resource to unlock