org.apache.cocoon.forms.formmodel
Class CalculatedFieldDefinitionBuilder

java.lang.Object
  extended byorg.apache.cocoon.forms.formmodel.AbstractWidgetDefinitionBuilder
      extended byorg.apache.cocoon.forms.formmodel.AbstractDatatypeWidgetDefinitionBuilder
          extended byorg.apache.cocoon.forms.formmodel.FieldDefinitionBuilder
              extended byorg.apache.cocoon.forms.formmodel.CalculatedFieldDefinitionBuilder
All Implemented Interfaces:
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 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
 
Fields inherited from class org.apache.cocoon.forms.formmodel.AbstractWidgetDefinitionBuilder
datatypeManager, expressionManager, widgetDefinitionBuilders, widgetListenerBuilders, widgetValidatorBuilders
 
Constructor Summary
CalculatedFieldDefinitionBuilder()
           
 
Method Summary
 WidgetDefinition buildWidgetDefinition(Element widgetElement, WidgetDefinitionBuilderContext context)
           
 void setCalculatedFieldAlgorithmBuilders(Map calculatedFieldAlgorithmBuilders)
           
 void setDefaultCalculatedFieldAlgorithmBuilder(String defaultCalculatedFieldAlgorithmBuilder)
           
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, getProcessInfoProvider, setDefaultSelectionListBuilder, setProcessInfoProvider, setSelectionListBuilders, setSourceResolver, setupDefinition, setupDefinition, setXmlizer
 
Methods inherited from class org.apache.cocoon.forms.formmodel.AbstractWidgetDefinitionBuilder
buildAnotherWidgetDefinition, buildEventListeners, buildWidgetDefinition, setCommonProperties, setCreateListeners, setDatatypeManager, setDisplayData, setExpressionManager, setupDefinition, setValidators, setWidgetDefinitionBuilders, setWidgetListenerBuilders, setWidgetValidatorBuilders
 
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

setCalculatedFieldAlgorithmBuilders

public void setCalculatedFieldAlgorithmBuilders(Map calculatedFieldAlgorithmBuilders)

setDefaultCalculatedFieldAlgorithmBuilder

public void setDefaultCalculatedFieldAlgorithmBuilder(String defaultCalculatedFieldAlgorithmBuilder)


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.