cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@outerthought.org
Subject [WIKI-UPDATE] CMS WoodySample Sat Nov 1 14:00:04 2003
Date Sat, 01 Nov 2003 13:00:04 GMT
Page: http://wiki.cocoondev.org/Wiki.jsp?page=CMS , version: 10 on Sat Nov  1 12:33:38 2003
by 195.186.162.114



Page: http://wiki.cocoondev.org/Wiki.jsp?page=WoodySample , version: 16 on Sat Nov  1 12:22:24
2003 by BrunoDumon

- Create forms with woody is very easy, just follow this 3 steps:
?      ^

+ Creating forms with woody is very easy, just follow this 3 steps:
?      ^^^

- If we wouldn't make this datatype and selection list associations, we would need to create
specific widgets for each possible combination: StringField, LongField, DateField, StringSelectionList,
LongSelectionList, ...
?                       ^

+ If we wouldn't make these datatype and selection list associations, we would need to create
specific widgets for each possible combination: StringField, LongField, DateField, StringSelectionList,
LongSelectionList, ...
?                       ^ +

-   <map:transform src="xsl/html/woody-default.xsl"/>
+   <map:transform src="resources/woody-samples-styling.xsl"/>
- <html xmlns:wt="http://apache.org/cocoon/woody/template/1.0">
?                                                             -

+ <html xmlns:wt="http://apache.org/cocoon/woody/template/1.0"
+   xmlns:wi="http://apache.org/cocoon/woody/instance/1.0">
-       <wt:widget id="password"/>
?                               -

+       <wt:widget id="password">
+         <wi:styling type="password"/>
+       </wt:widget>
-       <wt:widget id="confirmPassword"/>
?                                      -

+       <wt:widget id="confirmPassword">
+         <wi:styling type="password"/>
+       </wt:widget>
- The XML representation of the widget will then be translated to HTML by an XSLT stylesheet
(woody-default.xsl in our case). This XSLT only has to handle individual widgets, and not
the page as a whole, and is thus not specific for one form but can be reused across forms.
This stylesheet is provided just for the example, you can make your own stylesheet if you
need.
?                                                                                        
          ^ ^^^ ^                                                                        
                                                                                         
   ------------------------------------------------------------------------------------------------

+ The XML representation of the widget will then be translated to HTML by an XSLT stylesheet
(woody-samples-styling.xsl in our case). This XSLT only has to handle individual widgets,
and not the page as a whole, and is thus not specific for one form but can be reused across
forms.
?                                                                                        
          ^^^^^ ^^^^^ ^^^

- For certain widgets it may be necessary to provide extra presentation hints, such as the
width of a text box, the style of a selection list (drop down, radio buttons, ...) or class
and style attribute values.  This can be done by putting extra elements inside the <wt:widget>
element. Currently there's not much implemented yet, but what's available will be documented
in a reference section.
+ For certain widgets it may be necessary to provide extra presentation hints, such as the
width of a text box, the style of a selection list (drop down, radio buttons, ...) or class
and style attribute values.  This can be done by putting a wi:styling element inside the wt:widget
element. This element is in the wi namespace because it will be copied literally. The attributes
and/or content of the wi:styling element depend on what is supported by the particular stylesheet
used. [[docs on what the included Woody stylesheets support yet to come]
- As an alternative to the template approach, you could also use the WoodyGenerator, which
will generate an XML representation of the whole form, and style that with a custom-written
XSLT.
+ As an alternative to the template approach, you could also use the WoodyGenerator, which
will generate an XML representation of the whole form, and style that with a custom-written
XSLT. Using the Woody template transformer is much easier though.
?                                                                                        
                                                                                         
        ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

- 
- !TODO
- 
- Fix reference to {{<map:transform src="xsl/html/woody-default.xsl"/>}}, which probably
won't work for a new user. Instead,
- 
- 1) Add stylesheet code to page.
- 
- or
- 
- 2) Replace with {{<map:transform src="context://samples/woody/xsl/html/woody-default.xsl"/>}}
(which would probably work for most users).
- 



Mime
View raw message