bruno       2003/07/25 04:23:10

  Modified:    src/blocks/woody/java/org/apache/cocoon/woody/transformation
                        WidgetReplacingPipe.java
  Log:
  * drop location attribute on wt:form-template element
  * removed some of the user-oriented javadoc that's now in the wiki to avoid 
duplicate maintenance
  
  Revision  Changes    Path
  1.5       +8 -25     
cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation/WidgetReplacingPipe.java
  
  Index: WidgetReplacingPipe.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation/WidgetReplacingPipe.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- WidgetReplacingPipe.java  25 Jul 2003 09:07:46 -0000      1.4
  +++ WidgetReplacingPipe.java  25 Jul 2003 11:23:10 -0000      1.5
  @@ -76,30 +76,8 @@
    * then be translated to a HTML presentation by an XSL. This XSL will then only 
have to style
    * individual widget, and will not need to do the whole page layout.
    *
  - * <p>The content of the &lt;widget&gt; element will be re-inserted in the XML 
generated by the Widget
  - * (as a child of its root element, before the closing tag), and wrapped inside a 
&lt;wi:styling&gt;
  - * element. This allows to pass extra information to the XSLT that will render the 
widgets. For example,
  - * this could be used to define the textbox width or the listbox style (dropdown or 
normal), ...</p>
  - *
  - * <p>Additionally, this transformer supports the following tags:
  - * <ul>
  - *  <li><strong>form-template</strong>: all other widget related tags should appear 
inside a form-template
  - *  tag. The form-template tag should specify the location where the woody form can 
be retrieved in a "location"
  - *  attribute, using a JXPath expression. If not specified, the default expression 
"/woody-form" is used.
  - *  If the form-template tag has an action attribute, then all JXPath expressions 
in that attribute
  - *  embedded inside #{...} will be evaluated.
  - *  <li><strong>widget-label</strong>: used to insert the label of a widget. 
Requires an "id" attribute.
  - *  <li><strong>repeater-widget</strong>: provides special treatement for repeater 
widgets. The content
  - *   of the repeater-widget element will be used as a template to generate each of 
the rows of the repeater.
  - *  The repeater-widget element requires an "id" attribute.
  - *  <li><strong>repeater-widget-label</strong>: inserts the label of a widget 
contained by the repeater.
  - *  Requires an "id" attribute (identifying the repeater) and a "widget-id" 
attribute (identifying the widget
  - *  in the repeater).
  - *  <li><strong>repeater-size</strong>: inserts an element &lt;repeater-size id="" 
size=""/> containing the
  - *   size (number of rows) in the repeater.
  - * </ul>
  - *
  - * <p>Woody ships with an XSL that can style all the widgets that are provided by 
the core Woody framework.
  + * <p>For more information about the supported tags and their function, see the 
user documentation
  + * for the woody template transformer.</p>
    */
   public class WidgetReplacingPipe extends AbstractXMLPipe {
            
  @@ -189,6 +167,11 @@
                   // first look for the form using the location attribute, if any
                   String formJXPath = attributes.getValue("location");
                   if (formJXPath != null) {
  +                    // remove the location attribute
  +                    AttributesImpl attrsCopy = new AttributesImpl(attributes);
  +                    attrsCopy.removeAttribute(attributes.getIndex("location"));
  +                    attributes = attrsCopy;
  +
                       Object form = jxpathContext.getValue(formJXPath);
                       if (form == null)
                           throw new SAXException("No form found at location \"" + 
formJXPath + "\".");
  @@ -213,7 +196,7 @@
   
                   String[] namesToTranslate = {"action"};
                   Attributes transAtts = translateAttributes(attributes, 
namesToTranslate);
  -                contentHandler.startElement(Constants.WI_NS , FORM_TEMPLATE_EL, 
Constants.WI_PREFIX_COLON + FORM_TEMPLATE_EL, transAtts);                
  +                contentHandler.startElement(Constants.WI_NS , FORM_TEMPLATE_EL, 
Constants.WI_PREFIX_COLON + FORM_TEMPLATE_EL, transAtts);
               } else {
                   throw new SAXException("Unsupported WoodyTemplateTransformer 
element: " + localName);
               }
  
  
  

Reply via email to