Author: apatel Date: Sat Sep 27 22:37:46 2014 New Revision: 1628014 URL: http://svn.apache.org/r1628014 Log: [OFBIZ-3719] Reverting DOCTYPE hardcoding from cmsevents. Giving control back to the template.
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java?rev=1628014&r1=1628013&r2=1628014&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java Sat Sep 27 22:37:46 2014 @@ -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("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"); // if use web analytics List<GenericValue> webAnalytics = delegator.findByAnd("WebAnalyticsConfig", UtilMisc.toMap("webSiteId", webSiteId), null, false);