Author: tchemit Date: 2011-11-13 15:18:28 +0100 (Sun, 13 Nov 2011) New Revision: 49 Url: http://forge.codelutin.com/repositories/revision/echobase/49 Log: finalize export screens add jdbc information screen improve actions configuration (use more convention) Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/ConnectToDbInformations.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ExportSqlQueryToFile.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadExportSqlMainPage.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadSqlQueryInGrid.java trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/connectToDbInformations.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/modificationLogs.jsp Removed: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ExportSql.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadPage.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadSqlGrid.java Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ManageSqlQuery.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetEntities.java trunk/echobase-ui/src/main/resources/config/struts-dbeditor.xml trunk/echobase-ui/src/main/resources/config/struts-export.xml trunk/echobase-ui/src/main/resources/config/struts-import.xml trunk/echobase-ui/src/main/resources/config/struts-json.xml trunk/echobase-ui/src/main/resources/config/struts-user.xml trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportGrid.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/ConnectToDbInformations.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/ConnectToDbInformations.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/ConnectToDbInformations.java 2011-11-13 14:18:28 UTC (rev 49) @@ -0,0 +1,61 @@ +/* + * #%L + * EchoBase :: UI + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.ui.actions; + +import fr.ifremer.echobase.EchoBaseConfiguration; +import org.nuiton.topia.TopiaContextFactory; + +import java.util.Properties; + +/** + * Display a page to show connection details. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class ConnectToDbInformations extends EchoBaseActionSupport { + private static final long serialVersionUID = 1L; + + protected String jdbcUrl; + + protected String jdbcLogin; + + public String getJdbcUrl() { + return jdbcUrl; + } + + public String getJdbcLogin() { + return jdbcLogin; + } + + @Override + public String execute() throws Exception { + EchoBaseConfiguration configuration = + getEchoBaseApplicationContext().getConfiguration(); + Properties properties = configuration.getProperties(); + jdbcUrl = properties.getProperty(TopiaContextFactory.CONFIG_URL); + jdbcLogin = properties.getProperty(TopiaContextFactory.CONFIG_USER); + return SUCCESS; + } +} Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/ConnectToDbInformations.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ExportSql.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ExportSql.java 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ExportSql.java 2011-11-13 14:18:28 UTC (rev 49) @@ -1,92 +0,0 @@ -/* - * #%L - * EchoBase :: UI - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.ui.actions.export; - -import fr.ifremer.echobase.services.ExportSqlService; -import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; - -/** - * To export sql to a csv file. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class ExportSql extends EchoBaseActionSupport { - - private static final long serialVersionUID = 1L; - - /** Sql request to execute. */ - protected String sql; - - /** Input stream to load by the stream result. */ - protected transient InputStream inputStream; - - protected String fileName; - - protected int contentLength; - - protected String contentType; - - public void setSql(String sql) { - this.sql = sql; - } - - public void setFileName(String fileName) { - this.fileName = fileName; - } - - public InputStream getInputStream() { - return inputStream; - } - - public String getFileName() { - return fileName; - } - - public int getContentLength() { - return contentLength; - } - - public String getContentType() { - return contentType; - } - - @Override - public String execute() throws Exception { - - ExportSqlService service = newService(ExportSqlService.class); - - contentType = "text/csv"; - String content = service.createCsvStream(sql, - getEchoBaseSession().getEchoBaseUser() - ); - contentLength = content.length(); - inputStream = new ByteArrayInputStream(content.getBytes()); - - return SUCCESS; - } -} Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ExportSqlQueryToFile.java (from rev 47, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ExportSql.java) =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ExportSqlQueryToFile.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ExportSqlQueryToFile.java 2011-11-13 14:18:28 UTC (rev 49) @@ -0,0 +1,96 @@ +/* + * #%L + * EchoBase :: UI + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.ui.actions.export; + +import fr.ifremer.echobase.services.ExportSqlService; +import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; + +/** + * To export sql to a csv file. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class ExportSqlQueryToFile extends EchoBaseActionSupport { + + private static final long serialVersionUID = 1L; + + /** Sql request to execute. */ + protected String sql; + + /** Input stream of the file to download. */ + protected transient InputStream inputStream; + + /** File name of the download. */ + protected String fileName; + + /** Length of the file to download. */ + protected int contentLength; + + /** Content type of the file to download. */ + protected String contentType; + + public void setSql(String sql) { + this.sql = sql; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public InputStream getInputStream() { + return inputStream; + } + + public String getFileName() { + return fileName; + } + + public int getContentLength() { + return contentLength; + } + + public String getContentType() { + return contentType; + } + + @Override + public String execute() throws Exception { + + ExportSqlService service = newService(ExportSqlService.class); + + contentType = "text/csv"; + String content = service.createCsvStream( + sql, + getEchoBaseSession().getEchoBaseUser() + ); + contentLength = content.length(); + inputStream = new ByteArrayInputStream(content.getBytes()); + + return SUCCESS; + } +} Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ExportSqlQueryToFile.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadExportSqlMainPage.java (from rev 47, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadPage.java) =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadExportSqlMainPage.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadExportSqlMainPage.java 2011-11-13 14:18:28 UTC (rev 49) @@ -0,0 +1,92 @@ +/* + * #%L + * EchoBase :: UI + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.ui.actions.export; + +import fr.ifremer.echobase.entities.ExportQuery; +import fr.ifremer.echobase.entities.ExportQueryImpl; +import fr.ifremer.echobase.services.ExportSqlService; +import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; +import org.apache.commons.lang.StringUtils; + +import java.util.Collection; +import java.util.Map; + +/** + * Load export sql main page. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class LoadExportSqlMainPage extends EchoBaseActionSupport { + + private static final long serialVersionUID = 1L; + + /** All available queries from database. */ + protected Map<String, String> queries; + + /** Selected query loaded from database if his id is not empty. */ + protected ExportQuery query; + + public ExportQuery getQuery() { + if (query == null) { + query = new ExportQueryImpl(); + } + return query; + } + + public Map<String, String> getQueries() { + return queries; + } + + public Map<String, String> getTableNames() { + return queries; + } + + @Override + public String execute() throws Exception { + ExportSqlService service = newService(ExportSqlService.class); + + Collection<ExportQuery> sqlQueries = service.getQueries(); + queries = sortAndDecorate(sqlQueries, null); + + if (sqlQueries.isEmpty()) { + // no query saved + addActionMessage(_("echobase.info.no.sqlQuery.saved")); + } + + String selectedQueryId = getQuery().getTopiaId(); + + if (StringUtils.isEmpty(selectedQueryId)) { + + // no query selected + addActionMessage(_("echobase.info.no.sqlQuery.selected")); + } else { + + // load query from database + query = service.getQuery(selectedQueryId); + } + return SUCCESS; + } + +} Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadExportSqlMainPage.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadPage.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadPage.java 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadPage.java 2011-11-13 14:18:28 UTC (rev 49) @@ -1,92 +0,0 @@ -/* - * #%L - * EchoBase :: UI - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.ui.actions.export; - -import fr.ifremer.echobase.entities.ExportQuery; -import fr.ifremer.echobase.entities.ExportQueryImpl; -import fr.ifremer.echobase.services.ExportSqlService; -import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; -import org.apache.commons.lang.StringUtils; - -import java.util.Collection; -import java.util.Map; - -/** - * Load export sql page. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class LoadPage extends EchoBaseActionSupport { - - private static final long serialVersionUID = 1L; - - /** All available queries */ - protected Map<String, String> queries; - - /** Selected query */ - protected ExportQuery query; - - public ExportQuery getQuery() { - if (query == null) { - query = new ExportQueryImpl(); - } - return query; - } - - public Map<String, String> getQueries() { - return queries; - } - - public Map<String, String> getTableNames() { - return queries; - } - - @Override - public String input() throws Exception { - ExportSqlService service = newService(ExportSqlService.class); - - Collection<ExportQuery> sqlQueries = service.getQueries(); - queries = sortAndDecorate(sqlQueries, null); - - if (sqlQueries.isEmpty()) { - // no query saved - addActionMessage(_("echobase.info.no.sqlQuery.saved")); - } - - String selectedQueryId = getQuery().getTopiaId(); - - if (StringUtils.isEmpty(selectedQueryId)) { - - // no query selected - addActionMessage(_("echobase.info.no.sqlQuery.selected")); - } else { - - // load query - query = service.getQuery(selectedQueryId); - } - return INPUT; - } - -} Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadSqlGrid.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadSqlGrid.java 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadSqlGrid.java 2011-11-13 14:18:28 UTC (rev 49) @@ -1,76 +0,0 @@ -/* - * #%L - * EchoBase :: UI - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -package fr.ifremer.echobase.ui.actions.export; - -import fr.ifremer.echobase.services.ExportSqlService; -import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; - -/** - * Load export sql grid page. - * - * @author tchemit <chemit@codelutin.com> - * @since 0.1 - */ -public class LoadSqlGrid extends EchoBaseActionSupport { - - private static final long serialVersionUID = 1L; - - /** Sql request to execute. */ - protected String sql; - - /** Default file name for export. */ - protected String fileName; - - /** names of columns from the executed sql request. */ - protected String[] columnNames; - - public String getSql() { - return sql; - } - - public String[] getColumnNames() { - return columnNames; - } - - public String getFileName() { - return fileName; - } - - public void setSql(String sql) { - this.sql = sql; - } - - @Override - public String input() throws Exception { - - // obtain columNames from the request - ExportSqlService service = newService(ExportSqlService.class); - columnNames = service.getColumnNames(sql); - - // create default file name - - fileName = "export.csv"; - return INPUT; - } -} Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadSqlQueryInGrid.java (from rev 47, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadSqlGrid.java) =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadSqlQueryInGrid.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadSqlQueryInGrid.java 2011-11-13 14:18:28 UTC (rev 49) @@ -0,0 +1,76 @@ +/* + * #%L + * EchoBase :: UI + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.ui.actions.export; + +import fr.ifremer.echobase.services.ExportSqlService; +import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; + +/** + * Load export sql grid page. + * + * @author tchemit <chemit@codelutin.com> + * @since 0.1 + */ +public class LoadSqlQueryInGrid extends EchoBaseActionSupport { + + private static final long serialVersionUID = 1L; + + /** Sql request to execute. */ + protected String sql; + + /** Default file name for export. */ + protected String fileName; + + /** names of columns from the executed sql request. */ + protected String[] columnNames; + + public String getSql() { + return sql; + } + + public String[] getColumnNames() { + return columnNames; + } + + public String getFileName() { + return fileName; + } + + public void setSql(String sql) { + this.sql = sql; + } + + @Override + public String execute() throws Exception { + + // obtain columNames from the request + ExportSqlService service = newService(ExportSqlService.class); + columnNames = service.getColumnNames(sql); + + // create default file name + + fileName = "export.csv"; + return SUCCESS; + } +} Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadSqlQueryInGrid.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ManageSqlQuery.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ManageSqlQuery.java 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ManageSqlQuery.java 2011-11-13 14:18:28 UTC (rev 49) @@ -76,6 +76,7 @@ //TODO : do validation ExportSqlService service = newService(ExportSqlService.class); service.delete(getQuery().getTopiaId()); + query = null; return SUCCESS; } } \ No newline at end of file Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetEntities.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetEntities.java 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetEntities.java 2011-11-13 14:18:28 UTC (rev 49) @@ -23,6 +23,7 @@ */ package fr.ifremer.echobase.ui.actions.json; +import fr.ifremer.echobase.entities.EntityModificationLogImpl; import fr.ifremer.echobase.services.DbEditorService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -49,7 +50,7 @@ protected Map<?, ?>[] datas; public GetEntities() { - super("tableDatas_"); + super("datas_"); } public Map<?, ?>[] getDatas() { @@ -111,4 +112,9 @@ } + public String entityModificationLogs() throws Exception { + tableName = EntityModificationLogImpl.class.getName(); + execute(); + return SUCCESS; + } } Modified: trunk/echobase-ui/src/main/resources/config/struts-dbeditor.xml =================================================================== --- trunk/echobase-ui/src/main/resources/config/struts-dbeditor.xml 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/resources/config/struts-dbeditor.xml 2011-11-13 14:18:28 UTC (rev 49) @@ -40,7 +40,7 @@ <action name="getForeignEntities" class="fr.ifremer.echobase.ui.actions.dbeditor.GetForeignEntities"> <interceptor-ref name="basicStackLoggued"/> - <result name="success">/WEB-INF/jsp/dbeditor/foreignEntities.jsp</result> + <result>/WEB-INF/jsp/dbeditor/foreignEntities.jsp</result> </action> <action name="editTableData" Modified: trunk/echobase-ui/src/main/resources/config/struts-export.xml =================================================================== --- trunk/echobase-ui/src/main/resources/config/struts-export.xml 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/resources/config/struts-export.xml 2011-11-13 14:18:28 UTC (rev 49) @@ -31,50 +31,44 @@ <package name="export" extends="loggued" namespace="/export"> - <action name="exportSql" method="input" - class="fr.ifremer.echobase.ui.actions.export.LoadPage"> - <interceptor-ref name="basicStackLoggued"/> - <result name="input">/WEB-INF/jsp/export/export.jsp</result> + <result-types> + <result-type name="redirectToMainPage" + class="org.apache.struts2.dispatcher.ServletActionRedirectResult"> + <param name="actionName">exportSql</param> + <param name="namespace">export</param> + <param name="query.topiaId">${query.topiaId}</param> + </result-type> + </result-types> + + <default-interceptor-ref name="basicStackLoggued"/> + + <action name="exportSql" + class="fr.ifremer.echobase.ui.actions.export.LoadExportSqlMainPage"> + <result>/WEB-INF/jsp/export/export.jsp</result> </action> + <action name="loadResult" + class="fr.ifremer.echobase.ui.actions.export.LoadSqlQueryInGrid"> + <result>/WEB-INF/jsp/export/exportGrid.jsp</result> + </action> + <action name="cloneQuery" method="cloneQuery" class="fr.ifremer.echobase.ui.actions.export.ManageSqlQuery"> - <interceptor-ref name="basicStackLoggued"/> - <result type="redirectAction"> - <param name="actionName">exportSql</param> - <param name="namespace">export</param> - <param name="query.topiaId">${query.topiaId}</param> - </result> + <result type="redirectToMainPage"/> </action> <action name="saveQuery" method="saveQuery" class="fr.ifremer.echobase.ui.actions.export.ManageSqlQuery"> - <interceptor-ref name="basicStackLoggued"/> - <result type="redirectAction"> - <param name="actionName">exportSql</param> - <param name="namespace">export</param> - <param name="query.topiaId">${query.topiaId}</param> - </result> + <result type="redirectToMainPage"/> </action> <action name="deleteQuery" method="deleteQuery" class="fr.ifremer.echobase.ui.actions.export.ManageSqlQuery"> - <interceptor-ref name="basicStackLoggued"/> - <result type="redirectAction"> - <param name="actionName">exportSql</param> - <param name="namespace">export</param> - </result> + <result type="redirectToMainPage"/> </action> - <action name="loadResult" method="input" - class="fr.ifremer.echobase.ui.actions.export.LoadSqlGrid"> - <interceptor-ref name="basicStackLoggued"/> - <result name="input">/WEB-INF/jsp/export/exportGrid.jsp</result> - </action> - - <action name="downloadExport" method="execute" - class="fr.ifremer.echobase.ui.actions.export.ExportSql"> - <interceptor-ref name="basicStackLoggued"/> + <action name="downloadExport" + class="fr.ifremer.echobase.ui.actions.export.ExportSqlQueryToFile"> <result type="stream"> <param name="contentType">${contentType}</param> <param name="contentLength">${contentLength}</param> Modified: trunk/echobase-ui/src/main/resources/config/struts-import.xml =================================================================== --- trunk/echobase-ui/src/main/resources/config/struts-import.xml 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/resources/config/struts-import.xml 2011-11-13 14:18:28 UTC (rev 49) @@ -42,7 +42,7 @@ <!-- Display import page --> <action name="doImport" class="fr.ifremer.echobase.ui.actions.ImportAction"> <interceptor-ref name="paramsPrepareParamsStackLoggued"/> - <result name="success">/WEB-INF/jsp/import/importProgress.jsp</result> + <result>/WEB-INF/jsp/import/importProgress.jsp</result> </action> </package> Modified: trunk/echobase-ui/src/main/resources/config/struts-json.xml =================================================================== --- trunk/echobase-ui/src/main/resources/config/struts-json.xml 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/resources/config/struts-json.xml 2011-11-13 14:18:28 UTC (rev 49) @@ -31,24 +31,28 @@ <package name="json" extends="loggued" namespace="/json"> + <default-interceptor-ref name="basicStackLoggued"/> + <action name="getUsers" class="fr.ifremer.echobase.ui.actions.json.GetUsers"> - <interceptor-ref name="basicStackLoggued"/> - <interceptor-ref name="checkUserIsAdmin"/> + <!--interceptor-ref name="basicStackLoggued"/> + <interceptor-ref name="checkUserIsAdmin"/--> <result type="json"/> </action> <action name="getExportSqlResult" method="execute" class="fr.ifremer.echobase.ui.actions.json.GetSqlResult"> - <interceptor-ref name="basicStackLoggued"/> <result type="json"/> </action> <action name="getTableDatas" class="fr.ifremer.echobase.ui.actions.json.GetEntities"> - <interceptor-ref name="basicStackLoggued"/> <result type="json"/> </action> + <action name="getEntityModificationLogs" method="entityModificationLogs" + class="fr.ifremer.echobase.ui.actions.json.GetEntities"> + <result type="json"/> + </action> </package> Modified: trunk/echobase-ui/src/main/resources/config/struts-user.xml =================================================================== --- trunk/echobase-ui/src/main/resources/config/struts-user.xml 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/resources/config/struts-user.xml 2011-11-13 14:18:28 UTC (rev 49) @@ -35,7 +35,6 @@ <action name="login" class="fr.ifremer.echobase.ui.actions.LoginAction" method="doLogin"> <result name="input">/WEB-INF/jsp/user/login.jsp</result> - <result name="error">/WEB-INF/jsp/user/login.jsp</result> <result name="redirect" type="redirect">${redirectAction}</result> <interceptor-ref name="paramsPrepareParamsStack"/> </action> @@ -55,7 +54,7 @@ <action name="userList" class="fr.ifremer.echobase.ui.actions.UserAction"> <interceptor-ref name="basicStackLoggued"/> <interceptor-ref name="checkUserIsAdmin"/> - <result name="success">/WEB-INF/jsp/user/userList.jsp</result> + <result>/WEB-INF/jsp/user/userList.jsp</result> </action> <!-- get detail of a user --> @@ -64,11 +63,23 @@ <interceptor-ref name="paramsPrepareParamsStackLoggued"/> <interceptor-ref name="checkUserIsAdmin"/> <result name="input">/WEB-INF/jsp/user/userForm.jsp</result> - <result name="error">/WEB-INF/jsp/user/userForm.jsp</result> <result name="success">/WEB-INF/jsp/user/userForm.jsp</result> <result name="backToList" type="redirectAction">userList</result> </action> + <!-- get db modifications --> + <action name="logs" + class="fr.ifremer.echobase.ui.actions.EchoBaseActionSupport"> + <interceptor-ref name="basicStackLoggued"/> + <result>/WEB-INF/jsp/modificationLogs.jsp</result> + </action> + + <action name="connectToDbInformations" + class="fr.ifremer.echobase.ui.actions.ConnectToDbInformations"> + <interceptor-ref name="basicStackLoggued"/> + <result>/WEB-INF/jsp/connectToDbInformations.jsp</result> + </action> + </package> </struts> Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties =================================================================== --- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2011-11-13 14:18:28 UTC (rev 49) @@ -54,20 +54,29 @@ echobase.label.login=Connexion echobase.label.user.login=Utilisateur \: %s echobase.label.welcome=Bienvenue dans EchoBase +echobase.menu.connectToDbInformations=Se connecter à la base echobase.menu.dbeditor=Modifier les données echobase.menu.export=Exporter des données echobase.menu.import=Importer des données echobase.menu.logs=Visualiser les modifications echobase.menu.users=Gérer les utilisateurs echobase.message.modified.property= +echobase.message.noEntrySelection=Aucune entrée sélectionnée echobase.msg.warnImportInProgress=Merci de ne pas fermer la fenêtre pour pouvoir accéder aux résultats de l'import. echobase.sqlQuery.configuration=Configuration de la requête +echobase.sqlQuery.result=Résultats de la requête +echobase.title.connectToDbInformations=Se connecter à la base de données +echobase.title.connectionToDb.detail=Détail de la connection à la base de données echobase.title.dbEditor=Modification de la base +echobase.title.entityModificationLogs=Journal des modifications echobase.title.export=Export echobase.title.import=Imports echobase.title.importProgress=Import en cours echobase.title.importResult=Résultats de l'import echobase.title.login=Connexion +echobase.title.modification.detail=Détail de la modification echobase.title.users=Adminitration des utilisateurs echobase.user.gridTitle=Liste des utilisateurs echobase.voyage.selectHeader=Selectionnez une campagne +echobase.common.jdbcUrl=Url de connexion +echobase.common.jdbcLogin=Login de connexion Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp 2011-11-13 14:18:28 UTC (rev 49) @@ -69,8 +69,15 @@ </s:a> </li> <li> - <s:a action="logs"><s:text name="echobase.menu.logs"/></s:a> + <s:a action="logs" namespace="/user"> + <s:text name="echobase.menu.logs"/> + </s:a> </li> + <li> + <s:a action="connectToDbInformations" namespace="/user"> + <s:text name="echobase.menu.connectToDbInformations"/> + </s:a> + </li> <s:if test="%{userIsAdmin}"> <li> Added: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/connectToDbInformations.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/connectToDbInformations.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/connectToDbInformations.jsp 2011-11-13 14:18:28 UTC (rev 49) @@ -0,0 +1,44 @@ +<%-- +#%L + EchoBase :: UI + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% +--%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> +<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> + +<title><s:text name="echobase.title.connectToDbInformations"/></title> + +<br/> +<fieldset> + <legend><s:text name="echobase.title.connectionToDb.detail"/></legend> + <s:label key="jdbcUrl" label='%{getText("echobase.common.jdbcUrl")}'/> + <s:label key="jdbcLogin" label='%{getText("echobase.common.jdbcLogin")}'/> +</fieldset> + +<br/> + +<div> + +</div> + + + Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/connectToDbInformations.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2011-11-13 14:18:28 UTC (rev 49) @@ -66,18 +66,11 @@ <sjg:grid id="datas" dataType="json" href="%{loadUrl}" gridModel="datas" caption="%{getText('echobase.common.tableDatas', tableNames[tableName])}" - pager="true" pagerButtons="true" pagerInput="true" - navigator="true" autowidth="true" rownumbers="false" - navigatorEdit="true" - navigatorDelete="false" - navigatorSearch="true" - navigatorRefresh="true" - navigatorAdd="false" - editurl="%{editUrl}" - rowList="10,15,20, 50" - rowNum="10" - viewrecords="true" - resizable="true" editinline="false" + pager="true" pagerButtons="true" pagerInput="true" navigator="true" + autowidth="true" rownumbers="false" viewrecords="true" + navigatorEdit="true" navigatorSearch="true" + navigatorDelete="false" navigatorAdd="false" + editurl="%{editUrl}" rowList="10,15,20, 50" rowNum="10" navigatorSearchOptions="{multipleGroup:false,showQuery:true,multipleSearch:true,sopt:['eq','ne','cn','nc','bw','bn','ew','en','lt','le','gt','ge','nu','nn','in','ni']}"> <sjg:gridColumn name="id" title="id" hidden="true" editable="true"/> Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportGrid.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportGrid.jsp 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportGrid.jsp 2011-11-13 14:18:28 UTC (rev 49) @@ -32,22 +32,23 @@ </s:url> <s:form action="downloadExport" namespace="/export"> + + <fieldset> + <legend><s:text name="echobase.sqlQuery.result"/></legend> + <s:hidden key="sql" label=""/> <s:textfield key="fileName" required="true" size="100" label="%{getText('echobase.common.exportFileName')}"/> <s:submit key="echobase.action.exportSqlData" align="left"/> -</s:form> - -<br/> + <br/> <sjg:grid id="rows" caption="%{getText('echobase.common.request.result')}" dataType="json" href="%{loadUrl}" gridModel="datas" pager="true" pagerButtons="true" pagerInput="true" navigator="true" autowidth="true" rownumbers="false" navigatorEdit="false" navigatorDelete="false" navigatorSearch="false" navigatorRefresh="false" - navigatorAdd="false" - rowList="10,15,20,50" rowNum="10" - viewrecords="true" resizable="true" editinline="false"> + navigatorAdd="false" rowList="10,15,20,50" rowNum="10" + viewrecords="true"> <s:iterator value="columnNames" var="name" status="status"> @@ -56,4 +57,8 @@ </s:iterator> </sjg:grid> + </fieldset> +</s:form> + + Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp 2011-11-13 14:18:28 UTC (rev 49) @@ -23,9 +23,6 @@ --%> <%@ page language="java" contentType="text/html" pageEncoding="utf-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> -<%--<s:set var="userIsAdmin" value="%{#session.echobaseSession.echobaseUser.admin}"/>--%> <title><s:text name="echobase.label.welcome"/></title> <h2><s:text name="echobase.label.welcome"/></h2> - -<hr/> \ No newline at end of file Added: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/modificationLogs.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/modificationLogs.jsp (rev 0) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/modificationLogs.jsp 2011-11-13 14:18:28 UTC (rev 49) @@ -0,0 +1,81 @@ +<%-- +#%L + EchoBase :: UI + $Id$ + $HeadURL$ + %% + Copyright (C) 2011 Ifremer, Codelutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + #L% +--%> +<%@page contentType="text/html" pageEncoding="UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> +<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %> +<script type="text/javascript" + src="<s:url value='/js/gridHelper.js' />"></script> +<s:set var="emptySelection"><s:text name="echobase.message.noEntrySelection"/></s:set> +<script type="text/javascript"> + + function formatEntityLabel(cellvalue, options, rowObject) { + var columnName = options.colModel.name + "_lib"; + return rowObject[columnName]; + } + + jQuery(document).ready(function () { + $.addRowSelectTopic('datas', function(event){ + var text = $("tr[aria-selected=true] td[aria-describedby='datas_modificationText']").text(); + $('#modificationTextContainter').html(text); + }); + $.addClearSelectTopic('datas', function(event){ + $('#modificationTextContainter').html("${emptySelection}"); + }); + }); +</script> + +<title><s:text name="echobase.title.entityModificationLogs"/></title> +<s:url id="loadUrl" action="getEntityModificationLogs" namespace="/json" + escapeAmp="false"/> + +<sjg:grid id="datas" dataType="json" href="%{loadUrl}" gridModel="datas" + caption="%{getText('echobase.common.entityModificationLog')}" + pager="true" pagerButtons="true" pagerInput="true" navigator="true" + autowidth="true" rownumbers="false" viewrecords="true" + navigatorEdit="false" navigatorSearch="false" + navigatorDelete="false" navigatorAdd="false" + rowList="10,15,20, 50" rowNum="10" + onSelectRowTopics='datas-rowSelect' + onCompleteTopics='datas-cleanSelect'> + + <sjg:gridColumn name="entityType" sortable="true" + title="%{getText('echobase.common.entityType')}"/> + <sjg:gridColumn name="entityId" sortable="true" + title="%{getText('echobase.common.entityId')}"/> + <sjg:gridColumn name="modificationDate" sortable="true" + title="%{getText('echobase.common.modificationDate')}"/> + <sjg:gridColumn name="modificationText" sortable="true" + title="%{getText('echobase.common.modificationText')}"/> + <sjg:gridColumn name="user" sortable="true" formatter="formatEntityLabel" + title="%{getText('echobase.common.user')}"/> + +</sjg:grid> +<br/> +<fieldset> + <legend><s:text name="echobase.title.modification.detail"/></legend> + <pre id='modificationTextContainter'></pre> +</fieldset> + + + Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/modificationLogs.jsp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp 2011-11-13 13:59:42 UTC (rev 48) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp 2011-11-13 14:18:28 UTC (rev 49) @@ -65,9 +65,8 @@ onCompleteTopics='users-cleanSelect' navigatorEdit="false" navigatorDelete="false" navigatorSearch="false" navigatorRefresh="false" - navigatorAdd="false" - editinline="false" resizable="true" - rowList="10,15,20, 50" rowNum="10" viewrecords="true" + navigatorAdd="false" viewrecords="true" + rowList="10,15,20, 50" rowNum="10" navigatorExtraButtons="{ add: { title : 'Ajouter', icon: 'ui-icon-plus', topic: 'users-rowAdd' }, update: { title : 'Mettre à jour', icon: 'ui-icon-pencil', topic: 'users-rowUpdate' },