cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/acting/modular DatabaseAction.java
Date Wed, 02 Oct 2002 08:41:20 GMT
haul        2002/10/02 01:41:20

  Modified:    src/java/org/apache/cocoon/acting/modular Tag:
                        cocoon_2_0_3_branch DatabaseAction.java
  Log:
  patch by Bobby Mitchell <bobby@niac.usra.edu>
  allows to turn off preceeding table name and trailing row number for column output.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.1   +25 -4     xml-cocoon2/src/java/org/apache/cocoon/acting/modular/DatabaseAction.java
  
  Index: DatabaseAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/modular/DatabaseAction.java,v
  retrieving revision 1.8
  retrieving revision 1.8.2.1
  diff -u -r1.8 -r1.8.2.1
  --- DatabaseAction.java	25 Aug 2002 08:54:29 -0000	1.8
  +++ DatabaseAction.java	2 Oct 2002 08:41:20 -0000	1.8.2.1
  @@ -451,12 +451,33 @@
       /**
        * compose name for output a long the lines of "table.column[row]" or
        * "table.column" if rowIndex is -1.
  +     * If the section of the sitemap corresponding to the action contains
  +     * <append-table-name>false</append-table-name>
  +     * the name for output is "column[row]"
  +     * If the section of the sitemap corresponding to the action contains
  +     * <append-row>false</append-row>
  +     * the name for output is "column"
        */
       protected String getOutputName ( Configuration tableConf, Configuration columnConf,
int rowIndex ) {
   
  -        return ( tableConf.getAttribute("alias", tableConf.getAttribute("name", null) )
  -                 + "." + columnConf.getAttribute("name",null)
  -                 + ( rowIndex == -1 ? "" : "[" + rowIndex + "]" ) );
  +        if ( rowIndex != -1 && this.settings.containsKey("append-row") &&

  +             (this.settings.get("append-row").toString().equalsIgnoreCase("false") || 
  +              this.settings.get("append-row").toString().equalsIgnoreCase("0")) ) {
  +            rowIndex = -1;
  +        }
  +        if ( this.settings.containsKey("append-table-name") && 
  +             (this.settings.get("append-table-name").toString().equalsIgnoreCase("false")
|| 
  +              this.settings.get("append-table-name").toString().equalsIgnoreCase("0"))
)
  +            {
  +                return ( columnConf.getAttribute("name",null)
  +                         + ( rowIndex == -1 ? "" : "[" + rowIndex + "]" ) );
  +            }
  +        else
  +            {
  +                return ( tableConf.getAttribute("alias", tableConf.getAttribute("name",
null) )
  +                         + "." + columnConf.getAttribute("name",null)
  +                         + ( rowIndex == -1 ? "" : "[" + rowIndex + "]" ) );
  +            }
       }
   
   
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message