Author: lektran
Date: Tue Mar 23 00:47:51 2010
New Revision: 926418
URL: http://svn.apache.org/viewvc?rev=926418&view=rev
Log:
Have the cms event use the current request's overrideViewUri
(_CURRENT_CHAIN_VIEW_) if present instead of request.getPathInfo(), this allows
you to go through a chain of requests before pushing back into cms.
So you can now have a request response push back to cms with something like
this:
<response name="success" type="request" value="cms/contentId/mapKey"/>
basically anything that would have worked in the URL will work here, except for
relying on the default-request mapping which chained requests ignore, so you
have to prefix with cms/ (or whatever your cms uri is)
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=926418&r1=926417&r2=926418&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
Tue Mar 23 00:47:51 2010
@@ -93,16 +93,24 @@ public class CmsEvents {
String contentId = null;
String mapKey = null;
- String pathInfo = request.getPathInfo();
- if (targetRequest.equals(actualRequest) && pathInfo != null) {
- // was called directly -- path info is everything after the request
- String[] pathParsed = pathInfo.split("/", 3);
- if (pathParsed.length > 2) {
- pathInfo = pathParsed[2];
- } else {
- pathInfo = null;
- }
- } // if called through the default request, there is no request in
pathinfo
+ String pathInfo = null;
+
+ // If an override view is present then use that in place of
request.getPathInfo()
+ String overrideViewUri = (String)
request.getAttribute("_CURRENT_CHAIN_VIEW_");
+ if (UtilValidate.isNotEmpty(overrideViewUri)) {
+ pathInfo = overrideViewUri;
+ } else {
+ pathInfo = request.getPathInfo();
+ if (targetRequest.equals(actualRequest) && pathInfo != null) {
+ // was called directly -- path info is everything after the
request
+ String[] pathParsed = pathInfo.split("/", 3);
+ if (pathParsed.length > 2) {
+ pathInfo = pathParsed[2];
+ } else {
+ pathInfo = null;
+ }
+ } // if called through the default request, there is no request in
pathinfo
+ }
// if path info is null; check for a default content
if (pathInfo == null) {