cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject svn commit: r171293 - in /cocoon: blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/ blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/ blocks/core/forms/trunk/java/org/apache/cocoon/forms/generation/ blocks/core/forms/trunk/java/org/apache/cocoon/forms/resources/js/ blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/ blocks/core/forms/trunk/samples/ blocks/core/forms/trunk/samples/messages/ blocks/core/forms/trunk/samples/resources/ trunk/
Date Sun, 22 May 2005 08:55:43 GMT
Author: sylvain
Date: Sun May 22 01:55:42 2005
New Revision: 171293

URL: http://svn.apache.org/viewcvs?rev=171293&view=rev
Log:
sync captcha

Added:
    cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaDefinitionBuilder.java
  (with props)
    cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaField.java
  (with props)
    cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaFieldDefinition.java
  (with props)
    cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidator.java
  (with props)
    cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidatorBuilder.java
  (with props)
Modified:
    cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java
    cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/Form.java
    cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
    cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js
    cocoon/blocks/core/forms/trunk/samples/messages/FormsMessages.xml
    cocoon/blocks/core/forms/trunk/samples/messages/FormsMessages_it_IT.xml
    cocoon/blocks/core/forms/trunk/samples/resources/forms-field-styling.xsl
    cocoon/blocks/core/forms/trunk/samples/sitemap.xmap
    cocoon/blocks/core/forms/trunk/samples/welcome.xml
    cocoon/trunk/status.xml

Modified: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java?rev=171293&r1=171292&r2=171293&view=diff
==============================================================================
--- cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java
(original)
+++ cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/binding/JavaScriptJXPathBinding.java
Sun May 22 01:55:42 2005
@@ -58,8 +58,9 @@
         
         // Set parent on child bindings
         for(Iterator iter = childBindings.values().iterator(); iter.hasNext(); ) {
-       	    ((Binding)iter.next()).setParent(this);
+        	    ((Binding)iter.next()).setParent(this);
         }
+
         this.childBindings = new ScriptableMap(childBindings);
     }
 

Added: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaDefinitionBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaDefinitionBuilder.java?rev=171293&view=auto
==============================================================================
--- cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaDefinitionBuilder.java
(added)
+++ cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaDefinitionBuilder.java
Sun May 22 01:55:42 2005
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.forms.formmodel;
+
+import org.apache.avalon.framework.context.Context;
+import org.apache.avalon.framework.context.ContextException;
+import org.apache.avalon.framework.context.Contextualizable;
+import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.cocoon.forms.util.DomHelper;
+import org.w3c.dom.Element;
+
+/**
+ * Builds {@link CaptchaFieldDefinition}s.
+ *
+ * @see http://www.captcha.net/
+ * @version $Id$
+ */
+public class CaptchaDefinitionBuilder extends AbstractDatatypeWidgetDefinitionBuilder implements
Contextualizable, ThreadSafe {
+    
+    private Context avalonContext;
+    
+    public void contextualize(Context context) throws ContextException {
+        this.avalonContext = context;
+    }
+
+    public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception
{
+        FieldDefinition definition = new CaptchaFieldDefinition(avalonContext);
+        setupDefinition(widgetElement, definition);
+        definition.makeImmutable();
+        return definition;
+    }
+
+    protected void setupDefinition(Element widgetElement, FieldDefinition definition) throws
Exception {
+        super.setupDefinition(widgetElement, definition);
+        
+        // parse "@required"
+        boolean required = DomHelper.getAttributeAsBoolean(widgetElement, "required", false);
+        definition.setRequired(required);
+        
+        // parse "@length"
+        int length = DomHelper.getAttributeAsInteger(widgetElement, "length", 7);
+        ((CaptchaFieldDefinition) definition).setLength(length);
+    }
+}

Propchange: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaDefinitionBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaDefinitionBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaField.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaField.java?rev=171293&view=auto
==============================================================================
--- cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaField.java
(added)
+++ cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaField.java
Sun May 22 01:55:42 2005
@@ -0,0 +1,120 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.forms.formmodel;
+
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.util.Locale;
+import java.util.Map;
+
+import org.apache.avalon.framework.CascadingRuntimeException;
+import org.apache.avalon.framework.context.Context;
+import org.apache.cocoon.components.ContextHelper;
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Session;
+import org.apache.cocoon.forms.Constants;
+import org.apache.cocoon.xml.AttributesImpl;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+
+/**
+ * A {@link Field} for CAPTCHA validation. Upon generation, a secret random string is stored
+ * in a session attribute having a randomly generated name, for use by a 
+ * {@link org.apache.cocoon.forms.validation.impl.CaptchaValidator}.
+ * <br>
+ * Usage sample:
+ * <pre>
+    &lt;fd:captcha id="f1" required="true">
+      &lt;fd:label>Copy the number shown into the input field&lt;/fd:label>
+      &lt;fd:datatype base="string"/>
+      &lt;fd:validation>
+        &lt;fd:captcha/>
+      &lt;/fd:validation>
+    &lt;/fd:captcha>
+ * </pre>
+ * 
+ * @see http://www.captcha.net/
+ * @version CVS $Id$
+ */
+public class CaptchaField extends Field {
+
+    public static final String SESSION_ATTR_PREFIX = "captcha-";
+
+    private static final String IMAGE_EL = "captcha-image";
+    private static final String SECRET_CHARS = "abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789";
+    private static final int SESSION_ATTR_NAME_LENGTH = 6;
+    
+    private Context avalonContext;
+    private int length;
+
+    /**
+     * Random number generator used to create session attribute name.
+     */
+    protected static SecureRandom random;
+
+    static {
+        try {
+            random = SecureRandom.getInstance("SHA1PRNG");
+        } catch(java.security.NoSuchAlgorithmException nsae) {
+            // Maybe we are on IBM's SDK
+            try {
+                random = SecureRandom.getInstance("IBMSecureRandom");
+            } catch (NoSuchAlgorithmException e) {
+                throw new CascadingRuntimeException("No random number generator available",
e);
+            }
+        }
+        random.setSeed(System.currentTimeMillis());
+    }
+
+    public CaptchaField(CaptchaFieldDefinition fieldDefinition, Context avalonContext) {
+        super(fieldDefinition);
+        this.avalonContext = avalonContext;
+        this.length = fieldDefinition.getLength();
+    }
+    
+    private String generateSecret() {
+        StringBuffer secret = new StringBuffer(length);
+        for (int n = 0 ; n < length ; n++) {
+            int randomnumber = random.nextInt(SECRET_CHARS.length());
+            secret.append(SECRET_CHARS.charAt(randomnumber)); 
+        }
+        return secret.toString();
+    }
+
+    public void generateItemSaxFragment(ContentHandler contentHandler, Locale locale) throws
SAXException {
+        super.generateItemSaxFragment(contentHandler, locale);
+        byte[] bytes = new byte[SESSION_ATTR_NAME_LENGTH];
+        char[] result = new char[bytes.length * 2];
+        random.nextBytes(bytes);
+        for (int i = 0; i < SESSION_ATTR_NAME_LENGTH; i++) {
+            byte ch = bytes[i];
+            result[2 * i] = Character.forDigit(Math.abs(ch >> 4), 16);
+            result[2 * i + 1] = Character.forDigit(Math.abs(ch & 0x0f), 16);
+        }
+        String id = new String(result);
+        Map objectModel = ContextHelper.getObjectModel(this.avalonContext);
+        Session session = ObjectModelHelper.getRequest(objectModel).getSession(true);
+        String secret = generateSecret();
+        session.setAttribute(SESSION_ATTR_PREFIX + id, secret);
+        this.setAttribute("secret", secret);
+        AttributesImpl attrs = new AttributesImpl();
+        attrs.addAttribute("", "id", "id", "PCDATA", id);
+        contentHandler.startElement(Constants.INSTANCE_NS, IMAGE_EL, Constants.INSTANCE_PREFIX_COLON
+ IMAGE_EL, attrs);
+        contentHandler.endElement(Constants.INSTANCE_NS, IMAGE_EL, Constants.INSTANCE_PREFIX_COLON
+ IMAGE_EL);
+    }
+    
+}

Propchange: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaField.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaField.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaFieldDefinition.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaFieldDefinition.java?rev=171293&view=auto
==============================================================================
--- cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaFieldDefinition.java
(added)
+++ cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaFieldDefinition.java
Sun May 22 01:55:42 2005
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.forms.formmodel;
+
+import org.apache.avalon.framework.context.Context;
+
+/**
+ * A {@link FieldDefinition} for {@link CaptchaField}s.
+ * 
+ * @see http://www.captcha.net/
+ * @version CVS $Id$
+ */
+public class CaptchaFieldDefinition extends FieldDefinition {
+    
+    private Context avalonContext;
+    private int length;
+
+    public CaptchaFieldDefinition(Context avalonContext) {
+        this.avalonContext = avalonContext;
+    }
+
+    public Widget createInstance() {
+        CaptchaField field = new CaptchaField(this, avalonContext);
+        return field;
+    }
+
+    public int getLength() {
+        return length;
+    }
+
+    public void setLength(int length) {
+        checkMutable();
+        this.length = length;
+    }
+
+}

Propchange: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaFieldDefinition.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/CaptchaFieldDefinition.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/Form.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/Form.java?rev=171293&r1=171292&r2=171293&view=diff
==============================================================================
--- cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/Form.java (original)
+++ cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/formmodel/Form.java Sun May
22 01:55:42 2005
@@ -59,7 +59,6 @@
     // Widgets that need to be updated in the client when in AJAX mode
     private Set updatedWidgets;
 
-
     public Form(FormDefinition definition) {
         super(definition);
         this.definition = definition;

Modified: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml?rev=171293&r1=171292&r2=171293&view=diff
==============================================================================
--- cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml (original)
+++ cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/generation/jx-macros.xml Sun
May 22 01:55:42 2005
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
 <!--
   Copyright 1999-2005 The Apache Software Foundation
 

Modified: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js?rev=171293&r1=171292&r2=171293&view=diff
==============================================================================
--- cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js (original)
+++ cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/resources/js/cforms.js Sun
May 22 01:55:42 2005
@@ -1,5 +1,5 @@
 /*
-* Copyright 1999-2004 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.

Added: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidator.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidator.java?rev=171293&view=auto
==============================================================================
--- cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidator.java
(added)
+++ cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidator.java
Sun May 22 01:55:42 2005
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.forms.validation.impl;
+
+import org.apache.cocoon.forms.formmodel.Widget;
+import org.apache.cocoon.forms.validation.ValidationError;
+import org.apache.cocoon.forms.validation.ValidationErrorAware;
+import org.apache.cocoon.forms.validation.WidgetValidator;
+
+
+/**
+ * A {@link org.apache.cocoon.forms.validation.WidgetValidator} that relies on a CAPTCHA
+ * test.
+ * 
+ * @see http://www.captcha.net/
+ * @version $Id$
+ */
+public class CaptchaValidator implements WidgetValidator {
+
+    private static final String VALIDATION_MESSAGE_KEY = "validation.captcha.mismatch"; 
+
+    public boolean validate(Widget widget) {
+        if (! (widget instanceof ValidationErrorAware)) {
+            // Invalid widget type
+            throw new IllegalArgumentException("Widget '" + widget.getRequestParameterName()
+ "' is not ValidationErrorAware");
+        }
+        boolean result = widget.getValue() != null && widget.getValue().equals(widget.getAttribute("secret"));
+        if (! result) {
+            ((ValidationErrorAware) widget).setValidationError(new ValidationError(VALIDATION_MESSAGE_KEY));
+        }
+        return result;
+    }
+}

Propchange: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidator.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidatorBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidatorBuilder.java?rev=171293&view=auto
==============================================================================
--- cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidatorBuilder.java
(added)
+++ cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidatorBuilder.java
Sun May 22 01:55:42 2005
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package org.apache.cocoon.forms.validation.impl;
+
+import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.cocoon.forms.formmodel.WidgetDefinition;
+import org.apache.cocoon.forms.validation.WidgetValidator;
+import org.apache.cocoon.forms.validation.WidgetValidatorBuilder;
+import org.w3c.dom.Element;
+
+
+/**
+ * Builds a CAPTCHA validator.
+ * 
+ * @see org.apache.cocoon.forms.validation.impl.CaptchaValidator
+ * @version $Id$
+ */
+public class CaptchaValidatorBuilder implements WidgetValidatorBuilder, ThreadSafe {
+
+    public WidgetValidator build(Element validationRuleElement,
+            WidgetDefinition definition) throws Exception {
+        return new CaptchaValidator();
+    }
+
+}

Propchange: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidatorBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/blocks/core/forms/trunk/java/org/apache/cocoon/forms/validation/impl/CaptchaValidatorBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/blocks/core/forms/trunk/samples/messages/FormsMessages.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/messages/FormsMessages.xml?rev=171293&r1=171292&r2=171293&view=diff
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/messages/FormsMessages.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/messages/FormsMessages.xml Sun May 22 01:55:42
2005
@@ -48,6 +48,8 @@
 
   <message key="validation.mod10">Mod 10 check failed.</message>
 
+  <message key="validation.captcha.mismatch">CAPTCHA check failed.</message>
+
   <message key="aggregatedfield.split-failed">Content of this field does not match
the following regular expression: {0}</message>
   <message key="upload.invalid-type">Invalid content type.</message>
 </catalogue>

Modified: cocoon/blocks/core/forms/trunk/samples/messages/FormsMessages_it_IT.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/messages/FormsMessages_it_IT.xml?rev=171293&r1=171292&r2=171293&view=diff
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/messages/FormsMessages_it_IT.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/messages/FormsMessages_it_IT.xml Sun May 22 01:55:42
2005
@@ -49,6 +49,7 @@
 
   <message key="validation.mod10">Verifica Mod 10 fallita.</message>
 
+  <message key="validation.captcha.mismatch">Verifica CAPTCHA fallita.</message>
 
   <message key="aggregatedfield.split-failed">Il valore non corrisponde alla seguente
espressione regolare: {0}</message>
   <message key="upload.invalid-type">Tipo del contenuto non valido.</message>

Modified: cocoon/blocks/core/forms/trunk/samples/resources/forms-field-styling.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/resources/forms-field-styling.xsl?rev=171293&r1=171292&r2=171293&view=diff
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/resources/forms-field-styling.xsl (original)
+++ cocoon/blocks/core/forms/trunk/samples/resources/forms-field-styling.xsl Sun May 22 01:55:42
2005
@@ -50,6 +50,10 @@
       +-->
   <xsl:template match="fi:field">
     <span id="{@id}">
+      <xsl:if test="fi:captcha-image">
+        <img src="captcha-{fi:captcha-image/@id}.jpg" style="vertical-align:middle"/>
+        <xsl:text> </xsl:text>
+      </xsl:if>
       <!--  @id-input is what labels point to -->
       <input name="{@id}" id="{@id}-input" value="{fi:value}" title="{fi:hint}" type="text">
         <xsl:apply-templates select="." mode="styling"/>

Modified: cocoon/blocks/core/forms/trunk/samples/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/sitemap.xmap?rev=171293&r1=171292&r2=171293&view=diff
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/sitemap.xmap (original)
+++ cocoon/blocks/core/forms/trunk/samples/sitemap.xmap Sun May 22 01:55:42 2005
@@ -530,8 +530,8 @@
        <map:serialize type="xml"/>
      </map:match>     
      
-     <!-- **************************** mounts **************************** -->
-     
+     <!-- **************************** mounts **************************** -->    

+
     <map:match pattern="*">
         <map:redirect-to uri="{1}/"/>
     </map:match>

Modified: cocoon/blocks/core/forms/trunk/samples/welcome.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/core/forms/trunk/samples/welcome.xml?rev=171293&r1=171292&r2=171293&view=diff
==============================================================================
--- cocoon/blocks/core/forms/trunk/samples/welcome.xml (original)
+++ cocoon/blocks/core/forms/trunk/samples/welcome.xml Sun May 22 01:55:42 2005
@@ -48,6 +48,7 @@
   <sample name="HTMLArea" href="htmlarea">A simple form using the HTML editor widget.</sample>
   <sample name="Aggregate" href="aggregate/example">Aggregate field examples</sample>
   <sample name="Multipage wizard" href="do-multipage.flow">A multipage wizard, using
widget states and actions to move between pages.</sample>
+  <sample name="CAPTCHA validation" href="captcha/">CAPTCHA validation (requires <a
href="/samples/blocks/batik/">Batik block</a>)</sample>
  </group>
 
  <group name="Binding Samples">

Modified: cocoon/trunk/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/status.xml?rev=171293&r1=171292&r2=171293&view=diff
==============================================================================
--- cocoon/trunk/status.xml (original)
+++ cocoon/trunk/status.xml Sun May 22 01:55:42 2005
@@ -443,6 +443,11 @@
    </action>
   </release>
   <release version="2.1.8" date="TBD">
+    <action dev="SW" type="add">
+      CForms block: add automatic AJAX features. When <code>&lt;ft:form-template&gt;</code>
+      has an <code>ajax="true"</code> attribute, partial page updates are performed
rather
+      than full page reloads.
+    </action>
     <action dev="AG" type="fix" fixes-bug="32728" due-to="Thomas Scheithauer" due-to-email="cocoon-t3@gmx.de">
       SearchGenerator return has-previous false when meet the no. 2 page.
     </action>



Mime
View raw message