org.apache.cocoon.forms.formmodel
Class CalculatedFieldDefinitionBuilder

java.lang.Object
  extended by org.apache.cocoon.forms.formmodel.AbstractWidgetDefinitionBuilder
      extended by org.apache.cocoon.forms.formmodel.AbstractDatatypeWidgetDefinitionBuilder
          extended by org.apache.cocoon.forms.formmodel.FieldDefinitionBuilder
              extended by org.apache.cocoon.forms.formmodel.CalculatedFieldDefinitionBuilder
All Implemented Interfaces:
Disposable, Serviceable, WidgetDefinitionBuilder

public class CalculatedFieldDefinitionBuilder
extends FieldDefinitionBuilder

Builder for CalculatedFields.

A common calculated field definition is as follows :

<fd:calculatedfield id="id" [state="{invisible|output|disabled|active}"]> <fd:datatype base="...">...</fd:datatype> <fd:label>...</fd:label> <fd:value type="...">...</fd:algorithm> </fd:calculatedfield>

Since it inherits from Field, other attributes and elements may be specified, like listeners (on-value-changed, on-create etc..) or selection lists (which could make sense if the algorithm calculates one value between many possibilities).

Note that the default state is active, althought typing in a calculated field is useless. The state invisible can be used to create fields which are used as temporary value placeholders in a chain of calculations.

Version:
$Id: CalculatedFieldDefinitionBuilder.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Field Summary
 
Fields inherited from class org.apache.cocoon.forms.formmodel.AbstractWidgetDefinitionBuilder
datatypeManager, expressionManager, serviceManager, widgetDefinitionBuilderSelector, widgetListenerBuilderSelector, widgetValidatorBuilderSelector
 
Constructor Summary
CalculatedFieldDefinitionBuilder()
           
 
Method Summary
 WidgetDefinition buildWidgetDefinition(Element widgetElement, WidgetDefinitionBuilderContext context)
           
protected  void setupDefinition(Element widgetElement, CalculatedFieldDefinition definition, WidgetDefinitionBuilderContext context)
           
 
Methods inherited from class org.apache.cocoon.forms.formmodel.FieldDefinitionBuilder
setupDefinition
 
Methods inherited from class org.apache.cocoon.forms.formmodel.AbstractDatatypeWidgetDefinitionBuilder
buildSelectionList, setupDefinition, setupDefinition
 
Methods inherited from class org.apache.cocoon.forms.formmodel.AbstractWidgetDefinitionBuilder
buildAnotherWidgetDefinition, buildEventListeners, buildWidgetDefinition, dispose, service, setCommonProperties, setCreateListeners, setDisplayData, setupDefinition, setValidators
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalculatedFieldDefinitionBuilder

public CalculatedFieldDefinitionBuilder()
Method Detail

buildWidgetDefinition

public WidgetDefinition buildWidgetDefinition(Element widgetElement,
                                              WidgetDefinitionBuilderContext context)
                                       throws Exception
Specified by:
buildWidgetDefinition in interface WidgetDefinitionBuilder
Overrides:
buildWidgetDefinition in class FieldDefinitionBuilder
Throws:
Exception

setupDefinition

protected void setupDefinition(Element widgetElement,
                               CalculatedFieldDefinition definition,
                               WidgetDefinitionBuilderContext context)
                        throws Exception
Throws:
Exception


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.