From 1ea2d0a76517cbad940bd152e67f832e23fee65b Mon Sep 17 00:00:00 2001 From: Anil Patel Date: Sat, 27 Sep 2014 22:37:46 +0000 Subject: [PATCH] [OFBIZ-3719] Reverting DOCTYPE hardcoding from cmsevents. Giving control back to the template. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1628014 13f79535-47bb-0310-9956-ffa450edef68 --- .../content/src/org/ofbiz/content/cms/CmsEvents.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/applications/content/src/org/ofbiz/content/cms/CmsEvents.java b/applications/content/src/org/ofbiz/content/cms/CmsEvents.java index 51447d4372..48edb2b93e 100644 --- a/applications/content/src/org/ofbiz/content/cms/CmsEvents.java +++ b/applications/content/src/org/ofbiz/content/cms/CmsEvents.java @@ -78,7 +78,10 @@ public class CmsEvents { // is this a default request or called from a defined request mapping String targetRequest = (String) request.getAttribute("targetRequestUri"); + Debug.logInfo("The targetRequest is " + targetRequest , module); String actualRequest = (String) request.getAttribute("thisRequestUri"); + Debug.logInfo("The actualRequest is " + actualRequest , module); + if (targetRequest != null) { targetRequest = targetRequest.replaceAll("\\W", ""); } else { @@ -102,6 +105,7 @@ public class CmsEvents { pathInfo = overrideViewUri; } else { pathInfo = request.getPathInfo(); + Debug.logInfo("The pathInfo is " + actualRequest , module); if (targetRequest.equals(actualRequest) && pathInfo != null) { // was called directly -- path info is everything after the request String[] pathParsed = pathInfo.split("/", 3); @@ -155,7 +159,7 @@ public class CmsEvents { if (!alias.startsWith("/")) { alias = "/" + alias; } - + Debug.logInfo("WebPathAlias is set to " + alias , module); RequestDispatcher rd = request.getRequestDispatcher(request.getServletPath() + alias); try { rd.forward(request, response); @@ -175,6 +179,9 @@ public class CmsEvents { Locale locale = UtilHttp.getLocale(request); // get the contentId/mapKey from URL + + // If webpathalias is valid then system will never look for content id or mapKey. + if (contentId == null) { if (Debug.verboseOn()) Debug.logVerbose("Current PathInfo: " + pathInfo, module); String[] pathSplit = pathInfo.split("/"); @@ -268,8 +275,6 @@ public class CmsEvents { // TODO: replace "screen" to support dynamic rendering of different output FormStringRenderer formStringRenderer = new MacroFormRenderer(UtilProperties.getPropertyValue("widget", "screen.formrenderer"), request, response); templateMap.put("formStringRenderer", formStringRenderer); - //include DOCTYPE for cms screens - writer.append(""); // if use web analytics List webAnalytics = delegator.findByAnd("WebAnalyticsConfig", UtilMisc.toMap("webSiteId", webSiteId), null, false);