You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by st...@outerthought.org on 2004/02/09 19:00:04 UTC

[WIKI-UPDATE] Woody WoodyScratchpad Mon Feb 9 19:00:03 2004

Page: http://wiki.cocoondev.org/Wiki.jsp?page=Woody , version: 29 on Mon Feb  9 17:51:55 2004 by 217.112.237.100

+ * [Scratchpad|WoodyScratchpad] - some notes on ongoing work.


Page: http://wiki.cocoondev.org/Wiki.jsp?page=WoodyScratchpad , version: 1 on Mon Feb  9 17:55:13 2004 by 217.112.237.100

New page created:
+ Various notes about some ongoing thoughts.
+ 
+ !!! Types -- id/defines/extends
+ 
+ Just create a widget:
+ {{{
+   <wd:field id="field-a">
+     <!-- validation, etc. -->
+   </wd:field>
+ }}}
+ 
+ Just create a type:
+ {{{
+   <wd:field defines="typeD">
+     <!-- validation, etc. -->
+   </wd:field>
+ }}}
+ 
+ Create a widget extending a type:
+ {{{
+   <wd:field id="field-b" extends="type-1">
+     <!-- validation, etc. -->
+   </wd:field>
+ }}}
+ 
+ Create a new type extending an existing type:
+ {{{
+   <wd:field defines="type-2" extends="type-1">
+     <!-- validation, etc. -->
+   </wd:field>
+ }}}
+ 
+ Create a new type extending an existing type while also creating a widget based on this new type:
+ {{{
+   <wd:field id="field-b" defines="type-3" extends="type-1">
+     <!-- validation, etc. -->
+   </wd:field>
+ }}}
+ 
+ !!! Repository -- wd:import/wd:widget
+ 
+ The type defining, extending, and instanciating facilities above could enhanced to also allow pre-made types to be imported into a form from a repository.
+ 
+ The imported types could be extended and instanciated by the same syntax and semantics as for locally defined types within a form.
+ 
+ To make use of the facilities available in Cocoon, an import statement could reference a Source via its URI to make available the set of types it contains.
+ 
+ The import statement could also supply a prefix that could be used when extending an imported type to prevent ambiguity when several imports supply different types that happen to have the same names.
+ 
+ 
+ !!! Conditional -- choice/case
+ 
+ Note: The "expr" can only be an attribute on either the wd:choice or the wd:case's, but not both.
+ 
+ {{{
+ <wd:choice expr="some-expression">
+ 
+   <!-- Place list of widget definitions here -->
+ 
+   <!-- One or more cases -->
+   <wd:case id="some-case-id" expr="some-expression">
+     <!-- list of inline widget definitions and/or references to the widgets defined above -->
+   </wd:case>
+   <!-- Optionally, a default case can be given like this: -->
+   <wd:case id="case-3" expr="true">
+     <!-- list of inline widget definitions and/or references to the widgets defined above -->
+   </wd:case>
+ </wd:choice>
+ 
+ <wd:choice expr="some-expression">
+   <wd:field id="field-A".../>
+   <wd:repeater id="repeater-B" .../>
+   <wd:case id="case-0" expr="case-1-expression">
+     <wd:ref id="field-A"/>
+   </wd:case>
+   <wd:case id="case-1" expr="case-1-expression">
+     <wd:ref id="field-A"/>
+     <wd:ref id="repeater-A"/>
+   </wd:case>
+   <wd:case id="case-2" expr="case-2-expression">
+     <wd:booleanfield id="bool-C".../>
+   </wd:case>
+   <wd:case id="case-3" expr="true">
+     <wd:ref id="field-A"/>
+     <wd:field id="field-B".../>
+   </wd:case>
+ </wd:choice>
+ }}}
+