cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r106196 - /cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java /cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml
Date Mon, 22 Nov 2004 16:04:57 GMT
Author: bruno
Date: Mon Nov 22 08:04:55 2004
New Revision: 106196

Modified:
   cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java
   cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml
Log:
re-applying the changes I did in revisions 53786 and 53803,
which got lost since I only applied them to the trunk.


Modified: cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java?view=diff&rev=106196&p1=cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java&r1=106195&p2=cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java&r2=106196
==============================================================================
--- cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java
(original)
+++ cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java
Mon Nov 22 08:04:55 2004
@@ -22,7 +22,6 @@
 import java.util.Map;
 
 import org.apache.cocoon.forms.Constants;
-import org.apache.cocoon.forms.formmodel.ContainerWidget;
 import org.apache.cocoon.forms.formmodel.Form;
 import org.apache.cocoon.forms.formmodel.Repeater;
 import org.apache.cocoon.forms.formmodel.Widget;
@@ -30,6 +29,7 @@
 import org.apache.cocoon.xml.AbstractXMLPipe;
 import org.apache.cocoon.xml.AttributesImpl;
 import org.apache.cocoon.xml.XMLConsumer;
+import org.apache.cocoon.xml.XMLUtils;
 import org.apache.commons.collections.ArrayStack;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
@@ -152,12 +152,20 @@
         getRepeater(widget, id).generateSize(this.cocoonConsumer);
     }
 
+    private static final String VALIDATION_ERROR = "validation-error";
+
     public void generateValidationError(ValidationError error) throws SAXException {
         // Needs to be buffered
         RootBufferingPipe pipe = new RootBufferingPipe(this.cocoonConsumer);
         this.stack.push(pipe);
         this.stack.push(error);
+        pipe.startElement(Constants.INSTANCE_NS, VALIDATION_ERROR, Constants.INSTANCE_PREFIX_COLON
+ VALIDATION_ERROR, XMLUtils.EMPTY_ATTRIBUTES);
         error.generateSaxFragment(pipe);
+        pipe.endElement(Constants.INSTANCE_NS, VALIDATION_ERROR, Constants.INSTANCE_PREFIX_COLON
+ VALIDATION_ERROR);
+    }
+
+    public boolean isValidationError(Object object) {
+        return object instanceof ValidationError;
     }
 
     public void defineClassBody(Form form, String id, Object body) {

Modified: cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml?view=diff&rev=106196&p1=cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml&r1=106195&p2=cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml&r2=106196
==============================================================================
--- cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml	(original)
+++ cocoon/trunk/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml	Mon
Nov 22 08:04:55 2004
@@ -6,7 +6,7 @@
         ft:form-template
     -->
     <jx:macro name="form-template" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
-      <jx:set var="cformsHelper" value="${Packages.org.apache.cocoon.forms.generation.JXMacrosHelper.createHelper(cocoon.consumer)}"/>
+      <jx:set var="cformsHelper" value="#{org.apache.cocoon.forms.generation.JXMacrosHelper.createHelper($cocoon/consumer)}"/>
       <jx:set var="form" value="${CocoonFormsInstance}"/>
       <jx:if test="${cformsHelper.isVisible(form)}">
         <jx:set var="cformsDummy" value="${cformsHelper.startForm(form, macro.arguments)}"/>
@@ -97,7 +97,7 @@
     -->
     <jx:macro name="group" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
       <jx:parameter name="id"/>
-      
+
       <jx:set var="widget" value="${cformsHelper.getWidget(widget, id)}"/>
       <jx:if test="${cformsHelper.isVisible(widget)}">
         <fi:group id="${widget.getRequestParameterName()}">
@@ -105,7 +105,7 @@
         </fi:group>
       </jx:if>
     </jx:macro>
-    
+
     <!--
         ft:new
     -->
@@ -163,7 +163,7 @@
       
       <jx:set var="widget" value="${cformsHelper.getWidget(widget, id)}"/>
       <jx:set var="validationError" value="${widget.getValidationError()}"/>
-      <jx:if test="${validationError != null}">
+      <jx:if test="${cformsHelper.isValidationError(validationError)}">
         <fi:validation-error>
           <jx:set var="cformsDummy" value="${cformsHelper.generateValidationError(validationError)}"/>
             <jx:evalBody/>

Mime
View raw message