cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@outerthought.org
Subject [WIKI-UPDATE] TimLarson Thu Nov 20 22:00:03 2003
Date Thu, 20 Nov 2003 21:00:03 GMT
Page: http://wiki.cocoondev.org/Wiki.jsp?page=TimLarson , version: 3 on Thu Nov 20 21:05:40
2003 by TimLarson

+ ----
+ !!!Presenting four new Woody form widgets:
+ !!!Class, New, Struct, and Union
+ 
+ !!Preface
+ 
+ All aspects of this implementation are open for discussion and change.
+ While the features are definitely needed, the way it is coded, the names that
+ were chosen, etc. can all be changed as we decide as a community.
+ Please consider this as seed code that we can all grow in the way we see fit.
+ 
+ 
+ !!Quick summary
+ 
+ Combined use of the following four widgets allow for the creation of dynamic, recursive
+ GUI's and editors for structured content of any nesting level.  See "TODO" below for
+ current limitations in this implementation.  When finished, we should be able to use
+ woody/ cforms to create and edit sitemaps, form definitions and templates, xreporter
+ reports, etc.
+ 
+ !Class
+ Allows specification of a collection reusable widget definitions or
+ reusable templates and/or markup.
+ 
+ !New
+ Inserts the widgets or templates and/or markup from the referenced class.
+ 
+ !Struct
+ Generic container for widgets, allows multiple uses of a group of widget
+ names in a form by wrapping them with a namespace (the name of the Struct widget).
+ 
+ !Union
+ Discriminated union that holds one of several possible widgets at any one time.
+ 
+ 
+ !!Detailed descriptions:
+ 
+ !Class
+ Specify a set of widget definitions or templates and/or markup for reuse.
+ The same concept is implemented in the form definition for
+ widget reuse, and in the form template for template and/or markup reuse.
+ 
+ Definition syntax:
+ {{{
+   <!-- Only allowed as a direct child widget of wd:form -->
+   <!-- Note that the definition class id's currently form a flat namespace -->
+   <wd:class id="some-class">
+     <wd:widgets>
+       <!-- A list of any widget(s), such as wd:field, wd:new, wd:struct, wd:union -->
+     </wd:widgets>
+   </wd:class>
+ }}}
+ Template syntax:
+ {{{
+   <!-- Inside the wd:form template, allowed anywhere other templates are allowed -->
+   <!-- Note that the template class id's currently form a flat namespace -->
+   <wt:class id="some-class">
+     <!-- A list of templates and/or markup -->
+   </wd:class>
+ }}}
+ 
+ !New
+ Insert the widgets or templates and/or markup from the referenced class.
+ 
+ Definition syntax:
+ {{{
+   <!-- Inserts the widgets from the referenced class here -->
+   <wd:new id="some-class"/>
+ }}}
+ Template syntax:
+ {{{
+   <!-- Inserts the templates and markup from the referenced class here -->
+   <wd:new id="some-class"/>
+ }}}
+ 
+ !Struct
+ Generic container for widgets.
+ Useful to hold multiple widgets in a union case, and anywhere
+ there is a need to wrap a collection of widgets in a namespace.
+ 
+ Definition syntax:
+ {{{
+   <wd:struct id="some-struct">
+     <wd:widgets>
+       <!-- A list of any widget(s), such as wd:field, wd:new, wd:struct, wd:union -->
+     </wd:widgets>
+   </wd:struct>
+ }}}
+ Template syntax:
+ {{{
+   <wt:struct id="some-struct">
+     <!-- A list of any relevant templates, possibly mixed with markup -->
+   </wt:struct>
+ }}}
+ 
+ !Union
+ Discriminated union
+ Each direct child widget is considered a union case.  The widgets are only
+ created when their case is selected (lazy construction), but their values
+ continue to exist after switching to another case, to allow for case-switching
+ validation, value copying between cases, and automatic support for remembering
+ values on a switch back to a previously selected case.
+ A container widget (Repeater, Struct, Union, or sort-of AggregateField)
+ must be used for union cases that need to hold multiple widgets.
+ 
+ Definition syntax:
+ {{{
+   <wd:union id="some-union" required="true/false" default="some-case">
+     <!-- same elements allowed as for wd:field -->
+     <wd:widgets>
+       <!-- A list of any widget(s), such as wd:field, wd:new, wd:struct, wd:union -->
+     </wd:widgets>
+   </wd:union>
+ }}}
+ Template syntax:
+ {{{
+   <!-- Union discriminant -->
+   <wt:widget id="some-union">
+     <!-- same elements allowed as for any other wt:widget template -->
+   </wt:widget>
+ 
+   <!-- Union cases -->
+   <!-- (only the contents of the current case, and any markup outside of the cases, will
be output -->
+   <wt:union>
+ 
+     <!-- A list of union cases, possibly mixed with markup -->
+ 
+     <!-- No-widget case -->
+     <wt:case id="">
+       <!-- Any markup -->
+     </wt:case>
+ 
+     <wt:case id="some-case">
+       <!-- A list of any relevant templates, possibly mixed with markup -->
+     </wt:case>
+ 
+   </wt:union>
+ }}}
+ 
+ !TODO:
+ *Fix issues with nested Repeater's:
+ **Double, quadrupple, etc. row creation.
+ **Forgetting values on Union case switch.
+ *Finish "Form GUI" sample:
+ **Setup binding to create and edit forms.
+ **Add the rest of the widgets and options.
+ **Add display of form as it is created, possibly in some sort of a frame.
+ **Replace the XSP success page with a JX page.
+ *Create a "Template GUI" sample.
+ *Automatic selection list generation for union.
+ *Add test to NewDefinition.resolve for union defaults that would case a non-terminating
recursion.
+ *Make the non-terminating recursion detection more efficient.
+ *Verify the most useful and correct source code locations are given in exceptions.
+ *Augment the EffectTransformer/WoodyTemplateTransformer exceptions with source code location
information.
+ *Figure out what wi:* element we want to generate for wt:struct and wt:union.
+ *Make remaining exceptions use I18n catalogue.
+ *Reduce object turnover in EffectTransformer and WoodyTemplateTransformer. (Should be pretty
simple; replace some of the instances of out.copy() with a version out.startElement() or out.endElement()
that does not create objects on the element stack, etc.)
+ *Extend binding to handle the new widgets.
+ *Add more support to style the new widgets.
+ *Consider whether widget definition classes and template and/or markup
+ *classes should stay in flat namespaces or allow nesting class definitions. (Note that class
instances (wd:new, wt:new) can already nest.)
+ *Find hotspots in the code to optimize.  Currently gets very slow at about seven nesting
levels.
+ *Improve the javadocs.
+ *Write lots of test cases.
+ *And hopefully much more...
+ 



Mime
View raw message