// add the cocoon header timestamp
res.setProperty("X-Cocoon-Version", Constants.VERSION);
// get the request (wrapped if contains multipart-form data)
ActionRequest request;
try {
if (this.enableUploads) {
request = requestFactory.getServletRequest(req);
} else {
request = req;
}
} catch (Exception e) {
if (getLogger().isErrorEnabled()) {
getLogger().error("Problem with Cocoon portlet", e);
}
manageException(req, res, null, null,
"Problem in creating the Request", null, null, e);
return;
}
// Get the cocoon engine instance
Cocoon cocoon = getCocoon();
// Check if cocoon was initialized
if (cocoon == null) {
manageException(request, res, null, null,
"Initialization Problem",
null /* "Cocoon was not initialized" */,
null /* "Cocoon was not initialized, cannot process request" */,
this.exception);
return;
}
// We got it... Process the request
String uri = this.servletPath;
if (uri == null) {
uri = "portlets/" + getPortletConfig().getPortletName();
}
// override servlet-path by the request
if (servletPathOverriding) {
String reqServletPath = (String) request.getAttribute("servlet-path");
if (reqServletPath != null) {
uri = reqServletPath;
} else {
PortletPreferences prefs = request.getPreferences();
if (prefs != null) {
uri = prefs.getValue("servlet-path", uri);
}
}