[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-cocoon-dev
Subject:    cvs commit: cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/transformation Web3RfcTransformer.java
From:       haul () apache ! org
Date:       2003-03-31 11:14:12
[Download RAW message or body]

haul        2003/03/31 03:14:12

  Modified:    src/blocks/web3/java/org/apache/cocoon/components/web3/impl
                        DefaultWeb3StreamerImpl.java
               src/blocks/web3/java/org/apache/cocoon/transformation
                        Web3RfcTransformer.java
  Log:
  Patch from Michael Gerzabek <michael.gerzabek@at.efp.cc>
  * null values were not correctly handled. should now comply with SAP guidelines
  * JavaConnector 2.0- requires to extend null value handling in DefaultWeb3Streamer
    since unicode version returns several &#0;
  
  Revision  Changes    Path
  1.4       +9 -5      \
cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/components/web3/impl/DefaultWeb3StreamerImpl.java
  
  Index: DefaultWeb3StreamerImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/components/web3/impl/DefaultWeb3StreamerImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultWeb3StreamerImpl.java	19 Mar 2003 09:04:40 -0000	1.3
  +++ DefaultWeb3StreamerImpl.java	31 Mar 2003 11:14:11 -0000	1.4
  @@ -65,7 +65,7 @@
   /**
    * TBD
    *
  - * @author  <a href="mailto:mge@efp.co.at>Michael Gerzabek</a>
  + * @author  <a href="mailto:mge@efp.co.at">Michael Gerzabek</a>
    * @since 21. Oct. 2002
    * @version CVS $Id$
    */
  @@ -80,6 +80,7 @@
               Web3.INCLUDE_NAME_ATTR, "CDATA", function.getName().toUpperCase() );
           contentHandler.startElement( Web3.URI, Web3.INCLUDE_ELEM, 
               Web3.INCLUDE_ELEM, attributes );
  +        attributes.clear();
           contentHandler.startElement( Web3.URI, Web3.IMPORT_ELEM, 
               Web3.IMPORT_ELEM, attributes );
           streamParameterList( function.getImportParameterList(), contentHandler );
  @@ -119,7 +120,8 @@
                                   "CDATA", sapTable.getName(k).toUpperCase());
                               contentHandler.startElement(Web3.URI, 
                                   Web3.FIELD_ELEM, Web3.FIELD_ELEM, attributes);
  -                            String theValue = sapTable.getString(k);
  +                            String theValue = ( sapTable.getString(k) == null) 
  +                                ? "" : sapTable.getString(k).trim();
                               contentHandler.characters(theValue.toCharArray(), 0, 
                                   theValue.length());
                               contentHandler.endElement(Web3.URI, Web3.FIELD_ELEM, 
  @@ -162,7 +164,8 @@
                               sapStructure.getName(j).toUpperCase());
                           contentHandler.startElement(Web3.URI, Web3.FIELD_ELEM, 
                               Web3.FIELD_ELEM, attributes);
  -                        String theValue = sapStructure.getString(j);
  +                        String theValue = (sapStructure.getString(j) == null) 
  +                            ? "" : sapStructure.getString(j).trim();
                           contentHandler.characters(theValue.toCharArray(), 0, 
                               theValue.length());
                           contentHandler.endElement(Web3.URI, Web3.FIELD_ELEM, 
  @@ -178,7 +181,8 @@
                           pList.getName(i).toUpperCase());
                       contentHandler.startElement(Web3.URI, Web3.FIELD_ELEM, 
                           Web3.FIELD_ELEM, attributes);
  -                    String theValue = pList.getString(i);
  +                    String theValue = (pList.getString(i) == null)
  +                        ? "" : pList.getString(i).trim();
                       contentHandler.characters(theValue.toCharArray(), 0, 
                           theValue.length());
                       contentHandler.endElement(Web3.URI, Web3.FIELD_ELEM, 
  
  
  
  1.3       +6 -3      \
cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/transformation/Web3RfcTransformer.java
  
  Index: Web3RfcTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/web3/java/org/apache/cocoon/transformation/Web3RfcTransformer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Web3RfcTransformer.java	16 Mar 2003 17:49:10 -0000	1.2
  +++ Web3RfcTransformer.java	31 Mar 2003 11:14:11 -0000	1.3
  @@ -82,7 +82,7 @@
   /**
    * TBD
    *
  - * @author  <a href="mailto:mge@efp.co.at>Michael Gerzabek</a>
  + * @author  <a href="mailto:mge@efp.co.at">Michael Gerzabek</a>
    * @since 21. Oct. 2002
    * @version CVS $Id$
    */
  @@ -265,7 +265,10 @@
       public void characters(char c[], int start, int len)
       throws SAXException {
           String theValue = new String(c, start, len).trim();
  -        if ( ( null != this.fillMe ) && ( !"".equals(theValue) )) {
  +        if ( null != this.fillMe ) {
  +            if ( "".equals( theValue )) {
  +                theValue = null;
  +            }
               try {
                   this.fillMe.setValue( theValue );
                   this.fillMe = null;
  
  
  


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic