cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jheym...@apache.org
Subject svn commit: r330548 [104/132] - in /cocoon/whiteboard/maven2/cocoon-flat-layout: ./ cocoon-ajax-block/ cocoon-ajax-block/api/ cocoon-ajax-block/api/src/ cocoon-ajax-block/api/src/main/ cocoon-ajax-block/api/src/main/java/ cocoon-ajax-block/api/src/main...
Date Thu, 03 Nov 2005 14:00:48 GMT
Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/datatype/convertor/HtmlCleanerConfiguration.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/datatype/convertor/HtmlCleanerConfiguration.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/datatype/convertor/HtmlCleanerConfiguration.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/datatype/convertor/HtmlCleanerConfiguration.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,144 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 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.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<htmlcleaner>
+  <cleanup>
+    <!-- Span elements will only be retained if they have one of the classes listed belowed. -->
+    <allowed-span-classes>
+    </allowed-span-classes>
+
+    <!-- Div elements will only be retained if they have one of the classes listed belowed. -->
+    <allowed-div-classes>
+    </allowed-div-classes>
+
+    <!-- The class attribute of p elements will only be retained if they have one of the classes listed belowed. -->
+    <allowed-para-classes>
+      <class>note</class>
+      <class>warn</class>
+      <class>fixme</class>
+    </allowed-para-classes>
+
+    <!-- The class attribute of pre elements will only be retained if they have one of the classes listed belowed. -->
+    <allowed-pre-classes>
+      <class>query</class>
+      <class>include</class>
+      <class>query-and-include</class>      
+    </allowed-pre-classes>
+
+    <img-alternate-src-attr name="title"/>
+
+    <!-- Lists the allowed elements and their allowed attributes.
+
+         For the correct worker of the cleaner, some elements cannot be removed,
+         usch as html, body, p, some others...
+     -->
+    <allowed-elements>
+      <element name="html"/>
+      <element name="body"/>
+
+      <element name="div">
+        <attribute name="class"/>
+      </element>
+      <element name="span">
+        <attribute name="class"/>
+      </element>
+
+      <element name="p">
+        <attribute name="align"/>
+        <attribute name="class"/>
+      </element>
+      <element name="br"/>
+      <element name="pre">
+        <attribute name="class"/>
+      </element>
+
+      <!-- titles -->
+      <element name="h1"/>
+      <element name="h2"/>
+      <element name="h3"/>
+      <element name="h4"/>
+      <element name="h5"/>
+
+      <!-- linking -->
+      <element name="a">
+        <attribute name="href"/>
+      </element>
+
+      <!-- inline styles -->
+      <element name="strong"/>
+      <element name="em"/>
+      <element name="sup"/>
+      <element name="sub"/>
+
+      <!-- lists -->
+      <element name="ul"/>
+      <element name="ol"/>
+      <element name="li"/>
+
+      <element name="img">
+        <attribute name="src"/>
+        <attribute name="align"/>
+      </element>
+
+      <!-- tables -->
+      <element name="table">
+        <attribute name="class"/>
+      </element>
+      <element name="tbody"/>
+      <element name="tr"/>
+      <element name="td">
+        <attribute name="colspan"/>
+        <attribute name="rowspan"/>
+        <attribute name="valign"/>
+      </element>
+      <element name="th">
+        <attribute name="colspan"/>
+        <attribute name="rowspan"/>
+        <attribute name="valign"/>
+      </element>
+      <element name="hr"/>
+    </allowed-elements>
+  </cleanup>
+
+  <serialization>
+    <linewidth value="80"/>
+    <elements>
+      <!-- Note: to avoid unexpected results, mention all block-type tags here,
+           and NO inline tags. -->
+      <element name="html" afterOpen="1" beforeClose="1"/>
+      <element name="body" afterOpen="1" beforeClose="1"/>
+      <element name="p" beforeOpen="1" afterClose="1"/>
+      <element name="h1" beforeOpen="1" afterClose="1"/>
+      <element name="h2" beforeOpen="1" afterClose="1"/>
+      <element name="h3" beforeOpen="1" afterClose="1"/>
+      <element name="h4" beforeOpen="1" afterClose="1"/>
+      <element name="h5" beforeOpen="1" afterClose="1"/>
+      <element name="pre" beforeOpen="1" afterClose="1"/>
+      <element name="div" beforeOpen="1" afterClose="1"/>
+      <element name="ul" beforeOpen="1" beforeClose="1" afterClose="1"/>
+      <element name="ol" beforeOpen="1" beforeClose="1" afterClose="1"/>
+      <element name="li" beforeOpen="1"/>
+      <element name="table" beforeOpen="1" beforeClose="1" afterClose="1"/>
+      <element name="tbody" beforeOpen="1" beforeClose="1"/>
+      <element name="tr" beforeOpen="1" beforeClose="1"/>
+      <element name="td" beforeOpen="1"/>
+      <element name="th" beforeOpen="1"/>
+      <element name="br" afterClose="1"/>
+
+    </elements>
+  </serialization>
+
+</htmlcleaner>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/datatype/convertor/HtmlCleanerConfiguration.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js Thu Nov  3 05:41:06 2005
@@ -0,0 +1,331 @@
+/*
+ * Copyright 1999-2004 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.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Implementation of the Cocoon Forms/FlowScript integration.
+ *
+ * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a>
+ * @version $Id: Form.js 326838 2005-10-20 06:26:53Z sylvain $
+ */
+
+// Revisit this class, so it gives access to more than the value.
+defineClass("org.apache.cocoon.forms.flow.javascript.ScriptableWidget");
+
+/**
+ * Create a form, given the URI of its definition file
+ */
+function Form(formDefinition) {
+    var formMgr = null;
+    var resolver = null;
+    var src = null;
+    var xmlAdapter = null;
+    try {
+        formMgr = cocoon.getComponent(Packages.org.apache.cocoon.forms.FormManager.ROLE);
+        if ((typeof formDefinition) == "string" || formDefinition instanceof String) {
+            resolver = cocoon.getComponent(Packages.org.apache.cocoon.environment.SourceResolver.ROLE);
+            src = resolver.resolveURI(formDefinition);
+            this.form = formMgr.createForm(src);
+        } else {
+            this.form = formMgr.createForm(formDefinition)
+        }
+    } finally {
+        cocoon.releaseComponent(formMgr);
+        if (src != null) resolver.release(src);
+        cocoon.releaseComponent(resolver);
+    }
+    this.binding = null;
+    this.eventHandler = null;
+    // FIXME : hack needed because FOM doesn't provide access to the context
+    this.avalonContext = formMgr.getAvalonContext();
+    // TODO : do we keep this ?
+    this.formWidget = new Widget(this.form);
+}
+
+Form.prototype.getModel = function() {
+    return this.formWidget;
+}
+
+
+/**
+ * Get the actual Form-Widget (the Java object)
+ */
+Form.prototype.getWidget = function(name) {
+    if (name != undefined) {
+        throw "getWidget(id) has been deprecated.\n" +
+              "Consider using getChild(id) or lookupWidget(path) instead."
+    }
+    return this.form;
+}
+
+/**
+ * Get a child Widget (the java object) from the form via its <code>id</code>.
+ */
+Form.prototype.getChild = function(id) {
+    return this.form.getChild(id);
+}
+
+/**
+ * Get a Widget (the java object) from the form via its <code>path</code>.
+ */
+Form.prototype.lookupWidget = function(path) {
+    return this.form.lookupWidget(path);
+}
+
+/**
+ * Manages the display of a form and its validation.
+ *
+ * This uses some additionnal properties on the form object :
+ * - "locale" : the form locale (default locale is used if not set)
+ * - "cleanupHook": a function called after having sent the page displaying the form. This is equivalent
+ *       to the "fun" argument of sendPageAndWait(), which allows to perform some cleanup when the pipeline
+ *       has been processed. The function is called with a single parameter which is the form it is attached to.
+ * - "restoreHook": a function called before processing the form when it has been submitted by
+ *       the browser. This allows to restore some environment that is needed by the form processing.
+ *       The function is called with a single parameter which is the form it is attached to.
+ *
+ * On return, the calling code can check some properties to know the form result :
+ * - "isValid" : true if the form was sucessfully validated
+ * - "submitId" : the id of the widget that triggered the form submit (can be null)
+ *
+ * @parameter uri the page uri (like in cocoon.sendPageAndWait())
+ * @parameter viewdata some data for the view (like in cocoon.sendPageAndWait()).
+ *            The "{FormsPipelineConfig.CFORMSKEY}" and "locale" properties are added to this object.
+ * @parameter ttl the time to live of the continuation used to display the form
+ */
+Form.prototype.showForm = function(uri, viewdata, ttl) {
+
+    if (viewdata == undefined) viewdata = new Object();
+    viewdata[Packages.org.apache.cocoon.forms.transformation.FormsPipelineConfig.CFORMSKEY] = this.form;
+
+    if (this.locale == null)
+        this.locale = java.util.Locale.getDefault();
+    viewdata["locale"] = this.locale;
+
+    var finished = false;
+
+    var comingBack = false;
+    var bookmark = cocoon.createWebContinuation(ttl);
+    
+    // Attach the form to the continuation so that we can access by just knowing the continuation id
+    bookmark.setAttribute("form", this.form);
+
+    if (comingBack) {
+        // We come back to the bookmark: process the form
+        
+        if (finished && cocoon.request.getParameter("cocoon-ajax-continue") != null) {
+            // A request with this parameter is sent by the client upon receiving the indication
+            // that Ajax interaction on the form is finished (see below).
+            // We also check "finished" to ensure we won't exit showForm() because of some
+            // faulty or hacked request. It's set to false, this will simply redisplay the form.
+            return bookmark;
+        }
+        
+	    if (this.restoreHook) {
+	        this.restoreHook(this);
+	    }
+        var formContext = new Packages.org.apache.cocoon.forms.FormContext(cocoon.request, this.locale);
+
+        // Prematurely add the viewdata as in the object model so that event listeners can use it 	 
+        // (the same is done by cocoon.sendPage()) 	 
+        // FIXME : hack needed because FOM doesn't provide access to the object model 	 
+        var objectModel = org.apache.cocoon.components.ContextHelper.getObjectModel(this.avalonContext); 	 
+        org.apache.cocoon.components.flow.FlowHelper.setContextObject(objectModel, viewdata); 	 
+
+        finished = this.form.process(formContext);
+        if (finished) {
+            this.isValid = this.form.isValid();
+            var widget = this.form.getSubmitWidget();
+            // Can be null on "normal" submit
+            this.submitId = widget == null ? null : widget.getId();
+            
+            if (cocoon.request.getParameter("cocoon-ajax") != null) {
+                // Ask the client to issue a new request reloading the whole page.
+                // As we have nothing special to send back, so a header should be just what we need...
+                // e.g. cocoon.response.setHeader("X-Cocoon-Ajax", "continue");
+                //      cocoon.sendStatus(200);               
+                // ...but Safari doesn't consider empty responses (with content-length = 0) as
+                // valid ones. So send a continue response by using directly the HttpResponse's
+                // output stream. Avoiding this hack would require to put an additional pipeline
+                // in the sitemap for just sending constant response, which isn't nice.
+                cocoon.sendStatus(200);
+                var httpResponse = objectModel.get(org.apache.cocoon.environment.http.HttpEnvironment.HTTP_RESPONSE_OBJECT);
+                if (httpResponse) {
+                    httpResponse.setContentType("text/xml");
+                    var text = "<?xml version='1.0'?><bu:document xmlns:bu='" +
+                        org.apache.cocoon.ajax.BrowserUpdateTransformer.BU_NSURI +
+                        "'><bu:continue/></bu:document>";
+                    httpResponse.setContentLength(text.length);
+                    httpResponse.writer.print(text);
+                } else {
+                    // Empty response
+                    cocoon.response.setHeader("Content-Length", "0");
+                }
+
+                FOM_Cocoon.suicide();
+            }
+            
+            return bookmark;
+        }
+    }
+    comingBack = true;
+    cocoon.sendPage(uri, viewdata, bookmark);
+    
+    // Clean up after sending the page
+    if (this.cleanupHook) {
+        this.cleanupHook(this);
+    }
+    
+    FOM_Cocoon.suicide();
+}
+
+Form.prototype.setValidationError = function(error) {
+    this.form.setValidationError(error);
+}
+
+Form.prototype.getValidationError = function() {
+    return this.form.getValidationError();
+}
+
+Form.prototype.createBinding = function(bindingURI) {
+    var bindingManager = null;
+    var source = null;
+    var resolver = null;
+    try {
+        bindingManager = cocoon.getComponent(Packages.org.apache.cocoon.forms.binding.BindingManager.ROLE);
+        resolver = cocoon.getComponent(Packages.org.apache.cocoon.environment.SourceResolver.ROLE);
+        source = resolver.resolveURI(bindingURI);
+        this.binding = bindingManager.createBinding(source);
+    } finally {
+        if (source != null)
+            resolver.release(source);
+        cocoon.releaseComponent(bindingManager);
+        cocoon.releaseComponent(resolver);
+    }
+}
+
+Form.prototype.load = function(object) {
+    if (this.binding == null)
+        throw new Error("Binding not configured for this form.");
+    this.binding.loadFormFromModel(this.form, object);
+}
+
+Form.prototype.save = function(object) {
+    if (this.binding == null)
+        throw new Error("Binding not configured for this form.");
+    this.binding.saveFormToModel(this.form, object);
+}
+
+Form.prototype.setAttribute = function(name, value) {
+    this.form.setAttribute(name, value);
+}
+
+Form.prototype.getAttribute = function(name) {
+    return this.form.getAttribute(name);
+}
+
+Form.prototype.removeAttribute = function(name) {
+    this.form.removeAttribute(name);
+}
+
+Form.prototype.getXML = function() {
+    if (this.xmlAdapter == null)
+        this.xmlAdapter = new Packages.org.apache.cocoon.forms.util.XMLAdapter(this.form);
+    return this.xmlAdapter;
+}
+
+Form.prototype.loadXML = function(uri) {
+    var source = null;
+    var resolver = null;
+    try {
+        resolver = cocoon.getComponent(Packages.org.apache.cocoon.environment.SourceResolver.ROLE);
+        source = resolver.resolveURI(uri);
+        Packages.org.apache.cocoon.components.source.SourceUtil.toSAX(source, this.getXML());
+    } finally {
+        if (source != null)
+            resolver.release(source);
+        cocoon.releaseComponent(resolver);
+    }
+}
+
+Form.prototype.saveXML = function(uri) {
+    var source = null;
+    var resolver = null;
+    var outputStream = null;
+    try {
+        resolver = cocoon.getComponent(Packages.org.apache.cocoon.environment.SourceResolver.ROLE);
+        source = resolver.resolveURI(uri);
+
+        var tf = Packages.javax.xml.transform.TransformerFactory.newInstance();
+
+        if (source instanceof Packages.org.apache.excalibur.source.ModifiableSource
+            && tf.getFeature(Packages.javax.xml.transform.sax.SAXTransformerFactory.FEATURE)) {
+
+            outputStream = source.getOutputStream();
+            var transformerHandler = tf.newTransformerHandler();
+            var transformer = transformerHandler.getTransformer();
+            transformer.setOutputProperty(Packages.javax.xml.transform.OutputKeys.INDENT, "true");
+            transformer.setOutputProperty(Packages.javax.xml.transform.OutputKeys.METHOD, "xml");
+            transformerHandler.setResult(new Packages.javax.xml.transform.stream.StreamResult(outputStream));
+            this.getXML().toSAX(transformerHandler);
+        } else {
+            throw new Packages.org.apache.cocoon.ProcessingException("Cannot write to source " + uri);
+        }
+
+    } finally {
+        if (source != null)
+            resolver.release(source);
+        cocoon.releaseComponent(resolver);
+        if (outputStream != null) {
+            try {
+                outputStream.flush();
+                outputStream.close();
+            } catch (error) {
+                cocoon.log.error("Could not flush/close outputstream: " + error);
+            }
+        }
+    }
+}
+
+function handleForm() {
+    // get the form definition
+    var def = cocoon.parameters["definitionURI"];
+    if (def == null) {
+        if (cocoon.parameters["form-definition"] != null) {
+            cocoon.log.warn("the form-definition parameter in handleForm has changed to definitionURI");
+            def = cocoon.parameters["form-definition"];
+        } else {
+            throw "Definition not configured for this form.";
+        }
+    }
+    // create the Form
+    var form = new Form(def);
+    // set the binding on the form if there is one
+    var bindingURI = cocoon.parameters["bindingURI"];
+    if (bindingURI != null) {
+        form.createBinding(bindingURI);
+    }
+    // get the function to call to handle the form
+    var funcName = cocoon.parameters["function"];
+    var func = this[funcName];
+    // check the function exists
+    if (!func) {
+        throw "Function \"" + funcName + "\" is not defined.";
+    } else if (!(func instanceof Function)) {
+        throw "\"" + funcName + "\" is not a function.";
+    }
+    // call the function
+    func.apply(this, [form]);
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/Form.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/v2/Form.js
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/v2/Form.js?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/v2/Form.js (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/v2/Form.js Thu Nov  3 05:41:06 2005
@@ -0,0 +1,176 @@
+/*
+ * Copyright 1999-2004 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.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Cocoon Forms JavaScript API
+ */
+
+defineClass("org.apache.cocoon.forms.flow.javascript.v2.ScriptableWidget");
+
+/**
+ * Create a form, giving either:
+ *   - the URI of its definition file
+ *   - an fd:form element in the form of a org.w3c.dom.Element
+ */
+function Form(formDefinition) {
+    var formMgr = null;
+    var resolver = null;
+    var src = null;
+    try {
+        var FormManager = 
+            Packages.org.apache.cocoon.forms.FormManager;
+        var SourceResolver = 
+            Packages.org.apache.cocoon.environment.SourceResolver;
+        formMgr = cocoon.getComponent(FormManager.ROLE);
+        var form;
+        if ((typeof formDefinition) == "string" || formDefinition instanceof String) {
+            resolver = cocoon.getComponent(SourceResolver.ROLE);
+            src = resolver.resolveURI(formDefinition);
+            form = formMgr.createForm(src);
+        } else {
+            form = formMgr.createForm(formDefinition)
+        }
+        this.binding_ = null;
+        this.formWidget_ = new Widget(form);
+        this.local_ = cocoon.createPageLocal();
+        this.locale = java.util.Locale.getDefault();
+    } finally {
+        cocoon.releaseComponent(formMgr);
+        if (src != null) resolver.release(src);
+        cocoon.releaseComponent(resolver);
+    }
+}
+
+/**
+ * Get the actual Form-Widget 
+ * (which for the v2 API means that it is still 
+ *  wrapped in a ScriptableWidget)
+ */
+Form.prototype.getWidget = function(name) {
+    if (name != undefined) {
+    	throw "getWidget(id) has been deprecated.\n" +
+    	      "Consider using getChild(id) or lookupWidget(path) instead."
+    } 
+    return this.formWidget_;
+}
+
+/**
+ * Get a Widget from the form.
+ * If <code>path</code> is undefined, the form widget itself is returned.
+ * Otherwise, the widget addressed by the specified path is looked up.
+ */
+Form.prototype.lookupWidget = function(path) {
+    var result;
+    if (path == undefined) {
+        result = this.formWidget_;
+    } else {
+        result = this.formWidget_.lookupWidget(path);
+    }
+    return result;
+}
+
+/**
+ * Sets the point in your script that will be returned to when the form is 
+ * redisplayed. If setBookmark() is not called, this is implicitly set to 
+ * the beginning of showForm().
+ */
+Form.prototype.setBookmark = function() {
+    return (this.local_.webContinuation = cocoon.createWebContinuation());
+}
+
+/**
+ * Returns the bookmark continuation associated with this form, or undefined
+ * if setBookmark() has not been called.
+ */
+Form.prototype.getBookmark = function() {
+    return this.local_.webContinuation;
+}
+
+/**
+ * Manages the display of a form and its validation.
+ * @parameter uri the page uri (like in cocoon.sendPageAndWait())
+ * @parameter fun optional function which will be executed after pipeline processing. Useful for releasing resources needed during pipeline processing but which should not become part of the continuation
+ * @parameter ttl Time to live (in milliseconds) for the continuation created
+ * @returns The web continuation associated with submitting this form
+ */
+Form.prototype.showForm = function(uri, fun, ttl) {
+    if (!this.getBookmark()) {
+        this.setBookmark();
+    }
+    var FormContext = Packages.org.apache.cocoon.forms.FormContext;
+    // this is needed by the FormTemplateTransformer:
+    var javaWidget = this.formWidget_.unwrap();
+    this.formWidget_["CocoonFormsInstance"] = javaWidget;
+    cocoon.request.setAttribute(Packages.org.apache.cocoon.forms.transformation.CFORMSKEY, javaWidget);
+    var wk = cocoon.sendPageAndWait(uri, this.formWidget_, fun, ttl); 
+    var formContext = 
+        new FormContext(cocoon.request, this.locale);
+    var userErrors = 0;
+    this.formWidget_.validationErrorListener = function(widget, error) {
+        if (error != null) {
+            userErrors++;
+        }
+    }
+    var finished = javaWidget.process(formContext);
+    if (this.onValidate) {
+        this.onValidate(this);
+    }
+    if (!finished || userErrors > 0) {
+        cocoon.continuation = this.local_.webContinuation;
+        this.local_.webContinuation.continuation(this.local_.webContinuation);
+    }
+    return wk;
+}
+
+Form.prototype.createEmptySelectionList = function(message) {
+    return new Packages.org.apache.cocoon.forms.datatype.EmptySelectionList(message);
+}
+
+Form.prototype.createBinding = function(bindingURI) {
+    var bindingManager = null;
+    var source = null;
+    var resolver = null;
+    try {
+        var BindingManager = 
+            Packages.org.apache.cocoon.forms.binding.BindingManager;
+        var SourceResolver = 
+            Packages.org.apache.cocoon.environment.SourceResolver;
+        bindingManager = cocoon.getComponent(BindingManager.ROLE);
+        resolver = cocoon.getComponent(SourceResolver.ROLE);
+        source = resolver.resolveURI(bindingURI);
+        this.binding_ = bindingManager.createBinding(source);
+    } finally {
+        if (source != null) {
+            resolver.release(source);
+        }
+        cocoon.releaseComponent(bindingManager);
+        cocoon.releaseComponent(resolver);
+    }
+}
+
+Form.prototype.load = function(object) {
+    if (this.binding_ == null) {
+        throw "Binding not configured for this form.";
+    }
+    this.binding_.loadFormFromModel(this.formWidget_.unwrap(), object);
+}
+
+Form.prototype.save = function(object) {
+    if (this.binding_ == null) {
+        throw "Binding not configured for this form.";
+    }
+    this.binding_.saveFormToModel(this.formWidget_.unwrap(), object);
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/v2/Form.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/v3/Form.js
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/v3/Form.js?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/v3/Form.js (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/v3/Form.js Thu Nov  3 05:41:06 2005
@@ -0,0 +1,177 @@
+/*
+ * Copyright 1999-2004 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.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Cocoon Forms JavaScript API
+ */
+
+defineClass("org.apache.cocoon.forms.flow.javascript.v3.ScriptableWidget");
+importClass(Packages.org.apache.cocoon.forms.FormContext);
+
+/**
+ * Create a form, giving either:
+ *   - the URI of its definition file
+ *   - an fd:form element in the form of a org.w3c.dom.Element
+ */
+function Form(formDefinition) {
+    var formMgr = null;
+    var resolver = null;
+    var src = null;
+    try {
+        var FormManager = 
+            Packages.org.apache.cocoon.forms.FormManager;
+        var SourceResolver = 
+            Packages.org.apache.cocoon.environment.SourceResolver;
+        formMgr = cocoon.getComponent(FormManager.ROLE);
+        var form;
+        if ((typeof formDefinition) == "string" || formDefinition instanceof String) {
+            resolver = cocoon.getComponent(SourceResolver.ROLE);
+            src = resolver.resolveURI(formDefinition);
+            form = formMgr.createForm(src);
+        } else {
+            form = formMgr.createForm(formDefinition)
+        }
+        this.form = form;
+        this.model = new Widget(form);
+        this.bindings_ = new Object();
+        this.locale = java.util.Locale.getDefault();
+    } finally {
+        cocoon.releaseComponent(formMgr);
+        if (src != null) resolver.release(src);
+        cocoon.releaseComponent(resolver);
+    }
+}
+
+/**
+ * Get the actual Form-Widget (the Java object)
+ */
+Form.prototype.getWidget = function() {
+    return this.form;
+}
+
+/**
+ * Get a Widget (the java object) from the form.
+ * If <code>name</code> is undefined, the form widget itself is returned.
+ * Otherwise, the form's child widget of name <code>name</code> is returned.
+ */
+Form.prototype.lookupWidget = function(name) {
+    if (name == undefined) {
+        return this.form;
+    } else {
+        return this.form.lookupWidget(name);
+    }
+}
+
+/**
+ * Displays a form until it is valid.
+ */
+Form.prototype.showForm = function(uri, viewData, fun, ttl) {
+    if (viewData == null)
+        viewData = new Object();
+    viewData["CocoonFormsInstance"] = this.form;
+
+    var webCont;
+    var finished = false;
+    while (!finished) {
+        webCont = cocoon.sendPageAndWait(uri, viewData, fun, ttl);
+        finished = this.processSubmit();
+    }
+    return webCont;
+}
+
+Form.prototype.processSubmit = function() {
+    var formContext = new FormContext(cocoon.request, this.locale);
+    return this.form.process(formContext);
+}
+
+Form.prototype.createEmptySelectionList = function(message) {
+    return new Packages.org.apache.cocoon.forms.datatype.EmptySelectionList(message);
+}
+
+Form.prototype.createBinding = function(arg1, arg2) {
+    var name;
+    var bindingURI;
+    if (arguments.length == 2) {
+        name = arg1;
+        bindingURI = arg2;
+    } else {
+        name = "default";
+        bindingURI = arg1;
+    }
+    var bindingManager = null;
+    var source = null;
+    var resolver = null;
+    try {
+        var BindingManager = 
+            Packages.org.apache.cocoon.forms.binding.BindingManager;
+        var SourceResolver = 
+            Packages.org.apache.cocoon.environment.SourceResolver;
+        bindingManager = cocoon.getComponent(BindingManager.ROLE);
+        resolver = cocoon.getComponent(SourceResolver.ROLE);
+        source = resolver.resolveURI(bindingURI);
+        this.bindings_[name] = bindingManager.createBinding(source);
+    } finally {
+        if (source != null) {
+            resolver.release(source);
+        }
+        cocoon.releaseComponent(bindingManager);
+        cocoon.releaseComponent(resolver);
+    }
+}
+
+Form.prototype.load = function(arg1, arg2) {
+    var name;
+    var object;
+    if (arguments.length == 2) {
+        name = arg1;
+        object = arg2;
+    } else {
+        name = "default";
+        object = arg1;
+    }
+    if (this.bindings_[name] == null) {
+        throw "Binding \"" + name + "\" not configured for this form.";
+    }
+    this.bindings_[name].loadFormFromModel(this.getWidget(), object);
+}
+
+Form.prototype.save = function(arg1, arg2) {
+    var name;
+    var object;
+    if (arguments.length == 2) {
+        name = arg1;
+        object = arg2;
+    } else {
+        name = "default";
+        object = arg1;
+    }
+    if (this.bindings_[name] == null) {
+        throw "Binding \"" + name + "\" not configured for this form.";
+    }
+    this.bindings_[name].saveFormToModel(this.getWidget(), object);
+}
+
+Form.prototype.setAttribute = function(name, value) {
+    this.form.setAttribute(name, value);
+}
+
+Form.prototype.getAttribute = function(name) {
+    return this.form.getAttribute(name);
+}
+
+Form.prototype.removeAttribute = function(name) {
+    this.form.removeAttribute(name);
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/flow/javascript/v3/Form.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/forms.roles
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/forms.roles?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/forms.roles (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/forms.roles Thu Nov  3 05:41:06 2005
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 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.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!--+
+    | $Id: forms.roles 292213 2005-09-28 15:36:40Z vgritsenko $
+    +-->
+<role-list>
+  <role name="org.apache.cocoon.forms.binding.BindingManager"
+        shorthand="forms-binding"
+        default-class="org.apache.cocoon.forms.binding.JXPathBindingManager"/>
+
+  <role name="org.apache.cocoon.forms.CacheManager"
+        shorthand="forms-cachemanager"
+        default-class="org.apache.cocoon.forms.DefaultCacheManager"/>
+
+  <role name="org.apache.cocoon.forms.datatype.DatatypeManager"
+        shorthand="forms-datatype"
+        default-class="org.apache.cocoon.forms.datatype.DefaultDatatypeManager"/>
+
+  <role name="org.apache.cocoon.forms.expression.ExpressionManager"
+        shorthand="forms-expression"
+        default-class="org.apache.cocoon.forms.expression.DefaultExpressionManager"/>
+
+  <role name="org.apache.cocoon.forms.FormManager"
+        shorthand="forms-formmanager"
+        default-class="org.apache.cocoon.forms.DefaultFormManager"/>
+
+  <role name="org.apache.cocoon.forms.datatype.SelectionListBuilderSelector"
+        shorthand="forms-selection-lists"
+        default-class="org.apache.cocoon.core.container.DefaultServiceSelector"/>
+
+  <role name="org.apache.cocoon.forms.validation.WidgetValidatorBuilderSelector"
+        shorthand="forms-validators"
+        default-class="org.apache.cocoon.core.container.DefaultServiceSelector"/>
+	
+  <role name="org.apache.cocoon.forms.event.WidgetListenerBuilderSelector"
+        shorthand="forms-widgetlisteners"
+        default-class="org.apache.cocoon.core.container.DefaultServiceSelector"/>
+
+  <role name="org.apache.cocoon.forms.formmodel.tree.builder.TreeModelDefinitionBuilderSelector"
+        shorthand="forms-treemodels"
+        default-class="org.apache.cocoon.core.container.DefaultServiceSelector"/>
+
+</role-list>

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/generation/jx-macros.xml
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/generation/jx-macros.xml?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/generation/jx-macros.xml (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/generation/jx-macros.xml Thu Nov  3 05:41:06 2005
@@ -0,0 +1,272 @@
+<?xml version="1.0"?>
+<!--
+  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.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- An implementation of the CForms template engine as a JXTemplate tag library -->
+    
+<jx:template xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+             xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
+             xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
+             xmlns:bu="http://apache.org/cocoon/browser-update/1.0">
+    <!--
+        ft:form-template
+    -->
+    <jx:macro name="form-template" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:set var="cformsHelper" value="#{org.apache.cocoon.forms.generation.JXMacrosHelper.createHelper($cocoon/consumer,$cocoon/request,$cocoon/parameters/locale)}"/>
+      <jx:set var="form" value="${cformsHelper.getForm(CocoonFormsInstance, cocoon.parameters['attribute-name'])}"/>
+      <jx:if test="${cformsHelper.isVisible(form)}">
+        <jx:set var="cformsDummy" value="${cformsHelper.startForm(form, macro.arguments)}"/>
+        <!-- the form is also the current widget -->
+        <jx:set var="widget" value="${form}"/>
+        <jx:evalBody/>
+        <jx:set var="cformsDummy" value="${cformsHelper.endForm()}"/>
+      </jx:if>
+    </jx:macro>
+    
+    <!--
+        ft:widget
+    -->
+    <jx:macro name="widget" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+      
+      <jx:if test="${cformsHelper.pushWidget(id)}">
+        <jx:set var="widget" value="${cformsHelper.peekWidget()}"/>
+        <jx:set var="cformsDummy" value="${cformsHelper.generateWidget(widget, macro.arguments)}"/>
+        <jx:evalBody/>
+        <jx:set var="cformsDummy" value="${cformsHelper.flushRootAndPop()}"/>
+      </jx:if>
+    </jx:macro>
+    
+    <!--
+        ft:repeater-widget-label
+    -->
+    <jx:macro name="repeater-widget-label" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+      <jx:parameter name="widget-id"/>
+      
+      <jx:set var="cformsDummy" value="${cformsHelper.generateRepeaterWidgetLabel(widget, id, this['widget-id'])}"/>
+    </jx:macro>
+    
+    <!--
+        ft:widget-label
+    -->
+    <jx:macro name="widget-label" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+      
+      <jx:set var="cformsDummy" value="${cformsHelper.generateWidgetLabel(widget, id)}"/>
+    </jx:macro>
+    
+    <!--
+        ft:repeater-size
+    -->
+    <jx:macro name="repeater-size" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+      
+      <jx:set var="cformsDummy" value="${cformsHelper.generateRepeaterSize(widget, id)}"/>
+    </jx:macro>
+
+    <!--
+        ft:repeater-widget, the old non-ajax capable way
+    -->
+    <jx:macro name="repeater-widget" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+
+      <jx:if test="${cformsHelper.pushRepeater(id, false)}">
+        <jx:set var="repeater" value="${cformsHelper.peekWidget()}"/>
+        <jx:forEach varStatus="repeaterLoop" begin="0" end="${repeater.getSize() - 1}">
+          <jx:if test="#{pushContainer($cformsHelper, java.lang.Integer.toString($repeaterLoop/index))}">
+            <jx:set var="widget" value="${cformsHelper.peekWidget()}"/>
+            <jx:evalBody/>
+            <jx:set var="cformsDummy" value="${cformsHelper.popWidget()}"/>
+          </jx:if>
+        </jx:forEach>
+        <jx:set var="cformsDummy" value="${cformsHelper.popWidget()}"/>
+      </jx:if>
+    </jx:macro>
+    
+    <!--
+        ft:continuation-id
+    -->
+    <jx:macro name="continuation-id" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <fi:continuation-id>${cocoon.continuation.id}</fi:continuation-id>
+    </jx:macro>
+
+    <!--
+        ft:class
+    -->
+    <jx:macro name="class" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+      
+      <jx:set var="cformsDummy" value="${cformsHelper.defineClassBody(form, id, macro.body)}"/>
+    </jx:macro>
+
+    <!--
+        ft:group : just increase the nesting level
+    -->
+    <jx:macro name="group" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+
+      <jx:if test="${cformsHelper.pushContainer(id)}">
+        <jx:set var="widget" value="${cformsHelper.peekWidget()}"/>
+        <fi:group id="${widget.fullName}">
+          <jx:evalBody/>
+        </fi:group>
+        <jx:set var="cformsDummy" value="${cformsHelper.popWidget()}"/>
+      </jx:if>
+    </jx:macro>
+
+    <!--
+        ft:new
+    -->
+    <jx:macro name="new" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+      
+      <jx:eval select="${cformsHelper.getClassBody(id)}"/>
+    </jx:macro>
+
+    <!--
+        ft:struct : just increase the nesting level
+    -->
+    <jx:macro name="struct" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+      
+      <jx:if test="${cformsHelper.pushContainer(id)}">
+        <jx:set var="widget" value="${cformsHelper.peekWidget()}"/>
+        <fi:struct id="${widget.fullName}">
+          <jx:evalBody/>
+        </fi:struct>
+        <jx:set var="cformsDummy" value="${cformsHelper.popWidget()}"/>
+      </jx:if>
+    </jx:macro>
+    
+    <!--
+        ft:union
+    -->
+    <jx:macro name="union" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+      
+      <jx:if test="${cformsHelper.pushContainer(id)}">
+        <jx:set var="widget" value="${cformsHelper.peekWidget()}"/>
+        <fi:union id="${widget.getRequestParameterName()}">
+          <jx:evalBody/>
+        </fi:union>
+        <jx:set var="cformsDummy" value="${cformsHelper.popWidget()}"/>
+      </jx:if>
+    </jx:macro>
+
+    <!--
+        ft:case
+    -->
+    <jx:macro name="case" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+
+      <jx:if test="${cformsHelper.isSelectedCase(widget, id)}">
+        <jx:set widget="${cformsHelper.getWidget(widget, id)}"/>
+        <jx:evalBody/>
+      </jx:if>
+    </jx:macro>
+    
+    <!--
+        ft:validation-error
+    -->
+    <jx:macro name="validation-error" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+      
+      <jx:set var="widget" value="${cformsHelper.getWidget(widget, id)}"/>
+      <jx:set var="validationError" value="${widget.getValidationError()}"/>
+      <jx:if test="${cformsHelper.isValidationError(validationError)}">
+          <jx:set var="cformsDummy" value="${cformsHelper.generateValidationError(validationError)}"/>
+            <jx:evalBody/>
+          <jx:set var="cformsDummy" value="${cformsHelper.flushRoot()}"/>
+      </jx:if>
+    </jx:macro>
+
+
+    <!--
+        ft:aggregate-widget
+    -->
+    <jx:macro name="aggregate-widget" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+      
+      <jx:if test="${cformsHelper.pushContainer(id)}">
+        <jx:set var="widget" value="${cformsHelper.peekWidget()}"/>
+        <jx:evalBody/>
+        <jx:set var="cformsDummy" value="${cformsHelper.popWidget()}"/>
+      </jx:if>
+    </jx:macro>
+    
+    <jx:macro name="repeater" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+      <jx:if test="${cformsHelper.pushRepeater(id, true)}">
+        <jx:set var="repeater" value="${cformsHelper.peekWidget()}"/>
+        <jx:set var="widget" value="${cformsHelper.peekWidget()}"/>
+        <jx:evalBody/>
+        <jx:set var="cformsDummy" value="${cformsHelper.popWidget()}"/>
+      </jx:if>
+    </jx:macro>
+    
+    <jx:macro name="repeater-rows" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+        <jx:forEach varStatus="repeaterLoop" begin="0" end="${repeater.getSize() - 1}">
+          <jx:if test="#{pushContainer($cformsHelper, java.lang.Integer.toString($repeaterLoop/index))}">
+            <jx:set var="widget" value="${cformsHelper.peekWidget()}"/>
+            <jx:evalBody/>
+            <jx:set var="cformsDummy" value="${cformsHelper.popWidget()}"/>
+          </jx:if>
+        </jx:forEach>
+    </jx:macro>
+
+    <jx:macro name="tree" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:parameter name="id"/>
+      <jx:if test="${cformsHelper.pushContainer(id)}">
+        <jx:set var="widget" value="${cformsHelper.peekWidget()}"/>
+          <jx:set var="treeWidget" value="${widget}"/>
+	      <jx:set var="treeNode" value="${cformsHelper.createWalker()}"/>
+	      <jx:evalBody/>
+          <jx:set var="cformsDummy" value="${cformsHelper.popWidget()}"/>
+	  </jx:if>
+      <!-- Generate tree-management hidden fields here, i.e. inside the block element
+           that should have been produced by <ft:tree> (used by bu:replace) -->
+      <fi:field id="${widget.fullName}:action">
+        <fi:styling type="hidden"/>
+      </fi:field>
+      <fi:field id="${widget.fullName}:path">
+        <fi:styling type="hidden"/>
+      </fi:field>
+    </jx:macro>
+    
+    <jx:macro name="tree-nodes" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:set var="treeNodesBody" value="${macro.body}"/>
+      <jx:choose>
+        <jx:when test="${treeWidget.isRootVisible()}">
+          <!-- set current widget for root node -->
+          <jx:eval select="${treeNodesBody}"/>
+        </jx:when>
+        <jx:otherwise>
+          <ft:tree-children/>
+        </jx:otherwise>
+      </jx:choose>
+    </jx:macro>
+    
+    <jx:macro name="tree-children" targetNamespace="http://apache.org/cocoon/forms/1.0#template">
+      <jx:if test="${!treeNode.isLeaf() &amp;&amp; treeNode.isExpanded()}">
+        <jx:forEach varStatus="treeLoop" items="${treeNode.enterChildren()}">
+          <!-- also set widget when we'll have a container for each node -->
+          <jx:eval select="${treeNodesBody}"/>
+        </jx:forEach>
+        <jx:set var="cformsDummy" value="${treeNode.leave()}"/>
+      </jx:if>
+    </jx:macro>
+</jx:template>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/generation/jx-macros.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/css/forms-calendar.css
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/css/forms-calendar.css?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/css/forms-calendar.css (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/css/forms-calendar.css Thu Nov  3 05:41:06 2005
@@ -0,0 +1,93 @@
+/*
+* Copyright 1999-2004 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.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+#forms_calendarDiv {
+    position: absolute;
+    visibility: hidden;
+    background-color: white;
+    layer-background-color: white;
+    z-index: 10000;
+}
+
+.forms_cpYearNavigation, .forms_cpMonthNavigation {
+    background-color:#C0C0C0;
+    text-align:center;
+    vertical-align:center;
+    text-decoration:none;
+    color:#000000;
+    font-weight:bold;
+}
+  
+.forms_cpDayColumnHeader, .forms_cpYearNavigation, .forms_cpMonthNavigation, .forms_cpCurrentMonthDate, .forms_cpCurrentMonthDateDisabled, .forms_cpOtherMonthDate, .forms_cpOtherMonthDateDisabled, .forms_cpCurrentDate, .forms_cpCurrentDateDisabled, .forms_cpTodayText, .forms_cpTodayTextDisabled, .forms_cpText {
+    font-family:arial;
+    font-size:8pt;
+}
+  
+TD.forms_cpDayColumnHeader {
+    text-align:right;
+    border:solid thin #C0C0C0;
+    border-width:0 0 19 0;
+}
+  
+.forms_cpCurrentMonthDate, .forms_cpOtherMonthDate, .forms_cpCurrentDate  {
+    text-align:right;
+    text-decoration:none;
+}
+  
+.forms_cpCurrentMonthDateDisabled, .forms_cpOtherMonthDateDisabled, .forms_cpCurrentDateDisabled {
+    color:#D0D0D0;
+    text-align:right;
+    text-decoration:line-through;
+}
+  
+.forms_cpCurrentMonthDate, .forms_cpCurrentDate {
+    color:#000000;
+}
+  
+.forms_cpOtherMonthDate {
+    color:#808080;
+}
+  
+TD.forms_cpCurrentDate {
+    color:white; background-color: #C0C0C0;
+    border-width:1;
+    border:solid thin #800000;
+}
+  
+TD.forms_cpCurrentDateDisabled {
+    border-width:1;
+    border:solid thin #FFAAAA;
+}
+  
+TD.forms_cpTodayText, TD.forms_cpTodayTextDisabled {
+    border:solid thin #C0C0C0;
+    border-width:1 0 0 0;
+}
+  
+A.forms_cpTodayText, SPAN.forms_cpTodayTextDisabled {
+    height:20px;
+}
+  
+A.forms_cpTodayText {
+    color:black;
+}
+  
+.forms_cpTodayTextDisabled {
+    color:#D0D0D0;
+}
+  
+.forms_cpBorder {
+    border:solid thin #808080;
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/css/forms-calendar.css
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/css/forms.css
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/css/forms.css?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/css/forms.css (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/css/forms.css Thu Nov  3 05:41:06 2005
@@ -0,0 +1,75 @@
+/*
+* Copyright 1999-2004 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.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+.forms-tab {
+    background-color: white;
+    border: 1px solid black;
+    border-bottom-width: 0px;
+    padding: 2px 1em 2px 1em;
+    margin-right: 5px;
+    position: relative;
+    text-decoration: none;
+    top: -1px;
+    z-index: 1;
+    cursor: pointer;
+}
+
+.forms-tab.forms-activeTab {
+    font-weight: bold;
+    padding-top: 5px;
+    cursor: default;
+    z-index: 3;
+}
+
+.forms-tabContent {
+    background-color: white;
+    border: 1px solid black;
+    padding: 1em;
+    position: relative;
+    z-index: 2;
+}
+
+.forms-validation-message, a.forms-validation-message:link {
+    color: red;
+    font-weight: bold;
+}
+
+.forms-validation-errors {
+}
+
+.forms-validation-error {
+}
+
+.forms-field-required {
+	color:blue;
+    font-weight: bold;
+}
+
+.forms-help {
+    border-style: dotted;
+    border-width: 1px;
+    padding: 5px;
+    background-color:#FFFFC0; /* light yellow */
+    width: 200px; /* otherwise IE does a weird layout */
+    z-index:1000; /* must be higher than forms-tabContent */
+}
+
+.forms-doubleList select {
+    width: 150px;
+}
+
+.forms-doubleList input {
+    width: 40px;
+}

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/css/forms.css
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/def2binding.xsl
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/def2binding.xsl?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/def2binding.xsl (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/def2binding.xsl Thu Nov  3 05:41:06 2005
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 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.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!--
+  Transforms a form definition file into a binding file. This is an attempt at merging
+  these two files in only one.
+  To use it, simply load the form bindings from a cocoon: pipeline that applies this stylesheet
+  on a form definition. Next step will by to rewrite this directly into Cocoon Forms binding system.
+  
+  The binding is created according to the following rules :
+  - fb:* attributes on widget definitions lead to the creation of
+    - <fb:context> if a @fb:context attribute is found
+    - <fb:simple-repeater> if a @fb:parent-path is found on a <fd:repeater>
+    - <fb:value> if a @fb:path is found on any fd:* element    
+  - if a <fd:binding> is present, its content is copied as is with the @id of the enclosing widget
+  
+  @author Sylvain Wallez
+  @version $Id: def2binding.xsl 180233 2005-06-06 06:01:26Z reinhard $
+-->
+
+<xsl:stylesheet
+  version="1.0"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
+  xmlns:fb="http://apache.org/cocoon/forms/1.0#binding">
+  
+<xsl:template match="fd:*[@fb:context]">
+  <fb:context path="{@fb:context}">
+    <xsl:for-each select="@*[(local-name(.) != 'context') and (namespace-uri() = 'http://apache.org/cocoon/forms/1.0#binding')]">
+      <xsl:attribute name="{local-name(.)}"><xsl:value-of select="."/></xsl:attribute>
+    </xsl:for-each>
+    <xsl:apply-templates/>
+  </fb:context>
+</xsl:template>
+
+<xsl:template match="fd:*[@fb:path]">
+  <fb:value id="{@id}">
+    <xsl:for-each select="@*[namespace-uri() = 'http://apache.org/cocoon/forms/1.0#binding']">
+      <xsl:attribute name="{local-name(.)}"><xsl:value-of select="."/></xsl:attribute>
+    </xsl:for-each>
+    <xsl:apply-templates/>
+  </fb:value>
+</xsl:template>
+
+<xsl:template match="fd:repeater[@fb:parent-path]">
+  <fb:simple-repeater id="{@id}">
+    <xsl:for-each select="@*[namespace-uri() = 'http://apache.org/cocoon/forms/1.0#binding']">
+      <xsl:attribute name="{local-name(.)}"><xsl:value-of select="."/></xsl:attribute>
+    </xsl:for-each>
+    <xsl:apply-templates/>
+  </fb:simple-repeater>
+</xsl:template>
+
+<xsl:template match="fd:*[fd:binding]">
+  <!-- copy the binding element -->
+  <xsl:variable name="binding" select="fd:binding/fb:*[1]"/>
+  <xsl:element name="{local-name($binding)}" namespace="{namespace-uri($binding)}">
+    <xsl:copy-of select="$binding/@*"/>
+    <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
+    <xsl:copy-of select="$binding/node()"/>
+    <!-- and recurse in the widgets while in the binding element -->
+    <xsl:apply-templates/>
+  </xsl:element>
+</xsl:template>
+
+<!-- avoid copying text -->
+<xsl:template match="text()|@*"/>
+
+</xsl:stylesheet>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/def2binding.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl Thu Nov  3 05:41:06 2005
@@ -0,0 +1,229 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 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.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
+                exclude-result-prefixes="fi">
+  <!--+
+      | This stylesheet is designed to be included by 'forms-samples-styling.xsl'.
+      | It extends the 'forms-field-styling.xsl' with additional stylings.
+      | The very specific advanced stylings as the calendar or htmlarea (both
+      | also need additional JS files) are separated out of this file.
+      +-->
+
+  <xsl:import href="resource://org/apache/cocoon/forms/resources/forms-field-styling.xsl"/>
+  <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-calendar-styling.xsl"/>
+  <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-htmlarea-styling.xsl"/>
+
+  <xsl:template match="head" mode="forms-field">
+    <xsl:apply-imports/>
+    <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>
+
+  <xsl:template match="body" mode="forms-field">
+    <xsl:apply-imports/>
+    <xsl:apply-templates select="." mode="forms-calendar"/>
+    <xsl:apply-templates select="." mode="forms-htmlarea"/>
+  </xsl:template>
+
+  <!--+ This template should not be necessary as this stylesheet "inherits"
+      | all templates from 'forms-field-styling.xsl', but without it, it does
+      | not work for me (using Xalan 2.5.1). It's like adding all methods of
+      | a superclass in a subclass and calling everywhere only the super
+      | implementation.
+      +-->
+  <xsl:template match="*">
+    <xsl:apply-imports/>
+  </xsl:template>
+
+  <!--+
+      | Add fi:help to the common stuff.
+      +-->
+  <xsl:template match="fi:*" mode="common">
+    <xsl:apply-imports/>
+    <xsl:apply-templates select="fi:help"/>
+  </xsl:template>
+
+  <!--+
+      | 
+      +-->
+  <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}/forms/img/close.gif" height="6" width="6"/></a></span>
+      <xsl:apply-templates select="node()"/>
+    </div>
+    <script type="text/javascript">
+      var helpWin<xsl:value-of select="$id"/> = forms_createPopupWindow('help<xsl:value-of select="$id"/>');
+    </script>
+    <a id="{$id}" name="{$id}" href="#" onclick="helpWin{$id}.showPopup('{$id}');return false;">
+      <!-- TODO: i18n key for helppopup -->
+      <img src="{$resources-uri}/forms/img/help.gif" alt="helppopup"/>
+    </a>
+  </xsl:template>
+
+  <!--+
+      | fi:multivaluefield with list-type='double-listbox' styling
+      +-->
+  <xsl:template match="fi:multivaluefield[fi:styling/@list-type='double-listbox']">
+    <xsl:variable name="id" select="@id"/>
+    <xsl:variable name="values" select="fi:values/fi:value/text()"/>
+
+    <div id="{@id}" class="forms-doubleList" title="{fi:hint}">
+      <table>
+        <xsl:if test="fi:styling/fi:available-label|fi:styling/fi:selected-label">
+          <tr>
+            <th>
+              <xsl:copy-of select="fi:styling/fi:available-label/node()"/>
+            </th>
+            <th> </th>
+            <th>
+              <xsl:copy-of select="fi:styling/fi:selected-label/node()"/>
+            </th>
+          </tr>
+        </xsl:if>
+        <tr>
+          <td>
+            <!-- select for the unselected values -->
+            <select id="{@id}.unselected" name="{@id}.unselected" multiple="multiple"
+                    ondblclick="opt{generate-id()}.forms_transferRight()">
+              <xsl:apply-templates select="." mode="styling"/>
+              <xsl:for-each select="fi:selection-list/fi:item">
+                <xsl:variable name="value" select="@value"/>
+                <xsl:if test="not($values[. = $value])">
+                  <option value="{$value}">
+                    <xsl:copy-of select="fi:label/node()"/>
+                  </option>
+                </xsl:if>
+              </xsl:for-each>
+            </select>
+          </td>
+          <td>
+            <!-- command buttons -->
+            <!-- strangely, IE adds an extra blank line if there only a button on a line. So we surround it with nbsp -->
+            <xsl:text>&#160;</xsl:text>
+            <input type="button" value="&gt;" onclick="opt{generate-id()}.forms_transferRight()">
+              <xsl:if test="@state='disabled'">
+                <xsl:attribute name="disabled">disabled</xsl:attribute>
+              </xsl:if>
+            </input>
+            <xsl:text>&#160;</xsl:text>
+            <br/>
+            <xsl:text>&#160;</xsl:text>
+            <input type="button" value="&gt;&gt;" onclick="opt{generate-id()}.forms_transferAllRight()">
+              <xsl:if test="@state='disabled'">
+                <xsl:attribute name="disabled">disabled</xsl:attribute>
+              </xsl:if>
+            </input>
+            <xsl:text>&#160;</xsl:text>
+            <br/>
+            <xsl:text>&#160;</xsl:text>
+            <input type="button" value="&lt;" onclick="opt{generate-id()}.forms_transferLeft()">
+              <xsl:if test="@state='disabled'">
+                <xsl:attribute name="disabled">disabled</xsl:attribute>
+              </xsl:if>
+            </input>
+            <xsl:text>&#160;</xsl:text>
+            <br/>
+            <xsl:text>&#160;</xsl:text>
+            <input type="button" value="&lt;&lt;" onclick="opt{generate-id()}.forms_transferAllLeft()">
+              <xsl:if test="@state='disabled'">
+                <xsl:attribute name="disabled">disabled</xsl:attribute>
+              </xsl:if>
+            </input>
+            <xsl:text>&#160;</xsl:text>
+            <br/>
+            <xsl:apply-templates select="." mode="common"/>
+          </td>
+          <td>
+            <!-- select for the selected values -->
+            <select id="{@id}-input" name="{@id}" multiple="multiple"
+                    ondblclick="opt{generate-id()}.forms_transferLeft()" >
+              <xsl:apply-templates select="." mode="styling"/>
+              <xsl:for-each select="fi:selection-list/fi:item">
+                <xsl:variable name="value" select="@value"/>
+                <xsl:if test="$values[. = $value]">
+                  <option value="{$value}">
+                    <xsl:copy-of select="fi:label/node()"/>
+                  </option>
+                </xsl:if>
+              </xsl:for-each>
+            </select>
+          </td>
+        </tr>
+      </table>
+      <script type="text/javascript">
+        var opt<xsl:value-of select="generate-id()"/> = forms_createOptionTransfer('<xsl:value-of select="@id"/>', <xsl:value-of select="fi:styling/@submit-on-change = 'true'"/>);
+      </script>
+    </div>
+  </xsl:template>
+
+  <xsl:template match="fi:multivaluefield/fi:styling[@list-type='double-listbox']/@submit-on-change" mode="styling"/>
+
+  <!--+
+      | fi:multivaluefield without a selection list
+      +-->
+  <xsl:template match="fi:multivaluefield[not(fi:selection-list)]">
+    <xsl:variable name="id" select="@id"/>
+    <xsl:variable name="values" select="fi:values/fi:value/text()"/>
+
+    <div id="{$id}">
+      <input name="{$id}.entry" id="{$id}.entry">
+        <xsl:if test="fi:styling/@size">
+          <xsl:attribute name="size"><xsl:value-of select="fi:styling/@size"/></xsl:attribute>
+        </xsl:if>
+      </input>
+      <br/>
+      <table>
+        <tr>
+          <td>
+            <select name="{$id}" id="{$id}-input" size="5" multiple="multiple" style="width: 150px">
+              <xsl:for-each select="$values">
+                <option value="{.}"><xsl:value-of select="."/></option>
+              </xsl:for-each>
+            </select>
+          </td>
+          <td>
+            <!-- strangely, IE adds an extra blank line if there only a button on a line. So we surround it with nbsp -->
+            <xsl:text>&#160;</xsl:text>
+            <input type="image" id="{$id}.delete" src="{$resources-uri}/forms/img/delete.gif"/>
+            <xsl:text>&#160;</xsl:text>
+            <br/>
+            <xsl:text>&#160;</xsl:text>
+            <input type="image" id="{$id}.up" src="{$resources-uri}/forms/img/move_up.gif"/>
+            <xsl:text>&#160;</xsl:text>
+            <br/>
+            <xsl:text>&#160;</xsl:text>
+            <input type="image" id="{$id}.down" src="{$resources-uri}/forms/img/move_down.gif"/>
+            <xsl:text>&#160;</xsl:text>
+            <br/>
+            <xsl:apply-templates select="." mode="common"/>
+          </td>
+        </tr>
+      </table>
+      <script type="text/javascript">
+        new FormsMultiValueEditor("<xsl:value-of select="$id"/>");
+      </script>
+    </div>
+  </xsl:template>
+
+</xsl:stylesheet>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl?rev=330548&view=auto
==============================================================================
--- cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl (added)
+++ cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl Thu Nov  3 05:41:06 2005
@@ -0,0 +1,97 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2004 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.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
+                xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+                exclude-result-prefixes="fi">
+  <!--+
+      | This stylesheet is designed to be included by 'forms-advanced-styling.xsl'.
+      +-->
+
+  <xsl:template match="head" mode="forms-calendar">
+    <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();
+      forms_calendar.setWeekStartDay(1);
+      forms_calendar.showYearNavigation();
+      forms_calendar.showYearNavigationInput();
+      forms_calendar.setCssPrefix("forms_");
+    </script>
+    <link rel="stylesheet" type="text/css" href="{$resources-uri}/forms/css/forms-calendar.css"/>
+  </xsl:template>
+
+  <xsl:template match="body" mode="forms-calendar">
+    <!-- div id="forms_calendarDiv"/ -->
+  </xsl:template>
+
+  <!--+
+      | fi:field or fi:aggregatefield with either
+      | - explicit styling @type = 'date' or
+      | - implicit if no styling @type is specified,
+      |   but datatype/@type = 'date' and datatype/convertor/@variant = 'date',
+      |   selection lists must be excluded here
+      +-->
+  <xsl:template match="fi:field[fi:styling/@type='date'] |
+                       fi:field[fi:datatype[@type='date'][fi:convertor/@variant='date']][not(fi:styling/@type)][not(fi:selection-list)] |
+                       fi:aggregatefield[fi:datatype[@type='date'][fi:convertor/@variant='date']][not(fi:styling/@type)][not(fi:selection-list)]
+                       ">
+    <xsl:variable name="id" select="generate-id()"/>
+    
+    <xsl:variable name="format">
+      <xsl:choose>
+        <xsl:when test="fi:datatype[@type='date']/fi:convertor/@pattern">
+          <xsl:value-of select="fi:datatype[@type='date']/fi:convertor/@pattern"/>
+        </xsl:when>
+        <xsl:otherwise>yyyy-MM-dd</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    
+    <span id="{@id}">
+      <xsl:choose>
+        <xsl:when test="@state = 'output'">
+          <xsl:value-of select="fi:value"/>
+        </xsl:when>
+        <xsl:otherwise>
+	      <!-- regular input -->
+	      <input id="{@id}-input" name="{@id}" value="{fi:value}" title="{normalize-space(fi:hint)}" type="text">
+	        <xsl:apply-templates select="." mode="styling"/>
+	      </input>
+	    
+	      <!-- calendar popup -->
+	      <xsl:choose>
+	        <xsl:when test="@state = 'disabled'">
+	          <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}/forms/img/cal.gif" alt="forms:calendar.alt" i18n:attr="alt"/>
+	          </a>
+	        </xsl:otherwise>
+	      </xsl:choose>
+	
+	      <!-- common stuff -->
+	      <xsl:apply-templates select="." mode="common"/>
+	    </xsl:otherwise>
+	  </xsl:choose>
+    </span>
+  </xsl:template>
+
+</xsl:stylesheet>

Propchange: cocoon/whiteboard/maven2/cocoon-flat-layout/cocoon-forms-block/impl/src/main/resources/org/apache/cocoon/forms/resources/forms-calendar-styling.xsl
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message