cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bobby Mitchell <bo...@niac.usra.edu>
Subject Proposed change to mod-db actions
Date Mon, 16 Sep 2002 20:07:40 GMT
I have been using mod-db actions and have found that I want to be able 
to not have the action append the table name to the request attributes 
that are created. The following is a diff -u showing the changes.

--- 
/root/java/xml-cocoon2/src/java/org/apache/cocoon/acting/modular/DatabaseAction.java>...Thu

Aug 29 15:24:00 2002
+++ DatabaseAction.java>Mon Sep 16 15:59:18 2002
@@ -451,12 +451,25 @@
     /**    
      * 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]."
      */     
     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 ( 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 + "]" ) );
+        }
     }

                
TIA,
Bobby M

-- 
Robert J. (Bobby) Mitchell
Systems Administrator
NASA Institute for Advanced Concepts
555A 14th St Atlanta, Ga. 30318
Phone: (404)347-9633 Fax: (404)347-9638




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message