Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 87911 invoked from network); 4 Mar 2009 20:52:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Mar 2009 20:52:47 -0000 Received: (qmail 5915 invoked by uid 500); 4 Mar 2009 20:52:45 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 5853 invoked by uid 500); 4 Mar 2009 20:52:45 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 5844 invoked by uid 99); 4 Mar 2009 20:52:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Mar 2009 12:52:45 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [209.86.89.62] (HELO elasmtp-dupuy.atl.sa.earthlink.net) (209.86.89.62) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Mar 2009 20:52:36 +0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=kOeVHcMaBAbPt0raAb4A1D5q8kPA3WCGbhkP3ODHiLjT+BpF2wG10yX7vtNNHxP6; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-ELNK-Trace:X-Originating-IP; Received: from [129.33.49.251] (helo=tetra-009037243157.raleigh.ibm.com) by elasmtp-dupuy.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1Ley4c-0002W1-P3 for dev@geronimo.apache.org; Wed, 04 Mar 2009 15:52:14 -0500 Message-ID: <49AEE9FE.3010402@earthlink.net> Date: Wed, 04 Mar 2009 15:52:14 -0500 From: Joe Bohn User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 To: dev@geronimo.apache.org Subject: Re: svn commit: r700193 - in /geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main: java/org/apache/geronimo/console/internaldb/ resources/ webapp/WEB-INF/view/internaldb/ References: <20080929180918.5942A23889FD@eris.apache.org> In-Reply-To: <20080929180918.5942A23889FD@eris.apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: c408501814fc19611aa676d7e74259b7b3291a7d08dfec79d4393ae4a5ae19858e160b76e0c63790350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 129.33.49.251 X-Virus-Checked: Checked by ClamAV on apache.org I know this is going way back in time ... but any idea why this change deleted the content of dbViewerMaximized.jsp but kept the empty file around? I discovered this when checking for source headers. This file is flagged because it doesn't contain a header - but more than that it doesn't contain anything at all. I presume we can delete the entire file. Does anybody know of any reason why we should not do this? There are a few other instances of similar files that we need to deal with as well. Joe dwoods@apache.org wrote: > Author: dwoods > Date: Mon Sep 29 11:09:17 2008 > New Revision: 700193 > > URL: http://svn.apache.org/viewvc?rev=700193&view=rev > Log: > GERONIMO-4225 Allow Run SQL portlet run sql against any configured data source. Thanks to Michal Borowiecki for the patch. > > Added: > geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/listDatabasesMaximized.jsp (with props) > geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/listTablesMaximized.jsp (with props) > geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/viewTableContentsMaximized.jsp (with props) > Modified: > geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DBViewerHelper.java > geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DBViewerPortlet.java > geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java > geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLHelper.java > geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLPortlet.java > geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/resources/systemdatabase.properties > geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/dbViewerMaximized.jsp > geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/runSQLNormal.jsp > > Modified: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DBViewerHelper.java > URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DBViewerHelper.java?rev=700193&r1=700192&r2=700193&view=diff > ============================================================================== > --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DBViewerHelper.java (original) > +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DBViewerHelper.java Mon Sep 29 11:09:17 2008 > @@ -18,9 +18,20 @@ > package org.apache.geronimo.console.internaldb; > > import java.io.File; > +import java.util.ArrayList; > import java.util.Collection; > +import java.util.List; > import java.util.Vector; > > +import org.apache.geronimo.console.util.KernelManagementHelper; > +import org.apache.geronimo.console.util.ManagementHelper; > +import org.apache.geronimo.console.util.PortletManager; > +import org.apache.geronimo.gbean.AbstractName; > +import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory; > +import org.apache.geronimo.kernel.Kernel; > +import org.apache.geronimo.kernel.KernelRegistry; > +import org.apache.geronimo.management.geronimo.ResourceAdapterModule; > + > public class DBViewerHelper { > > private static final String SYS_TBL_PREFIX = "SYS."; > @@ -28,6 +39,34 @@ > private static final int COUNT_COL = 1; > > /** > + * List the databases having datasources deployed. > + * > + * @param derbySysHome > + * @return > + */ > + public Collection getDataSourceNames() { > + > + List databaseNames = new ArrayList(); > + > + Kernel kernel = KernelRegistry.getSingleKernel(); > + ManagementHelper helper = new KernelManagementHelper(kernel); > + ResourceAdapterModule[] modules = helper.getOutboundRAModules(helper.getDomains()[0].getServerInstances()[0], "javax.sql.DataSource"); > + for (ResourceAdapterModule module : modules) { > + org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory[] databases = helper.getOutboundFactories(module, "javax.sql.DataSource"); > + for (org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory db : databases) { > + try { > + AbstractName dbName = kernel.getAbstractNameFor(db); > + String datasourceName = (String)dbName.getName().get(NameFactory.J2EE_NAME); > + databaseNames.add(datasourceName); > + } catch (Exception ignored) { > + } > + } > + } > + > + return databaseNames; > + } > + > + /** > * List the databases given the derby home directory. > * > * @param derbySysHome > > Modified: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DBViewerPortlet.java > URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DBViewerPortlet.java?rev=700193&r1=700192&r2=700193&view=diff > ============================================================================== > --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DBViewerPortlet.java (original) > +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DBViewerPortlet.java Mon Sep 29 11:09:17 2008 > @@ -40,16 +40,20 @@ > > private static final int RDBMS_MSSQL = 2; > > - private static final String MAXIMIZEDVIEW_JSP = "/WEB-INF/view/internaldb/dbViewerMaximized.jsp"; > - > private static final String HELPVIEW_JSP = "/WEB-INF/view/internaldb/dbViewerHelp.jsp"; > > private static final String LISTDATABASES_JSP = "/WEB-INF/view/internaldb/listDatabases.jsp"; > > + private static final String LISTDATABASES_MAXIMIZEDVIEW_JSP = "/WEB-INF/view/internaldb/listDatabasesMaximized.jsp"; > + > private static final String LISTTABLES_JSP = "/WEB-INF/view/internaldb/listTables.jsp"; > > + private static final String LISTTABLES_MAXIMIZEDVIEW_JSP = "/WEB-INF/view/internaldb/listTablesMaximized.jsp"; > + > private static final String VIEWTABLECONTENTS_JSP = "/WEB-INF/view/internaldb/viewTableContents.jsp"; > > + private static final String VIEWTABLECONTENTS_MAXIMIZEDVIEW_JSP = "/WEB-INF/view/internaldb/viewTableContentsMaximized.jsp"; > + > private static final String LISTDB_ACTION = "listDatabases"; > > private static final String LISTTBLS_ACTION = "listTables"; > @@ -58,8 +62,6 @@ > > private static DBViewerHelper helper = new DBViewerHelper(); > > - private PortletRequestDispatcher maximizedView; > - > private PortletRequestDispatcher helpView; > > private PortletRequestDispatcher listDatabasesView; > @@ -68,6 +70,12 @@ > > private PortletRequestDispatcher viewTableContentsView; > > + private PortletRequestDispatcher listDatabasesMaximizedView; > + > + private PortletRequestDispatcher listTablesMaximizedView; > + > + private PortletRequestDispatcher viewTableContentsMaximizedView; > + > public void processAction(ActionRequest actionRequest, > ActionResponse actionResponse) throws PortletException, IOException { > // getting parameters here because it fails on doView() > @@ -106,47 +114,56 @@ > String rdbms = renderRequest.getParameter("rdbms"); > int rdbmsParam = (rdbms == null ? RDBMS_DERBY : Integer.parseInt(rdbms)); > > - if (WindowState.NORMAL.equals(renderRequest.getWindowState())) { > - if (rdbmsParam == RDBMS_DERBY) { > - // Check is database & table is valid > - if (LISTTBLS_ACTION.equals(action) > - || VIEWTBLCONTENTS_ACTION.equals(action)) { > - if (!helper.isDBValid(DerbyConnectionUtil.getDerbyHome(), db)) { > - // DB not valid > - log.error("Database is not valid: " + db); > - action = ""; > - } > + if (rdbmsParam == RDBMS_DERBY) { > + // Check is database & table is valid > + if (LISTTBLS_ACTION.equals(action) > + || VIEWTBLCONTENTS_ACTION.equals(action)) { > + if (!helper.isDBValid(DerbyConnectionUtil.getDerbyHome(), db)) { > + // DB not valid > + log.error("Database is not valid: " + db); > + action = ""; > } > - if (VIEWTBLCONTENTS_ACTION.equals(action)) { > - if (!helper.isTblValid(db, tbl)) { > - // Table not valid > - log.error("Table is not valid: " + tbl); > - action = ""; > - } > + } > + if (VIEWTBLCONTENTS_ACTION.equals(action)) { > + if (!helper.isTblValid(db, tbl)) { > + // Table not valid > + log.error("Table is not valid: " + tbl); > + action = ""; > } > } > + } > > - renderRequest.setAttribute("rdbms", rdbms); > - if (LISTTBLS_ACTION.equals(action)) { > - renderRequest.setAttribute("db", db); > - renderRequest.setAttribute("viewTables", viewTables); > - renderRequest.setAttribute("ds", DerbyConnectionUtil > - .getDataSource(db)); > - listTablesView.include(renderRequest, renderResponse); > - } else if (VIEWTBLCONTENTS_ACTION.equals(action)) { > - renderRequest.setAttribute("db", db); > - renderRequest.setAttribute("tbl", tbl); > - renderRequest.setAttribute("viewTables", viewTables); > - renderRequest.setAttribute("ds", DerbyConnectionUtil > - .getDataSource(db)); > - viewTableContentsView.include(renderRequest, renderResponse); > + renderRequest.setAttribute("rdbms", rdbms); > + if (LISTTBLS_ACTION.equals(action)) { > + renderRequest.setAttribute("db", db); > + renderRequest.setAttribute("viewTables", viewTables); > + renderRequest.setAttribute("ds", DerbyConnectionUtil > + .getDataSourceForDataBaseName(db)); > + > + if (WindowState.NORMAL.equals(renderRequest.getWindowState())) { > + listTablesView.include(renderRequest, renderResponse); > } else { > - renderRequest.setAttribute("databases", helper > - .getDerbyDatabases(DerbyConnectionUtil.getDerbyHome())); > - listDatabasesView.include(renderRequest, renderResponse); > + listTablesMaximizedView.include(renderRequest, renderResponse); > + } > + } else if (VIEWTBLCONTENTS_ACTION.equals(action)) { > + renderRequest.setAttribute("db", db); > + renderRequest.setAttribute("tbl", tbl); > + renderRequest.setAttribute("viewTables", viewTables); > + renderRequest.setAttribute("ds", DerbyConnectionUtil > + .getDataSourceForDataBaseName(db)); > + if (WindowState.NORMAL.equals(renderRequest.getWindowState())) { > + viewTableContentsView.include(renderRequest, renderResponse); > + } else { > + viewTableContentsMaximizedView.include(renderRequest, renderResponse); > } > } else { > - maximizedView.include(renderRequest, renderResponse); > + renderRequest.setAttribute("databases", helper > + .getDerbyDatabases(DerbyConnectionUtil.getDerbyHome())); > + if (WindowState.NORMAL.equals(renderRequest.getWindowState())) { > + listDatabasesView.include(renderRequest, renderResponse); > + } else { > + listDatabasesMaximizedView.include(renderRequest, renderResponse); > + } > } > } > > @@ -157,8 +174,6 @@ > > public void init(PortletConfig portletConfig) throws PortletException { > super.init(portletConfig); > - maximizedView = portletConfig.getPortletContext().getRequestDispatcher( > - MAXIMIZEDVIEW_JSP); > helpView = portletConfig.getPortletContext().getRequestDispatcher( > HELPVIEW_JSP); > listDatabasesView = portletConfig.getPortletContext() > @@ -167,14 +182,22 @@ > .getRequestDispatcher(LISTTABLES_JSP); > viewTableContentsView = portletConfig.getPortletContext() > .getRequestDispatcher(VIEWTABLECONTENTS_JSP); > + listDatabasesMaximizedView = portletConfig.getPortletContext() > + .getRequestDispatcher(LISTDATABASES_MAXIMIZEDVIEW_JSP); > + listTablesMaximizedView = portletConfig.getPortletContext() > + .getRequestDispatcher(LISTTABLES_MAXIMIZEDVIEW_JSP); > + viewTableContentsMaximizedView = portletConfig.getPortletContext() > + .getRequestDispatcher(VIEWTABLECONTENTS_MAXIMIZEDVIEW_JSP); > } > > public void destroy() { > - maximizedView = null; > helpView = null; > listDatabasesView = null; > listTablesView = null; > viewTableContentsView = null; > + listDatabasesMaximizedView = null; > + listTablesMaximizedView = null; > + viewTableContentsMaximizedView = null; > super.destroy(); > } > > > Modified: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java > URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java?rev=700193&r1=700192&r2=700193&view=diff > ============================================================================== > --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java (original) > +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java Mon Sep 29 11:09:17 2008 > @@ -166,7 +166,7 @@ > public static Connection getSystemDBConnection() throws SQLException { > DataSource ds = null; > try { > - ds = getDataSource(SYSTEM_DB); > + ds = getDataSourceForDataBaseName(SYSTEM_DB); > return ds.getConnection(); > } catch (Exception e) { > throw new SQLException(e.getMessage()); > @@ -174,12 +174,27 @@ > } > > /** > - * Get the datasource if dbName is == SYSTEM_DB, otherwise returns null. > + * Get a connaction to a named datasource > + * > + * @param dbName > + * @return > + * @throws SQLException > + */ > + public static Connection getDataSourceConnection(String dataSourceName) throws SQLException{ > + try { > + return getDataSource(dataSourceName).getConnection(); > + } catch (Exception e) { > + throw new SQLException(e.getMessage()); > + } > + } > + > + /** > + * Get the datasource if dbName is == SYSTEM_DB, otherwise finds the datasource among JCAManagedConnectionFactories, otherwise returns null. > * > * @param dbName > * @return datasource > */ > - public static DataSource getDataSource(String dbName) { > + public static DataSource getDataSourceForDataBaseName(String dbName) { > try { > if (SYSTEM_DATASOURCE_NAME!=null && SYSTEM_DB.equalsIgnoreCase(dbName)) { > return (DataSource) KernelRegistry.getSingleKernel().invoke( > @@ -210,4 +225,42 @@ > return null; > } > > + /** > + * Get the datasource if dbName is == SYSTEM_DB, otherwise finds the datasource among JCAManagedConnectionFactories, otherwise returns null. > + * > + * @param dbName > + * @return datasource > + */ > + public static DataSource getDataSource(String dsName) { > + try { > + if (SYSTEM_DATASOURCE_NAME!=null && ((String)SYSTEM_DATASOURCE_NAME.getName().get(NameFactory.J2EE_NAME)).equalsIgnoreCase(dsName)) { > + return (DataSource) KernelRegistry.getSingleKernel().invoke( > + SYSTEM_DATASOURCE_NAME, "$getResource"); > + } > + } catch (Exception e) { > + log.error("Problem getting datasource " + dsName, e); > + } > + > + Kernel kernel = KernelRegistry.getSingleKernel(); > + ManagementHelper helper = new KernelManagementHelper(kernel); > + ResourceAdapterModule[] modules = helper.getOutboundRAModules(helper.getDomains()[0].getServerInstances()[0], "javax.sql.DataSource"); > + for (ResourceAdapterModule module : modules) { > + org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory[] databases = helper.getOutboundFactories(module, "javax.sql.DataSource"); > + for (org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory db : databases) { > + try { > + AbstractName dbName = kernel.getAbstractNameFor(db); > + String datasourceName = (String)dbName.getName().get(NameFactory.J2EE_NAME); > + if(dsName.equalsIgnoreCase(datasourceName)) { > + AbstractName tempDbName = helper.getNameFor(db); > + return (DataSource) KernelRegistry.getSingleKernel().invoke( > + tempDbName, "$getResource"); > + } > + } catch (Exception ignored) { > + } > + } > + } > + > + return null; > + } > + > } > > Modified: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLHelper.java > URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLHelper.java?rev=700193&r1=700192&r2=700193&view=diff > ============================================================================== > --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLHelper.java (original) > +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLHelper.java Mon Sep 29 11:09:17 2008 > @@ -132,19 +132,20 @@ > return result; > } > > - public String runSQL(String dbName, String sql) { > + public String runSQL(String dsName, String sql) { > String result = SQL_SUCCESS_MSG; > > if ((sql == null) || (sql.trim().length() == 0)) { > result = SQL_EMPTY_MSG; > return result; > } > + > > Connection conn = null; > Statement s = null; > try { > > - conn = DerbyConnectionUtil.getDerbyConnection(dbName); > + conn = DerbyConnectionUtil.getDataSourceConnection(dsName); > conn.setAutoCommit(false); > > s = conn.createStatement(); > > Modified: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLPortlet.java > URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLPortlet.java?rev=700193&r1=700192&r2=700193&view=diff > ============================================================================== > --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLPortlet.java (original) > +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/java/org/apache/geronimo/console/internaldb/RunSQLPortlet.java Mon Sep 29 11:09:17 2008 > @@ -60,6 +60,8 @@ > private PortletRequestDispatcher helpView; > > private Collection databases; > + > + private Collection dataSourceNames; > > private String action; > > @@ -108,33 +110,36 @@ > } > > String singleSelectStmt; > - if (WindowState.NORMAL.equals(renderRequest.getWindowState())) { > - databases = dbHelper.getDerbyDatabases(DerbyConnectionUtil.getDerbyHome()); > - renderRequest.setAttribute("databases", databases); > - if (RUNSQL_ACTION.equals(action)) { > - // check if it's a single Select statement > - if ((sqlStmts != null) && (sqlStmts.trim().indexOf(';') == -1) > - && sqlStmts.trim().toUpperCase().startsWith("SELECT") > - && RunSQLHelper.SQL_SUCCESS_MSG.equals(actionResult)) { > - singleSelectStmt = sqlStmts.trim(); > - // set action result to blank so it won't display > - actionResult = ""; > - } else { > - singleSelectStmt = ""; > - } > - renderRequest.setAttribute("useDB", useDB); > - renderRequest > - .setAttribute("singleSelectStmt", singleSelectStmt); > - renderRequest.setAttribute("ds", DerbyConnectionUtil > - .getDataSource(useDB)); > - } > - if ((action != null) && (action.trim().length() > 0)) { > - renderRequest.setAttribute("actionResult", actionResult); > - //set action to null so that subsequent renders of portlet > - // won't display > - //action result if there is no action to process > - action = null; > + databases = dbHelper.getDerbyDatabases(DerbyConnectionUtil.getDerbyHome()); > + dataSourceNames = dbHelper.getDataSourceNames(); > + renderRequest.setAttribute("databases", databases); > + renderRequest.setAttribute("dataSourceNames", dataSourceNames); > + renderRequest.setAttribute("sqlStmts", sqlStmts); > + renderRequest.setAttribute("useDB", useDB); > + if (RUNSQL_ACTION.equals(action)) { > + // check if it's a single Select statement > + if ((sqlStmts != null) && (sqlStmts.trim().indexOf(';') == -1) > + && sqlStmts.trim().toUpperCase().startsWith("SELECT") > + && RunSQLHelper.SQL_SUCCESS_MSG.equals(actionResult)) { > + singleSelectStmt = sqlStmts.trim(); > + // set action result to blank so it won't display > + actionResult = ""; > + } else { > + singleSelectStmt = ""; > } > + renderRequest > + .setAttribute("singleSelectStmt", singleSelectStmt); > + renderRequest.setAttribute("ds", DerbyConnectionUtil > + .getDataSource(useDB)); > + } > + if ((action != null) && (action.trim().length() > 0)) { > + renderRequest.setAttribute("actionResult", actionResult); > + //set action to null so that subsequent renders of portlet > + // won't display > + //action result if there is no action to process > + action = null; > + } > + if (WindowState.NORMAL.equals(renderRequest.getWindowState())) { > normalView.include(renderRequest, renderResponse); > } else { > maximizedView.include(renderRequest, renderResponse); > @@ -155,6 +160,7 @@ > helpView = portletConfig.getPortletContext().getRequestDispatcher( > HELPVIEW_JSP); > databases = dbHelper.getDerbyDatabases(DerbyConnectionUtil.getDerbyHome()); > + dataSourceNames = dbHelper.getDataSourceNames(); > } > > public void destroy() { > > Modified: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/resources/systemdatabase.properties > URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/resources/systemdatabase.properties?rev=700193&r1=700192&r2=700193&view=diff > ============================================================================== > --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/resources/systemdatabase.properties (original) > +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/resources/systemdatabase.properties Mon Sep 29 11:09:17 2008 > @@ -199,7 +199,7 @@ > internaldb.common.tableTypes = Table Types > internaldb.common.tables = Tables > internaldb.common.timeDateFunctions = Time Date Functions > -internaldb.common.useDB = Use DB > +internaldb.common.useDB = Use DataSource > internaldb.common.userName = Username > internaldb.common.viewContents = View Contents > internaldb.common.viewDatabases = View Databases > > Modified: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/dbViewerMaximized.jsp > URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/dbViewerMaximized.jsp?rev=700193&r1=700192&r2=700193&view=diff > ============================================================================== > --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/dbViewerMaximized.jsp (original) > +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/dbViewerMaximized.jsp Mon Sep 29 11:09:17 2008 > @@ -1,17 +0,0 @@ > -<%-- > - Licensed to the Apache Software Foundation (ASF) under one or more > - contributor license agreements. See the NOTICE file distributed with > - this work for additional information regarding copyright ownership. > - The ASF licenses this file to You under the Apache License, Version 2.0 > - (the "License"); you may not use this file except in compliance with > - the License. You may obtain a copy of the License at > - > - http://www.apache.org/licenses/LICENSE-2.0 > - > - Unless required by applicable law or agreed to in writing, software > - distributed under the License is distributed on an "AS IS" BASIS, > - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > - See the License for the specific language governing permissions and > - limitations under the License. > ---%> > -<%@ include file="listDatabases.jsp" %> > > Added: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/listDatabasesMaximized.jsp > URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/listDatabasesMaximized.jsp?rev=700193&view=auto > ============================================================================== > --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/listDatabasesMaximized.jsp (added) > +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/listDatabasesMaximized.jsp Mon Sep 29 11:09:17 2008 > @@ -0,0 +1,17 @@ > +<%-- > + Licensed to the Apache Software Foundation (ASF) under one or more > + contributor license agreements. See the NOTICE file distributed with > + this work for additional information regarding copyright ownership. > + The ASF licenses this file to You under the Apache License, Version 2.0 > + (the "License"); you may not use this file except in compliance with > + the License. You may obtain a copy of the License at > + > + http://www.apache.org/licenses/LICENSE-2.0 > + > + Unless required by applicable law or agreed to in writing, software > + distributed under the License is distributed on an "AS IS" BASIS, > + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > + See the License for the specific language governing permissions and > + limitations under the License. > +--%> > +<%@ include file="listDatabases.jsp" %> > > Propchange: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/listDatabasesMaximized.jsp > ------------------------------------------------------------------------------ > svn:eol-style = native > > Added: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/listTablesMaximized.jsp > URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/listTablesMaximized.jsp?rev=700193&view=auto > ============================================================================== > --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/listTablesMaximized.jsp (added) > +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/listTablesMaximized.jsp Mon Sep 29 11:09:17 2008 > @@ -0,0 +1,17 @@ > +<%-- > + Licensed to the Apache Software Foundation (ASF) under one or more > + contributor license agreements. See the NOTICE file distributed with > + this work for additional information regarding copyright ownership. > + The ASF licenses this file to You under the Apache License, Version 2.0 > + (the "License"); you may not use this file except in compliance with > + the License. You may obtain a copy of the License at > + > + http://www.apache.org/licenses/LICENSE-2.0 > + > + Unless required by applicable law or agreed to in writing, software > + distributed under the License is distributed on an "AS IS" BASIS, > + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > + See the License for the specific language governing permissions and > + limitations under the License. > +--%> > +<%@ include file="listTables.jsp" %> > > Propchange: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/listTablesMaximized.jsp > ------------------------------------------------------------------------------ > svn:eol-style = native > > Modified: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/runSQLNormal.jsp > URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/runSQLNormal.jsp?rev=700193&r1=700192&r2=700193&view=diff > ============================================================================== > --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/runSQLNormal.jsp (original) > +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/runSQLNormal.jsp Mon Sep 29 11:09:17 2008 > @@ -67,15 +67,15 @@ >
:
> >   > > > > > -
: > +
:
> > > > @@ -113,17 +113,6 @@ > > <%-- Display query result from single select statement --%> > > -<%-- Datasource --%> > - > - <%-- Create the connection manually --%> > - - var="ds" > - driver="org.apache.derby.jdbc.EmbeddedDriver" > - url="jdbc:derby:${useDB};create=true" > - user="" > - password="" > - /> > - > > <%-- Select statement --%> > > > Added: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/viewTableContentsMaximized.jsp > URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/viewTableContentsMaximized.jsp?rev=700193&view=auto > ============================================================================== > --- geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/viewTableContentsMaximized.jsp (added) > +++ geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/viewTableContentsMaximized.jsp Mon Sep 29 11:09:17 2008 > @@ -0,0 +1,17 @@ > +<%-- > + Licensed to the Apache Software Foundation (ASF) under one or more > + contributor license agreements. See the NOTICE file distributed with > + this work for additional information regarding copyright ownership. > + The ASF licenses this file to You under the Apache License, Version 2.0 > + (the "License"); you may not use this file except in compliance with > + the License. You may obtain a copy of the License at > + > + http://www.apache.org/licenses/LICENSE-2.0 > + > + Unless required by applicable law or agreed to in writing, software > + distributed under the License is distributed on an "AS IS" BASIS, > + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > + See the License for the specific language governing permissions and > + limitations under the License. > +--%> > +<%@ include file="viewTableContents.jsp" %> > > Propchange: geronimo/server/branches/2.1/plugins/system-database/sysdb-portlets/src/main/webapp/WEB-INF/view/internaldb/viewTableContentsMaximized.jsp > ------------------------------------------------------------------------------ > svn:eol-style = native > > >