cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap ActTypeNode.java
Date Thu, 07 Aug 2003 09:49:51 GMT
sylvain     2003/08/07 02:49:51

  Modified:    src/blocks/databases/samples/tutorial sitemap.xmap
               src/java/org/apache/cocoon/components/treeprocessor/sitemap
                        ActTypeNode.java
  Log:
  Fix bug #9835 again !
  
  Revision  Changes    Path
  1.4       +2 -2      cocoon-2.1/src/blocks/databases/samples/tutorial/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/databases/samples/tutorial/sitemap.xmap,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sitemap.xmap	7 Aug 2003 08:42:20 -0000	1.3
  +++ sitemap.xmap	7 Aug 2003 09:49:50 -0000	1.4
  @@ -78,7 +78,7 @@
     <map:act set="process">
       <map:parameter name="descriptor" value="context://samples/databases/tutorial/docs/department-form.xml"/>
       <map:generate type="serverpages" src="docs/confirm-dept.xsp"/>
  -    <map:transform src="stylesheets/apache.xsl"/>
  +    <map:transform src="apache.xsl"/>
       <map:serialize/>
     </map:act>
     <map:generate type="serverpages" src="docs/{1}-dept.xsp"/>
  @@ -91,7 +91,7 @@
     <map:act set="process">
       <map:parameter name="descriptor" value="context://samples/databases/tutorial/docs/employee-form.xml"/>
       <map:generate type="serverpages" src="docs/confirm-empl.xsp"/>
  -    <map:transform src="stylesheets/apache.xsl"/>
  +    <map:transform src="apache.xsl"/>
       <map:serialize/>
     </map:act>
     <map:generate type="serverpages" src="docs/{1}-empl.xsp"/>
  
  
  
  1.3       +20 -2     cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java
  
  Index: ActTypeNode.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ActTypeNode.java	7 Aug 2003 08:42:20 -0000	1.2
  +++ ActTypeNode.java	7 Aug 2003 09:49:51 -0000	1.3
  @@ -130,6 +130,22 @@
           Parameters     resolvedParams = VariableResolver.buildParameters(this.parameters,
context, objectModel);
   
           Map actionResult;
  +        
  +        // If in action set, merge parameters
  +        if (inActionSet) {
  +            Parameters callerParams = (Parameters)env.getAttribute(ActionSetNode.CALLER_PARAMETERS);
  +            if (resolvedParams == Parameters.EMPTY_PARAMETERS) {
  +                // Just swap
  +                resolvedParams = callerParams;
  +            } else if (callerParams != Parameters.EMPTY_PARAMETERS) {
  +                // Build a new Parameters object since the both we hare are read-only
  +                Parameters newParams = new Parameters();
  +                // And merge both
  +                newParams.merge(resolvedParams);
  +                newParams.merge(callerParams);
  +                resolvedParams = newParams;
  +            }
  +        }
   
           // If action is ThreadSafe, avoid select() and try/catch block (faster !)
           if (this.threadSafeAction != null) {
  @@ -163,7 +179,9 @@
                       // Merge child action results, if any
                       Map childMap = (Map)env.getAttribute(ActionSetNode.ACTION_RESULTS);
                       if (childMap != null) {
  -                        childMap.putAll(actionResult);
  +                        Map newResults = new HashMap(childMap);
  +                        newResults.putAll(actionResult);
  +                        env.setAttribute(ActionSetNode.ACTION_RESULTS, newResults);
                       } else {
                           // No previous results
                           env.setAttribute(ActionSetNode.ACTION_RESULTS, actionResult);
  
  
  

Mime
View raw message