|
||||||||
| 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,
String moduleBaseURL,
String strongName)
We do not want that the server goes to fetch files from the servlet context. |
protected void |
doUnexpectedFailure(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(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(Throwable t)
Logs and re-throws the given exception for RPC responses. |
CmsObject |
getCmsObject()
Returns the current cms context. |
protected Map<String,CmsProperty> |
getPropertiesByName(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(String msg)
|
void |
log(String message,
Throwable t)
|
void |
logError(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 satisfied
public void error(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(String msg)
log in class javax.servlet.GenericServletGenericServlet.log(java.lang.String)
public void log(String message,
Throwable t)
log in class javax.servlet.GenericServletGenericServlet.log(java.lang.String, java.lang.Throwable)public void logError(Throwable t)
t - the exception to log
public void service(javax.servlet.ServletRequest arg0,
javax.servlet.ServletResponse arg1)
throws javax.servlet.ServletException,
IOException
service in interface javax.servlet.Servletservice in class javax.servlet.http.HttpServletjavax.servlet.ServletException
IOExceptionHttpServlet.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 set
protected com.google.gwt.user.server.rpc.SerializationPolicy doGetSerializationPolicy(javax.servlet.http.HttpServletRequest request,
String moduleBaseURL,
String strongName)
doGetSerializationPolicy in class com.google.gwt.user.server.rpc.RemoteServiceServletRemoteServiceServlet.doGetSerializationPolicy(javax.servlet.http.HttpServletRequest, java.lang.String, java.lang.String)protected void doUnexpectedFailure(Throwable e)
doUnexpectedFailure in class com.google.gwt.user.server.rpc.AbstractRemoteServiceServletAbstractRemoteServiceServlet.doUnexpectedFailure(java.lang.Throwable)
protected CmsLock ensureLock(CmsResource resource)
throws CmsException
resource - the resource to lock
CmsException - if the resource could not be locked
protected CmsLock ensureLock(CmsUUID structureId)
throws CmsException
structureId - the structure id of the resource
CmsException - if something goes wrong
protected CmsLock ensureLock(String sitepath)
throws CmsException
sitepath - the site-path of the resource to lock
CmsException - if the resource could not be locked
protected void ensureSession()
throws CmsException
CmsException - if the current user is the guest userprotected Map<String,CmsProperty> getPropertiesByName(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 | |||||||