tim 2003/12/19 13:28:40
Modified: src/blocks/woody/java/org/apache/cocoon/woody/formmodel AbstractWidget.java AbstractWidgetDefinition.java AbstractWidgetDefinitionBuilder.java Action.java ActionDefinitionBuilder.java AggregateField.java AggregateFieldDefinitionBuilder.java BooleanField.java BooleanFieldDefinitionBuilder.java Field.java FieldDefinitionBuilder.java Form.java FormDefinitionBuilder.java Messages.java MessagesDefinitionBuilder.java MultiValueField.java MultiValueFieldDefinitionBuilder.java Output.java OutputDefinitionBuilder.java Repeater.java RepeaterActionDefinitionBuilder.java RepeaterDefinitionBuilder.java RowActionDefinitionBuilder.java Submit.java Upload.java UploadDefinitionBuilder.java Widget.java WidgetDefinition.java Log: Add getLocation to widgets and to widget definitions to be able to recall the source location. Discussion at: http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107166304223950&w=2 Revision Changes Path 1.6 +15 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AbstractWidget.java Index: AbstractWidget.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AbstractWidget.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- AbstractWidget.java 19 Dec 2003 20:36:48 -0000 1.5 +++ AbstractWidget.java 19 Dec 2003 21:28:39 -0000 1.6 @@ -57,8 +57,23 @@ * common to many widgets. */ public abstract class AbstractWidget implements Widget { + private String location = null; private Widget parent; private Form form; + + /** + * Sets the source location of this widget. + */ + protected void setLocation(String location) { + this.location = location; + } + + /** + * Gets the source location of this widget. + */ + public String getLocation() { + return this.location; + } public Widget getParent() { return parent; 1.4 +9 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AbstractWidgetDefinition.java Index: AbstractWidgetDefinition.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AbstractWidgetDefinition.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AbstractWidgetDefinition.java 13 Nov 2003 13:19:09 -0000 1.3 +++ AbstractWidgetDefinition.java 19 Dec 2003 21:28:39 -0000 1.4 @@ -62,8 +62,17 @@ * Provides functionality that is common across many WidgetDefinition implementations. */ public abstract class AbstractWidgetDefinition implements WidgetDefinition { + private String location = null; private String id; private Map displayData; + + protected void setLocation(String location) { + this.location = location; + } + + public String getLocation() { + return location; + } public String getId() { return id; 1.8 +4 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AbstractWidgetDefinitionBuilder.java Index: AbstractWidgetDefinitionBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AbstractWidgetDefinitionBuilder.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- AbstractWidgetDefinitionBuilder.java 13 Nov 2003 13:19:09 -0000 1.7 +++ AbstractWidgetDefinitionBuilder.java 19 Dec 2003 21:28:39 -0000 1.8 @@ -90,6 +90,10 @@ expressionManager = (ExpressionManager)serviceManager.lookup(ExpressionManager.ROLE); } + protected void setLocation(Element widgetElement, AbstractWidgetDefinition widgetDefinition) { + widgetDefinition.setLocation(DomHelper.getLocation(widgetElement)); + } + protected void setId(Element widgetElement, AbstractWidgetDefinition widgetDefinition) throws Exception { String id = DomHelper.getAttribute(widgetElement, "id"); if (id.length() < 1) 1.7 +1 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Action.java Index: Action.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Action.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Action.java 5 Nov 2003 09:24:14 -0000 1.6 +++ Action.java 19 Dec 2003 21:28:39 -0000 1.7 @@ -75,6 +75,7 @@ public Action(ActionDefinition definition) { this.definition = definition; + setLocation(definition.getLocation()); } public String getId() { 1.5 +1 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/ActionDefinitionBuilder.java Index: ActionDefinitionBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/ActionDefinitionBuilder.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ActionDefinitionBuilder.java 24 Oct 2003 14:13:49 -0000 1.4 +++ ActionDefinitionBuilder.java 19 Dec 2003 21:28:39 -0000 1.5 @@ -62,6 +62,7 @@ public class ActionDefinitionBuilder extends AbstractWidgetDefinitionBuilder { public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { ActionDefinition actionDefinition = createDefinition(); + setLocation(widgetElement, actionDefinition); setId(widgetElement, actionDefinition); setDisplayData(widgetElement, actionDefinition); 1.12 +1 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AggregateField.java Index: AggregateField.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AggregateField.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- AggregateField.java 13 Nov 2003 13:15:41 -0000 1.11 +++ AggregateField.java 19 Dec 2003 21:28:39 -0000 1.12 @@ -94,6 +94,7 @@ protected AggregateField(AggregateFieldDefinition definition) { this.definition = definition; + setLocation(definition.getLocation()); } protected void addField(Field field) { 1.6 +1 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AggregateFieldDefinitionBuilder.java Index: AggregateFieldDefinitionBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/AggregateFieldDefinitionBuilder.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- AggregateFieldDefinitionBuilder.java 13 Nov 2003 13:19:09 -0000 1.5 +++ AggregateFieldDefinitionBuilder.java 19 Dec 2003 21:28:39 -0000 1.6 @@ -68,6 +68,7 @@ public class AggregateFieldDefinitionBuilder extends AbstractWidgetDefinitionBuilder { public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { AggregateFieldDefinition definition = new AggregateFieldDefinition(); + setLocation(widgetElement, definition); setId(widgetElement, definition); setDisplayData(widgetElement, definition); 1.8 +1 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/BooleanField.java Index: BooleanField.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/BooleanField.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- BooleanField.java 6 Nov 2003 13:23:47 -0000 1.7 +++ BooleanField.java 19 Dec 2003 21:28:39 -0000 1.8 @@ -79,6 +79,7 @@ public BooleanField(BooleanFieldDefinition definition) { this.definition = definition; + setLocation(definition.getLocation()); } public String getId() { 1.5 +1 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/BooleanFieldDefinitionBuilder.java Index: BooleanFieldDefinitionBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/BooleanFieldDefinitionBuilder.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- BooleanFieldDefinitionBuilder.java 24 Oct 2003 14:13:49 -0000 1.4 +++ BooleanFieldDefinitionBuilder.java 19 Dec 2003 21:28:39 -0000 1.5 @@ -61,6 +61,7 @@ public class BooleanFieldDefinitionBuilder extends AbstractWidgetDefinitionBuilder { public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { BooleanFieldDefinition definition = new BooleanFieldDefinition(); + setLocation(widgetElement, definition); setId(widgetElement, definition); setDisplayData(widgetElement, definition); 1.19 +2 -1 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Field.java Index: Field.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Field.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- Field.java 27 Nov 2003 02:14:08 -0000 1.18 +++ Field.java 19 Dec 2003 21:28:39 -0000 1.19 @@ -96,6 +96,7 @@ public Field(FieldDefinition fieldDefinition) { this.definition = fieldDefinition; + setLocation(fieldDefinition.getLocation()); } public FieldDefinition getFieldDefinition() { 1.6 +1 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/FieldDefinitionBuilder.java Index: FieldDefinitionBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/FieldDefinitionBuilder.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- FieldDefinitionBuilder.java 24 Oct 2003 14:13:49 -0000 1.5 +++ FieldDefinitionBuilder.java 19 Dec 2003 21:28:39 -0000 1.6 @@ -65,6 +65,7 @@ public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { FieldDefinition fieldDefinition = new FieldDefinition(); + setLocation(widgetElement, fieldDefinition); setId(widgetElement, fieldDefinition); Element datatypeElement = DomHelper.getChildElement(widgetElement, Constants.WD_NS, "datatype"); 1.11 +2 -1 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Form.java Index: Form.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Form.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Form.java 31 Oct 2003 12:26:06 -0000 1.10 +++ Form.java 19 Dec 2003 21:28:39 -0000 1.11 @@ -97,6 +97,7 @@ widgets = new ArrayList(); widgetsById = new HashMap(); this.definition = definition; + setLocation(definition.getLocation()); } protected void addWidget(Widget widget) { 1.5 +1 -1 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/FormDefinitionBuilder.java Index: FormDefinitionBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/FormDefinitionBuilder.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- FormDefinitionBuilder.java 1 Nov 2003 20:08:18 -0000 1.4 +++ FormDefinitionBuilder.java 19 Dec 2003 21:28:39 -0000 1.5 @@ -61,7 +61,7 @@ public WidgetDefinition buildWidgetDefinition(Element formElement) throws Exception { FormDefinition formDefinition = new FormDefinition(); - + setLocation(formElement, formDefinition); formDefinition.setId(""); setDisplayData(formElement, formDefinition); 1.2 +1 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Messages.java Index: Messages.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Messages.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Messages.java 14 Nov 2003 09:44:40 -0000 1.1 +++ Messages.java 19 Dec 2003 21:28:39 -0000 1.2 @@ -77,6 +77,7 @@ protected Messages(MessagesDefinition definition) { this.definition = definition; + setLocation(definition.getLocation()); } public String getId() { 1.2 +1 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/MessagesDefinitionBuilder.java Index: MessagesDefinitionBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/MessagesDefinitionBuilder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MessagesDefinitionBuilder.java 14 Nov 2003 09:44:40 -0000 1.1 +++ MessagesDefinitionBuilder.java 19 Dec 2003 21:28:39 -0000 1.2 @@ -58,6 +58,7 @@ public class MessagesDefinitionBuilder extends AbstractWidgetDefinitionBuilder { public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { MessagesDefinition messagesDefinition = new MessagesDefinition(); + setLocation(widgetElement, messagesDefinition); setId(widgetElement, messagesDefinition); setDisplayData(widgetElement, messagesDefinition); return messagesDefinition; 1.12 +1 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/MultiValueField.java Index: MultiValueField.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/MultiValueField.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- MultiValueField.java 12 Dec 2003 05:39:38 -0000 1.11 +++ MultiValueField.java 19 Dec 2003 21:28:39 -0000 1.12 @@ -87,6 +87,7 @@ public MultiValueField(MultiValueFieldDefinition definition) { this.definition = definition; + setLocation(definition.getLocation()); } public String getId() { 1.6 +1 -1 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/MultiValueFieldDefinitionBuilder.java Index: MultiValueFieldDefinitionBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/MultiValueFieldDefinitionBuilder.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- MultiValueFieldDefinitionBuilder.java 24 Oct 2003 14:13:49 -0000 1.5 +++ MultiValueFieldDefinitionBuilder.java 19 Dec 2003 21:28:39 -0000 1.6 @@ -64,7 +64,7 @@ public class MultiValueFieldDefinitionBuilder extends AbstractDatatypeWidgetDefinitionBuilder { public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { MultiValueFieldDefinition definition = new MultiValueFieldDefinition(); - + setLocation(widgetElement, definition); setId(widgetElement, definition); setDisplayData(widgetElement, definition); 1.4 +1 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Output.java Index: Output.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Output.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Output.java 24 Oct 2003 22:49:08 -0000 1.3 +++ Output.java 19 Dec 2003 21:28:39 -0000 1.4 @@ -21,6 +21,7 @@ protected Output(OutputDefinition definition) { this.definition = definition; + setLocation(definition.getLocation()); } public String getId() { 1.3 +1 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/OutputDefinitionBuilder.java Index: OutputDefinitionBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/OutputDefinitionBuilder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- OutputDefinitionBuilder.java 24 Oct 2003 14:13:49 -0000 1.2 +++ OutputDefinitionBuilder.java 19 Dec 2003 21:28:39 -0000 1.3 @@ -11,6 +11,7 @@ public class OutputDefinitionBuilder extends AbstractDatatypeWidgetDefinitionBuilder { public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { OutputDefinition definition = new OutputDefinition(); + setLocation(widgetElement, definition); setId(widgetElement, definition); Element datatypeElement = DomHelper.getChildElement(widgetElement, Constants.WD_NS, "datatype"); 1.14 +5 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Repeater.java Index: Repeater.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Repeater.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Repeater.java 3 Nov 2003 23:01:41 -0000 1.13 +++ Repeater.java 19 Dec 2003 21:28:39 -0000 1.14 @@ -76,6 +76,7 @@ public Repeater(RepeaterDefinition repeaterDefinition) { this.definition = repeaterDefinition; + setLocation(definition.getLocation()); // setup initial size removeRows(); } @@ -318,6 +319,10 @@ widgets.add(widget); widgetsById.put(widget.getId(), widget); } + } + + public String getLocation() { + return Repeater.this.getLocation(); } public String getId() { 1.4 +2 -1 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/RepeaterActionDefinitionBuilder.java Index: RepeaterActionDefinitionBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/RepeaterActionDefinitionBuilder.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- RepeaterActionDefinitionBuilder.java 24 Oct 2003 14:13:49 -0000 1.3 +++ RepeaterActionDefinitionBuilder.java 19 Dec 2003 21:28:39 -0000 1.4 @@ -78,6 +78,7 @@ public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { String actionCommand = DomHelper.getAttribute(widgetElement, "action-command"); RepeaterActionDefinition definition = createDefinition(widgetElement, actionCommand); + setLocation(widgetElement, definition); setId(widgetElement, definition); setDisplayData(widgetElement, definition); 1.6 +1 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/RepeaterDefinitionBuilder.java Index: RepeaterDefinitionBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/RepeaterDefinitionBuilder.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- RepeaterDefinitionBuilder.java 3 Nov 2003 17:05:32 -0000 1.5 +++ RepeaterDefinitionBuilder.java 19 Dec 2003 21:28:39 -0000 1.6 @@ -64,6 +64,7 @@ int initialSize = DomHelper.getAttributeAsInteger(repeaterElement, "initial-size", 0); RepeaterDefinition repeaterDefinition = new RepeaterDefinition(initialSize); + setLocation(repeaterElement, repeaterDefinition); setId(repeaterElement, repeaterDefinition); setDisplayData(repeaterElement, repeaterDefinition); 1.2 +2 -1 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/RowActionDefinitionBuilder.java Index: RowActionDefinitionBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/RowActionDefinitionBuilder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- RowActionDefinitionBuilder.java 3 Nov 2003 17:05:32 -0000 1.1 +++ RowActionDefinitionBuilder.java 19 Dec 2003 21:28:39 -0000 1.2 @@ -67,6 +67,7 @@ public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { String actionCommand = DomHelper.getAttribute(widgetElement, "action-command"); RowActionDefinition definition = createDefinition(widgetElement, actionCommand); + setLocation(widgetElement, definition); setId(widgetElement, definition); setDisplayData(widgetElement, definition); 1.3 +2 -1 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Submit.java Index: Submit.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Submit.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Submit.java 9 Oct 2003 09:12:06 -0000 1.2 +++ Submit.java 19 Dec 2003 21:28:39 -0000 1.3 @@ -63,6 +63,7 @@ public Submit(ActionDefinition definition, boolean validateForm) { super(definition); + setLocation(definition.getLocation()); this.validateForm = validateForm; } 1.2 +2 -1 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Upload.java Index: Upload.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Upload.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Upload.java 13 Nov 2003 14:57:05 -0000 1.1 +++ Upload.java 19 Dec 2003 21:28:39 -0000 1.2 @@ -77,6 +77,7 @@ public Upload(UploadDefinition uploadDefinition) { this.definition = uploadDefinition; + setLocation(uploadDefinition.getLocation()); } public UploadDefinition getUploadDefinition() { 1.2 +2 -1 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/UploadDefinitionBuilder.java Index: UploadDefinitionBuilder.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/UploadDefinitionBuilder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- UploadDefinitionBuilder.java 13 Nov 2003 14:57:05 -0000 1.1 +++ UploadDefinitionBuilder.java 19 Dec 2003 21:28:39 -0000 1.2 @@ -67,6 +67,7 @@ boolean required = DomHelper.getAttributeAsBoolean(widgetElement, "required", false); UploadDefinition uploadDefinition = new UploadDefinition(required, mimeTypes); + setLocation(widgetElement, uploadDefinition); setId(widgetElement, uploadDefinition); setDisplayData(widgetElement, uploadDefinition); 1.6 +6 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Widget.java Index: Widget.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/Widget.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Widget.java 24 Sep 2003 20:47:06 -0000 1.5 +++ Widget.java 19 Dec 2003 21:28:39 -0000 1.6 @@ -90,6 +90,12 @@ * classes and objects in Java. */ public interface Widget { + + /** + * Gets the source location of this widget. + */ + public String getLocation(); + /** * Returns the id of this widget. */ 1.2 +13 -0 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/WidgetDefinition.java Index: WidgetDefinition.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/formmodel/WidgetDefinition.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- WidgetDefinition.java 22 Apr 2003 12:04:19 -0000 1.1 +++ WidgetDefinition.java 19 Dec 2003 21:28:39 -0000 1.2 @@ -60,7 +60,20 @@ * the Widget's themselves. */ public interface WidgetDefinition { + + /** + * Gets source location of this widget definition. + */ + public String getLocation(); + + /** + * Gets id of this widget definition. + */ public String getId(); + + /** + * Creates and returns a widget based on this widget definition. + */ public Widget createInstance(); /**