public class CmsHistoryResourceHandler extends java.lang.Object implements I_CmsResourceInit
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
ATTRIBUTE_NAME
Constant for the historical version request attribute name.
|
static java.lang.String |
HISTORY_HANDLER
The historical version handler path.
|
static java.lang.String |
PARAM_VERSION
Request parameter name for the version number.
|
static int |
PROJECT_OFFLINE_VERSION
Constant for the offline project version.
|
构造器和说明 |
---|
CmsHistoryResourceHandler() |
限定符和类型 | 方法和说明 |
---|---|
static I_CmsHistoryResource |
getHistoryResource(javax.servlet.ServletRequest req)
Returns the historical version of a resource,
if the given request is displaying a history version.
|
static java.lang.String |
getHistoryResourceURI(java.lang.String uri,
javax.servlet.ServletRequest req)
Appends the
version parameter to the URI if needed. |
static CmsResource |
getResourceWithHistory(CmsObject cms,
java.lang.String resourceUri)
Returns the correct resource for the given URI, taken into account historical versions
marked by the
version parameter. |
CmsResource |
initResource(CmsResource resource,
CmsObject cms,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Possibility to modify or change the CmsFile with the CmsObject.
|
static boolean |
isHistoryRequest(javax.servlet.ServletRequest req)
Returns
true if the given request is displaying an historical version. |
public static final java.lang.String ATTRIBUTE_NAME
public static final java.lang.String HISTORY_HANDLER
public static final java.lang.String PARAM_VERSION
public static final int PROJECT_OFFLINE_VERSION
public static I_CmsHistoryResource getHistoryResource(javax.servlet.ServletRequest req)
req
- the request to checkpublic static java.lang.String getHistoryResourceURI(java.lang.String uri, javax.servlet.ServletRequest req)
version
parameter to the URI if needed.uri
- the resource URIreq
- the current requestpublic static CmsResource getResourceWithHistory(CmsObject cms, java.lang.String resourceUri) throws CmsException
version
parameter.cms
- the current CMS contextresourceUri
- the resource URII_CmsHistoryResource
CmsException
- if something goes wrongpublic static boolean isHistoryRequest(javax.servlet.ServletRequest req)
true
if the given request is displaying an historical version.req
- the request to checktrue
if the given request is displaying a historical versionpublic CmsResource initResource(CmsResource resource, CmsObject cms, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws CmsResourceInitException
I_CmsResourceInit
Caution: reading parameters from the request, destroys special characters in all parameters, because the encoding for the request was not set yet.
initResource
在接口中 I_CmsResourceInit
resource
- the requested filecms
- the current CmsObjectreq
- the current requestres
- the current responseCmsResourceInitException
- if other implementations of the interface should not be executedI_CmsResourceInit.initResource(org.opencms.file.CmsResource, org.opencms.file.CmsObject, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)