Echobase-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
November 2011
- 3 participants
- 137 discussions
r49 - in trunk/echobase-ui/src/main: java/fr/ifremer/echobase/ui/actions java/fr/ifremer/echobase/ui/actions/export java/fr/ifremer/echobase/ui/actions/json resources/config resources/i18n webapp/WEB-INF/includes webapp/WEB-INF/jsp webapp/WEB-INF/jsp/dbeditor webapp/WEB-INF/jsp/export webapp/WEB-INF/jsp/user
by tchemit@users.forge.codelutin.com 13 Nov '11
by tchemit@users.forge.codelutin.com 13 Nov '11
13 Nov '11
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(a)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(a)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(a)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(a)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(a)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(a)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(a)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' },
1
0
13 Nov '11
Author: tchemit
Date: 2011-11-13 14:59:42 +0100 (Sun, 13 Nov 2011)
New Revision: 48
Url: http://forge.codelutin.com/repositories/revision/echobase/48
Log:
add callback
Modified:
trunk/echobase-ui/src/main/webapp/js/gridHelper.js
Modified: trunk/echobase-ui/src/main/webapp/js/gridHelper.js
===================================================================
--- trunk/echobase-ui/src/main/webapp/js/gridHelper.js 2011-11-12 22:53:44 UTC (rev 47)
+++ trunk/echobase-ui/src/main/webapp/js/gridHelper.js 2011-11-13 13:59:42 UTC (rev 48)
@@ -25,7 +25,7 @@
$.fn.extend(
{
- addRowSelectTopic: function(gridId) {
+ addRowSelectTopic: function(gridId, callback) {
$.subscribe(gridId + '-rowSelect', function(event) {
var gridId = event.data.id;
var opts = jQuery.struts2_jquery[gridId] = {};
@@ -33,14 +33,22 @@
if (id) {
opts['selectedRow'] = id;
}
- }, {id:gridId});
+ var callback = event.data.callback;
+ if (callback) {
+ callback(event);
+ }
+ }, {id:gridId, callback:callback});
},
- addClearSelectTopic: function (gridId) {
+ addClearSelectTopic: function (gridId, callback) {
$.subscribe(gridId + '-cleanSelect', function(event) {
var gridId = event.data.id;
jQuery.struts2_jquery[gridId] = {};
- }, {id:gridId});
+ var callback = event.data.callback;
+ if (callback) {
+ callback(event);
+ }
+ }, {id:gridId, callback:callback});
},
addAddRowTopic: function (gridId, url) {
@@ -125,12 +133,12 @@
});
$.extend({
- addRowSelectTopic:function(gridId) {
- return $(document).addRowSelectTopic(gridId);
+ addRowSelectTopic:function(gridId, callback) {
+ return $(document).addRowSelectTopic(gridId, callback);
},
- addClearSelectTopic:function(gridId) {
- return $(document).addClearSelectTopic(gridId);
+ addClearSelectTopic:function(gridId, callback) {
+ return $(document).addClearSelectTopic(gridId, callback);
},
addAddRowTopic:function(gridId, url) {
1
0
r47 - in trunk/echobase-ui: . src/main/java/fr/ifremer/echobase/ui/actions/export src/main/java/fr/ifremer/echobase/ui/actions/json src/main/resources src/main/resources/config src/main/resources/i18n src/main/webapp/WEB-INF src/main/webapp/WEB-INF/includes src/main/webapp/WEB-INF/jsp/dbeditor src/main/webapp/WEB-INF/jsp/export src/main/webapp/WEB-INF/jsp/user src/main/webapp/css
by tchemit@users.forge.codelutin.com 12 Nov '11
by tchemit@users.forge.codelutin.com 12 Nov '11
12 Nov '11
Author: tchemit
Date: 2011-11-12 23:53:44 +0100 (Sat, 12 Nov 2011)
New Revision: 47
Url: http://forge.codelutin.com/repositories/revision/echobase/47
Log:
- finish export (create csv file to donwload)
- add filtred data in configuration from pom
- improve layout for actions
Added:
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/ManageSqlQuery.java
Removed:
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/SaveExportQuery.java
trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp
Modified:
trunk/echobase-ui/pom.xml
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
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/GetSqlResult.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-json.xml
trunk/echobase-ui/src/main/resources/echobase.properties
trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/includes/i18n.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/export.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportGrid.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userForm.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp
trunk/echobase-ui/src/main/webapp/css/screen.css
Modified: trunk/echobase-ui/pom.xml
===================================================================
--- trunk/echobase-ui/pom.xml 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/pom.xml 2011-11-12 22:53:44 UTC (rev 47)
@@ -227,21 +227,23 @@
<resources>
<resource>
- <directory>src/main/filters</directory>
- <filtering>true</filtering>
+ <directory>src/main/resources</directory>
<includes>
- <include>*.properties</include>
+ <include>**/*</include>
</includes>
+ <excludes>
+ <exclude>echobase.properties</exclude>
+ </excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
+ <filtering>true</filtering>
<includes>
- <include>**/*</include>
+ <include>echobase.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/env/${env}/resources</directory>
- <!--<filtering>true</filtering>-->
<includes>
<include>*.properties</include>
</includes>
Added: 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 (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ExportSql.java 2011-11-12 22:53:44 UTC (rev 47)
@@ -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.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(a)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;
+ }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ExportSql.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/LoadPage.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadPage.java 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadPage.java 2011-11-12 22:53:44 UTC (rev 47)
@@ -89,25 +89,4 @@
return INPUT;
}
-// public String getEditType(ColumnMeta meta) {
-// Class<?> type = meta.getType();
-// String editType = "text";
-// if (boolean.class.equals(type)) {
-// editType = "checkbox";
-// } else if (TopiaEntity.class.isAssignableFrom(type)) {
-// editType = "select";
-// }
-// return editType;
-// }
-//
-// public String getFormatter(ColumnMeta meta) {
-// Class<?> type = meta.getType();
-// String editType = "'string'";
-// if (boolean.class.equals(type)) {
-// editType = "'checkbox'";
-// } else if (TopiaEntity.class.isAssignableFrom(type)) {
-// editType = "'formatEntityLabel'";
-// }
-// return editType;
-// }
}
Modified: 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-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadSqlGrid.java 2011-11-12 22:53:44 UTC (rev 47)
@@ -39,6 +39,9 @@
/** 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;
@@ -50,6 +53,10 @@
return columnNames;
}
+ public String getFileName() {
+ return fileName;
+ }
+
public void setSql(String sql) {
this.sql = sql;
}
@@ -61,6 +68,9 @@
ExportSqlService service = newService(ExportSqlService.class);
columnNames = service.getColumnNames(sql);
+ // create default file name
+
+ fileName = "export.csv";
return INPUT;
}
}
Added: 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 (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ManageSqlQuery.java 2011-11-12 22:53:44 UTC (rev 47)
@@ -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%
+ */
+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;
+
+/**
+ * To manage {@link ExportQuery}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class ManageSqlQuery extends EchoBaseActionSupport {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Selected query */
+ protected ExportQuery query;
+
+ public ExportQuery getQuery() {
+ if (query == null) {
+ query = new ExportQueryImpl();
+ }
+ return query;
+ }
+
+ public String saveQuery() throws Exception {
+
+ //TODO : do validation
+ ExportSqlService service = newService(ExportSqlService.class);
+
+ query = service.createOrUpdate(getQuery(),
+ getEchoBaseSession().getEchoBaseUser()
+ );
+ return SUCCESS;
+ }
+
+ public String cloneQuery() throws Exception {
+
+ //TODO : do validation
+ ExportSqlService service = newService(ExportSqlService.class);
+
+ getQuery().setTopiaId(null);
+ query = service.createOrUpdate(getQuery(),
+ getEchoBaseSession().getEchoBaseUser()
+ );
+ return SUCCESS;
+ }
+
+ public String deleteQuery() throws Exception {
+
+ //TODO : do validation
+ ExportSqlService service = newService(ExportSqlService.class);
+ service.delete(getQuery().getTopiaId());
+ return SUCCESS;
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/ManageSqlQuery.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/SaveExportQuery.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/SaveExportQuery.java 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/SaveExportQuery.java 2011-11-12 22:53:44 UTC (rev 47)
@@ -1,62 +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;
-
-/**
- * To save a given export query.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class SaveExportQuery extends EchoBaseActionSupport {
-
- private static final long serialVersionUID = 1L;
-
- /** Selected query */
- protected ExportQuery query;
-
- public ExportQuery getQuery() {
- if (query == null) {
- query = new ExportQueryImpl();
- }
- return query;
- }
-
- @Override
- public String execute() throws Exception {
-
- //TODO : do validation
- ExportSqlService service = newService(ExportSqlService.class);
-
- service.createOrUpdate(getQuery(),
- getEchoBaseSession().getEchoBaseUser()
- );
- return SUCCESS;
- }
-}
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-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetEntities.java 2011-11-12 22:53:44 UTC (rev 47)
@@ -87,11 +87,11 @@
String sortColumn = getSortColumn();
Object filterObject = getFilterObject();
- if (log.isInfoEnabled()) {
- log.info("filters = " + getFilters());
- log.info("filterObject = " + filterObject);
- log.info("sidx = " + sortColumn);
- log.info("sord = " + ascendantOrder);
+ if (log.isDebugEnabled()) {
+ log.debug("filters = " + getFilters());
+ log.debug("filterObject = " + filterObject);
+ log.debug("sidx = " + sortColumn);
+ log.debug("sord = " + ascendantOrder);
}
DbEditorService dbEditorService = newService(DbEditorService.class);
@@ -103,8 +103,8 @@
ascendantOrder
);
- if (log.isInfoEnabled()) {
- log.info("Total page = " + getTotal());
+ if (log.isDebugEnabled()) {
+ log.debug("Total page = " + getTotal());
}
return SUCCESS;
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetSqlResult.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetSqlResult.java 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetSqlResult.java 2011-11-12 22:53:44 UTC (rev 47)
@@ -40,9 +40,6 @@
/** Sql request to execute. */
protected String sql;
-// /** names of columns from the executed sql request. */
-// protected String[] columnNames;
-
/** Datas of the given table. */
protected Map<?, ?>[] datas;
@@ -54,10 +51,6 @@
this.sql = sql;
}
-// public String[] getColumnNames() {
-// return columnNames;
-// }
-
public Map<?, ?>[] getDatas() {
return datas;
}
Modified: trunk/echobase-ui/src/main/resources/config/struts-dbeditor.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/config/struts-dbeditor.xml 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/resources/config/struts-dbeditor.xml 2011-11-12 22:53:44 UTC (rev 47)
@@ -37,12 +37,6 @@
<result name="input">/WEB-INF/jsp/dbeditor/dbeditor.jsp</result>
</action>
- <action name="getTableDatas"
- class="fr.ifremer.echobase.ui.actions.json.GetEntities">
- <interceptor-ref name="basicStackLoggued"/>
- <result type="json"/>
- </action>
-
<action name="getForeignEntities"
class="fr.ifremer.echobase.ui.actions.dbeditor.GetForeignEntities">
<interceptor-ref name="basicStackLoggued"/>
Modified: trunk/echobase-ui/src/main/resources/config/struts-export.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/config/struts-export.xml 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/resources/config/struts-export.xml 2011-11-12 22:53:44 UTC (rev 47)
@@ -37,14 +37,18 @@
<result name="input">/WEB-INF/jsp/export/export.jsp</result>
</action>
- <action name="loadResult" method="input"
- class="fr.ifremer.echobase.ui.actions.export.LoadSqlGrid">
+ <action name="cloneQuery" method="cloneQuery"
+ class="fr.ifremer.echobase.ui.actions.export.ManageSqlQuery">
<interceptor-ref name="basicStackLoggued"/>
- <result name="input">/WEB-INF/jsp/export/exportGrid.jsp</result>
+ <result type="redirectAction">
+ <param name="actionName">exportSql</param>
+ <param name="namespace">export</param>
+ <param name="query.topiaId">${query.topiaId}</param>
+ </result>
</action>
- <action name="saveQuery"
- class="fr.ifremer.echobase.ui.actions.export.SaveExportQuery">
+ <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>
@@ -53,12 +57,31 @@
</result>
</action>
- <action name="getSqlResult" method="execute"
- class="fr.ifremer.echobase.ui.actions.json.GetSqlResult">
+ <action name="deleteQuery" method="deleteQuery"
+ class="fr.ifremer.echobase.ui.actions.export.ManageSqlQuery">
<interceptor-ref name="basicStackLoggued"/>
- <result type="json"/>
+ <result type="redirectAction">
+ <param name="actionName">exportSql</param>
+ <param name="namespace">export</param>
+ </result>
</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"/>
+ <result type="stream">
+ <param name="contentType">${contentType}</param>
+ <param name="contentLength">${contentLength}</param>
+ <param name="contentDisposition">filename="${fileName}"</param>
+ </result>
+ </action>
+
</package>
</struts>
Modified: trunk/echobase-ui/src/main/resources/config/struts-json.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/config/struts-json.xml 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/resources/config/struts-json.xml 2011-11-12 22:53:44 UTC (rev 47)
@@ -38,6 +38,18 @@
<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>
+
</package>
</struts>
Modified: trunk/echobase-ui/src/main/resources/echobase.properties
===================================================================
--- trunk/echobase-ui/src/main/resources/echobase.properties 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/resources/echobase.properties 2011-11-12 22:53:44 UTC (rev 47)
@@ -21,6 +21,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# #L%
###
+
+application.version=${project.version}
+application.site.url=${project.url}
+
hibernate.hbm2ddl.auto=none
hibernate.show_sql=false
hibernate.dialect=org.hibernate.dialect.H2Dialect
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-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2011-11-12 22:53:44 UTC (rev 47)
@@ -1,16 +1,22 @@
echobase.action.applySqlQuery=Appliquer la requête
+echobase.action.backToUserList=Retour à la liste des utilisateurs
+echobase.action.cloneSqlQuery=Cloner la requête
echobase.action.create=Créer
echobase.action.delete=Suppression
+echobase.action.deleteSqlQuery=Supprimer la requête
+echobase.action.exportSqlData=Exporter les données
echobase.action.import=Importer
echobase.action.locale.english=Anglais
echobase.action.locale.french=Français
echobase.action.login=Connection
echobase.action.logout=Déconnexion
+echobase.action.reloadSqlQuery=Recharger
echobase.action.save=Sauvegarder
echobase.action.saveSqlQuery=Enregistrer la requête
echobase.common.admin=Administrateur
echobase.common.comment=Commentaire
echobase.common.email=Email
+echobase.common.exportFileName=Nom du fichier d'export
echobase.common.import=Import configuration
echobase.common.password=Mot de passe
echobase.common.query.description=Description
@@ -47,12 +53,12 @@
echobase.label.locale.french=Français
echobase.label.login=Connexion
echobase.label.user.login=Utilisateur \: %s
-echobase.label.welcome=Bienvenue
-echobase.menu.dbeditor=Modification du référentiel
-echobase.menu.export=Export sql
-echobase.menu.import=Imports
-echobase.menu.logs=Logs
-echobase.menu.users=Utilisateurs
+echobase.label.welcome=Bienvenue dans EchoBase
+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.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
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml 2011-11-12 22:53:44 UTC (rev 47)
@@ -31,7 +31,7 @@
<pattern>/index*</pattern>
<pattern>/dbeditor/getForeignEntities*</pattern>
<pattern>/export/loadResult*</pattern>
- <pattern>/export/getSqlResult*</pattern>
+ <pattern>/json/*</pattern>
</excludes>
<decorator name="layout-default" page="layout-default.jsp">
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-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp 2011-11-12 22:53:44 UTC (rev 47)
@@ -24,7 +24,8 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<s:set var="userIsAdmin" value="%{#session.echoBaseSession.echoBaseUser.admin}"/>
+<s:set var="userIsAdmin"
+ value="%{#session.echoBaseSession.echoBaseUser.admin}"/>
<div class='displayBlock'>
@@ -48,9 +49,37 @@
</ul>
</div>
<br/>
- <%@ include file="i18n.jsp" %>
+ <%@ include file="i18n.jsp" %>
<br/>
</div>
- <%@ include file="menu.jsp" %>
+ <div class="cleanBoth">
+ <ul>
+ <li>
+ <s:a action="import" namespace="/import">
+ <s:text name="echobase.menu.import"/></s:a>
+ </li>
+ <li>
+ <s:a action="exportSql" namespace="/export">
+ <s:text name="echobase.menu.export"/>
+ </s:a>
+ </li>
+ <li>
+ <s:a action="dbeditor" namespace="/dbeditor">
+ <s:text name="echobase.menu.dbeditor"/>
+ </s:a>
+ </li>
+ <li>
+ <s:a action="logs"><s:text name="echobase.menu.logs"/></s:a>
+ </li>
+ <s:if
+ test="%{userIsAdmin}">
+ <li>
+ <s:a action="userList" namespace="/user">
+ <s:text name="echobase.menu.users"/>
+ </s:a>
+ </li>
+ </s:if>
+ </ul>
+ </div>
</div>
<hr/>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/i18n.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/includes/i18n.jsp 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/i18n.jsp 2011-11-12 22:53:44 UTC (rev 47)
@@ -22,7 +22,7 @@
#L%
--%>
<%@ taglib prefix="s" uri="/struts-tags" %>
-<div class="cleanBoth">
+<%--div class="cleanBoth">
<s:text name="echobase.label.language"/>
<ul>
<li>
@@ -50,4 +50,4 @@
</s:else>
</li>
</ul>
-</div>
+</div--%>
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp 2011-11-12 22:53:44 UTC (rev 47)
@@ -1,46 +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%
- --%>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<div class="cleanBoth">
- <ul>
- <li>
- <s:a action="import" namespace="/import"><s:text name="echobase.menu.import"/></s:a>
- </li>
- <li>
- <s:a action="exportSql" namespace="/export"><s:text name="echobase.menu.export"/></s:a>
- </li>
- <li>
- <s:a action="logs"><s:text name="echobase.menu.logs"/></s:a>
- </li>
- <li>
- <s:a action="dbeditor" namespace="/dbeditor"><s:text name="echobase.menu.dbeditor"/></s:a>
- </li>
- <s:if
- test="%{userIsAdmin}">
- <li>
- <s:a action="userList" namespace="/user"><s:text name="echobase.menu.users"/></s:a>
- </li>
- </s:if>
- </ul>
-</div>
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-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2011-11-12 22:53:44 UTC (rev 47)
@@ -53,7 +53,7 @@
<br/>
<s:if test="tableName!=null and tableName != ''">
- <s:url id="loadUrl" action="getTableDatas" namespace="/dbeditor"
+ <s:url id="loadUrl" action="getTableDatas" namespace="/json"
escapeAmp="false">
<s:param name="tableName" value="%{tableName}"/>
</s:url>
@@ -64,9 +64,8 @@
</s:url>
- <sjg:grid id="tableDatas"
+ <sjg:grid id="datas" dataType="json" href="%{loadUrl}" gridModel="datas"
caption="%{getText('echobase.common.tableDatas', tableNames[tableName])}"
- dataType="json" href="%{loadUrl}" gridModel="datas"
pager="true" pagerButtons="true" pagerInput="true"
navigator="true" autowidth="true" rownumbers="false"
navigatorEdit="true"
@@ -100,7 +99,6 @@
editoptions="{dataUrl : '%{urlName}'}"
formatter='formatEntityLabel'
sortable="true" editable="true"/>
-
</s:if>
<s:else>
<sjg:gridColumn name="%{#meta.name}"
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/export.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/export.jsp 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/export.jsp 2011-11-12 22:53:44 UTC (rev 47)
@@ -29,32 +29,48 @@
<s:url id="loadGridUrl" action="loadResult" namespace="/export"/>
<script type="text/javascript">
+ function reloadQuery() {
+ var queryId = $('[name="query.topiaId"]').val();
+ var url = "${loadUrl}?" + $.param({ 'query.topiaId':queryId});
+ window.location = url;
+ return false;
+ }
+
+ function loadGridData() {
+ // get sql query
+ var sqlQuery = "${loadGridUrl}?" + $.param({ sql :$('[name="query.sqlQuery"]').val()});
+
+ $.ajax(sqlQuery, {
+ success: function(data, textStatus, jqXHR) {
+ $('#resultGrid').html(data);
+ }
+ });
+ return false;
+ }
+
jQuery(document).ready(function () {
$('[name="query.topiaId"]').change(function(event) {
var url = "${loadUrl}?" + $.param({ 'query.topiaId':this.value});
- console.info("Reload url " + url);
window.location = url;
});
+
+ var queryId = $('[name="query.topiaId"]').val();
+ if (queryId) {
+ // auto launch query
+ loadGridData();
+ }
+
});
- function loadGridData() {
- // get sql query
- var sqlQuery = "${loadGridUrl}?" + $.param({ sql :$('[name="query.sqlQuery"]').val()});
- $.ajax(sqlQuery, {
- success: function(data, textStatus, jqXHR) {
- $('#resultGrid').html(data);
- console.info("Return " + data);
- }
- });
- return false;
- }
</script>
<title><s:text name="echobase.title.export"/></title>
+<s:set var="queryExists" value="query.topiaId != null && query.topiaId != ''"/>
+
<s:form id="exportQueryForm" namespace="/export">
<s:select key="query.topiaId" label="%{getText('echobase.common.sqlQueries')}"
@@ -65,30 +81,56 @@
<fieldset>
<legend><s:text name="echobase.sqlQuery.configuration"/></legend>
- <s:textfield key="query.name" required="true"
- label="%{getText('echobase.common.query.name')}" size="40"/>
+ <s:textarea key="query.name" required="true" cols="160" rows="1"
+ label="%{getText('echobase.common.query.name')}"/>
- <s:textarea key="query.description" required="true" cols="160" rows="6"
+ <s:textarea key="query.description" required="true" cols="160" rows="2"
label="%{getText('echobase.common.query.description')}"/>
- <s:textarea key="query.sqlQuery" required="true" cols="160" rows="6"
+ <s:textarea key="query.sqlQuery" required="true" cols="160" rows="4"
label="%{getText('echobase.common.sqlQuery')}"/>
- <s:label value="%{query.lastModifiedDate}" readonly="true"
- label="%{getText('echobase.common.lastModifiedDate')}"/>
+ <s:if test="queryExists">
- <s:label value="%{decorate(query.lastModifiedUser, null)}" readonly="true"
- label="%{getText('echobase.common.lastModifiedUser')}"/>
- </fieldset>
- <br/>
+ <s:label value="%{query.lastModifiedDate}" readonly="true"
+ label="%{getText('echobase.common.lastModifiedDate')}"/>
- <s:submit action="saveQuery" key="echobase.action.saveSqlQuery"
- align="right"/>
+ <s:label value="%{decorate(query.lastModifiedUser, null)}" readonly="true"
+ label="%{getText('echobase.common.lastModifiedUser')}"/>
- <s:submit key="echobase.action.applySqlQuery" align="right" onclick="return loadGridData();"/>
+ </s:if>
+
+
+ <ul class="toolbar floatRight">
+ <s:if test="queryExists">
+ <li>
+ <s:submit onclick="return reloadQuery();"
+ key="echobase.action.reloadSqlQuery"
+ theme="simple"/>
+ </li>
+ <li>
+ <s:submit action="cloneQuery" key="echobase.action.cloneSqlQuery"
+ theme="simple"/>
+ </li>
+ <li>
+ <s:submit action="deleteQuery" key="echobase.action.deleteSqlQuery"
+ theme="simple"/>
+ </li>
+ </s:if>
+ <li>
+ <s:submit action="saveQuery" key="echobase.action.saveSqlQuery"
+ theme="simple"/>
+ </li>
+ <li>
+ <s:submit key="echobase.action.applySqlQuery" theme="simple"
+ onclick="return loadGridData();"/>
+ </li>
+ </ul>
+ </fieldset>
</s:form>
<br/>
-<div id="resultGrid"></div>
+<div id="resultGrid" class="cleanBoth"></div>
+
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-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportGrid.jsp 2011-11-12 22:53:44 UTC (rev 47)
@@ -26,17 +26,25 @@
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %>
-<s:url id="loadUrl" action="getSqlResult" namespace="/export"
+<s:url id="loadUrl" action="getExportSqlResult" namespace="/json"
escapeAmp="false">
<s:param name="sql" value="%{sql}"/>
</s:url>
+<s:form action="downloadExport" namespace="/export">
+ <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/>
<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="true"
+ navigatorSearch="false" navigatorRefresh="false"
navigatorAdd="false"
rowList="10,15,20,50" rowNum="10"
viewrecords="true" resizable="true" editinline="false">
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userForm.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userForm.jsp 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userForm.jsp 2011-11-12 22:53:44 UTC (rev 47)
@@ -30,9 +30,12 @@
src="<s:url value='/js/gridHelper.js' />"></script>
<%-- CRUD constants --%>
-<s:set name="create"><%=EditActionEnum.CREATE.toString()%></s:set>
-<s:set name="edit"><%=EditActionEnum.EDIT.toString()%></s:set>
-<s:set name="delete"><%=EditActionEnum.DELETE.toString()%></s:set>
+<s:set name="create"><%=EditActionEnum.CREATE.toString()%>
+</s:set>
+<s:set name="edit"><%=EditActionEnum.EDIT.toString()%>
+</s:set>
+<s:set name="delete"><%=EditActionEnum.DELETE.toString()%>
+</s:set>
<s:if test="userEditAction == #create">
<s:set name="title"><s:text name="echobase.label.admin.user.create"/></s:set>
@@ -60,12 +63,17 @@
<s:hidden key="userEditAction" label=""/>
<s:textfield key="user.email" label="%{getText('echobase.common.email')}"
size="40" required="true"/>
- <s:password key="user.password" label="%{getText('echobase.common.password')}"
- size="40" required="true"/>
+ <s:password key="user.password"
+ label="%{getText('echobase.common.password')}"
+ size="40" required="true"/>
<s:checkbox key="user.admin" label="%{getText('echobase.common.admin')}"/>
</fieldset>
- <br/>
- <s:submit action="userForm" method="doCreateOrUpdate" key="echobase.action.create" align="right"/>
+ <ul class="toolbar floatRight">
+ <li><s:submit action="userForm" method="doCreateOrUpdate"
+ key="echobase.action.create" theme="simple"/></li>
+ <li><s:submit action="userList" key="echobase.action.backToUserList"
+ theme="simple"/></li>
+ </ul>
</s:form>
</s:if>
<s:elseif test="userEditAction == #edit">
@@ -82,12 +90,16 @@
<s:textfield key="user.email" label="%{getText('echobase.common.email')}"
size="40"/>
<s:password name="user.password" value="" key="echobase.common.password"
- size="40"/>
+ size="40"/>
<s:checkbox value="%{user.admin}" key="echobase.common.admin"/>
</fieldset>
<p><s:text name="echobase.label.info.changePassword"/></p>
- <br/>
- <s:submit action="userForm" method="doCreateOrUpdate" key="echobase.action.save" align="right"/>
+ <ul class="toolbar floatRight">
+ <li><s:submit action="userForm" method="doCreateOrUpdate"
+ key="echobase.action.save" theme="simple"/></li>
+ <li><s:submit action="userList" key="echobase.action.backToUserList"
+ theme="simple"/></li>
+ </ul>
</s:form>
</s:elseif>
<s:elseif test="userEditAction == #delete">
@@ -103,10 +115,15 @@
<s:hidden name="userEditAction" label=""/>
<s:textfield key="user.email" label="%{getText('echobase.common.email')}"
size="40" disabled="true"/>
- <s:checkbox value="%{user.admin}" key="echobase.common.admin" disabled="true"/>
+ <s:checkbox value="%{user.admin}" key="echobase.common.admin"
+ disabled="true"/>
</fieldset>
- <br/>
- <s:submit action="userForm" method="doDelete" key="echobase.action.delete" align="right"/>
+ <ul class="toolbar floatRight">
+ <li><s:submit action="userForm" method="doDelete"
+ key="echobase.action.delete" theme="simple"/></li>
+ <li><s:submit action="userList" key="echobase.action.backToUserList"
+ theme="simple"/></li>
+ </ul>
</s:form>
</s:elseif>
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-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp 2011-11-12 22:53:44 UTC (rev 47)
@@ -67,7 +67,7 @@
navigatorSearch="false" navigatorRefresh="false"
navigatorAdd="false"
editinline="false" resizable="true"
- rowList="10,15,20, 50" rowNum="10"
+ rowList="10,15,20, 50" rowNum="10" viewrecords="true"
navigatorExtraButtons="{
add: { title : 'Ajouter', icon: 'ui-icon-plus', topic: 'users-rowAdd' },
update: { title : 'Mettre à jour', icon: 'ui-icon-pencil', topic: 'users-rowUpdate' },
Modified: trunk/echobase-ui/src/main/webapp/css/screen.css
===================================================================
--- trunk/echobase-ui/src/main/webapp/css/screen.css 2011-11-12 22:52:13 UTC (rev 46)
+++ trunk/echobase-ui/src/main/webapp/css/screen.css 2011-11-12 22:53:44 UTC (rev 47)
@@ -195,6 +195,17 @@
padding: 0 5px;
}
+ul.toolbar {
+ display:inline;
+ /*line-height: 20px;*/
+ /*padding: 0 5px;*/
+}
+
+ul.toolbar li {
+ display:inline;
+ padding: 0 5px;
+}
+
#footer ul li {
display:inline;
list-style: none;
1
0
r46 - trunk/echobase-services/src/main/java/fr/ifremer/echobase/services
by tchemit@users.forge.codelutin.com 12 Nov '11
by tchemit@users.forge.codelutin.com 12 Nov '11
12 Nov '11
Author: tchemit
Date: 2011-11-12 23:52:13 +0100 (Sat, 12 Nov 2011)
New Revision: 46
Url: http://forge.codelutin.com/repositories/revision/echobase/46
Log:
change log levels + finish export service (create the csv file)
Modified:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportSqlService.java
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2011-11-12 20:23:18 UTC (rev 45)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2011-11-12 22:52:13 UTC (rev 46)
@@ -116,13 +116,13 @@
int from = pager.getStartIndex();
int to = pager.getEndIndex();
- if (log.isInfoEnabled()) {
- log.info("Count = " + count);
- log.info("page = " + pager.getPageNumber());
- log.info("pageSize = " + pager.getPageSize());
- log.info("from = " + from);
- log.info("to = " + to);
- log.info("pageCount= " + pager.getPageCount());
+ if (log.isDebugEnabled()) {
+ log.debug("Count = " + count);
+ log.debug("page = " + pager.getPageNumber());
+ log.debug("pageSize = " + pager.getPageSize());
+ log.debug("from = " + from);
+ log.debug("to = " + to);
+ log.debug("pageCount= " + pager.getPageCount());
}
TopiaQuery query = dao.createQuery("e");
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportSqlService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportSqlService.java 2011-11-12 20:23:18 UTC (rev 45)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportSqlService.java 2011-11-12 22:52:13 UTC (rev 46)
@@ -75,7 +75,7 @@
}
}
- public void createOrUpdate(ExportQuery exportQuery, EchoBaseUser user) {
+ public ExportQuery createOrUpdate(ExportQuery exportQuery, EchoBaseUser user) {
try {
ExportQueryDAO dao = getDAO();
ExportQuery entityToSave;
@@ -96,11 +96,24 @@
dao.update(entityToSave);
getTransaction().commitTransaction();
+ return entityToSave;
} catch (TopiaException eee) {
throw new EchoBaseTechnicalException(eee);
}
}
+ public void delete(String topiaId) {
+ try {
+ ExportQueryDAO dao = getDAO();
+ ExportQuery entityToDelete = dao.findByTopiaId(topiaId);
+ dao.delete(entityToDelete);
+
+ getTransaction().commitTransaction();
+ } catch (TopiaException eee) {
+ throw new EchoBaseTechnicalException(eee);
+ }
+ }
+
protected ExportQueryDAO getDAO() throws TopiaException {
return EchoBaseDAOHelper.getExportQueryDAO(getTransaction());
}
@@ -135,6 +148,29 @@
}
}
+ public String createCsvStream(String sql, EchoBaseUser echoBaseUser) {
+
+ GenericSQLQuery sqlQuery = new GenericSQLQuery(sql, null);
+ Map<String, Object>[] rows;
+ String[] columnNames;
+ try {
+ rows = sqlQuery.getResult(getTransaction());
+ columnNames = sqlQuery.getColumnNames();
+ } catch (TopiaException eee) {
+ throw new EchoBaseTechnicalException("Could not execute sql query", eee);
+ }
+ StringBuilder buffer = new StringBuilder();
+ int rowCount = rows.length;
+ buffer.append("# Created at ").append(new Date()).append(" by user ").append(echoBaseUser.getEmail());
+ buffer.append("\n#").append(StringUtils.join(columnNames, ";"));
+ for (int i = 0; i < rowCount; i++) {
+ Map<String, Object> row = rows[i];
+ buffer.append('\n').append(StringUtils.join(row.values(), ";"));
+ }
+
+ return buffer.toString();
+ }
+
private static class GenericSQLQuery extends TopiaSQLQuery<Map<String, Object>> {
protected String[] columnNames;
1
0
r45 - in trunk/echobase-ui/src/main: java/fr/ifremer/echobase/ui java/fr/ifremer/echobase/ui/actions java/fr/ifremer/echobase/ui/actions/export java/fr/ifremer/echobase/ui/actions/json resources resources/config resources/i18n webapp/WEB-INF webapp/WEB-INF/includes webapp/WEB-INF/jsp webapp/WEB-INF/jsp/export
by tchemit@users.forge.codelutin.com 12 Nov '11
by tchemit@users.forge.codelutin.com 12 Nov '11
12 Nov '11
Author: tchemit
Date: 2011-11-12 21:23:18 +0100 (Sat, 12 Nov 2011)
New Revision: 45
Url: http://forge.codelutin.com/repositories/revision/echobase/45
Log:
- continue sql export
- reformat
- continue menus
Added:
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/
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
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/SaveExportQuery.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetSqlResult.java
trunk/echobase-ui/src/main/resources/config/struts-export.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportGrid.jsp
Removed:
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportQueryForm.jsp
Modified:
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetUsers.java
trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
trunk/echobase-ui/src/main/resources/struts.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/export.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java 2011-11-12 20:22:04 UTC (rev 44)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java 2011-11-12 20:23:18 UTC (rev 45)
@@ -256,7 +256,7 @@
rootContextSupplier.get();
try {
boolean schemaFound = TopiaUtil.isSchemaExist(
- tx.getHibernateConfiguration(),
+ tx,
EchoBaseUserImpl.class.getName()
);
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java 2011-11-12 20:22:04 UTC (rev 44)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java 2011-11-12 20:23:18 UTC (rev 45)
@@ -43,7 +43,6 @@
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
-import java.util.Locale;
import java.util.Map;
/**
@@ -192,6 +191,10 @@
return getDecoratorService().sortAndDecorate(getLocale(), beans, context);
}
+ public String decorate(Object o, String context) {
+ return getDecoratorService().decorate(getLocale(), o, context);
+ }
+
protected SimpleDateFormat getDateFormat() {
if (dateFormat == null) {
dateFormat = new SimpleDateFormat("dd/MM/yyyy");
@@ -207,7 +210,7 @@
}
protected DecoratorService getDecoratorService() {
- if (decoratorService==null) {
+ if (decoratorService == null) {
decoratorService = newService(DecoratorService.class);
}
return decoratorService;
Added: 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 (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadPage.java 2011-11-12 20:23:18 UTC (rev 45)
@@ -0,0 +1,113 @@
+/*
+ * #%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(a)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;
+ }
+
+// public String getEditType(ColumnMeta meta) {
+// Class<?> type = meta.getType();
+// String editType = "text";
+// if (boolean.class.equals(type)) {
+// editType = "checkbox";
+// } else if (TopiaEntity.class.isAssignableFrom(type)) {
+// editType = "select";
+// }
+// return editType;
+// }
+//
+// public String getFormatter(ColumnMeta meta) {
+// Class<?> type = meta.getType();
+// String editType = "'string'";
+// if (boolean.class.equals(type)) {
+// editType = "'checkbox'";
+// } else if (TopiaEntity.class.isAssignableFrom(type)) {
+// editType = "'formatEntityLabel'";
+// }
+// return editType;
+// }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadPage.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: 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 (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadSqlGrid.java 2011-11-12 20:23:18 UTC (rev 45)
@@ -0,0 +1,66 @@
+/*
+ * #%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(a)codelutin.com>
+ * @since 0.1
+ */
+public class LoadSqlGrid extends EchoBaseActionSupport {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Sql request to execute. */
+ protected String sql;
+
+ /** names of columns from the executed sql request. */
+ protected String[] columnNames;
+
+ public String getSql() {
+ return sql;
+ }
+
+ public String[] getColumnNames() {
+ return columnNames;
+ }
+
+ 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);
+
+ return INPUT;
+ }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/LoadSqlGrid.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/SaveExportQuery.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/SaveExportQuery.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/SaveExportQuery.java 2011-11-12 20:23:18 UTC (rev 45)
@@ -0,0 +1,62 @@
+/*
+ * #%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;
+
+/**
+ * To save a given export query.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class SaveExportQuery extends EchoBaseActionSupport {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Selected query */
+ protected ExportQuery query;
+
+ public ExportQuery getQuery() {
+ if (query == null) {
+ query = new ExportQueryImpl();
+ }
+ return query;
+ }
+
+ @Override
+ public String execute() throws Exception {
+
+ //TODO : do validation
+ ExportSqlService service = newService(ExportSqlService.class);
+
+ service.createOrUpdate(getQuery(),
+ getEchoBaseSession().getEchoBaseUser()
+ );
+ return SUCCESS;
+ }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/export/SaveExportQuery.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetSqlResult.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetSqlResult.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetSqlResult.java 2011-11-12 20:23:18 UTC (rev 45)
@@ -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.json;
+
+import fr.ifremer.echobase.services.ExportSqlService;
+
+import java.util.Map;
+
+/**
+ * To get a export sql DTO.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class GetSqlResult extends AbstractJSONPaginedAction {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Sql request to execute. */
+ protected String sql;
+
+// /** names of columns from the executed sql request. */
+// protected String[] columnNames;
+
+ /** Datas of the given table. */
+ protected Map<?, ?>[] datas;
+
+ public GetSqlResult() {
+ super("datas_");
+ }
+
+ public void setSql(String sql) {
+ this.sql = sql;
+ }
+
+// public String[] getColumnNames() {
+// return columnNames;
+// }
+
+ public Map<?, ?>[] getDatas() {
+ return datas;
+ }
+
+ @Override
+ public Integer getRows() {
+ return pager.getPageSize();
+ }
+
+ @Override
+ public Integer getPage() {
+ return pager.getPageNumber();
+ }
+
+ @Override
+ public Integer getTotal() {
+ return pager.getPageCount();
+ }
+
+ @Override
+ public Integer getRecords() {
+ return pager.getRecords();
+ }
+
+ @Override
+ public String execute() throws Exception {
+
+ ExportSqlService service = newService(ExportSqlService.class);
+ datas = service.executeSql(sql, pager);
+ return SUCCESS;
+ }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetSqlResult.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/json/GetUsers.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetUsers.java 2011-11-12 20:22:04 UTC (rev 44)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/json/GetUsers.java 2011-11-12 20:23:18 UTC (rev 45)
@@ -23,11 +23,11 @@
*/
package fr.ifremer.echobase.ui.actions.json;
+import com.google.common.collect.Lists;
import fr.ifremer.echobase.entities.EchoBaseUser;
import fr.ifremer.echobase.entities.EchoBaseUserDTO;
import fr.ifremer.echobase.services.UserService;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -76,7 +76,7 @@
List<EchoBaseUser> allUsers =
newService(UserService.class).getUsers(pager);
- users = new ArrayList<EchoBaseUserDTO>(allUsers.size());
+ users = Lists.newArrayList();
for (EchoBaseUser user : allUsers) {
users.add(user.toDTO());
}
Added: trunk/echobase-ui/src/main/resources/config/struts-export.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/config/struts-export.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/config/struts-export.xml 2011-11-12 20:23:18 UTC (rev 45)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ #%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%
+ -->
+
+<!DOCTYPE struts PUBLIC
+ "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
+ "http://struts.apache.org/dtds/struts-2.1.7.dtd">
+
+<struts>
+
+ <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>
+ </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="saveQuery"
+ class="fr.ifremer.echobase.ui.actions.export.SaveExportQuery">
+ <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>
+ </action>
+
+ <action name="getSqlResult" method="execute"
+ class="fr.ifremer.echobase.ui.actions.json.GetSqlResult">
+ <interceptor-ref name="basicStackLoggued"/>
+ <result type="json"/>
+ </action>
+
+ </package>
+
+</struts>
+
Property changes on: trunk/echobase-ui/src/main/resources/config/struts-export.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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-12 20:22:04 UTC (rev 44)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2011-11-12 20:23:18 UTC (rev 45)
@@ -1,3 +1,4 @@
+echobase.action.applySqlQuery=Appliquer la requête
echobase.action.create=Créer
echobase.action.delete=Suppression
echobase.action.import=Importer
@@ -6,11 +7,16 @@
echobase.action.login=Connection
echobase.action.logout=Déconnexion
echobase.action.save=Sauvegarder
+echobase.action.saveSqlQuery=Enregistrer la requête
echobase.common.admin=Administrateur
echobase.common.comment=Commentaire
echobase.common.email=Email
echobase.common.import=Import configuration
echobase.common.password=Mot de passe
+echobase.common.query.description=Description
+echobase.common.query.name=Nom
+echobase.common.request.result=Résultat de la requête sql
+echobase.common.sqlQueries=Requêtes enregistrées
echobase.common.tableName=Nom de la table
echobase.common.user=Utilisateur
echobase.common.voyage=Campagne
@@ -29,6 +35,8 @@
echobase.importFile.lectureAgeGen=Fichier lecture age
echobase.importFile.pecherie=Fichier pecherie
echobase.importFile.typeEchoSpecies=Fichier espèces
+echobase.info.no.sqlQuery.saved=Aucune requête d'export sql enregistré
+echobase.info.no.sqlQuery.selected=Aucune requête d'export sql sélectionnée
echobase.info.no.table.selected=Aucune table sélectionnée
echobase.label.admin.user.create=Création d'un utilisateur
echobase.label.admin.user.delete=Suppression d'un utilisateur
@@ -40,12 +48,14 @@
echobase.label.login=Connexion
echobase.label.user.login=Utilisateur \: %s
echobase.label.welcome=Bienvenue
-echobase.menu.export=Exports
+echobase.menu.dbeditor=Modification du référentiel
+echobase.menu.export=Export sql
echobase.menu.import=Imports
echobase.menu.logs=Logs
echobase.menu.users=Utilisateurs
echobase.message.modified.property=
-echobase.msg.warnImportInProgress=Merci de ne pas fermer la fenêtre pour pouvoir acceder au résultats de l'import.
+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.title.dbEditor=Modification de la base
echobase.title.export=Export
echobase.title.import=Imports
Modified: trunk/echobase-ui/src/main/resources/struts.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/struts.xml 2011-11-12 20:22:04 UTC (rev 44)
+++ trunk/echobase-ui/src/main/resources/struts.xml 2011-11-12 20:23:18 UTC (rev 45)
@@ -128,6 +128,7 @@
<include file="config/struts-json.xml"/>
<include file="config/struts-user.xml"/>
<include file="config/struts-import.xml"/>
+ <include file="config/struts-export.xml"/>
</struts>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml 2011-11-12 20:22:04 UTC (rev 44)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml 2011-11-12 20:23:18 UTC (rev 45)
@@ -30,6 +30,8 @@
<pattern>/user/login*</pattern>
<pattern>/index*</pattern>
<pattern>/dbeditor/getForeignEntities*</pattern>
+ <pattern>/export/loadResult*</pattern>
+ <pattern>/export/getSqlResult*</pattern>
</excludes>
<decorator name="layout-default" page="layout-default.jsp">
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp 2011-11-12 20:22:04 UTC (rev 44)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp 2011-11-12 20:23:18 UTC (rev 45)
@@ -28,11 +28,14 @@
<s:a action="import" namespace="/import"><s:text name="echobase.menu.import"/></s:a>
</li>
<li>
- <s:a action="export"><s:text name="echobase.menu.export"/></s:a>
+ <s:a action="exportSql" namespace="/export"><s:text name="echobase.menu.export"/></s:a>
</li>
<li>
<s:a action="logs"><s:text name="echobase.menu.logs"/></s:a>
</li>
+ <li>
+ <s:a action="dbeditor" namespace="/dbeditor"><s:text name="echobase.menu.dbeditor"/></s:a>
+ </li>
<s:if
test="%{userIsAdmin}">
<li>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/export.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/export.jsp 2011-11-12 20:22:04 UTC (rev 44)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/export.jsp 2011-11-12 20:23:18 UTC (rev 45)
@@ -25,29 +25,70 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+<s:url id="loadUrl" action='exportSql' namespace='/export'/>
+<s:url id="loadGridUrl" action="loadResult" namespace="/export"/>
+<script type="text/javascript">
+
+ jQuery(document).ready(function () {
+
+ $('[name="query.topiaId"]').change(function(event) {
+ var url = "${loadUrl}?" + $.param({ 'query.topiaId':this.value});
+ console.info("Reload url " + url);
+ window.location = url;
+ });
+ });
+
+ function loadGridData() {
+ // get sql query
+ var sqlQuery = "${loadGridUrl}?" + $.param({ sql :$('[name="query.sqlQuery"]').val()});
+
+ $.ajax(sqlQuery, {
+ success: function(data, textStatus, jqXHR) {
+ $('#resultGrid').html(data);
+ console.info("Return " + data);
+ }
+ });
+ return false;
+ }
+</script>
+
<title><s:text name="echobase.title.export"/></title>
-<s:url id="savedExportQueries" action="savedExportQueries" namespace="/ajax"/>
-<sj:select id="lastQueriesSelect"
- href="%{savedExportQueries}"
- name="selectedQuery"
- listKey="topiaId"
- listValue="name"
- list="savedExportQueries"
- emptyOption="true"
- listenTopics="updateSavedExportQueries"
- onChangeTopics="updateExportQueryForm"/>
+<s:form id="exportQueryForm" namespace="/export">
-<s:url id="exportQueryFormUrl" action="exportQueryFormForm" namespace="/fragment"/>
-<sj:div id="exportQueryForm"
- href="%{exportQueryFormUrl}"
- listenTopics="updateExportQueryForm"
- onSuccessTopics="updateExportGrid"
- indicator="indicator-searchPanel">
- <img id="indicator-searchPanel" src="/img/indicator.gif" alt="Loading..." style="display:none"/>
-</sj:div>
+ <s:select key="query.topiaId" label="%{getText('echobase.common.sqlQueries')}"
+ list="queries" headerKey="" headerValue=""/>
-<%-- TODO sletellier : add result grid listen event updateExportGrid named exportGrid --%>
+ <br/>
-</sjg:grid>
\ No newline at end of file
+ <fieldset>
+ <legend><s:text name="echobase.sqlQuery.configuration"/></legend>
+
+ <s:textfield key="query.name" required="true"
+ label="%{getText('echobase.common.query.name')}" size="40"/>
+
+ <s:textarea key="query.description" required="true" cols="160" rows="6"
+ label="%{getText('echobase.common.query.description')}"/>
+
+ <s:textarea key="query.sqlQuery" required="true" cols="160" rows="6"
+ label="%{getText('echobase.common.sqlQuery')}"/>
+
+ <s:label value="%{query.lastModifiedDate}" readonly="true"
+ label="%{getText('echobase.common.lastModifiedDate')}"/>
+
+ <s:label value="%{decorate(query.lastModifiedUser, null)}" readonly="true"
+ label="%{getText('echobase.common.lastModifiedUser')}"/>
+ </fieldset>
+ <br/>
+
+ <s:submit action="saveQuery" key="echobase.action.saveSqlQuery"
+ align="right"/>
+
+ <s:submit key="echobase.action.applySqlQuery" align="right" onclick="return loadGridData();"/>
+</s:form>
+
+<br/>
+<div id="resultGrid"></div>
+
+
Added: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportGrid.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportGrid.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportGrid.jsp 2011-11-12 20:23:18 UTC (rev 45)
@@ -0,0 +1,51 @@
+<%--
+ #%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" %>
+
+<s:url id="loadUrl" action="getSqlResult" namespace="/export"
+ escapeAmp="false">
+ <s:param name="sql" value="%{sql}"/>
+</s:url>
+
+<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="true"
+ navigatorAdd="false"
+ rowList="10,15,20,50" rowNum="10"
+ viewrecords="true" resizable="true" editinline="false">
+
+ <s:iterator value="columnNames" var="name" status="status">
+
+ <sjg:gridColumn name="%{#name}" title="%{#name}" sortable="false"/>
+
+ </s:iterator>
+
+</sjg:grid>
+
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportGrid.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportQueryForm.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportQueryForm.jsp 2011-11-12 20:22:04 UTC (rev 44)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/export/exportQueryForm.jsp 2011-11-12 20:23:18 UTC (rev 45)
@@ -1,67 +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%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8"%>
-<%@taglib prefix="s" uri="/struts-tags"%>
-<%@taglib prefix="sj" uri="/struts-jquery-tags" %>
-
-<s:form id="exportQueryForm" action="executeExportQuery" namespace="/export">
-
- <s:text name="echobase.export.queryName"/>
- <s:textfield id="queryName"
- cssClass="right"
- theme="simple"
- name="queryName"
- size="40"/>
-
- <s:text name="echobase.export.querySql"/>
- <s:textarea id="querySql"
- name="querySql"
- cols="160"
- rows="6"/>
-
- <s:text name="echobase.export.queryDescription"/>
- <s:textarea id="querySql"
- name="querySql"
- cols="160"
- rows="6"/>
-
- <s:url id="saveExportQueryUrl" action="saveExportQuery" namespace="export"/>
-
- <s:set id="saveExportQueryText">
- <s:text name="echobase.action.save"/>
- </s:set>
-
- <sj:submit id="saveQuery"
- href="%{saveExportQueryUrl}"
- value="%{saveExportQueryText}"
- onSuccessTopics="updateExportQueries"
- button="true"/>
-
- <sj:submit id="search"
- value="%{searchText}"
- indicator="indicator-exportGrid"
- targets="exportGrid"
- button="true"/>
-
-</s:form>
\ No newline at end of file
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-12 20:22:04 UTC (rev 44)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp 2011-11-12 20:23:18 UTC (rev 45)
@@ -28,5 +28,4 @@
<h2><s:text name="echobase.label.welcome"/></h2>
-<s:a action="dbeditor" namespace="/dbeditor">Modification du référentiel</s:a>
<hr/>
\ No newline at end of file
1
0
r44 - trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor
by tchemit@users.forge.codelutin.com 12 Nov '11
by tchemit@users.forge.codelutin.com 12 Nov '11
12 Nov '11
Author: tchemit
Date: 2011-11-12 21:22:04 +0100 (Sat, 12 Nov 2011)
New Revision: 44
Url: http://forge.codelutin.com/repositories/revision/echobase/44
Log:
reformat
Modified:
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp
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-12 20:21:21 UTC (rev 43)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2011-11-12 20:22:04 UTC (rev 44)
@@ -47,8 +47,7 @@
</script>
<div>
- <s:select key="tableName"
- label='%{getText("echobase.common.tableName")}'
+ <s:select key="tableName" label='%{getText("echobase.common.tableName")}'
list="tableNames" headerKey="" headerValue=""/>
</div>
<br/>
1
0
r43 - trunk/echobase-services/src/main/java/fr/ifremer/echobase/services
by tchemit@users.forge.codelutin.com 12 Nov '11
by tchemit@users.forge.codelutin.com 12 Nov '11
12 Nov '11
Author: tchemit
Date: 2011-11-12 21:21:21 +0100 (Sat, 12 Nov 2011)
New Revision: 43
Url: http://forge.codelutin.com/repositories/revision/echobase/43
Log:
continue export sql service
Added:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportSqlService.java
Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportSqlService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportSqlService.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportSqlService.java 2011-11-12 20:21:21 UTC (rev 43)
@@ -0,0 +1,217 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $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.services;
+
+import fr.ifremer.echobase.EchoBaseTechnicalException;
+import fr.ifremer.echobase.entities.EchoBaseDAOHelper;
+import fr.ifremer.echobase.entities.EchoBaseUser;
+import fr.ifremer.echobase.entities.ExportQuery;
+import fr.ifremer.echobase.entities.ExportQueryDAO;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.framework.TopiaContextImplementor;
+import org.nuiton.topia.framework.TopiaSQLQuery;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Service to deal with sql export.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class ExportSqlService extends AbstractEchoBaseService {
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(ExportSqlService.class);
+
+ public Collection<ExportQuery> getQueries() {
+ try {
+ List<ExportQuery> result = getDAO().findAll();
+ return result;
+ } catch (TopiaException eee) {
+ throw new EchoBaseTechnicalException("Could not obtain export queries", eee);
+ }
+ }
+
+ public ExportQuery getQuery(String queryId) {
+
+ try {
+ ExportQuery result = getDAO().findByTopiaId(queryId);
+ return result;
+ } catch (TopiaException eee) {
+ throw new EchoBaseTechnicalException("Could not obtain export query with id " + queryId, eee);
+ }
+ }
+
+ public void createOrUpdate(ExportQuery exportQuery, EchoBaseUser user) {
+ try {
+ ExportQueryDAO dao = getDAO();
+ ExportQuery entityToSave;
+
+ // No id, creating new one entity
+ String id = exportQuery.getTopiaId();
+ if (StringUtils.isEmpty(id)) {
+ entityToSave = dao.create();
+ } else {
+ entityToSave = dao.findByTopiaId(id);
+ }
+
+ entityToSave.setName(exportQuery.getName());
+ entityToSave.setDescription(exportQuery.getDescription());
+ entityToSave.setSqlQuery(exportQuery.getSqlQuery());
+ entityToSave.setLastModifiedDate(new Date());
+ entityToSave.setLastModifiedUser(user);
+
+ dao.update(entityToSave);
+ getTransaction().commitTransaction();
+ } catch (TopiaException eee) {
+ throw new EchoBaseTechnicalException(eee);
+ }
+ }
+
+ protected ExportQueryDAO getDAO() throws TopiaException {
+ return EchoBaseDAOHelper.getExportQueryDAO(getTransaction());
+ }
+
+ public Map<String, Object>[] executeSql(String sql, Pager pager) {
+
+ // get a query to count all rows for the request
+ GenericSQLQuery sqlQuery = new GenericSQLQuery(sql, pager);
+ try {
+ Map<String, Object>[] result = sqlQuery.getResult(getTransaction());
+ return result;
+ } catch (TopiaException eee) {
+ throw new EchoBaseTechnicalException("Could not execute sql query", eee);
+ }
+ }
+
+ public String[] getColumnNames(String sql) {
+
+ String limitSql = sql.trim();
+ if (limitSql.endsWith(";")) {
+ limitSql = limitSql.substring(0, limitSql.length() - 1);
+ limitSql += " LIMIT 1";
+ }
+ try {
+ // do a limit query to one result and obtain the column names
+ // from the meta data of the result set
+ GenericSQLQuery sqlQuery = new GenericSQLQuery(limitSql, null);
+ String[] result = sqlQuery.getColumnNames(getTransaction());
+ return result;
+ } catch (TopiaException eee) {
+ throw new EchoBaseTechnicalException("Could not execute query " + limitSql, eee);
+ }
+ }
+
+ private static class GenericSQLQuery extends TopiaSQLQuery<Map<String, Object>> {
+
+ protected String[] columnNames;
+
+ private final String sql;
+
+ private final Pager pager;
+
+ public GenericSQLQuery(String sql, Pager pager) {
+ this.sql = sql;
+ this.pager = pager;
+ }
+
+ public String[] getColumnNames() {
+ return columnNames;
+ }
+
+ @Override
+ protected PreparedStatement prepareQuery(Connection connection) throws SQLException {
+ return connection.prepareStatement(
+ sql,
+ ResultSet.TYPE_SCROLL_INSENSITIVE,
+ ResultSet.CONCUR_READ_ONLY
+ );
+ }
+
+ @Override
+ protected void afterExecuteQuery(ResultSet set) throws SQLException {
+ super.afterExecuteQuery(set);
+
+ // obtain columnNames
+ columnNames = getColumnNames(set);
+
+ if (pager != null) {
+
+ // must count rows
+ int nbRows = getNbRows(set);
+ if (log.isInfoEnabled()) {
+ log.info("For request " + sql + ", nb rows = " + nbRows);
+ }
+ pager.setRecords(nbRows);
+ pager.computeIndexesAndPageCount();
+ }
+ }
+
+ @Override
+ protected Map<String, Object> prepareResult(ResultSet set) throws SQLException {
+
+ if (pager != null) {
+
+ // get row number (getRow() begins at 1)
+ int rowNumber = set.getRow() - 1;
+ if (rowNumber < pager.getStartIndex() ||
+ rowNumber >= pager.getEndIndex()) {
+
+ // out of pager bound, by returning null
+ // result will not be take in account
+ return null;
+ }
+ }
+
+ Map<String, Object> result = getRowAsMap(columnNames, set);
+ return result;
+ }
+
+ public Map<String, Object>[] getResult(TopiaContext tx) throws TopiaException {
+ List<Map<String, Object>> rows =
+ findMultipleResult((TopiaContextImplementor) tx);
+ return rows.toArray(new Map[rows.size()]);
+ }
+
+
+ public String[] getColumnNames(TopiaContext tx) throws TopiaException {
+ findSingleResult((TopiaContextImplementor) tx);
+ return columnNames;
+ }
+
+
+ }
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportSqlService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0
r42 - trunk/echobase-services/src/main/java/fr/ifremer/echobase/services
by tchemit@users.forge.codelutin.com 12 Nov '11
by tchemit@users.forge.codelutin.com 12 Nov '11
12 Nov '11
Author: tchemit
Date: 2011-11-12 21:21:07 +0100 (Sat, 12 Nov 2011)
New Revision: 42
Url: http://forge.codelutin.com/repositories/revision/echobase/42
Log:
add decorator
Modified:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DecoratorService.java
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DecoratorService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DecoratorService.java 2011-11-12 20:20:53 UTC (rev 41)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DecoratorService.java 2011-11-12 20:21:07 UTC (rev 42)
@@ -27,6 +27,7 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import fr.ifremer.echobase.entities.EchoBaseUser;
+import fr.ifremer.echobase.entities.ExportQuery;
import fr.ifremer.echobase.entities.Voyage;
import org.apache.commons.collections.CollectionUtils;
import org.nuiton.topia.persistence.TopiaEntity;
@@ -123,6 +124,8 @@
// voyage decorator
registerJXPathDecorator(locale, Voyage.class, "${voyageName}$s");
+ // export query decorator
+ registerJXPathDecorator(locale, ExportQuery.class, "${name}$s - ${description}$s");
}
}
}
1
0
r41 - trunk/echobase-services/src/main/java/fr/ifremer/echobase/services
by tchemit@users.forge.codelutin.com 12 Nov '11
by tchemit@users.forge.codelutin.com 12 Nov '11
12 Nov '11
Author: tchemit
Date: 2011-11-12 21:20:53 +0100 (Sat, 12 Nov 2011)
New Revision: 41
Url: http://forge.codelutin.com/repositories/revision/echobase/41
Log:
id can be empty (from form)
Modified:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/UserService.java
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/UserService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/UserService.java 2011-11-12 20:16:33 UTC (rev 40)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/UserService.java 2011-11-12 20:20:53 UTC (rev 41)
@@ -96,7 +96,7 @@
// No id, creating new one entity
String id = userDTO.getId();
- if (id == null) {
+ if (StringUtils.isEmpty(id)) {
user = dao.create();
} else {
user = dao.findByTopiaId(id);
1
0
Author: tchemit
Date: 2011-11-12 21:16:33 +0100 (Sat, 12 Nov 2011)
New Revision: 40
Url: http://forge.codelutin.com/repositories/revision/echobase/40
Log:
pass to snapshot of topia
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-11-11 17:19:56 UTC (rev 39)
+++ trunk/pom.xml 2011-11-12 20:16:33 UTC (rev 40)
@@ -107,7 +107,7 @@
<!-- libraries version -->
<eugenePluginVersion>2.4.1</eugenePluginVersion>
- <topiaVersion>2.6.3</topiaVersion>
+ <topiaVersion>2.6.4-SNAPSHOT</topiaVersion>
<nuitonUtilsVersion>2.4-SNAPSHOT</nuitonUtilsVersion>
<nuitonI18nVersion>2.4.1</nuitonI18nVersion>
<nuitonWebVersion>1.6-SNAPSHOT</nuitonWebVersion>
1
0