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/06/15 11:00:05 UTC

[WIKI-UPDATE] SandBox XML CocoonFormsCreatingWidgets Tue Jun 15 11:00:04 2004

Page: http://wiki.cocoondev.org/Wiki.jsp?page=SandBox , version: 461 on Mon Jun 15 08:30:21 2004 by JoergHeinicke

- Play http-link-to-texas-holdem-online-poker.com Texas Holdem Online Poker.
- <a http-link-to-texas-holdem-online-poker.com">Texas Holdem Online Poker</a> The best Texas Holdem on the net. 
- == [Texas Holdem|http-link-to-texas-holdem-online-poker.com]] == 
- Play [http-link-to-texas-holdem-online-poker.com Texas Holdem]] Online Poker at the best poker rooms on the net.
- Play [http-link-to-texas-holdem-online-poker.com]] Texas Holdem Online Poker at the best poker rooms on the net.
- <a href="http-link-to-texas-holdem-online-poker.com">Texas Holdem</a> Online Poker at the best poker rooms on the net.


Page: http://wiki.cocoondev.org/Wiki.jsp?page=XML , version: 14 on Mon Jun 15 08:21:57 2004 by 61.160.31.112

+ [http-link-to-www.china-crawfish.com]


Page: http://wiki.cocoondev.org/Wiki.jsp?page=CocoonFormsCreatingWidgets , version: 12 on Mon Jun 15 08:17:14 2004 by SylvainWallez

- # Modify the {{EffectWidgetReplacingPipe}} class.
- # Modify the {{WidgetReplacingPipe}} class.
- __Create the Java classes for the Widget__
? ^^                                      --

+ !!Create the Java classes for the Widget
? ^^

+ The WidgetDefinitionBuilder parses the form definition document to create a WidgetDefinition. The WidgetDefinition is an __immutable__ class that is used as a factory to create Widget instances. Widget instances are what constitute the form's object model that hold the form state.
+ 
+ !!Update the {{forms-form.xconf}} file
+ 
+ Add a reference to your {{WidgetDefinitionBuilder}} implementation in the {{forms-form.xconf}} file, which can be found in the {{conf}} directory for the forms block. You have to specify the name of the element for that widget as well. This name should preferably match the string returned from the {{getXMLElementName()}} method of your {{Widget}} implementation.
+ 
+ !!Update the XSL which processes the widgets
+ 
+ You'll probably need to update the XSL file(s) which process the widgets. If you are using the samples that come as part of the forms block, this will most likely be {{forms-field-styling.xsl}} (which is found in the {{COCOON_HOME/src/blocks/forms/samples/resources}} directory). You will need to add a template which matches the element name of your new widget and generates appropriate output from it. The file contains plenty of templates to use as examples.
+ 
+ !!Rebuild Cocoon
+ 
+ After all this, you'll need to rebuild cocoon. This will cause the new classes to be compiled, the updated classes to be recompiled and the {{cocoon.xconf}} file to be regenerated. It may be a good idea to do a {{build clean}} first, but that's up to you.
+ 
+ !!For very specific widgets
+ 
+ In some rare cases, you may also need to modify the WidgetReplacingPipe. This is needed only for widgets that require a special handling by the template engine, such as repeater, class or union.
+ 
- __Modify the {{EffectWidgetReplacingPipe}} class__
? ^^                                              --

+ !Modify the {{EffectWidgetReplacingPipe}} class
? ^

- __Modify the {{WidgetReplacingPipe}} class__
? ^^                                        --

+ !Modify the {{WidgetReplacingPipe}} class
? ^

- __Update the {{forms-form.xconf}} file__
- Add a reference to your {{WidgetDefinitionBuilder}} implementation in the {{forms-form.xconf}} file, which can be found in the {{conf}} directory for the forms block. You have to specify the name of the element for that widget as well; this must match the string returned from the {{getXMLElementName()}} method of your {{Widget}} implementation.
- 
- __Update the XSL which processes the widgets__
- 
- You'll probably need to update the XSL file(s) which process the widgets. If you are using the samples that come as part of the forms block, this will most likely be {{forms-field-styling.xsl}} (which is found in the {{COCOON_HOME/src/blocks/forms/samples/resources}} directory). You will need to add a template which matches the element name of your new widget and generates appropriate output from it. The file contains plenty of templates to use as examples.
- 
- __Rebuild Cocoon__
- 
- After all this, you'll need to rebuild cocoon. This will cause the new classes to be compiled, the updated classes to be recompiled and the {{cocoon.xconf}} file to be regenerated. It may be a good idea to do a {{build clean}} first, but that's up to you.
- 
- I think that's pretty much it!
- 
-