cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stev...@outerthought.org
Subject [WIKI-UPDATE] Limpy Sat May 15 03:00:03 2004
Date Sat, 15 May 2004 01:00:04 GMT
Page: http://wiki.cocoondev.org/Wiki.jsp?page=Limpy , version: 5 on Fri May 15 00:11:08 2004
by JonasEkstedt

- There is a lot of cool stuff one can do with DOM. After having read a bit about it I started
building a widget framework based on DOM. The advantages are several. Using a DOM to model
all widgets one gets the benefits of DOM Event handling, DOM Traversal and XML schema all
for free with hardly any effort on the programmer. 
?                                                                                        
                                                                                         
      ----

+ There is a lot of cool stuff one can do with DOM. After having read a bit about it I started
building a widget framework based on DOM. The advantages are several. Using a DOM to model
widgets one gets the benefits of DOM Event handling, DOM Traversal and XML schema all for
free with hardly any effort on the programmer. 
- I put this up here in case anyone would be interested in it. It is only proof-of-concept
stuff and definitely not suitable for anything else than playing around with. 
+ I put this up here in case anyone would be interested in it. It's not thouroughly tested
yet so it is only usable for playing around with.
- Using Limpy is very similar to using woody/cforms. You write a definition file containing
the widget structure. A template file places those widgets on a page and a transformer does
all the magic. As a last step you XSL transform the widgets to HTML elements. I'll try and
outline a simple usage scenario below.
?                                                                                        
                                        -  ^^    --

+ Using Limpy is very similar to using woody/cforms. You write a definition file containing
the widget structure. A template file lays out the widgets on a page and a transformer does
all the magic. As a last step you XSL transform the widgets to HTML elements. I'll try and
outline a simple usage scenario below.
?                                                                                        
                                          ^ ++++

- * li:template is reserved
+ * Elements outside the "li:" namespace (and all their descendants) will be ignored
- As you can see the id of a widget is the parent id + its name. In the DOM the @id is also
made to be a proper ID. That means that retrieving a specific widget in the DOM is dead easy.
Simply do {{Element formWidget = document.getElementById("app/form")}}, no need for traversing
the entire tree when searching for widgets.
+ As you can see the id of a widget is the parent id + "/" + its name. In the DOM the @id
is also made to be a proper ID. That means that retrieving a specific widget in the DOM is
dead easy. Simply do:
+ 
+ {{Element formWidget = document.getElementById("app/form")}}
- The transformer does very little. If we take a template
?                                           ^

+ The transformer does very little. If we use the definition above and the template:
?                                         ++++ ++++++++++++++ ^^^   ++++++         +

- The transformer simply replace all <li:widget name="..."/> with the corresponding
element from the widget definition. Note that you can adress widgets both by its id as in
{{<li:widget id="app/form"/>}} or by its name {{<li:widget name="new"/>}}. In
the latter case the transformer will look for the widget in the parent widgets context. 
+ The transformer simply replace all <li:widget name="..."/> with the corresponding
element from the widget definition. Note that you can adress widgets both by its id as in
{{<li:widget id="app/form"/>}} or by its name {{<li:widget name="new"/>}}. In
the latter case the transformer will look for the widget in the parent widgets context. Limpy
supports adressing of parent widgets, as in <li:widget name="../some-name"/>
?                                                                                        
                                                                                         
                                                                                         
                                                                      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

- The transformer also supports hiding widgets that have @active=false. Suppose before transformation
we did this in flow {{tree.setAttribute("app/form", "active", "false")}} then the transformed
template would be:
+ The transformer also supports hiding widgets that has @active=false. Suppose before transformation
we did this in flow: 
+ 
+ {{tree.setAttribute("app/form", "active", "false")}} 
+ 
+ then the transformed template would be:
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http-link-to-www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ * Build cocoon and make sure you include the forms block



Mime
View raw message