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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks the permissions of the current user to match the required security level.voiddestroySession(CmsUUID sessionId) Destroys the given session.voidLogs 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 voidhandleUpload(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 voidservice(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, tryUnlockMethods 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, getLastModifiedMethods 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:CmsGwtServiceChecks 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:
checkPermissionsin classCmsGwtService- Parameters:
cms- the current cms object- See Also:
-
destroySession
Description copied from interface:I_CmsUgcEditServiceDestroys the given session.- Specified by:
destroySessionin interfaceI_CmsUgcEditService- Parameters:
sessionId- the id of the session to destroy- Throws:
CmsUgcException- See Also:
-
error
Description copied from class:CmsGwtServiceLogs and re-throws the given exception for RPC responses.- Overrides:
errorin classCmsGwtService- Parameters:
t- the exception- Throws:
CmsUgcException- See Also:
-
getContent
Description copied from interface:I_CmsUgcEditServiceLoads the form content for an existing session.- Specified by:
getContentin 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_CmsUgcEditServiceGets the link corresponding to a given site path.- Specified by:
getLinkin 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_CmsUgcEditServiceSaves the given content values to the edited content.- Specified by:
saveContentin 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_CmsUgcEditServiceUploads multiple files.- Specified by:
uploadFilesin 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_CmsUgcEditServiceValidates the new content values for a content loaded in the given session.- Specified by:
validateContentin 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:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException- See Also:
-