Package org.opencms.ade.galleries
Class CmsPreviewService
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.ade.galleries.CmsPreviewService
- 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_CmsPreviewService
Handles all RPC services related to the gallery preview dialog.
- Since:
- 8.0.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Pattern
Regex used to parse the image.focalpoint property.Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
perThreadRequest, perThreadResponse
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetImageInfo
(String resourcePath, String locale) Returns the image resource data to be displayed in the preview dialog.static String
getPreviewContent
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, CmsObject cms, CmsResource resource, Locale locale) Renders the preview content for the given resource and locale.getResourceInfo
(String resourcePath, String locale) Returns the data to be displayed in the preview dialog.static CmsPoint
readFocalPoint
(CmsObject cms, CmsResource resource) Reads the focal point from a resource.void
readResourceInfo
(CmsObject cms, CmsResource resource, CmsResourceInfoBean resInfo, String locale) Retrieves the resource information and puts it into the provided resource info bean.Saves the given properties to the resource and returns the data to be displayed in the preview dialog.Saves the given properties to the resource and returns the data to be displayed in the preview dialog.Methods inherited from class org.opencms.gwt.CmsGwtService
checkPermissions, clearThreadStorage, doGetSerializationPolicy, doUnexpectedFailure, ensureLock, ensureLock, ensureLock, ensureLock, ensureSession, error, 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, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init
-
Field Details
-
PATTERN_FOCAL_POINT
Regex used to parse the image.focalpoint property.
-
-
Constructor Details
-
CmsPreviewService
public CmsPreviewService()
-
-
Method Details
-
getPreviewContent
public static String getPreviewContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, CmsObject cms, CmsResource resource, Locale locale) Renders the preview content for the given resource and locale.- Parameters:
request
- the current servlet requestresponse
- the current servlet responsecms
- the cms contextresource
- the resourcelocale
- the content locale- Returns:
- the rendered HTML preview content
-
readFocalPoint
Reads the focal point from a resource.- Parameters:
cms
- the CMS context to useresource
- the resource- Returns:
- the focal point (or null, if the focal point property is not set or contains an invalid value)
- Throws:
CmsException
- if something goes wrong
-
getImageInfo
Description copied from interface:I_CmsPreviewService
Returns the image resource data to be displayed in the preview dialog.- Specified by:
getImageInfo
in interfaceI_CmsPreviewService
- Parameters:
resourcePath
- the resource pathlocale
- the content locale- Returns:
- the image resource data
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
getResourceInfo
public CmsResourceInfoBean getResourceInfo(String resourcePath, String locale) throws CmsRpcException Description copied from interface:I_CmsPreviewService
Returns the data to be displayed in the preview dialog.- Specified by:
getResourceInfo
in interfaceI_CmsPreviewService
- Parameters:
resourcePath
- the path to the selected resourcelocale
- the content locale- Returns:
- the preview data
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
updateImageProperties
public CmsImageInfoBean updateImageProperties(String resourcePath, String locale, Map<String, String> properties) throws CmsRpcExceptionDescription copied from interface:I_CmsPreviewService
Saves the given properties to the resource and returns the data to be displayed in the preview dialog.- Specified by:
updateImageProperties
in interfaceI_CmsPreviewService
- Parameters:
resourcePath
- the path to the selected resourcelocale
- the content localeproperties
- a map with the key/value pairs of the properties to be updated- Returns:
- the updates preview data
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-
updateResourceProperties
public CmsResourceInfoBean updateResourceProperties(String resourcePath, String locale, Map<String, String> properties) throws CmsRpcExceptionDescription copied from interface:I_CmsPreviewService
Saves the given properties to the resource and returns the data to be displayed in the preview dialog.- Specified by:
updateResourceProperties
in interfaceI_CmsPreviewService
- Parameters:
resourcePath
- the path to the selected resourcelocale
- the content localeproperties
- a map with the key/value pairs of the properties to be updated- Returns:
- the updates preview data
- Throws:
CmsRpcException
- if something goes wrong- See Also:
-