cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject svn commit: r326838 [3/4] - in /cocoon/blocks: ajax/trunk/java/org/apache/cocoon/ajax/ ajax/trunk/java/org/apache/cocoon/ajax/resources/js/ ajax/trunk/java/org/apache/cocoon/transformation/ ajax/trunk/samples/ forms/trunk/java/org/apache/cocoon/forms/ ...
Date Thu, 20 Oct 2005 06:28:25 GMT
Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/JXMacrosHelper.java Wed Oct 19 23:26:53 2005
@@ -25,7 +25,7 @@
 
 import org.apache.cocoon.ajax.BrowserUpdateTransformer;
 import org.apache.cocoon.environment.Request;
-import org.apache.cocoon.forms.Constants;
+import org.apache.cocoon.forms.FormsConstants;
 import org.apache.cocoon.forms.FormsRuntimeException;
 import org.apache.cocoon.forms.formmodel.Form;
 import org.apache.cocoon.forms.formmodel.Repeater;
@@ -106,10 +106,10 @@
         
         this.ajaxTemplate = "true".equals(attributes.get("ajax"));
 
-        this.cocoonConsumer.startPrefixMapping(Constants.INSTANCE_PREFIX, Constants.INSTANCE_NS);
-        this.cocoonConsumer.startElement(Constants.INSTANCE_NS,
+        this.cocoonConsumer.startPrefixMapping(FormsConstants.INSTANCE_PREFIX, FormsConstants.INSTANCE_NS);
+        this.cocoonConsumer.startElement(FormsConstants.INSTANCE_NS,
                                          "form-template",
-                                         Constants.INSTANCE_PREFIX_COLON + "form-template",
+                                         FormsConstants.INSTANCE_PREFIX_COLON + "form-template",
                                          attrs);
         // Push the form at the top of the stack
         this.widgetStack.push(Boolean.FALSE); // Not in an updated template
@@ -119,10 +119,10 @@
     public void endForm() throws SAXException {
         this.widgetStack.pop();
         this.widgetStack.pop();
-        this.cocoonConsumer.endElement(Constants.INSTANCE_NS,
+        this.cocoonConsumer.endElement(FormsConstants.INSTANCE_NS,
                                        "form-template",
-                                       Constants.INSTANCE_PREFIX_COLON + "form-template");
-        this.cocoonConsumer.endPrefixMapping(Constants.INSTANCE_PREFIX);
+                                       FormsConstants.INSTANCE_PREFIX_COLON + "form-template");
+        this.cocoonConsumer.endPrefixMapping(FormsConstants.INSTANCE_PREFIX);
         
         this.ajaxTemplate = false;
         this.updatedWidgets = null;
@@ -150,49 +150,54 @@
         String id = widget.getFullName();
         boolean display;
 
-        if (widget.getState().isDisplayingValues()) {
-            //-----------------------------------------------------------------
-            // Widget is visible
-            //-----------------------------------------------------------------
-            if (ajaxRequest) {
-                // If an ajax request
-                if (this.updatedWidgets.contains(id)) {
-                    inUpdatedTemplate = true;
-                }
+        if (ajaxRequest) {
+            // An Ajax request. We will send partial updates
+            if (inUpdatedTemplate) {
+                // A parent widget has been updated: redisplay this one also
+                display = true;
+            } else if (this.updatedWidgets.contains(id)) {
+                // Widget has been updated. We are now in an updated template section,
+                // and widgets have to be surrounded with <bu:replace>
+                inUpdatedTemplate = true;
+                display = true;
+            } else if (this.childUpdatedWidgets.contains(id)) {
+                // A child need to be updated
+                display = true;
+            } else {
+                // Doesn't need to be displayed
+                display = false;
+            }
+        } else {
+            // Not an ajax request
+            if (ajaxTemplate) {
+                // Surround all widgets with <bu:replace>, which the bu tranformer will use to check structure
+                // consistency and add an id attribute to its child elements.
+                inUpdatedTemplate = true;
+            }
+            // Display the widget
+            display = true;
+        }
+        
+        if (display) {
+            // Widget needs to be displayed, but does it actually allows it?
+            if (widget.getState().isDisplayingValues()) {
                 if (inUpdatedTemplate) {
-                    // Display the widget surrounded by a bu:replace
+                    // Updated part of an Ajax template: surround with <bu:replace>
                     startBuReplace(id);
-                    display = true;
-                } else if (this.childUpdatedWidgets.contains(id)) {
-                    // A child needs to be displayed
-                    display = true;
-                } else {
-                    // Doesn't need to be displayed
-                    display = false;
                 }
             } else {
-                // Not an ajax request
                 if (ajaxTemplate) {
-                    // Start a bu:replace, which the bu tranformer will use to check structure
-                    // consistency and add an id attribute to its child element.
+                    // Generate a placeholder, so that the page can be updated later
                     startBuReplace(id);
+                    AttributesImpl attrs = new AttributesImpl();
+                    attrs.addCDATAAttribute("id", id);
+                    this.cocoonConsumer.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
+                    this.cocoonConsumer.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
+                    endBuReplace(id);
                 }
-                // Display the widget
-                display = true;
-            }
-        } else {
-            //-----------------------------------------------------------------
-            // Widget is not visible
-            //-----------------------------------------------------------------
-            if (ajaxTemplate) {
-                // Generate a placeholder, so that the page can be updated later
-                AttributesImpl attrs = new AttributesImpl();
-                attrs.addCDATAAttribute("id", id);
-                this.cocoonConsumer.startElement(Constants.INSTANCE_NS, "placeholder", Constants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
-                this.cocoonConsumer.endElement(Constants.INSTANCE_NS, "placeholder", Constants.INSTANCE_PREFIX_COLON + "placeholder");
+                // Production finished for this widget
+                display = false;
             }
-            // Don't display
-            display = false;
         }
 
         if (display) {
@@ -210,19 +215,10 @@
     public void popWidget() throws SAXException {
         Widget widget = (Widget)this.widgetStack.pop();
         boolean inUpdatedTemplate = ((Boolean)this.widgetStack.pop()).booleanValue();
-        // Note: the structure of if's below is the same as in enterWidget() above
-        // in order to more easily handle identical conditions
-        if (widget.getState().isDisplayingValues()) {
-            if (ajaxRequest) {
-                if (inUpdatedTemplate) {
-                    // Close the bu:replace
-                    endBuReplace(widget.getFullName());
-                }
-            } else {
-                if (ajaxTemplate) {
-                    endBuReplace(widget.getFullName());
-                }
-            }
+        
+        if (inUpdatedTemplate) {
+            // Close the bu:replace
+            endBuReplace(widget.getFullName());
         }
     }
     
@@ -327,9 +323,9 @@
         // Needs to be buffered
         RootBufferingPipe pipe = new RootBufferingPipe(this.cocoonConsumer);
         this.pipeStack.push(pipe);
-        pipe.startElement(Constants.INSTANCE_NS, VALIDATION_ERROR, Constants.INSTANCE_PREFIX_COLON + VALIDATION_ERROR, XMLUtils.EMPTY_ATTRIBUTES);
+        pipe.startElement(FormsConstants.INSTANCE_NS, VALIDATION_ERROR, FormsConstants.INSTANCE_PREFIX_COLON + VALIDATION_ERROR, XMLUtils.EMPTY_ATTRIBUTES);
         error.generateSaxFragment(pipe);
-        pipe.endElement(Constants.INSTANCE_NS, VALIDATION_ERROR, Constants.INSTANCE_PREFIX_COLON + VALIDATION_ERROR);
+        pipe.endElement(FormsConstants.INSTANCE_NS, VALIDATION_ERROR, FormsConstants.INSTANCE_PREFIX_COLON + VALIDATION_ERROR);
     }
 
     public boolean isValidationError(Object object) {
@@ -373,8 +369,8 @@
             AttributesImpl attrs = new AttributesImpl();
             attrs.addCDATAAttribute("id", id);
             this.cocoonConsumer.startElement(BrowserUpdateTransformer.BU_NSURI, "replace", "bu:replace", attrs);
-            this.cocoonConsumer.startElement(Constants.INSTANCE_NS, "placeholder", Constants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
-            this.cocoonConsumer.endElement(Constants.INSTANCE_NS, "placeholder", Constants.INSTANCE_PREFIX_COLON + "placeholder");
+            this.cocoonConsumer.startElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder", attrs);
+            this.cocoonConsumer.endElement(FormsConstants.INSTANCE_NS, "placeholder", FormsConstants.INSTANCE_PREFIX_COLON + "placeholder");
             this.cocoonConsumer.endElement(BrowserUpdateTransformer.BU_NSURI, "replace", "bu:replace");
         }
 
@@ -414,8 +410,8 @@
         
         if (attr != null) {
             // There were some styling attributes
-            handler.startElement(Constants.INSTANCE_NS, "styling", Constants.INSTANCE_PREFIX_COLON + "styling", attr);
-            handler.endElement(Constants.INSTANCE_NS, "styling", Constants.INSTANCE_PREFIX_COLON + "styling");
+            handler.startElement(FormsConstants.INSTANCE_NS, "styling", FormsConstants.INSTANCE_PREFIX_COLON + "styling", attr);
+            handler.endElement(FormsConstants.INSTANCE_NS, "styling", FormsConstants.INSTANCE_PREFIX_COLON + "styling");
             return true;
         } else {
             return false;
@@ -460,7 +456,7 @@
             }
             
             if (depth == 1 && forbidStyling &&
-                uri.equals(Constants.INSTANCE_NS) && loc.equals("styling")) {
+                uri.equals(FormsConstants.INSTANCE_NS) && loc.equals("styling")) {
                 throw new SAXException("Cannot use 'fi:*' attributes and <fi:styling> at the same time");
             }
 

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/SelectionListFilter.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/SelectionListFilter.java?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/SelectionListFilter.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/SelectionListFilter.java Wed Oct 19 23:26:53 2005
@@ -15,7 +15,7 @@
  */
 package org.apache.cocoon.forms.generation;
 
-import org.apache.cocoon.forms.Constants;
+import org.apache.cocoon.forms.FormsConstants;
 import org.apache.cocoon.xml.AbstractXMLPipe;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
@@ -45,7 +45,7 @@
     public void startElement(String uri, String loc, String raw, Attributes a) throws SAXException {
         depth++;
 
-        if (uri.equals(Constants.INSTANCE_NS) && loc.equals("item")) {
+        if (uri.equals(FormsConstants.INSTANCE_NS) && loc.equals("item")) {
             String value = a.getValue("value");
             if (!value.startsWith(this.filterValue)) {
                 filterDepth = depth;

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/SuggestionListGenerator.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/SuggestionListGenerator.java?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/SuggestionListGenerator.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/SuggestionListGenerator.java Wed Oct 19 23:26:53 2005
@@ -29,7 +29,7 @@
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.SourceResolver;
-import org.apache.cocoon.forms.Constants;
+import org.apache.cocoon.forms.FormsConstants;
 import org.apache.cocoon.forms.datatype.SelectionList;
 import org.apache.cocoon.forms.formmodel.Field;
 import org.apache.cocoon.forms.formmodel.Form;
@@ -90,7 +90,7 @@
     
     public void generate() throws IOException, SAXException, ProcessingException {
         super.contentHandler.startDocument();
-        super.contentHandler.startPrefixMapping(Constants.INSTANCE_PREFIX, Constants.INSTANCE_NS);
+        super.contentHandler.startPrefixMapping(FormsConstants.INSTANCE_PREFIX, FormsConstants.INSTANCE_NS);
         ContentHandler handler;
         if (filter == null || filter.length() == 0) {
             handler = super.contentHandler;
@@ -99,7 +99,7 @@
         }
         list.generateSaxFragment(handler, this.locale);
         
-        super.contentHandler.endPrefixMapping(Constants.INSTANCE_PREFIX);
+        super.contentHandler.endPrefixMapping(FormsConstants.INSTANCE_PREFIX);
         super.contentHandler.endDocument();
     }
 

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml Wed Oct 19 23:26:53 2005
@@ -121,10 +121,9 @@
 
       <jx:if test="${cformsHelper.pushContainer(id)}">
         <jx:set var="widget" value="${cformsHelper.peekWidget()}"/>
-        <!--FIXME(SW): revisit fi:group
-          fi:group id="${widget.getRequestParameterName()}"-->
+        <fi:group id="${widget.fullName}">
           <jx:evalBody/>
-        <!--/fi:group-->
+        </fi:group>
         <jx:set var="cformsDummy" value="${cformsHelper.popWidget()}"/>
       </jx:if>
     </jx:macro>

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl Wed Oct 19 23:26:53 2005
@@ -31,10 +31,10 @@
 
   <xsl:template match="head" mode="forms-field">
     <xsl:apply-imports/>
-    <script src="{$resources-uri}/mattkruse-lib/AnchorPosition.js" type="text/javascript"/>
-    <script src="{$resources-uri}/mattkruse-lib/PopupWindow.js" type="text/javascript"/>
-    <script src="{$resources-uri}/mattkruse-lib/OptionTransfer.js" type="text/javascript"/>
-    <script src="{$resources-uri}/mattkruse-lib/selectbox.js" type="text/javascript"/>
+    <script src="{$resources-uri}/forms/mattkruse-lib/AnchorPosition.js" type="text/javascript"/>
+    <script src="{$resources-uri}/forms/mattkruse-lib/PopupWindow.js" type="text/javascript"/>
+    <script src="{$resources-uri}/forms/mattkruse-lib/OptionTransfer.js" type="text/javascript"/>
+    <script src="{$resources-uri}/forms/mattkruse-lib/selectbox.js" type="text/javascript"/>
     <xsl:apply-templates select="." mode="forms-calendar"/>
     <xsl:apply-templates select="." mode="forms-htmlarea"/>
   </xsl:template>
@@ -69,7 +69,7 @@
   <xsl:template match="fi:help">
     <xsl:variable name="id" select="generate-id()"/>
     <div class="forms-help" id="help{$id}" style="visibility:hidden; position:absolute;">
-    	<span style="float:right"><a href="#" onClick="helpWin{$id}.hidePopup();return false;"><img align="top" alt="close" src="{$resources-uri}/img/close.gif" height="6" width="6"/></a></span>
+    	<span style="float:right"><a href="#" onClick="helpWin{$id}.hidePopup();return false;"><img align="top" alt="close" src="{$resources-uri}/forms/img/close.gif" height="6" width="6"/></a></span>
       <xsl:apply-templates select="node()"/>
     </div>
     <script type="text/javascript">
@@ -77,7 +77,7 @@
     </script>
     <a id="{$id}" name="{$id}" href="#" onclick="helpWin{$id}.showPopup('{$id}');return false;">
       <!-- TODO: i18n key for helppopup -->
-      <img src="{$resources-uri}/img/help.gif" alt="helppopup"/>
+      <img src="{$resources-uri}/forms/img/help.gif" alt="helppopup"/>
     </a>
   </xsl:template>
 

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl Wed Oct 19 23:26:53 2005
@@ -24,8 +24,8 @@
       +-->
 
   <xsl:template match="head" mode="forms-calendar">
-    <script src="{$resources-uri}/mattkruse-lib/CalendarPopup.js" type="text/javascript"/>
-    <script src="{$resources-uri}/mattkruse-lib/date.js" type="text/javascript"/>
+    <script src="{$resources-uri}/forms/mattkruse-lib/CalendarPopup.js" type="text/javascript"/>
+    <script src="{$resources-uri}/forms/mattkruse-lib/date.js" type="text/javascript"/>
     <script type="text/javascript">
       // Setup calendar
       var forms_calendar = CalendarPopup();
@@ -34,7 +34,7 @@
       forms_calendar.showYearNavigationInput();
       forms_calendar.setCssPrefix("forms_");
     </script>
-    <link rel="stylesheet" type="text/css" href="{$resources-uri}/css/forms-calendar.css"/>
+    <link rel="stylesheet" type="text/css" href="{$resources-uri}/forms/css/forms-calendar.css"/>
   </xsl:template>
 
   <xsl:template match="body" mode="forms-calendar">
@@ -77,12 +77,12 @@
 	      <!-- calendar popup -->
 	      <xsl:choose>
 	        <xsl:when test="@state = 'disabled'">
-	          <img src="{$resources-uri}/img/cal.gif" alt="forms:calendar.alt" i18n:attr="alt"/>
+	          <img src="{$resources-uri}/forms/img/cal.gif" alt="forms:calendar.alt" i18n:attr="alt"/>
 	        </xsl:when>
 	        <xsl:otherwise>
 	          <a href="#" name="{$id}" id="{$id}"
 	             onclick="forms_calendar.select(forms_getForm(this)['{@id}'],'{$id}','{$format}'); return false;">
-	            <img src="{$resources-uri}/img/cal.gif" alt="forms:calendar.alt" i18n:attr="alt"/>
+	            <img src="{$resources-uri}/forms/img/cal.gif" alt="forms:calendar.alt" i18n:attr="alt"/>
 	          </a>
 	        </xsl:otherwise>
 	      </xsl:choose>

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-field-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-field-styling.xsl?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-field-styling.xsl (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-field-styling.xsl Wed Oct 19 23:26:53 2005
@@ -27,10 +27,10 @@
                 exclude-result-prefixes="fi">
 
   <xsl:template match="head" mode="forms-field">
-    <script src="{$resources-uri}/js/forms-lib.js" type="text/javascript"/>
+    <script src="{$resources-uri}/forms/js/forms-lib.js" type="text/javascript"/>
     <script src="{$resources-uri}/ajax/js/cocoon-ajax.js" type="text/javascript"/>
-    <script src="{$resources-uri}/js/cforms.js" type="text/javascript"/>
-    <link rel="stylesheet" type="text/css" href="{$resources-uri}/css/forms.css"/>
+    <script src="{$resources-uri}/forms/js/cforms.js" type="text/javascript"/>
+    <link rel="stylesheet" type="text/css" href="{$resources-uri}/forms/css/forms.css"/>
   </xsl:template>
 
   <xsl:template match="body" mode="forms-field">
@@ -266,24 +266,6 @@
   </xsl:template>
 
   <!--+
-      | fi:field with a selection list and @type 'output'
-      +-->
-  <xsl:template match="fi:field[fi:selection-list][fi:styling/@type='output']" priority="3">
-    <xsl:variable name="value" select="fi:value"/>
-    <xsl:variable name="selected" select="fi:selection-list/fi:item[@value = $value]"/>
-    <span id="{@id}">
-      <xsl:choose>
-        <xsl:when test="$selected/fi:label">
-          <xsl:copy-of select="$selected/fi:label/node()"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="$value"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </span>
-  </xsl:template>
-
-  <!--+
       | fi:field with @type 'textarea'
       +-->
   <xsl:template match="fi:field[fi:styling/@type='textarea']">
@@ -298,11 +280,21 @@
   </xsl:template>
 
   <!--+
-      | fi:field with @type 'output' and fi:output are both rendered as text
+      | fi:output is rendered as text
       +-->
-  <xsl:template match="fi:output | fi:field[fi:styling/@type='output']" priority="2">
+  <xsl:template match="fi:output">
     <span id="{@id}"><xsl:copy-of select="fi:value/node()"/></span>
   </xsl:template>
+  
+  <!--+
+      | fi:field with @type 'output' used to be allowed but causes too much problems
+      +-->
+  <xsl:template match="fi:field[fi:styling/@type='output']" priority="10">
+    <xsl:message terminate="yes">
+      <xsl:text>&lt;fi:styling type="output"&gt; should no more be used as it resets field values. </xsl:text>
+      <xsl:text>Please set the widget's state to WidgetState.OUTPUT instead.</xsl:text>
+    </xsl:message>
+  </xsl:template>
 
   <!--+
       | Labels for form elements.
@@ -325,7 +317,7 @@
   <!--+
       | Labels for pure outputs must not contain <label/> as there is no element to point to.
       +-->
-  <xsl:template match="fi:output | fi:field[fi:styling/@type='output'] | fi:messages | fi:field[fi:selection-list][fi:styling/@list-type='radio']" mode="label">
+  <xsl:template match="fi:output | fi:messages | fi:field[fi:selection-list][fi:styling/@list-type='radio']" mode="label">
     <xsl:copy-of select="fi:label/node()"/>
   </xsl:template>
 
@@ -359,7 +351,7 @@
       | fi:booleanfield with @state 'output': rendered as an inactive checkbox (this doesn't
       | use text but avoids i18n problems related to hardcoding 'yes'/'no' or 'true'/'false'
       +-->
-  <xsl:template match="fi:booleanfield[@state='output' or fi:styling/@type='output']" priority="3">
+  <xsl:template match="fi:booleanfield[@state='output']" priority="3">
     <input id="{@id}" type="checkbox" title="{fi:hint}" disabled="disabled" value="{@true-value}">
     	  <xsl:if test="fi:value != 'true'">
     	    <xsl:attribute name="checked">checked</xsl:attribute>
@@ -546,7 +538,7 @@
       <!-- hidden field to store the submit id -->
       <div><input type="hidden" name="forms_submit_id"/></div>
       <xsl:if test="@ajax = 'true'">
-        <script script="text/javascript">Cocoon.CForms.ajax = true;</script>
+        <script script="text/javascript">cocoon.forms.ajax = true;</script>
       </xsl:if>
       <xsl:apply-templates/>
       
@@ -681,6 +673,13 @@
       | fi:struct - has no visual representation by default
       +-->
   <xsl:template match="fi:struct">
+    <xsl:apply-templates/>
+  </xsl:template>
+
+  <!--+
+      | fi:group - has no visual representation by default
+      +-->
+  <xsl:template match="fi:group">
     <xsl:apply-templates/>
   </xsl:template>
 

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-htmlarea-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-htmlarea-styling.xsl?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-htmlarea-styling.xsl (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-htmlarea-styling.xsl Wed Oct 19 23:26:53 2005
@@ -26,10 +26,10 @@
 
   <xsl:template match="head" mode="forms-htmlarea">
     <script type="text/javascript">
-      _editor_url = "<xsl:value-of select="concat($resources-uri, '/htmlarea/')"/>";
+      _editor_url = "<xsl:value-of select="concat($resources-uri, '/forms/htmlarea/')"/>";
       _editor_lang = "<xsl:value-of select="$htmlarea-lang"/>";
     </script>
-    <script type="text/javascript" src="{$resources-uri}/htmlarea/htmlarea.js"></script>
+    <script type="text/javascript" src="{$resources-uri}/forms/htmlarea/htmlarea.js"></script>
   </xsl:template>
 
   <xsl:template match="body" mode="forms-htmlarea"/>

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-page-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-page-styling.xsl?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-page-styling.xsl (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/forms-page-styling.xsl Wed Oct 19 23:26:53 2005
@@ -31,9 +31,9 @@
   <xsl:template match="body" mode="forms-page"/>
 
   <!--
-    fi:group : default is to enclose items in a div
+    fi:group with a layout but no type : enclose items in a div
   -->
-  <xsl:template match="fi:group">
+  <xsl:template match="fi:group[fi:styling/@layout and not(fi:styling/@type)]">
     <div title="{fi:hint}">
       <xsl:copy-of select="@*"/>
       <xsl:apply-templates mode="group-layout" select="."/>
@@ -59,7 +59,13 @@
     </xsl:variable>
     <!-- copy the "state-widget" attribute for use in for-each -->
     <xsl:variable name="state-widget" select="fi:state/fi:*/@id"/>
-    <xsl:variable name="id" select="generate-id()"/>
+
+    <xsl:variable name="id">
+      <xsl:choose>
+        <xsl:when test="@id"><xsl:value-of select="@id"/></xsl:when>
+        <xsl:otherwise><xsl:value-of select="generate-id()"/></xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
 
     <div id="{$id}" title="{fi:hint}">
       <!-- add an hidden input for the state -->
@@ -136,7 +142,13 @@
     </xsl:variable>
     <!-- copy the "state-widget" attribute for use in for-each -->
     <xsl:variable name="state-widget" select="fi:state/fi:*/@id"/>
-    <xsl:variable name="id" select="generate-id()"/>
+
+    <xsl:variable name="id">
+      <xsl:choose>
+        <xsl:when test="@id"><xsl:value-of select="@id"/></xsl:when>
+        <xsl:otherwise><xsl:value-of select="generate-id()"/></xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
 
     <fieldset id="{$id}">
       <legend title="{fi:hint}">
@@ -184,6 +196,9 @@
   -->
   <xsl:template match="fi:group[fi:styling/@type='fieldset']">
     <fieldset>
+      <xsl:if test="@id">
+        <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
+      </xsl:if>
       <xsl:apply-templates select="." mode="styling"/>
       <legend title="{fi:hint}"><xsl:copy-of select="fi:label/node()"/></legend>
       <xsl:apply-templates mode="group-layout" select="."/>

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/htmlarea/htmlarea.js
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/htmlarea/htmlarea.js?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/htmlarea/htmlarea.js (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/htmlarea/htmlarea.js Wed Oct 19 23:26:53 2005
@@ -321,7 +321,7 @@
  */
 HTMLArea.Config.prototype.hideSomeButtons = function(remove) {
 	var toolbar = this.toolbar;
-	for (var i in toolbar) {
+	for (var i = 0; i < toolbar.length; i++) { //in toolbar) {
 		var line = toolbar[i];
 		for (var j = line.length; --j >= 0; ) {
 			if (remove.indexOf(" " + line[j] + " ") >= 0) {
@@ -567,14 +567,14 @@
 	};
 
 	var first = true;
-	for (var i in this.config.toolbar) {
+	for (var i = 0; i < this.config.toolbar.length; i++) {// in this.config.toolbar) {
 		if (!first) {
 			createButton("linebreak");
 		} else {
 			first = false;
 		}
 		var group = this.config.toolbar[i];
-		for (var j in group) {
+		for (var j = 0; j < group.length; j++) {// in group) {
 			var code = group[j];
 			if (/^([IT])\[(.*?)\]/.test(code)) {
 				// special case, create text label

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js Wed Oct 19 23:26:53 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2005 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,29 +14,41 @@
  * limitations under the License.
  */
 
-//-------------------------------------------------------------------------------------------------
 /**
- * The CForms class holds all forms-related properties and methods.
+ * Runtime JavaScript library for Cocoon forms.
+ *
+ * @version $Id$
  */
 
-// in case the cocoon-ajax.js lib is not loaded
-if (!Cocoon) Cocoon = new Object();
-if (!Cocoon.CForms) Cocoon.CForms = new Object();
+//-------------------------------------------------------------------------------------------------
+/**
+ * The cocoon.forms object holds all forms-related properties and methods.
+ */
+if (typeof cocoon == "undefined") cocoon = {};
 
-Cocoon.CForms = {
+cocoon.forms = {
     ajax : false // default mode is full page update
 };
 
 /**
- * Submits a form. If ajax mode is on and the browser is ajax-aware, the page isn't reloaded
+ * Get the form of an element
  */
-Cocoon.CForms.submitForm = function(element, name) {
+cocoon.forms.getForm = function(element) {
+    while(element != null && element.tagName != "FORM") {
+        element = element.parentNode;
+    }
+    return element;
+}
 
-    if (name == undefined) {
+/**
+ * Submits a form. If ajax mode is on and the browser is ajax-aware, the page isn't reloaded
+ */
+cocoon.forms.submitForm = function(element, name) {
+    if (typeof(name) == "undefined") {
         name = element.name;
     }
     
-    var form = forms_getForm(element);
+    var form = this.getForm(element);
     if (form == null) {
         alert("Cannot find form for " + element);
     } else {
@@ -44,50 +56,48 @@
         // FIXME: programmatically submitting the form doesn't trigger onsubmit ? (both in IE and Moz)
         forms_onsubmit();
         
-        if (Cocoon.CForms.ajax && Cocoon.Ajax.BrowserUpdater != null) {
-        
-        	// Provide feedback that something is happening.
-        	document.body.style.cursor = "wait";
-
-					var uri = form.getAttribute("ajax-action");
-					if (! uri) uri = form.action;
-					if ( uri == "" ) uri = document.location;
-        
-        	var req = new Cocoon.Ajax.BrowserUpdater(
-        		uri, 
-						{
-							method: 'post', 
-							postBody: Cocoon.CForms.buildQueryString(form, name), 
-							onFailure: Cocoon.Ajax.BrowserUpdater.handleError,
-							form: form
-						}
-					);
+        // Provide feedback that something is happening.
+        document.body.style.cursor = "wait";
         
-					// Reset submit-id
-					form["forms_submit_id"].value = '';
-					forms_onsubmitHandlers = new Array();
+        var req = this.ajax && cocoon.ajax.newXMLHttpRequest();
+        if (req) {
+            var query = this._buildQueryString(form, name);
+            if (!query) {
+                // Some inputs are not ajax-compatible. Fall back to full page reload
+                form.submit();
+            }
+
+            // The "ajax-action" attribute specifies an alternate submit location used in Ajax mode.
+            // This allows to use Ajax in the portal where forms are normally posted to the portal URL.
+            var uri = form.getAttribute("ajax-action");
+            if (! uri) uri = form.action;
+            if (uri == "") uri = document.location;
+
+            req.open("POST", uri, true);
+            req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
+            req.onreadystatechange = function() {
+                if (req.readyState == 4) {
+                    cocoon.forms._handleBrowserUpdate(form, req);
+                }
+            }
+            req.send(query);
+            // Reset submit-id
+            form["forms_submit_id"].value = '';
+            forms_onsubmitHandlers = new Array();
         } else {
             // Non ajax-aware browser : regular submit
             form.submit();
         }
     }
-
 }
 
 // Override the default forms_submitForm
-forms_submitForm = Cocoon.CForms.submitForm;
+forms_submitForm = function() { cocoon.forms.submitForm.apply(cocoon.forms, arguments) };
 
 /**
  * Build a query string with all form inputs
- *
- * NB. It is possible that this could be replaced by the use of Form.serialize in prototype.js
- * but that Objec t also sends Submit buttons, which it is possible CForms does not want
- *
- * Another possiblity is that we could overcome that horror in HTML whereby 
- * unchecked checkboxes are not normally submitted :-)
- *
  */
-Cocoon.CForms.buildQueryString = function(form, submitId) {
+cocoon.forms._buildQueryString = function(form, submitId) {
     // Indicate to the server that we're in ajax mode
     var result = "cocoon-ajax=true";
     // Iterate on all form controls
@@ -101,7 +111,83 @@
             // Skip unchecked checkboxes and radio buttons
             continue;
         }
+        if (input.type == "file") {
+            // Can't send files in Ajax mode. Fall back to full page
+            return null;
+        }
+        if (input.tagName.toLowerCase() == "select" && input.multiple) {
+            var name = encodeURIComponent(input.name);
+            var options = input.options;
+            for (i in options) {
+                if (options[i].selected) {
+                    result += "&" + name + "=" + encodeURIComponent(options[i].value)
+                }
+            }
+            // don't use the default fallback
+            continue;
+        }
+        
+        // text, passwod, textarea, hidden, single select
         result += "&" + encodeURIComponent(input.name) + "=" + encodeURIComponent(input.value);
     }
     return result;
+}
+
+/**
+ * Redirect when interaction is finished with the current form
+ */
+cocoon.forms._continue = function(form) {
+    if (form.method.toLowerCase() == "post") {
+        // Create a fake form and post it
+        var div = document.createElement("div");
+        content = "<form action='" + form.action + "' method='POST'>" +
+                  "<input type='hidden' name='cocoon-ajax-continue' value='true'/>";
+	    if (form.elements["continuation-id"]) {
+	        content += "<input type='hidden' name='continuation-id' value='" +
+	            form.elements["continuation-id"].value + "'/>";
+	    }
+	    content += "</form>";
+	    div.innerHTML = content;
+	    document.body.appendChild(div);
+	    div.firstChild.submit();
+    } else {	    
+        // Redirect to the form's action URL
+	    var contParam = '?cocoon-ajax-continue=true';
+	    if (form.elements["continuation-id"]) {
+	        contParam += "&continuation-id=" + form.elements["continuation-id"].value;
+	    }
+	    window.location.href = form.action + contParam;
+	}
+}
+
+/**
+ * Handle the server response
+ */
+cocoon.forms._handleBrowserUpdate = function(form, request) {
+    // Restore normal cursor
+    document.body.style.cursor = "auto";
+    if (request.status == 200) {
+        var xca;
+        try { // An exception is thrown if header doesn't exist
+            xca = request.getResponseHeader("X-Cocoon-Ajax");
+        } catch (e) {
+            // header doesn't exist
+        }
+        if (xca == "continue") {
+            this._continue(form);
+        } else {
+            // Handle browser update directives
+            var doc = request.responseXML;
+            if (!doc) {
+                cocoon.ajax.BrowserUpdater.handleError("No xml answer", request);
+                return;
+            }
+            
+            var updater = new cocoon.ajax.BrowserUpdater();
+            updater.handlers['continue'] = function() { cocoon.forms._continue(form); }
+            updater.processResponse(doc, request);
+       }
+    } else {
+        cocoon.ajax.BrowserUpdater.handleError("Request failed - status=" + request.status, request);
+    }
 }

Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java Wed Oct 19 23:26:53 2005
@@ -17,7 +17,7 @@
 
 import org.apache.avalon.excalibur.pool.Recyclable;
 
-import org.apache.cocoon.forms.Constants;
+import org.apache.cocoon.forms.FormsConstants;
 import org.apache.cocoon.forms.formmodel.AggregateField;
 import org.apache.cocoon.forms.formmodel.DataWidget;
 import org.apache.cocoon.forms.formmodel.Group;
@@ -48,10 +48,10 @@
 
 /**
  * The basic operation of this Pipe is that it replaces <code>ft:widget</code>
- * (in the {@link Constants#TEMPLATE_NS} namespace) tags (having an id attribute)
+ * (in the {@link FormsConstants#TEMPLATE_NS} namespace) tags (having an id attribute)
  * by the XML representation of the corresponding widget instance.
  *
- * <p>These XML fragments (normally all in the {@link Constants#INSTANCE_NS "CForms Instance"}
+ * <p>These XML fragments (normally all in the {@link FormsConstants#INSTANCE_NS "CForms Instance"}
  * namespace), can then be translated to a HTML presentation by an XSLT.
  * This XSLT will then only have to style individual widget, and will not
  * need to do the whole page layout.
@@ -266,7 +266,7 @@
         }
 
         // Consume template namespace mapping
-        if (!Constants.TEMPLATE_NS.equals(uri)) {
+        if (!FormsConstants.TEMPLATE_NS.equals(uri)) {
             super.startPrefixMapping(prefix, uri);
         }
     }
@@ -297,7 +297,7 @@
         }
 
         // Consume template namespace mapping
-        if (!Constants.TEMPLATE_NS.equals(uri)) {
+        if (!FormsConstants.TEMPLATE_NS.equals(uri)) {
             super.endPrefixMapping(prefix);
         }
     }
@@ -325,7 +325,7 @@
         public Handler nestedElement(String uri, String loc, String raw, Attributes attrs)
         throws SAXException {
             // Is it forms namespace?
-            if (!Constants.TEMPLATE_NS.equals(uri)) {
+            if (!FormsConstants.TEMPLATE_NS.equals(uri)) {
                 return hNested;
             }
 
@@ -345,7 +345,7 @@
     protected class DocHandler extends CopyHandler {
         public Handler nestedElement(String uri, String loc, String raw, Attributes attrs)
         throws SAXException {
-            if (Constants.TEMPLATE_NS.equals(uri)) {
+            if (FormsConstants.TEMPLATE_NS.equals(uri)) {
                 if (!FORM_TEMPLATE_EL.equals(loc)) {
                     throw new SAXException("Element '" + loc + "' is not permitted outside of " +
                                            "'form-template', at " + getLocation());
@@ -424,19 +424,19 @@
                 throw new SAXException( e.getMessage() + " " +getLocation());
             }
             
-            hasInstanceNamespace = hasPrefixMapping(Constants.INSTANCE_NS, Constants.INSTANCE_PREFIX);
+            hasInstanceNamespace = hasPrefixMapping(FormsConstants.INSTANCE_NS, FormsConstants.INSTANCE_PREFIX);
             if (!hasInstanceNamespace) {
-                getContentHandler().startPrefixMapping(Constants.INSTANCE_PREFIX, Constants.INSTANCE_NS);
+                getContentHandler().startPrefixMapping(FormsConstants.INSTANCE_PREFIX, FormsConstants.INSTANCE_NS);
             }
-            getContentHandler().startElement(Constants.INSTANCE_NS, "form-template", Constants.INSTANCE_PREFIX_COLON + "form-template", transAttrs);
+            getContentHandler().startElement(FormsConstants.INSTANCE_NS, "form-template", FormsConstants.INSTANCE_PREFIX_COLON + "form-template", transAttrs);
             return this;
         }
 
         public void endElement(String uri, String loc, String raw)
         throws SAXException {
-            getContentHandler().endElement(Constants.INSTANCE_NS, "form-template", Constants.INSTANCE_PREFIX_COLON + "form-template");
+            getContentHandler().endElement(FormsConstants.INSTANCE_NS, "form-template", FormsConstants.INSTANCE_PREFIX_COLON + "form-template");
             if (!hasInstanceNamespace) {
-                getContentHandler().endPrefixMapping(Constants.INSTANCE_PREFIX);
+                getContentHandler().endPrefixMapping(FormsConstants.INSTANCE_PREFIX);
             }
             contextWidget = null;
         }
@@ -496,7 +496,7 @@
 
         public Handler nestedElement(String uri, String loc, String raw, Attributes attrs)
         throws SAXException {
-            if (Constants.INSTANCE_NS.equals(uri)) {
+            if (FormsConstants.INSTANCE_NS.equals(uri)) {
                 if (!STYLING_EL.equals(loc)) {
                     throw new SAXException("Element '" + loc + "' is not permitted within 'widget', " +
                                            "at " + getLocation());
@@ -669,7 +669,7 @@
         }
 
         public Handler nestedElement(String uri, String loc, String raw, Attributes attrs) throws SAXException {
-            if (Constants.TEMPLATE_NS.equals(uri)) {
+            if (FormsConstants.TEMPLATE_NS.equals(uri)) {
                 if ("when".equals(loc)) {
                     String testValue = getAttributeValue(loc, attrs, "value");
                     String value = (String) ((Widget) chooseWidgets.get(0)).getValue();
@@ -691,7 +691,7 @@
      */
     protected class ChoosePassThruHandler extends CopyHandler {
         public Handler nestedElement(String uri, String loc, String raw, Attributes attrs) throws SAXException {
-            if (Constants.TEMPLATE_NS.equals(uri)) {
+            if (FormsConstants.TEMPLATE_NS.equals(uri)) {
                 if ("when".equals(loc)) {
                     String testValue = getAttributeValue(loc, attrs, "value");
                     String value = (String) ((Widget) chooseWidgets.get(0)).getValue();
@@ -731,7 +731,7 @@
 
         public Handler nestedElement(String uri, String loc, String raw, Attributes attrs)
         throws SAXException {
-            if (Constants.TEMPLATE_NS.equals(uri)) {
+            if (FormsConstants.TEMPLATE_NS.equals(uri)) {
                 if ("case".equals(loc)) {
                     String id = getAttributeValue(loc, attrs, "id");
                     String value = (String) contextWidget.getValue();
@@ -753,7 +753,7 @@
     protected class UnionPassThruHandler extends CopyHandler {
         public Handler nestedElement(String uri, String loc, String raw, Attributes attrs)
         throws SAXException {
-            if (Constants.TEMPLATE_NS.equals(uri)) {
+            if (FormsConstants.TEMPLATE_NS.equals(uri)) {
                 if ("case".equals(loc)) {
                     if (contextWidget.getValue().equals(attrs.getValue("id"))) {
                         return hSkip;
@@ -845,9 +845,9 @@
             }
 
             String id = idObj.toString();
-            getContentHandler().startElement(Constants.INSTANCE_NS, "continuation-id", Constants.INSTANCE_PREFIX_COLON + "continuation-id", attrs);
+            getContentHandler().startElement(FormsConstants.INSTANCE_NS, "continuation-id", FormsConstants.INSTANCE_PREFIX_COLON + "continuation-id", attrs);
             getContentHandler().characters(id.toCharArray(), 0, id.length());
-            getContentHandler().endElement(Constants.INSTANCE_NS, "continuation-id", Constants.INSTANCE_PREFIX_COLON + "continuation-id");
+            getContentHandler().endElement(FormsConstants.INSTANCE_NS, "continuation-id", FormsConstants.INSTANCE_PREFIX_COLON + "continuation-id");
             return this;
         }
 
@@ -911,9 +911,9 @@
             if (widget instanceof ValidationErrorAware) {
                 ValidationError error = ((ValidationErrorAware)widget).getValidationError();
                 if (error != null) {
-                    getContentHandler().startElement(Constants.INSTANCE_NS, VALIDATION_ERROR, Constants.INSTANCE_PREFIX_COLON + VALIDATION_ERROR, XMLUtils.EMPTY_ATTRIBUTES);
+                    getContentHandler().startElement(FormsConstants.INSTANCE_NS, VALIDATION_ERROR, FormsConstants.INSTANCE_PREFIX_COLON + VALIDATION_ERROR, XMLUtils.EMPTY_ATTRIBUTES);
                     error.generateSaxFragment(hStyling);
-                    getContentHandler().endElement(Constants.INSTANCE_NS, VALIDATION_ERROR, Constants.INSTANCE_PREFIX_COLON + VALIDATION_ERROR);
+                    getContentHandler().endElement(FormsConstants.INSTANCE_NS, VALIDATION_ERROR, FormsConstants.INSTANCE_PREFIX_COLON + VALIDATION_ERROR);
                 }
             }
             widget = null;

Modified: cocoon/blocks/forms/trunk/samples/dreamteam/content/teamTemplate.jx
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/dreamteam/content/teamTemplate.jx?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/dreamteam/content/teamTemplate.jx (original)
+++ cocoon/blocks/forms/trunk/samples/dreamteam/content/teamTemplate.jx Wed Oct 19 23:26:53 2005
@@ -34,25 +34,25 @@
           </tr>
           <tr>
             <td>
-              <img src="resources/move_up.gif"/>
+              <img src="resources/forms/img/move_up.gif"/>
             </td>
             <td>Move this row 1 up</td>
           </tr>
           <tr>
             <td>
-              <img src="resources/move_down.gif"/>
+              <img src="resources/forms/img/move_down.gif"/>
             </td>
             <td>Move this row 1 down</td>
           </tr>
           <tr>
             <td>
-              <img src="resources/delete.gif"/>
+              <img src="resources/forms/img/delete.gif"/>
             </td>
             <td>Delete this row</td>
           </tr>
           <tr>
             <td>
-              <img src="resources/new.gif"/>
+              <img src="resources/forms/img/new.gif"/>
             </td>
             <td>Add a new row below this row</td>
           </tr>
@@ -111,11 +111,11 @@
                       -->
                       <jx:choose>
                         <jx:when test="${repeaterLoop.first}">
-                          <img src="resources/blank_btn.gif"/>
+                          <img src="resources/forms/img/blank_btn.gif"/>
                         </jx:when>
                         <jx:otherwise>
                           <ft:widget id="up">
-                            <fi:styling type="image" src="resources/move_up.gif"/>
+                            <fi:styling type="image" src="resources/forms/img/move_up.gif"/>
                           </ft:widget>
                         </jx:otherwise>
                       </jx:choose>
@@ -128,15 +128,15 @@
                         </jx:when>
                         <jx:otherwise>
                           <ft:widget id="down">
-                            <fi:styling type="image" src="resources/move_down.gif"/>
+                            <fi:styling type="image" src="resources/forms/img/move_down.gif"/>
                           </ft:widget>
                         </jx:otherwise>
                       </jx:choose>
                       <ft:widget id="delete">
-                        <fi:styling type="image" src="resources/delete.gif"/>
+                        <fi:styling type="image" src="resources/forms/img/delete.gif"/>
                       </ft:widget>
                       <ft:widget id="add">
-                        <fi:styling type="image" src="resources/new.gif"/>
+                        <fi:styling type="image" src="resources/forms/img/new.gif"/>
                       </ft:widget>
                       <ft:widget id="select"/>
                     </td>

Modified: cocoon/blocks/forms/trunk/samples/dreamteam/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/dreamteam/sitemap.xmap?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/dreamteam/sitemap.xmap (original)
+++ cocoon/blocks/forms/trunk/samples/dreamteam/sitemap.xmap Wed Oct 19 23:26:53 2005
@@ -125,8 +125,8 @@
       <!-- ========================================= -->
       <!-- images                                    -->
       <!-- ========================================= -->
-      <map:match pattern="resources/*.gif">
-        <map:read mime-type="image/gif" src="resource://org/apache/cocoon/forms/resources/img/{1}.gif"/>
+      <map:match pattern="resources/*/**">
+        <map:read src="resource://org/apache/cocoon/{1}/resources/{2}"/>
       </map:match>
       <map:match pattern="flags/*.gif">
         <map:read mime-type="image/gif" src="resources/flags/{1}.gif"/>
@@ -136,12 +136,6 @@
       <!-- ========================================= -->
       <map:match pattern="local-resources/*.css">
         <map:read mime-type="text/css" src="resources/styles/{1}.css"/>
-      </map:match>
-      <map:match pattern="resources/**.css">
-        <map:read mime-type="text/css" src="resource://org/apache/cocoon/forms/resources/styles/{1}.css"/>
-      </map:match>
-      <map:match pattern="resources/**.js">
-        <map:read src="resource://org/apache/cocoon/forms/resources/{1}.js"/>
       </map:match>
     </map:pipeline>
   </map:pipelines>

Modified: cocoon/blocks/forms/trunk/samples/flow/forms_flow_example.js
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/flow/forms_flow_example.js?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/flow/forms_flow_example.js (original)
+++ cocoon/blocks/forms/trunk/samples/flow/forms_flow_example.js Wed Oct 19 23:26:53 2005
@@ -52,7 +52,11 @@
     form.lookupWidget("make").setValue(cocoon.parameters.defaultMake);
     form.showForm("carselector-display-pipeline.jx");
     cocoon.request.setAttribute("carselectorform", form.getWidget());
-    cocoon.sendPage("carselector-success-pipeline.xsp");
+    cocoon.sendPage("carselector-success-pipeline.xsp", {
+        make: form.lookupWidget("make").value,
+	type: form.lookupWidget("type").value,
+	model: form.lookupWidget("model").value}
+    );
 }
 
 function xhrSelectCar() {

Modified: cocoon/blocks/forms/trunk/samples/forms/carselector_success_jx.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/forms/carselector_success_jx.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/forms/carselector_success_jx.xml (original)
+++ cocoon/blocks/forms/trunk/samples/forms/carselector_success_jx.xml Wed Oct 19 23:26:53 2005
@@ -23,9 +23,7 @@
   <h4 class="samplesGroup">AJAX sample</h4>
   <title>Car selector result</title>
   <content>
-    You selected: maker ${request.getAttribute("carselectorform").lookupWidget("make").getValue()},
-    type ${request.getAttribute("carselectorform").lookupWidget("type").getValue()},
-    model ${request.getAttribute("carselectorform").lookupWidget("model").getValue()}
+    You selected: maker ${make}, type ${type}, model ${model}
     <p>
       <a href="./">Back to Forms samples</a>
     </p>

Modified: cocoon/blocks/forms/trunk/samples/forms/carselector_template.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/forms/carselector_template.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/forms/carselector_template.xml (original)
+++ cocoon/blocks/forms/trunk/samples/forms/carselector_template.xml Wed Oct 19 23:26:53 2005
@@ -35,15 +35,16 @@
     See "carselector_form.xml" and "carselector_template.xml" to see how this is done.
   </para>
   <content>
-    <script language="JavaScript">
+    <script type="text/javascript">
        var currentEffect = "fade";
+       cocoon.ajax.BrowserUpdater.highlight = cocoon.ajax.Fader.fade;
        function setEffect(effect) {
            if (effect == "none") {
-               BrowserUpdate.highlight = null;
+               cocoon.ajax.BrowserUpdater.highlight = null;
            } else if (effect == "fade") {
-               BrowserUpdate.highlight = Fader.fade;
+               cocoon.ajax.BrowserUpdater.highlight = cocoon.ajax.Fader.fade;
            } else if (effect == "blink") {
-               BrowserUpdate.highlight = Blinker.blink;
+               cocoon.ajax.BrowserUpdater.highlight = cocoon.ajax.Blinker.blink;
            }
            
            document.getElementById(currentEffect).style.fontWeight = "";
@@ -54,9 +55,9 @@
     </script>
     <para>
       Page update effect:
-      <a id="none" href="#" onclick="setEffect('none')">None</a> - 
-      <a style="font-weight: bold" id="fade" href="#" onclick="setEffect('fade')">Fade</a> - 
-      <a id="blink" href="#" onclick="setEffect('blink')">Blink</a>
+      <a id="none" href="#" onclick="return setEffect('none')">None</a> - 
+      <a style="font-weight: bold" id="fade" href="#" onclick="return setEffect('fade')">Fade</a> - 
+      <a id="blink" href="#" onclick="return setEffect('blink')">Blink</a>
     </para>
       
     <ft:form-template action="continue" method="POST" ajax="true">

Modified: cocoon/blocks/forms/trunk/samples/forms/datasource_chooser_template.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/forms/datasource_chooser_template.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/forms/datasource_chooser_template.xml (original)
+++ cocoon/blocks/forms/trunk/samples/forms/datasource_chooser_template.xml Wed Oct 19 23:26:53 2005
@@ -22,6 +22,9 @@
   <jx:import uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml"/>
   <h4 class="samplesGroup">Union widget sample (with AJAX)</h4>
   <title>Datasource chooser</title>
+  <script type="text/javascript">
+     cocoon.ajax.BrowserUpdater.highlight = cocoon.ajax.Fader.fade;
+  </script>
   <content>
     <ft:form-template action="#{$cocoon/continuation/id}.continue" method="POST" ajax="true">
       

Modified: cocoon/blocks/forms/trunk/samples/forms/dynamicrepeater_template.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/forms/dynamicrepeater_template.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/forms/dynamicrepeater_template.xml (original)
+++ cocoon/blocks/forms/trunk/samples/forms/dynamicrepeater_template.xml Wed Oct 19 23:26:53 2005
@@ -74,22 +74,22 @@
                         <!-- Don't display the "move up" button on the first row -->
                         <jx:choose>
                           <jx:when test="${repeaterLoop.first}">
-                            <img src="resources/img/blank_btn.gif"/>
+                            <img src="resources/forms/img/blank_btn.gif"/>
                           </jx:when>
                           <jx:otherwise>
                             <ft:widget id="up">
-                              <fi:styling type="image" src="resources/img/move_up.gif"/>
+                              <fi:styling type="image" src="resources/forms/img/move_up.gif"/>
                             </ft:widget>
                           </jx:otherwise>
                         </jx:choose>
                         <!-- Don't display the "move down" button on the first row -->
                         <jx:choose>
                           <jx:when test="${repeaterLoop.last}">
-                            <img src="resources/img/blank_btn.gif"/>
+                            <img src="resources/forms/img/blank_btn.gif"/>
                           </jx:when>
                           <jx:otherwise>
                             <ft:widget id="down">
-                              <fi:styling type="image" src="resources/img/move_down.gif"/>
+                              <fi:styling type="image" src="resources/forms/img/move_down.gif"/>
                             </ft:widget>
                           </jx:otherwise>
                         </jx:choose>
@@ -102,7 +102,7 @@
               </jx:choose>
              <p>
                   <ft:widget id="../addcontact"/>
-                  <jx:if test="${widget.getChild('contacts').getSize() > 0}">
+                  <jx:if test="${widget.getSize() > 0}">
                     <ft:widget id="../removecontacts"/>
                   </jx:if>
               </p>

Modified: cocoon/blocks/forms/trunk/samples/forms/file_explorer_template.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/forms/file_explorer_template.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/forms/file_explorer_template.xml (original)
+++ cocoon/blocks/forms/trunk/samples/forms/file_explorer_template.xml Wed Oct 19 23:26:53 2005
@@ -24,18 +24,19 @@
   <jx:macro name="toggle-icon">
 	  <jx:choose>
 	    <jx:when test="${treeNode.isLeaf()}">
-	      <img src="resources/img/tree/win/${treeNode.iconType}.gif" border="0"/>
+	      <img src="resources/forms/img/tree/win/${treeNode.iconType}.gif" border="0"/>
 	    </jx:when>
 	    <jx:otherwise>
 	       <a href="#" onclick="return TreeToggleCollapse('${widget.fullName}', '${treeNode.path}')"><img
-	         src="resources/img/tree/win/${treeNode.iconType}.gif" border="0"/></a>
+	         src="resources/forms/img/tree/win/${treeNode.iconType}.gif" border="0"/></a>
 	    </jx:otherwise>
 	  </jx:choose>
   </jx:macro>
   
   <title>File explorer</title>
   <style type="text/css">
-    #files td { border: dotted black 1px; }
+	 #files { border-collapse: collapse; border-left: dotted black 1px; }
+    #files td { padding: 0.1em; border-bottom: dotted black 1px; }
     .selected { background: #D0D0D0; }
   </style>
   <content>
@@ -69,8 +70,6 @@
         return TreeAction(id, "toggle-select", path);
       }
       
-      // Trees are fully-refreshed for now, and highlighting them isn't nice
-      BrowserUpdate.highlight = null;
     </script>
     <ft:form-template action="continue" method="POST" ajax="true">
       <ft:continuation-id/>

Modified: cocoon/blocks/forms/trunk/samples/forms/multipage_template.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/forms/multipage_template.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/forms/multipage_template.xml (original)
+++ cocoon/blocks/forms/trunk/samples/forms/multipage_template.xml Wed Oct 19 23:26:53 2005
@@ -24,12 +24,16 @@
   <!-- Import the macros that define CForms template elements -->
   <jx:import uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml"/>
   <h4 class="samplesGroup">Widget sampler: one form divided in multiple pages</h4>
-  <title>Sample multipage form</title>
+  <title>Sample multipage form with Ajax updates</title>
+  <script type="text/javascript">
+	  //cocoon.ajax.BrowserUpdater.highlight = cocoon.ajax.Fader.fade;
+  </script>
   <content>
-    <ft:form-template action="#{$cocoon/continuation/id}.continue" method="POST">
+    <ft:form-template action="#{$cocoon/continuation/id}.continue" method="POST" ajax="true">
       <div style="width: 70%; margin: 10px 50px 50px 50px;">
       	
         <ft:group id="page1">
+	       <div id="page1">
             <!-- group with automatic two-column layout -->
             <fi:group>
               <fi:label>String fields</fi:label>
@@ -46,10 +50,11 @@
             
         	   <br/>
             <ft:widget id="next"/>
-            
+          </div>
          </ft:group>
 
          <ft:group id="page2">
+	        <div id="page2">
             <fi:group>
               <fi:label>Number fields</fi:label>
               <fi:styling type="fieldset" layout="columns"/>
@@ -68,9 +73,11 @@
         	   <br/>
             <ft:widget id="prev"/>
             <ft:widget id="next"/>
+           </div>
          </ft:group>
          
          <ft:group id="page3">
+	        <div id="page3">
             <fi:group>
               <fi:styling type="fieldset" layout="columns"/>
               <fi:label>Boolean fields</fi:label>
@@ -85,6 +92,7 @@
         	   <br/>
             <ft:widget id="prev"/>
             <ft:widget id="ok"/>
+          </div>
         </ft:group>
 
       </div>

Modified: cocoon/blocks/forms/trunk/samples/forms/sampletree_template.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/forms/sampletree_template.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/forms/sampletree_template.xml (original)
+++ cocoon/blocks/forms/trunk/samples/forms/sampletree_template.xml Wed Oct 19 23:26:53 2005
@@ -25,18 +25,19 @@
   <jx:macro name="toggle-icon">
 	  <jx:choose>
 	    <jx:when test="${treeNode.isLeaf()}">
-	      <img src="resources/img/tree/win/${treeNode.iconType}.gif" border="0"/>
+	      <img src="resources/forms/img/tree/win/${treeNode.iconType}.gif" border="0"/>
 	    </jx:when>
 	    <jx:otherwise>
 	       <a href="#" onclick="return TreeToggleCollapse('${widget.fullName}', '${treeNode.path}')"><img
-	         src="resources/img/tree/win/${treeNode.iconType}.gif" border="0"/></a>
+	         src="resources/forms/img/tree/win/${treeNode.iconType}.gif" border="0"/></a>
 	    </jx:otherwise>
 	  </jx:choose>
   </jx:macro>
   
-  <title>Datasource chooser</title>
+  <title>Tree layout samples</title>
   <style type="text/css">
-    #files td { border: dotted black 1px; }
+	 #files { border-collapse: collapse; }
+    #files td { padding: 0.1em; border-top: dotted black 1px; }
     .selected { background: #D0D0D0; }
   </style>
   <content>
@@ -66,9 +67,11 @@
         return TreeAction(id, "toggle-select", path);
       }
       
-      // Trees are fully-refreshed for now, and highlighting them isn't nice
-      Cocoon.Ajax.BrowserUpdater.highlight = null;
     </script>
+    <p>This page shows a number of different possible renderings of a tree widget. They're all very easily defined
+	    in the form template using the &lt;ft:tree&gt; and &lt;ft:tree-nodes&gt; instructions (currently available only
+	    in the JXTemplate version of the CForms template language).</p>
+
     <ft:form-template action="#{$cocoon/continuation/id}.continue" method="get" ajax="true">
       Name: <ft:widget id="name"/>
       <br/>

Modified: cocoon/blocks/forms/trunk/samples/forms/tasktree_template.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/forms/tasktree_template.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/forms/tasktree_template.xml (original)
+++ cocoon/blocks/forms/trunk/samples/forms/tasktree_template.xml Wed Oct 19 23:26:53 2005
@@ -71,10 +71,10 @@
         <div class="section">
           <ft:group id="task">
             <span class="actions">
-              <ft:widget id="down"><fi:styling type="image" src="resources/img/move_down.gif"/></ft:widget>
-              <ft:widget id="up"><fi:styling type="image" src="resources/img/move_up.gif"/></ft:widget>
-              <ft:widget id="delete"><fi:styling type="image" src="resources/img/delete.gif"/></ft:widget>
-              <ft:widget id="add"><fi:styling type="image" src="resources/img/new.gif"/></ft:widget>
+              <ft:widget id="down"><fi:styling type="image" src="resources/forms/img/move_down.gif"/></ft:widget>
+              <ft:widget id="up"><fi:styling type="image" src="resources/forms/img/move_up.gif"/></ft:widget>
+              <ft:widget id="delete"><fi:styling type="image" src="resources/forms/img/delete.gif"/></ft:widget>
+              <ft:widget id="add"><fi:styling type="image" src="resources/forms/img/new.gif"/></ft:widget>
             </span>
             Title: <ft:widget id="title"/>
             From <ft:widget id="start"><fi:styling size="10"/></ft:widget>

Modified: cocoon/blocks/forms/trunk/samples/forms/xdoceditor_template.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/forms/xdoceditor_template.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/forms/xdoceditor_template.xml (original)
+++ cocoon/blocks/forms/trunk/samples/forms/xdoceditor_template.xml Wed Oct 19 23:26:53 2005
@@ -71,22 +71,22 @@
                         <!-- Don't display the "move up" button on the first row -->
                         <jx:choose>
                           <jx:when test="${repeaterLoop.first}">
-                            <img src="resources/img/blank_btn.gif"/>
+                            <img src="resources/forms/img/blank_btn.gif"/>
                           </jx:when>
                           <jx:otherwise>
                             <ft:widget id="up">
-                              <fi:styling type="image" src="resources/img/move_up.gif"/>
+                              <fi:styling type="image" src="resources/forms/img/move_up.gif"/>
                             </ft:widget>
                           </jx:otherwise>
                         </jx:choose>
                         <!-- Don't display the "move down" button on the first row -->
                         <jx:choose>
                           <jx:when test="${repeaterLoop.last}">
-                            <img src="resources/img/blank_btn.gif"/>
+                            <img src="resources/forms/img/blank_btn.gif"/>
                           </jx:when>
                           <jx:otherwise>
                             <ft:widget id="down">
-                              <fi:styling type="image" src="resources/img/move_down.gif"/>
+                              <fi:styling type="image" src="resources/forms/img/move_down.gif"/>
                             </ft:widget>
                           </jx:otherwise>
                         </jx:choose>

Modified: cocoon/blocks/forms/trunk/samples/library/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/library/sitemap.xmap?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/library/sitemap.xmap (original)
+++ cocoon/blocks/forms/trunk/samples/library/sitemap.xmap Wed Oct 19 23:26:53 2005
@@ -128,8 +128,8 @@
         <map:serialize type="xml"/>
       </map:match>
       
-      <map:match pattern="resources/**">
-        <map:read src="resource://org/apache/cocoon/forms/{0}"/>
+      <map:match pattern="resources/*/**">
+        <map:read src="resource://org/apache/cocoon/{1}/{2}"/>
       </map:match>
       
       

Modified: cocoon/blocks/forms/trunk/samples/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/sitemap.xmap?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/sitemap.xmap (original)
+++ cocoon/blocks/forms/trunk/samples/sitemap.xmap Wed Oct 19 23:26:53 2005
@@ -439,10 +439,6 @@
        <map:call function="htmlarea"/>
      </map:match>
 
-     <map:match pattern="htmlarea/**">
-       <map:read src="resource://org/apache/cocoon/forms/resources/{0}"/>
-     </map:match>
-     
      <map:match pattern="htmlarea-display-pipeline">
        <map:generate src="forms/htmlarea_template.xml"/>
        <map:transform type="forms"/>
@@ -465,14 +461,18 @@
        <map:serialize type="xml"/>
      </map:match>
 
-     <map:match type="regexp" pattern="resources/(ajax)/(.*)">
+     <!-- System-provided resources
+          If needed, you can override them with your own pipelines before -->
+
+     <!-- for developers: load directly from the source tree, rather than from the jars
+ 	  <map:match pattern="resources/*/**">
+	    <map:read src="file://{realpath:}/../../src/blocks/{1}/trunk/java/org/apache/cocoon/{1}/resources/{2}"/>
+	  </map:match>
+       -->
+     <map:match pattern="resources/*/**">
        <map:read src="resource://org/apache/cocoon/{1}/resources/{2}"/>
      </map:match>
      
-     <map:match pattern="resources/**">
-       <map:read src="resource://org/apache/cocoon/forms/{0}"/>
-     </map:match>
-
      <!--
         | Sample building a forms-form-gui editor in forms
         | Doubles as a showcase for class, new, struct, union widgets

Modified: cocoon/blocks/forms/trunk/samples/sqldatabase/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/sqldatabase/sitemap.xmap?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/sqldatabase/sitemap.xmap (original)
+++ cocoon/blocks/forms/trunk/samples/sqldatabase/sitemap.xmap Wed Oct 19 23:26:53 2005
@@ -92,8 +92,8 @@
       </map:match>
 
       <!-- Serve resources -->
-      <map:match pattern="resources/**">
-        <map:read src="resource://org/apache/cocoon/forms/resources/{1}"/>
+      <map:match pattern="resources/*/**">
+        <map:read src="resource://org/apache/cocoon/{1}/resources/{2}"/>
       </map:match>
 
     </map:pipeline>

Modified: cocoon/blocks/forms/trunk/samples/swan/forms/binding_template.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/swan/forms/binding_template.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/swan/forms/binding_template.xml (original)
+++ cocoon/blocks/forms/trunk/samples/swan/forms/binding_template.xml Wed Oct 19 23:26:53 2005
@@ -385,26 +385,26 @@
       <ft:class id="view-selector-class">
         <ft:choose path="view-selector">
           <ft:when value="fold">
-            <ft:widget id="view-view"><fi:styling type="image" src="resources/img/view.gif"/></ft:widget>
-            <ft:widget id="edit-view"><fi:styling type="image" src="resources/img/edit.gif"/></ft:widget>
+            <ft:widget id="view-view"><fi:styling type="image" src="resources/forms/img/view.gif"/></ft:widget>
+            <ft:widget id="edit-view"><fi:styling type="image" src="resources/forms/img/edit.gif"/></ft:widget>
           </ft:when>
           <ft:when value="view">
-            <ft:widget id="fold-view"><fi:styling type="image" src="resources/img/fold.gif"/></ft:widget>
-            <ft:widget id="edit-view"><fi:styling type="image" src="resources/img/edit.gif"/></ft:widget>
+            <ft:widget id="fold-view"><fi:styling type="image" src="resources/forms/img/fold.gif"/></ft:widget>
+            <ft:widget id="edit-view"><fi:styling type="image" src="resources/forms/img/edit.gif"/></ft:widget>
           </ft:when>
           <ft:when value="edit">
-            <ft:widget id="fold-view"><fi:styling type="image" src="resources/img/fold.gif"/></ft:widget>
-            <ft:widget id="view-view"><fi:styling type="image" src="resources/img/view.gif"/></ft:widget>
+            <ft:widget id="fold-view"><fi:styling type="image" src="resources/forms/img/fold.gif"/></ft:widget>
+            <ft:widget id="view-view"><fi:styling type="image" src="resources/forms/img/view.gif"/></ft:widget>
           </ft:when>
         </ft:choose>
       </ft:class>
 
       <ft:class id="item-row-class">
         <span class="actions">
-          <ft:widget id="up"><fi:styling type="image" src="resources/img/move_up.gif"/></ft:widget>
-          <ft:widget id="down"><fi:styling type="image" src="resources/img/move_down.gif"/></ft:widget>
-          <ft:widget id="add"><fi:styling type="image" src="resources/img/new.gif"/></ft:widget>
-          &#160;<ft:widget id="delete"><fi:styling type="image" src="resources/img/delete.gif"/></ft:widget>
+          <ft:widget id="up"><fi:styling type="image" src="resources/forms/img/move_up.gif"/></ft:widget>
+          <ft:widget id="down"><fi:styling type="image" src="resources/forms/img/move_down.gif"/></ft:widget>
+          <ft:widget id="add"><fi:styling type="image" src="resources/forms/img/new.gif"/></ft:widget>
+          &#160;<ft:widget id="delete"><fi:styling type="image" src="resources/forms/img/delete.gif"/></ft:widget>
         </span>
         <ft:new id="view-selector-class"/>
         <ft:new id="type-selector-class"/>
@@ -412,7 +412,7 @@
       </ft:class>
 
       <ft:class id="items-class">
-        <ft:widget id="addItem"><fi:styling type="image" src="resources/img/new_child.gif"/></ft:widget>
+        <ft:widget id="addItem"><fi:styling type="image" src="resources/forms/img/new_child.gif"/></ft:widget>
         <ft:repeater-size id="items"/>
         <ft:repeater-widget id="items">
           <div class="section"><ft:new id="item-row-class"/></div>

Modified: cocoon/blocks/forms/trunk/samples/swan/forms/model_template.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/swan/forms/model_template.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/swan/forms/model_template.xml (original)
+++ cocoon/blocks/forms/trunk/samples/swan/forms/model_template.xml Wed Oct 19 23:26:53 2005
@@ -315,26 +315,26 @@
       <ft:class id="view-selector-class">
         <ft:choose path="view-selector">
           <ft:when value="fold">
-            <ft:widget id="view-view"><fi:styling type="image" src="resources/img/view.gif"/></ft:widget>
-            <ft:widget id="edit-view"><fi:styling type="image" src="resources/img/edit.gif"/></ft:widget>
+            <ft:widget id="view-view"><fi:styling type="image" src="resources/forms/img/view.gif"/></ft:widget>
+            <ft:widget id="edit-view"><fi:styling type="image" src="resources/forms/img/edit.gif"/></ft:widget>
           </ft:when>
           <ft:when value="view">
-            <ft:widget id="fold-view"><fi:styling type="image" src="resources/img/fold.gif"/></ft:widget>
-            <ft:widget id="edit-view"><fi:styling type="image" src="resources/img/edit.gif"/></ft:widget>
+            <ft:widget id="fold-view"><fi:styling type="image" src="resources/forms/img/fold.gif"/></ft:widget>
+            <ft:widget id="edit-view"><fi:styling type="image" src="resources/forms/img/edit.gif"/></ft:widget>
           </ft:when>
           <ft:when value="edit">
-            <ft:widget id="fold-view"><fi:styling type="image" src="resources/img/fold.gif"/></ft:widget>
-            <ft:widget id="view-view"><fi:styling type="image" src="resources/img/view.gif"/></ft:widget>
+            <ft:widget id="fold-view"><fi:styling type="image" src="resources/forms/img/fold.gif"/></ft:widget>
+            <ft:widget id="view-view"><fi:styling type="image" src="resources/forms/img/view.gif"/></ft:widget>
           </ft:when>
         </ft:choose>
       </ft:class>
 
       <ft:class id="item-row-class">
         <span class="actions">
-          <ft:widget id="up"><fi:styling type="image" src="resources/img/move_up.gif"/></ft:widget>
-          <ft:widget id="down"><fi:styling type="image" src="resources/img/move_down.gif"/></ft:widget>
-          <ft:widget id="add"><fi:styling type="image" src="resources/img/new.gif"/></ft:widget>
-          &#160;<ft:widget id="delete"><fi:styling type="image" src="resources/img/delete.gif"/></ft:widget>
+          <ft:widget id="up"><fi:styling type="image" src="resources/forms/img/move_up.gif"/></ft:widget>
+          <ft:widget id="down"><fi:styling type="image" src="resources/forms/img/move_down.gif"/></ft:widget>
+          <ft:widget id="add"><fi:styling type="image" src="resources/forms/img/new.gif"/></ft:widget>
+          &#160;<ft:widget id="delete"><fi:styling type="image" src="resources/forms/img/delete.gif"/></ft:widget>
         </span>
         <ft:new id="view-selector-class"/>
         <ft:new id="type-selector-class"/>
@@ -342,7 +342,7 @@
       </ft:class>
 
       <ft:class id="items-class">
-        <ft:widget id="addItem"><fi:styling type="image" src="resources/img/new_child.gif"/></ft:widget>
+        <ft:widget id="addItem"><fi:styling type="image" src="resources/forms/img/new_child.gif"/></ft:widget>
         <ft:repeater-size id="items"/>
         <ft:repeater-widget id="items">
           <div class="section"><ft:new id="item-row-class"/></div>

Modified: cocoon/blocks/forms/trunk/samples/swan/forms/sitemap_template.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/swan/forms/sitemap_template.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/swan/forms/sitemap_template.xml (original)
+++ cocoon/blocks/forms/trunk/samples/swan/forms/sitemap_template.xml Wed Oct 19 23:26:53 2005
@@ -436,26 +436,26 @@
       <ft:class id="view-selector-class">
         <ft:choose path="view-selector">
           <ft:when value="fold">
-            <ft:widget id="view-view"><fi:styling type="image" src="resources/img/view.gif"/></ft:widget>
-            <ft:widget id="edit-view"><fi:styling type="image" src="resources/img/edit.gif"/></ft:widget>
+            <ft:widget id="view-view"><fi:styling type="image" src="resources/forms/img/view.gif"/></ft:widget>
+            <ft:widget id="edit-view"><fi:styling type="image" src="resources/forms/img/edit.gif"/></ft:widget>
           </ft:when>
           <ft:when value="view">
-            <ft:widget id="fold-view"><fi:styling type="image" src="resources/img/fold.gif"/></ft:widget>
-            <ft:widget id="edit-view"><fi:styling type="image" src="resources/img/edit.gif"/></ft:widget>
+            <ft:widget id="fold-view"><fi:styling type="image" src="resources/forms/img/fold.gif"/></ft:widget>
+            <ft:widget id="edit-view"><fi:styling type="image" src="resources/forms/img/edit.gif"/></ft:widget>
           </ft:when>
           <ft:when value="edit">
-            <ft:widget id="fold-view"><fi:styling type="image" src="resources/img/fold.gif"/></ft:widget>
-            <ft:widget id="view-view"><fi:styling type="image" src="resources/img/view.gif"/></ft:widget>
+            <ft:widget id="fold-view"><fi:styling type="image" src="resources/forms/img/fold.gif"/></ft:widget>
+            <ft:widget id="view-view"><fi:styling type="image" src="resources/forms/img/view.gif"/></ft:widget>
           </ft:when>
         </ft:choose>
       </ft:class>
 
       <ft:class id="item-row-class">
         <span class="actions">
-          <ft:widget id="up"><fi:styling type="image" src="resources/img/move_up.gif"/></ft:widget>
-          <ft:widget id="down"><fi:styling type="image" src="resources/img/move_down.gif"/></ft:widget>
-          <ft:widget id="add"><fi:styling type="image" src="resources/img/new.gif"/></ft:widget>
-          &#160;<ft:widget id="delete"><fi:styling type="image" src="resources/img/delete.gif"/></ft:widget>
+          <ft:widget id="up"><fi:styling type="image" src="resources/forms/img/move_up.gif"/></ft:widget>
+          <ft:widget id="down"><fi:styling type="image" src="resources/forms/img/move_down.gif"/></ft:widget>
+          <ft:widget id="add"><fi:styling type="image" src="resources/forms/img/new.gif"/></ft:widget>
+          &#160;<ft:widget id="delete"><fi:styling type="image" src="resources/forms/img/delete.gif"/></ft:widget>
         </span>
         <ft:new id="view-selector-class"/>
         <ft:new id="type-selector-class"/>
@@ -463,7 +463,7 @@
       </ft:class>
 
       <ft:class id="items-class">
-        <ft:widget id="addItem"><fi:styling type="image" src="resources/img/new_child.gif"/></ft:widget>
+        <ft:widget id="addItem"><fi:styling type="image" src="resources/forms/img/new_child.gif"/></ft:widget>
         <ft:repeater-size id="items"/>
         <ft:repeater-widget id="items">
           <div class="section"><ft:new id="item-row-class"/></div>

Modified: cocoon/blocks/forms/trunk/samples/swan/forms/template_template.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/swan/forms/template_template.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/swan/forms/template_template.xml (original)
+++ cocoon/blocks/forms/trunk/samples/swan/forms/template_template.xml Wed Oct 19 23:26:53 2005
@@ -285,26 +285,26 @@
       <ft:class id="view-selector-class">
         <ft:choose path="view-selector">
           <ft:when value="fold">
-            <ft:widget id="view-view"><fi:styling type="image" src="resources/img/view.gif"/></ft:widget>
-            <ft:widget id="edit-view"><fi:styling type="image" src="resources/img/edit.gif"/></ft:widget>
+            <ft:widget id="view-view"><fi:styling type="image" src="resources/forms/img/view.gif"/></ft:widget>
+            <ft:widget id="edit-view"><fi:styling type="image" src="resources/forms/img/edit.gif"/></ft:widget>
           </ft:when>
           <ft:when value="view">
-            <ft:widget id="fold-view"><fi:styling type="image" src="resources/img/fold.gif"/></ft:widget>
-            <ft:widget id="edit-view"><fi:styling type="image" src="resources/img/edit.gif"/></ft:widget>
+            <ft:widget id="fold-view"><fi:styling type="image" src="resources/forms/img/fold.gif"/></ft:widget>
+            <ft:widget id="edit-view"><fi:styling type="image" src="resources/forms/img/edit.gif"/></ft:widget>
           </ft:when>
           <ft:when value="edit">
-            <ft:widget id="fold-view"><fi:styling type="image" src="resources/img/fold.gif"/></ft:widget>
-            <ft:widget id="view-view"><fi:styling type="image" src="resources/img/view.gif"/></ft:widget>
+            <ft:widget id="fold-view"><fi:styling type="image" src="resources/forms/img/fold.gif"/></ft:widget>
+            <ft:widget id="view-view"><fi:styling type="image" src="resources/forms/img/view.gif"/></ft:widget>
           </ft:when>
         </ft:choose>
       </ft:class>
 
       <ft:class id="item-row-class">
         <span class="actions">
-          <ft:widget id="up"><fi:styling type="image" src="resources/img/move_up.gif"/></ft:widget>
-          <ft:widget id="down"><fi:styling type="image" src="resources/img/move_down.gif"/></ft:widget>
-          <ft:widget id="add"><fi:styling type="image" src="resources/img/new.gif"/></ft:widget>
-          &#160;<ft:widget id="delete"><fi:styling type="image" src="resources/img/delete.gif"/></ft:widget>
+          <ft:widget id="up"><fi:styling type="image" src="resources/forms/img/move_up.gif"/></ft:widget>
+          <ft:widget id="down"><fi:styling type="image" src="resources/forms/img/move_down.gif"/></ft:widget>
+          <ft:widget id="add"><fi:styling type="image" src="resources/forms/img/new.gif"/></ft:widget>
+          &#160;<ft:widget id="delete"><fi:styling type="image" src="resources/forms/img/delete.gif"/></ft:widget>
         </span>
         <ft:new id="view-selector-class"/>
         <ft:new id="type-selector-class"/>
@@ -312,7 +312,7 @@
       </ft:class>
 
       <ft:class id="items-class">
-        <ft:widget id="addItem"><fi:styling type="image" src="resources/img/new_child.gif"/></ft:widget>
+        <ft:widget id="addItem"><fi:styling type="image" src="resources/forms/img/new_child.gif"/></ft:widget>
         <ft:repeater-size id="items"/>
         <ft:repeater-widget id="items">
           <div class="section"><ft:new id="item-row-class"/></div>

Modified: cocoon/blocks/forms/trunk/samples/swan/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/swan/sitemap.xmap?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/swan/sitemap.xmap (original)
+++ cocoon/blocks/forms/trunk/samples/swan/sitemap.xmap Wed Oct 19 23:26:53 2005
@@ -115,8 +115,8 @@
         <map:serialize/>
       </map:match>
 
-      <map:match pattern="resources/**">
-        <map:read src="resource://org/apache/cocoon/forms/{0}"/>
+      <map:match pattern="resources/*/**">
+        <map:read src="resource://org/apache/cocoon/{1}/{2}"/>
       </map:match>
  
       <map:match pattern="swan/resources/**">

Modified: cocoon/blocks/forms/trunk/samples/welcome.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/samples/welcome.xml?rev=326838&r1=326837&r2=326838&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/samples/welcome.xml (original)
+++ cocoon/blocks/forms/trunk/samples/welcome.xml Wed Oct 19 23:26:53 2005
@@ -127,11 +127,11 @@
    </sample>
  </group>
  
- <group name="Advanced Ajax samples (work in progress)">
+ <!--group name="Advanced Ajax samples (work in progress)">
    <sample name="Cocoon suggests" href="do-suggest.flow">
      (Ajax) Very simple demo of the &lt;suggestion-list&gt; feature.
    </sample>
- </group>
+ </group-->
  
  <group name="Dynamic repeater template and event handling">
     <sample name="Dynamic repeater template" href="dreamteam">
@@ -148,6 +148,7 @@
     <sample name="form1 - FormsTransformer" href="form1-cforms-transformer">Render form using the FormsTransformer</sample>    
   </group> 
  
+<!--
  <group name="Experimental Flowscript API for Cocoon Forms">
   <note>
     The sample below demonstrates a proposal for a new Flowscript API, including a multipage form with a back button.
@@ -161,10 +162,10 @@
   </note>
   <sample name="Swan" href="swan/">Start page</sample>
  </group>
-
+-->
   <group name="Forms Library samples">
     <note>
-      This demonstrates the new library subsystem of Cocoon Forms.
+      This demonstrates the new library subsystem of Cocoon Forms. This is currently under development and is likely to change.
     </note>
     <sample name="Basic Sample" href="library/form1.flow">Basic Sample</sample>
     <sample name="Basic Sample 2" href="library/form2.flow">Basic Sample 2 (depends on the same library as above, see how it still changes after editing the library and reloading the first)</sample>



Mime
View raw message