Package org.opencms.main
Class CmsPermalinkResourceHandler
java.lang.Object
org.opencms.main.CmsPermalinkResourceHandler
- All Implemented Interfaces:
I_CmsResourceInit
Resource init handler that loads a resource given its permalink.
The permalink must have following format:
/${CONTEXT}/${SERVLET}/permalink/${UUID}.${EXT}
for example:
/opencms/opencms/permalink/a7b5d298-b3ab-11d8-b3e3-514d35713fed.html
- Since:
- 6.3
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Regex for capturing a UUID.static final String
The permalink handler path.static final String
Regex for the optional file extension.Fields inherited from interface org.opencms.main.I_CmsResourceInit
ATTR_ALTERNATIVE_CMS_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioninitResource
(CmsResource resource, CmsObject cms, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) Possibility to modify or change the CmsFile with the CmsObject.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opencms.main.I_CmsResourceInit
getConfiguration, initParameters
-
Field Details
-
CAPTURE_UUID_REGEX
Regex for capturing a UUID.- See Also:
-
PERMALINK_HANDLER
The permalink handler path.- See Also:
-
SUFFIX_REGEX
Regex for the optional file extension.- See Also:
-
-
Constructor Details
-
CmsPermalinkResourceHandler
public CmsPermalinkResourceHandler()Default constructor.
-
-
Method Details
-
initResource
public CmsResource initResource(CmsResource resource, CmsObject cms, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws CmsResourceInitException, CmsPermissionViolationException Description copied from interface:I_CmsResourceInit
Possibility to modify or change the CmsFile with the CmsObject.Caution: reading parameters from the request, destroys special characters in all parameters, because the encoding for the request was not set yet.
- Specified by:
initResource
in interfaceI_CmsResourceInit
- Parameters:
resource
- the requested filecms
- the current CmsObjectreq
- the current requestres
- the current response- Returns:
- a resource in the OpenCms VFS
- Throws:
CmsResourceInitException
- if other implementations of the interface should not be executedCmsPermissionViolationException
- See Also:
-