This project has retired. For details please refer to its
Attic page .
CaptchaField (Cocoon Forms Block Implementation 1.1.0 API)
org.apache.cocoon.forms.formmodel
Class CaptchaField
java.lang.Object
org.apache.cocoon.forms.formmodel.AbstractWidget
org.apache.cocoon.forms.formmodel.Field
org.apache.cocoon.forms.formmodel.CaptchaField
All Implemented Interfaces: DataWidget , org.apache.cocoon.util.location.Locatable, SelectableWidget , ValidationErrorAware , ValueChangedListenerEnabled , Widget
public class CaptchaField extends Field
A 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
CaptchaValidator .
Usage sample:
<fd:captcha id="f1" required="true">
<fd:label>Copy the number shown into the input field</fd:label>
<fd:datatype base="string"/>
<fd:validation>
<fd:captcha/>
</fd:validation>
</fd:captcha>
Version:
$Id: CaptchaField.html 1304280 2012-03-23 11:18:01Z ilgrosso $
See Also: captcha.net
Fields inherited from class org.apache.cocoon.forms.formmodel.Field
enteredValue , required , selectionList , SUGGESTED_LABEL_ATTR , validationError , value , VALUE_DISPLAY_PARSE_ERROR , VALUE_DISPLAY_VALIDATION , VALUE_PARSE_ERROR , VALUE_PARSED , VALUE_UNPARSED , VALUE_VALIDATED , VALUE_VALIDATING , valueState
Methods inherited from class org.apache.cocoon.forms.formmodel.Field
addValueChangedListener , applyWhitespaceTrim , broadcastEvent , getDatatype , getDefinition , getFieldDefinition , getSuggestionLabel , getSuggestionList , getValidationError , getValue , getXMLElementAttributes , getXMLElementName , hasValueChangedListeners , initialize , isRequired , isSuggested , readFromRequest , readFromRequest , removeValueChangedListener , setRequired , setSelectionList , setSelectionList , setSelectionList , setSuggestionLabel , setValidationError , setValue , validate
Methods inherited from class org.apache.cocoon.forms.formmodel.AbstractWidget
addValidator , generateDisplayData , generateLabel , generateSaxFragment , getAttribute , getChild , getCombinedState , getForm , getFullName , getId , getLocation , getName , getParent , getRequestParameterName , getState , getWidget , isValid , lookupWidget , removeAttribute , removeValidator , setAttribute , setParent , setState , toString , widgetNameChanged
Methods inherited from interface org.apache.cocoon.forms.formmodel.Widget
addValidator , generateLabel , generateSaxFragment , getAttribute , getCombinedState , getForm , getFullName , getId , getLocation , getName , getParent , getRequestParameterName , getState , getWidget , isValid , lookupWidget , removeAttribute , removeValidator , setAttribute , setParent , setState
SESSION_ATTR_PREFIX
public static final String SESSION_ATTR_PREFIX
See Also: Constant Field Values
random
protected static final SecureRandom random
Random number generator used to create session attribute name.
CaptchaField
public CaptchaField (CaptchaFieldDefinition fieldDefinition,
org.apache.cocoon.processing.ProcessInfoProvider processInfoProvider)
generateItemSaxFragment
public void generateItemSaxFragment (ContentHandler contentHandler,
Locale locale)
throws SAXException
Description copied from class: AbstractWidget
Generates nested additional content nested inside the main element for this
widget which is generated by AbstractWidget.generateSaxFragment(ContentHandler, Locale)
The implementation on the AbstractWidget level inserts no additional XML.
Subclasses need to override to insert widget specific content.
Overrides: generateItemSaxFragment in class Field
Throws:
SAXException
Copyright © 1999-2008 The Apache Software Foundation . All Rights Reserved.