You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by gk...@apache.org on 2007/07/18 19:17:43 UTC
svn commit: r557336 -
/cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/Call.java
Author: gkossakowski
Date: Wed Jul 18 10:17:42 2007
New Revision: 557336
URL: http://svn.apache.org/viewvc?view=rev&rev=557336
Log:
COCOON-2092: Use new ObjectModel in Call tag. Fixes macro-related tests.
Modified:
cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/Call.java
Modified: cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/Call.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/Call.java?view=diff&rev=557336&r1=557335&r2=557336
==============================================================================
--- cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/Call.java (original)
+++ cocoon/whiteboard/objectmodel/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/instruction/Call.java Wed Jul 18 10:17:42 2007
@@ -109,12 +109,11 @@
Object parameterValue = parameter.getValue(expressionContext);
attributeMap.put(parameterName, parameterValue);
}
- ExpressionContext localExpressionContext = new ExpressionContext(
- expressionContext);
+ expressionContext.getObjectModel().markLocalContext();
HashMap macro = new HashMap();
macro.put("body", this.body);
macro.put("arguments", attributeMap);
- localExpressionContext.put("macro", macro);
+ expressionContext.getObjectModel().put("macro", macro);
Define definition = resolveMacroDefinition(expressionContext,
executionContext);
@@ -128,7 +127,7 @@
if (val == null) {
val = default_;
}
- localExpressionContext.put(key, val);
+ expressionContext.getObjectModel().put(key, val);
}
Event macroBodyStart = getNext();
@@ -142,13 +141,14 @@
MacroContext newMacroContext = new MacroContext(definition.getQname(),
macroBodyStart, macroBodyEnd);
try {
- Invoker.execute(consumer, localExpressionContext, executionContext,
+ Invoker.execute(consumer, expressionContext, executionContext,
newMacroContext, definition.getBody(), definition
.getEndInstruction());
} catch (SAXParseException exc) {
throw new SAXParseException(newMacroContext.getMacroQName() + ": "
+ exc.getMessage(), location, exc);
}
+ expressionContext.getObjectModel().cleanupLocalContext();
if (getEndInstruction() != null)
return getEndInstruction().getNext();