Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinition.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinition.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinition.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinition.java Thu Feb 24 09:02:09 2005 @@ -15,6 +15,9 @@ */ package org.apache.cocoon.forms.formmodel; +import org.apache.cocoon.forms.event.ActionEvent; +import org.apache.cocoon.forms.event.ActionListener; + /** * Abstract repeater action. Subclasses will typically just self-add an * event handler that will act on the repeater. @@ -56,4 +59,89 @@ return this.name; } + //--------------------------------------------------------------------------------------------- + + /** + * The definition of a repeater action that deletes the selected rows of a sibling repeater. + * <p> + * The action listeners attached to this action, if any, are called <em>before</em> the rows + * are actually removed + */ + public static class DeleteRowsActionDefinition extends RepeaterActionDefinition { + + private String selectName; + + public DeleteRowsActionDefinition(String repeaterName, String selectName) { + super(repeaterName); + this.selectName = selectName; + } + + public boolean hasActionListeners() { + // we always want to be notified + return true; + } + + public void fireActionEvent(ActionEvent event) { + // Call action listeners, if any + super.fireActionEvent(event); + + // and actually delete the rows + Repeater repeater = ((RepeaterAction)event.getSource()).getRepeater(); + for (int i = repeater.getSize() - 1; i >= 0; i--) { + Repeater.RepeaterRow row = repeater.getRow(i); + if (Boolean.TRUE.equals(row.getChild(this.selectName).getValue())) { + repeater.removeRow(i); + } + } + } + } + + //--------------------------------------------------------------------------------------------- + + /** + * The definition of a repeater action that adds a row to a sibling repeater. + */ + public static class AddRowActionDefinition extends RepeaterActionDefinition { + + public AddRowActionDefinition(String repeaterName) { + super(repeaterName); + + this.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + Repeater repeater = ((RepeaterAction)event.getSource()).getRepeater(); + repeater.addRow(); + } + }); + } + } + + //--------------------------------------------------------------------------------------------- + + /** + * The definition of a repeater action that insert rows before the selected rows in a sibling repeater. + */ + public static class InsertRowsActionDefinition extends RepeaterActionDefinition { + + private String selectName; + + public InsertRowsActionDefinition(String repeaterName, String selectWidgetName) { + super(repeaterName); + this.selectName = selectWidgetName; + + this.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + Repeater repeater = ((RepeaterAction)event.getSource()).getRepeater(); + for (int i = repeater.getSize() - 1; i >= 0; i--) { + Repeater.RepeaterRow row = repeater.getRow(i); + Widget selectWidget = row.getChild(selectName); + if (Boolean.TRUE.equals(selectWidget.getValue())) { + // Clear selection and add a row + selectWidget.setValue(Boolean.FALSE); + repeater.addRow(i); + } + } + } + }); + } + } }
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinitionBuilder.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinitionBuilder.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinitionBuilder.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinitionBuilder.java Thu Feb 24 09:02:09 2005 @@ -20,24 +20,33 @@ import org.apache.cocoon.forms.Constants; import org.apache.cocoon.forms.event.ActionListener; import org.apache.cocoon.forms.util.DomHelper; +import org.apache.cocoon.util.log.DeprecationLogger; import org.w3c.dom.Element; /** * Builds a <code><fd:repeater-action/></code> * - * <p>Two actions are defined: + * <p>Three actions are defined: * <ul> * <li> - * <code><fd:repeater-action id="add" action-command="add-row" + * <code><fd:repeater-action id="add" command="add-row" * repeater="repeater-id"/></code>: when activated, adds a row to the * sibling repeater named "repeater-id". * </li> * <li> - * <code><fd:repeater-action id="rm" action-command="delete-rows" + * <code><fd:repeater-action id="rm" command="delete-rows" * repeater="repeater-id" select="select-id"/></code>: removes the * selected rows from the sibling repeater named "repeater-id". The * selected rows are identified by the boolean field "select-id" present * in each row. + * </li> + * <li> + * <code><fd:repeater-action id="insert" command="insert-rows" + * repeater="repeater-id" select="select-id"/></code>: inserts rows before + * the selected rows from the sibling repeater named "repeater-id". The + * selected rows are identified by the boolean field "select-id" present + * in each row. + * </li> * </ul> * * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a> @@ -45,13 +54,26 @@ */ public class RepeaterActionDefinitionBuilder extends AbstractWidgetDefinitionBuilder { - public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { - String actionCommand = DomHelper.getAttribute(widgetElement, "action-command"); + // Get the "command" attribute + String actionCommand = DomHelper.getAttribute(widgetElement, "command", null); + + // If unspecified, check the deprecated "action-command" deprecated attribute + if (actionCommand == null) { + actionCommand = DomHelper.getAttribute(widgetElement, "action-command", null); + if (actionCommand != null) { + DeprecationLogger.log("The 'action-command' attribute is deprecated and replaced by 'command', at " + + DomHelper.getLocation(widgetElement)); + } + } + if (actionCommand == null) { + throw new Exception("Missing attribute 'command' at " + DomHelper.getLocation(widgetElement)); + } + + RepeaterActionDefinition definition = createDefinition(widgetElement, actionCommand); - setCommonProperties(widgetElement, definition); + super.setupDefinition(widgetElement, definition); setDisplayData(widgetElement, definition); - setValidators(widgetElement, definition); definition.setActionCommand(actionCommand); @@ -67,19 +89,23 @@ definition.addActionListener((ActionListener)iter.next()); } + definition.makeImmutable(); return definition; } protected RepeaterActionDefinition createDefinition(Element element, String actionCommand) throws Exception { + String repeater = DomHelper.getAttribute(element, "repeater"); if ("delete-rows".equals(actionCommand)) { - String repeater = DomHelper.getAttribute(element, "repeater"); String select = DomHelper.getAttribute(element, "select"); - return new DeleteRowsActionDefinition(repeater, select); + return new RepeaterActionDefinition.DeleteRowsActionDefinition(repeater, select); } else if ("add-row".equals(actionCommand)) { - String repeater = DomHelper.getAttribute(element, "repeater"); - return new AddRowActionDefinition(repeater); + return new RepeaterActionDefinition.AddRowActionDefinition(repeater); + + } else if ("insert-rows".equals(actionCommand)) { + String select = DomHelper.getAttribute(element, "select"); + return new RepeaterActionDefinition.InsertRowsActionDefinition(repeater, select); } else { throw new Exception("Unknown repeater action '" + actionCommand + "' at " + DomHelper.getLineLocation(element)); Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterDefinitionBuilder.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterDefinitionBuilder.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterDefinitionBuilder.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RepeaterDefinitionBuilder.java Thu Feb 24 09:02:09 2005 @@ -24,16 +24,15 @@ * * @version $Id$ */ -public class RepeaterDefinitionBuilder extends AbstractWidgetDefinitionBuilder { +public final class RepeaterDefinitionBuilder extends AbstractWidgetDefinitionBuilder { public WidgetDefinition buildWidgetDefinition(Element repeaterElement) throws Exception { int initialSize = DomHelper.getAttributeAsInteger(repeaterElement, "initial-size", 0); RepeaterDefinition repeaterDefinition = new RepeaterDefinition(initialSize); - setCommonProperties(repeaterElement, repeaterDefinition); + super.setupDefinition(repeaterElement, repeaterDefinition); setDisplayData(repeaterElement, repeaterDefinition); - setValidators(repeaterElement, repeaterDefinition); Element widgetsElement = DomHelper.getChildElement(repeaterElement, Constants.DEFINITION_NS, "widgets", true); // All child elements of the widgets element are widgets @@ -43,6 +42,7 @@ repeaterDefinition.addWidgetDefinition(widgetDefinition); } + repeaterDefinition.makeImmutable(); return repeaterDefinition; } } Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RowActionDefinitionBuilder.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RowActionDefinitionBuilder.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RowActionDefinitionBuilder.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/RowActionDefinitionBuilder.java Thu Feb 24 09:02:09 2005 @@ -20,6 +20,7 @@ import org.apache.cocoon.forms.Constants; import org.apache.cocoon.forms.event.ActionListener; import org.apache.cocoon.forms.util.DomHelper; +import org.apache.cocoon.util.log.DeprecationLogger; import org.w3c.dom.Element; /** @@ -31,9 +32,23 @@ public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { - String actionCommand = DomHelper.getAttribute(widgetElement, "action-command"); + // Get the "command" attribute + String actionCommand = DomHelper.getAttribute(widgetElement, "command", null); + + // If unspecified, check the deprecated "action-command" deprecated attribute + if (actionCommand == null) { + actionCommand = DomHelper.getAttribute(widgetElement, "action-command", null); + if (actionCommand != null) { + DeprecationLogger.log("The 'action-command' attribute is deprecated and replaced by 'command', at " + + DomHelper.getLocation(widgetElement)); + } + } + if (actionCommand == null) { + throw new Exception("Missing attribute 'command' at " + DomHelper.getLocation(widgetElement)); + } + RowActionDefinition definition = createDefinition(widgetElement, actionCommand); - setCommonProperties(widgetElement, definition); + super.setupDefinition(widgetElement, definition); setDisplayData(widgetElement, definition); definition.setActionCommand(actionCommand); @@ -50,6 +65,7 @@ definition.addActionListener((ActionListener)iter.next()); } + definition.makeImmutable(); return definition; } Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SelectableWidget.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SelectableWidget.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SelectableWidget.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SelectableWidget.java Thu Feb 24 09:02:09 2005 @@ -18,14 +18,36 @@ import org.apache.cocoon.forms.datatype.SelectionList; /** - * @version $Id$ + * A [EMAIL PROTECTED] Widget} that can have a selection list. The initial selection list is set by the + * widget's [EMAIL PROTECTED] WidgetDefinition}, and can be changed afterwards. The selection list can + * be removed by setting the list to <code>null</code>. * + * @version $Id$ */ public interface SelectableWidget extends Widget { + /** + * Set the widget's selection list given a [EMAIL PROTECTED] SelectionList}. + * + * @param selectionList the selection list or <code>null</code> to have no selection list. + */ public void setSelectionList(SelectionList selectionList); + /** + * Set the widget's selection list given a source URI where the list will be read from. + * + * @param uri the selection list's URI + */ public void setSelectionList(String uri); + /** + * Set the widgdet's selection given an object and XPath expressions. + * + * @param model the selection list model. This is typically a collection or an array of objects + * in which <code>valuePath</code> and <code>labelPath</code> will extract some data. + * @param valuePath the XPath expression to extract values + * @param labelPath the XPath expression to extract labels (can be absent in which case the value is + * used as label). + */ public void setSelectionList(Object model, String valuePath, String labelPath); } Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Struct.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Struct.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Struct.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Struct.java Thu Feb 24 09:02:09 2005 @@ -18,23 +18,17 @@ /** * A container [EMAIL PROTECTED] Widget} which can hold zero or more child widgets. - * + * + * @deprecated replaced by [EMAIL PROTECTED] Group} * @version $Id$ */ -public class Struct extends AbstractContainerWidget { +public class Struct extends Group { private static final String STRUCT_EL = "struct"; - private final StructDefinition definition; - - public Struct(StructDefinition definition) { + public Struct(GroupDefinition definition) { super(definition); - this.definition = definition; - } - - protected WidgetDefinition getDefinition() { - return this.definition; } - + /** * @return "struct" */ Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/StructDefinition.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/StructDefinition.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/StructDefinition.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/StructDefinition.java Thu Feb 24 09:02:09 2005 @@ -18,9 +18,10 @@ /** * The [EMAIL PROTECTED] WidgetDefinition} corresponding to a [EMAIL PROTECTED] Struct} widget. * + * @deprecated replaced by [EMAIL PROTECTED] GroupDefinition} * @version $Id$ */ -public class StructDefinition extends AbstractContainerDefinition { +public class StructDefinition extends GroupDefinition { public Widget createInstance() { Struct structWidget = new Struct(this); Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/StructDefinitionBuilder.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/StructDefinitionBuilder.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/StructDefinitionBuilder.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/StructDefinitionBuilder.java Thu Feb 24 09:02:09 2005 @@ -18,19 +18,20 @@ import org.w3c.dom.Element; import org.apache.cocoon.forms.Constants; import org.apache.cocoon.forms.util.DomHelper; +import org.apache.cocoon.util.log.DeprecationLogger; /** * Builds {StructDefinition}s. * + * @deprecated replaced by [EMAIL PROTECTED] GroupDefinitionBuilder} * @version $Id$ */ public class StructDefinitionBuilder extends AbstractWidgetDefinitionBuilder { public WidgetDefinition buildWidgetDefinition(Element element) throws Exception { StructDefinition definition = new StructDefinition(); - setCommonProperties(element, definition); + super.setupDefinition(element, definition); setDisplayData(element, definition); - setValidators(element, definition); Element widgetsElement = DomHelper.getChildElement(element, Constants.DEFINITION_NS, "widgets", true); // All child elements of the widgets element are widgets @@ -41,6 +42,8 @@ definition.addWidgetDefinition(widgetDefinition); } + definition.makeImmutable(); + DeprecationLogger.log("Use of 'fd:struct' is deprecated. Use 'fd:group' instead, at " + definition.getLocation()); return definition; } } Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SubmitDefinition.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SubmitDefinition.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SubmitDefinition.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SubmitDefinition.java Thu Feb 24 09:02:09 2005 @@ -27,6 +27,7 @@ private boolean validateForm; public void setValidateForm(boolean validateForm) { + checkMutable(); this.validateForm = validateForm; } Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SubmitDefinitionBuilder.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SubmitDefinitionBuilder.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SubmitDefinitionBuilder.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/SubmitDefinitionBuilder.java Thu Feb 24 09:02:09 2005 @@ -26,7 +26,7 @@ * * <p>The syntax is as follows: * <pre> - * <wd:submit id="sub-id" action-command="cmd" validate="false"> + * <wd:submit id="sub-id" command="cmd" validate="false"> * </pre> * The "validate" attribute can have the value <code>true</code> or * <code>false</code> and determines if the form is to be validated @@ -35,15 +35,13 @@ * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a> * @version $Id$ */ -public class SubmitDefinitionBuilder extends ActionDefinitionBuilder { +public final class SubmitDefinitionBuilder extends ActionDefinitionBuilder { public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { - SubmitDefinition definition = (SubmitDefinition)super.buildWidgetDefinition(widgetElement); + SubmitDefinition definition = new SubmitDefinition(); + super.setupDefinition(widgetElement, definition); definition.setValidateForm(DomHelper.getAttributeAsBoolean(widgetElement, "validate", true)); + definition.makeImmutable(); return definition; - } - - protected ActionDefinition createDefinition() { - return new SubmitDefinition(); - } + } } Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Union.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Union.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Union.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Union.java Thu Feb 24 09:02:09 2005 @@ -47,7 +47,7 @@ //item.enteredValue = (String)definition.getDefaultValue(); } - protected WidgetDefinition getDefinition() { + public WidgetDefinition getDefinition() { return definition; } Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/UnionDefinition.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/UnionDefinition.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/UnionDefinition.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/UnionDefinition.java Thu Feb 24 09:02:09 2005 @@ -51,6 +51,7 @@ */ public void setCaseWidgetId(String id) { + checkMutable(); caseWidgetId = id; } Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/UnionDefinitionBuilder.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/UnionDefinitionBuilder.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/UnionDefinitionBuilder.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/UnionDefinitionBuilder.java Thu Feb 24 09:02:09 2005 @@ -24,14 +24,13 @@ * * @version $Id$ */ -public class UnionDefinitionBuilder extends AbstractWidgetDefinitionBuilder { +public final class UnionDefinitionBuilder extends AbstractWidgetDefinitionBuilder { public WidgetDefinition buildWidgetDefinition(Element element) throws Exception { UnionDefinition definition = new UnionDefinition(); - setCommonProperties(element, definition); + super.setupDefinition(element, definition); definition.setCaseWidgetId(DomHelper.getAttribute(element, "case", "")); setDisplayData(element, definition); - setValidators(element, definition); Element widgetsElement = DomHelper.getChildElement(element, Constants.DEFINITION_NS, "widgets", true); // All child elements of the widgets element are widgets @@ -42,6 +41,7 @@ definition.addWidgetDefinition(widgetDefinition); } + definition.makeImmutable(); return definition; } // TODO: Need to add code somewhere to build a selection list for the case widget. Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java Thu Feb 24 09:02:09 2005 @@ -56,7 +56,7 @@ return this.uploadDefinition; } - protected WidgetDefinition getDefinition() { + public WidgetDefinition getDefinition() { return uploadDefinition; } Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/UploadDefinitionBuilder.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/UploadDefinitionBuilder.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/UploadDefinitionBuilder.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/UploadDefinitionBuilder.java Thu Feb 24 09:02:09 2005 @@ -25,18 +25,18 @@ * @author <a href="http://www.apache.org/~sylvain/">Sylvain Wallez</a> * @version $Id$ */ -public class UploadDefinitionBuilder extends AbstractWidgetDefinitionBuilder { +public final class UploadDefinitionBuilder extends AbstractWidgetDefinitionBuilder { public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { String mimeTypes = DomHelper.getAttribute(widgetElement, "mime-types", null); boolean required = DomHelper.getAttributeAsBoolean(widgetElement, "required", false); UploadDefinition uploadDefinition = new UploadDefinition(required, mimeTypes); - setCommonProperties(widgetElement, uploadDefinition); + super.setupDefinition(widgetElement, uploadDefinition); setDisplayData(widgetElement, uploadDefinition); - setValidators(widgetElement, uploadDefinition); + uploadDefinition.makeImmutable(); return uploadDefinition; } } Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Widget.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Widget.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Widget.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Widget.java Thu Feb 24 09:02:09 2005 @@ -97,6 +97,13 @@ public Form getForm(); /** + * Get this widget's definition. + * + * @return the widget's definition + */ + public WidgetDefinition getDefinition(); + + /** * Get the widget's own state. Note that this state is <em>not</em> the one actually considered * for handling requests and producing output. For these matters, the combined state is used. * @@ -180,16 +187,26 @@ public void generateLabel(ContentHandler contentHandler) throws SAXException; /** - * @return the value of the widget. For some widgets (notably ContainerWidgets) - * this may not make sense, those should then simply return null here. + * Get the value of a widget. + * <p> + * Not all widgets do have a value (notably [EMAIL PROTECTED] ContainerWidget}s, + * but this method is provided here as a convenience to ease writing and avoiding casts. + * + * @return the value of the widget. + * @throws UnsupportedOperationException if this widget doesn't have a value. */ - public Object getValue(); + public Object getValue() throws UnsupportedOperationException; /** - * Sets the value of this widget to the given object. Some widgets may not support this - * method, those should throw an runtime exception if you try to set their value anyway. + * Sets the value of this widget. + * <p> + * Not all widgets do have a value (notably [EMAIL PROTECTED] ContainerWidget}s, + * but this method is provided here as a convenience to ease writing and avoiding casts. + * + * @param value the new widget's value. + * @throws UnsupportedOperationException if this widget doesn't have a value. */ - public void setValue(Object object); + public void setValue(Object value) throws UnsupportedOperationException; /** * @return whether this widget is required to be filled in. As with [EMAIL PROTECTED] #getValue()}, Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/WidgetDefinitionList.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/WidgetDefinitionList.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/WidgetDefinitionList.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/WidgetDefinitionList.java Thu Feb 24 09:02:09 2005 @@ -32,7 +32,7 @@ public class WidgetDefinitionList { private List widgetDefinitions = new ArrayList(); private Map widgetDefinitionsById = new HashMap(); - private WidgetDefinition definition; + private WidgetDefinition containerDefinition; private boolean resolving; private ListIterator definitionsIt = widgetDefinitions.listIterator(); @@ -40,7 +40,7 @@ * @param definition the widget definition to which this container delegate belongs */ public WidgetDefinitionList(WidgetDefinition definition) { - this.definition = definition; + this.containerDefinition = definition; resolving = false; } @@ -50,11 +50,11 @@ if (!(widgetDefinition instanceof NewDefinition)) { if (widgetDefinitionsById.containsKey(id)) { String duplicateLocation = widgetDefinition.getLocation(); - String containerLocation = definition.getLocation(); + String containerLocation = containerDefinition.getLocation(); String firstLocation = getWidgetDefinition(id).getLocation(); throw new DuplicateIdException( "Duplicate widget id \"" + id + "\" detected at " + duplicateLocation + ".\n" + - "Container widget \"" + definition.getId() + "\" at " + containerLocation + "\n" + + "Container widget \"" + containerDefinition.getId() + "\" at " + containerLocation + "\n" + "already contains a widget with id \"" + id + "\" at " + firstLocation + "."); } widgetDefinitionsById.put(widgetDefinition.getId(), widgetDefinition); @@ -82,7 +82,7 @@ if (!resolving) { resolving = true; this.definitionsIt = widgetDefinitions.listIterator(); - parents.add(definition); + parents.add(containerDefinition); while (this.definitionsIt.hasNext()) { WidgetDefinition widgetDefinition = (WidgetDefinition)this.definitionsIt.next(); // ClassDefinition's get resolved by NewDefinition rather than here. @@ -90,10 +90,10 @@ if (widgetDefinition instanceof NewDefinition) { // Remove NewDefinition in preparation for its referenced class of widget definitions to be added. this.definitionsIt.remove(); - ((NewDefinition)widgetDefinition).resolve(parents, definition); + ((NewDefinition)widgetDefinition).resolve(parents, containerDefinition); } else { if (widgetDefinition instanceof ContainerDefinition) - ((ContainerDefinition)widgetDefinition).resolve(parents, definition); + ((ContainerDefinition)widgetDefinition).resolve(parents, containerDefinition); } } } @@ -108,8 +108,8 @@ WidgetDefinition widgetDefinition = (WidgetDefinition)parentsIt.previous(); if (widgetDefinition instanceof UnionDefinition) break; if (widgetDefinition instanceof RepeaterDefinition) break; - if (widgetDefinition == definition) { - String location = definition.getLocation(); + if (widgetDefinition == containerDefinition) { + String location = containerDefinition.getLocation(); if (parent instanceof FormDefinition) { throw new Exception("Container: Non-terminating recursion detected in form definition (" + location + ")"); } else { @@ -125,8 +125,8 @@ public void createWidget(Widget parent, String id) { WidgetDefinition widgetDefinition = (WidgetDefinition)widgetDefinitionsById.get(id); if (widgetDefinition == null) { - throw new RuntimeException(definition.getId() + ": WidgetDefinition \"" + id + - "\" does not exist (" + definition.getLocation() + ")"); + throw new RuntimeException(containerDefinition.getId() + ": WidgetDefinition \"" + id + + "\" does not exist (" + containerDefinition.getLocation() + ")"); } Widget widget = widgetDefinition.createInstance(); if (widget != null) Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/WidgetState.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/WidgetState.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/WidgetState.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/WidgetState.java Thu Feb 24 09:02:09 2005 @@ -27,9 +27,11 @@ */ public class WidgetState extends ValuedEnum { - private static final int ACTIVE_VALUE = 3; + private static final int ACTIVE_VALUE = 4; + + private static final int DISABLED_VALUE = 3; - private static final int DISABLED_VALUE = 2; + private static final int OUTPUT_VALUE = 2; private static final int INVISIBLE_VALUE = 1; @@ -40,9 +42,16 @@ public static final WidgetState ACTIVE = new WidgetState("active", ACTIVE_VALUE); /** - * Disabled state. Values are displayed, but user input is ignored. + * Disabled state, value is displayed but user input is ignored. The widget should be + * rendered in a manner that indicates that this widget could be active, but is currently not. */ public static final WidgetState DISABLED = new WidgetState("disabled", DISABLED_VALUE); + + /** + * Output state, value is displayed but user input is ignored. The widget should be rendered + * as plain text, giving no indication that it could be input. + */ + public static final WidgetState OUTPUT = new WidgetState("output", OUTPUT_VALUE); /** * Invisible state. Values are not displayed and user input is ignored. Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/generation/jx-macros.xml Thu Feb 24 09:02:09 2005 @@ -100,9 +100,10 @@ <jx:set var="widget" value="${cformsHelper.getWidget(widget, id)}"/> <jx:if test="${cformsHelper.isVisible(widget)}"> - <fi:group id="${widget.getRequestParameterName()}"> + <!--FIXME(SW): revisit fi:group + fi:group id="${widget.getRequestParameterName()}"--> <jx:evalBody/> - </fi:group> + <!--/fi:group--> </jx:if> </jx:macro> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/JavaScriptHelper.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/JavaScriptHelper.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/JavaScriptHelper.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/util/JavaScriptHelper.java Thu Feb 24 09:02:09 2005 @@ -75,13 +75,14 @@ * Build a function with the content of a DOM element. * * @param element the element containing the function body + * @param name the name of the function * @param argumentNames names of the function arguments * @return the compiled function * @throws IOException */ - public static Function buildFunction(Element element, String[] argumentNames) throws IOException { + public static Function buildFunction(Element element, String name, String[] argumentNames) throws IOException { // Enclose the script text with a function declaration - StringBuffer buffer = new StringBuffer("function foo("); + StringBuffer buffer = new StringBuffer("function ").append(name).append("("); for (int i = 0; i < argumentNames.length; i++) { if (i > 0) { buffer.append(','); Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/validation/impl/JavaScriptValidatorBuilder.java URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/validation/impl/JavaScriptValidatorBuilder.java?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/validation/impl/JavaScriptValidatorBuilder.java (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/validation/impl/JavaScriptValidatorBuilder.java Thu Feb 24 09:02:09 2005 @@ -50,7 +50,7 @@ * @see org.apache.cocoon.forms.validation.ValidatorBuilder#build(org.apache.cocoon.forms.formmodel.WidgetDefinition, org.w3c.dom.Element) */ public WidgetValidator build(Element element, WidgetDefinition definition) throws Exception { - Function function = JavaScriptHelper.buildFunction(element, ARG_NAMES); + Function function = JavaScriptHelper.buildFunction(element, "validate", ARG_NAMES); return new JavaScriptValidator(this.avalonContext, function); } Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/dreamteam/sitemap.xmap URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/dreamteam/sitemap.xmap?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/dreamteam/sitemap.xmap (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/dreamteam/sitemap.xmap Thu Feb 24 09:02:09 2005 @@ -126,7 +126,7 @@ <!-- images --> <!-- ========================================= --> <map:match pattern="resources/*.gif"> - <map:read mime-type="images/gif" src="../resources/{1}.gif"/> + <map:read mime-type="images/gif" src="resource://org/apache/cocoon/forms/resources/{1}.gif"/> </map:match> <map:match pattern="flags/*.gif"> <map:read mime-type="images/gif" src="resources/flags/{1}.gif"/> @@ -137,11 +137,11 @@ <map:match pattern="local-resources/*.css"> <map:read mime-type="text/css" src="resources/styles/{1}.css"/> </map:match> - <map:match pattern="resources/*.css"> - <map:read mime-type="text/css" src="../resources/styles/{1}.css"/> + <map:match pattern="resources/**.css"> + <map:read mime-type="text/css" src="resource://org/apache/cocoon/forms/resources/styles/{1}.css"/> </map:match> - <map:match pattern="resources/*.js"> - <map:read src="../resources/{1}.js"/> + <map:match pattern="resources/**.js"> + <map:read src="resource://org/apache/cocoon/forms/resources/{1}.js"/> </map:match> </map:pipeline> </map:pipelines> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/datasource_chooser.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/datasource_chooser.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/datasource_chooser.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/datasource_chooser.xml Thu Feb 24 09:02:09 2005 @@ -30,6 +30,8 @@ <!-- The datasource type. This is the union's "case" widget --> <fd:field id="sourcetype"> <fd:datatype base="string"/> + <!-- The union will initially be showing the "SQL" choice --> + <fd:initial-value>SQL</fd:initial-value> <fd:selection-list> <fd:item value=""/> <fd:item value="SQL"/> @@ -42,35 +44,38 @@ <fd:widgets> <!-- data for an SQL datasource --> - <fd:struct id="SQL"> + <fd:group id="SQL"> <fd:widgets> <fd:field id="jdbc-url"> <fd:label>JDBC URL</fd:label> <fd:datatype base="string"/> + <!-- pre-fill with the sample values in cocoon.xconf --> + <fd:initial-value>jdbc:hsqldb:hsql://localhost:9002</fd:initial-value> </fd:field> <fd:field id="login"> <fd:label>Login</fd:label> <fd:datatype base="string"/> + <fd:initial-value>sa</fd:initial-value> </fd:field> <fd:field id="password"> <fd:label>Password</fd:label> <fd:datatype base="string"/> </fd:field> </fd:widgets> - </fd:struct> + </fd:group> <!-- data for a file datasource --> - <fd:struct id="file"> + <fd:group id="file"> <fd:widgets> <fd:field id="filename"> <fd:datatype base="string"/> </fd:field> </fd:widgets> - </fd:struct> + </fd:group> </fd:widgets> </fd:union> - <fd:submit id="ok" action-command="foo"> + <fd:submit id="ok"> <fd:label>OK</fd:label> </fd:submit> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/datasource_chooser_binding.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/datasource_chooser_binding.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/datasource_chooser_binding.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/datasource_chooser_binding.xml Thu Feb 24 09:02:09 2005 @@ -30,16 +30,16 @@ <fb:union id="datasource" path="."> <fb:case id="SQL" path="."> - <fb:struct id="SQL" path="."> + <fb:group id="SQL" path="."> <fb:value id="jdbc-url" path="URL"/> <fb:value id="login" path="login"/> <fb:value id="password" path="password"/> - </fb:struct> + </fb:group> </fb:case> <fb:case id="file" path="."> - <fb:struct id="file" path="."> + <fb:group id="file" path="."> <fb:value id="filename" path="file/@path"/> - </fb:struct> + </fb:group> </fb:case> </fb:union> </fb:context> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/datasource_chooser_template.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/datasource_chooser_template.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/datasource_chooser_template.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/datasource_chooser_template.xml Thu Feb 24 09:02:09 2005 @@ -35,7 +35,7 @@ Please choose a datasource type. </ft:case> <ft:case id="SQL"> - <ft:struct id="SQL"> + <ft:group id="SQL"> <fi:group> <fi:styling layout="columns"/> <fi:items> @@ -44,12 +44,12 @@ <ft:widget id="password"><fi:styling type="password"/></ft:widget> </fi:items> </fi:group> - </ft:struct> + </ft:group> </ft:case> <ft:case id="file"> - <ft:struct id="file"> + <ft:group id="file"> File name: <ft:widget id="filename"/> - </ft:struct> + </ft:group> </ft:case> </ft:union> </fieldset> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/dynamicrepeater.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/dynamicrepeater.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/dynamicrepeater.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/dynamicrepeater.xml Thu Feb 24 09:02:09 2005 @@ -44,9 +44,9 @@ <fd:datatype base="string"/> </fd:field> - <fd:row-action id="up" action-command="move-up"/> + <fd:row-action id="up" command="move-up"/> - <fd:row-action id="down" action-command="move-down"/> + <fd:row-action id="down" command="move-down"/> <fd:booleanfield id="select"> <fd:label>Select</fd:label> @@ -55,7 +55,7 @@ </fd:widgets> </fd:repeater> - <fd:repeater-action id="addcontact" action-command="add-row" repeater="contacts"> + <fd:repeater-action id="addcontact" command="add-row" repeater="contacts"> <fd:label>Add contact</fd:label> <fd:on-action> <fd:javascript> @@ -72,11 +72,11 @@ </fd:on-action> </fd:repeater-action> - <fd:repeater-action id="removecontacts" action-command="delete-rows" repeater="contacts" select="select"> + <fd:repeater-action id="removecontacts" command="delete-rows" repeater="contacts" select="select"> <fd:label>Remove selected contacts</fd:label> </fd:repeater-action> - <fd:submit id="submit" action-command="foo" > + <fd:submit id="submit"> <fd:label>Submit</fd:label> </fd:submit> </fd:widgets> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form1.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form1.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form1.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form1.xml Thu Feb 24 09:02:09 2005 @@ -327,11 +327,11 @@ </fd:widgets> </fd:repeater> - <fd:repeater-action id="addcontact" action-command="add-row" repeater="contacts"> + <fd:repeater-action id="addcontact" command="add-row" repeater="contacts"> <fd:label>Add contact</fd:label> </fd:repeater-action> - <fd:repeater-action id="removecontacts" action-command="delete-rows" repeater="contacts" select="select"> + <fd:repeater-action id="removecontacts" command="delete-rows" repeater="contacts" select="select"> <fd:label>Remove selected contacts</fd:label> </fd:repeater-action> </fd:widgets> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form2_model.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form2_model.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form2_model.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form2_model.xml Thu Feb 24 09:02:09 2005 @@ -150,11 +150,11 @@ </fd:widgets> </fd:repeater> - <fd:repeater-action id="addcontact" action-command="add-row" repeater="contacts"> + <fd:repeater-action id="addcontact" command="add-row" repeater="contacts"> <fd:label>Add contact</fd:label> </fd:repeater-action> - <fd:repeater-action id="removecontacts" action-command="delete-rows" repeater="contacts" select="select"> + <fd:repeater-action id="removecontacts" command="delete-rows" repeater="contacts" select="select"> <fd:label>Remove selected contacts</fd:label> </fd:repeater-action> </fd:widgets> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_binding.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_binding.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_binding.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_binding.xml Thu Feb 24 09:02:09 2005 @@ -59,7 +59,7 @@ <fb:new id="output-class"/> <fb:new id="repeater-class"/> <fb:new id="row-action-class"/> - <fb:new id="struct-class"/> + <fb:new id="group-class"/> <fb:new id="submit-class"/> <fb:new id="union-class"/> </fb:union> @@ -70,10 +70,10 @@ <fb:insert-node> <fd:action/> </fb:insert-node> - <fb:struct id="action" path="fd:action"> + <fb:group id="action" path="fd:action"> <fb:value id="label" path="fd:label"/> <fb:value id="id" path="@id"/> - </fb:struct> + </fb:group> </fb:case> </fb:class> @@ -82,12 +82,12 @@ <fb:insert-node> <fd:aggregatefield/> </fb:insert-node> - <fb:struct id="aggregatefield" path="fd:aggregatefield"> + <fb:group id="aggregatefield" path="fd:aggregatefield"> <fb:value id="id" path="@id"/> <fb:value id="label" path="fd:label"/> <fb:insert-node><fd:widgets/></fb:insert-node> <fb:new id="widgets-class"/> - </fb:struct> + </fb:group> </fb:case> </fb:class> @@ -96,10 +96,10 @@ <fb:insert-node> <fd:booleanfield/> </fb:insert-node> - <fb:struct id="booleanfield" path="fd:booleanfield"> + <fb:group id="booleanfield" path="fd:booleanfield"> <fb:value id="id" path="@id"/> <fb:value id="label" path="fd:label"/> - </fb:struct> + </fb:group> </fb:case> </fb:class> @@ -108,11 +108,11 @@ <fb:insert-node> <fd:class/> </fb:insert-node> - <fb:struct id="class" path="fd:class"> + <fb:group id="class" path="fd:class"> <fb:value id="id" path="@id"/> <fb:insert-node><fd:widgets/></fb:insert-node> <fb:new id="widgets-class"/> - </fb:struct> + </fb:group> </fb:case> </fb:class> @@ -121,13 +121,13 @@ <fb:insert-node> <fd:field/> </fb:insert-node> - <fb:struct id="field" path="fd:field"> + <fb:group id="field" path="fd:field"> <fb:value id="id" path="@id"/> <fb:value id="label" path="fd:label"/> <fb:value id="required" path="@required"> <fd:convertor datatype="boolean"/> </fb:value> - </fb:struct> + </fb:group> </fb:case> </fb:class> @@ -136,9 +136,9 @@ <fb:insert-node> <fd:new/> </fb:insert-node> - <fb:struct id="new" path="fd:new"> + <fb:group id="new" path="fd:new"> <fb:value id="id" path="@id"/> - </fb:struct> + </fb:group> </fb:case> </fb:class> @@ -147,10 +147,10 @@ <fb:insert-node> <fd:output/> </fb:insert-node> - <fb:struct id="output" path="fd:output"> + <fb:group id="output" path="fd:output"> <fb:value id="id" path="@id"/> <fb:value id="label" path="fd:label"/> - </fb:struct> + </fb:group> </fb:case> </fb:class> @@ -159,7 +159,7 @@ <fb:insert-node> <fd:repeater/> </fb:insert-node> - <fb:struct id="repeater" path="fd:repeater"> + <fb:group id="repeater" path="fd:repeater"> <fb:value id="id" path="@id"/> <fb:value id="label" path="fd:label"/> <fb:value id="initial-size" path="@initial-size"> @@ -167,7 +167,7 @@ </fb:value> <fb:insert-node><fd:widgets/></fb:insert-node> <fb:new id="widgets-class"/> - </fb:struct> + </fb:group> </fb:case> </fb:class> @@ -176,24 +176,24 @@ <fb:insert-node> <fd:row-action/> </fb:insert-node> - <fb:struct id="row-action" path="fd:row-action"> + <fb:group id="row-action" path="fd:row-action"> <fb:value id="id" path="@id"/> <fb:value id="label" path="fd:label"/> - </fb:struct> + </fb:group> </fb:case> </fb:class> - <fb:class id="struct-class"> - <fb:case id="struct" path="."> + <fb:class id="group-class"> + <fb:case id="group" path="."> <fb:insert-node> - <fd:struct/> + <fd:group/> </fb:insert-node> - <fb:struct id="struct" path="fd:struct"> + <fb:group id="group" path="fd:group"> <fb:value id="id" path="@id"/> <fb:value id="label" path="fd:label"/> <fb:insert-node><fd:widgets/></fb:insert-node> <fb:new id="widgets-class"/> - </fb:struct> + </fb:group> </fb:case> </fb:class> @@ -202,10 +202,10 @@ <fb:insert-node> <fd:submit/> </fb:insert-node> - <fb:struct id="submit" path="fd:submit"> + <fb:group id="submit" path="fd:submit"> <fb:value id="id" path="@id"/> <fb:value id="label" path="fd:label"/> - </fb:struct> + </fb:group> </fb:case> </fb:class> @@ -214,12 +214,12 @@ <fb:insert-node> <fd:union/> </fb:insert-node> - <fb:struct id="union" path="fd:union"> + <fb:group id="union" path="fd:union"> <fb:value id="id" path="@id"/> <fb:value id="label" path="fd:label"/> <fb:insert-node><fd:widgets/></fb:insert-node> <fb:new id="widgets-class"/> - </fb:struct> + </fb:group> </fb:case> </fb:class> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_data.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_data.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_data.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_data.xml Thu Feb 24 09:02:09 2005 @@ -54,13 +54,13 @@ <fd:row-action id="samp-row-action"><fd:label>Sample RowAction</fd:label></fd:row-action> - <fd:struct id="samp-struct"> - <fd:label>Sample Struct</fd:label> + <fd:group id="samp-group"> + <fd:label>Sample Group</fd:label> <fd:widgets> - <fd:booleanfield id="samp-struct-booleanfield"><fd:label>Sample Struct BooleanField</fd:label></fd:booleanfield> - <fd:field id="samp-struct-field" required="true"><fd:label>Sample Struct Field</fd:label></fd:field> + <fd:booleanfield id="samp-group-booleanfield"><fd:label>Sample Group BooleanField</fd:label></fd:booleanfield> + <fd:field id="samp-group-field" required="true"><fd:label>Sample Group Field</fd:label></fd:field> </fd:widgets> - </fd:struct> + </fd:group> <fd:submit id="samp-submit"><fd:label>Sample Submit</fd:label></fd:submit> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_model.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_model.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_model.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_model.xml Thu Feb 24 09:02:09 2005 @@ -32,11 +32,11 @@ <fd:new id="widgets-class"/> <!-- - <fd:struct id="form"> + <fd:group id="form"> <fd:widgets> <fd:new id="widgets-class"/> </fd:widgets> - </fd:struct> + </fd:group> --> <fd:class id="widgets-class"> @@ -47,10 +47,10 @@ <fd:new id="widget-row-class"/> </fd:widgets> </fd:repeater> - <fd:repeater-action id="addWidget" action-command="add-row" repeater="widgets"> + <fd:repeater-action id="addWidget" command="add-row" repeater="widgets"> <fd:label>New</fd:label> </fd:repeater-action> - <fd:repeater-action id="removeWidgets" action-command="delete-rows" repeater="widgets" select="select"> + <fd:repeater-action id="removeWidgets" command="delete-rows" repeater="widgets" select="select"> <fd:label>Delete</fd:label> </fd:repeater-action> </fd:widgets> @@ -73,7 +73,7 @@ <fd:item value="output"><fd:label>Output</fd:label></fd:item> <fd:item value="repeater"><fd:label>Repeater</fd:label></fd:item> <fd:item value="row-action"><fd:label>RowAction</fd:label></fd:item> - <fd:item value="struct"><fd:label>Struct</fd:label></fd:item> + <fd:item value="group"><fd:label>Group</fd:label></fd:item> <fd:item value="submit"><fd:label>Submit</fd:label></fd:item> <fd:item value="union"><fd:label>Union</fd:label></fd:item> </fd:selection-list> @@ -83,15 +83,15 @@ <fd:label>Type</fd:label> <fd:widgets> - <fd:struct id="action"> + <fd:group id="action"> <fd:label>Action</fd:label> <fd:widgets> <fd:new id="id-class"/> <fd:new id="label-class"/> </fd:widgets> - </fd:struct> + </fd:group> - <fd:struct id="aggregatefield"> + <fd:group id="aggregatefield"> <fd:label>AggregateField</fd:label> <fd:widgets> <fd:new id="id-class"/> @@ -99,49 +99,49 @@ <fd:new id="required-class"/> <fd:new id="widgets-class"/> </fd:widgets> - </fd:struct> + </fd:group> - <fd:struct id="booleanfield"> + <fd:group id="booleanfield"> <fd:label>BooleanField</fd:label> <fd:widgets> <fd:new id="id-class"/> <fd:new id="label-class"/> </fd:widgets> - </fd:struct> + </fd:group> - <fd:struct id="class"> + <fd:group id="class"> <fd:label>Class</fd:label> <fd:widgets> <fd:new id="id-class"/> <fd:new id="widgets-class"/> </fd:widgets> - </fd:struct> + </fd:group> - <fd:struct id="field"> + <fd:group id="field"> <fd:label>Field</fd:label> <fd:widgets> <fd:new id="id-class"/> <fd:new id="label-class"/> <fd:new id="required-class"/> </fd:widgets> - </fd:struct> + </fd:group> - <fd:struct id="new"> + <fd:group id="new"> <fd:label>New</fd:label> <fd:widgets> <fd:new id="id-class"/> </fd:widgets> - </fd:struct> + </fd:group> - <fd:struct id="output"> + <fd:group id="output"> <fd:label>Output</fd:label> <fd:widgets> <fd:new id="id-class"/> <fd:new id="label-class"/> </fd:widgets> - </fd:struct> + </fd:group> - <fd:struct id="repeater"> + <fd:group id="repeater"> <fd:label>Repeater</fd:label> <fd:widgets> <fd:new id="id-class"/> @@ -149,41 +149,41 @@ <fd:new id="initial-size-class"/> <fd:new id="widgets-class"/> </fd:widgets> - </fd:struct> + </fd:group> - <fd:struct id="row-action"> + <fd:group id="row-action"> <fd:label>RowAction</fd:label> <fd:widgets> <fd:new id="id-class"/> <fd:new id="label-class"/> </fd:widgets> - </fd:struct> + </fd:group> - <fd:struct id="struct"> - <fd:label>Struct</fd:label> + <fd:group id="group"> + <fd:label>Group</fd:label> <fd:widgets> <fd:new id="id-class"/> <fd:new id="label-class"/> <fd:new id="widgets-class"/> </fd:widgets> - </fd:struct> + </fd:group> - <fd:struct id="submit"> + <fd:group id="submit"> <fd:label>Submit</fd:label> <fd:widgets> <fd:new id="id-class"/> <fd:new id="label-class"/> </fd:widgets> - </fd:struct> + </fd:group> - <fd:struct id="union"> + <fd:group id="union"> <fd:label>Union</fd:label> <fd:widgets> <fd:new id="id-class"/> <fd:new id="label-class"/> <fd:new id="widgets-class"/> </fd:widgets> - </fd:struct> + </fd:group> </fd:widgets> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_template.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_template.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_template.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/form_model_gui_template.xml Thu Feb 24 09:02:09 2005 @@ -52,92 +52,92 @@ </ft:case> <ft:case id="action"> - <ft:struct id="action"> + <ft:group id="action"> <ft:new id="id-class"/> <ft:new id="label-class"/> - </ft:struct> + </ft:group> </ft:case> <ft:case id="aggregatefield"> - <ft:struct id="aggregatefield"> + <ft:group id="aggregatefield"> <ft:new id="id-class"/> <ft:new id="label-class"/> <ft:new id="widgets-class"/> - </ft:struct> + </ft:group> </ft:case> <ft:case id="booleanfield"> - <ft:struct id="booleanfield"> + <ft:group id="booleanfield"> <ft:new id="id-class"/> <ft:new id="label-class"/> - </ft:struct> + </ft:group> </ft:case> <ft:case id="class"> - <ft:struct id="class"> + <ft:group id="class"> <ft:new id="id-class"/> <ft:new id="widgets-class"/> - </ft:struct> + </ft:group> </ft:case> <ft:case id="field"> - <ft:struct id="field"> + <ft:group id="field"> <ft:new id="id-class"/> <ft:new id="label-class"/> <ft:new id="required-class"/> - </ft:struct> + </ft:group> </ft:case> <ft:case id="new"> - <ft:struct id="new"> + <ft:group id="new"> <ft:new id="id-class"/> - </ft:struct> + </ft:group> </ft:case> <ft:case id="output"> - <ft:struct id="output"> + <ft:group id="output"> <ft:new id="id-class"/> <ft:new id="label-class"/> - </ft:struct> + </ft:group> </ft:case> - <ft:case id="struct"> - <ft:struct id="struct"> + <ft:case id="group"> + <ft:group id="group"> <ft:new id="id-class"/> <ft:new id="label-class"/> <ft:new id="widgets-class"/> - </ft:struct> + </ft:group> </ft:case> <ft:case id="repeater"> - <ft:struct id="repeater"> + <ft:group id="repeater"> <ft:new id="id-class"/> <ft:new id="label-class"/> <ft:new id="initial-size-class"/> <ft:new id="widgets-class"/> - </ft:struct> + </ft:group> </ft:case> <ft:case id="row-action"> - <ft:struct id="row-action"> + <ft:group id="row-action"> <ft:new id="id-class"/> <ft:new id="label-class"/> - </ft:struct> + </ft:group> </ft:case> <ft:case id="submit"> - <ft:struct id="submit"> + <ft:group id="submit"> <ft:new id="id-class"/> <ft:new id="label-class"/> - </ft:struct> + </ft:group> </ft:case> <ft:case id="union"> - <ft:struct id="union"> + <ft:group id="union"> <ft:new id="id-class"/> <ft:new id="label-class"/> <ft:new id="widgets-class"/> - </ft:struct> + </ft:group> </ft:case> </ft:union> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/multipage_binding.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/multipage_binding.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/multipage_binding.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/multipage_binding.xml Thu Feb 24 09:02:09 2005 @@ -23,24 +23,24 @@ xmlns:fd="http://apache.org/cocoon/forms/1.0#definition" path="result"> - <fb:struct id="page1" path="."> + <fb:group id="page1" path="."> <fb:value id="email" path="email"/> <fb:value id="fourchars" path="fourchars"/> <fb:value id="birthdate" path="birthdate"> <fd:convertor datatype="date" type="formatting" style="short"/> </fb:value> - </fb:struct> + </fb:group> - <fb:struct id="page2" path="."> + <fb:group id="page2" path="."> <fb:value id="number1" path="number1"/> <fb:value id="number2" path="number2"/> <fb:value id="account" path="account"/> <fb:value id="cowheight" path="cowheight"/> - </fb:struct> + </fb:group> - <fb:struct id="page3" path="."> + <fb:group id="page3" path="."> <fb:value id="somebool" path="somebool"/> <fb:multi-value id="drinks" parent-path="drinks" row-path="drink"/> - </fb:struct> + </fb:group> </fb:context> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/multipage_model.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/multipage_model.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/multipage_model.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/multipage_model.xml Thu Feb 24 09:02:09 2005 @@ -24,7 +24,7 @@ <fd:widgets> - <fd:struct id="page1"> + <fd:group id="page1"> <fd:widgets> <fd:field id="email" required="true"> <fd:datatype base="string"/> @@ -77,7 +77,7 @@ </fd:validation> </fd:field> - <fd:action id="next" action-command="foo"> + <fd:action id="next"> <fd:label>Next</fd:label> <fd:on-action> <fd:javascript> @@ -90,9 +90,9 @@ </fd:on-action> </fd:action> </fd:widgets> - </fd:struct> + </fd:group> - <fd:struct id="page2" state="invisible"> + <fd:group id="page2" state="invisible"> <fd:widgets> <fd:field id="number1" required="true"> <fd:label>Please enter a number<br/> @@ -150,7 +150,7 @@ </fd:selection-list> </fd:field> - <fd:action id="prev" action-command="foo"> + <fd:action id="prev"> <fd:label>Previous</fd:label> <fd:on-action> <fd:javascript> @@ -161,7 +161,7 @@ </fd:javascript> </fd:on-action> </fd:action> - <fd:action id="next" action-command="foo"> + <fd:action id="next"> <fd:label>Next</fd:label> <fd:on-action> <fd:javascript> @@ -174,9 +174,9 @@ </fd:on-action> </fd:action> </fd:widgets> - </fd:struct> + </fd:group> - <fd:struct id="page3" state="invisible"> + <fd:group id="page3" state="invisible"> <fd:widgets> <fd:booleanfield id="somebool"> <fd:label>Put me <em>on</em> or <em>off</em>.</fd:label> @@ -198,7 +198,7 @@ </fd:selection-list> </fd:multivaluefield> - <fd:action id="prev" action-command="foo"> + <fd:action id="prev"> <fd:label>Previous</fd:label> <fd:on-action> <fd:javascript> @@ -210,11 +210,11 @@ </fd:on-action> </fd:action> - <fd:submit id="ok" action-command="foo"> + <fd:submit id="ok"> <fd:label>Finish</fd:label> </fd:submit> </fd:widgets> - </fd:struct> + </fd:group> </fd:widgets> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/multipage_template.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/multipage_template.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/multipage_template.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/multipage_template.xml Thu Feb 24 09:02:09 2005 @@ -29,7 +29,7 @@ <ft:form-template action="#{$cocoon/continuation/id}.continue" method="POST"> <div style="width: 70%; margin: 10px 50px 50px 50px;"> - <ft:struct id="page1"> + <ft:group id="page1"> <!-- group with automatic two-column layout --> <fi:group> <fi:label>String fields</fi:label> @@ -47,9 +47,9 @@ <br/> <ft:widget id="next"/> - </ft:struct> + </ft:group> - <ft:struct id="page2"> + <ft:group id="page2"> <fi:group> <fi:label>Number fields</fi:label> <fi:styling type="fieldset" layout="columns"/> @@ -68,9 +68,9 @@ <br/> <ft:widget id="prev"/> <ft:widget id="next"/> - </ft:struct> + </ft:group> - <ft:struct id="page3"> + <ft:group id="page3"> <fi:group> <fi:styling type="fieldset" layout="columns"/> <fi:label>Boolean fields</fi:label> @@ -85,7 +85,7 @@ <br/> <ft:widget id="prev"/> <ft:widget id="ok"/> - </ft:struct> + </ft:group> </div> </ft:form-template> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/tasktree.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/tasktree.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/tasktree.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/tasktree.xml Thu Feb 24 09:02:09 2005 @@ -35,7 +35,7 @@ <fd:new id="task-class"/> </fd:widgets> </fd:repeater> - <fd:repeater-action id="addsub" repeater="tasks" action-command="add-row"> + <fd:repeater-action id="addsub" repeater="tasks" command="add-row"> <fd:label>Add subtasks</fd:label> <fd:hint>Creates a task subtree</fd:hint> </fd:repeater-action> @@ -45,8 +45,8 @@ <!-- a task --> <fd:class id="task-class"> <fd:widgets> - <!-- FIXME: doesn't work if there's not an enclosing struct --> - <fd:struct id="task"> + <!-- FIXME: doesn't work if there's not an enclosing group --> + <fd:group id="task"> <fd:widgets> <fd:field id="title"> <fd:datatype base="string"/> @@ -59,16 +59,16 @@ </fd:field> <!-- these actions will act on the "tasks" repeater in which this class is inlined --> - <fd:row-action id="add" action-command="add-after"> + <fd:row-action id="add" command="add-after"> <fd:label>+</fd:label> </fd:row-action> - <fd:row-action id="up" action-command="move-up"> + <fd:row-action id="up" command="move-up"> <fd:label>^</fd:label> </fd:row-action> - <fd:row-action id="down" action-command="move-down"> + <fd:row-action id="down" command="move-down"> <fd:label>v</fd:label> </fd:row-action> - <fd:row-action id="delete" action-command="delete"> + <fd:row-action id="delete" command="delete"> <fd:label>X</fd:label> </fd:row-action> @@ -76,7 +76,7 @@ <fd:new id="tasklist-class"/> </fd:widgets> - </fd:struct> + </fd:group> </fd:widgets> </fd:class> @@ -88,7 +88,7 @@ <!-- the top-level tasks --> <fd:new id="tasklist-class"/> - <fd:submit id="ok" action-command="foo"> + <fd:submit id="ok"> <fd:label>OK</fd:label> </fd:submit> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/tasktree_binding.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/tasktree_binding.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/tasktree_binding.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/tasktree_binding.xml Thu Feb 24 09:02:09 2005 @@ -31,7 +31,7 @@ </fb:class> <fb:class id="task-class"> - <fb:struct id="task" path="."> + <fb:group id="task" path="."> <fb:value id="title" path="title"/> <fb:value id="start" path="@start"> <fd:convertor datatype="date" type="formatting" style="short"/> @@ -40,7 +40,7 @@ <fd:convertor datatype="date" type="formatting" style="short"/> </fb:value> <fb:new id="tasklist-class"/> - </fb:struct> + </fb:group> </fb:class> <fb:value id="name" path="name"/> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/tasktree_template.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/tasktree_template.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/tasktree_template.xml (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/forms/tasktree_template.xml Thu Feb 24 09:02:09 2005 @@ -69,7 +69,7 @@ <ft:class id="task-class"> <div class="section"> - <ft:struct id="task"> + <ft:group id="task"> <span class="actions"> <ft:widget id="down"><fi:styling type="image" src="resources/img/move_down.gif"/></ft:widget> <ft:widget id="up"><fi:styling type="image" src="resources/img/move_up.gif"/></ft:widget> @@ -83,7 +83,7 @@ <!-- Recurse --> <ft:new id="tasklist-class"/> - </ft:struct> + </ft:group> </div> </ft:class> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/resources/forms-field-styling.xsl URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/resources/forms-field-styling.xsl?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/resources/forms-field-styling.xsl (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/resources/forms-field-styling.xsl Thu Feb 24 09:02:09 2005 @@ -55,6 +55,13 @@ </xsl:template> <!--+ + | Field in "output" state: display its value + +--> + <xsl:template match="fi:[EMAIL PROTECTED]'output']" priority="3"> + <xsl:value-of select="fi:value/node()"/> + </xsl:template> + + <!--+ | Common stuff like fi:validation-message, @required. +--> <xsl:template match="fi:*" mode="common"> @@ -299,17 +306,15 @@ </xsl:template> <!--+ - | fi:booleanfield with @type 'output' : rendered as text + | fi:booleanfield with @state 'output': rendered as an inactive checkbox (this doesn't + | use text but avoids i18n problems related to hardcoding 'yes'/'no' or 'true'/'false' +--> - <xsl:template match="fi:booleanfield[fi:styling/@type='output']"> - <xsl:choose> - <xsl:when test="fi:value = 'true'"> - yes - </xsl:when> - <xsl:otherwise> - no - </xsl:otherwise> - </xsl:choose> + <xsl:template match="fi:[EMAIL PROTECTED]'output' or fi:styling/@type='output']" priority="3"> + <input type="checkbox" title="{fi:hint}" disabled="disabled"> + <xsl:if test="fi:value = 'true'"> + <xsl:attribute name="checked">checked</xsl:attribute> + </xsl:if> + </input> </xsl:template> <!--+ @@ -394,6 +399,19 @@ </xsl:template> <!--+ + | fi:multivaluefield in 'output' state + +--> + <xsl:template match="fi:[EMAIL PROTECTED]'output']" priority="3"> + <xsl:variable name="values" select="fi:values/fi:value/text()"/> + <xsl:for-each select="fi:selection-list/fi:item"> + <xsl:variable name="value" select="@value"/> + <xsl:if test="$values[. = $value]"> + <xsl:value-of select="fi:label/node()"/> + </xsl:if> + </xsl:for-each> + </xsl:template> + + <!--+ | fi:upload +--> <xsl:template match="fi:upload"> @@ -414,6 +432,13 @@ </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="." mode="common"/> + </xsl:template> + + <!--+ + | fi:upload, output state + +--> + <xsl:template match="fi:[EMAIL PROTECTED]'output']" priority="3"> + <xsl:copy-of select="fi:value/node()"/> </xsl:template> <!--+ Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/sitemap.xmap URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/sitemap.xmap?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/sitemap.xmap (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/forms/samples/sitemap.xmap Thu Feb 24 09:02:09 2005 @@ -153,12 +153,21 @@ </map:call> </map:match> + <!-- Start a flowscript scenario --> <map:match pattern="do-*.flow"> <map:call function="do_{1}"/> </map:match> + <!-- Continue a scenario. The continuation id is passed in the URL + (typically used for GET requests) --> <map:match pattern="*.continue"> <map:call continuation="{1}"/> + </map:match> + + <!-- Continue a scenario. The continuation id is passed as a request + parameter (typically used for POST request) --> + <map:match pattern="continue"> + <map:call continuation="{request-param:continuation-id}"/> </map:match> <!-- Modified: cocoon/branches/BRANCH_2_1_X/status.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?view=diff&r1=155209&r2=155210 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/status.xml (original) +++ cocoon/branches/BRANCH_2_1_X/status.xml Thu Feb 24 09:02:09 2005 @@ -202,6 +202,52 @@ <changes> <release version="@version@" date="@date@"> + <action dev="SW" type="add"> + Many changes in CForms block. + <br/> + Widgets: + <ul> + <li>add <code>Widget.getDefinition()</code> to access the definition that was used to create the widget.</li> + <li>make widget definitions immutable once setup. This is necessary with the previous change as a definition + is shared by all of the widgets it creates and modifying it could lead to weird behaviors.</li> + <li>new "output" widget state, where values are displayed but not read on the request. The difference with + "disabled" is that "output" widgets are displayed as plain text and not as disabled inputs.</li> + <li>add <code>on-create</code> event listeners that are called when a widget is created.</li> + <li>deprecate "struct" in favor of "group" in definition, template and binding. More work is needed on the + relation between ft:group and fi:group provided by forms-page-styling.xsl</li> + </ul> + <br/> + Field: + <ul> + <li>a field's selection list can be removed by setting it to null. This previously re-installed the widget + definition's selection list.</li> + <li>a field can have an optional initial value defined using <initial-value locale="...">...</initial-value>. + The "locale" attribute is used to convert the value text into an object as defined by the datatype's convertor. + This feature is also available on AggregateField and BooleanField (for which locale is useless).</li> + </ul> + <br/> + Form.js : + <ul> + <li>added "fun" and "ttl" parameters to <code>Form.showForm()</code>, which now has the exact + same parameters as cocoon.sendPageAndWait().</li> + <li>the argument of <code>new Form(...)</code> can now be either a String or a DOM Element. + Accepting an Element allows the use of any kind of dynamic process to build the form + definition.</li> + <li><code>Form.showForm()</code> now uses a single continuation, which saves memory and speeds + up processing by shortening the continuation chain when the user has a long interaction + with the form.</li> + </ul> + <br/> + Actions: + <ul> + <li>the "action-command" attribute is deprecated and replaced by "command" which is now optional, except on + repeater-action and row-action where it indicates what to do.</li> + <li>new "insert-rows" repeater-action that insert new rows before the selected rows in a repeater</li> + </ul> + <br/> + Styling: styling "output" is deprecated and will be removed in 2.1.8. The "output" widget state should be + used instead. + </action> <action dev="TC" type="add" fixes-bug="30417"> Added best-fit-while-keeping-aspect-ratio option to the ImageReader </action>