|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
com.google.gwt.user.server.rpc.RemoteServiceServlet
org.opencms.gwt.CmsGwtService
public class CmsGwtService
Wrapper for GWT services served through OpenCms.
Field Summary |
---|
Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet |
---|
perThreadRequest, perThreadResponse |
Constructor Summary | |
---|---|
CmsGwtService()
Constructor. |
Method Summary | |
---|---|
void |
checkPermissions(CmsObject cms)
Checks the permissions of the current user to match the required security level. |
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 CmsLock |
ensureLock(CmsResource resource)
Locks the given resource with a temporary, if not already locked by the current user. |
protected CmsLock |
ensureLock(CmsUUID structureId)
Locks the given resource with a temporary, if not already locked by the current user. |
protected CmsLock |
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 arg0,
javax.servlet.ServletResponse arg1)
|
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. |
protected void |
tryUnlock(CmsResource resource)
Tries to unlock a resource. |
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 |
Constructor Detail |
---|
public CmsGwtService()
Method Detail |
---|
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 object
CmsRoleViolationException
- if the security level can not be satisfiedpublic void error(java.lang.Throwable t) throws CmsRpcException
t
- the exception
CmsRpcException
- 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 arg0, javax.servlet.ServletResponse arg1) 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 setprotected 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 CmsLock ensureLock(CmsResource resource) throws CmsException
resource
- the resource to lock
CmsException
- if the resource could not be lockedprotected CmsLock ensureLock(CmsUUID structureId) throws CmsException
structureId
- the structure id of the resource
CmsException
- if something goes wrongprotected CmsLock ensureLock(java.lang.String sitepath) throws CmsException
sitepath
- the site-path of the resource to lock
CmsException
- 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 properties
protected void tryUnlock(CmsResource resource)
resource
- the resource to unlock
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |