cziegeler    2004/04/15 00:51:41

  Modified:    src/blocks/portal/java/org/apache/cocoon/portal/transformation
                        HTMLEventLinkTransformer.java
  Log:
  Fixing bug 28387
  Portal: HTMLEventLinkTransformer eats form attributes
  
  Revision  Changes    Path
  1.11      +6 -7      
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/transformation/HTMLEventLinkTransformer.java
  
  Index: HTMLEventLinkTransformer.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/transformation/HTMLEventLinkTransformer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- HTMLEventLinkTransformer.java     2 Apr 2004 07:07:45 -0000       1.10
  +++ HTMLEventLinkTransformer.java     15 Apr 2004 07:51:41 -0000      1.11
  @@ -32,7 +32,6 @@
    * into events.
    * The transformer listens for the element a and form. Links
    * that only contain an anchor are ignored.
  - * Current we only support POSTing of forms.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
    * @version CVS $Id$
  @@ -130,7 +129,8 @@
   
       protected void createFormEvent(Attributes attributes)
       throws SAXException {
  -        AttributesImpl newAttributes = new AttributesImpl();
  +        AttributesImpl newAttributes = new AttributesImpl(attributes);
  +        newAttributes.removeAttribute("action");
           String link = attributes.getValue("action");
   
           CopletInstanceData cid = this.getCopletInstanceData();
  @@ -140,11 +140,10 @@
           newAttributes.addCDATAAttribute("value", link);
           newAttributes.addCDATAAttribute("coplet", cid.getId());
           newAttributes.addCDATAAttribute("format", "html-form");
  -        newAttributes.addCDATAAttribute("method", "POST");
  -        final String encType = attributes.getValue("enctype");
  -        if ( encType != null ) {
  -            newAttributes.addCDATAAttribute("enctype", encType);
  +        if ( newAttributes.getIndex("method") == -1 ) {
  +            newAttributes.addCDATAAttribute("method", "POST");
           }
  +
           this.xmlConsumer.startPrefixMapping("coplet", 
CopletTransformer.NAMESPACE_URI);
           this.xmlConsumer.startElement(CopletTransformer.NAMESPACE_URI,
                   CopletTransformer.LINK_ELEM,
  
  
  

Reply via email to