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
r9 - in trunk/echobase-entities/src/main: java/fr/ifremer/echobase java/fr/ifremer/echobase/entities resources/i18n xmi
by tchemit@users.forge.codelutin.com 04 Nov '11
by tchemit@users.forge.codelutin.com 04 Nov '11
04 Nov '11
Author: tchemit
Date: 2011-11-04 13:06:39 +0100 (Fri, 04 Nov 2011)
New Revision: 9
Url: http://forge.codelutin.com/repositories/revision/echobase/9
Log:
add DTO for JSON purposes + remove generated i18n
Added:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EchoBaseUserImpl.java
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/ExportQueryImpl.java
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTopiaRootContextSupplierFactory.java
trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
trunk/echobase-entities/src/main/xmi/echobase.properties
trunk/echobase-entities/src/main/xmi/echobase.zargo
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java 2011-11-04 10:09:27 UTC (rev 8)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java 2011-11-04 12:06:39 UTC (rev 9)
@@ -27,6 +27,7 @@
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.TopiaContextFactory;
import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.ArgumentsParserException;
import org.nuiton.util.FileUtil;
@@ -84,20 +85,29 @@
}
public File getDataDirectory() {
- File v = applicationConfig.getOptionAsFile(EchoBaseConfigurationOption.DATA_DIRECTORY.key);
- return v;
+ File file = applicationConfig.getOptionAsFile(EchoBaseConfigurationOption.DATA_DIRECTORY.key);
+ Preconditions.checkNotNull(file);
+ return file;
}
public Version getApplicationVersion() {
Version v = applicationConfig.getOptionAsVersion(EchoBaseConfigurationOption.VERSION.key);
+ Preconditions.checkNotNull(v);
return v;
}
public URL getApplicationSite() {
URL url = applicationConfig.getOptionAsURL(EchoBaseConfigurationOption.SITE_URL.key);
+ Preconditions.checkNotNull(url);
return url;
}
+ public Class<?> getDriverClass() {
+ Class<?> klass = applicationConfig.getOptionAsClass(TopiaContextFactory.CONFIG_DRIVER);
+ Preconditions.checkNotNull(klass);
+ return klass;
+ }
+
/**
* Creates a directory given the configuration given key.
*
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTopiaRootContextSupplierFactory.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTopiaRootContextSupplierFactory.java 2011-11-04 10:09:27 UTC (rev 8)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTopiaRootContextSupplierFactory.java 2011-11-04 12:06:39 UTC (rev 9)
@@ -104,6 +104,11 @@
Properties properties = config.getProperties();
+ return newDatabaseFromProperties(properties);
+ }
+
+ public Supplier<TopiaContext> newDatabaseFromProperties(Properties properties) {
+
if (log.isDebugEnabled()) {
log.debug("Database settings are :");
Set<String> keysToDisplay = Sets.newHashSet(
Added: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EchoBaseUserImpl.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EchoBaseUserImpl.java (rev 0)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EchoBaseUserImpl.java 2011-11-04 12:06:39 UTC (rev 9)
@@ -0,0 +1,53 @@
+/*
+ * #%L
+ * EchoBase :: Entities
+ *
+ * $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.entities;
+
+/**
+ * Default implementation of the {@link EchoBaseUser}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class EchoBaseUserImpl extends EchoBaseUserAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public EchoBaseUserDTO toDTO() {
+ EchoBaseUserDTO dto = new EchoBaseUserDTOImpl();
+ dto.setAdmin(isAdmin());
+ dto.setEmail(getEmail());
+ dto.setPassword(getPassword());
+ dto.setId(getTopiaId());
+ return dto;
+ }
+
+ @Override
+ public void fromDTO(EchoBaseUserDTO dto) {
+ setAdmin(dto.isAdmin());
+ setEmail(dto.getEmail());
+ setPassword(dto.getPassword());
+ }
+
+}
Property changes on: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EchoBaseUserImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/ExportQueryImpl.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/ExportQueryImpl.java (rev 0)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/ExportQueryImpl.java 2011-11-04 12:06:39 UTC (rev 9)
@@ -0,0 +1,47 @@
+/*
+ * #%L
+ * EchoBase :: Entities
+ *
+ * $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.entities;
+
+/**
+ * Default implementation of the {@link ExportQuery}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class ExportQueryImpl extends ExportQueryAbstract {
+
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public ExportQueryDTO toDTO() {
+ ExportQueryDTO dto = new ExportQueryDTOImpl();
+ dto.setDescription(getDescription());
+ dto.setId(getTopiaId());
+ dto.setLastModifiedDate(getLastModifiedDate());
+ dto.setLastModifiedUser(getLastModifiedUser().toDTO());
+ dto.setName(getName());
+ dto.setSqlQuery(getSqlQuery());
+ return dto;
+ }
+}
Property changes on: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/ExportQueryImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
===================================================================
--- trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties 2011-11-04 10:09:27 UTC (rev 8)
+++ trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties 2011-11-04 12:06:39 UTC (rev 9)
@@ -1,16 +1 @@
-echobase.common.admin=
-echobase.common.description=
-echobase.common.echoBaseUser=
-echobase.common.email=
-echobase.common.exportQuery=
-echobase.common.lastModifiedDate=
-echobase.common.lastModifiedUser=
-echobase.common.login=
-echobase.common.name=
-echobase.common.password=
-echobase.common.sqlQuery=
echobase.config.data.directory.description=
-echobase.config.internal.db.directory.description=
-echobase.config.parameterProfiles.storage.directory.description=
-echobase.config.treatment.working.directory.description=
-echobase.user.log.directory.description=
Modified: trunk/echobase-entities/src/main/xmi/echobase.properties
===================================================================
--- trunk/echobase-entities/src/main/xmi/echobase.properties 2011-11-04 10:09:27 UTC (rev 8)
+++ trunk/echobase-entities/src/main/xmi/echobase.properties 2011-11-04 12:06:39 UTC (rev 9)
@@ -22,7 +22,7 @@
# #L%
###
-model.tagValue.i18n=echobase.common.
+#model.tagValue.i18n=echobase.common.
model.tagValue.notGenerateToString=true
model.tagValue.generateOperatorForDAOHelper=true
model.tagValue.generateStandaloneEnumForDAOHelper=true
Modified: trunk/echobase-entities/src/main/xmi/echobase.zargo
===================================================================
(Binary files differ)
1
0
04 Nov '11
Author: tchemit
Date: 2011-11-04 11:09:27 +0100 (Fri, 04 Nov 2011)
New Revision: 8
Url: http://forge.codelutin.com/repositories/revision/echobase/8
Log:
using Arnaud and Brendan api + add entity ExportQuery in model
Added:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTechnicalException.java
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTopiaRootContextSupplierFactory.java
trunk/echobase-entities/src/test/resources/echobase.properties
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContext.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContextImpl.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceFactory.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationContext.java
Removed:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationHelper.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSessionAware.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseTransactionActionSupport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseSessionInterceptor.java
Modified:
trunk/LICENSE.txt
trunk/README.txt
trunk/changelog.txt
trunk/echobase-entities/LICENSE.txt
trunk/echobase-entities/README.txt
trunk/echobase-entities/changelog.txt
trunk/echobase-entities/pom.xml
trunk/echobase-entities/src/license/THIRD-PARTY.properties
trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
trunk/echobase-entities/src/main/xmi/echobase.properties
trunk/echobase-entities/src/main/xmi/echobase.zargo
trunk/echobase-entities/src/test/resources/log4j.properties
trunk/echobase-services/LICENSE.txt
trunk/echobase-services/README.txt
trunk/echobase-services/changelog.txt
trunk/echobase-services/pom.xml
trunk/echobase-services/src/license/THIRD-PARTY.properties
trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseObjectFactory.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceInitializable.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceInjectable.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceSingleton.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/IOCService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/AbstractInjector.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectDAO.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectEntitiesById.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectEntityById.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectFromDAO.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/Injector.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorDAO.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorEntitiesById.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorEntityById.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorFromDAO.java
trunk/echobase-services/src/main/resources/META-INF/services/fr.ifremer.echobase.services.ioc.Injector
trunk/echobase-services/src/main/resources/echobase-config
trunk/echobase-services/src/main/resources/echobase-db-h2.properties
trunk/echobase-services/src/main/resources/echobase-db.properties
trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties
trunk/echobase-services/src/test/resources/log4j.properties
trunk/echobase-ui/LICENSE.txt
trunk/echobase-ui/README.txt
trunk/echobase-ui/changelog.txt
trunk/echobase-ui/pom.xml
trunk/echobase-ui/src/license/THIRD-PARTY.properties
trunk/echobase-ui/src/main/env/dev/resources/log4j.properties
trunk/echobase-ui/src/main/env/dev/resources/struts.properties
trunk/echobase-ui/src/main/env/prod/resources/log4j.properties
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/ApplicationListener.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.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/HomeAction.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/LoginAction.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/AbstractCheckInterceptor.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckInUserSessionInterceptor.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckLogguedInterceptor.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckUserIsAdmin.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CleanEchoBaseSessionInterceptor.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseTransactionInterceptorImpl.java
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/resources/struts.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/decorators/layout-default.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/includes/footer.jsp
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/includes/menu.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/includes/metas.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/ImportProgress.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/ImportResult.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/imports.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/login.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/users.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/web.xml
trunk/echobase-ui/src/main/webapp/css/screen.css
trunk/echobase-ui/src/main/webapp/images/exclamation.png
trunk/echobase-ui/src/main/webapp/images/logo_codelutin.png
trunk/echobase-ui/src/main/webapp/images/true.png
trunk/echobase-ui/src/main/webapp/index.jsp
trunk/echobase-ui/src/main/webapp/js/gridHelper.js
trunk/echobase-ui/src/site/rst/index.rst
trunk/echobase-ui/src/site/site_fr.xml
trunk/echobase-ui/web/WEB-INF/web.xml
trunk/pom.xml
trunk/src/doc/reunions/reunion-2011-11-03.txt
trunk/src/site/rst/Todo.rst
trunk/src/site/rst/index.rst
trunk/src/site/site_fr.xml
Property changes on: trunk/LICENSE.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/README.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/changelog.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-entities/LICENSE.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-entities/README.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-entities/changelog.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/echobase-entities/pom.xml
===================================================================
--- trunk/echobase-entities/pom.xml 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-entities/pom.xml 2011-11-04 10:09:27 UTC (rev 8)
@@ -54,12 +54,12 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- </dependency>
+ </dependency-->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- </dependency-->
+ </dependency>
<!-- ToPIA dependencies -->
Property changes on: trunk/echobase-entities/pom.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-entities/src/license/THIRD-PARTY.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Copied: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java (from rev 5, trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java)
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java (rev 0)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -0,0 +1,128 @@
+/*
+ * #%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;
+
+import com.google.common.base.Preconditions;
+import org.apache.commons.lang.builder.ReflectionToStringBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.ArgumentsParserException;
+import org.nuiton.util.FileUtil;
+import org.nuiton.util.Version;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Properties;
+
+/**
+ * EchoBase configuration
+ *
+ * @author chemit <chemit(a)codelutin.com>
+ * @since 1.0
+ */
+public class EchoBaseConfiguration {
+
+ /** Logger. */
+ protected static final Log log = LogFactory.getLog(EchoBaseConfiguration.class);
+
+ /** Delegate application config object containing all the configuration. */
+ protected ApplicationConfig applicationConfig;
+
+ public EchoBaseConfiguration() {
+ applicationConfig = new ApplicationConfig();
+ applicationConfig.setConfigFileName("echobase.properties");
+
+ if (log.isInfoEnabled()) {
+ log.info(this + " is initializing...");
+ }
+ try {
+ applicationConfig.loadDefaultOptions(EchoBaseConfigurationOption.class);
+ applicationConfig.parse();
+ } catch (ArgumentsParserException e) {
+ throw new EchoBaseTechnicalException(
+ "Could not parse configuration", e);
+ }
+
+ createDirectory(EchoBaseConfigurationOption.DATA_DIRECTORY);
+
+ if (log.isDebugEnabled()) {
+ log.debug("parsed options in config file" + applicationConfig.getOptions());
+ }
+ }
+
+ @Override
+ public String toString() {
+ return ReflectionToStringBuilder.toString(this);
+ }
+
+ public Properties getProperties() {
+ Properties result = applicationConfig.getFlatOptions();
+ return result;
+ }
+
+ public File getDataDirectory() {
+ File v = applicationConfig.getOptionAsFile(EchoBaseConfigurationOption.DATA_DIRECTORY.key);
+ return v;
+ }
+
+ public Version getApplicationVersion() {
+ Version v = applicationConfig.getOptionAsVersion(EchoBaseConfigurationOption.VERSION.key);
+ return v;
+ }
+
+ public URL getApplicationSite() {
+ URL url = applicationConfig.getOptionAsURL(EchoBaseConfigurationOption.SITE_URL.key);
+ return url;
+ }
+
+ /**
+ * Creates a directory given the configuration given key.
+ *
+ * @param key the configuration option key which contains the location of
+ * the directory to create
+ */
+ protected void createDirectory(EchoBaseConfigurationOption key) {
+
+ File directory = applicationConfig.getOptionAsFile(key.getKey());
+
+ Preconditions.checkNotNull(
+ directory,
+ "Could not find directory " + directory + " (key " +
+ key +
+ "in your configuration file named echobase.properties)"
+ );
+ if (log.isInfoEnabled()) {
+ log.info(key + " = " + directory);
+ }
+ try {
+ FileUtil.createDirectoryIfNecessary(directory);
+ } catch (IOException e) {
+ throw new EchoBaseTechnicalException(
+ "Could not create directory " + directory, e);
+ }
+ }
+
+}
Property changes on: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java (rev 0)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -0,0 +1,127 @@
+/*
+ * #%L
+ * EchoBase :: Entities
+ *
+ * $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;
+
+import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.Version;
+
+import java.io.File;
+import java.net.URL;
+
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ * All EchoBase configuration options.
+ *
+ * @since 1.0
+ */
+public enum EchoBaseConfigurationOption implements ApplicationConfig.OptionDef {
+
+ /** Main directory where to put echobase data (logs, and others...). */
+ DATA_DIRECTORY(
+ "data.directory",
+ n_("echobase.config.data.directory.description"),
+ "/var/local/echobase",
+ File.class),
+
+ PASSWORD_DIGEST_ALGORITHM(
+ "password.digest.algorithm",
+ "Algorithme de hashage à utiliser pour les mot de passe",
+ "SHA1", String.class),
+ VERSION(
+ "project.version",
+ "Version de l'application",
+ "", Version.class),
+ SITE_URL(
+ "project.siteUrl",
+ "URL du site de l'application",
+ "", URL.class);
+
+ /** Configuration key. */
+ protected final String key;
+
+ /** I18n key of option description */
+ protected final String description;
+
+ /** Type of option */
+ protected final Class<?> type;
+
+ /** Default value of option. */
+ protected String defaultValue;
+
+ EchoBaseConfigurationOption(String key,
+ String description,
+ String defaultValue,
+ Class<?> type) {
+ this.key = key;
+ this.description = description;
+ this.defaultValue = defaultValue;
+ this.type = type;
+ }
+
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public Class<?> getType() {
+ return type;
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public boolean isTransient() {
+ return true;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return true;
+ }
+
+ @Override
+ public void setDefaultValue(String defaultValue) {
+ this.defaultValue = defaultValue;
+ }
+
+ @Override
+ public void setTransient(boolean newValue) {
+ // not used
+ }
+
+ @Override
+ public void setFinal(boolean newValue) {
+ // not used
+ }
+}
Property changes on: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTechnicalException.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTechnicalException.java (rev 0)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTechnicalException.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -0,0 +1,44 @@
+/*
+ * #%L
+ * EchoBase :: Entities
+ *
+ * $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;
+
+public class EchoBaseTechnicalException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ public EchoBaseTechnicalException() {
+ }
+
+ public EchoBaseTechnicalException(String message) {
+ super(message);
+ }
+
+ public EchoBaseTechnicalException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public EchoBaseTechnicalException(Throwable cause) {
+ super(cause);
+ }
+}
Property changes on: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTechnicalException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTopiaRootContextSupplierFactory.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTopiaRootContextSupplierFactory.java (rev 0)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTopiaRootContextSupplierFactory.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -0,0 +1,133 @@
+/*
+ * #%L
+ * Extranet NF-Logement :: Entities
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 Cerqual
+ * %%
+ * 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;
+
+import com.google.common.base.Supplier;
+import com.google.common.collect.Sets;
+import com.google.common.io.Closeables;
+import fr.ifremer.echobase.entities.EchoBaseDAOHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hibernate.cfg.Environment;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.TopiaContextFactory;
+import org.nuiton.topia.TopiaNotFoundException;
+import org.nuiton.topia.TopiaRuntimeException;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import java.util.Set;
+
+public class EchoBaseTopiaRootContextSupplierFactory {
+
+ /** Logger. */
+ private static final Log log =
+ LogFactory.getLog(EchoBaseTopiaRootContextSupplierFactory.class);
+
+ protected static class EchoBaseTopiaRootContextSupplier implements Supplier<TopiaContext> {
+
+ protected TopiaContext rootContext;
+
+ public EchoBaseTopiaRootContextSupplier(TopiaContext rootContext) {
+ this.rootContext = rootContext;
+ }
+
+ @Override
+ public TopiaContext get() {
+ return rootContext;
+ }
+ }
+
+ public Supplier<TopiaContext> newEmbeddedDatabase(File dir) {
+
+ File databaseFile = new File(dir, "h2-db");
+
+ String databaseAbsolutePath = databaseFile.getAbsolutePath();
+
+ // prepare call to topia-context factory
+ Properties properties = new Properties();
+ InputStream input = null;
+ try {
+ input = getClass().getResourceAsStream("/topia-h2.properties");
+ properties.load(input);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ } finally {
+ Closeables.closeQuietly(input);
+ }
+ properties.setProperty(Environment.URL,
+ "jdbc:h2:file:" + databaseAbsolutePath);
+
+ // add entities to the context
+ properties.setProperty(
+ TopiaContextFactory.CONFIG_PERSISTENCE_CLASSES,
+ EchoBaseDAOHelper.getImplementationClassesAsString());
+
+ TopiaContext rootContext;
+ try {
+ rootContext = TopiaContextFactory.getContext(properties);
+ } catch (TopiaNotFoundException e) {
+ throw new TopiaRuntimeException(e);
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("will output database in " + databaseAbsolutePath);
+ }
+
+ return new EchoBaseTopiaRootContextSupplier(rootContext);
+ }
+
+ public Supplier<TopiaContext> newDatabaseFromConfig(EchoBaseConfiguration config) {
+
+ Properties properties = config.getProperties();
+
+ if (log.isDebugEnabled()) {
+ log.debug("Database settings are :");
+ Set<String> keysToDisplay = Sets.newHashSet(
+ "hibernate.dialect",
+ "hibernate.connection.driver_class",
+ "hibernate.connection.url",
+ "hibernate.connection.username");
+ for (String key : keysToDisplay) {
+ log.debug(String.format("%s=%s", key, properties.getProperty(key)));
+ }
+ }
+
+ // add entities to the context
+ String classesKey = TopiaContextFactory.CONFIG_PERSISTENCE_CLASSES;
+ String classesValue = EchoBaseDAOHelper.getImplementationClassesAsString();
+ properties.setProperty(classesKey, classesValue);
+
+ TopiaContext rootContext;
+ try {
+ rootContext = TopiaContextFactory.getContext(properties);
+ } catch (TopiaNotFoundException e) {
+ throw new TopiaRuntimeException(e);
+ }
+
+ return new EchoBaseTopiaRootContextSupplier(rootContext);
+ }
+}
Property changes on: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTopiaRootContextSupplierFactory.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
===================================================================
--- trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties 2011-11-04 10:09:27 UTC (rev 8)
@@ -1,4 +1,16 @@
echobase.common.admin=
+echobase.common.description=
echobase.common.echoBaseUser=
+echobase.common.email=
+echobase.common.exportQuery=
+echobase.common.lastModifiedDate=
+echobase.common.lastModifiedUser=
echobase.common.login=
+echobase.common.name=
echobase.common.password=
+echobase.common.sqlQuery=
+echobase.config.data.directory.description=
+echobase.config.internal.db.directory.description=
+echobase.config.parameterProfiles.storage.directory.description=
+echobase.config.treatment.working.directory.description=
+echobase.user.log.directory.description=
Property changes on: trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-entities/src/main/xmi/echobase.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/echobase-entities/src/main/xmi/echobase.zargo
===================================================================
(Binary files differ)
Property changes on: trunk/echobase-entities/src/main/xmi/echobase.zargo
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/echobase-entities/src/test/resources/echobase.properties
===================================================================
--- trunk/echobase-entities/src/test/resources/echobase.properties (rev 0)
+++ trunk/echobase-entities/src/test/resources/echobase.properties 2011-11-04 10:09:27 UTC (rev 8)
@@ -0,0 +1,31 @@
+###
+# #%L
+# EchoBase :: Entities
+#
+# $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%
+###
+hibernate.hbm2ddl.auto=update
+hibernate.show_sql=false
+hibernate.dialect=org.hibernate.dialect.H2Dialect
+
+hibernate.connection.driver_class=org.h2.Driver
+hibernate.connection.url=jdbc:h2:file:${data.directory}/echobase/h2data
+hibernate.connection.username=sa
+hibernate.connection.password=sa
Property changes on: trunk/echobase-entities/src/test/resources/echobase.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/echobase-entities/src/test/resources/log4j.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/LICENSE.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/README.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/changelog.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/pom.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/license/THIRD-PARTY.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -1,218 +0,0 @@
-/*
- * #%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;
-
-import com.google.common.base.Preconditions;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.util.ApplicationConfig;
-import org.nuiton.util.ArgumentsParserException;
-import org.nuiton.util.FileUtil;
-
-import java.io.File;
-import java.io.IOException;
-
-import static org.nuiton.i18n.I18n.n_;
-
-/**
- * EchoBase configuration
- *
- * @author chemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class EchoBaseConfiguration extends ApplicationConfig {
-
- /** Logger. */
- protected static final Log log = LogFactory.getLog(EchoBaseConfiguration.class);
-
- public EchoBaseConfiguration() {
-
- setConfigFileName("echobase-config");
-
- if (log.isInfoEnabled()) {
- log.info(this + " is initializing...");
- }
- loadDefaultOptions(EchoBaseConfigurationOption.class);
- }
-
- /**
- * To initialise the configuration.
- * <p/>
- * Will mainly parse configuration options and creates required directories.
- */
- public void init() {
-
- // parse configuration (with no parameters)
- try {
- parse();
- } catch (ArgumentsParserException e) {
- if (log.isErrorEnabled()) {
- log.error("Could not parse configuration", e);
- }
- }
-
- createDirectory(EchoBaseConfigurationOption.DATA_DIRECTORY,
- "data directory");
-
- createDirectory(EchoBaseConfigurationOption.USER_LOG_DIRECTORY,
- "user logs directory");
-
- createDirectory(EchoBaseConfigurationOption.TREATMENT_WORKING_DIRECTORY,
- "treatment workdir directory");
- }
-
- /**
- * Creates a directory given the configuration given key.
- *
- * @param key the configuration option key which contains the location of
- * the directory to create
- * @param name a name used for logs
- */
- protected void createDirectory(EchoBaseConfigurationOption key, String name) {
-
- File directory = getOptionAsFile(key.getKey());
-
- Preconditions.checkNotNull(
- directory,
- "Could not find " + name + " (key " +
- key +
- "in your configuration file named echobase-config)"
- );
- if (log.isInfoEnabled()) {
- log.info(key + " = " + directory);
- }
- try {
- FileUtil.createDirectoryIfNecessary(directory);
- } catch (IOException e) {
- throw new IllegalStateException(
- "Could not create " + name + "in " + directory);
- }
- }
-
- /**
- * All EchoBase configuration options.
- *
- * @since 1.0
- */
- public enum EchoBaseConfigurationOption implements OptionDef {
-
- /** Main directory where to put echobase data (logs, and others...). */
- DATA_DIRECTORY(
- "data.directory",
- n_("echobase.config.data.directory.description"),
- "/var/local/echobase",
- File.class),
-
- INTERNAL_DB_DIRECTORY(
- "internal.db.directory",
- n_("echobase.config.internal.db.directory.description"),
- "${data.directory}/echobase",
- File.class),
-
- PARAMETER_PROFILE_DIRECTORY(
- "parameterProfiles.storage.directory",
- n_("echobase.config.parameterProfiles.storage.directory.description"),
- "${data.directory}/parameter-profiles",
- File.class),
-
- USER_LOG_DIRECTORY(
- "user.log.directory",
- n_("echobase.user.log.directory.description"),
- "${data.directory}/logs",
- File.class),
-
- TREATMENT_WORKING_DIRECTORY(
- "treatment.working.directory",
- n_("echobase.config.treatment.working.directory.description"),
- "${data.directory}/treatments",
- File.class);
-
- /** Configuration key. */
- protected final String key;
-
- /** I18n key of option description */
- protected final String description;
-
- /** Type of option */
- protected final Class<?> type;
-
- /** Default value of option. */
- protected String defaultValue;
-
- EchoBaseConfigurationOption(String key,
- String description,
- String defaultValue,
- Class<?> type) {
- this.key = key;
- this.description = description;
- this.defaultValue = defaultValue;
- this.type = type;
- }
-
- @Override
- public String getKey() {
- return key;
- }
-
- @Override
- public Class<?> getType() {
- return type;
- }
-
- @Override
- public String getDescription() {
- return description;
- }
-
- @Override
- public String getDefaultValue() {
- return defaultValue;
- }
-
- @Override
- public boolean isTransient() {
- return true;
- }
-
- @Override
- public boolean isFinal() {
- return true;
- }
-
- @Override
- public void setDefaultValue(String defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- @Override
- public void setTransient(boolean newValue) {
- // not used
- }
-
- @Override
- public void setFinal(boolean newValue) {
- // not used
- }
- }
-}
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationHelper.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationHelper.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationHelper.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -1,65 +0,0 @@
-/*
- * #%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;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.nuiton.util.ApplicationConfig;
-
-import java.net.URL;
-import java.util.Properties;
-
-
-/**
- * Helper to access specialized property from a neutral configuration
- * {@link ApplicationConfig}.
- *
- * @author chemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class EchoBaseConfigurationHelper {
-
- /** Logger. */
- protected static final Log log =
- LogFactory.getLog(EchoBaseConfigurationHelper.class);
-
- public static String getApplicationVersion(ApplicationConfig config) {
- String v = config.getOption("application.version");
- return v;
- }
-
- public static URL getApplicationSite(ApplicationConfig config) {
- URL url = config.getOptionAsURL("application.site.url");
- return url;
- }
-
- protected EchoBaseConfigurationHelper() {
- // hide helper constructor
- }
-
- protected static void reloadProperty(Properties properties, String propertyName) {
- Object o = properties.getProperty(propertyName);
- properties.put(propertyName, o);
- }
-}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseObjectFactory.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseObjectFactory.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseObjectFactory.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -25,15 +25,14 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
-import fr.ifremer.echobase.services.IOCService;
import fr.ifremer.echobase.services.EchoBaseServiceInitializable;
import fr.ifremer.echobase.services.EchoBaseServiceInjectable;
import fr.ifremer.echobase.services.EchoBaseServiceSingleton;
+import fr.ifremer.echobase.services.IOCService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.framework.TopiaTransactionAware;
-import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.ObjectUtil;
import java.util.Map;
@@ -55,14 +54,14 @@
* <b>Note:</b> this configuration must be filled before any invocation
* to a service.
*/
- protected static ApplicationConfig configuration;
+ protected static EchoBaseConfiguration configuration;
/**
* Sets the shared application configuration.
*
* @param configuration the shared application configuration to set
*/
- public static void setConfiguration(ApplicationConfig configuration) {
+ public static void setConfiguration(EchoBaseConfiguration configuration) {
EchoBaseObjectFactory.configuration = configuration;
}
@@ -72,7 +71,7 @@
* @return the share application configuration, or {@code null} if none
* was setted
*/
- public static ApplicationConfig getConfiguration() {
+ public static EchoBaseConfiguration getConfiguration() {
return configuration;
}
@@ -81,7 +80,7 @@
* <p/>
* <strong>Note:</strong> The shared configuration must have been setted
* before using this method via the method
- * {@link #setConfiguration(ApplicationConfig)}
+ * {@link #setConfiguration(EchoBaseConfiguration)}
*
* @return the new instanciated EchoBase factory.
*/
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseObjectFactory.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseService.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseService.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -0,0 +1,31 @@
+/*
+ * #%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;
+
+public interface EchoBaseService {
+
+ void setServiceContext(EchoBaseServiceContext serviceContext);
+
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContext.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContext.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContext.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -0,0 +1,43 @@
+/*
+ * #%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.EchoBaseConfiguration;
+import org.nuiton.topia.TopiaContext;
+
+/**
+ * This contract represents objects you must provide when asking for a service.
+ * Objects provided may be injected in services returned by
+ * {@link EchoBaseServiceFactory#newService(Class, EchoBaseServiceContext)}
+ */
+public interface EchoBaseServiceContext {
+
+ TopiaContext getTransaction();
+
+ <E extends EchoBaseService> E newService(Class<E> clazz);
+
+ EchoBaseConfiguration getConfiguration();
+
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContext.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContextImpl.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContextImpl.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContextImpl.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -0,0 +1,66 @@
+/*
+ * #%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 com.google.common.base.Preconditions;
+import fr.ifremer.echobase.EchoBaseConfiguration;
+import org.nuiton.topia.TopiaContext;
+
+/** Instances of this class will be given to service factory. */
+public class EchoBaseServiceContextImpl implements EchoBaseServiceContext {
+
+ protected TopiaContext transaction;
+
+ protected EchoBaseServiceFactory serviceFactory;
+
+ protected EchoBaseConfiguration configuration;
+
+ public EchoBaseServiceContextImpl(TopiaContext transaction,
+ EchoBaseConfiguration configuration,
+ EchoBaseServiceFactory serviceFactory) {
+ this.transaction = transaction;
+ this.configuration = configuration;
+ this.serviceFactory = serviceFactory;
+ }
+
+ @Override
+ public TopiaContext getTransaction() {
+ Preconditions.checkNotNull(transaction);
+ return transaction;
+ }
+
+ @Override
+ public <E extends EchoBaseService> E newService(Class<E> clazz) {
+ return serviceFactory.newService(clazz, this);
+ }
+
+ @Override
+ public EchoBaseConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ protected EchoBaseServiceFactory getServiceFactory() {
+ return serviceFactory;
+ }
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContextImpl.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceFactory.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceFactory.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceFactory.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -0,0 +1,52 @@
+/*
+ * #%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 java.lang.reflect.InvocationTargetException;
+
+public class EchoBaseServiceFactory {
+
+ public <E extends EchoBaseService> E newService(Class<E> clazz, EchoBaseServiceContext serviceContext) {
+ // instantiate service using empty constructor
+ E service;
+ try {
+ service = clazz.getConstructor().newInstance();
+ } catch (InstantiationException e) {
+ throw new EchoBaseTechnicalException(e);
+ } catch (IllegalAccessException e) {
+ throw new EchoBaseTechnicalException(e);
+ } catch (InvocationTargetException e) {
+ throw new EchoBaseTechnicalException(e);
+ } catch (NoSuchMethodException e) {
+ throw new EchoBaseTechnicalException(e);
+ }
+
+ service.setServiceContext(serviceContext);
+
+ return service;
+ }
+
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceFactory.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceInitializable.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceInjectable.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceSingleton.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/IOCService.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/AbstractInjector.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectDAO.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectEntitiesById.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectEntityById.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectFromDAO.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/Injector.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorDAO.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorEntitiesById.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorEntityById.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorFromDAO.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/resources/META-INF/services/fr.ifremer.echobase.services.ioc.Injector
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/echobase-services/src/main/resources/echobase-config
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/echobase-services/src/main/resources/echobase-db-h2.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/resources/echobase-db.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-services/src/test/resources/log4j.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/LICENSE.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/README.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/changelog.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/pom.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/license/THIRD-PARTY.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/env/dev/resources/log4j.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/env/dev/resources/struts.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/env/prod/resources/log4j.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/ApplicationListener.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/ApplicationListener.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/ApplicationListener.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -23,8 +23,11 @@
*/
package fr.ifremer.echobase.ui;
+import com.google.common.base.Supplier;
import fr.ifremer.echobase.EchoBaseConfiguration;
import fr.ifremer.echobase.EchoBaseObjectFactory;
+import fr.ifremer.echobase.EchoBaseTopiaRootContextSupplierFactory;
+import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
import fr.ird.converter.FloatConverter;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.Converter;
@@ -58,6 +61,8 @@
protected static final Log log =
LogFactory.getLog(ApplicationListener.class);
+ private Supplier<TopiaContext> rootContextSupplier;
+
@Override
public void contextInitialized(ServletContextEvent sce) {
@@ -65,19 +70,30 @@
log.info("Application starting at " + new Date() + "...");
}
+ // init I18n
+ DefaultI18nInitializer i18nInitializer =
+ new DefaultI18nInitializer("echobase-i18n");
+ i18nInitializer.setMissingKeyReturnNull(true);
+ I18n.init(i18nInitializer, Locale.getDefault());
+
+ EchoBaseApplicationContext applicationContext = new EchoBaseApplicationContext();
+ sce.getServletContext().setAttribute(EchoBaseActionSupport.APPLICATION_CONTEXT_PARAMETER, applicationContext);
+
// initialize configuration
EchoBaseConfiguration configuration = new EchoBaseConfiguration();
- configuration.init();
+ applicationContext.setConfiguration(configuration);
+ if (log.isInfoEnabled()) {
+ log.info("Initializing RootContextSupplier...");
+ }
+ EchoBaseTopiaRootContextSupplierFactory factory =
+ new EchoBaseTopiaRootContextSupplierFactory();
+ rootContextSupplier = factory.newDatabaseFromConfig(configuration);
+ applicationContext.setRootContextSupplier(rootContextSupplier);
+
// attach configuration to service factory
EchoBaseObjectFactory.setConfiguration(configuration);
- // init I18n
- DefaultI18nInitializer i18nInitializer =
- new DefaultI18nInitializer("echobase-i18n");
- i18nInitializer.setMissingKeyReturnNull(true);
- I18n.init(i18nInitializer, Locale.getDefault());
-
// register our not locale dependant converter
Converter converter = ConverterUtil.getConverter(Float.class);
if (converter != null) {
@@ -89,6 +105,7 @@
EchoBaseObjectFactory serviceFactory = EchoBaseObjectFactory.newInstance();
// init database (and create minimal admin user if required)
+
// initInternalDatabase(serviceFactory, configuration);
}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/ApplicationListener.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationContext.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationContext.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationContext.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -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%
+ */
+package fr.ifremer.echobase.ui;
+
+import com.google.common.base.Supplier;
+import fr.ifremer.echobase.EchoBaseConfiguration;
+import org.nuiton.topia.TopiaContext;
+
+public class EchoBaseApplicationContext {
+
+ protected EchoBaseConfiguration configuration;
+
+ protected Supplier<TopiaContext> rootContextSupplier;
+
+ public EchoBaseConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(EchoBaseConfiguration configuration) {
+ this.configuration = configuration;
+ }
+
+ public Supplier<TopiaContext> getRootContextSupplier() {
+ return rootContextSupplier;
+ }
+
+ public void setRootContextSupplier(Supplier<TopiaContext> rootContextSupplier) {
+ this.rootContextSupplier = rootContextSupplier;
+ }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationContext.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/EchoBaseSession.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -23,7 +23,6 @@
*/
package fr.ifremer.echobase.ui;
-import com.opensymphony.xwork2.ActionContext;
import fr.ifremer.echobase.EchoBaseObjectFactory;
import fr.ifremer.echobase.entities.EchoBaseUser;
import org.apache.commons.logging.Log;
@@ -43,42 +42,42 @@
/** Logger. */
private static final Log log = LogFactory.getLog(EchoBaseSession.class);
- /**
- * Obtain the user EchoBase session.
- * <p/>
- * If not found in application session, then will instanciate it and
- * push it in it.
- * <p/>
- * At the creation time the session, it will also set his object factory.
- *
- * @return the user EchoBase session (never null)
- */
- public static EchoBaseSession getEchoBaseSession() {
- Map<String, Object> session = ActionContext.getContext().getSession();
- EchoBaseSession echoBaseSession = (EchoBaseSession)
- session.get(SESSION_PARAMETER_ECHO_BASE_SESSION);
- if (echoBaseSession == null) {
- // let's create it
- echoBaseSession = new EchoBaseSession();
- echoBaseSession.setObjectFactory(EchoBaseObjectFactory.newInstance());
- session.put(SESSION_PARAMETER_ECHO_BASE_SESSION, echoBaseSession);
- }
- return echoBaseSession;
- }
+// /**
+// * Obtain the user EchoBase session.
+// * <p/>
+// * If not found in application session, then will instanciate it and
+// * push it in it.
+// * <p/>
+// * At the creation time the session, it will also set his object factory.
+// *
+// * @return the user EchoBase session (never null)
+// */
+// public static EchoBaseSession getEchoBaseSession() {
+// Map<String, Object> session = ActionContext.getContext().getSession();
+// EchoBaseSession echoBaseSession = (EchoBaseSession)
+// session.get(SESSION_PARAMETER_ECHO_BASE_SESSION);
+// if (echoBaseSession == null) {
+// // let's create it
+// echoBaseSession = new EchoBaseSession();
+// echoBaseSession.setObjectFactory(EchoBaseObjectFactory.newInstance());
+// session.put(SESSION_PARAMETER_ECHO_BASE_SESSION, echoBaseSession);
+// }
+// return echoBaseSession;
+// }
- /**
- * Tests if user is loggued (means the {@link #getEchoBaseUser()} is not null).
- *
- * @return {@code true} if user is loggued, {@code false} otherwise
- */
- public static boolean isUserInSession() {
- EchoBaseSession session = getEchoBaseSession();
- boolean result = session.getEchoBaseUser() != null;
- return result;
- }
+// /**
+// * Tests if user is loggued (means the {@link #getEchoBaseUser()} is not null).
+// *
+// * @return {@code true} if user is loggued, {@code false} otherwise
+// */
+// public static boolean isUserInSession() {
+// EchoBaseSession session = getEchoBaseSession();
+// boolean result = session.getEchoBaseUser() != null;
+// return result;
+// }
/** Key used to store this EchoBase session in application session */
- public static final String SESSION_PARAMETER_ECHO_BASE_SESSION = "echobaseSession";
+// public static final String SESSION_PARAMETER_ECHO_BASE_SESSION = "echobaseSession";
/** Key to set EchoBase factory in this session. */
protected static final String PROPERTY_OBJECT_FACTORY = "objectFactory";
@@ -152,7 +151,7 @@
}
/** Protect session constructor. */
- protected EchoBaseSession() {
+ public EchoBaseSession() {
store = new TreeMap<String, Object>();
}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSessionAware.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSessionAware.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSessionAware.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -1,35 +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;
-
-/**
- * Set the EchoBase session user in the action.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public interface EchoBaseSessionAware {
-
- void setEchoBaseSession(EchoBaseSession echoBaseSession);
-}
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-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -24,16 +24,23 @@
package fr.ifremer.echobase.ui.actions;
import com.google.common.base.Preconditions;
-import fr.ifremer.echobase.EchoBaseConfigurationHelper;
+import com.opensymphony.xwork2.ActionContext;
+import fr.ifremer.echobase.EchoBaseConfiguration;
import fr.ifremer.echobase.EchoBaseObjectFactory;
+import fr.ifremer.echobase.services.EchoBaseService;
+import fr.ifremer.echobase.services.EchoBaseServiceContext;
+import fr.ifremer.echobase.services.EchoBaseServiceContextImpl;
+import fr.ifremer.echobase.services.EchoBaseServiceFactory;
import fr.ifremer.echobase.services.IOCService;
+import fr.ifremer.echobase.ui.EchoBaseApplicationContext;
import fr.ifremer.echobase.ui.EchoBaseSession;
-import fr.ifremer.echobase.ui.EchoBaseSessionAware;
-import org.nuiton.util.ApplicationConfig;
+import org.nuiton.topia.TopiaContext;
+import org.nuiton.topia.framework.TopiaTransactionAware;
import org.nuiton.web.struts2.BaseAction;
import java.text.SimpleDateFormat;
import java.util.Date;
+import java.util.Map;
/**
* EchoBase action support.
@@ -46,49 +53,75 @@
* @author chemit <chemit(a)codelutin.com>
* @since 1.0
*/
-public class EchoBaseActionSupport extends BaseAction implements EchoBaseSessionAware {
+public class EchoBaseActionSupport extends BaseAction implements TopiaTransactionAware {
private static final long serialVersionUID = 1L;
public static final String LOG_LINE =
"--------------------------------------------------------------------------------";
+ /** Key to store the {@link EchoBaseSession} instance in the session's map. */
+ protected static final String SESSION_PARAMETER = "echoBaseSession";
+
+ /** Key to store the single instance of the application context */
+ public static final String APPLICATION_CONTEXT_PARAMETER = "echoBaseApplicationContext";
+
private SimpleDateFormat dateFormat;
private SimpleDateFormat monthFormat;
+ public static EchoBaseApplicationContext getEchoBaseApplicationContext() {
+ Map<String, Object> application = ActionContext.getContext().getApplication();
+ EchoBaseApplicationContext applicationContext =
+ (EchoBaseApplicationContext) application.get(APPLICATION_CONTEXT_PARAMETER);
+ return applicationContext;
+ }
- /**
- * EchoBase User session.
- * <p/>
- * <strong>This object will be injected only if you implements the
- * contract {@link EchoBaseSessionAware} on your action.</strong>
- */
+ protected EchoBaseConfiguration getConfiguration() {
+ return getEchoBaseApplicationContext().getConfiguration();
+ }
+
+ /** EchoBase User session. */
private transient EchoBaseSession echoBaseSession;
/**
- * To inject the EchoBase User session in action.
- *
- * @param echoBaseSession the new EchoBase User session to inject in action
+ * Provides a way to get a service.
+ * <p/>
+ * Actions may <strong>not</strong> call it directly by use
+ * {@link #newService(Class)} instead.
*/
- @Override
- public final void setEchoBaseSession(EchoBaseSession echoBaseSession) {
- this.echoBaseSession = echoBaseSession;
- }
+ protected transient EchoBaseServiceFactory serviceFactory =
+ new EchoBaseServiceFactory();
- protected EchoBaseSession getEchoBaseSession() {
+ protected transient EchoBaseServiceContext serviceContext;
+
+ protected transient TopiaContext transaction;
+
+ public EchoBaseSession getEchoBaseSession() {
+ if (echoBaseSession == null) {
+
+ // load it from session
+ Map<String, Object> strutsSession = ActionContext.getContext().getSession();
+ EchoBaseSession session = (EchoBaseSession)
+ strutsSession.get(SESSION_PARAMETER);
+
+ if (session == null) {
+
+ // create an empty session
+ session = new EchoBaseSession();
+
+ // and store it in the struts session
+ strutsSession.put(SESSION_PARAMETER, session);
+ }
+ echoBaseSession = session;
+ }
return echoBaseSession;
}
public static String getApplicationVersion() {
- return EchoBaseConfigurationHelper.getApplicationVersion(
- EchoBaseObjectFactory.getConfiguration());
+ return getEchoBaseApplicationContext().getConfiguration().getApplicationVersion().toString();
}
- protected ApplicationConfig getApplicationConfig() {
- return EchoBaseObjectFactory.getConfiguration();
- }
-
public EchoBaseObjectFactory getServiceFactory() {
Preconditions.checkNotNull(echoBaseSession,
"No echo base user session injected.");
@@ -96,6 +129,39 @@
return factory;
}
+ /**
+ * Fabrique pour récupérer le ServiceContext tel qu'il devrait être fourni
+ * à la fabrication d'un service.
+ */
+ protected EchoBaseServiceContext getServiceContext() {
+ if (serviceContext == null) {
+ serviceContext = new EchoBaseServiceContextImpl(
+ getTransaction(), getConfiguration(), serviceFactory);
+ }
+ return serviceContext;
+ }
+
+ /**
+ * Sub-classes should use this method to easily get a service instance.
+ *
+ * @param serviceClass The type of service to instantiate
+ * @return A newly created service of the expected type with necessary data set
+ */
+ public <E extends EchoBaseService> E newService(Class<E> serviceClass) {
+ E service = serviceFactory.newService(serviceClass, getServiceContext());
+ return service;
+ }
+
+ @Override
+ public TopiaContext getTransaction() {
+ return transaction;
+ }
+
+ @Override
+ public void setTransaction(TopiaContext transaction) {
+ this.transaction = transaction;
+ }
+
public IOCService getIocService() {
return getServiceFactory().newService(IOCService.class);
}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseTransactionActionSupport.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseTransactionActionSupport.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseTransactionActionSupport.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -1,53 +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;
-
-import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.framework.TopiaTransactionAware;
-
-/**
- * EchoBase action with a transaction.
- *
- * @author chemit <chemit(a)codelutin.com>
- * @see TopiaTransactionAware
- * @see EchoBaseActionSupport
- * @since 1.0
- */
-public class EchoBaseTransactionActionSupport extends EchoBaseActionSupport implements TopiaTransactionAware {
-
- private static final long serialVersionUID = 1L;
-
- protected transient TopiaContext transaction;
-
- @Override
- public TopiaContext getTransaction() {
- return transaction;
- }
-
- @Override
- public void setTransaction(TopiaContext transaction) {
- this.transaction = transaction;
- }
-
-}
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/HomeAction.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/HomeAction.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/HomeAction.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -32,7 +32,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0
*/
-public class HomeAction extends EchoBaseTransactionActionSupport {
+public class HomeAction extends EchoBaseActionSupport {
private static final long serialVersionUID = 1L;
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/HomeAction.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/LoginAction.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/LoginAction.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/LoginAction.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -40,7 +40,7 @@
* @author chemit <chemit(a)codelutin.com>
* @since 1.0
*/
-public class LoginAction extends EchoBaseTransactionActionSupport implements SessionAware {
+public class LoginAction extends EchoBaseActionSupport implements SessionAware {
protected static final Log log = LogFactory.getLog(LoginAction.class);
@@ -124,8 +124,7 @@
userSession.setObjectFactory(null);
// remove echoBaseSession from application session
- ActionContext.getContext().getSession().remove(
- EchoBaseSession.SESSION_PARAMETER_ECHO_BASE_SESSION);
+ ActionContext.getContext().getSession().remove(SESSION_PARAMETER);
return SUCCESS;
}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/LoginAction.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/AbstractCheckInterceptor.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckInUserSessionInterceptor.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckInUserSessionInterceptor.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckInUserSessionInterceptor.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -27,6 +27,7 @@
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.util.TextParseUtil;
import fr.ifremer.echobase.ui.EchoBaseSession;
+import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -63,7 +64,9 @@
@Override
protected boolean doCheck(ActionInvocation invocation) {
- EchoBaseSession echoBaseSession = EchoBaseSession.getEchoBaseSession();
+ EchoBaseActionSupport action = (EchoBaseActionSupport) invocation.getAction();
+
+ EchoBaseSession echoBaseSession = action.getEchoBaseSession();
Set<String> missingKeys = null;
for (String parameter : parameters) {
boolean ok = echoBaseSession.contains(parameter);
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckInUserSessionInterceptor.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckLogguedInterceptor.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckLogguedInterceptor.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckLogguedInterceptor.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -25,6 +25,7 @@
import com.opensymphony.xwork2.ActionInvocation;
import fr.ifremer.echobase.ui.EchoBaseSession;
+import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -53,8 +54,11 @@
@Override
protected boolean doCheck(ActionInvocation invocation) {
- boolean userLoggued = EchoBaseSession.isUserInSession();
+ EchoBaseActionSupport action = (EchoBaseActionSupport) invocation.getAction();
+ EchoBaseSession echoBaseSession = action.getEchoBaseSession();
+ boolean userLoggued = echoBaseSession.getEchoBaseUser() != null;
+
if (!userLoggued) {
if (log.isInfoEnabled()) {
log.info("No user loggued!");
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckLogguedInterceptor.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckUserIsAdmin.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckUserIsAdmin.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckUserIsAdmin.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -27,6 +27,7 @@
import com.opensymphony.xwork2.ActionInvocation;
import fr.ifremer.echobase.entities.EchoBaseUser;
import fr.ifremer.echobase.ui.EchoBaseSession;
+import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
/**
* To check if logged user is admin.
@@ -40,8 +41,10 @@
@Override
protected boolean doCheck(ActionInvocation invocation) {
- EchoBaseSession echoBaseSession = EchoBaseSession.getEchoBaseSession();
+ EchoBaseActionSupport action = (EchoBaseActionSupport) invocation.getAction();
+ EchoBaseSession echoBaseSession = action.getEchoBaseSession();
+
EchoBaseUser user = echoBaseSession.getEchoBaseUser();
Preconditions.checkNotNull(user, "No user found is session");
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckUserIsAdmin.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CleanEchoBaseSessionInterceptor.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CleanEchoBaseSessionInterceptor.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CleanEchoBaseSessionInterceptor.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -27,6 +27,7 @@
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.opensymphony.xwork2.util.TextParseUtil;
import fr.ifremer.echobase.ui.EchoBaseSession;
+import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -62,18 +63,17 @@
@Override
public String intercept(ActionInvocation invocation) throws Exception {
- EchoBaseSession echoBaseSession = EchoBaseSession.getEchoBaseSession();
- if (echoBaseSession != null) {
+ EchoBaseActionSupport action = (EchoBaseActionSupport) invocation.getAction();
- for (String paramName : parameters) {
- Object value = echoBaseSession.remove(paramName);
- if (log.isDebugEnabled()) {
- log.debug("Removed [" + paramName + "] : " + value);
- }
+ EchoBaseSession echoBaseSession = action.getEchoBaseSession();
-
+ for (String paramName : parameters) {
+ Object value = echoBaseSession.remove(paramName);
+ if (log.isDebugEnabled()) {
+ log.debug("Removed [" + paramName + "] : " + value);
}
}
+
return invocation.invoke();
}
}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CleanEchoBaseSessionInterceptor.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseSessionInterceptor.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseSessionInterceptor.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseSessionInterceptor.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -1,51 +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.interceptors;
-
-import com.opensymphony.xwork2.ActionInvocation;
-import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
-import fr.ifremer.echobase.ui.EchoBaseSession;
-import fr.ifremer.echobase.ui.EchoBaseSessionAware;
-
-/**
- * Inject the {@link EchoBaseSession} inside any action with contract
- * {@link EchoBaseSessionAware}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 1.0
- */
-public class EchoBaseSessionInterceptor extends AbstractInterceptor {
- private static final long serialVersionUID = 1L;
-
- @Override
- public String intercept(ActionInvocation invocation) throws Exception {
-
- Object action = invocation.getAction();
- if (action instanceof EchoBaseSessionAware) {
- EchoBaseSession echoBaseSession = EchoBaseSession.getEchoBaseSession();
- ((EchoBaseSessionAware) action).setEchoBaseSession(echoBaseSession);
- }
- return invocation.invoke();
- }
-}
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseTransactionInterceptorImpl.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseTransactionInterceptorImpl.java 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseTransactionInterceptorImpl.java 2011-11-04 10:09:27 UTC (rev 8)
@@ -23,7 +23,9 @@
*/
package fr.ifremer.echobase.ui.interceptors;
-import fr.ifremer.echobase.ui.EchoBaseSession;
+import com.google.common.base.Supplier;
+import fr.ifremer.echobase.ui.EchoBaseApplicationContext;
+import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaContext;
@@ -47,8 +49,13 @@
@Override
protected TopiaContext beginTransaction() throws TopiaException {
- EchoBaseSession echoBaseSession = EchoBaseSession.getEchoBaseSession();
- TopiaContext transaction = echoBaseSession.getObjectFactory().beginTransaction();
+ EchoBaseApplicationContext applicationContext =
+ EchoBaseActionSupport.getEchoBaseApplicationContext();
+ Supplier<TopiaContext> rootContextSupplier =
+ applicationContext.getRootContextSupplier();
+
+ TopiaContext rootContext = rootContextSupplier.get();
+ TopiaContext transaction = rootContext.beginTransaction();
if (log.isDebugEnabled()) {
log.debug("Starts a new echo transaction " + transaction);
}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseTransactionInterceptorImpl.java
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/resources/config/struts-user.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Modified: trunk/echobase-ui/src/main/resources/struts.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/struts.xml 2011-11-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/resources/struts.xml 2011-11-04 10:09:27 UTC (rev 8)
@@ -61,10 +61,6 @@
<interceptor name="topiaTransaction"
class="fr.ifremer.echobase.ui.interceptors.EchoBaseTransactionInterceptorImpl"/>
- <!-- to inject the echobase session inside an action -->
- <interceptor name="injectEchoBaseSession"
- class="fr.ifremer.echobase.ui.interceptors.EchoBaseSessionInterceptor"/>
-
<!-- to clean some properties from the echobase session -->
<interceptor name="cleanEchoBaseSession"
class="fr.ifremer.echobase.ui.interceptors.CleanEchoBaseSessionInterceptor"/>
@@ -97,16 +93,12 @@
<!-- echobase basic authenticated stack -->
<interceptor-stack name="echoBaseBasicStack">
- <interceptor-ref name="injectEchoBaseSession"/>
- <!--<interceptor-ref name="checkEchoBaseDatabaseSelected"/>-->
<interceptor-ref name="topiaTransaction"/>
<interceptor-ref name="basicStack"/>
</interceptor-stack>
<!-- echobase stack with params-->
<interceptor-stack name="echoBaseParamsPrepareParamsStack">
- <interceptor-ref name="injectEchoBaseSession"/>
- <!--<interceptor-ref name="checkEchoBaseDatabaseSelected"/>-->
<interceptor-ref name="topiaTransaction"/>
<interceptor-ref name="paramsPrepareParamsStack"/>
</interceptor-stack>
@@ -118,15 +110,6 @@
<interceptor-ref name="echoBaseBasicStack"/>
</interceptor-stack>
- <interceptor-stack name="loginAndActionContext">
- <interceptor-ref name="i18n"/>
- <interceptor-ref name="checkUserLoggued"/>
- <interceptor-ref name="checkEchobaseSession">
- <param name="parameters">actionContext</param>
- <param name="redirectAction">/missingActionContext</param>
- </interceptor-ref>
- </interceptor-stack>
-
<!-- authenticated stack with params-->
<interceptor-stack name="paramsPrepareParamsStackLoggued">
<interceptor-ref name="i18n"/>
@@ -159,7 +142,6 @@
<param name="paramNames">request_locale</param>
</interceptor-ref>
<interceptor-ref name="checkUserLoggued"/>
- <interceptor-ref name="injectEchoBaseSession"/>
<interceptor-ref name="topiaTransaction"/>
</action>
Property changes on: trunk/echobase-ui/src/main/resources/struts.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/decorators/layout-default.jsp
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/footer.jsp
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/i18n.jsp
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
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-04 09:21:14 UTC (rev 7)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp 2011-11-04 10:09:27 UTC (rev 8)
@@ -2,7 +2,7 @@
#%L
EchoBase :: UI
- $Id: i18n.jsp 1 2011-11-03 14:23:42Z tchemit $
+ $Id$
$HeadURL$
%%
Copyright (C) 2011 Ifremer, Codelutin
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/metas.jsp
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/ImportProgress.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/ImportResult.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/imports.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/login.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/users.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/web.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/webapp/css/screen.css
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/webapp/images/exclamation.png
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/webapp/images/logo_codelutin.png
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/webapp/images/true.png
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/webapp/index.jsp
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/main/webapp/js/gridHelper.js
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/src/site/rst/index.rst
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/echobase-ui/src/site/site_fr.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/echobase-ui/web/WEB-INF/web.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/pom.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/src/doc/reunions/reunion-2011-11-03.txt
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
Property changes on: trunk/src/site/rst/Todo.rst
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/site/rst/index.rst
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Property changes on: trunk/src/site/site_fr.xml
___________________________________________________________________
Modified: svn:keywords
- Author Date Id Revision
+ Author Date Id Revision HeadURL
1
0
r7 - in trunk/echobase-ui/src/main: resources resources/config resources/i18n webapp/WEB-INF/jsp webapp/WEB-INF/jsp/import webapp/WEB-INF/jsp/user
by sletellier@users.forge.codelutin.com 04 Nov '11
by sletellier@users.forge.codelutin.com 04 Nov '11
04 Nov '11
Author: sletellier
Date: 2011-11-04 10:21:14 +0100 (Fri, 04 Nov 2011)
New Revision: 7
Url: http://forge.codelutin.com/repositories/revision/echobase/7
Log:
- Rename all ecobase to ecHobase
- Creating import pages
- Creating user administration page
- Add missing traductions
Added:
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/ImportProgress.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/ImportResult.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/imports.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/users.jsp
Modified:
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/resources/struts.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/login.jsp
Modified: trunk/echobase-ui/src/main/resources/config/struts-user.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/config/struts-user.xml 2011-11-04 08:43:34 UTC (rev 6)
+++ trunk/echobase-ui/src/main/resources/config/struts-user.xml 2011-11-04 09:21:14 UTC (rev 7)
@@ -40,8 +40,8 @@
<!-- login action -->
<action name="login" class="fr.ifremer.echobase.ui.actions.LoginAction"
method="doLogin">
- <result name="input">/WEB-INF/jsp/login.jsp</result>
- <result name="error">/WEB-INF/jsp/login.jsp</result>
+ <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="internalTransaction"/>-->
<interceptor-ref name="paramsPrepareParamsStack"/>
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-04 08:43:34 UTC (rev 6)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2011-11-04 09:21:14 UTC (rev 7)
@@ -1,10 +1,23 @@
echobase.action.locale.english=Anglais
echobase.action.locale.french=Français
+echobase.action.login=Connection
echobase.action.logout=Déconnection
+echobase.common.admin=Administrateur
+echobase.common.email=Email
+echobase.common.password=Mot de passe
echobase.label.language=Language
echobase.label.locale.english=Anglais
echobase.label.locale.french=Français
-echobase.label.user.login=Login
-ecobase.label.login=Connection
-ecobase.label.welcome=Bienvenue
-ecobase.title.login=Connection
+echobase.label.login=Connection
+echobase.label.welcome=Bienvenue
+echobase.menu.export=Exports
+echobase.menu.import=Imports
+echobase.menu.logs=Logs
+echobase.menu.users=Utilisateurs
+echobase.msg.warnImportInProgress=Merci de ne pas fermer la fenêtre pour pouvoir acceder au résultats de l'import.
+echobase.title.import=Imports
+echobase.title.importProgress=Import en cours
+echobase.title.importResult=Résultats de l'import
+echobase.title.login=Connection
+echobase.title.users=Adminitration des utilisateurs
+echobase.user.gridTitle=Liste des utilisateurs
Modified: trunk/echobase-ui/src/main/resources/struts.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/struts.xml 2011-11-04 08:43:34 UTC (rev 6)
+++ trunk/echobase-ui/src/main/resources/struts.xml 2011-11-04 09:21:14 UTC (rev 7)
@@ -57,15 +57,15 @@
<interceptor name="paramRemover"
class="com.opensymphony.xwork2.interceptor.ParameterRemoverInterceptor"/>
- <!-- to manage the Ecobase topia transaction inside an action -->
+ <!-- to manage the echobase topia transaction inside an action -->
<interceptor name="topiaTransaction"
class="fr.ifremer.echobase.ui.interceptors.EchoBaseTransactionInterceptorImpl"/>
- <!-- to inject the ecobase session inside an action -->
+ <!-- to inject the echobase session inside an action -->
<interceptor name="injectEchoBaseSession"
class="fr.ifremer.echobase.ui.interceptors.EchoBaseSessionInterceptor"/>
- <!-- to clean some properties from the ecobase session -->
+ <!-- to clean some properties from the echobase session -->
<interceptor name="cleanEchoBaseSession"
class="fr.ifremer.echobase.ui.interceptors.CleanEchoBaseSessionInterceptor"/>
@@ -81,7 +81,7 @@
<param name="redirectAction">/home</param>
</interceptor>
- <interceptor name="checkEcobaseSession"
+ <interceptor name="checkEchobaseSession"
class="fr.ifremer.echobase.ui.interceptors.CheckInUserSessionInterceptor"/>
</interceptors>
@@ -95,7 +95,7 @@
<interceptors>
- <!-- ecobase basic authenticated stack -->
+ <!-- echobase basic authenticated stack -->
<interceptor-stack name="echoBaseBasicStack">
<interceptor-ref name="injectEchoBaseSession"/>
<!--<interceptor-ref name="checkEchoBaseDatabaseSelected"/>-->
@@ -103,7 +103,7 @@
<interceptor-ref name="basicStack"/>
</interceptor-stack>
- <!-- ecobase stack with params-->
+ <!-- echobase stack with params-->
<interceptor-stack name="echoBaseParamsPrepareParamsStack">
<interceptor-ref name="injectEchoBaseSession"/>
<!--<interceptor-ref name="checkEchoBaseDatabaseSelected"/>-->
@@ -121,7 +121,7 @@
<interceptor-stack name="loginAndActionContext">
<interceptor-ref name="i18n"/>
<interceptor-ref name="checkUserLoggued"/>
- <interceptor-ref name="checkEcobaseSession">
+ <interceptor-ref name="checkEchobaseSession">
<param name="parameters">actionContext</param>
<param name="redirectAction">/missingActionContext</param>
</interceptor-ref>
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-04 08:43:34 UTC (rev 6)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp 2011-11-04 09:21:14 UTC (rev 7)
@@ -23,9 +23,9 @@
--%>
<%@ page language="java" contentType="text/html" pageEncoding="utf-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
-<%--<s:set var="userIsAdmin" value="%{#session.ecobaseSession.ecobaseUser.admin}"/>--%>
-<title><s:text name="ecobase.label.welcome"/></title>
+<%--<s:set var="userIsAdmin" value="%{#session.echobaseSession.echobaseUser.admin}"/>--%>
+<title><s:text name="echobase.label.welcome"/></title>
-<h2><s:text name="ecobase.label.welcome"/></h2>
+<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/import/ImportProgress.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/ImportProgress.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/ImportProgress.jsp 2011-11-04 09:21:14 UTC (rev 7)
@@ -0,0 +1,33 @@
+<%--
+ #%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" %>
+
+<title><s:text name="echobase.title.importProgress"/></title>
+
+<sj:progressbar value="%{EchoBaseActionContext.progression}"/>
+
+<%-- TODO letellier 20111104 : Add warn icon --%>
+<p><s:text name="echobase.msg.warnImportInProgress"/></p>
\ No newline at end of file
Added: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/ImportResult.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/ImportResult.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/ImportResult.jsp 2011-11-04 09:21:14 UTC (rev 7)
@@ -0,0 +1,29 @@
+<%--
+ #%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" %>
+
+<title><s:text name="echobase.title.importResult"/></title>
+
+<%-- TODO letellier 20111104 : Add import results --%>
\ No newline at end of file
Added: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/imports.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/imports.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/import/imports.jsp 2011-11-04 09:21:14 UTC (rev 7)
@@ -0,0 +1,43 @@
+<%--
+ #%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" %>
+
+<title><s:text name="echobase.title.import"/></title>
+
+<s:form id="importForm" action="importFiles" namespace="/import" method="POST" enctype="multipart/form-data">
+
+ <%-- TODO letellier 20111104 : Allow to select existing campagne --%>
+
+ <s:file name="accoustique" key="echobase.importFile.accoustique"/>
+ <s:file name="pecherie" key="echobase.importFile.pecherie"/>
+ <s:file name="lectureAgeGen" key="echobase.importFile.lectureAgeGen"/>
+ <s:file name="events" key="echobase.importFile.events"/>
+ <s:file name="typeEchoSpecies" key="echobase.importFile.typeEchoSpecies"/>
+
+ <s:textarea name="comment" key="echobase.common.comment"/>
+
+ <s:submit id="addFilesSubmit"
+ value="%{saveText}"/>
+</s:form>
\ No newline at end of file
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/login.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/login.jsp 2011-11-04 08:43:34 UTC (rev 6)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/login.jsp 2011-11-04 09:21:14 UTC (rev 7)
@@ -27,7 +27,7 @@
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
- <title>Ecobase - <s:text name="ecobase.label.login"/></title>
+ <title>Echobase - <s:text name="echobase.label.login"/></title>
<link rel="stylesheet" type="text/css"
href="<s:url value='/css/screen.css' />"/>
<link rel="icon" type="image/png"
@@ -41,7 +41,7 @@
<div class='displayBlock'>
<div class='floatLeft'>
- <s:a action="home" namespace="/">Ecobase</s:a>
+ <s:a action="home" namespace="/">Echobase</s:a>
</div>
<div id='headerRight'>
<%@ include file="/WEB-INF/includes/i18n.jsp" %>
@@ -52,13 +52,13 @@
<%-- content --%>
-<h2><s:text name="ecobase.title.login"/></h2>
+<h2><s:text name="echobase.title.login"/></h2>
<s:form method="POST" namespace="/user">
<s:hidden key="redirectAction" label=""/>
- <s:textfield name="login" key="ecobase.common.login" required="true"/>
- <s:password name="password" key="ecobase.common.password" required="true"/>
- <s:submit action="login" key="ecobase.action.login" align="right"/>
+ <s:textfield name="email" key="echobase.common.email" required="true"/>
+ <s:password name="password" key="echobase.common.password" required="true"/>
+ <s:submit action="login" key="echobase.action.login" align="right"/>
</s:form>
<br/>
Added: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/users.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/users.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/users.jsp 2011-11-04 09:21:14 UTC (rev 7)
@@ -0,0 +1,99 @@
+<%--
+ #%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="sjg" uri="/struts-jquery-grid-tags" %>
+
+<title><s:text name="echobase.title.users"/></title>
+
+<h2><s:text name="echobase.title.users"/></h2>
+
+<hr/>
+
+<s:url id="usersListUrl" namespace="/users" action="list"/>
+<s:url id="saveUrl" action="saveUser" />
+
+<sjg:grid id="usersList"
+ caption='%{getText("echobase.user.gridTitle")}'
+ dataType="json"
+ href="%{usersListUrl}"
+ pager="true"
+ navigator="true"
+ navigatorAddOptions="{
+ height:280,
+ reloadAfterSubmit:true,
+ afterSubmit:function(response, postdata) {
+ return isError(response.responseText);
+ }
+ }"
+ navigatorEdit="true"
+ navigatorEditOptions="{
+ height:280,
+ reloadAfterSubmit:true,
+ afterSubmit:function(response, postdata) {
+ return isError(response.responseText);
+ }
+ }"
+ navigatorDelete="true"
+ navigatorDeleteOptions="{
+ height:280,
+ reloadAfterSubmit:true,
+ afterSubmit:function(response, postdata) {
+ return isError(response.responseText);
+ }
+ }"
+ gridModel="gridModel"
+ rowList="10,100,1000"
+ rowNum="10"
+ editurl="%{saveUrl}"
+ editinline="false"
+ rownumbers="true"
+ multiselect="false"
+ autowidth="true"
+ viewrecords="true">
+
+ <sjg:gridColumn name="id"
+ key="true"
+ hidden="true"/>
+
+ <sjg:gridColumn name="email"
+ title='%{getText("echobase.common.email")}'
+ sortable="true"
+ editable="true"
+ edittype="text"/>
+
+ <sjg:gridColumn name="password"
+ title='%{getText("echobase.common.password")}'
+ editable="true"
+ edittype="password"
+ hidden="true"/>
+
+ <sjg:gridColumn name="admin"
+ title='%{getText("echobase.common.admin")}'
+ sortable="true"
+ editable="true"
+ edittype="checkbox"/>
+
+</sjg:grid>
\ No newline at end of file
1
0
r6 - trunk/echobase-ui/src/main/webapp/WEB-INF/includes
by sletellier@users.forge.codelutin.com 04 Nov '11
by sletellier@users.forge.codelutin.com 04 Nov '11
04 Nov '11
Author: sletellier
Date: 2011-11-04 09:43:34 +0100 (Fri, 04 Nov 2011)
New Revision: 6
Url: http://forge.codelutin.com/repositories/revision/echobase/6
Log:
Add main menu
Added:
trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp
Modified:
trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.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-03 16:52:22 UTC (rev 5)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp 2011-11-04 08:43:34 UTC (rev 6)
@@ -45,7 +45,7 @@
</ul>
</div>
<br/>
- <%@ include file="menuPrincipal.jsp" %>
+ <%@ include file="menu.jsp" %>
<%@ include file="i18n.jsp" %>
<br/>
</div>
Added: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/menu.jsp 2011-11-04 08:43:34 UTC (rev 6)
@@ -0,0 +1,43 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id: i18n.jsp 1 2011-11-03 14:23:42Z tchemit $
+ $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"><s:text name="echobase.menu.import"/></s:a>
+ </li>
+ <li>
+ <s:a action="export"><s:text name="echobase.menu.export"/></s:a>
+ </li>
+ <li>
+ <s:a action="export"><s:text name="echobase.menu.logs"/></s:a>
+ </li>
+ <%--<s:if--%>
+ <%--test="%{userIsAdmin}">--%>
+ <li>
+ <s:a namespace="admin" action="users"><s:text name="echobase.menu.users"/></s:a>
+ </li>
+ <%--</s:if>--%>
+ </ul>
+</div>
1
0
r5 - in trunk/echobase-ui/src/main: java/fr/ifremer/echobase/ui/interceptors resources/i18n webapp/WEB-INF/includes webapp/WEB-INF/jsp
by sletellier@users.forge.codelutin.com 03 Nov '11
by sletellier@users.forge.codelutin.com 03 Nov '11
03 Nov '11
Author: sletellier
Date: 2011-11-03 17:52:22 +0100 (Thu, 03 Nov 2011)
New Revision: 5
Url: http://forge.codelutin.com/repositories/revision/echobase/5
Log:
Comment not implemented code
Modified:
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckUserIsAdmin.java
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/home.jsp
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckUserIsAdmin.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckUserIsAdmin.java 2011-11-03 16:20:03 UTC (rev 4)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CheckUserIsAdmin.java 2011-11-03 16:52:22 UTC (rev 5)
@@ -47,5 +47,4 @@
return user.isAdmin();
}
-
}
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-03 16:20:03 UTC (rev 4)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2011-11-03 16:52:22 UTC (rev 5)
@@ -1,10 +1,10 @@
+echobase.action.locale.english=Anglais
+echobase.action.locale.french=Français
+echobase.action.logout=Déconnection
echobase.label.language=Language
echobase.label.locale.english=Anglais
-echobase.action.locale.english=Anglais
echobase.label.locale.french=Français
-echobase.action.locale.french=Français
+echobase.label.user.login=Login
+ecobase.label.login=Connection
ecobase.label.welcome=Bienvenue
-ecobase.label.login=Connection
ecobase.title.login=Connection
-echobase.label.user.login=Login
-echobase.action.logout=Déconnection
\ No newline at end of file
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-03 16:20:03 UTC (rev 4)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp 2011-11-03 16:52:22 UTC (rev 5)
@@ -32,9 +32,9 @@
<div id='headerRight'>
<div>
<s:text name="echobase.label.user.login">
- <s:param>
- <s:property value="#session.echoBaseSession.echoBaseUser.login"/>
- </s:param>
+ <%--<s:param>--%>
+ <%--<s:property value="#session.echoBaseSession.echoBaseUser.login"/>--%>
+ <%--</s:param>--%>
</s:text>
<ul>
<li>
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-03 16:20:03 UTC (rev 4)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp 2011-11-03 16:52:22 UTC (rev 5)
@@ -23,7 +23,7 @@
--%>
<%@ page language="java" contentType="text/html" pageEncoding="utf-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
-<s:set var="userIsAdmin" value="%{#session.ecobaseSession.ecobaseUser.admin}"/>
+<%--<s:set var="userIsAdmin" value="%{#session.ecobaseSession.ecobaseUser.admin}"/>--%>
<title><s:text name="ecobase.label.welcome"/></title>
<h2><s:text name="ecobase.label.welcome"/></h2>
1
0
03 Nov '11
Author: sletellier
Date: 2011-11-03 17:20:03 +0100 (Thu, 03 Nov 2011)
New Revision: 4
Url: http://forge.codelutin.com/repositories/revision/echobase/4
Log:
- Remove T3 references
- Update files headers
- Creating login and home pages
- Add includes pages
Added:
trunk/echobase-ui/src/main/resources/config/struts-user.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/login.jsp
Modified:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseObjectFactory.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/AbstractInjector.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectDAO.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectEntitiesById.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectEntityById.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectFromDAO.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/Injector.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorDAO.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorEntitiesById.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorEntityById.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorFromDAO.java
trunk/echobase-services/src/main/resources/echobase-db-h2.properties
trunk/echobase-services/src/main/resources/echobase-db.properties
trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/ApplicationListener.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSessionAware.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/LoginAction.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CleanEchoBaseSessionInterceptor.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseSessionInterceptor.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseTransactionInterceptorImpl.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/includes/footer.jsp
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/site/site_fr.xml
trunk/src/site/site_fr.xml
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -36,7 +36,7 @@
import static org.nuiton.i18n.I18n.n_;
/**
- * T3 configuration
+ * EchoBase configuration
*
* @author chemit <chemit(a)codelutin.com>
* @since 1.0
@@ -48,12 +48,12 @@
public EchoBaseConfiguration() {
- setConfigFileName("t3-config");
+ setConfigFileName("echobase-config");
if (log.isInfoEnabled()) {
log.info(this + " is initializing...");
}
- loadDefaultOptions(BaracoudaConfigurationOption.class);
+ loadDefaultOptions(EchoBaseConfigurationOption.class);
}
/**
@@ -72,13 +72,13 @@
}
}
- createDirectory(BaracoudaConfigurationOption.DATA_DIRECTORY,
+ createDirectory(EchoBaseConfigurationOption.DATA_DIRECTORY,
"data directory");
- createDirectory(BaracoudaConfigurationOption.USER_LOG_DIRECTORY,
+ createDirectory(EchoBaseConfigurationOption.USER_LOG_DIRECTORY,
"user logs directory");
- createDirectory(BaracoudaConfigurationOption.TREATMENT_WORKING_DIRECTORY,
+ createDirectory(EchoBaseConfigurationOption.TREATMENT_WORKING_DIRECTORY,
"treatment workdir directory");
}
@@ -89,7 +89,7 @@
* the directory to create
* @param name a name used for logs
*/
- protected void createDirectory(BaracoudaConfigurationOption key, String name) {
+ protected void createDirectory(EchoBaseConfigurationOption key, String name) {
File directory = getOptionAsFile(key.getKey());
@@ -97,7 +97,7 @@
directory,
"Could not find " + name + " (key " +
key +
- "in your configuration file named t3-config)"
+ "in your configuration file named echobase-config)"
);
if (log.isInfoEnabled()) {
log.info(key + " = " + directory);
@@ -111,61 +111,42 @@
}
/**
- * All T3 configuration options.
+ * All EchoBase configuration options.
*
* @since 1.0
*/
- public enum BaracoudaConfigurationOption implements OptionDef {
+ public enum EchoBaseConfigurationOption implements OptionDef {
- /** Main directory where to put t3 data (logs, and others...). */
+ /** Main directory where to put echobase data (logs, and others...). */
DATA_DIRECTORY(
"data.directory",
- n_("t3.config.data.directory.description"),
- "/var/local/t3",
+ n_("echobase.config.data.directory.description"),
+ "/var/local/echobase",
File.class),
+
INTERNAL_DB_DIRECTORY(
"internal.db.directory",
- n_("t3.config.internal.db.directory.description"),
- "${data.directory}/db",
+ n_("echobase.config.internal.db.directory.description"),
+ "${data.directory}/echobase",
File.class),
PARAMETER_PROFILE_DIRECTORY(
"parameterProfiles.storage.directory",
- n_("t3.config.parameterProfiles.storage.directory.description"),
+ n_("echobase.config.parameterProfiles.storage.directory.description"),
"${data.directory}/parameter-profiles",
File.class),
USER_LOG_DIRECTORY(
"user.log.directory",
- n_("t3.user.log.directory.description"),
+ n_("echobase.user.log.directory.description"),
"${data.directory}/logs",
File.class),
TREATMENT_WORKING_DIRECTORY(
"treatment.working.directory",
- n_("t3.config.treatment.working.directory.description"),
+ n_("echobase.config.treatment.working.directory.description"),
"${data.directory}/treatments",
- File.class),
- STRATUM_WEIGHT_RATIO(
- "stratum.weightRatio",
- n_("t3.config.stratum.weightRatio.description"),
- "40",
- Float.class),
- RF1_MINIMUM_RATE(
- "rf1.minimumrate",
- n_("t3.config.rf1.minimumrate.description"),
- "0.8",
- Float.class),
- RF1_MAXIMUM_RATE(
- "rf1.maximumrate",
- n_("t3.config.rf1.maximumrate.description"),
- "1.5",
- Float.class),
- WEIGHTED_SET_WEIGHT(
- "level0.weightedSetWeight",
- n_("t3.config.level0.weightedSetWeight.description"),
- "40",
- Float.class);
+ File.class);
/** Configuration key. */
protected final String key;
@@ -179,10 +160,10 @@
/** Default value of option. */
protected String defaultValue;
- BaracoudaConfigurationOption(String key,
- String description,
- String defaultValue,
- Class<?> type) {
+ EchoBaseConfigurationOption(String key,
+ String description,
+ String defaultValue,
+ Class<?> type) {
this.key = key;
this.description = description;
this.defaultValue = defaultValue;
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseObjectFactory.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseObjectFactory.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/EchoBaseObjectFactory.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -77,19 +77,19 @@
}
/**
- * Obtain a new T3 factory.
+ * Obtain a new EchoBase factory.
* <p/>
* <strong>Note:</strong> The shared configuration must have been setted
* before using this method via the method
* {@link #setConfiguration(ApplicationConfig)}
*
- * @return the new instanciated T3 factory.
+ * @return the new instanciated EchoBase factory.
*/
public static EchoBaseObjectFactory newInstance() {
// must have a configuration to start the factory
Preconditions.checkNotNull(
configuration,
- "No t3 appliation configuration registred.");
+ "No EchoBase appliation configuration registred.");
if (log.isInfoEnabled()) {
log.info("New EchoBaseObjectFactory with configuration " + configuration);
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/AbstractInjector.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/AbstractInjector.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/AbstractInjector.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,11 +1,11 @@
/*
* #%L
- * T3 :: Api
+ * EchoBase :: Services
*
* $Id$
- * $HeadURL: https://svn.mpl.ird.fr/osiris/t3/trunk/t3-api/src/main/java/fr/ird/t3/servi… $
+ * $HeadURL$
* %%
- * Copyright (C) 2010 - 2011 IRD, Codelutin, Tony Chemit
+ * 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
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectDAO.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectDAO.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectDAO.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,11 +1,11 @@
/*
* #%L
- * T3 :: Api
+ * EchoBase :: Services
*
* $Id$
- * $HeadURL: https://svn.mpl.ird.fr/osiris/t3/trunk/t3-api/src/main/java/fr/ird/t3/servi… $
+ * $HeadURL$
* %%
- * Copyright (C) 2010 - 2011 IRD, Codelutin, Tony Chemit
+ * 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
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectEntitiesById.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectEntitiesById.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectEntitiesById.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,11 +1,11 @@
/*
* #%L
- * T3 :: Api
+ * EchoBase :: Services
*
* $Id$
- * $HeadURL: https://svn.mpl.ird.fr/osiris/t3/trunk/t3-api/src/main/java/fr/ird/t3/servi… $
+ * $HeadURL$
* %%
- * Copyright (C) 2010 - 2011 IRD, Codelutin, Tony Chemit
+ * 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
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectEntityById.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectEntityById.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectEntityById.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,11 +1,11 @@
/*
* #%L
- * T3 :: Api
+ * EchoBase :: Services
*
* $Id$
- * $HeadURL: https://svn.mpl.ird.fr/osiris/t3/trunk/t3-api/src/main/java/fr/ird/t3/servi… $
+ * $HeadURL$
* %%
- * Copyright (C) 2010 - 2011 IRD, Codelutin, Tony Chemit
+ * 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
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectFromDAO.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectFromDAO.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectFromDAO.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,11 +1,11 @@
/*
* #%L
- * T3 :: Api
+ * EchoBase :: Services
*
* $Id$
- * $HeadURL: https://svn.mpl.ird.fr/osiris/t3/trunk/t3-api/src/main/java/fr/ird/t3/servi… $
+ * $HeadURL$
* %%
- * Copyright (C) 2010 - 2011 IRD, Codelutin, Tony Chemit
+ * 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
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/Injector.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/Injector.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/Injector.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,11 +1,11 @@
/*
* #%L
- * T3 :: Api
+ * EchoBase :: Services
*
* $Id$
- * $HeadURL: https://svn.mpl.ird.fr/osiris/t3/trunk/t3-api/src/main/java/fr/ird/t3/servi… $
+ * $HeadURL$
* %%
- * Copyright (C) 2010 - 2011 IRD, Codelutin, Tony Chemit
+ * 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
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorDAO.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorDAO.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorDAO.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,11 +1,11 @@
/*
* #%L
- * T3 :: Api
+ * EchoBase :: Services
*
* $Id$
- * $HeadURL: https://svn.mpl.ird.fr/osiris/t3/trunk/t3-api/src/main/java/fr/ird/t3/servi… $
+ * $HeadURL$
* %%
- * Copyright (C) 2010 - 2011 IRD, Codelutin, Tony Chemit
+ * 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
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorEntitiesById.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorEntitiesById.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorEntitiesById.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,11 +1,11 @@
/*
* #%L
- * T3 :: Api
+ * EchoBase :: Services
*
* $Id$
- * $HeadURL: https://svn.mpl.ird.fr/osiris/t3/trunk/t3-api/src/main/java/fr/ird/t3/servi… $
+ * $HeadURL$
* %%
- * Copyright (C) 2010 - 2011 IRD, Codelutin, Tony Chemit
+ * 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
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorEntityById.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorEntityById.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorEntityById.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,11 +1,11 @@
/*
* #%L
- * T3 :: Api
+ * EchoBase :: Services
*
* $Id$
- * $HeadURL: https://svn.mpl.ird.fr/osiris/t3/trunk/t3-api/src/main/java/fr/ird/t3/servi… $
+ * $HeadURL$
* %%
- * Copyright (C) 2010 - 2011 IRD, Codelutin, Tony Chemit
+ * 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
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorFromDAO.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorFromDAO.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ioc/InjectorFromDAO.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,11 +1,11 @@
/*
* #%L
- * T3 :: Api
+ * EchoBase :: Services
*
* $Id$
- * $HeadURL: https://svn.mpl.ird.fr/osiris/t3/trunk/t3-api/src/main/java/fr/ird/t3/servi… $
+ * $HeadURL$
* %%
- * Copyright (C) 2010 - 2011 IRD, Codelutin, Tony Chemit
+ * 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
Modified: trunk/echobase-services/src/main/resources/echobase-db-h2.properties
===================================================================
--- trunk/echobase-services/src/main/resources/echobase-db-h2.properties 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/resources/echobase-db-h2.properties 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,11 +1,11 @@
###
# #%L
-# T3 :: Api
+# EchoBase :: Services
#
# $Id$
-# $HeadURL: https://svn.mpl.ird.fr/osiris/t3/trunk/t3-api/src/main/resources/t3-interna… $
+# $HeadURL$
# %%
-# Copyright (C) 2010 - 2011 IRD, Codelutin, Tony Chemit
+# 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
@@ -28,4 +28,4 @@
hibernate.connection.username=sa
hibernate.connection.password=sa
hibernate.connection.driver_class=org.h2.Driver
-hibernate.connection.url=jdbc:h2:file:${internal.db.directory}/t3-user
+hibernate.connection.url=jdbc:h2:file:${internal.db.directory}/echobase-user
Modified: trunk/echobase-services/src/main/resources/echobase-db.properties
===================================================================
--- trunk/echobase-services/src/main/resources/echobase-db.properties 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/resources/echobase-db.properties 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,11 +1,11 @@
###
# #%L
-# T3 :: Api
+# EchoBase :: Services
#
# $Id$
-# $HeadURL: https://svn.mpl.ird.fr/osiris/t3/trunk/t3-api/src/main/resources/t3-datadb.… $
+# $HeadURL$
# %%
-# Copyright (C) 2010 - 2011 IRD, Codelutin, Tony Chemit
+# 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
@@ -21,6 +21,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# #L%
###
+###
# DB configuration
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class=org.postgresql.Driver
@@ -35,6 +36,6 @@
# Migration configuration
topia.service.migration=org.nuiton.topia.migration.TopiaMigrationEngine
-topia.service.migration.callback=fr.ird.t3.services.migration.T3MigrationCallback
+topia.service.migration.callback=fr.ifremer.echobase.services.migration.EchoBaseMigrationCallback
topia.service.migration.showSql=true
Modified: trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties
===================================================================
--- trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,9 +1,9 @@
-t3.config.data.directory.description=
-t3.config.internal.db.directory.description=
-t3.config.level0.weightedSetWeight.description=
-t3.config.parameterProfiles.storage.directory.description=
-t3.config.rf1.maximumrate.description=
-t3.config.rf1.minimumrate.description=
-t3.config.stratum.weightRatio.description=
-t3.config.treatment.working.directory.description=
-t3.user.log.directory.description=
+echobase.config.data.directory.description=
+echobase.config.internal.db.directory.description=
+echobase.config.level0.weightedSetWeight.description=
+echobase.config.parameterProfiles.storage.directory.description=
+echobase.config.rf1.maximumrate.description=
+echobase.config.rf1.minimumrate.description=
+echobase.config.stratum.weightRatio.description=
+echobase.config.treatment.working.directory.description=
+echobase.user.log.directory.description=
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/ApplicationListener.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/ApplicationListener.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/ApplicationListener.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -74,7 +74,7 @@
// init I18n
DefaultI18nInitializer i18nInitializer =
- new DefaultI18nInitializer("t3-i18n");
+ new DefaultI18nInitializer("echobase-i18n");
i18nInitializer.setMissingKeyReturnNull(true);
I18n.init(i18nInitializer, Locale.getDefault());
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSession.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -44,14 +44,14 @@
private static final Log log = LogFactory.getLog(EchoBaseSession.class);
/**
- * Obtain the user T3 session.
+ * Obtain the user EchoBase session.
* <p/>
* If not found in application session, then will instanciate it and
* push it in it.
* <p/>
* At the creation time the session, it will also set his object factory.
*
- * @return the user T3 session (never null)
+ * @return the user EchoBase session (never null)
*/
public static EchoBaseSession getEchoBaseSession() {
Map<String, Object> session = ActionContext.getContext().getSession();
@@ -80,7 +80,7 @@
/** Key used to store this EchoBase session in application session */
public static final String SESSION_PARAMETER_ECHO_BASE_SESSION = "echobaseSession";
- /** Key to set T3 factory in this session. */
+ /** Key to set EchoBase factory in this session. */
protected static final String PROPERTY_OBJECT_FACTORY = "objectFactory";
/** Key to set User connected in this session. */
@@ -119,10 +119,10 @@
/**
* Sets in this session the loggued user.
*
- * @param t3User the user loggued to use in this session
+ * @param echoBaseUser the user loggued to use in this session
*/
- public void setEchoBaseUser(EchoBaseUser t3User) {
- set(PROPERTY_ECHO_BASE_USER, t3User);
+ public void setEchoBaseUser(EchoBaseUser echoBaseUser) {
+ set(PROPERTY_ECHO_BASE_USER, echoBaseUser);
}
/**
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSessionAware.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSessionAware.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseSessionAware.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -31,5 +31,5 @@
*/
public interface EchoBaseSessionAware {
- void setEchoBaseSession(EchoBaseSession t3Session);
+ void setEchoBaseSession(EchoBaseSession echoBaseSession);
}
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-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -59,7 +59,7 @@
/**
- * T3 User session.
+ * EchoBase User session.
* <p/>
* <strong>This object will be injected only if you implements the
* contract {@link EchoBaseSessionAware} on your action.</strong>
@@ -67,9 +67,9 @@
private transient EchoBaseSession echoBaseSession;
/**
- * To inject the T3 User session in action.
+ * To inject the EchoBase User session in action.
*
- * @param echoBaseSession the new T3 User session to inject in action
+ * @param echoBaseSession the new EchoBase User session to inject in action
*/
@Override
public final void setEchoBaseSession(EchoBaseSession echoBaseSession) {
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/LoginAction.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/LoginAction.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/LoginAction.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -95,7 +95,7 @@
EchoBaseSession userSession = getEchoBaseSession();
- // user is authorized, keep it in his t3Session
+ // user is authorized, keep it in his echoBaseSession
userSession.setEchoBaseUser(user);
// add locale in echoBaseSession if required
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CleanEchoBaseSessionInterceptor.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CleanEchoBaseSessionInterceptor.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/CleanEchoBaseSessionInterceptor.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -62,11 +62,11 @@
@Override
public String intercept(ActionInvocation invocation) throws Exception {
- EchoBaseSession t3Session = EchoBaseSession.getEchoBaseSession();
- if (t3Session != null) {
+ EchoBaseSession echoBaseSession = EchoBaseSession.getEchoBaseSession();
+ if (echoBaseSession != null) {
for (String paramName : parameters) {
- Object value = t3Session.remove(paramName);
+ Object value = echoBaseSession.remove(paramName);
if (log.isDebugEnabled()) {
log.debug("Removed [" + paramName + "] : " + value);
}
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseSessionInterceptor.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseSessionInterceptor.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseSessionInterceptor.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -43,8 +43,8 @@
Object action = invocation.getAction();
if (action instanceof EchoBaseSessionAware) {
- EchoBaseSession t3Session = EchoBaseSession.getEchoBaseSession();
- ((EchoBaseSessionAware) action).setEchoBaseSession(t3Session);
+ EchoBaseSession echoBaseSession = EchoBaseSession.getEchoBaseSession();
+ ((EchoBaseSessionAware) action).setEchoBaseSession(echoBaseSession);
}
return invocation.invoke();
}
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseTransactionInterceptorImpl.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseTransactionInterceptorImpl.java 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/interceptors/EchoBaseTransactionInterceptorImpl.java 2011-11-03 16:20:03 UTC (rev 4)
@@ -32,7 +32,7 @@
/**
* Implementation of the {@link OpenTopiaTransactionInterceptor} giving how to
- * create a new topia transaction on a T3 database.
+ * create a new topia transaction on a EchoBase database.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 1.0
Added: trunk/echobase-ui/src/main/resources/config/struts-user.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/config/struts-user.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/config/struts-user.xml 2011-11-03 16:20:03 UTC (rev 4)
@@ -0,0 +1,91 @@
+<?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="user" extends="default" namespace="/user">
+
+ <!-- when a action has no context -->
+ <!--<action name="missingEchoBaseDatabase">-->
+ <!--<result name="success">/WEB-INF/jsp/missingEchoBaseDatabaseSelected.jsp</result>-->
+ <!--</action>-->
+
+ <!-- login action -->
+ <action name="login" class="fr.ifremer.echobase.ui.actions.LoginAction"
+ method="doLogin">
+ <result name="input">/WEB-INF/jsp/login.jsp</result>
+ <result name="error">/WEB-INF/jsp/login.jsp</result>
+ <result name="redirect" type="redirect">${redirectAction}</result>
+ <!--<interceptor-ref name="internalTransaction"/>-->
+ <interceptor-ref name="paramsPrepareParamsStack"/>
+ </action>
+
+ <!-- logout action -->
+ <action name="logout" class="fr.ifremer.echobase.ui.actions.LoginAction"
+ method="doLogout">
+ <result type="redirectAction">
+ <param name="namespace">/</param>
+ <param name="actionName">home</param>
+ </result>
+ <interceptor-ref name="checkUserLoggued"/>
+ <interceptor-ref name="basicStack"/>
+ <interceptor-ref name="injectEchoBaseSession"/>
+ </action>
+
+ <!-- get lists of users -->
+ <!--<action name="userList" class="fr.ird.t3.web.actions.admin.UserAction"-->
+ <!--method="input">-->
+ <!--<interceptor-ref name="internalBasicStackLoggued"/>-->
+ <!--<interceptor-ref name="checkUserIsAdmin"/>-->
+ <!--<result name="input">/WEB-INF/jsp/admin/userList.jsp</result>-->
+ <!--</action>-->
+
+ <!-- get detail of a user -->
+ <!--<action name="userForm" class="fr.ird.t3.web.actions.admin.UserAction"-->
+ <!--method="input">-->
+ <!--<interceptor-ref name="internalParamsPrepareParamsStackLoggued"/>-->
+ <!--<result name="input">/WEB-INF/jsp/admin/userForm.jsp</result>-->
+ <!--<result name="error">/WEB-INF/jsp/admin/userForm.jsp</result>-->
+ <!--<result name="success">/WEB-INF/jsp/admin/userForm.jsp</result>-->
+ <!--<result name="backToList" type="redirectAction">userList</result>-->
+ <!--</action>-->
+
+ <!-- download user log file -->
+ <!--<action name="getUserLog"-->
+ <!--class="fr.ifremer.echobase.web.actions.data.DownloadUserLogAction">-->
+ <!--<interceptor-ref name="internalBasicStackLoggued"/>-->
+ <!--<result name="success" type="stream">-->
+ <!--<param name="contentCharSet">UTF-8</param>-->
+ <!--</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-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2011-11-03 16:20:03 UTC (rev 4)
@@ -0,0 +1,10 @@
+echobase.label.language=Language
+echobase.label.locale.english=Anglais
+echobase.action.locale.english=Anglais
+echobase.label.locale.french=Français
+echobase.action.locale.french=Français
+ecobase.label.welcome=Bienvenue
+ecobase.label.login=Connection
+ecobase.title.login=Connection
+echobase.label.user.login=Login
+echobase.action.logout=Déconnection
\ No newline at end of file
Modified: trunk/echobase-ui/src/main/resources/struts.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/struts.xml 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/main/resources/struts.xml 2011-11-03 16:20:03 UTC (rev 4)
@@ -57,15 +57,15 @@
<interceptor name="paramRemover"
class="com.opensymphony.xwork2.interceptor.ParameterRemoverInterceptor"/>
- <!-- to manage the t3 topia transaction inside an action -->
+ <!-- to manage the Ecobase topia transaction inside an action -->
<interceptor name="topiaTransaction"
class="fr.ifremer.echobase.ui.interceptors.EchoBaseTransactionInterceptorImpl"/>
- <!-- to inject the T3 session inside an action -->
+ <!-- to inject the ecobase session inside an action -->
<interceptor name="injectEchoBaseSession"
class="fr.ifremer.echobase.ui.interceptors.EchoBaseSessionInterceptor"/>
- <!-- to clean some properties from the T3 session -->
+ <!-- to clean some properties from the ecobase session -->
<interceptor name="cleanEchoBaseSession"
class="fr.ifremer.echobase.ui.interceptors.CleanEchoBaseSessionInterceptor"/>
@@ -81,7 +81,7 @@
<param name="redirectAction">/home</param>
</interceptor>
- <interceptor name="checkT3Session"
+ <interceptor name="checkEcobaseSession"
class="fr.ifremer.echobase.ui.interceptors.CheckInUserSessionInterceptor"/>
</interceptors>
@@ -95,18 +95,18 @@
<interceptors>
- <!-- t3 basic authenticated stack -->
+ <!-- ecobase basic authenticated stack -->
<interceptor-stack name="echoBaseBasicStack">
<interceptor-ref name="injectEchoBaseSession"/>
- <interceptor-ref name="checkT3DatabaseSelected"/>
+ <!--<interceptor-ref name="checkEchoBaseDatabaseSelected"/>-->
<interceptor-ref name="topiaTransaction"/>
<interceptor-ref name="basicStack"/>
</interceptor-stack>
- <!-- t3 stack with params-->
+ <!-- ecobase stack with params-->
<interceptor-stack name="echoBaseParamsPrepareParamsStack">
<interceptor-ref name="injectEchoBaseSession"/>
- <interceptor-ref name="checkT3DatabaseSelected"/>
+ <!--<interceptor-ref name="checkEchoBaseDatabaseSelected"/>-->
<interceptor-ref name="topiaTransaction"/>
<interceptor-ref name="paramsPrepareParamsStack"/>
</interceptor-stack>
@@ -121,7 +121,7 @@
<interceptor-stack name="loginAndActionContext">
<interceptor-ref name="i18n"/>
<interceptor-ref name="checkUserLoggued"/>
- <interceptor-ref name="checkT3Session">
+ <interceptor-ref name="checkEcobaseSession">
<param name="parameters">actionContext</param>
<param name="redirectAction">/missingActionContext</param>
</interceptor-ref>
@@ -167,7 +167,7 @@
<!--<include file="config/struts-json.xml"/>-->
<!--<include file="config/struts-io.xml"/>-->
- <!--<include file="config/struts-user.xml"/>-->
+ <include file="config/struts-user.xml"/>
<!--<include file="config/struts-trip.xml"/>-->
<!--<include file="config/struts-level0.xml"/>-->
<!--<include file="config/struts-level1.xml"/>-->
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/footer.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/includes/footer.jsp 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/footer.jsp 2011-11-03 16:20:03 UTC (rev 4)
@@ -31,7 +31,7 @@
<li>
<a href="http://maven-site.forge.codelutin.com/echobase/"
title="Documentation de l'application" target="_blank">
- T3+
+ Echobase
</a>
</li>
<li>
@@ -41,7 +41,7 @@
</a>
</li>
<!--li>
- <a href="mailto:t3-users at " title="Contacter un responsable">
+ <a href="mailto:echobase-users at " title="Contacter un responsable">
Contact
</a>
</li-->
@@ -53,7 +53,7 @@
</li>
<li>
Copyright 2011
- <a href="http://www.ifremer.fr">IRD</a>
+ <a href="http://www.ifremer.fr">Echobase</a>
<a href="http://www.codelutin.com" title="Code Lutin" target="_blank">Code
Lutin</a>
</li>
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-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/header.jsp 2011-11-03 16:20:03 UTC (rev 4)
@@ -45,6 +45,7 @@
</ul>
</div>
<br/>
+ <%@ include file="menuPrincipal.jsp" %>
<%@ include file="i18n.jsp" %>
<br/>
</div>
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-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/i18n.jsp 2011-11-03 16:20:03 UTC (rev 4)
@@ -23,7 +23,7 @@
--%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<div class="cleanBoth">
- <s:text name="t3.label.language"/>
+ <s:text name="echobase.label.language"/>
<ul>
<li>
<s:if
Added: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp 2011-11-03 16:20:03 UTC (rev 4)
@@ -0,0 +1,31 @@
+<%--
+ #%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 language="java" contentType="text/html" pageEncoding="utf-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<s:set var="userIsAdmin" value="%{#session.ecobaseSession.ecobaseUser.admin}"/>
+<title><s:text name="ecobase.label.welcome"/></title>
+
+<h2><s:text name="ecobase.label.welcome"/></h2>
+
+<hr/>
\ No newline at end of file
Added: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/login.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/login.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/login.jsp 2011-11-03 16:20:03 UTC (rev 4)
@@ -0,0 +1,69 @@
+<%--
+ #%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%
+ --%>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <title>Ecobase - <s:text name="ecobase.label.login"/></title>
+ <link rel="stylesheet" type="text/css"
+ href="<s:url value='/css/screen.css' />"/>
+ <link rel="icon" type="image/png"
+ href="<s:url value='/images/logo_codelutin.png' />"/>
+ <sj:head jqueryui="true" jquerytheme="start"/>
+</head>
+
+<body>
+
+<%--header--%>
+
+<div class='displayBlock'>
+ <div class='floatLeft'>
+ <s:a action="home" namespace="/">Ecobase</s:a>
+ </div>
+ <div id='headerRight'>
+ <%@ include file="/WEB-INF/includes/i18n.jsp" %>
+ </div>
+</div>
+<div class="cleanBoth"></div>
+<hr/>
+
+<%-- content --%>
+
+<h2><s:text name="ecobase.title.login"/></h2>
+
+<s:form method="POST" namespace="/user">
+ <s:hidden key="redirectAction" label=""/>
+ <s:textfield name="login" key="ecobase.common.login" required="true"/>
+ <s:password name="password" key="ecobase.common.password" required="true"/>
+ <s:submit action="login" key="ecobase.action.login" align="right"/>
+</s:form>
+
+<br/>
+<%-- footer --%>
+<%@ include file="/WEB-INF/includes/footer.jsp" %>
+
+</body>
+</html>
Modified: trunk/echobase-ui/src/site/site_fr.xml
===================================================================
--- trunk/echobase-ui/src/site/site_fr.xml 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/echobase-ui/src/site/site_fr.xml 2011-11-03 16:20:03 UTC (rev 4)
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
#%L
- T3 :: Web
+ EchoBase :: UI
$Id$
$HeadURL$
%%
- Copyright (C) 2010 IRD, Codelutin, Tony Chemit
+ 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
Modified: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml 2011-11-03 16:09:54 UTC (rev 3)
+++ trunk/src/site/site_fr.xml 2011-11-03 16:20:03 UTC (rev 4)
@@ -70,7 +70,7 @@
</menu>
<!--menu name="Modélisation">
- <item name="Télécharger le modèle" href="model/t3-persistence.zargo"/>
+ <item name="Télécharger le modèle" href="model/echobase-persistence.zargo"/>
<item name="Données thématiques" href="model.html#donn-es-th-matiques"/>
<item name="Données référentiel" href="model.html#r-f-rentiel"/>
</menu-->
1
0
Author: sletellier
Date: 2011-11-03 17:09:54 +0100 (Thu, 03 Nov 2011)
New Revision: 3
Url: http://forge.codelutin.com/repositories/revision/echobase/3
Log:
Delete .iml
Removed:
trunk/echobase.iml
Deleted: trunk/echobase.iml
===================================================================
--- trunk/echobase.iml 2011-11-03 14:29:33 UTC (rev 2)
+++ trunk/echobase.iml 2011-11-03 16:09:54 UTC (rev 3)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
- <component name="NewModuleRootManager" inherit-compiler-output="false">
- <output url="file://$MODULE_DIR$/target/classes" />
- <output-test url="file://$MODULE_DIR$/target/test-classes" />
- <exclude-output />
- <content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/target/generated-sources/changes" isTestSource="false" />
- <excludeFolder url="file://$MODULE_DIR$/target/antrun" />
- <excludeFolder url="file://$MODULE_DIR$/target/collect" />
- <excludeFolder url="file://$MODULE_DIR$/target/surefire-workdir" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- </component>
-</module>
-
1
0