Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 27285 invoked by uid 500); 2 Oct 2002 11:24:39 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 27255 invoked by uid 500); 2 Oct 2002 11:24:38 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 2 Oct 2002 11:24:37 -0000 Message-ID: <20021002112437.68359.qmail@icarus.apache.org> From: haul@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/acting/modular DatabaseAction.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N haul 2002/10/02 04:24:37 Modified: src/java/org/apache/cocoon/acting/modular DatabaseAction.java Log: patch by Bobby Mitchell allows to turn off preceeding table name and trailing row number for column output. Revision Changes Path 1.9 +28 -10 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.9 diff -u -r1.8 -r1.9 --- DatabaseAction.java 25 Aug 2002 08:54:29 -0000 1.8 +++ DatabaseAction.java 2 Oct 2002 11:24:37 -0000 1.9 @@ -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 + * false + * the name for output is "column[row]" + * If the section of the sitemap corresponding to the action contains + * false + * 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 + "]" ) ); + } } @@ -538,12 +559,9 @@ set.columns[i].isSet = false; set.columns[i].isKey = isKey; set.columns[i].isAutoIncrement = false; - if ( isKey & this.honourAutoIncrement() ) { - String autoIncrement = set.columns[i].columnConf.getAttribute("autoincrement","false"); - if ( autoIncrement.equalsIgnoreCase("yes") || autoIncrement.equalsIgnoreCase("true") ) { - set.columns[i].isAutoIncrement = true; - } - } + if ( isKey & this.honourAutoIncrement() ) + set.columns[i].isAutoIncrement = set.columns[i].columnConf.getAttributeAsBoolean("autoincrement",false); + set.columns[i].modeConf = getMode( set.columns[i].columnConf, selectMode( set.columns[i].isAutoIncrement, modeTypes ) ); set.columns[i].mode = ( set.columns[i].modeConf != null ? ---------------------------------------------------------------------- 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