cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r557585 [2/2] - in /cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template: ./ expression/ instruction/ script/ script/event/
Date Thu, 19 Jul 2007 11:48:01 GMT
Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/IgnorableWhitespace.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/IgnorableWhitespace.java?view=diff&rev=557585&r1=557584&r2=557585
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/IgnorableWhitespace.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/IgnorableWhitespace.java
Thu Jul 19 04:47:58 2007
@@ -16,10 +16,11 @@
  */
 package org.apache.cocoon.template.script.event;
 
-import org.apache.cocoon.components.expression.ExpressionContext;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.environment.ParsingContext;
 import org.apache.cocoon.template.instruction.MacroContext;
+import org.apache.cocoon.xml.NamespacesTable;
 import org.apache.cocoon.xml.XMLConsumer;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -33,10 +34,10 @@
         super(parsingContext, location, chars, start, length);
     }
 
-    public Event execute(final XMLConsumer consumer, ExpressionContext expressionContext,
-            ExecutionContext executionContext, MacroContext macroContext, Event startEvent,
Event endEvent)
+    public Event execute(final XMLConsumer consumer, ObjectModel objectModel,
+            ExecutionContext executionContext, MacroContext macroContext, NamespacesTable
namespaces, Event startEvent, Event endEvent)
             throws SAXException {
-        characters(expressionContext, executionContext, this, new CharHandler() {
+        characters(objectModel, executionContext, this, new CharHandler() {
             public void characters(char[] ch, int offset, int len) throws SAXException {
                 consumer.ignorableWhitespace(ch, offset, len);
             }

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/ProcessingInstruction.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/ProcessingInstruction.java?view=diff&rev=557585&r1=557584&r2=557585
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/ProcessingInstruction.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/ProcessingInstruction.java
Thu Jul 19 04:47:58 2007
@@ -16,9 +16,10 @@
  */
 package org.apache.cocoon.template.script.event;
 
-import org.apache.cocoon.components.expression.ExpressionContext;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.instruction.MacroContext;
+import org.apache.cocoon.xml.NamespacesTable;
 import org.apache.cocoon.xml.XMLConsumer;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -46,9 +47,9 @@
     
     
     public Event execute(XMLConsumer consumer,
-            ExpressionContext expressionContext,
+            ObjectModel objectModel,
             ExecutionContext executionContext, MacroContext macroContext,
-            Event startEvent, Event endEvent) throws SAXException {
+            NamespacesTable namespaces, Event startEvent, Event endEvent) throws SAXException
{
         consumer.processingInstruction(getTarget(), getData());
         return getNext();
     }

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/SkippedEntity.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/SkippedEntity.java?view=diff&rev=557585&r1=557584&r2=557585
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/SkippedEntity.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/SkippedEntity.java
Thu Jul 19 04:47:58 2007
@@ -16,9 +16,10 @@
  */
 package org.apache.cocoon.template.script.event;
 
-import org.apache.cocoon.components.expression.ExpressionContext;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.instruction.MacroContext;
+import org.apache.cocoon.xml.NamespacesTable;
 import org.apache.cocoon.xml.XMLConsumer;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -39,9 +40,9 @@
     }
 
     public Event execute(XMLConsumer consumer,
-            ExpressionContext expressionContext,
+            ObjectModel objectModel,
             ExecutionContext executionContext, MacroContext macroContext,
-            Event startEvent, Event endEvent) throws SAXException {
+            NamespacesTable namespaces, Event startEvent, Event endEvent) throws SAXException
{
         consumer.skippedEntity(getName());
         return getNext();
     }

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartCDATA.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartCDATA.java?view=diff&rev=557585&r1=557584&r2=557585
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartCDATA.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartCDATA.java
Thu Jul 19 04:47:58 2007
@@ -16,9 +16,10 @@
  */
 package org.apache.cocoon.template.script.event;
 
-import org.apache.cocoon.components.expression.ExpressionContext;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.instruction.MacroContext;
+import org.apache.cocoon.xml.NamespacesTable;
 import org.apache.cocoon.xml.XMLConsumer;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -32,9 +33,9 @@
     }
     
     public Event execute(XMLConsumer consumer,
-            ExpressionContext expressionContext,
+            ObjectModel objectModel,
             ExecutionContext executionContext, MacroContext macroContext,
-            Event startEvent, Event endEvent) throws SAXException {
+            NamespacesTable namespaces, Event startEvent, Event endEvent) throws SAXException
{
         consumer.startCDATA();
         return getNext();
     }

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartDTD.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartDTD.java?view=diff&rev=557585&r1=557584&r2=557585
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartDTD.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartDTD.java
Thu Jul 19 04:47:58 2007
@@ -16,9 +16,10 @@
  */
 package org.apache.cocoon.template.script.event;
 
-import org.apache.cocoon.components.expression.ExpressionContext;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.instruction.MacroContext;
+import org.apache.cocoon.xml.NamespacesTable;
 import org.apache.cocoon.xml.XMLConsumer;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -52,9 +53,9 @@
     private final String systemId;
 
     public Event execute(XMLConsumer consumer,
-            ExpressionContext expressionContext,
+            ObjectModel objectModel,
             ExecutionContext executionContext, MacroContext macroContext,
-            Event startEvent, Event endEvent) throws SAXException {
+            NamespacesTable namespaces, Event startEvent, Event endEvent) throws SAXException
{
         consumer.startDTD(getName(), getPublicId(), getSystemId());
         return getNext();
     }

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartDocument.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartDocument.java?view=diff&rev=557585&r1=557584&r2=557585
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartDocument.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartDocument.java
Thu Jul 19 04:47:58 2007
@@ -19,9 +19,10 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.cocoon.components.expression.ExpressionContext;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.instruction.MacroContext;
+import org.apache.cocoon.xml.NamespacesTable;
 import org.apache.cocoon.xml.XMLConsumer;
 import org.apache.excalibur.source.SourceValidity;
 import org.xml.sax.Locator;
@@ -84,9 +85,9 @@
     }
 
     public Event execute(XMLConsumer consumer,
-            ExpressionContext expressionContext,
+            ObjectModel objectModel,
             ExecutionContext executionContext, MacroContext macroContext,
-            Event startEvent, Event endEvent) throws SAXException {
+            NamespacesTable namespaces, Event startEvent, Event endEvent) throws SAXException
{
         if (getEndDocument() != null)
             consumer.startDocument();
         return getNext();

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java?view=diff&rev=557585&r1=557584&r2=557585
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java
Thu Jul 19 04:47:58 2007
@@ -20,11 +20,12 @@
 import java.util.LinkedList;
 import java.util.List;
 
-import org.apache.cocoon.components.expression.ExpressionContext;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.environment.ParsingContext;
 import org.apache.cocoon.template.expression.Substitutions;
 import org.apache.cocoon.template.instruction.MacroContext;
+import org.apache.cocoon.xml.NamespacesTable;
 import org.apache.cocoon.xml.XMLConsumer;
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
@@ -100,9 +101,9 @@
     }
 
     public Event execute(XMLConsumer consumer,
-            ExpressionContext expressionContext,
+            ObjectModel objectModel,
             ExecutionContext executionContext, MacroContext macroContext,
-            Event startEvent, Event endEvent) throws SAXException {
+            NamespacesTable namespaces, Event startEvent, Event endEvent) throws SAXException
{
         Iterator i = getAttributeEvents().iterator();
         AttributesImpl attrs = new AttributesImpl();
         while (i.hasNext()) {
@@ -114,7 +115,7 @@
             } else if (attrEvent instanceof SubstituteAttribute) {
                 SubstituteAttribute substEvent = (SubstituteAttribute) attrEvent;
                 String attributeValue = substEvent.getSubstitutions().toString(
-                        getLocation(), expressionContext);
+                        getLocation(), objectModel);
                 attrs.addAttribute(attrEvent.getNamespaceURI(), attrEvent
                         .getLocalName(), attrEvent.getRaw(), attrEvent
                         .getType(), attributeValue);
@@ -122,7 +123,7 @@
         }
         
         // Send any pending startPrefixMapping events
-        expressionContext.getNamespaces().enterScope(consumer);
+        namespaces.enterScope(consumer);
         consumer.startElement(getNamespaceURI(), getLocalName(), getRaw(),
                 attrs);
         return getNext();

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartEntity.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartEntity.java?view=diff&rev=557585&r1=557584&r2=557585
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartEntity.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartEntity.java
Thu Jul 19 04:47:58 2007
@@ -16,9 +16,10 @@
  */
 package org.apache.cocoon.template.script.event;
 
-import org.apache.cocoon.components.expression.ExpressionContext;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.instruction.MacroContext;
+import org.apache.cocoon.xml.NamespacesTable;
 import org.apache.cocoon.xml.XMLConsumer;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -39,9 +40,9 @@
     private final String name;
 
     public Event execute(XMLConsumer consumer,
-            ExpressionContext expressionContext,
+            ObjectModel objectModel,
             ExecutionContext executionContext, MacroContext macroContext,
-            Event startEvent, Event endEvent) throws SAXException {
+            NamespacesTable namespaces, Event startEvent, Event endEvent) throws SAXException
{
         consumer.startEntity(getName());
         return getNext();
     }

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartPrefixMapping.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartPrefixMapping.java?view=diff&rev=557585&r1=557584&r2=557585
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartPrefixMapping.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartPrefixMapping.java
Thu Jul 19 04:47:58 2007
@@ -16,9 +16,10 @@
  */
 package org.apache.cocoon.template.script.event;
 
-import org.apache.cocoon.components.expression.ExpressionContext;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.instruction.MacroContext;
+import org.apache.cocoon.xml.NamespacesTable;
 import org.apache.cocoon.xml.XMLConsumer;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
@@ -45,12 +46,13 @@
     private final String uri;
 
     public Event execute(XMLConsumer consumer,
-            ExpressionContext expressionContext,
+            ObjectModel objectModel,
             ExecutionContext executionContext, MacroContext macroContext,
-            Event startEvent, Event endEvent) throws SAXException {
-        
-        expressionContext.getNamespaces().addDeclaration(getPrefix(), getUri());
+            NamespacesTable namespaces, Event startEvent, Event endEvent) throws SAXException
{
         // the startPrefixMapping event will be sent in StartElement
+        namespaces.addDeclaration(getPrefix(), getUri());
+        objectModel.markLocalContext();
+        objectModel.put(ObjectModel.NAMESPACE, namespaces);
         return getNext();
     }
 }

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/TextEvent.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/TextEvent.java?view=diff&rev=557585&r1=557584&r2=557585
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/TextEvent.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/TextEvent.java
Thu Jul 19 04:47:58 2007
@@ -18,7 +18,7 @@
 
 import java.util.Iterator;
 
-import org.apache.cocoon.components.expression.ExpressionContext;
+import org.apache.cocoon.objectmodel.ObjectModel;
 import org.apache.cocoon.template.environment.ErrorHolder;
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.environment.ParsingContext;
@@ -58,9 +58,8 @@
                 throws SAXException;
     }
 
-    protected static void characters(ExpressionContext expressionContext,
-                                   ExecutionContext executionContext,
-                                   TextEvent event, CharHandler handler)
+    protected static void characters(ObjectModel objectModel, ExecutionContext executionContext,
+                                     TextEvent event, CharHandler handler)
         throws SAXException {
         Iterator iter = event.getSubstitutions().iterator();
         while (iter.hasNext()) {
@@ -71,7 +70,7 @@
             } else {
                 JXTExpression expr = (JXTExpression) subst;
                 try {
-                    Object val = expr.getValue(expressionContext);
+                    Object val = expr.getValue(objectModel);
                     chars = val != null ? val.toString().toCharArray()
                             : ArrayUtils.EMPTY_CHAR_ARRAY;
                 } catch (Exception e) {



Mime
View raw message