Package org.opencms.ugc
Class CmsUgcEditService
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
org.opencms.ugc.CmsUgcEditService
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService
,com.google.gwt.user.server.rpc.SerializationPolicyProvider
,Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
,I_CmsUgcEditService
The form editing service.
- See Also:
-
Field Summary
Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
perThreadRequest, perThreadResponse
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks the permissions of the current user to match the required security level.void
destroySession
(CmsUUID sessionId) Destroys the given session.void
Logs and re-throws the given exception for RPC responses.getContent
(CmsUUID sessionId) Loads the form content for an existing session.Gets the link corresponding to a given site path.protected void
handleUpload
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handles all multipart requests.saveContent
(CmsUUID sessionId, Map<String, String> contentValues) Saves the given content values to the edited content.protected void
service
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) uploadFiles
(CmsUUID sessionId, Set<String> fieldNames, String formDataId) Uploads multiple files.validateContent
(CmsUUID sessionId, Map<String, String> contentValues) Validates the new content values for a content loaded in the given session.Methods inherited from class org.opencms.gwt.CmsGwtService
clearThreadStorage, doGetSerializationPolicy, doUnexpectedFailure, ensureLock, ensureLock, ensureLock, ensureLock, ensureSession, getCmsObject, getPropertiesByName, getRequest, getResponse, isBroadcastCall, log, log, logError, service, setBroadcastPoll, setCms, setContext, setRequest, setResponse, tryUnlock
Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet
checkPermutationStrongName, getCodeServerPolicyUrl, getRequestModuleBasePath, getSerializationPolicy, init, loadPolicyFromCodeServer, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, 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
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init
-
Constructor Details
-
CmsUgcEditService
public CmsUgcEditService()
-
-
Method Details
-
checkPermissions
Description copied from class:CmsGwtService
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.
- Overrides:
checkPermissions
in classCmsGwtService
- Parameters:
cms
- the current cms object- See Also:
-
destroySession
Description copied from interface:I_CmsUgcEditService
Destroys the given session.- Specified by:
destroySession
in interfaceI_CmsUgcEditService
- Parameters:
sessionId
- the id of the session to destroy- Throws:
CmsUgcException
- See Also:
-
error
Description copied from class:CmsGwtService
Logs and re-throws the given exception for RPC responses.- Overrides:
error
in classCmsGwtService
- Parameters:
t
- the exception- Throws:
CmsUgcException
- See Also:
-
getContent
Description copied from interface:I_CmsUgcEditService
Loads the form content for an existing session.- Specified by:
getContent
in interfaceI_CmsUgcEditService
- Parameters:
sessionId
- the id of the existing session- Returns:
- the form content information
- Throws:
CmsUgcException
- See Also:
-
getLink
Description copied from interface:I_CmsUgcEditService
Gets the link corresponding to a given site path.- Specified by:
getLink
in interfaceI_CmsUgcEditService
- Parameters:
path
- the site path- Returns:
- the link for the path
- See Also:
-
saveContent
public Map<String,String> saveContent(CmsUUID sessionId, Map<String, String> contentValues) throws CmsUgcExceptionDescription copied from interface:I_CmsUgcEditService
Saves the given content values to the edited content.- Specified by:
saveContent
in interfaceI_CmsUgcEditService
- Parameters:
sessionId
- the session idcontentValues
- the content values- Returns:
- the validation errors, if there are any
- Throws:
CmsUgcException
- See Also:
-
uploadFiles
public Map<String,String> uploadFiles(CmsUUID sessionId, Set<String> fieldNames, String formDataId) throws CmsRpcException Description copied from interface:I_CmsUgcEditService
Uploads multiple files.- Specified by:
uploadFiles
in interfaceI_CmsUgcEditService
- Parameters:
sessionId
- the session idfieldNames
- the set of field names of the form fields containing the uploaded filesformDataId
- the form data id of the form submit in which the form fields were posted- Returns:
- the map from field names to the VFS paths of uploaded files
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
validateContent
public Map<String,String> validateContent(CmsUUID sessionId, Map<String, String> contentValues) throws CmsUgcExceptionDescription copied from interface:I_CmsUgcEditService
Validates the new content values for a content loaded in the given session.- Specified by:
validateContent
in interfaceI_CmsUgcEditService
- Parameters:
sessionId
- the id of the session containing the contentcontentValues
- the values to validate- Returns:
- the map of validation results
- Throws:
CmsUgcException
- if something goes wrong- See Also:
-
handleUpload
protected void handleUpload(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handles all multipart requests.- Parameters:
request
- the requestresponse
- the response
-
service
protected void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException - Overrides:
service
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
- See Also:
-
HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
-