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
- 1820 discussions
r305 - in trunk: . echobase-entities/src/main/java/fr/ifremer/echobase echobase-entities/src/main/resources/i18n echobase-services/src/main/java/fr/ifremer/echobase/services echobase-services/src/main/java/fr/ifremer/echobase/services/csv echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData echobase-ui/src/main/webapp/WEB-INF/jsp/importData
by tchemit@users.forge.codelutin.com 02 Feb '12
by tchemit@users.forge.codelutin.com 02 Feb '12
02 Feb '12
Author: tchemit
Date: 2012-02-03 00:46:23 +0100 (Fri, 03 Feb 2012)
New Revision: 305
Url: http://forge.codelutin.com/repositories/revision/echobase/305
Log:
continue imports + use mavenpom 3.1
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceSupport.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ResultsImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModel.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp
trunk/pom.xml
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2012-02-02 23:46:23 UTC (rev 305)
@@ -77,13 +77,6 @@
}
};
- public static final Function<Species, String> SPECIES_CODE_MEMO = new Function<Species, String>() {
- @Override
- public String apply(Species input) {
- return input.getCodeMemo();
- }
- };
-
public static final Function<Vessel, String> VESSEL_NAME = new Function<Vessel, String>() {
@Override
public String apply(Vessel input) {
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 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties 2012-02-02 23:46:23 UTC (rev 305)
@@ -269,4 +269,3 @@
echobase.common.vesselType=
echobase.common.voyage=Campagne
echobase.config.data.directory.description=Chemin de l'application
-
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceSupport.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceSupport.java 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceSupport.java 2012-02-02 23:46:23 UTC (rev 305)
@@ -128,7 +128,7 @@
return dao;
}
- protected void commitTransaction(String errorMessage) {
+ public void commitTransaction(String errorMessage) {
try {
getTransaction().commitTransaction();
} catch (TopiaException eee) {
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ResultsImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ResultsImportService.java 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ResultsImportService.java 2012-02-02 23:46:23 UTC (rev 305)
@@ -82,9 +82,9 @@
List<Species> allSpecies =
getEntities(Species.class);
Map<String, Species> speciesMap = Maps.uniqueIndex(
- allSpecies, EchoBaseFunctions.SPECIES_CODE_MEMO);
+ allSpecies, EchoBaseFunctions.SPECIES_BARACOUDA_CODE);
- if (configuration.canImportLengthWeightKeyFile()) {
+ if (configuration.canImportLengthAgeKeyFile()) {
List<Strata> allStratas =
getEntities(Strata.class);
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModel.java 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModel.java 2012-02-02 23:46:23 UTC (rev 305)
@@ -60,7 +60,7 @@
newMandatoryColumn(LengthAgeKeyImportModelRow.PROPERTY_VOYAGE, CsvModelUtil.newForeignKeyValue(Voyage.class, voyageMap));
newMandatoryColumn(LengthAgeKeyImportModelRow.PROPERTY_STRATA, CsvModelUtil.newForeignKeyValue(Strata.class, strataMap));
- newMandatoryColumn(LengthAgeKeyImportModelRow.PROPERTY_SPECIES, CsvModelUtil.newForeignKeyValue(Species.class, speciesMap));
+ newMandatoryColumn("codeMemo", LengthAgeKeyImportModelRow.PROPERTY_SPECIES, CsvModelUtil.newForeignKeyValue(Species.class, speciesMap));
}
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java 2012-02-02 23:46:23 UTC (rev 305)
@@ -74,6 +74,8 @@
try {
service.startImport(model, getEchoBaseSession().getEchoBaseUser());
+
+ service.commitTransaction("Could not commit imported data");
} catch (Exception e) {
if (log.isErrorEnabled()) {
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java 2012-02-02 23:46:23 UTC (rev 305)
@@ -87,17 +87,20 @@
getModel().setImportMode(CommonDataImportMode.ALL);
}
+
return INPUT;
}
@InputConfig(methodName = "input")
- public String modeAll() {
- return SUCCESS;
+ public String modeAll() throws Exception {
+
+ return execute();
}
@InputConfig(methodName = "input")
- public String modeTransect() {
- return SUCCESS;
+ public String modeTransect() throws Exception {
+
+ return execute();
}
public Map<String, String> getMissions() {
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java 2012-02-02 23:46:23 UTC (rev 305)
@@ -81,13 +81,15 @@
}
@InputConfig(methodName = "input")
- public String modeVoyage() {
- return SUCCESS;
+ public String modeVoyage() throws Exception {
+
+ return execute();
}
@InputConfig(methodName = "input")
- public String modeAcoustic() {
- return SUCCESS;
+ public String modeAcoustic() throws Exception {
+
+ return execute();
}
public Map<String, String> getVoyages() {
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp 2012-02-02 23:46:23 UTC (rev 305)
@@ -176,7 +176,7 @@
</fieldset>
<br/>
<s:submit action="configureAccousticData"
- value='%{getText("echobase.action.configureImport")}'/>
+ value='%{getText("echobase.action.import")}'/>
</s:form>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp 2012-02-02 23:46:23 UTC (rev 305)
@@ -59,7 +59,7 @@
<br/>
<s:submit action="configureCatchesData"
- value='%{getText("echobase.action.configureImport")}'/>
+ value='%{getText("echobase.action.import")}'/>
</s:form>
\ No newline at end of file
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp 2012-02-02 23:46:23 UTC (rev 305)
@@ -111,7 +111,7 @@
</s:a>
<br/>
<s:submit action="ConfigureCommonData-modeAll"
- value='%{getText("echobase.action.configureImport")}'/>
+ value='%{getText("echobase.action.import")}'/>
</s:form>
@@ -155,7 +155,7 @@
<br/>
<s:submit action="ConfigureCommonData-modeTransect"
- value='%{getText("echobase.action.configureImport")}'/>
+ value='%{getText("echobase.action.import")}'/>
</s:form>
\ No newline at end of file
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp 2012-02-02 23:46:23 UTC (rev 305)
@@ -64,7 +64,7 @@
<br/>
<s:submit action="configureOperation"
- value='%{getText("echobase.action.configureImport")}'/>
+ value='%{getText("echobase.action.import")}'/>
</s:form>
\ No newline at end of file
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp 2012-02-02 23:46:23 UTC (rev 305)
@@ -40,7 +40,6 @@
var incomingVal = $('[name="model.importMode"][checked="checked"]').val();
$('#' + incomingVal).show();
-
});
</script>
@@ -75,7 +74,7 @@
<br/>
<s:submit action="ConfigureResults-modeVoyage"
- value='%{getText("echobase.action.configureImport")}'/>
+ value='%{getText("echobase.action.import")}'/>
</s:form>
@@ -107,6 +106,6 @@
<br/>
<s:submit action="ConfigureResults-modeAcoustic"
- value='%{getText("echobase.action.configureImport")}'/>
+ value='%{getText("echobase.action.import")}'/>
</s:form>
\ No newline at end of file
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp 2012-02-02 23:46:23 UTC (rev 305)
@@ -25,7 +25,7 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<s:url id="url" action="import-AccousticData" namespace="/importData"/>
+<s:url id="url" action="importAccousticData" namespace="/importData"/>
<meta http-equiv="refresh" content="1;url=${url}"/>
<title>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp 2012-02-02 23:46:23 UTC (rev 305)
@@ -25,7 +25,7 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<s:url id="url" action="import-CatchesData" namespace="/importData"/>
+<s:url id="url" action="importCatchesData" namespace="/importData"/>
<meta http-equiv="refresh" content="1;url=${url}"/>
<title>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp 2012-02-02 23:46:23 UTC (rev 305)
@@ -25,7 +25,7 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<s:url id="url" action="import-CommonData" namespace="/importData"/>
+<s:url id="url" action="importCommonData" namespace="/importData"/>
<meta http-equiv="refresh" content="1;url=${url}"/>
<title>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp 2012-02-02 23:46:23 UTC (rev 305)
@@ -25,7 +25,7 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<s:url id="url" action="import-Operation" namespace="/importData"/>
+<s:url id="url" action="importOperation" namespace="/importData"/>
<meta http-equiv="refresh" content="1;url=${url}"/>
<title>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp 2012-02-02 23:46:23 UTC (rev 305)
@@ -25,7 +25,7 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-<s:url id="url" action="import-Results" namespace="/importData"/>
+<s:url id="url" action="importResults" namespace="/importData"/>
<meta http-equiv="refresh" content="1;url=${url}"/>
<title>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-02-02 22:58:29 UTC (rev 304)
+++ trunk/pom.xml 2012-02-02 23:46:23 UTC (rev 305)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>3.0.7</version>
+ <version>3.1</version>
</parent>
<groupId>fr.ifremer</groupId>
@@ -120,10 +120,7 @@
<h2Version>1.3.163</h2Version>
<postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion>
<slf4jVersion>1.6.4</slf4jVersion>
- <!--<jettyVersion>7.5.3.v20111011</jettyVersion>-->
<jackcessVersion>1.2.6</jackcessVersion>
- <!-- This version does not work (missing javax.el api in overlay) -->
- <jettyVersion>8.1.0.RC5</jettyVersion>
<hibernateVersion>3.6.9.Final</hibernateVersion>
@@ -331,7 +328,7 @@
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-runner</artifactId>
- <version>${jettyVersion}</version>
+ <version>${jettyPluginVersion}</version>
<scope>provided</scope>
</dependency>
@@ -428,27 +425,6 @@
<version>${nuitonI18nVersion}</version>
</plugin>
- <!-- remove this when using mavenpom 3.1 -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>wagon-maven-plugin</artifactId>
- <version>${wagonPluginVersion}</version>
- </plugin>
-
- <!-- remove this when using mavenpom 3.1 -->
- <plugin>
- <groupId>org.nuiton</groupId>
- <artifactId>helper-maven-plugin</artifactId>
- <version>1.4</version>
- </plugin>
-
- <!-- remove this when using mavenpom 3.1 -->
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
- <version>${jettyPluginVersion}</version>
- </plugin>
-
</plugins>
</pluginManagement>
1
0
02 Feb '12
Author: tchemit
Date: 2012-02-02 23:58:29 +0100 (Thu, 02 Feb 2012)
New Revision: 304
Url: http://forge.codelutin.com/repositories/revision/echobase/304
Log:
import nouvelles donn?\195?\169es
Added:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBasePredicates.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/MissionNameAlreadyExistException.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/OperationImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ResultsImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CellPositionReference.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportMode.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/OperationImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportMode.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModelRow.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModelRow.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModelRow.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/CreateMission.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcoustic-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/CreateMission-createMission-validation.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/createMission.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp
trunk/src/doc/reunions/reunion-2012-02-01.txt
Removed:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AccousticRegionDataImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CatchesIndividualDataImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CatchesReferenceImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataCompleteImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataFromTransectImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AccousticRegionDataImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesIndividualDataImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesReferenceImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataCompleteImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataFromTransectImportConfiguration.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticRegionData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesIndividualData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesReference.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataComplete.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataFromTransect.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticRegionData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesIndividualData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesReference.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonDataComplete.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonDataFromTransect.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectedMissionMode.java
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticRegionData-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesIndividualData-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesReference-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataComplete-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataFromTransect-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureMission-validation.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticRegionData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesIndividualData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesReference.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataComplete.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataFromTransect.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticRegionData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesIndividualData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesReference.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonDataComplete.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonDataFromTransect.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticRegionData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesIndividualData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesReference.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonDataComplete.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonDataFromTransect.jsp
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AbstractImportDataService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AccousticDataImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CatchesDataImportService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDataMode.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AccousticDataImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesDataImportConfiguration.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModel.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModelRow.java
trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectImportType.java
trunk/echobase-ui/src/main/resources/config/struts-importData.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData-validation.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData-validation.xml
trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp
trunk/echobase-ui/src/main/webapp/css/screen.css
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseFunctions.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -46,6 +46,7 @@
import fr.ifremer.echobase.entities.references.SizeCategory;
import fr.ifremer.echobase.entities.references.Species;
import fr.ifremer.echobase.entities.references.SpeciesCategory;
+import fr.ifremer.echobase.entities.references.Strata;
import fr.ifremer.echobase.entities.references.Vessel;
import org.apache.commons.lang3.StringUtils;
import org.nuiton.topia.persistence.TopiaEntity;
@@ -76,6 +77,13 @@
}
};
+ public static final Function<Species, String> SPECIES_CODE_MEMO = new Function<Species, String>() {
+ @Override
+ public String apply(Species input) {
+ return input.getCodeMemo();
+ }
+ };
+
public static final Function<Vessel, String> VESSEL_NAME = new Function<Vessel, String>() {
@Override
public String apply(Vessel input) {
@@ -240,6 +248,13 @@
}
};
+ public static final Function<Strata, String> STRATA_BY_NAME = new Function<Strata, String>() {
+ @Override
+ public String apply(Strata input) {
+ return input.getName();
+ }
+ };
+
public static String getSpeciesCategoryKey(Species species, SizeCategory sizeCategory, SexCategory sexCategory) {
String key = species.getBaracoudaCode();
if (sizeCategory != null) {
Added: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBasePredicates.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBasePredicates.java (rev 0)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBasePredicates.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,61 @@
+/*
+ * #%L
+ * EchoBase :: Entities
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.Predicate;
+import fr.ifremer.echobase.entities.references.AcousticInstrument;
+import fr.ifremer.echobase.entities.references.Echotype;
+
+/**
+ * Keep usefull precidates on model.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class EchoBasePredicates {
+
+ public static final Predicate<AcousticInstrument> IS_ACOUSTIC_INSTRUMENT_ME70 = new Predicate<AcousticInstrument>() {
+ @Override
+ public boolean apply(AcousticInstrument input) {
+ return input.getId().toUpperCase().contains("MEBS");
+ }
+ };
+
+ public static EchotypeByNamePredicate newEchotypeByNamePredicate(String name) {
+ return new EchotypeByNamePredicate(name);
+ }
+
+ public static class EchotypeByNamePredicate implements Predicate<Echotype> {
+ private final String echotypeName;
+
+ public EchotypeByNamePredicate(String echotypeName) {
+ this.echotypeName = echotypeName;
+ }
+
+ @Override
+ public boolean apply(Echotype input) {
+ return echotypeName.equals(input.getName());
+ }
+ }
+}
Property changes on: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBasePredicates.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 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties 2012-02-02 22:58:29 UTC (rev 304)
@@ -15,7 +15,7 @@
echobase.common.ageCategory=
echobase.common.altCallsign=
echobase.common.aquisitionMethod=
-echobase.common.areaOfOperation=areaOfOperation
+echobase.common.areaOfOperation=AreaOfOperation
echobase.common.author=Auteur
echobase.common.authorEmail=Courriel de l'auteur
echobase.common.authorReference=
@@ -269,3 +269,4 @@
echobase.common.vesselType=
echobase.common.voyage=Campagne
echobase.config.data.directory.description=Chemin de l'application
+
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AbstractImportDataService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AbstractImportDataService.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AbstractImportDataService.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -39,5 +39,6 @@
*/
public abstract class AbstractImportDataService<M extends AbstractImportConfiguration> extends EchoBaseServiceSupport {
- public abstract Map<InputFile, CsvImportResult> startImport(M configuration, EchoBaseUser user) throws IOException, TopiaException;
+ public abstract Map<InputFile, CsvImportResult> startImport(M configuration,
+ EchoBaseUser user) throws IOException, TopiaException;
}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AccousticDataImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AccousticDataImportService.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AccousticDataImportService.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -26,6 +26,7 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import fr.ifremer.echobase.EchoBaseFunctions;
+import fr.ifremer.echobase.EchoBasePredicates;
import fr.ifremer.echobase.InputFile;
import fr.ifremer.echobase.entities.EchoBaseUser;
import fr.ifremer.echobase.entities.data.Cell;
@@ -59,7 +60,7 @@
import java.util.Map;
/**
- * Service to launch a "common data complete" import.
+ * Service to launch a "acoustic data" import.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 0.3
@@ -125,6 +126,8 @@
CellDAO cellDAO = (CellDAO) getDAO(Cell.class);
DataDAO dataDAO = (DataDAO) getDAO(Data.class);
+ boolean addDataAcquisition = configuration.isAddDataAcquisition();
+
Reader reader = new BufferedReader(new FileReader(inputFile.getFile()));
try {
Import<AcousticDataImportModelRow> importer = Import.newImport(csvModel, reader);
@@ -138,30 +141,55 @@
String sndname = row.getSndName();
String channelName = row.getChannelName();
String instrumentId = sndname + channelName;
- AcousticInstrument instrument = instrumentsById.get(instrumentId);
+ AcousticInstrument instrument =
+ instrumentsById.get(instrumentId);
+ boolean isME70 =
+ EchoBasePredicates.IS_ACOUSTIC_INSTRUMENT_ME70.apply(instrument);
if (dataAcquisition == null ||
!instrument.equals(dataAcquisition.getAcousticInstrument())) {
- // first dataAcquisition or new instrument
+ // need to use another data acquisition
String softwareVersion =
- getSoftwareVersion(configuration, instrument);
+ getSoftwareVersion(configuration, isME70);
+
String soundSpeedCalculations =
- getSoundSpeedCalculations(configuration, instrument);
+ getSoundSpeedCalculations(configuration, isME70);
- // create dataAcquisiton
- dataAcquisition = createDataAcquisition(
- configuration,
- instrument,
- softwareVersion,
- soundSpeedCalculations,
- row,
- dataAcquisitionDAO
- );
+ if (!addDataAcquisition && !transect.isDataAcquisitionEmpty()) {
- transect.addDataAcquisition(dataAcquisition);
+ // try to obtain an existing data acquisiton
+ for (DataAcquisition acquisition : transect.getDataAcquisition()) {
+
+ if (instrument.equals(acquisition.getAcousticInstrument())) {
+
+ // found a matching data acquisiotn from his acoustic instrument
+ dataAcquisition = acquisition;
+ break;
+ }
+ }
+ }
+
+ if (dataAcquisition == null) {
+
+ // need to create the data acquisition
+
+ // create dataAcquisiton
+ dataAcquisition = createDataAcquisition(
+ configuration,
+ instrument,
+ softwareVersion,
+ soundSpeedCalculations,
+ row,
+ dataAcquisitionDAO
+ );
+
+ // add it to transect
+ transect.addDataAcquisition(dataAcquisition);
+ }
+
// create data processing
dataProcessing = createDataProcessing(
configuration,
@@ -171,23 +199,29 @@
dataProcessingDAO
);
+ // add it to data acquisition
dataAcquisition.addDataProcessing(dataProcessing);
// must start a fresh new esdu cell
esduCell = null;
}
- Date startDate = row.getEsduCellStartDate();
+ int cellType = row.getCellType();
+
+ Date startDate = row.getCellDateStart();
String esduCellId = cellDateFormat.format(startDate);
- if (esduCell == null || !esduCellId.equals(esduCell.getName())) {
+ if (cellType == 4) {
+ // this is a esdu cell row
+
// create esdu cell
esduCell = cellDAO.create(
Cell.PROPERTY_CELL_TYPE, esduCellType,
Cell.PROPERTY_NAME, esduCellId
);
+ // add it to data processing
dataProcessing.addCell(esduCell);
// create esdu cell data
@@ -196,17 +230,19 @@
dataMetadatasByName,
row,
dataDAO);
+ } else {
- // force to create a new elementary cell
- elementaryCell = null;
- }
+ // this is a elementary cell row
- int cellNum = row.getElementaryCellNum();
+ int cellNum = row.getCellNum();
- String elementaryCellId = esduCellId + "_" + cellNum;
+ String elementaryCellId = esduCellId + "_" + cellNum;
- if (elementaryCell == null ||
- !elementaryCellId.equals(elementaryCell.getName())) {
+ if (esduCell == null) {
+ throw new IllegalStateException(
+ "No esdu cell where to attach the " +
+ "elementary cell " + elementaryCellId);
+ }
// create the elementary cell
@@ -214,15 +250,37 @@
Cell.PROPERTY_CELL_TYPE, elementaryCellType,
Cell.PROPERTY_NAME, elementaryCellId
);
+
+ // add it to esdu cell
esduCell.addChilds(elementaryCell);
+
+
+ // create datas of the elementary cell
+ createElementaryCellData(configuration,
+ elementaryCell,
+ dataMetadatasByName,
+ row,
+ dataDAO);
}
- // create datas of the elementary cell
- createElementaryCellData(configuration,
- elementaryCell,
- dataMetadatasByName,
- row,
- dataDAO);
+
+// if (esduCell == null ||
+// !esduCellId.equals(esduCell.getName())) {
+//
+//
+//
+// // force to create a new elementary cell
+// elementaryCell = null;
+// }
+//
+//
+//
+// if (elementaryCell == null ||
+// !elementaryCellId.equals(elementaryCell.getName())) {
+//
+//
+// }
+
}
} finally {
@@ -240,30 +298,33 @@
Data data;
String dataValue;
+ String suffix =
+ configuration.getCellPositionReference().getMetadataNameSuffix();
+
// create Latitude data
- dataMetadata = dataMetadatasByName.get("LatitudeStart");
+ dataMetadata = dataMetadatasByName.get("Latitude" + suffix);
dataValue = row.getEsduCellDataLatitude();
data = dao.create(Data.PROPERTY_DATA_METADATA, dataMetadata);
data.setDataValue(dataValue);
cell.addData(data);
// create Longitude data
- dataMetadata = dataMetadatasByName.get("LongitudeStart");
+ dataMetadata = dataMetadatasByName.get("Longitude" + suffix);
dataValue = row.getEsduCellDataLongitude();
data = dao.create(Data.PROPERTY_DATA_METADATA, dataMetadata);
data.setDataValue(dataValue);
cell.addData(data);
// create Depth data
- dataMetadata = dataMetadatasByName.get("DepthRefSurfaceStart");
+ dataMetadata = dataMetadatasByName.get("DepthRefSurface" + suffix);
dataValue = row.getEsduCellDataDepth();
data = dao.create(Data.PROPERTY_DATA_METADATA, dataMetadata);
data.setDataValue(dataValue);
cell.addData(data);
// create Time data
- dataMetadata = dataMetadatasByName.get("TimeStart");
- dataValue = row.getEsduCellDataTime();
+ dataMetadata = dataMetadatasByName.get("Time" + suffix);
+ dataValue = cellDateFormat.format(row.getCellDateStart());
data = dao.create(Data.PROPERTY_DATA_METADATA, dataMetadata);
data.setDataValue(dataValue);
cell.addData(data);
@@ -286,7 +347,7 @@
Data data;
String dataValue;
- int cellType = row.getElementaryCellType();
+ int cellType = row.getCellType();
String startMeta;
String endMeta;
@@ -304,27 +365,25 @@
startMeta = "DepthRefBottomStart";
endMeta = "DepthRefBottomEnd";
-
-
}
// create depth start data
dataMetadata = dataMetadatasByName.get(startMeta);
- dataValue = row.getElementaryCellDataDepthStart();
+ dataValue = row.getCellDepthStart();
data = dao.create(Data.PROPERTY_DATA_METADATA, dataMetadata);
data.setDataValue(dataValue);
cell.addData(data);
// create depth end data
dataMetadata = dataMetadatasByName.get(endMeta);
- dataValue = row.getElementaryCellDataDepthEnd();
+ dataValue = row.getCellDepthEnd();
data = dao.create(Data.PROPERTY_DATA_METADATA, dataMetadata);
data.setDataValue(dataValue);
cell.addData(data);
// create acoustic density data
dataMetadata = dataMetadatasByName.get("sa");
- dataValue = row.getElementaryCellDataAcousticDensity();
+ dataValue = row.getCellSa();
data = dao.create(Data.PROPERTY_DATA_METADATA, dataMetadata);
data.setDataValue(dataValue);
cell.addData(data);
@@ -447,28 +506,23 @@
}
private String getSoftwareVersion(AccousticDataImportConfiguration configuration,
- AcousticInstrument instrument) {
- String softwareVersionER60 = configuration.getAcquisitionSoftwareVersionER60();
- String softwareVersionME70 = configuration.getAcquisitionSoftwareVersionME70();
- String transceiverModel = instrument.getTransceiverModel();
- String result = softwareVersionER60;
-
- //FIXME Finish this algorithm
- if (transceiverModel.equals("ME70")) {
- result = softwareVersionME70;
+ boolean isME70) {
+ String result;
+ if (isME70) {
+ result = configuration.getAcquisitionSoftwareVersionME70();
+ } else {
+ result = configuration.getAcquisitionSoftwareVersionER60();
}
return result;
}
private String getSoundSpeedCalculations(AccousticDataImportConfiguration configuration,
- AcousticInstrument instrument) {
- String speedCalculationsER60 = configuration.getSoundSpeedCalculationsER60();
- String speedCalculationsME70 = configuration.getSoundSpeedCalculationsME70();
- String transceiverModel = instrument.getTransceiverModel();
- String result = speedCalculationsER60;
- //FIXME Finish this algorithm
- if (transceiverModel.equals("ME70")) {
- result = speedCalculationsME70;
+ boolean isME70) {
+ String result;
+ if (isME70) {
+ result = configuration.getSoundSpeedCalculationsME70();
+ } else {
+ result = configuration.getSoundSpeedCalculationsER60();
}
return result;
}
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AccousticRegionDataImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AccousticRegionDataImportService.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AccousticRegionDataImportService.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,58 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.collect.Maps;
-import fr.ifremer.echobase.InputFile;
-import fr.ifremer.echobase.entities.EchoBaseUser;
-import fr.ifremer.echobase.services.configurations.AccousticRegionDataImportConfiguration;
-
-import java.util.Map;
-
-/**
- * Service to launch a "common data complete" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class AccousticRegionDataImportService extends AbstractImportDataService<AccousticRegionDataImportConfiguration> {
-
- @Override
- public Map<InputFile, CsvImportResult> startImport(AccousticRegionDataImportConfiguration configuration, EchoBaseUser user) {
- Map<InputFile, CsvImportResult> result = Maps.newHashMap();
- char csvSeparator = serviceContext.getConfiguration().getCsvSeparator();
- importRegionsFile(configuration.getRegionsFile(), csvSeparator);
- importAssociationFile(configuration.getAssociationFile(), csvSeparator);
- return result;
- }
-
- private void importRegionsFile(InputFile inputFile, char csvSeparator) {
- }
-
-
- private void importAssociationFile(InputFile inputFile, char csvSeparator) {
- }
-
-
-}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CatchesDataImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CatchesDataImportService.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CatchesDataImportService.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -26,12 +26,14 @@
import com.google.common.collect.Maps;
import fr.ifremer.echobase.InputFile;
import fr.ifremer.echobase.entities.EchoBaseUser;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.Vessel;
import fr.ifremer.echobase.services.configurations.CatchesDataImportConfiguration;
import java.util.Map;
/**
- * Service to launch a "common data complete" import.
+ * Service to launch a "catches data" import.
*
* @author tchemit <chemit(a)codelutin.com>
* @since 0.3
@@ -39,26 +41,29 @@
public class CatchesDataImportService extends AbstractImportDataService<CatchesDataImportConfiguration> {
@Override
- public Map<InputFile, CsvImportResult> startImport(CatchesDataImportConfiguration configuration, EchoBaseUser user) {
+ public Map<InputFile, CsvImportResult> startImport(CatchesDataImportConfiguration configuration,
+ EchoBaseUser user) {
Map<InputFile, CsvImportResult> result = Maps.newHashMap();
- char csvSeparator = serviceContext.getConfiguration().getCsvSeparator();
- importTbleStationFile(configuration.getTlbeStationFile(), csvSeparator);
- importXtbleTriFile(configuration.getXtblTriFile(), csvSeparator);
- importTblMensurationFile(configuration.getTblMensurationFile(), csvSeparator);
- importTblMensurationFileClass(configuration.getTblMensurationClasseFile(), csvSeparator);
+ Voyage voyage = getEntityById(Voyage.class,
+ configuration.getVoyageId());
+
+ Vessel vessel = getEntityById(Vessel.class,
+ configuration.getVesselId());
+
+ importSampleFile(configuration.getSampleFile(), voyage, vessel);
+
+ importSampleDataFile(configuration.getSampleDataFile(), voyage, vessel);
+
return result;
}
- private void importTbleStationFile(InputFile inputFile, char csvSeparator) {
+ private void importSampleFile(InputFile inputFile, Voyage voyage, Vessel vessel) {
+ char csvSeparator = serviceContext.getConfiguration().getCsvSeparator();
}
- private void importXtbleTriFile(InputFile inputFile, char csvSeparator) {
+ private void importSampleDataFile(InputFile inputFile, Voyage voyage, Vessel vessel) {
+ char csvSeparator = serviceContext.getConfiguration().getCsvSeparator();
}
- private void importTblMensurationFile(InputFile inputFile, char csvSeparator) {
- }
-
- private void importTblMensurationFileClass(InputFile inputFile, char csvSeparator) {
- }
}
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CatchesIndividualDataImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CatchesIndividualDataImportService.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CatchesIndividualDataImportService.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,52 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.collect.Maps;
-import fr.ifremer.echobase.InputFile;
-import fr.ifremer.echobase.entities.EchoBaseUser;
-import fr.ifremer.echobase.services.configurations.CatchesIndividualDataImportConfiguration;
-
-import java.util.Map;
-
-/**
- * Service to launch a "common data complete" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CatchesIndividualDataImportService extends AbstractImportDataService<CatchesIndividualDataImportConfiguration> {
-
- @Override
- public Map<InputFile, CsvImportResult> startImport(CatchesIndividualDataImportConfiguration configuration, EchoBaseUser user) {
- Map<InputFile, CsvImportResult> result = Maps.newHashMap();
-
- char csvSeparator = serviceContext.getConfiguration().getCsvSeparator();
- importIndividialDataFile(configuration.getIndividualDataFile(), csvSeparator);
- return result;
- }
-
- private void importIndividialDataFile(InputFile inputFile, char csvSeparator) {
- }
-}
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CatchesReferenceImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CatchesReferenceImportService.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CatchesReferenceImportService.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,60 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.collect.Maps;
-import fr.ifremer.echobase.InputFile;
-import fr.ifremer.echobase.entities.EchoBaseUser;
-import fr.ifremer.echobase.services.configurations.CatchesReferenceImportConfiguration;
-
-import java.util.Map;
-
-/**
- * Service to launch a "catches references" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CatchesReferenceImportService extends AbstractImportDataService<CatchesReferenceImportConfiguration> {
-
- @Override
- public Map<InputFile, CsvImportResult> startImport(CatchesReferenceImportConfiguration configuration, EchoBaseUser user) {
-
- Map<InputFile, CsvImportResult> result = Maps.newHashMap();
- char csvSeparator = serviceContext.getConfiguration().getCsvSeparator();
-
- importLenthAgeKey(configuration.getLengthAgeKeyFile(), csvSeparator);
-
- importLenghtWeightKey(configuration.getLengthWeightKeyFile(), csvSeparator);
-
- return result;
- }
-
- protected void importLenghtWeightKey(InputFile inputFile, char csvSeparator) {
-
- }
-
- protected void importLenthAgeKey(InputFile inputFile, char csvSeparator) {
- }
-}
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataCompleteImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataCompleteImportService.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataCompleteImportService.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,242 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.collect.Maps;
-import fr.ifremer.echobase.EchoBaseFunctions;
-import fr.ifremer.echobase.EchoBaseTechnicalException;
-import fr.ifremer.echobase.InputFile;
-import fr.ifremer.echobase.entities.EchoBaseUser;
-import fr.ifremer.echobase.entities.data.Transect;
-import fr.ifremer.echobase.entities.data.Transit;
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.entities.references.AreaOfOperation;
-import fr.ifremer.echobase.entities.references.Mission;
-import fr.ifremer.echobase.entities.references.Vessel;
-import fr.ifremer.echobase.services.configurations.CommonDataCompleteImportConfiguration;
-import fr.ifremer.echobase.services.csv.TransectImportModel;
-import fr.ifremer.echobase.services.csv.TransectImportModelRow;
-import fr.ifremer.echobase.services.csv.TransitImportModel;
-import fr.ifremer.echobase.services.csv.TransitImportModelRow;
-import fr.ifremer.echobase.services.csv.VoyageImportModel;
-import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.persistence.TopiaDAO;
-import org.nuiton.util.csv.Import;
-import org.nuiton.util.csv.ImportModel;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Service to launch a "common data complete" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CommonDataCompleteImportService extends AbstractImportDataService<CommonDataCompleteImportConfiguration> {
-
- @Override
- public Map<InputFile, CsvImportResult> startImport(CommonDataCompleteImportConfiguration configuration,
- EchoBaseUser user) throws IOException, TopiaException {
-
- Map<InputFile, CsvImportResult> result = Maps.newHashMap();
-
- Mission mission = getEntityById(Mission.class,
- configuration.getMissionId());
- AreaOfOperation areaOfOperation =
- getEntityById(AreaOfOperation.class,
- configuration.getAreaOfOperationId());
- Vessel vessel = getEntityById(Vessel.class,
- configuration.getVesselId());
-
- importVoyageFile(configuration.getVoyageFile(),
- mission,
- areaOfOperation,
- configuration.getVoyageDescription(),
- configuration.getDatum());
-
- List<Voyage> allVoyages = getEntities(Voyage.class);
- Map<String, Voyage> voyageMap = Maps.uniqueIndex(
- allVoyages, EchoBaseFunctions.VOYAGE_NAME);
-
- importTransitFile(configuration.getTransitFile(),
- voyageMap,
- configuration.getTransitRelatedActivity());
-
- importTransectFile(configuration.getTransectFile(),
- vessel,
- voyageMap,
- configuration.getDatum(),
- configuration.getTransectLicence(),
- configuration.getTransectGeospatialVerticalPositive(),
- configuration.getTransectBinUnitsPingAxis());
-
- importEchotypeFile(configuration.getEchotypeFile());
-
- commitTransaction("Could not commit transaction of common data import");
- return result;
- }
-
- public Mission createMission(Mission mission) {
- try {
- Mission result = getDAO(Mission.class).create(mission);
- commitTransaction("Could not create mission " +
- mission.getName());
- return result;
- } catch (TopiaException eee) {
- throw new EchoBaseTechnicalException(eee);
- }
- }
-
- protected void importVoyageFile(InputFile inputFile,
- Mission mission,
- AreaOfOperation areaOfOperation,
- String voyageDescription,
- String datum) throws IOException, TopiaException {
-
-
- ImportModel<Voyage> csvModel = new VoyageImportModel(serviceContext.getConfiguration().getCsvSeparator());
-
- TopiaDAO<Voyage> dao = getDAO(Voyage.class);
- Reader reader = new BufferedReader(new FileReader(inputFile.getFile()));
- try {
- Import<Voyage> importer = Import.newImport(csvModel, reader);
- for (Voyage voyage : importer) {
- voyage.setMission(mission);
- voyage.setAreaOfOperation(areaOfOperation);
- voyage.setDescription(voyageDescription);
- voyage.setDatum(datum);
- dao.create(voyage);
- }
-
- } finally {
- reader.close();
- }
- }
-
- protected void importTransitFile(InputFile inputFile,
- Map<String, Voyage> voyageMap,
- String relatedActivity) throws TopiaException, IOException {
- TransitImportModel csvModel = new TransitImportModel(serviceContext.getConfiguration().getCsvSeparator(), voyageMap);
-
- TopiaDAO<Transit> dao = getDAO(Transit.class);
-
- Reader reader = new BufferedReader(new FileReader(inputFile.getFile()));
- try {
- Import<TransitImportModelRow> importer = Import.newImport(csvModel, reader);
- for (TransitImportModelRow row : importer) {
-
- Voyage voyage = row.getVoyage();
-
- Transit transit = dao.create();
-
- transit.setDescription(row.getDescription());
- transit.setStartLocality(row.getStartLocality());
- transit.setEndLocality(row.getEndLocality());
-
- transit.setStartTime(row.getStartTime());
- transit.setEndTime(row.getEndTime());
- transit.setRelatedActivity(relatedActivity);
- voyage.addTransit(transit);
- }
-
- } finally {
- reader.close();
- }
- }
-
- private void importTransectFile(InputFile inputFile,
- Vessel vessel,
- Map<String, Voyage> voyageMap,
- String datum,
- String license,
- String geospatialVerticalPositive,
- String binUnitsPingAxis
- ) throws TopiaException, IOException {
-
- TransectImportModel csvModel = new TransectImportModel(serviceContext.getConfiguration().getCsvSeparator(), voyageMap);
-
- TopiaDAO<Transect> dao = getDAO(Transect.class);
-
- Reader reader = new BufferedReader(new FileReader(inputFile.getFile()));
- try {
- Import<TransectImportModelRow> importer =
- Import.newImport(csvModel, reader);
- for (TransectImportModelRow row : importer) {
-
- Voyage voyage = row.getVoyage();
-
- Date timeCoverageStart = row.getTimeCoverageStart();
- Date timeCoverageEnd = row.getTimeCoverageEnd();
-
- Transit transit = voyage.getTransit(timeCoverageStart, timeCoverageEnd);
- if (transit == null) {
- throw new EchoBaseTechnicalException(
- "Could not find transit for voyage " + voyage.getName() + " between " + timeCoverageStart + " and " + timeCoverageEnd);
- }
-
- Transect transect = dao.create(
- Transect.PROPERTY_VESSEL, vessel
- );
-
- transect.setTitle(row.getTitle());
- transect.setTransectAbstract(row.getTransectAbstract());
- transect.setComment(row.getComment());
-
- transect.setDatum(datum);
- transect.setLicence(license);
- transect.setGeospatialVerticalPositive(geospatialVerticalPositive);
- transect.setBinUnitsPingAxis(binUnitsPingAxis);
-
- transect.setDateCreated(row.getDateCreated());
-
- transect.setTimeCoverageStart(timeCoverageStart);
- transect.setTimeCoverageEnd(timeCoverageEnd);
-
- transect.setGeospatialLatMin(row.getGeospatialLatMin());
- transect.setGeospatialLonMin(row.getGeospatialLonMin());
- transect.setGeospatialVerticalMin(row.getGeospatialVerticalMin());
-
- transect.setGeospatialLatMax(row.getGeospatialLatMax());
- transect.setGeospatialLonMax(row.getGeospatialLonMax());
- transect.setGeospatialVerticalMax(row.getGeospatialVerticalMax());
- transect.setLinestring(row.getLinestring());
- transit.addTransect(transect);
- }
-
- } finally {
- reader.close();
- }
- }
-
- private void importEchotypeFile(InputFile inputFile) {
-
- }
-
-}
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataFromTransectImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataFromTransectImportService.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataFromTransectImportService.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,142 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.collect.Maps;
-import fr.ifremer.echobase.EchoBaseFunctions;
-import fr.ifremer.echobase.EchoBaseTechnicalException;
-import fr.ifremer.echobase.InputFile;
-import fr.ifremer.echobase.entities.EchoBaseUser;
-import fr.ifremer.echobase.entities.data.Transect;
-import fr.ifremer.echobase.entities.data.Transit;
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.entities.references.Vessel;
-import fr.ifremer.echobase.services.configurations.CommonDataFromTransectImportConfiguration;
-import fr.ifremer.echobase.services.csv.TransectImportModel;
-import fr.ifremer.echobase.services.csv.TransectImportModelRow;
-import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.persistence.TopiaDAO;
-import org.nuiton.util.csv.Import;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Service to launch a "common data complete" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CommonDataFromTransectImportService extends AbstractImportDataService<CommonDataFromTransectImportConfiguration> {
-
- @Override
- public Map<InputFile, CsvImportResult> startImport(CommonDataFromTransectImportConfiguration configuration,
- EchoBaseUser user) throws IOException, TopiaException {
- Map<InputFile, CsvImportResult> result = Maps.newHashMap();
-
- Voyage voyage = getEntityById(Voyage.class, configuration.getVoyageId());
- Vessel vessel = getEntityById(Vessel.class, configuration.getVesselId());
-
- List<Voyage> allVoyages = getEntities(Voyage.class);
- Map<String, Voyage> voyageMap = Maps.uniqueIndex(
- allVoyages, EchoBaseFunctions.VOYAGE_NAME);
-
- importTransectFile(configuration.getTransectFile(),
- voyage,
- voyageMap,
- vessel,
- configuration);
- return result;
- }
-
- private void importTransectFile(InputFile inputFile,
- Voyage voyage,
- Map<String, Voyage> voyageMap,
- Vessel vessel,
- CommonDataFromTransectImportConfiguration configuration
- ) throws TopiaException, IOException {
-
- String datum = configuration.getDatum();
- String license = configuration.getTransectLicence();
- String geospatialVerticalPositive = configuration.getTransectGeospatialVerticalPositive();
- String binUnitsPingAxis = configuration.getTransectBinUnitsPingAxis();
-
- TransectImportModel csvModel = new TransectImportModel(serviceContext.getConfiguration().getCsvSeparator(),
- voyageMap);
-
- TopiaDAO<Transect> dao = getDAO(Transect.class);
-
- Reader reader = new BufferedReader(new FileReader(inputFile.getFile()));
- try {
- Import<TransectImportModelRow> importer = Import.newImport(csvModel, reader);
- for (TransectImportModelRow row : importer) {
-
- Date timeCoverageStart = row.getTimeCoverageStart();
- Date timeCoverageEnd = row.getTimeCoverageEnd();
-
- Transit transit = voyage.getTransit(timeCoverageStart, timeCoverageEnd);
- if (transit == null) {
- throw new EchoBaseTechnicalException(
- "Could not find transit for voyage " +
- voyage.getName() + " between " + timeCoverageStart + " and " + timeCoverageEnd);
- }
-
- Transect transect =
- dao.create(Transect.PROPERTY_VESSEL, vessel);
-
- transect.setTitle(row.getTitle());
- transect.setTransectAbstract(row.getTransectAbstract());
- transect.setComment(row.getComment());
-
- transect.setDatum(datum);
- transect.setLicence(license);
- transect.setGeospatialVerticalPositive(geospatialVerticalPositive);
- transect.setBinUnitsPingAxis(binUnitsPingAxis);
-
- transect.setDateCreated(row.getDateCreated());
- transect.setTimeCoverageStart(timeCoverageStart);
- transect.setTimeCoverageEnd(timeCoverageEnd);
-
- transect.setGeospatialLatMin(row.getGeospatialLatMin());
- transect.setGeospatialLonMin(row.getGeospatialLonMin());
- transect.setGeospatialVerticalMin(row.getGeospatialVerticalMin());
-
- transect.setGeospatialLatMax(row.getGeospatialLatMax());
- transect.setGeospatialLonMax(row.getGeospatialLonMax());
- transect.setGeospatialVerticalMax(row.getGeospatialVerticalMax());
- transect.setLinestring(row.getLinestring());
- transit.addTransect(transect);
- }
-
- } finally {
- reader.close();
- }
- }
-
-}
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataImportService.java (from rev 303, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataCompleteImportService.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataImportService.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataImportService.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,274 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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 com.google.common.collect.Maps;
+import fr.ifremer.echobase.EchoBaseFunctions;
+import fr.ifremer.echobase.EchoBaseTechnicalException;
+import fr.ifremer.echobase.InputFile;
+import fr.ifremer.echobase.entities.EchoBaseUser;
+import fr.ifremer.echobase.entities.data.Transect;
+import fr.ifremer.echobase.entities.data.Transit;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.AreaOfOperation;
+import fr.ifremer.echobase.entities.references.Mission;
+import fr.ifremer.echobase.entities.references.MissionDAO;
+import fr.ifremer.echobase.entities.references.Vessel;
+import fr.ifremer.echobase.services.configurations.CommonDataImportConfiguration;
+import fr.ifremer.echobase.services.configurations.CommonDataImportMode;
+import fr.ifremer.echobase.services.csv.TransectImportModel;
+import fr.ifremer.echobase.services.csv.TransectImportModelRow;
+import fr.ifremer.echobase.services.csv.TransitImportModel;
+import fr.ifremer.echobase.services.csv.TransitImportModelRow;
+import fr.ifremer.echobase.services.csv.VoyageImportModel;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.TopiaDAO;
+import org.nuiton.util.csv.Import;
+import org.nuiton.util.csv.ImportModel;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Service to launch a "common data" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class CommonDataImportService extends AbstractImportDataService<CommonDataImportConfiguration> {
+
+ @Override
+ public Map<InputFile, CsvImportResult> startImport(CommonDataImportConfiguration configuration,
+ EchoBaseUser user) throws IOException, TopiaException {
+
+ Map<InputFile, CsvImportResult> result = Maps.newHashMap();
+
+ CommonDataImportMode importMode = configuration.getImportMode();
+
+ Vessel vessel = getEntityById(Vessel.class,
+ configuration.getVesselId());
+
+ switch (importMode) {
+
+ case ALL: {
+ Mission mission = getEntityById(Mission.class,
+ configuration.getMissionId());
+ AreaOfOperation areaOfOperation =
+ getEntityById(AreaOfOperation.class,
+ configuration.getAreaOfOperationId());
+
+
+ importVoyageFile(configuration.getVoyageFile(),
+ mission,
+ areaOfOperation,
+ configuration.getVoyageDescription(),
+ configuration.getDatum());
+
+ List<Voyage> allVoyages = getEntities(Voyage.class);
+ Map<String, Voyage> voyageMap = Maps.uniqueIndex(
+ allVoyages, EchoBaseFunctions.VOYAGE_NAME);
+
+ importTransitFile(configuration.getTransitFile(),
+ voyageMap,
+ configuration.getTransitRelatedActivity());
+
+ importTransectFile(configuration.getTransectFile(),
+ vessel,
+ voyageMap,
+ configuration);
+
+
+ }
+ break;
+ case TRANSECT: {
+ List<Voyage> allVoyages = getEntities(Voyage.class);
+ Map<String, Voyage> voyageMap = Maps.uniqueIndex(
+ allVoyages, EchoBaseFunctions.VOYAGE_NAME);
+
+ importTransectFile(configuration.getTransectFile(),
+ vessel,
+ voyageMap,
+ configuration);
+ }
+ break;
+ }
+
+ commitTransaction("Could not commit transaction of common data import");
+ return result;
+ }
+
+ public Mission createMission(Mission mission) throws MissionNameAlreadyExistException {
+
+ Preconditions.checkNotNull(mission);
+
+ try {
+ MissionDAO dao = (MissionDAO) getDAO(Mission.class);
+
+ // check mission name is unique
+ boolean exists = dao.existByProperties(Mission.PROPERTY_NAME,
+ mission.getName());
+
+ if (exists) {
+ throw new MissionNameAlreadyExistException();
+ }
+ Mission result = dao.create(mission);
+ commitTransaction("Could not create mission " +
+ mission.getName());
+ return result;
+ } catch (TopiaException eee) {
+ throw new EchoBaseTechnicalException(eee);
+ }
+ }
+
+ protected void importVoyageFile(InputFile inputFile,
+ Mission mission,
+ AreaOfOperation areaOfOperation,
+ String voyageDescription,
+ String datum) throws IOException, TopiaException {
+
+
+ ImportModel<Voyage> csvModel = new VoyageImportModel(serviceContext.getConfiguration().getCsvSeparator());
+
+ TopiaDAO<Voyage> dao = getDAO(Voyage.class);
+ Reader reader = new BufferedReader(new FileReader(inputFile.getFile()));
+ try {
+ Import<Voyage> importer = Import.newImport(csvModel, reader);
+ for (Voyage voyage : importer) {
+ voyage.setMission(mission);
+ voyage.setAreaOfOperation(areaOfOperation);
+ voyage.setDescription(voyageDescription);
+ voyage.setDatum(datum);
+ dao.create(voyage);
+ }
+
+ } finally {
+ reader.close();
+ }
+ }
+
+ protected void importTransitFile(InputFile inputFile,
+ Map<String, Voyage> voyageMap,
+ String relatedActivity) throws TopiaException, IOException {
+ TransitImportModel csvModel = new TransitImportModel(serviceContext.getConfiguration().getCsvSeparator(), voyageMap);
+
+ TopiaDAO<Transit> dao = getDAO(Transit.class);
+
+ Reader reader = new BufferedReader(new FileReader(inputFile.getFile()));
+ try {
+ Import<TransitImportModelRow> importer = Import.newImport(csvModel, reader);
+ for (TransitImportModelRow row : importer) {
+
+ Voyage voyage = row.getVoyage();
+
+ Transit transit = dao.create();
+
+ transit.setDescription(row.getDescription());
+ transit.setStartLocality(row.getStartLocality());
+ transit.setEndLocality(row.getEndLocality());
+
+ transit.setStartTime(row.getStartTime());
+ transit.setEndTime(row.getEndTime());
+ transit.setRelatedActivity(relatedActivity);
+ voyage.addTransit(transit);
+ }
+
+ } finally {
+ reader.close();
+ }
+ }
+
+ private void importTransectFile(InputFile inputFile,
+ Vessel vessel,
+ Map<String, Voyage> voyageMap,
+ CommonDataImportConfiguration configuration
+ ) throws TopiaException, IOException {
+
+ String datum = configuration.getDatum();
+ String license = configuration.getTransectLicence();
+ String geospatialVerticalPositive = configuration.getTransectGeospatialVerticalPositive();
+ String binUnitsPingAxis = configuration.getTransectBinUnitsPingAxis();
+
+ TransectImportModel csvModel = new TransectImportModel(serviceContext.getConfiguration().getCsvSeparator(), voyageMap);
+
+ TopiaDAO<Transect> dao = getDAO(Transect.class);
+
+ Reader reader = new BufferedReader(new FileReader(inputFile.getFile()));
+ try {
+ Import<TransectImportModelRow> importer =
+ Import.newImport(csvModel, reader);
+ for (TransectImportModelRow row : importer) {
+
+ Voyage voyage = row.getVoyage();
+
+ Date timeCoverageStart = row.getTimeCoverageStart();
+ Date timeCoverageEnd = row.getTimeCoverageEnd();
+
+ Transit transit = voyage.getTransit(timeCoverageStart, timeCoverageEnd);
+ if (transit == null) {
+ throw new EchoBaseTechnicalException(
+ "Could not find transit for voyage " + voyage.getName() + " between " + timeCoverageStart + " and " + timeCoverageEnd);
+ }
+
+ Transect transect = dao.create(
+ Transect.PROPERTY_VESSEL, vessel
+ );
+
+ transect.setTitle(row.getTitle());
+ transect.setTransectAbstract(row.getTransectAbstract());
+ transect.setComment(row.getComment());
+
+ transect.setDatum(datum);
+ transect.setLicence(license);
+ transect.setGeospatialVerticalPositive(geospatialVerticalPositive);
+ transect.setBinUnitsPingAxis(binUnitsPingAxis);
+
+ transect.setDateCreated(row.getDateCreated());
+
+ transect.setTimeCoverageStart(timeCoverageStart);
+ transect.setTimeCoverageEnd(timeCoverageEnd);
+
+ transect.setGeospatialLatMin(row.getGeospatialLatMin());
+ transect.setGeospatialLonMin(row.getGeospatialLonMin());
+ transect.setGeospatialVerticalMin(row.getGeospatialVerticalMin());
+
+ transect.setGeospatialLatMax(row.getGeospatialLatMax());
+ transect.setGeospatialLonMax(row.getGeospatialLonMax());
+ transect.setGeospatialVerticalMax(row.getGeospatialVerticalMax());
+ transect.setLinestring(row.getLinestring());
+ transit.addTransect(transect);
+ }
+
+ } finally {
+ reader.close();
+ }
+ }
+
+
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/CommonDataImportService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -145,7 +145,7 @@
long timestamp = System.currentTimeMillis();
int index = 0;
for (FilterPagerBean.FilterRule rule : rules) {
- String ruleFilter = null;
+ String ruleFilter;
String field = rule.getField();
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDataMode.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDataMode.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDataMode.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -35,26 +35,20 @@
*/
public enum ImportDataMode implements I18nAble {
- /** Import all common data from Voyage to Operation. */
- CommonDataComplete(n_("echobase.common.importDataMode.commonDataComplete")),
+ /** Import Voyage / Transit / Transect. */
+ CommonData(n_("echobase.common.importDataMode.commonData")),
- /** Import all common data from Transect to Operation. */
- CommonDataFromTransect(n_("echobase.common.importDataMode.commonDataFromTransect")),
+ /** Import operations common data. */
+ Operation(n_("echobase.common.importDataMode.operation")),
- /** Import all common data from Voyage to Operation. */
- CatchesReference(n_("echobase.common.importDataMode.catchesReferences")),
-
/** Import catches data (unsorted, total, but no individual ones). */
CatchesData(n_("echobase.common.importDataMode.catchesData")),
- /** Import individual catches data. */
- CatchesIndividualData(n_("echobase.common.importDataMode.catchesIndividualData")),
-
/** Import accoustic data (Cells ESDU and Elementary). */
AccousticData(n_("echobase.common.importDataMode.accousticData")),
- /** Import accoustic region cells. */
- AccousticRegionData(n_("echobase.common.importDataMode.accousticRegionData"));
+ /** Import results. */
+ Results(n_("echobase.common.importDataMode.results"));
private final String i18nKey;
Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/MissionNameAlreadyExistException.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/MissionNameAlreadyExistException.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/MissionNameAlreadyExistException.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,34 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class MissionNameAlreadyExistException extends Exception {
+ private static final long serialVersionUID = 1L;
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/MissionNameAlreadyExistException.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/OperationImportService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/OperationImportService.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/OperationImportService.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,91 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.collect.Maps;
+import fr.ifremer.echobase.InputFile;
+import fr.ifremer.echobase.entities.EchoBaseUser;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.Vessel;
+import fr.ifremer.echobase.services.configurations.OperationImportConfiguration;
+import org.nuiton.topia.TopiaException;
+
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Service to launch a "operations" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class OperationImportService extends AbstractImportDataService<OperationImportConfiguration> {
+
+
+ @Override
+ public Map<InputFile, CsvImportResult> startImport(OperationImportConfiguration configuration,
+ EchoBaseUser user) throws IOException, TopiaException {
+
+ Map<InputFile, CsvImportResult> result = Maps.newHashMap();
+
+ Vessel vessel = getEntityById(Vessel.class,
+ configuration.getVesselId());
+
+ Voyage voyage = getEntityById(Voyage.class,
+ configuration.getVoyageId());
+
+
+ importOperationFile(configuration.getOperationFile(), voyage, vessel);
+
+ importOperationMetadataFile(configuration.getOperationMetadataFile(),
+ voyage, vessel);
+
+ importgearMetadataFile(configuration.getGearMetadataFile(), voyage,
+ vessel);
+
+ commitTransaction("Could not commit transaction of operation import");
+ return result;
+ }
+
+ protected void importOperationFile(InputFile inputFile,
+ Voyage voyage,
+ Vessel vessel) {
+ char csvSeparator = getConfiguration().getCsvSeparator();
+
+ }
+
+ protected void importOperationMetadataFile(InputFile inputFile,
+ Voyage voyage,
+ Vessel vessel) {
+ char csvSeparator = getConfiguration().getCsvSeparator();
+
+ }
+
+ protected void importgearMetadataFile(InputFile inputFile,
+ Voyage voyage,
+ Vessel vessel) {
+ char csvSeparator = getConfiguration().getCsvSeparator();
+
+ }
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/OperationImportService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ResultsImportService.java (from rev 303, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/AccousticRegionDataImportService.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ResultsImportService.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ResultsImportService.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,315 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.collect.Iterables;
+import com.google.common.collect.Maps;
+import fr.ifremer.echobase.EchoBaseFunctions;
+import fr.ifremer.echobase.EchoBasePredicates;
+import fr.ifremer.echobase.InputFile;
+import fr.ifremer.echobase.entities.EchoBaseUser;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.DepthStratum;
+import fr.ifremer.echobase.entities.references.Echotype;
+import fr.ifremer.echobase.entities.references.LengthAgeKey;
+import fr.ifremer.echobase.entities.references.LengthWeightKey;
+import fr.ifremer.echobase.entities.references.SizeCategory;
+import fr.ifremer.echobase.entities.references.Species;
+import fr.ifremer.echobase.entities.references.SpeciesCategory;
+import fr.ifremer.echobase.entities.references.SpeciesCategoryDAO;
+import fr.ifremer.echobase.entities.references.Strata;
+import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration;
+import fr.ifremer.echobase.services.configurations.ResultsImportMode;
+import fr.ifremer.echobase.services.csv.EchotypeImportModel;
+import fr.ifremer.echobase.services.csv.EchotypeImportModelRow;
+import fr.ifremer.echobase.services.csv.LengthAgeKeyImportModel;
+import fr.ifremer.echobase.services.csv.LengthAgeKeyImportModelRow;
+import fr.ifremer.echobase.services.csv.LengthWeightKeyImportModel;
+import fr.ifremer.echobase.services.csv.LengthWeightKeyImportModelRow;
+import org.nuiton.topia.TopiaException;
+import org.nuiton.topia.persistence.TopiaDAO;
+import org.nuiton.util.csv.Import;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Service to launch a "results" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class ResultsImportService extends AbstractImportDataService<ResultsImportConfiguration> {
+
+ @Override
+ public Map<InputFile, CsvImportResult> startImport(ResultsImportConfiguration configuration, EchoBaseUser user) throws IOException, TopiaException {
+ Map<InputFile, CsvImportResult> result = Maps.newHashMap();
+
+
+ ResultsImportMode importMode = configuration.getImportMode();
+ switch (importMode) {
+ case VOYAGE:
+
+ List<Voyage> allVoyages = getEntities(Voyage.class);
+ Map<String, Voyage> voyageMap = Maps.uniqueIndex(
+ allVoyages, EchoBaseFunctions.VOYAGE_NAME);
+
+ List<Species> allSpecies =
+ getEntities(Species.class);
+ Map<String, Species> speciesMap = Maps.uniqueIndex(
+ allSpecies, EchoBaseFunctions.SPECIES_CODE_MEMO);
+
+ if (configuration.canImportLengthWeightKeyFile()) {
+
+ List<Strata> allStratas =
+ getEntities(Strata.class);
+ Map<String, Strata> strataMap = Maps.uniqueIndex(
+ allStratas, EchoBaseFunctions.STRATA_BY_NAME);
+ importLenthAgeKey(configuration.getLengthAgeKeyFile(),
+ voyageMap,
+ strataMap,
+ speciesMap
+ );
+ }
+
+ if (configuration.canImportLengthWeightKeyFile()) {
+ List<SizeCategory> allSizeCategorys =
+ getEntities(SizeCategory.class);
+ Map<String, SizeCategory> sizeCategoryMap = Maps.uniqueIndex(
+ allSizeCategorys, EchoBaseFunctions.SIZE_CATEGORY_NAME);
+
+ importLenghtWeightKey(configuration.getLengthWeightKeyFile(),
+ voyageMap,
+ sizeCategoryMap,
+ speciesMap
+ );
+ }
+
+ if (configuration.canImportEchotypeFile()) {
+
+ List<DepthStratum> allDepthStratums =
+ getEntities(DepthStratum.class);
+ Map<String, DepthStratum> depthStratumMap = Maps.uniqueIndex(
+ allDepthStratums, EchoBaseFunctions.DEPTH_STRATUM_ID);
+
+ importEchotypeFile(configuration.getEchotypeFile(),
+ voyageMap,
+ depthStratumMap,
+ speciesMap
+ );
+ }
+ break;
+ case ACOUSTIC:
+ if (configuration.canImportRegionsFile()) {
+ importRegionsFile(configuration.getRegionsFile());
+ }
+ if (configuration.canImportAssociationFile()) {
+ importAssociationFile(configuration.getAssociationFile());
+ }
+ break;
+ }
+ return result;
+ }
+
+ protected void importRegionsFile(InputFile inputFile) {
+
+ }
+
+ protected void importAssociationFile(InputFile inputFile) {
+ }
+
+ protected void importLenghtWeightKey(InputFile inputFile,
+ Map<String, Voyage> voyageMap,
+ Map<String, SizeCategory> sizeCategoryMap,
+ Map<String, Species> speciesMap) throws TopiaException, IOException {
+
+ LengthWeightKeyImportModel csvModel = new LengthWeightKeyImportModel(
+ serviceContext.getConfiguration().getCsvSeparator(),
+ voyageMap,
+ sizeCategoryMap,
+ speciesMap);
+
+ TopiaDAO<LengthWeightKey> dao = getDAO(LengthWeightKey.class);
+
+ SpeciesCategoryDAO speciesCategoryDAO =
+ (SpeciesCategoryDAO) getDAO(SpeciesCategory.class);
+
+ Reader reader = new BufferedReader(new FileReader(inputFile.getFile()));
+ try {
+ Import<LengthWeightKeyImportModelRow> importer =
+ Import.newImport(csvModel, reader);
+
+ for (LengthWeightKeyImportModelRow row : importer) {
+
+ Voyage voyage = row.getVoyage();
+
+ LengthWeightKey lengthWeightKey = dao.create();
+
+ lengthWeightKey.setAParameter(row.getaParameter());
+ lengthWeightKey.setBParameter(row.getbParameter());
+ //TODO should we import it ?
+ //lengthWeightKey.setMetadata(row.getMetadata());
+
+ Species species = row.getSpecies();
+ SizeCategory sizeCategory = row.getSizeCategory();
+
+ // find speciesCategory
+ SpeciesCategory speciesCategory = speciesCategoryDAO.findByProperties(
+ SpeciesCategory.PROPERTY_SIZE_CATEGORY, sizeCategory,
+ SpeciesCategory.PROPERTY_SPECIES, species
+ );
+
+ if (speciesCategory == null) {
+
+ // not found, creates it
+ speciesCategory = speciesCategoryDAO.create(
+ SpeciesCategory.PROPERTY_SIZE_CATEGORY, sizeCategory,
+ SpeciesCategory.PROPERTY_SPECIES, species
+ );
+ }
+
+ lengthWeightKey.setSpeciesCategory(speciesCategory);
+
+ // attach it to voyage
+ voyage.addLengthWeightKey(lengthWeightKey);
+
+ }
+
+ } finally {
+ reader.close();
+ }
+
+ }
+
+ protected void importLenthAgeKey(InputFile inputFile,
+ Map<String, Voyage> voyageMap,
+ Map<String, Strata> startaMap,
+ Map<String, Species> speciesMap) throws IOException, TopiaException {
+
+ LengthAgeKeyImportModel csvModel = new LengthAgeKeyImportModel(
+ serviceContext.getConfiguration().getCsvSeparator(),
+ voyageMap,
+ startaMap,
+ speciesMap);
+
+ TopiaDAO<LengthAgeKey> dao = getDAO(LengthAgeKey.class);
+
+ Reader reader = new BufferedReader(new FileReader(inputFile.getFile()));
+ try {
+ Import<LengthAgeKeyImportModelRow> importer =
+ Import.newImport(csvModel, reader);
+
+ for (LengthAgeKeyImportModelRow row : importer) {
+
+ Voyage voyage = row.getVoyage();
+
+ LengthAgeKey lengthAgeKey = dao.create();
+
+ lengthAgeKey.setAge(row.getAge());
+ lengthAgeKey.setLength(row.getLength());
+ lengthAgeKey.setPercentAtAge(row.getPercentAtAge());
+ lengthAgeKey.setMetadata(row.getMetadata());
+ lengthAgeKey.setSpecies(row.getSpecies());
+ lengthAgeKey.setStrata(row.getStrata());
+
+ // attach it to voyage
+ voyage.addLengthAgeKey(lengthAgeKey);
+
+ }
+
+ } finally {
+ reader.close();
+ }
+ }
+
+ private void importEchotypeFile(InputFile inputFile,
+ Map<String, Voyage> voyageMap,
+ Map<String, DepthStratum> depthStratumMap,
+ Map<String, Species> speciesMap) throws TopiaException, IOException {
+
+ EchotypeImportModel csvModel = new EchotypeImportModel(
+ serviceContext.getConfiguration().getCsvSeparator(),
+ voyageMap,
+ depthStratumMap,
+ speciesMap);
+
+ TopiaDAO<Echotype> dao = getDAO(Echotype.class);
+
+ Reader reader = new BufferedReader(new FileReader(inputFile.getFile()));
+ try {
+ Import<EchotypeImportModelRow> importer =
+ Import.newImport(csvModel, reader);
+
+ for (EchotypeImportModelRow row : importer) {
+
+ Voyage voyage = row.getVoyage();
+
+ String echotypeName = row.getName();
+
+ // check if there is a echotype for the voyage and this name
+ Echotype echotype = null;
+
+ if (!voyage.isEchotypeEmpty()) {
+
+ echotype = Iterables.find(voyage.getEchotype(),
+ EchoBasePredicates.newEchotypeByNamePredicate(echotypeName));
+
+ }
+
+ if (echotype == null) {
+
+ // creates it
+ echotype = dao.create(
+ Echotype.PROPERTY_NAME, echotypeName,
+ Echotype.PROPERTY_MEANING, row.getMeaning()
+ );
+
+ DepthStratum depthStratum = row.getDepthStratum();
+ echotype.setDepthStratum(depthStratum);
+
+ // attach it to voyage
+
+ voyage.addEchotype(echotype);
+ }
+
+ Species species = row.getSpecies();
+ Species existingSpecie =
+ echotype.getSpeciesByTopiaId(species.getTopiaId());
+
+ if (existingSpecie == null) {
+
+ // add this species
+ echotype.addSpecies(species);
+ }
+ }
+
+ } finally {
+ reader.close();
+ }
+ }
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ResultsImportService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AccousticDataImportConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AccousticDataImportConfiguration.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AccousticDataImportConfiguration.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -48,6 +48,9 @@
/** Selected vessel id to find out transect where to import datas. */
protected String vesselId;
+ /** Flag to always add new dataAcquisition when a new instrument is found in movies file. */
+ protected boolean addDataAcquisition = true;
+
/** Manual transceiverAcquisitionAbsorptionDescription. */
protected String transceiverAcquisitionAbsorptionDescription = "(i) Equation: Francois and garrison 1982,(ii) CTD, (iii) nominal value for entire data set";
@@ -93,6 +96,9 @@
/** Manual notes. */
protected String notes;
+ /** Cell position reference for esdu cell datas. */
+ protected CellPositionReference cellPositionReference;
+
/** Movies file to import. */
protected final InputFile moviesFile;
@@ -126,6 +132,14 @@
this.vesselId = vesselId;
}
+ public boolean isAddDataAcquisition() {
+ return addDataAcquisition;
+ }
+
+ public void setAddDataAcquisition(boolean addDataAcquisition) {
+ this.addDataAcquisition = addDataAcquisition;
+ }
+
public String getTransceiverAcquisitionAbsorptionDescription() {
return transceiverAcquisitionAbsorptionDescription;
}
@@ -250,6 +264,14 @@
this.processingDescription = processingDescription;
}
+ public CellPositionReference getCellPositionReference() {
+ return cellPositionReference;
+ }
+
+ public void setCellPositionReference(CellPositionReference cellPositionReference) {
+ this.cellPositionReference = cellPositionReference;
+ }
+
@Override
public InputFile[] getInputFiles() {
return new InputFile[]{moviesFile};
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AccousticRegionDataImportConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AccousticRegionDataImportConfiguration.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AccousticRegionDataImportConfiguration.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,90 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.configurations;
-
-import fr.ifremer.echobase.InputFile;
-
-import java.util.Locale;
-
-import static org.nuiton.i18n.I18n.l_;
-
-/**
- * Configuration of a "accoustic region data" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class AccousticRegionDataImportConfiguration extends AbstractImportConfiguration {
-
- private static final long serialVersionUID = 1L;
-
- /** Selected voyage id where to import datas. */
- protected String voyageId;
-
- /** Selected vessel id to find out transect where to import datas. */
- protected String vesselId;
-
- /** Region file to import. */
- protected final InputFile regionsFile;
-
- /** Region cell associations file to import. */
- protected final InputFile associationFile;
-
- public AccousticRegionDataImportConfiguration(Locale locale) {
- regionsFile = InputFile.newFile(
- l_(locale, "echobase.common.regionsFile"));
- associationFile = InputFile.newFile(
- l_(locale, "echobase.common.associationFile"));
- }
-
- public String getVoyageId() {
- return voyageId;
- }
-
- public void setVoyageId(String voyageId) {
- this.voyageId = voyageId;
- }
-
- public String getVesselId() {
- return vesselId;
- }
-
- public void setVesselId(String vesselId) {
- this.vesselId = vesselId;
- }
-
- public InputFile getRegionsFile() {
- return regionsFile;
- }
-
-
- public InputFile getAssociationFile() {
- return associationFile;
- }
-
- @Override
- public InputFile[] getInputFiles() {
- return new InputFile[]{regionsFile, associationFile};
- }
-}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesDataImportConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesDataImportConfiguration.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesDataImportConfiguration.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -42,27 +42,20 @@
/** Selected voyage id where to import datas. */
protected String voyageId;
+ /** Selected vessel id to find out transect where to import datas. */
+ protected String vesselId;
+
/** Station file to import. */
- protected final InputFile tlbeStationFile;
+ protected final InputFile sampleFile;
/** Tri file to import. */
- protected final InputFile xtblTriFile;
+ protected final InputFile sampleDataFile;
- /** Mensuration data file to import. */
- protected final InputFile tblMensurationFile;
-
- /** Mensuration classes file to import. */
- protected final InputFile tblMensurationClasseFile;
-
public CatchesDataImportConfiguration(Locale locale) {
- tlbeStationFile = InputFile.newFile(
- l_(locale, "echobase.common.tlbeStationFile"));
- xtblTriFile = InputFile.newFile(
- l_(locale, "echobase.common.xtblTriFile"));
- tblMensurationFile = InputFile.newFile(
- l_(locale, "echobase.common.tblMensurationFile"));
- tblMensurationClasseFile = InputFile.newFile(
- l_(locale, "echobase.common.tblMensurationClasseFile"));
+ sampleFile = InputFile.newFile(
+ l_(locale, "echobase.common.sampleFile"));
+ sampleDataFile = InputFile.newFile(
+ l_(locale, "echobase.common.sampleDatafile"));
}
public String getVoyageId() {
@@ -73,25 +66,24 @@
this.voyageId = voyageId;
}
- public InputFile getTlbeStationFile() {
- return tlbeStationFile;
+ public String getVesselId() {
+ return vesselId;
}
- public InputFile getXtblTriFile() {
- return xtblTriFile;
+ public void setVesselId(String vesselId) {
+ this.vesselId = vesselId;
}
- public InputFile getTblMensurationFile() {
- return tblMensurationFile;
+ public InputFile getSampleFile() {
+ return sampleFile;
}
- public InputFile getTblMensurationClasseFile() {
- return tblMensurationClasseFile;
+ public InputFile getSampleDataFile() {
+ return sampleDataFile;
}
@Override
public InputFile[] getInputFiles() {
- return new InputFile[]{tlbeStationFile, xtblTriFile,
- tblMensurationFile, tblMensurationClasseFile};
+ return new InputFile[]{sampleFile, sampleDataFile};
}
}
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesIndividualDataImportConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesIndividualDataImportConfiguration.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesIndividualDataImportConfiguration.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,69 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.configurations;
-
-import fr.ifremer.echobase.InputFile;
-
-import java.util.Locale;
-
-import static org.nuiton.i18n.I18n.l_;
-
-/**
- * Configuration of a "catches individual data" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CatchesIndividualDataImportConfiguration extends AbstractImportConfiguration {
-
- private static final long serialVersionUID = 1L;
-
- /** Selected voyage id where to import datas. */
- protected String voyageId;
-
- /** Individual input file to import. */
- protected final InputFile individualDataFile;
-
- public CatchesIndividualDataImportConfiguration(Locale locale) {
- individualDataFile = InputFile.newFile(
- l_(locale, "echobase.common.individualDataFile"));
- }
-
- public String getVoyageId() {
- return voyageId;
- }
-
- public void setVoyageId(String voyageId) {
- this.voyageId = voyageId;
- }
-
- public InputFile getIndividualDataFile() {
- return individualDataFile;
- }
-
- @Override
- public InputFile[] getInputFiles() {
- return new InputFile[]{individualDataFile};
- }
-}
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesReferenceImportConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesReferenceImportConfiguration.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CatchesReferenceImportConfiguration.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,67 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.configurations;
-
-import fr.ifremer.echobase.InputFile;
-
-import java.util.Locale;
-
-import static org.nuiton.i18n.I18n.l_;
-
-/**
- * Configuration of a "catches references" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CatchesReferenceImportConfiguration extends AbstractImportConfiguration {
-
- private static final long serialVersionUID = 1L;
-
- /** LengthAgeKey file to import. */
- protected final InputFile lengthAgeKeyFile;
-
- /** LengthWeightKey file to import. */
- protected final InputFile lengthWeightKeyFile;
-
- public CatchesReferenceImportConfiguration(Locale locale) {
- lengthAgeKeyFile = InputFile.newFile(
- l_(locale, "echobase.common.lengthAgeKeyFile"));
- lengthWeightKeyFile = InputFile.newFile(
- l_(locale, "echobase.common.lengthWeightKeyFile"));
- }
-
- public InputFile getLengthAgeKeyFile() {
- return lengthAgeKeyFile;
- }
-
- public InputFile getLengthWeightKeyFile() {
- return lengthWeightKeyFile;
- }
-
- @Override
- public InputFile[] getInputFiles() {
- return new InputFile[]{lengthAgeKeyFile, lengthWeightKeyFile};
- }
-}
Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CellPositionReference.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CellPositionReference.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CellPositionReference.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,74 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.configurations;
+
+import fr.ifremer.echobase.I18nAble;
+
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ * To define cell position reference in acoustic import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public enum CellPositionReference implements I18nAble {
+
+ /** Begin. */
+ START(n_("echobase.common.cellPositionReference.start")) {
+ @Override
+ public String getMetadataNameSuffix() {
+ return "Start";
+ }
+ },
+
+ /** Mid. */
+ MID(n_("echobase.common.cellPositionReference.mid")) {
+ @Override
+ public String getMetadataNameSuffix() {
+ return "Bary";
+ }
+ },
+
+ /** End. */
+ END(n_("echobase.common.cellPositionReference.end")) {
+ @Override
+ public String getMetadataNameSuffix() {
+ return "End";
+ }
+ };
+
+ private final String i18nKey;
+
+ CellPositionReference(String i18nKey) {
+ this.i18nKey = i18nKey;
+ }
+
+ @Override
+ public String getI18nKey() {
+ return i18nKey;
+ }
+
+ public abstract String getMetadataNameSuffix();
+}
\ No newline at end of file
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CellPositionReference.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataCompleteImportConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataCompleteImportConfiguration.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataCompleteImportConfiguration.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,185 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.configurations;
-
-import fr.ifremer.echobase.InputFile;
-
-import java.util.Locale;
-
-import static org.nuiton.i18n.I18n.l_;
-
-/**
- * Configuration of a "common data complete" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CommonDataCompleteImportConfiguration extends AbstractImportConfiguration {
-
- private static final long serialVersionUID = 1L;
-
- /** Selected mission id to use in voyage. */
- protected String missionId;
-
- /** Selected area of operation to use for voyage. */
- protected String areaOfOperationId;
-
- /** Selected vessel to use for transect. */
- protected String vesselId;
-
- /** Manual description of voyage. */
- protected String voyageDescription;
-
- /** transit related activity. */
- protected String transitRelatedActivity;
-
- /** transect license. */
- protected String transectLicence;
-
- /** transect geospatialVerticalPositive. */
- protected String transectGeospatialVerticalPositive = "down";
-
- /** transect binUnitsPingAxis. */
- protected String transectBinUnitsPingAxis = "1 nautical mile";
-
- /** Manual datum to use in voyage. */
- protected String datum = "WGS84";
-
- /** Voyage file to import. */
- protected final InputFile voyageFile;
-
- /** Transit file to import. */
- protected final InputFile transitFile;
-
- /** Transect file to import. */
- protected final InputFile transectFile;
-
- /** Echotype file to import. */
- protected final InputFile echotypeFile;
-
- public CommonDataCompleteImportConfiguration(Locale locale) {
- voyageFile = InputFile.newFile(
- l_(locale, "echobase.common.voyageFile"));
- transitFile = InputFile.newFile(
- l_(locale, "echobase.common.transitFile"));
- transectFile = InputFile.newFile(
- l_(locale, "echobase.common.transectFile"));
- echotypeFile = InputFile.newFile(
- l_(locale, "echobase.common.echotypeFile"));
- }
-
- public String getMissionId() {
- return missionId;
- }
-
- public void setMissionId(String missionId) {
- this.missionId = missionId;
- }
-
- public String getAreaOfOperationId() {
- return areaOfOperationId;
- }
-
- public void setAreaOfOperationId(String areaOfOperationId) {
- this.areaOfOperationId = areaOfOperationId;
- }
-
- public String getVesselId() {
- return vesselId;
- }
-
- public void setVesselId(String vesselId) {
- this.vesselId = vesselId;
- }
-
- public String getVoyageDescription() {
- return voyageDescription;
- }
-
- public void setVoyageDescription(String voyageDescription) {
- this.voyageDescription = voyageDescription;
- }
-
- public String getDatum() {
- return datum;
- }
-
- public void setDatum(String datum) {
- this.datum = datum;
- }
-
- public String getTransitRelatedActivity() {
- return transitRelatedActivity;
- }
-
- public void setTransitRelatedActivity(String transitRelatedActivity) {
- this.transitRelatedActivity = transitRelatedActivity;
- }
-
- public String getTransectLicence() {
- return transectLicence;
- }
-
- public void setTransectLicence(String transectLicence) {
- this.transectLicence = transectLicence;
- }
-
- public String getTransectGeospatialVerticalPositive() {
- return transectGeospatialVerticalPositive;
- }
-
- public void setTransectGeospatialVerticalPositive(String transectGeospatialVerticalPositive) {
- this.transectGeospatialVerticalPositive = transectGeospatialVerticalPositive;
- }
-
- public String getTransectBinUnitsPingAxis() {
- return transectBinUnitsPingAxis;
- }
-
- public void setTransectBinUnitsPingAxis(String transectBinUnitsPingAxis) {
- this.transectBinUnitsPingAxis = transectBinUnitsPingAxis;
- }
-
- public InputFile getVoyageFile() {
- return voyageFile;
- }
-
- public InputFile getTransitFile() {
- return transitFile;
- }
-
- public InputFile getTransectFile() {
- return transectFile;
- }
-
- public InputFile getEchotypeFile() {
- return echotypeFile;
- }
-
- @Override
- public InputFile[] getInputFiles() {
- return new InputFile[]{voyageFile, transitFile,
- transectFile, echotypeFile};
- }
-}
Deleted: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataFromTransectImportConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataFromTransectImportConfiguration.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataFromTransectImportConfiguration.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,124 +0,0 @@
-/*
- * #%L
- * EchoBase :: Services
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.configurations;
-
-import fr.ifremer.echobase.InputFile;
-
-import java.util.Locale;
-
-import static org.nuiton.i18n.I18n.l_;
-
-/**
- * Configuration of a "common data from transect" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class CommonDataFromTransectImportConfiguration extends AbstractImportConfiguration {
-
- private static final long serialVersionUID = 1L;
-
- /** Selected voyage id where to import datas. */
- protected String voyageId;
-
- /** Selected vessel to use for transect. */
- protected String vesselId;
-
- /** transect license. */
- protected String transectLicence;
-
- /** transect geospatialVerticalPositive. */
- protected String transectGeospatialVerticalPositive = "down";
-
- /** transect binUnitsPingAxis. */
- protected String transectBinUnitsPingAxis = "1 nautical mile";
-
- /** Manual datum to use in voyage. */
- protected String datum = "WGS84";
-
- /** Transect file to import. */
- protected final InputFile transectFile;
-
- public CommonDataFromTransectImportConfiguration(Locale locale) {
- transectFile = InputFile.newFile(
- l_(locale, "echobase.common.transectFile"));
- }
-
- public String getVoyageId() {
- return voyageId;
- }
-
- public void setVoyageId(String voyageId) {
- this.voyageId = voyageId;
- }
-
- public String getVesselId() {
- return vesselId;
- }
-
- public void setVesselId(String vesselId) {
- this.vesselId = vesselId;
- }
-
- public String getDatum() {
- return datum;
- }
-
- public void setDatum(String datum) {
- this.datum = datum;
- }
-
- public String getTransectLicence() {
- return transectLicence;
- }
-
- public void setTransectLicence(String transectLicence) {
- this.transectLicence = transectLicence;
- }
-
- public String getTransectGeospatialVerticalPositive() {
- return transectGeospatialVerticalPositive;
- }
-
- public void setTransectGeospatialVerticalPositive(String transectGeospatialVerticalPositive) {
- this.transectGeospatialVerticalPositive = transectGeospatialVerticalPositive;
- }
-
- public String getTransectBinUnitsPingAxis() {
- return transectBinUnitsPingAxis;
- }
-
- public void setTransectBinUnitsPingAxis(String transectBinUnitsPingAxis) {
- this.transectBinUnitsPingAxis = transectBinUnitsPingAxis;
- }
-
- public InputFile getTransectFile() {
- return transectFile;
- }
-
- @Override
- public InputFile[] getInputFiles() {
- return new InputFile[]{transectFile};
- }
-}
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportConfiguration.java (from rev 303, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataCompleteImportConfiguration.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportConfiguration.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportConfiguration.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,197 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.configurations;
+
+import fr.ifremer.echobase.InputFile;
+
+import java.util.Locale;
+
+import static org.nuiton.i18n.I18n.l_;
+
+/**
+ * Configuration of a "common data complete" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class CommonDataImportConfiguration extends AbstractImportConfiguration {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Selected import mode. */
+ protected CommonDataImportMode importMode;
+
+ /** Selected mission id to use in voyage. */
+ protected String missionId;
+
+ /** Selected voyage id to use (in mode 2). */
+ protected String voyageId;
+
+ /** Selected area of operation to use for voyage. */
+ protected String areaOfOperationId;
+
+ /** Selected vessel to use for transect. */
+ protected String vesselId;
+
+ /** Manual description of voyage. */
+ protected String voyageDescription;
+
+ /** transit related activity. */
+ protected String transitRelatedActivity;
+
+ /** transect license. */
+ protected String transectLicence;
+
+ /** transect geospatialVerticalPositive. */
+ protected String transectGeospatialVerticalPositive = "down";
+
+ /** transect binUnitsPingAxis. */
+ protected String transectBinUnitsPingAxis = "1 nautical mile";
+
+ /** Manual datum to use in voyage. */
+ protected String datum = "WGS84";
+
+ /** Voyage file to import. */
+ protected final InputFile voyageFile;
+
+ /** Transit file to import. */
+ protected final InputFile transitFile;
+
+ /** Transect file to import. */
+ protected final InputFile transectFile;
+
+ public CommonDataImportConfiguration(Locale locale) {
+ voyageFile = InputFile.newFile(
+ l_(locale, "echobase.common.voyageFile"));
+ transitFile = InputFile.newFile(
+ l_(locale, "echobase.common.transitFile"));
+ transectFile = InputFile.newFile(
+ l_(locale, "echobase.common.transectFile"));
+ }
+
+ public CommonDataImportMode getImportMode() {
+ return importMode;
+ }
+
+ public void setImportMode(CommonDataImportMode importMode) {
+ this.importMode = importMode;
+ }
+
+ public String getMissionId() {
+ return missionId;
+ }
+
+ public void setMissionId(String missionId) {
+ this.missionId = missionId;
+ }
+
+ public String getAreaOfOperationId() {
+ return areaOfOperationId;
+ }
+
+ public void setAreaOfOperationId(String areaOfOperationId) {
+ this.areaOfOperationId = areaOfOperationId;
+ }
+
+ public String getVesselId() {
+ return vesselId;
+ }
+
+ public void setVesselId(String vesselId) {
+ this.vesselId = vesselId;
+ }
+
+ public String getVoyageId() {
+ return voyageId;
+ }
+
+ public void setVoyageId(String voyageId) {
+ this.voyageId = voyageId;
+ }
+
+ public String getVoyageDescription() {
+ return voyageDescription;
+ }
+
+ public void setVoyageDescription(String voyageDescription) {
+ this.voyageDescription = voyageDescription;
+ }
+
+ public String getDatum() {
+ return datum;
+ }
+
+ public void setDatum(String datum) {
+ this.datum = datum;
+ }
+
+ public String getTransitRelatedActivity() {
+ return transitRelatedActivity;
+ }
+
+ public void setTransitRelatedActivity(String transitRelatedActivity) {
+ this.transitRelatedActivity = transitRelatedActivity;
+ }
+
+ public String getTransectLicence() {
+ return transectLicence;
+ }
+
+ public void setTransectLicence(String transectLicence) {
+ this.transectLicence = transectLicence;
+ }
+
+ public String getTransectGeospatialVerticalPositive() {
+ return transectGeospatialVerticalPositive;
+ }
+
+ public void setTransectGeospatialVerticalPositive(String transectGeospatialVerticalPositive) {
+ this.transectGeospatialVerticalPositive = transectGeospatialVerticalPositive;
+ }
+
+ public String getTransectBinUnitsPingAxis() {
+ return transectBinUnitsPingAxis;
+ }
+
+ public void setTransectBinUnitsPingAxis(String transectBinUnitsPingAxis) {
+ this.transectBinUnitsPingAxis = transectBinUnitsPingAxis;
+ }
+
+ public InputFile getVoyageFile() {
+ return voyageFile;
+ }
+
+ public InputFile getTransitFile() {
+ return transitFile;
+ }
+
+ public InputFile getTransectFile() {
+ return transectFile;
+ }
+
+ @Override
+ public InputFile[] getInputFiles() {
+ return new InputFile[]{voyageFile, transitFile, transectFile};
+ }
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportConfiguration.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/configurations/CommonDataImportMode.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportMode.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportMode.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,54 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.configurations;
+
+import fr.ifremer.echobase.I18nAble;
+
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ * To define common data import mode.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public enum CommonDataImportMode implements I18nAble {
+
+ /** Import Voyage / Transit / Transect. */
+ ALL(n_("echobase.common.commonDataImportMode.all")),
+
+ /** Import all common data from Transect to Operation. */
+ TRANSECT(n_("echobase.common.commonDataImportMode.transect"));
+
+ private final String i18nKey;
+
+ CommonDataImportMode(String i18nKey) {
+ this.i18nKey = i18nKey;
+ }
+
+ @Override
+ public String getI18nKey() {
+ return i18nKey;
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/CommonDataImportMode.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/configurations/OperationImportConfiguration.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/OperationImportConfiguration.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/OperationImportConfiguration.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,100 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.configurations;
+
+import fr.ifremer.echobase.InputFile;
+
+import java.util.Locale;
+
+import static org.nuiton.i18n.I18n.l_;
+
+/**
+ * Configuration of a "operation" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class OperationImportConfiguration extends AbstractImportConfiguration {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Selected voyage id where to import datas. */
+ protected String voyageId;
+
+ /** Selected vessel to use for transect. */
+ protected String vesselId;
+
+ /** operation file to import. */
+ protected final InputFile operationFile;
+
+ /** operation metadatas file to import. */
+ protected final InputFile operationMetadataFile;
+
+ /** gear metadatas file to import. */
+ protected final InputFile gearMetadataFile;
+
+ public OperationImportConfiguration(Locale locale) {
+ operationFile = InputFile.newFile(
+ l_(locale, "echobase.common.operationFile"));
+ operationMetadataFile = InputFile.newFile(
+ l_(locale, "echobase.common.operationMetadataFile"));
+ gearMetadataFile = InputFile.newFile(
+ l_(locale, "echobase.common.gearMetadataFile"));
+ }
+
+ public String getVoyageId() {
+ return voyageId;
+ }
+
+ public void setVoyageId(String voyageId) {
+ this.voyageId = voyageId;
+ }
+
+ public String getVesselId() {
+ return vesselId;
+ }
+
+ public void setVesselId(String vesselId) {
+ this.vesselId = vesselId;
+ }
+
+ public InputFile getOperationFile() {
+ return operationFile;
+ }
+
+ public InputFile getOperationMetadataFile() {
+ return operationMetadataFile;
+ }
+
+ public InputFile getGearMetadataFile() {
+ return gearMetadataFile;
+ }
+
+ @Override
+ public InputFile[] getInputFiles() {
+ return new InputFile[]{operationFile,
+ operationMetadataFile,
+ gearMetadataFile};
+ }
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/OperationImportConfiguration.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportConfiguration.java (from rev 303, trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/AccousticRegionDataImportConfiguration.java)
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportConfiguration.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportConfiguration.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,148 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.configurations;
+
+import fr.ifremer.echobase.InputFile;
+
+import java.util.Locale;
+
+import static org.nuiton.i18n.I18n.l_;
+
+/**
+ * Configuration of a "results" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class ResultsImportConfiguration extends AbstractImportConfiguration {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Selected voyage id where to import datas. */
+ protected String voyageId;
+
+ /** Selected vessel id to find out transect where to import datas. */
+ protected String vesselId;
+
+ protected ResultsImportMode importMode;
+
+ /** Region file to import. */
+ protected final InputFile regionsFile;
+
+ /** Region cell associations file to import. */
+ protected final InputFile associationFile;
+
+ /** Region echotype file to import. */
+ protected final InputFile echotypeFile;
+
+ /** LengthAgeKey file to import. */
+ protected final InputFile lengthAgeKeyFile;
+
+ /** LengthWeightKey file to import. */
+ protected final InputFile lengthWeightKeyFile;
+
+ public ResultsImportConfiguration(Locale locale) {
+ regionsFile = InputFile.newFile(
+ l_(locale, "echobase.common.regionsFile"));
+ associationFile = InputFile.newFile(
+ l_(locale, "echobase.common.associationFile"));
+ echotypeFile = InputFile.newFile(
+ l_(locale, "echobase.common.echotypeFile"));
+
+ lengthAgeKeyFile = InputFile.newFile(
+ l_(locale, "echobase.common.lengthAgeKeyFile"));
+ lengthWeightKeyFile = InputFile.newFile(
+ l_(locale, "echobase.common.lengthWeightKeyFile"));
+ }
+
+ public String getVoyageId() {
+ return voyageId;
+ }
+
+ public void setVoyageId(String voyageId) {
+ this.voyageId = voyageId;
+ }
+
+ public String getVesselId() {
+ return vesselId;
+ }
+
+ public void setVesselId(String vesselId) {
+ this.vesselId = vesselId;
+ }
+
+ public ResultsImportMode getImportMode() {
+ return importMode;
+ }
+
+ public void setImportMode(ResultsImportMode importMode) {
+ this.importMode = importMode;
+ }
+
+ public InputFile getRegionsFile() {
+ return regionsFile;
+ }
+
+ public boolean canImportRegionsFile() {
+ return regionsFile.getFile() != null;
+ }
+
+ public InputFile getAssociationFile() {
+ return associationFile;
+ }
+
+ public boolean canImportAssociationFile() {
+ return associationFile.getFile() != null;
+ }
+
+ public InputFile getEchotypeFile() {
+ return echotypeFile;
+ }
+
+ public boolean canImportEchotypeFile() {
+ return echotypeFile.getFile() != null;
+ }
+
+ public InputFile getLengthAgeKeyFile() {
+ return lengthAgeKeyFile;
+ }
+
+ public boolean canImportLengthAgeKeyFile() {
+ return lengthAgeKeyFile.getFile() != null;
+ }
+
+ public InputFile getLengthWeightKeyFile() {
+ return lengthWeightKeyFile;
+ }
+
+ public boolean canImportLengthWeightKeyFile() {
+ return lengthWeightKeyFile.getFile() != null;
+ }
+
+ @Override
+ public InputFile[] getInputFiles() {
+ return new InputFile[]{regionsFile, associationFile, echotypeFile,
+ lengthAgeKeyFile, lengthWeightKeyFile};
+ }
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportConfiguration.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/configurations/ResultsImportMode.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportMode.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportMode.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,54 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.configurations;
+
+import fr.ifremer.echobase.I18nAble;
+
+import static org.nuiton.i18n.I18n.n_;
+
+/**
+ * To define results import mode.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public enum ResultsImportMode implements I18nAble {
+
+ /** Import results at voyage level. */
+ VOYAGE(n_("echobase.common.resultsImportMode.voyage")),
+
+ /** Import acoustic results. */
+ ACOUSTIC(n_("echobase.common.resultsImportMode.acoustic"));
+
+ private final String i18nKey;
+
+ ResultsImportMode(String i18nKey) {
+ this.i18nKey = i18nKey;
+ }
+
+ @Override
+ public String getI18nKey() {
+ return i18nKey;
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/configurations/ResultsImportMode.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModel.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModel.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -90,46 +90,46 @@
// Cell elementary Datas
newIgnoredColumn("MOVIES_EILayer\\cellset");//AW
- newMandatoryColumn("MOVIES_EILayer\\cellset\\cellnum", AcousticDataImportModelRow.PROPERTY_ELEMENTARY_CELL_NUM, CsvModelUtil.INTEGER);//AX
- newMandatoryColumn("MOVIES_EILayer\\cellset\\celltype", AcousticDataImportModelRow.PROPERTY_ELEMENTARY_CELL_TYPE, CsvModelUtil.INTEGER);//AY
- newMandatoryColumn("MOVIES_EILayer\\cellset\\depthstart", AcousticDataImportModelRow.PROPERTY_ELEMENTARY_CELL_DATA_DEPTH_START);//AZ
- newMandatoryColumn("MOVIES_EILayer\\cellset\\depthend", AcousticDataImportModelRow.PROPERTY_ELEMENTARY_CELL_DATA_DEPTHEND);//BA
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\cellnum", AcousticDataImportModelRow.PROPERTY_CELL_NUM, CsvModelUtil.INTEGER);//AX
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\celltype", AcousticDataImportModelRow.PROPERTY_CELL_TYPE, CsvModelUtil.INTEGER);//AY
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\depthstart", AcousticDataImportModelRow.PROPERTY_CELL_DEPTH_START);//AZ
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\depthend", AcousticDataImportModelRow.PROPERTY_CELL_DEPTH_END);//BA
newIgnoredColumn("MOVIES_EILayer\\cellset\\indexstart");//BB
newIgnoredColumn("MOVIES_EILayer\\cellset\\indexend");//BC
- newMandatoryColumn("MOVIES_EILayer\\cellset\\datestart", AcousticDataImportModelRow.PROPERTY_ESDU_CELL_START_DATE, CsvModelUtil.IMPORT_DAY_TIME3);//BD
+ newMandatoryColumn("MOVIES_EILayer\\cellset\\datestart", AcousticDataImportModelRow.PROPERTY_CELL_DATE_START, CsvModelUtil.IMPORT_DAY_TIME3);//BD
newIgnoredColumn("MOVIES_EILayer\\cellset\\dateend");//BE
newIgnoredColumn("MOVIES_EILayer\\cellset\\diststart");//BF
newIgnoredColumn("MOVIES_EILayer\\cellset\\distend");//BG
newMandatoryColumn("MOVIES_EILayer\\cellset\\thresholdup", AcousticDataImportModelRow.PROPERTY_EI_THRESHOLD, CsvModelUtil.INTEGER);//BH
newIgnoredColumn("MOVIES_EILayer\\cellset\\thresholdlow");//BI
newIgnoredColumn("MOVIES_EILayer\\eilayer");//BJ
- newMandatoryColumn("MOVIES_EILayer\\eilayer\\sa", AcousticDataImportModelRow.PROPERTY_ELEMENTARY_CELL_DATA_ACOUSTIC_DENSITY);//BK
+ newMandatoryColumn("MOVIES_EILayer\\eilayer\\sa", AcousticDataImportModelRow.PROPERTY_CELL_SA);//BK
newIgnoredColumn("MOVIES_EILayer\\eilayer\\sv");//BL
newIgnoredColumn("MOVIES_EILayer\\eilayer\\ni");//BM
newIgnoredColumn("MOVIES_EILayer\\eilayer\\nt");//BN
- // Cell ESDU Datas
- newIgnoredColumn("MOVIES_EILayer\\cellset2");//BO
- newIgnoredColumn("MOVIES_EILayer\\cellset2\\cellnum");//BP
- newIgnoredColumn("MOVIES_EILayer\\cellset2\\celltype");//BQ
- newIgnoredColumn("MOVIES_EILayer\\cellset2\\depthstart");//BR
- newIgnoredColumn("MOVIES_EILayer\\cellset2\\depthend");//BS
- newIgnoredColumn("MOVIES_EILayer\\cellset2\\indexstart");//BT
- newIgnoredColumn("MOVIES_EILayer\\cellset2\\indexend");//BU
- newMandatoryColumn("MOVIES_EILayer\\cellset2\\datestart", AcousticDataImportModelRow.PROPERTY_ESDU_CELL_DATA_TIME);//BV
- newIgnoredColumn("MOVIES_EILayer\\cellset2\\dateend");//BW
- newIgnoredColumn("MOVIES_EILayer\\cellset2\\diststart");//BX
- newIgnoredColumn("MOVIES_EILayer\\cellset2\\distend");//BY
- newIgnoredColumn("MOVIES_EILayer\\cellset2\\thresholdup");//BZ
- newIgnoredColumn("MOVIES_EILayer\\cellset2\\thresholdlow");//CA
- newIgnoredColumn("MOVIES_EILayer\\eilayer2");//CB
- newMandatoryColumn("MOVIES_EILayer\\eilayer2\\sa", AcousticDataImportModelRow.PROPERTY_ESDU_CELL_DATA_ACOUSTIC_DENSITY);//CC
- newIgnoredColumn("MOVIES_EILayer\\eilayer2\\sv");//CD
- newIgnoredColumn("MOVIES_EILayer\\eilayer2\\ni");//CE
- newIgnoredColumn("MOVIES_EILayer\\eilayer2\\nt");//CF
- newIgnoredColumn("MOVIES_EILayer\\boterr");//CG
- newIgnoredColumn("MOVIES_EILayer\\boterr\\sa");//CH
- newIgnoredColumn("MOVIES_EILayer\\boterr\\ni");//CI
+// // Cell ESDU Datas
+// newIgnoredColumn("MOVIES_EILayer\\cellset2");//BO
+// newIgnoredColumn("MOVIES_EILayer\\cellset2\\cellnum");//BP
+// newIgnoredColumn("MOVIES_EILayer\\cellset2\\celltype");//BQ
+// newIgnoredColumn("MOVIES_EILayer\\cellset2\\depthstart");//BR
+// newIgnoredColumn("MOVIES_EILayer\\cellset2\\depthend");//BS
+// newIgnoredColumn("MOVIES_EILayer\\cellset2\\indexstart");//BT
+// newIgnoredColumn("MOVIES_EILayer\\cellset2\\indexend");//BU
+// newMandatoryColumn("MOVIES_EILayer\\cellset2\\datestart", AcousticDataImportModelRow.PROPERTY_CELL_DATE_START);//BV
+// newIgnoredColumn("MOVIES_EILayer\\cellset2\\dateend");//BW
+// newIgnoredColumn("MOVIES_EILayer\\cellset2\\diststart");//BX
+// newIgnoredColumn("MOVIES_EILayer\\cellset2\\distend");//BY
+// newIgnoredColumn("MOVIES_EILayer\\cellset2\\thresholdup");//BZ
+// newIgnoredColumn("MOVIES_EILayer\\cellset2\\thresholdlow");//CA
+// newIgnoredColumn("MOVIES_EILayer\\eilayer2");//CB
+// newMandatoryColumn("MOVIES_EILayer\\eilayer2\\sa", AcousticDataImportModelRow.PROPERTY_CELL_SA);//CC
+// newIgnoredColumn("MOVIES_EILayer\\eilayer2\\sv");//CD
+// newIgnoredColumn("MOVIES_EILayer\\eilayer2\\ni");//CE
+// newIgnoredColumn("MOVIES_EILayer\\eilayer2\\nt");//CF
+// newIgnoredColumn("MOVIES_EILayer\\boterr");//CG
+// newIgnoredColumn("MOVIES_EILayer\\boterr\\sa");//CH
+// newIgnoredColumn("MOVIES_EILayer\\boterr\\ni");//CI
}
@Override
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModelRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModelRow.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/AcousticDataImportModelRow.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -37,28 +37,24 @@
public static final String PROPERTY_SNDNAME = "sndname";
- public static final String PROPERTY_ESDU_CELL_START_DATE = "esduCellStartDate";
+ public static final String PROPERTY_CELL_TYPE = "cellType";
- public static final String PROPERTY_ELEMENTARY_CELL_TYPE = "elementaryCellType";
+ public static final String PROPERTY_CELL_NUM = "cellNum";
- public static final String PROPERTY_ELEMENTARY_CELL_NUM = "elementaryCellNum";
-
public static final String PROPERTY_ESDU_CELL_DATA_LATITUDE = "esduCellDataLatitude";
public static final String PROPERTY_ESDU_CELL_DATA_LONGITUDE = "esduCellDataLongitude";
public static final String PROPERTY_ESDU_CELL_DATA_DEPTH = "esduCellDataDepth";
- public static final String PROPERTY_ESDU_CELL_DATA_TIME = "esduCellDataTime";
+ public static final String PROPERTY_CELL_DATE_START = "cellDateStart";
- public static final String PROPERTY_ESDU_CELL_DATA_ACOUSTIC_DENSITY = "esduCellDataAcousticDensity";
+ public static final String PROPERTY_CELL_DEPTH_START = "cellDepthStart";
- public static final String PROPERTY_ELEMENTARY_CELL_DATA_DEPTH_START = "elementaryCellDataDepthStart";
+ public static final String PROPERTY_CELL_DEPTH_END = "cellDepthEnd";
- public static final String PROPERTY_ELEMENTARY_CELL_DATA_DEPTHEND = "elementaryCellDataDepthend";
+ public static final String PROPERTY_CELL_SA = "cellSa";
- public static final String PROPERTY_ELEMENTARY_CELL_DATA_ACOUSTIC_DENSITY = "elementaryCellDataAcousticDensity";
-
public static final String PROPERTY_TRANSCEIVER_ACQUISITION_PULSE_LENGTH = "transceiverAcquisitionPulseLength";
public static final String PROPERTY_TRANSCEIVER_ACQUISITION_GAIN = "transceiverAcquisitionGain";
@@ -81,7 +77,7 @@
protected String channelName;
- protected Date esduCellStartDate;
+ protected Date cellDateStart;
protected String esduCellDataLatitude;
@@ -91,15 +87,15 @@
protected String esduCellDataAcousticDensity;
- protected int elementaryCellType;
+ protected int cellType;
- protected int elementaryCellNum;
+ protected int cellNum;
- protected String elementaryCellDataDepthStart;
+ protected String cellDepthStart;
- protected String elementaryCellDataDepthEnd;
+ protected String cellDepthEnd;
- protected String elementaryCellDataAcousticDensity;
+ protected String cellSa;
protected float transceiverAcquisitionPulseLength;
@@ -119,8 +115,6 @@
protected float eiThreshold;
- private String esduCellDataTime;
-
public String getSndName() {
return sndName;
}
@@ -137,28 +131,28 @@
this.channelName = channelName;
}
- public Date getEsduCellStartDate() {
- return esduCellStartDate;
+ public Date getCellDateStart() {
+ return cellDateStart;
}
- public void setEsduCellStartDate(Date esduCellStartDate) {
- this.esduCellStartDate = esduCellStartDate;
+ public void setCellDateStart(Date cellDateStart) {
+ this.cellDateStart = cellDateStart;
}
- public int getElementaryCellType() {
- return elementaryCellType;
+ public int getCellType() {
+ return cellType;
}
- public void setElementaryCellType(int elementaryCellType) {
- this.elementaryCellType = elementaryCellType;
+ public void setCellType(int cellType) {
+ this.cellType = cellType;
}
- public int getElementaryCellNum() {
- return elementaryCellNum;
+ public int getCellNum() {
+ return cellNum;
}
- public void setElementaryCellNum(int elementaryCellNum) {
- this.elementaryCellNum = elementaryCellNum;
+ public void setCellNum(int cellNum) {
+ this.cellNum = cellNum;
}
public String getEsduCellDataLatitude() {
@@ -193,28 +187,28 @@
this.esduCellDataAcousticDensity = esduCellDataAcousticDensity;
}
- public String getElementaryCellDataDepthStart() {
- return elementaryCellDataDepthStart;
+ public String getCellDepthStart() {
+ return cellDepthStart;
}
- public void setElementaryCellDataDepthStart(String elementaryCellDataDepthStart) {
- this.elementaryCellDataDepthStart = elementaryCellDataDepthStart;
+ public void setCellDepthStart(String cellDepthStart) {
+ this.cellDepthStart = cellDepthStart;
}
- public String getElementaryCellDataDepthEnd() {
- return elementaryCellDataDepthEnd;
+ public String getCellDepthEnd() {
+ return cellDepthEnd;
}
- public void setElementaryCellDataDepthEnd(String elementaryCellDataDepthEnd) {
- this.elementaryCellDataDepthEnd = elementaryCellDataDepthEnd;
+ public void setCellDepthEnd(String cellDepthEnd) {
+ this.cellDepthEnd = cellDepthEnd;
}
- public String getElementaryCellDataAcousticDensity() {
- return elementaryCellDataAcousticDensity;
+ public String getCellSa() {
+ return cellSa;
}
- public void setElementaryCellDataAcousticDensity(String elementaryCellDataAcousticDensity) {
- this.elementaryCellDataAcousticDensity = elementaryCellDataAcousticDensity;
+ public void setCellSa(String cellSa) {
+ this.cellSa = cellSa;
}
public float getTransceiverAcquisitionPulseLength() {
@@ -289,11 +283,4 @@
this.eiThreshold = eiThreshold;
}
- public String getEsduCellDataTime() {
- return esduCellDataTime;
- }
-
- public void setEsduCellDataTime(String esduCellDataTime) {
- this.esduCellDataTime = esduCellDataTime;
- }
}
Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModel.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModel.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,75 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.csv;
+
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.DepthStratum;
+import fr.ifremer.echobase.entities.references.Species;
+
+import java.util.Map;
+
+/**
+ * Model to import echotypes.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class EchotypeImportModel extends CsvModelUtil.AbstractImportModel<EchotypeImportModelRow> {
+
+ protected final Map<String, Voyage> voyageMap;
+
+ protected final Map<String, DepthStratum> depthStratumMap;
+
+ protected final Map<String, Species> speciesMap;
+
+ public EchotypeImportModel(char separator,
+ Map<String, Voyage> voyageMap,
+ Map<String, DepthStratum> depthStratumMap,
+ Map<String, Species> speciesMap) {
+ super(separator);
+ this.voyageMap = voyageMap;
+ this.depthStratumMap = depthStratumMap;
+ this.speciesMap = speciesMap;
+
+ /*
+ voyage
+ echotypeName
+ DepthStratumID
+ meaning
+ genusSpecies
+ */
+
+ newMandatoryColumn("echotypeName", EchotypeImportModelRow.PROPERTY_NAME);
+ newMandatoryColumn("meaning", EchotypeImportModelRow.PROPERTY_MEANING);
+ newMandatoryColumn(EchotypeImportModelRow.PROPERTY_VOYAGE, CsvModelUtil.newForeignKeyValue(Voyage.class, voyageMap));
+ newMandatoryColumn("DepthStratumID", EchotypeImportModelRow.PROPERTY_DEPTH_STRATUM, CsvModelUtil.newForeignKeyValue(DepthStratum.class, depthStratumMap));
+ newMandatoryColumn("genusSpecies", EchotypeImportModelRow.PROPERTY_SPECIES, CsvModelUtil.newForeignKeyValue(Species.class, speciesMap));
+
+ }
+
+ @Override
+ public EchotypeImportModelRow newEmptyInstance() {
+ return new EchotypeImportModelRow();
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModel.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/csv/EchotypeImportModelRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModelRow.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModelRow.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,101 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.csv;
+
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.DepthStratum;
+import fr.ifremer.echobase.entities.references.Species;
+
+import java.io.Serializable;
+
+/**
+ * Bean used as a row for import of {@link EchotypeImportModel}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class EchotypeImportModelRow implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_VOYAGE = "voyage";
+
+ public static final String PROPERTY_NAME = "name";
+
+ public static final String PROPERTY_MEANING = "meaning";
+
+ public static final String PROPERTY_DEPTH_STRATUM = "depthStratum";
+
+ public static final String PROPERTY_SPECIES = "species";
+
+ protected Voyage voyage;
+
+ protected String name;
+
+ protected String meaning;
+
+ protected DepthStratum depthStratum;
+
+ protected Species species;
+
+ public Voyage getVoyage() {
+ return voyage;
+ }
+
+ public void setVoyage(Voyage voyage) {
+ this.voyage = voyage;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getMeaning() {
+ return meaning;
+ }
+
+ public void setMeaning(String meaning) {
+ this.meaning = meaning;
+ }
+
+ public DepthStratum getDepthStratum() {
+ return depthStratum;
+ }
+
+ public void setDepthStratum(DepthStratum depthStratum) {
+ this.depthStratum = depthStratum;
+ }
+
+ public Species getSpecies() {
+ return species;
+ }
+
+ public void setSpecies(Species species) {
+ this.species = species;
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/EchotypeImportModelRow.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/csv/LengthAgeKeyImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModel.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModel.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,71 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.csv;
+
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.LengthAgeKey;
+import fr.ifremer.echobase.entities.references.Species;
+import fr.ifremer.echobase.entities.references.Strata;
+
+import java.util.Map;
+
+/**
+ * Model to import {@link LengthAgeKey}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class LengthAgeKeyImportModel extends CsvModelUtil.AbstractImportModel<LengthAgeKeyImportModelRow> {
+
+ protected final Map<String, Voyage> voyageMap;
+
+ protected final Map<String, Strata> strataMap;
+
+ protected final Map<String, Species> speciesMap;
+
+ public LengthAgeKeyImportModel(char separator,
+ Map<String, Voyage> voyageMap,
+ Map<String, Strata> strataMap,
+ Map<String, Species> speciesMap) {
+ super(separator);
+ this.voyageMap = voyageMap;
+ this.strataMap = strataMap;
+ this.speciesMap = speciesMap;
+
+ newMandatoryColumn(LengthAgeKeyImportModelRow.PROPERTY_AGE, CsvModelUtil.PRIMITIVE_INTEGER);
+ newMandatoryColumn(LengthAgeKeyImportModelRow.PROPERTY_PERCENT_AT_AGE, CsvModelUtil.PRIMITIVE_FLOAT);
+ newMandatoryColumn(LengthAgeKeyImportModelRow.PROPERTY_LENGTH, CsvModelUtil.PRIMITIVE_FLOAT);
+ newMandatoryColumn(LengthAgeKeyImportModelRow.PROPERTY_METADATA);
+
+ newMandatoryColumn(LengthAgeKeyImportModelRow.PROPERTY_VOYAGE, CsvModelUtil.newForeignKeyValue(Voyage.class, voyageMap));
+ newMandatoryColumn(LengthAgeKeyImportModelRow.PROPERTY_STRATA, CsvModelUtil.newForeignKeyValue(Strata.class, strataMap));
+ newMandatoryColumn(LengthAgeKeyImportModelRow.PROPERTY_SPECIES, CsvModelUtil.newForeignKeyValue(Species.class, speciesMap));
+
+ }
+
+ @Override
+ public LengthAgeKeyImportModelRow newEmptyInstance() {
+ return new LengthAgeKeyImportModelRow();
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModel.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/csv/LengthAgeKeyImportModelRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModelRow.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModelRow.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,126 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.csv;
+
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.LengthAgeKey;
+import fr.ifremer.echobase.entities.references.Species;
+import fr.ifremer.echobase.entities.references.Strata;
+
+import java.io.Serializable;
+
+/**
+ * Bean used as a row for import of {@link LengthAgeKeyImportModel}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class LengthAgeKeyImportModelRow implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_SPECIES = LengthAgeKey.PROPERTY_SPECIES;
+
+ public static final String PROPERTY_AGE = LengthAgeKey.PROPERTY_AGE;
+
+ public static final String PROPERTY_VOYAGE = "voyage";
+
+ public static final String PROPERTY_LENGTH = LengthAgeKey.PROPERTY_LENGTH;
+
+ public static final String PROPERTY_PERCENT_AT_AGE = LengthAgeKey.PROPERTY_PERCENT_AT_AGE;
+
+ public static final String PROPERTY_METADATA = LengthAgeKey.PROPERTY_METADATA;
+
+ public static final String PROPERTY_STRATA = LengthAgeKey.PROPERTY_STRATA;
+
+ protected Species species;
+
+ protected int age;
+
+ protected Voyage voyage;
+
+ protected float length;
+
+ protected float percentAtAge;
+
+ protected String metadata;
+
+ protected Strata strata;
+
+ public Species getSpecies() {
+ return species;
+ }
+
+ public void setSpecies(Species species) {
+ this.species = species;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public Voyage getVoyage() {
+ return voyage;
+ }
+
+ public void setVoyage(Voyage voyage) {
+ this.voyage = voyage;
+ }
+
+ public float getLength() {
+ return length;
+ }
+
+ public void setLength(float length) {
+ this.length = length;
+ }
+
+ public float getPercentAtAge() {
+ return percentAtAge;
+ }
+
+ public void setPercentAtAge(float percentAtAge) {
+ this.percentAtAge = percentAtAge;
+ }
+
+ public String getMetadata() {
+ return metadata;
+ }
+
+ public void setMetadata(String metadata) {
+ this.metadata = metadata;
+ }
+
+ public Strata getStrata() {
+ return strata;
+ }
+
+ public void setStrata(Strata strata) {
+ this.strata = strata;
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthAgeKeyImportModelRow.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/csv/LengthWeightKeyImportModel.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModel.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModel.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,76 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.csv;
+
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.LengthWeightKey;
+import fr.ifremer.echobase.entities.references.SizeCategory;
+import fr.ifremer.echobase.entities.references.Species;
+
+import java.util.Map;
+
+/**
+ * Model to import {@link LengthWeightKey}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class LengthWeightKeyImportModel extends CsvModelUtil.AbstractImportModel<LengthWeightKeyImportModelRow> {
+
+ protected final Map<String, Voyage> voyageMap;
+
+ protected final Map<String, SizeCategory> sizeCategoryMap;
+
+ protected final Map<String, Species> speciesMap;
+
+ public LengthWeightKeyImportModel(char separator,
+ Map<String, Voyage> voyageMap,
+ Map<String, SizeCategory> sizeCategoryMap,
+ Map<String, Species> speciesMap) {
+ super(separator);
+ this.voyageMap = voyageMap;
+ this.sizeCategoryMap = sizeCategoryMap;
+ this.speciesMap = speciesMap;
+
+ /*
+ voyage
+ sizeCategory
+ aParameter
+ bParameter
+ codeMemo
+ */
+
+ newMandatoryColumn(LengthWeightKeyImportModelRow.PROPERTY_APARAMETER, CsvModelUtil.PRIMITIVE_FLOAT);
+ newMandatoryColumn(LengthWeightKeyImportModelRow.PROPERTY_BPARAMETER, CsvModelUtil.PRIMITIVE_FLOAT);
+
+ newMandatoryColumn(LengthWeightKeyImportModelRow.PROPERTY_VOYAGE, CsvModelUtil.newForeignKeyValue(Voyage.class, voyageMap));
+ newMandatoryColumn(LengthWeightKeyImportModelRow.PROPERTY_SIZE_CATEGORY, CsvModelUtil.newForeignKeyValue(SizeCategory.class, sizeCategoryMap));
+ newMandatoryColumn(LengthWeightKeyImportModelRow.PROPERTY_SPECIES, CsvModelUtil.newForeignKeyValue(Species.class, speciesMap));
+ }
+
+ @Override
+ public LengthWeightKeyImportModelRow newEmptyInstance() {
+ return new LengthWeightKeyImportModelRow();
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModel.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/csv/LengthWeightKeyImportModelRow.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModelRow.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModelRow.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,102 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.csv;
+
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.LengthWeightKey;
+import fr.ifremer.echobase.entities.references.SizeCategory;
+import fr.ifremer.echobase.entities.references.Species;
+
+import java.io.Serializable;
+
+/**
+ * Bean used as a row for import of {@link LengthWeightKeyImportModel}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class LengthWeightKeyImportModelRow implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final String PROPERTY_VOYAGE = "voyage";
+
+ public static final String PROPERTY_SPECIES = "species";
+
+ public static final String PROPERTY_SIZE_CATEGORY = "sizeCategory";
+
+ public static final String PROPERTY_APARAMETER = LengthWeightKey.PROPERTY_APARAMETER;
+
+ public static final String PROPERTY_BPARAMETER = LengthWeightKey.PROPERTY_BPARAMETER;
+
+ protected Species species;
+
+ protected SizeCategory sizeCategory;
+
+ protected Voyage voyage;
+
+ protected float aParameter;
+
+ protected float bParameter;
+
+ public Species getSpecies() {
+ return species;
+ }
+
+ public void setSpecies(Species species) {
+ this.species = species;
+ }
+
+ public SizeCategory getSizeCategory() {
+ return sizeCategory;
+ }
+
+ public void setSizeCategory(SizeCategory sizeCategory) {
+ this.sizeCategory = sizeCategory;
+ }
+
+ public Voyage getVoyage() {
+ return voyage;
+ }
+
+ public void setVoyage(Voyage voyage) {
+ this.voyage = voyage;
+ }
+
+ public float getaParameter() {
+ return aParameter;
+ }
+
+ public void setaParameter(float aParameter) {
+ this.aParameter = aParameter;
+ }
+
+ public float getbParameter() {
+ return bParameter;
+ }
+
+ public void setbParameter(float bParameter) {
+ this.bParameter = bParameter;
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/csv/LengthWeightKeyImportModelRow.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
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 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-services/src/main/resources/i18n/echobase-services_fr_FR.properties 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,22 +1,27 @@
echobase.common.associationFile=Fichier d'associations de cellules
+echobase.common.cellPositionReference.end=Début
+echobase.common.cellPositionReference.mid=Milieu
+echobase.common.cellPositionReference.start=Fin
+echobase.common.commonDataImportMode.all=Import Voyage / Transit / Transects
+echobase.common.commonDataImportMode.transect=Import Transects
echobase.common.echotypeFile=Fichier echotype
+echobase.common.gearMetadataFile=Fichier Méta-données d'engin
echobase.common.importDataMode.accousticData=Import des données accoustiques
-echobase.common.importDataMode.accousticRegionData=Import des cellules régions (accoustique)
-echobase.common.importDataMode.catchesData=Import des données de pêche non biométrie
-echobase.common.importDataMode.catchesIndividualData=Import des données de pêche biométire
-echobase.common.importDataMode.catchesReferences=Import du référentiel pêche
-echobase.common.importDataMode.commonDataComplete=Import de données communes
-echobase.common.importDataMode.commonDataFromTransect=Import des données communes (à partir du transect)
+echobase.common.importDataMode.catchesData=Import des données de pêche
+echobase.common.importDataMode.commonData=Import Voyage / Transit / Transect
+echobase.common.importDataMode.operation=Import des opérations
+echobase.common.importDataMode.results=Import des résultats
echobase.common.importDbFile=Fichier d'import (zip)
-echobase.common.individualDataFile=Fichier de données individuelles
echobase.common.lengthAgeKeyFile=Fichier de relation Taille-Age
echobase.common.lengthWeightKeyFile=Fichier de relation Taille-Poids
echobase.common.moviesFile=Fichier Movies
+echobase.common.operationFile=Fichier Opérations
+echobase.common.operationMetadataFile=Fichier Méta-données opération
echobase.common.regionsFile=Fichier des régions
-echobase.common.tblMensurationClasseFile=Fichier de classes de mensuration
-echobase.common.tblMensurationFile=Fichier de mensuration
-echobase.common.tlbeStationFile=Fichier des stations
+echobase.common.resultsImportMode.acoustic=Import des résultats acoustiques
+echobase.common.resultsImportMode.voyage=Import des résultats du voyage
+echobase.common.sampleDatafile=Fichier SampleData
+echobase.common.sampleFile=Fichier Sample
echobase.common.transectFile=Fichier des transects
echobase.common.transitFile=Fichier des transits
-echobase.common.voyageFile=Fichier des voayges
-echobase.common.xtblTriFile=Fichier Tri
+echobase.common.voyageFile=Fichier des voyages
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/AbstractLaunchImport.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -72,7 +72,14 @@
log.info("Start imports for " + getModel());
}
- service.startImport(model, getEchoBaseSession().getEchoBaseUser());
+ try {
+ service.startImport(model, getEchoBaseSession().getEchoBaseUser());
+ } catch (Exception e) {
+
+ if (log.isErrorEnabled()) {
+ log.error("Could not do import ", e);
+ }
+ }
}
@Override
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -27,6 +27,8 @@
import fr.ifremer.echobase.entities.references.Vessel;
import fr.ifremer.echobase.services.EchoBaseServiceSupport;
import fr.ifremer.echobase.services.configurations.AccousticDataImportConfiguration;
+import fr.ifremer.echobase.services.configurations.CellPositionReference;
+import fr.ifremer.echobase.services.configurations.CommonDataImportMode;
import java.io.File;
import java.util.Map;
@@ -47,6 +49,8 @@
/** Universe of existing vessels. */
protected Map<String, String> vessels;
+ protected Map<String, String> cellPositionReferences;
+
public ConfigureAccousticData() {
super(AccousticDataImportConfiguration.class);
}
@@ -66,7 +70,13 @@
voyages = loadSortAndDecorate(service, Voyage.class);
vessels = loadSortAndDecorate(service, Vessel.class);
+ cellPositionReferences = decorateEnums(CellPositionReference.values());
+ if (getModel().getCellPositionReference() == null) {
+
+ getModel().setCellPositionReference(CellPositionReference.START);
+ }
+
return INPUT;
}
@@ -78,6 +88,10 @@
return vessels;
}
+ public Map<String, String> getCellPositionReferences() {
+ return cellPositionReferences;
+ }
+
public void setMoviesFile(File file) {
getModel().getMoviesFile().setFile(file);
}
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticRegionData.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticRegionData.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticRegionData.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,104 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.importData;
-
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.entities.references.Vessel;
-import fr.ifremer.echobase.services.EchoBaseServiceSupport;
-import fr.ifremer.echobase.services.configurations.AccousticRegionDataImportConfiguration;
-
-import java.io.File;
-import java.util.Map;
-
-/**
- * Configure a "accoustic region data" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class ConfigureAccousticRegionData extends AbstractConfigureImport<AccousticRegionDataImportConfiguration> {
-
- private static final long serialVersionUID = 1L;
-
- /** Universe of existing voyages. */
- protected Map<String, String> voyages;
-
- /** Universe of existing vessels. */
- protected Map<String, String> vessels;
-
- public ConfigureAccousticRegionData() {
- super(AccousticRegionDataImportConfiguration.class);
- }
-
- @Override
- protected AccousticRegionDataImportConfiguration createModel() {
- return new AccousticRegionDataImportConfiguration(getLocale());
- }
-
- @Override
- public String input() throws Exception {
-
- super.input();
-
- EchoBaseServiceSupport service =
- newService(EchoBaseServiceSupport.class);
-
- voyages = loadSortAndDecorate(service, Voyage.class);
- vessels = loadSortAndDecorate(service, Vessel.class);
-
- return INPUT;
- }
-
- public Map<String, String> getVoyages() {
- return voyages;
- }
-
- public Map<String, String> getVessels() {
- return vessels;
- }
-
- public void setRegionsFile(File file) {
- getModel().getRegionsFile().setFile(file);
- }
-
- public void setRegionsFileContentType(String contentType) {
- getModel().getRegionsFile().setContentType(contentType);
- }
-
- public void setRegionsFileFileName(String fileName) {
- getModel().getRegionsFile().setFileName(fileName);
- }
-
- public void setAssociationFile(File file) {
- getModel().getAssociationFile().setFile(file);
- }
-
- public void setAssociationFileContentType(String contentType) {
- getModel().getAssociationFile().setContentType(contentType);
- }
-
- public void setAssociationFileFileName(String fileName) {
- getModel().getAssociationFile().setFileName(fileName);
- }
-}
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -24,6 +24,7 @@
package fr.ifremer.echobase.ui.actions.importData;
import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.Vessel;
import fr.ifremer.echobase.services.EchoBaseServiceSupport;
import fr.ifremer.echobase.services.configurations.CatchesDataImportConfiguration;
@@ -43,6 +44,9 @@
/** Universe of existing voyages. */
protected Map<String, String> voyages;
+ /** Universe of existing vessels. */
+ protected Map<String, String> vessels;
+
public ConfigureCatchesData() {
super(CatchesDataImportConfiguration.class);
}
@@ -61,6 +65,7 @@
newService(EchoBaseServiceSupport.class);
voyages = loadSortAndDecorate(service, Voyage.class);
+ vessels = loadSortAndDecorate(service, Vessel.class);
return INPUT;
}
@@ -69,51 +74,31 @@
return voyages;
}
- public void setTlbeStationFile(File file) {
- getModel().getTlbeStationFile().setFile(file);
+ public Map<String, String> getVessels() {
+ return vessels;
}
- public void setTlbeStationFileContentType(String contentType) {
- getModel().getTlbeStationFile().setContentType(contentType);
+ public void setSampleFile(File file) {
+ getModel().getSampleFile().setFile(file);
}
- public void setTlbeStationFileFileName(String fileName) {
- getModel().getTlbeStationFile().setFileName(fileName);
+ public void setSampleFileContentType(String contentType) {
+ getModel().getSampleFile().setContentType(contentType);
}
- public void setXtblTriFile(File file) {
- getModel().getXtblTriFile().setFile(file);
+ public void setSampleFileFileName(String fileName) {
+ getModel().getSampleFile().setFileName(fileName);
}
- public void setXtblTriFileContentType(String contentType) {
- getModel().getXtblTriFile().setContentType(contentType);
+ public void setSampleDataFile(File file) {
+ getModel().getSampleDataFile().setFile(file);
}
- public void setXtblTriFileFileName(String fileName) {
- getModel().getXtblTriFile().setFileName(fileName);
+ public void setSampleDataFileContentType(String contentType) {
+ getModel().getSampleDataFile().setContentType(contentType);
}
- public void setTblMensurationFile(File file) {
- getModel().getTblMensurationFile().setFile(file);
+ public void setSampleDataFileFileName(String fileName) {
+ getModel().getSampleDataFile().setFileName(fileName);
}
-
- public void setTblMensurationFileContentType(String contentType) {
- getModel().getTblMensurationFile().setContentType(contentType);
- }
-
- public void setTblMensurationFileFileName(String fileName) {
- getModel().getTblMensurationFile().setFileName(fileName);
- }
-
- public void setTblMensurationClasseFile(File file) {
- getModel().getTblMensurationClasseFile().setFile(file);
- }
-
- public void setTblMensurationClasseFileContentType(String contentType) {
- getModel().getTblMensurationClasseFile().setContentType(contentType);
- }
-
- public void setTblMensurationClasseFileFileName(String fileName) {
- getModel().getTblMensurationClasseFile().setFileName(fileName);
- }
}
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesIndividualData.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesIndividualData.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesIndividualData.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,83 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.importData;
-
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.services.EchoBaseServiceSupport;
-import fr.ifremer.echobase.services.configurations.CatchesIndividualDataImportConfiguration;
-
-import java.io.File;
-import java.util.Map;
-
-/**
- * Configure a "catches individual data" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class ConfigureCatchesIndividualData extends AbstractConfigureImport<CatchesIndividualDataImportConfiguration> {
-
- private static final long serialVersionUID = 1L;
-
- /** Universe of existing voyages. */
- protected Map<String, String> voyages;
-
- public ConfigureCatchesIndividualData() {
- super(CatchesIndividualDataImportConfiguration.class);
- }
-
- @Override
- protected CatchesIndividualDataImportConfiguration createModel() {
- return new CatchesIndividualDataImportConfiguration(getLocale());
- }
-
- @Override
- public String input() throws Exception {
-
- super.input();
-
- EchoBaseServiceSupport service =
- newService(EchoBaseServiceSupport.class);
-
- voyages = loadSortAndDecorate(service, Voyage.class);
-
- return INPUT;
- }
-
- public Map<String, String> getVoyages() {
- return voyages;
- }
-
- public void setIndividualDataFile(File file) {
- getModel().getIndividualDataFile().setFile(file);
- }
-
- public void setIndividualDataFileContentType(String contentType) {
- getModel().getIndividualDataFile().setContentType(contentType);
- }
-
- public void setIndividualDataFileFileName(String fileName) {
- getModel().getIndividualDataFile().setFileName(fileName);
- }
-}
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesReference.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesReference.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesReference.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,72 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.importData;
-
-import fr.ifremer.echobase.services.configurations.CatchesReferenceImportConfiguration;
-
-import java.io.File;
-
-/**
- * Configure a accoustic data import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class ConfigureCatchesReference extends AbstractConfigureImport<CatchesReferenceImportConfiguration> {
-
- private static final long serialVersionUID = 1L;
-
- public ConfigureCatchesReference() {
- super(CatchesReferenceImportConfiguration.class);
- }
-
- @Override
- protected CatchesReferenceImportConfiguration createModel() {
- return new CatchesReferenceImportConfiguration(getLocale());
- }
-
- public void setLengthAgeKeyFile(File file) {
- getModel().getLengthAgeKeyFile().setFile(file);
- }
-
- public void setLengthAgeKeyFileContentType(String contentType) {
- getModel().getLengthAgeKeyFile().setContentType(contentType);
- }
-
- public void setLengthAgeKeyFileFileName(String fileName) {
- getModel().getLengthAgeKeyFile().setFileName(fileName);
- }
-
- public void setLengthWeightKeyFile(File file) {
- getModel().getLengthWeightKeyFile().setFile(file);
- }
-
- public void setLengthWeightKeyFileContentType(String contentType) {
- getModel().getLengthWeightKeyFile().setContentType(contentType);
- }
-
- public void setLengthWeightKeyFileFileName(String fileName) {
- getModel().getLengthWeightKeyFile().setFileName(fileName);
- }
-}
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java (from rev 303, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataComplete.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,159 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.importData;
+
+import com.opensymphony.xwork2.interceptor.annotations.InputConfig;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.AreaOfOperation;
+import fr.ifremer.echobase.entities.references.Mission;
+import fr.ifremer.echobase.entities.references.Vessel;
+import fr.ifremer.echobase.services.EchoBaseServiceSupport;
+import fr.ifremer.echobase.services.configurations.CommonDataImportConfiguration;
+import fr.ifremer.echobase.services.configurations.CommonDataImportMode;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ * Configure a accoustic data import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class ConfigureCommonData extends AbstractConfigureImport<CommonDataImportConfiguration> {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Universe of existing missions. */
+ protected Map<String, String> missions;
+
+ /** Universe of existing voyages. */
+ protected Map<String, String> voyages;
+
+ /** Universe of existing area of operations. */
+ protected Map<String, String> areaOfOperations;
+
+ /** Universe of existing vessels. */
+ protected Map<String, String> vessels;
+
+ /** Universe of possible import modes. */
+ protected Map<String, String> importModes;
+
+ public ConfigureCommonData() {
+ super(CommonDataImportConfiguration.class);
+ }
+
+ @Override
+ protected CommonDataImportConfiguration createModel() {
+ return new CommonDataImportConfiguration(getLocale());
+ }
+
+ @Override
+ public String input() throws Exception {
+
+ super.input();
+
+ EchoBaseServiceSupport service =
+ newService(EchoBaseServiceSupport.class);
+
+ missions = loadSortAndDecorate(service, Mission.class);
+ voyages = loadSortAndDecorate(service, Voyage.class);
+ areaOfOperations = loadSortAndDecorate(service, AreaOfOperation.class);
+ vessels = loadSortAndDecorate(service, Vessel.class);
+ importModes = decorateEnums(CommonDataImportMode.values());
+
+ if (getModel().getImportMode() == null) {
+
+ getModel().setImportMode(CommonDataImportMode.ALL);
+ }
+ return INPUT;
+ }
+
+ @InputConfig(methodName = "input")
+ public String modeAll() {
+ return SUCCESS;
+ }
+
+ @InputConfig(methodName = "input")
+ public String modeTransect() {
+ return SUCCESS;
+ }
+
+ public Map<String, String> getMissions() {
+ return missions;
+ }
+
+ public Map<String, String> getVoyages() {
+ return voyages;
+ }
+
+ public Map<String, String> getAreaOfOperations() {
+ return areaOfOperations;
+ }
+
+ public Map<String, String> getVessels() {
+ return vessels;
+ }
+
+ public Map<String, String> getImportModes() {
+ return importModes;
+ }
+
+ public void setVoyageFile(File file) {
+ getModel().getVoyageFile().setFile(file);
+ }
+
+ public void setVoyageFileContentType(String contentType) {
+ getModel().getVoyageFile().setContentType(contentType);
+ }
+
+ public void setVoyageFileFileName(String fileName) {
+ getModel().getVoyageFile().setFileName(fileName);
+ }
+
+ public void setTransitFile(File file) {
+ getModel().getTransitFile().setFile(file);
+ }
+
+ public void setTransitFileContentType(String contentType) {
+ getModel().getTransitFile().setContentType(contentType);
+ }
+
+ public void setTransitFileFileName(String fileName) {
+ getModel().getTransitFile().setFileName(fileName);
+ }
+
+ public void setTransectFile(File file) {
+ getModel().getTransectFile().setFile(file);
+ }
+
+ public void setTransectFileContentType(String contentType) {
+ getModel().getTransectFile().setContentType(contentType);
+ }
+
+ public void setTransectFileFileName(String fileName) {
+ getModel().getTransectFile().setFileName(fileName);
+ }
+
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataComplete.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataComplete.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataComplete.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,196 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.importData;
-
-import com.opensymphony.xwork2.interceptor.annotations.InputConfig;
-import fr.ifremer.echobase.entities.references.AreaOfOperation;
-import fr.ifremer.echobase.entities.references.Mission;
-import fr.ifremer.echobase.entities.references.MissionImpl;
-import fr.ifremer.echobase.entities.references.Vessel;
-import fr.ifremer.echobase.services.CommonDataCompleteImportService;
-import fr.ifremer.echobase.services.EchoBaseServiceSupport;
-import fr.ifremer.echobase.services.configurations.CommonDataCompleteImportConfiguration;
-
-import java.io.File;
-import java.util.Map;
-
-/**
- * Configure a accoustic data import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class ConfigureCommonDataComplete extends AbstractConfigureImport<CommonDataCompleteImportConfiguration> {
-
- private static final long serialVersionUID = 1L;
-
- /** Universe of existing missions. */
- protected Map<String, String> missions;
-
- /** Universe of existing area of operations. */
- protected Map<String, String> areaOfOperations;
-
- /** Universe of existing vessels. */
- protected Map<String, String> vessels;
-
- /** Universe of possible import modes. */
- protected Map<String, String> importModes;
-
- /** Selected import mode. */
- protected SelectedMissionMode importMode;
-
- /** mission to create (if asked to create a new mission). */
- protected Mission mission;
-
- public ConfigureCommonDataComplete() {
- super(CommonDataCompleteImportConfiguration.class);
- }
-
- @Override
- protected CommonDataCompleteImportConfiguration createModel() {
- return new CommonDataCompleteImportConfiguration(getLocale());
- }
-
- @Override
- public String input() throws Exception {
-
- super.input();
-
- EchoBaseServiceSupport service =
- newService(EchoBaseServiceSupport.class);
-
- missions = loadSortAndDecorate(service, Mission.class);
- areaOfOperations = loadSortAndDecorate(service, AreaOfOperation.class);
- vessels = loadSortAndDecorate(service, Vessel.class);
-
- importModes = decorateEnums(SelectedMissionMode.values());
-
- if (importMode == null) {
- importMode = SelectedMissionMode.USE_EXISTING_MISSION;
- }
-
- return INPUT;
- }
-
- @InputConfig(methodName = "input")
- @Override
- public String execute() throws Exception {
-
- super.execute();
-
- if (importMode == SelectedMissionMode.CREATE_NEW_MISSION) {
-
- // create voyage in db
- CommonDataCompleteImportService service =
- newService(CommonDataCompleteImportService.class);
-
- Mission missionToCreate = getMission();
-
- Mission missionSaved = service.createMission(missionToCreate);
-
- getModel().setMissionId(missionSaved.getTopiaId());
- }
-
- return SUCCESS;
- }
-
- public Map<String, String> getMissions() {
- return missions;
- }
-
- public Map<String, String> getAreaOfOperations() {
- return areaOfOperations;
- }
-
- public Map<String, String> getVessels() {
- return vessels;
- }
-
- public Map<String, String> getImportModes() {
- return importModes;
- }
-
- public SelectedMissionMode getImportMode() {
- return importMode;
- }
-
- public Mission getMission() {
- if (mission == null) {
- mission = new MissionImpl();
- }
- return mission;
- }
-
- public void setImportMode(SelectedMissionMode importMode) {
- this.importMode = importMode;
- }
-
- public void setVoyageFile(File file) {
- getModel().getVoyageFile().setFile(file);
- }
-
- public void setVoyageFileContentType(String contentType) {
- getModel().getVoyageFile().setContentType(contentType);
- }
-
- public void setVoyageFileFileName(String fileName) {
- getModel().getVoyageFile().setFileName(fileName);
- }
-
- public void setTransitFile(File file) {
- getModel().getTransitFile().setFile(file);
- }
-
- public void setTransitFileContentType(String contentType) {
- getModel().getTransitFile().setContentType(contentType);
- }
-
- public void setTransitFileFileName(String fileName) {
- getModel().getTransitFile().setFileName(fileName);
- }
-
- public void setTransectFile(File file) {
- getModel().getTransectFile().setFile(file);
- }
-
- public void setTransectFileContentType(String contentType) {
- getModel().getTransectFile().setContentType(contentType);
- }
-
- public void setTransectFileFileName(String fileName) {
- getModel().getTransectFile().setFileName(fileName);
- }
-
- public void setEchotypeFile(File file) {
- getModel().getEchotypeFile().setFile(file);
- }
-
- public void setEchotypeFileContentType(String contentType) {
- getModel().getEchotypeFile().setContentType(contentType);
- }
-
- public void setEchotypeFileFileName(String fileName) {
- getModel().getEchotypeFile().setFileName(fileName);
- }
-}
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataFromTransect.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataFromTransect.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataFromTransect.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,92 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.importData;
-
-import fr.ifremer.echobase.entities.data.Voyage;
-import fr.ifremer.echobase.entities.references.Vessel;
-import fr.ifremer.echobase.services.EchoBaseServiceSupport;
-import fr.ifremer.echobase.services.configurations.CommonDataFromTransectImportConfiguration;
-
-import java.io.File;
-import java.util.Map;
-
-/**
- * Configure a "common data from transect" import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class ConfigureCommonDataFromTransect extends AbstractConfigureImport<CommonDataFromTransectImportConfiguration> {
-
- private static final long serialVersionUID = 1L;
-
- /** Universe of existing voyages. */
- protected Map<String, String> voyages;
-
- /** Universe of existing vessels. */
- protected Map<String, String> vessels;
-
- public ConfigureCommonDataFromTransect() {
- super(CommonDataFromTransectImportConfiguration.class);
- }
-
- @Override
- protected CommonDataFromTransectImportConfiguration createModel() {
- return new CommonDataFromTransectImportConfiguration(getLocale());
- }
-
- @Override
- public String input() throws Exception {
-
- super.input();
-
- EchoBaseServiceSupport service =
- newService(EchoBaseServiceSupport.class);
-
- voyages = loadSortAndDecorate(service, Voyage.class);
- vessels = loadSortAndDecorate(service, Vessel.class);
-
- return INPUT;
- }
-
- public Map<String, String> getVoyages() {
- return voyages;
- }
-
- public Map<String, String> getVessels() {
- return vessels;
- }
-
- public void setTransectFile(File file) {
- getModel().getTransectFile().setFile(file);
- }
-
- public void setTransectFileContentType(String contentType) {
- getModel().getTransectFile().setContentType(contentType);
- }
-
- public void setTransectFileFileName(String fileName) {
- getModel().getTransectFile().setFileName(fileName);
- }
-}
Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,116 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.importData;
+
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.Vessel;
+import fr.ifremer.echobase.services.EchoBaseServiceSupport;
+import fr.ifremer.echobase.services.configurations.OperationImportConfiguration;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class ConfigureOperation extends AbstractConfigureImport<OperationImportConfiguration> {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Universe of existing voyages. */
+ protected Map<String, String> voyages;
+
+ /** Universe of existing vessels. */
+ protected Map<String, String> vessels;
+
+ public ConfigureOperation() {
+ super(OperationImportConfiguration.class);
+ }
+
+ @Override
+ protected OperationImportConfiguration createModel() {
+ return new OperationImportConfiguration(getLocale());
+ }
+
+ @Override
+ public String input() throws Exception {
+
+ super.input();
+
+ EchoBaseServiceSupport service =
+ newService(EchoBaseServiceSupport.class);
+
+ voyages = loadSortAndDecorate(service, Voyage.class);
+ vessels = loadSortAndDecorate(service, Vessel.class);
+
+ return INPUT;
+ }
+
+ public Map<String, String> getVoyages() {
+ return voyages;
+ }
+
+ public Map<String, String> getVessels() {
+ return vessels;
+ }
+
+ public void setOperationFile(File file) {
+ getModel().getOperationFile().setFile(file);
+ }
+
+ public void setOperationFileContentType(String contentType) {
+ getModel().getOperationFile().setContentType(contentType);
+ }
+
+ public void setOperationFileFileName(String fileName) {
+ getModel().getOperationFile().setFileName(fileName);
+ }
+
+ public void setOperationMetadataFile(File file) {
+ getModel().getOperationMetadataFile().setFile(file);
+ }
+
+ public void setOperationMetadataFileContentType(String contentType) {
+ getModel().getOperationMetadataFile().setContentType(contentType);
+ }
+
+ public void setOperationMetadataFileFileName(String fileName) {
+ getModel().getOperationMetadataFile().setFileName(fileName);
+ }
+
+ public void setGearMetadataFile(File file) {
+ getModel().getGearMetadataFile().setFile(file);
+ }
+
+ public void setGearMetadataFileContentType(String contentType) {
+ getModel().getGearMetadataFile().setContentType(contentType);
+ }
+
+ public void setGearMetadataFileFileName(String fileName) {
+ getModel().getGearMetadataFile().setFileName(fileName);
+ }
+}
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java (from rev 303, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticRegionData.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,164 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.importData;
+
+import com.opensymphony.xwork2.interceptor.annotations.InputConfig;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.Vessel;
+import fr.ifremer.echobase.services.EchoBaseServiceSupport;
+import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration;
+import fr.ifremer.echobase.services.configurations.ResultsImportMode;
+
+import java.io.File;
+import java.util.Map;
+
+/**
+ * Configure a "accoustic region data" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class ConfigureResults extends AbstractConfigureImport<ResultsImportConfiguration> {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Universe of existing voyages. */
+ protected Map<String, String> voyages;
+
+ /** Universe of existing vessels. */
+ protected Map<String, String> vessels;
+
+ /** Universe of possible import modes. */
+ protected Map<String, String> importModes;
+
+ public ConfigureResults() {
+ super(ResultsImportConfiguration.class);
+ }
+
+ @Override
+ protected ResultsImportConfiguration createModel() {
+ return new ResultsImportConfiguration(getLocale());
+ }
+
+ @Override
+ public String input() throws Exception {
+
+ super.input();
+
+ EchoBaseServiceSupport service =
+ newService(EchoBaseServiceSupport.class);
+
+ voyages = loadSortAndDecorate(service, Voyage.class);
+ vessels = loadSortAndDecorate(service, Vessel.class);
+ importModes = decorateEnums(ResultsImportMode.values());
+
+ if (getModel().getImportMode() == null) {
+
+ getModel().setImportMode(ResultsImportMode.VOYAGE);
+ }
+ return INPUT;
+ }
+
+ @InputConfig(methodName = "input")
+ public String modeVoyage() {
+ return SUCCESS;
+ }
+
+ @InputConfig(methodName = "input")
+ public String modeAcoustic() {
+ return SUCCESS;
+ }
+
+ public Map<String, String> getVoyages() {
+ return voyages;
+ }
+
+ public Map<String, String> getVessels() {
+ return vessels;
+ }
+
+ public Map<String, String> getImportModes() {
+ return importModes;
+ }
+
+ public void setRegionsFile(File file) {
+ getModel().getRegionsFile().setFile(file);
+ }
+
+ public void setRegionsFileContentType(String contentType) {
+ getModel().getRegionsFile().setContentType(contentType);
+ }
+
+ public void setRegionsFileFileName(String fileName) {
+ getModel().getRegionsFile().setFileName(fileName);
+ }
+
+ public void setAssociationFile(File file) {
+ getModel().getAssociationFile().setFile(file);
+ }
+
+ public void setAssociationFileContentType(String contentType) {
+ getModel().getAssociationFile().setContentType(contentType);
+ }
+
+ public void setAssociationFileFileName(String fileName) {
+ getModel().getAssociationFile().setFileName(fileName);
+ }
+
+ public void setLengthAgeKeyFile(File file) {
+ getModel().getLengthAgeKeyFile().setFile(file);
+ }
+
+ public void setLengthAgeKeyFileContentType(String contentType) {
+ getModel().getLengthAgeKeyFile().setContentType(contentType);
+ }
+
+ public void setLengthAgeKeyFileFileName(String fileName) {
+ getModel().getLengthAgeKeyFile().setFileName(fileName);
+ }
+
+ public void setLengthWeightKeyFile(File file) {
+ getModel().getLengthWeightKeyFile().setFile(file);
+ }
+
+ public void setLengthWeightKeyFileContentType(String contentType) {
+ getModel().getLengthWeightKeyFile().setContentType(contentType);
+ }
+
+ public void setLengthWeightKeyFileFileName(String fileName) {
+ getModel().getLengthWeightKeyFile().setFileName(fileName);
+ }
+
+ public void setEchotypeFile(File file) {
+ getModel().getEchotypeFile().setFile(file);
+ }
+
+ public void setEchotypeFileContentType(String contentType) {
+ getModel().getEchotypeFile().setContentType(contentType);
+ }
+
+ public void setEchotypeFileFileName(String fileName) {
+ getModel().getEchotypeFile().setFileName(fileName);
+ }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/ConfigureResults.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/CreateMission.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/CreateMission.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/CreateMission.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,82 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.importData;
+
+import com.google.common.base.Preconditions;
+import fr.ifremer.echobase.entities.references.Mission;
+import fr.ifremer.echobase.entities.references.MissionImpl;
+import fr.ifremer.echobase.services.CommonDataImportService;
+import fr.ifremer.echobase.services.MissionNameAlreadyExistException;
+import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * To create a new mission
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class CreateMission extends EchoBaseActionSupport {
+
+ private static final long serialVersionUID = 1L;
+
+ /** Logger. */
+ private static final Log log = LogFactory.getLog(CreateMission.class);
+
+ /** Mission to create. */
+ protected Mission mission;
+
+ public Mission getMission() {
+ if (mission == null) {
+ mission = new MissionImpl();
+ }
+ return mission;
+ }
+
+ @Override
+ public String execute() throws Exception {
+
+ Preconditions.checkNotNull(mission);
+
+ String result = INPUT;
+
+ try {
+ CommonDataImportService service =
+ newService(CommonDataImportService.class);
+ Mission missionSaved = service.createMission(mission);
+
+ if (log.isInfoEnabled()) {
+ log.info("Created mission : " + missionSaved.getTopiaId());
+ }
+ getTransaction().commitTransaction();
+ addActionMessage(_("echobase.information.mission.created", missionSaved.getName()));
+ result = SUCCESS;
+ } catch (MissionNameAlreadyExistException e) {
+ addFieldError("mission.name",
+ _("echobase.error.mission.name.already.exist"));
+ }
+ return result;
+ }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/CreateMission.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticRegionData.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticRegionData.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticRegionData.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,43 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.importData;
-
-import fr.ifremer.echobase.services.AccousticRegionDataImportService;
-import fr.ifremer.echobase.services.configurations.AccousticRegionDataImportConfiguration;
-
-/**
- * Configure a accoustic data import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class LaunchAccousticRegionData extends AbstractLaunchImport<AccousticRegionDataImportConfiguration, AccousticRegionDataImportService> {
-
- private static final long serialVersionUID = 1L;
-
- public LaunchAccousticRegionData() {
- super(AccousticRegionDataImportConfiguration.class, AccousticRegionDataImportService.class);
- }
-
-}
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesIndividualData.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesIndividualData.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesIndividualData.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,43 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.importData;
-
-import fr.ifremer.echobase.services.CatchesIndividualDataImportService;
-import fr.ifremer.echobase.services.configurations.CatchesIndividualDataImportConfiguration;
-
-/**
- * Configure a accoustic data import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class LaunchCatchesIndividualData extends AbstractLaunchImport<CatchesIndividualDataImportConfiguration, CatchesIndividualDataImportService> {
-
- private static final long serialVersionUID = 1L;
-
- public LaunchCatchesIndividualData() {
- super(CatchesIndividualDataImportConfiguration.class, CatchesIndividualDataImportService.class);
- }
-
-}
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesReference.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesReference.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCatchesReference.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,43 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.importData;
-
-import fr.ifremer.echobase.services.CatchesReferenceImportService;
-import fr.ifremer.echobase.services.configurations.CatchesReferenceImportConfiguration;
-
-/**
- * Configure a accoustic data import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class LaunchCatchesReference extends AbstractLaunchImport<CatchesReferenceImportConfiguration, CatchesReferenceImportService> {
-
- private static final long serialVersionUID = 1L;
-
- public LaunchCatchesReference() {
- super(CatchesReferenceImportConfiguration.class, CatchesReferenceImportService.class);
- }
-
-}
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java (from rev 303, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonDataComplete.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,43 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.importData;
+
+import fr.ifremer.echobase.services.CommonDataImportService;
+import fr.ifremer.echobase.services.configurations.CommonDataImportConfiguration;
+
+/**
+ * Configure a accoustic data import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class LaunchCommonData extends AbstractLaunchImport<CommonDataImportConfiguration, CommonDataImportService> {
+
+ private static final long serialVersionUID = 1L;
+
+ public LaunchCommonData() {
+ super(CommonDataImportConfiguration.class, CommonDataImportService.class);
+ }
+
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonData.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonDataComplete.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonDataComplete.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonDataComplete.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,43 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.importData;
-
-import fr.ifremer.echobase.services.CommonDataCompleteImportService;
-import fr.ifremer.echobase.services.configurations.CommonDataCompleteImportConfiguration;
-
-/**
- * Configure a accoustic data import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class LaunchCommonDataComplete extends AbstractLaunchImport<CommonDataCompleteImportConfiguration, CommonDataCompleteImportService> {
-
- private static final long serialVersionUID = 1L;
-
- public LaunchCommonDataComplete() {
- super(CommonDataCompleteImportConfiguration.class, CommonDataCompleteImportService.class);
- }
-
-}
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonDataFromTransect.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonDataFromTransect.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchCommonDataFromTransect.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,43 +0,0 @@
-/*
- * #%L
- * EchoBase :: UI
- *
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2011 - 2012 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.importData;
-
-import fr.ifremer.echobase.services.CommonDataFromTransectImportService;
-import fr.ifremer.echobase.services.configurations.CommonDataFromTransectImportConfiguration;
-
-/**
- * Configure a accoustic data import.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.3
- */
-public class LaunchCommonDataFromTransect extends AbstractLaunchImport<CommonDataFromTransectImportConfiguration, CommonDataFromTransectImportService> {
-
- private static final long serialVersionUID = 1L;
-
- public LaunchCommonDataFromTransect() {
- super(CommonDataFromTransectImportConfiguration.class, CommonDataFromTransectImportService.class);
- }
-
-}
Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,44 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.importData;
+
+import fr.ifremer.echobase.services.OperationImportService;
+import fr.ifremer.echobase.services.configurations.OperationImportConfiguration;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class LaunchOperation extends AbstractLaunchImport<OperationImportConfiguration, OperationImportService> {
+
+ private static final long serialVersionUID = 1L;
+
+ public LaunchOperation() {
+ super(OperationImportConfiguration.class,
+ OperationImportService.class);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchOperation.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java (from rev 303, trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchAccousticRegionData.java)
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,43 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.importData;
+
+import fr.ifremer.echobase.services.ResultsImportService;
+import fr.ifremer.echobase.services.configurations.ResultsImportConfiguration;
+
+/**
+ * Configure a "result" import.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class LaunchResults extends AbstractLaunchImport<ResultsImportConfiguration, ResultsImportService> {
+
+ private static final long serialVersionUID = 1L;
+
+ public LaunchResults() {
+ super(ResultsImportConfiguration.class, ResultsImportService.class);
+ }
+
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/LaunchResults.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectImportType.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectImportType.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectImportType.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -61,7 +61,7 @@
modes = decorateEnums(ImportDataMode.values());
if (mode == null) {
- mode = ImportDataMode.CommonDataComplete;
+ mode = ImportDataMode.CommonData;
}
return INPUT;
}
Deleted: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectedMissionMode.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectedMissionMode.java 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/SelectedMissionMode.java 2012-02-02 22:58:29 UTC (rev 304)
@@ -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.actions.importData;
-
-import fr.ifremer.echobase.I18nAble;
-
-import static org.nuiton.i18n.I18n.n_;
-
-/**
- * Define import mode (use an existing voayge, or create a new one.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.2
- */
-public enum SelectedMissionMode implements I18nAble {
-
- CREATE_NEW_MISSION(n_("echobase.common.importMode.createNewMission")),
- USE_EXISTING_MISSION(n_("echobase.common.importMode.useExistingMission"));
-
- private final String i18nKey;
-
- SelectedMissionMode(String i18nKey) {
- this.i18nKey = i18nKey;
- }
-
- @Override
- public String getI18nKey() {
- return i18nKey;
- }
-}
Modified: trunk/echobase-ui/src/main/resources/config/struts-importData.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/config/struts-importData.xml 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/resources/config/struts-importData.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -45,6 +45,17 @@
</action>
<!-- Configure import -->
+ <action name="Configure*-*" method="{2}"
+ class="fr.ifremer.echobase.ui.actions.importData.Configure{1}">
+ <interceptor-ref name="paramsPrepareParamsStackLoggued"/>
+ <result name="input">/WEB-INF/jsp/importData/configure{1}.jsp</result>
+ <result type="redirectAction">
+ <param name="namespace">/importData</param>
+ <param name="actionName">import{1}</param>
+ </result>
+ </action>
+
+ <!-- Configure import -->
<action name="configure*"
class="fr.ifremer.echobase.ui.actions.importData.Configure{1}">
<interceptor-ref name="paramsPrepareParamsStackLoggued"/>
@@ -76,6 +87,18 @@
<result type="json"/>
</action>
+ <!-- Create a new mission -->
+ <action name="createMission"
+ class="fr.ifremer.echobase.ui.actions.importData.CreateMission">
+ <interceptor-ref name="paramsPrepareParamsStackLoggued"/>
+ <result name="input">/WEB-INF/jsp/importData/createMission.jsp</result>
+ <result type="redirectAction">
+ <param name="namespace">/importData</param>
+ <param name="actionName">configureCommonData</param>
+ <param name="method">input</param>
+ </result>
+ </action>
+
</package>
</struts>
Modified: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData-validation.xml 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -44,6 +44,12 @@
</field-validator>
</field>
+ <field name="model.cellPositionReference">
+ <field-validator type="nrequired">
+ <message key="echobase.error.import.cellPositionReference.required"/>
+ </field-validator>
+ </field>
+
<field name="model.transceiverAcquisitionAbsorptionDescription">
<field-validator type="nrequiredstring">
<message key="echobase.error.import.transceiverAcquisitionAbsorptionDescription.required"/>
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticRegionData-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticRegionData-validation.xml 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticRegionData-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,55 +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%
- -->
-<!DOCTYPE validators PUBLIC
- "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
-<validators>
-
- <field name="model.voyageId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.voyage.required"/>
- </field-validator>
- </field>
-
- <field name="model.vesselId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.vessel.required"/>
- </field-validator>
- </field>
-
- <field name="regionsFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.regionsFile.file!=null</param>
- <message key="echobase.error.import.regionsFile.required"/>
- </field-validator>
- </field>
-
- <field name="associationFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.associationFile.file!=null</param>
- <message key="echobase.error.import.associationFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Modified: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData-validation.xml 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesData-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -32,32 +32,18 @@
</field-validator>
</field>
- <field name="tlbeStationFile">
+ <field name="sampleFile">
<field-validator type="nfieldexpression">
- <param name="expression">model.tlbeStationFile.file!=null</param>
- <message key="echobase.error.import.tlbeStationFile.required"/>
+ <param name="expression">model.sampleFile.file!=null</param>
+ <message key="echobase.error.import.sampleFile.required"/>
</field-validator>
</field>
- <field name="xtblTriFile">
+ <field name="sampleDataFile">
<field-validator type="nfieldexpression">
- <param name="expression">model.xtblTriFile.file!=null</param>
- <message key="echobase.error.import.xtblTriFile.required"/>
+ <param name="expression">model.sampleDataFile.file!=null</param>
+ <message key="echobase.error.import.sampleDataFile.required"/>
</field-validator>
</field>
- <field name="tblMensurationFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.tblMensurationFile.file!=null</param>
- <message key="echobase.error.import.tblMensurationFile.required"/>
- </field-validator>
- </field>
-
- <field name="tblMensurationClasseFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.tblMensurationClasseFile.file!=null</param>
- <message key="echobase.error.import.tblMensurationClasseFile.required"/>
- </field-validator>
- </field>
-
</validators>
\ No newline at end of file
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesIndividualData-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesIndividualData-validation.xml 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesIndividualData-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,42 +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%
- -->
-<!DOCTYPE validators PUBLIC
- "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
-<validators>
-
- <field name="model.voyageId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.voyage.required"/>
- </field-validator>
- </field>
-
- <field name="individualDataFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.individualDataFile.file!=null</param>
- <message key="echobase.error.import.individualDataFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesReference-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesReference-validation.xml 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCatchesReference-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,43 +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%
- -->
-<!DOCTYPE validators PUBLIC
- "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
-<validators>
-
- <field name="lengthAgeKeyFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.lengthAgeKeyFile.file!=null</param>
- <message key="echobase.error.import.lengthAgeKeyFile.required"/>
- </field-validator>
- </field>
-
- <field name="lengthWeightKeyFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.lengthWeightKeyFile.file!=null</param>
- <message key="echobase.error.import.lengthWeightKeyFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml (from rev 303, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataComplete-validation.xml)
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,104 @@
+<!--
+ #%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 validators PUBLIC
+ "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+
+ <field name="model.missionId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.mission.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.areaOfOperationId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.areaOfOperation.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.vesselId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.vessel.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.voyageDescription">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyageDescription.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transitRelatedActivity">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transitRelatedActivity.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transectLicence">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transectLicence.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transectGeospatialVerticalPositive">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transectGeospatialVerticalPositive.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transectBinUnitsPingAxis">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transectBinUnitsPingAxis.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.datum">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.datum.required"/>
+ </field-validator>
+ </field>
+
+ <field name="voyageFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.voyageFile.file!=null</param>
+ <message key="echobase.error.import.voyageFile.required"/>
+ </field-validator>
+ </field>
+
+ <field name="transitFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.transitFile.file!=null</param>
+ <message key="echobase.error.import.transitFile.required"/>
+ </field-validator>
+ </field>
+
+ <field name="transectFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.transectFile.file!=null</param>
+ <message key="echobase.error.import.transectFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeAll-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml (from rev 303, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataFromTransect-validation.xml)
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,73 @@
+<!--
+ #%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 validators PUBLIC
+ "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+
+ <field name="model.voyageId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyage.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.vesselId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.vessel.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transectLicence">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transectLicence.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transectGeospatialVerticalPositive">
+ <field-validator type="nrequiredstring">
+ <message
+ key="echobase.error.import.transectGeospatialVerticalPositive.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.transectBinUnitsPingAxis">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transectBinUnitsPingAxis.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.datum">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.datum.required"/>
+ </field-validator>
+ </field>
+
+ <field name="transectFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.transectFile.file!=null</param>
+ <message key="echobase.error.import.transectFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonData-ConfigureCommonData-modeTransect-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataComplete-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataComplete-validation.xml 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataComplete-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,111 +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%
- -->
-<!DOCTYPE validators PUBLIC
- "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
-<validators>
-
- <field name="model.missionId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.mission.required"/>
- </field-validator>
- </field>
-
- <field name="model.areaOfOperationId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.areaOfOperation.required"/>
- </field-validator>
- </field>
-
- <field name="model.vesselId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.vessel.required"/>
- </field-validator>
- </field>
-
- <field name="model.voyageDescription">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.voyageDescription.required"/>
- </field-validator>
- </field>
-
- <field name="model.transitRelatedActivity">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transitRelatedActivity.required"/>
- </field-validator>
- </field>
-
- <field name="model.transectLicence">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transectLicence.required"/>
- </field-validator>
- </field>
-
- <field name="model.transectGeospatialVerticalPositive">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transectGeospatialVerticalPositive.required"/>
- </field-validator>
- </field>
-
- <field name="model.transectBinUnitsPingAxis">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transectBinUnitsPingAxis.required"/>
- </field-validator>
- </field>
-
- <field name="model.datum">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.datum.required"/>
- </field-validator>
- </field>
-
- <field name="voyageFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.voyageFile.file!=null</param>
- <message key="echobase.error.import.voyageFile.required"/>
- </field-validator>
- </field>
-
- <field name="transitFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.transitFile.file!=null</param>
- <message key="echobase.error.import.transitFile.required"/>
- </field-validator>
- </field>
-
- <field name="transectFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.transectFile.file!=null</param>
- <message key="echobase.error.import.transectFile.required"/>
- </field-validator>
- </field>
-
- <field name="echotypeFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.echotypeFile.file!=null</param>
- <message key="echobase.error.import.echotypeFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataFromTransect-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataFromTransect-validation.xml 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureCommonDataFromTransect-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,73 +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%
- -->
-<!DOCTYPE validators PUBLIC
- "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
-<validators>
-
- <field name="model.voyageId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.voyage.required"/>
- </field-validator>
- </field>
-
- <field name="model.vesselId">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.vessel.required"/>
- </field-validator>
- </field>
-
- <field name="model.transectLicence">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transectLicence.required"/>
- </field-validator>
- </field>
-
- <field name="model.transectGeospatialVerticalPositive">
- <field-validator type="nrequiredstring">
- <message
- key="echobase.error.import.transectGeospatialVerticalPositive.required"/>
- </field-validator>
- </field>
-
- <field name="model.transectBinUnitsPingAxis">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.transectBinUnitsPingAxis.required"/>
- </field-validator>
- </field>
-
- <field name="model.datum">
- <field-validator type="nrequiredstring">
- <message key="echobase.error.import.datum.required"/>
- </field-validator>
- </field>
-
- <field name="transectFile">
- <field-validator type="nfieldexpression">
- <param name="expression">model.transectFile.file!=null</param>
- <message key="echobase.error.import.transectFile.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Deleted: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureMission-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureMission-validation.xml 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureMission-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,56 +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%
- -->
-<!DOCTYPE validators PUBLIC
- "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
- "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
-<validators>
-
- <field name="importMode">
- <field-validator type="required">
- <message key="echobase.error.import.importMode.required"/>
- </field-validator>
- </field>
-
- <field name="mission.topiaId">
- <field-validator type="nrequiredstring">
- <param name="skip">importMode.name() != "USE_EXISTING_MISSION"</param>
- <message key="echobase.error.import.mission.required"/>
- </field-validator>
- </field>
-
- <field name="mission.name">
- <field-validator type="nrequiredstring">
- <param name="skip">importMode.name() != "CREATE_NEW_MISSION"</param>
- <message key="echobase.error.import.missionName.required"/>
- </field-validator>
- </field>
-
- <field name="mission.missionAbstract">
- <field-validator type="nrequiredstring">
- <param name="skip">importMode.name() != "CREATE_NEW_MISSION"</param>
- <message key="echobase.error.import.missionAbstract.required"/>
- </field-validator>
- </field>
-
-</validators>
\ No newline at end of file
Added: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 - 2012 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 validators PUBLIC
+ "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+
+<validators>
+
+ <field name="model.voyageId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyage.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.vesselId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.vessel.required"/>
+ </field-validator>
+ </field>
+
+ <field name="operationFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.operationFile.file!=null</param>
+ <message key="echobase.error.import.operationFile.required"/>
+ </field-validator>
+ </field>
+
+ <field name="operationMetadataFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.operationMetadataFile.file!=null</param>
+ <message key="echobase.error.import.operationMetadataFile.required"/>
+ </field-validator>
+ </field>
+
+ <field name="gearMetadataFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.gearMetadataFile.file!=null</param>
+ <message key="echobase.error.import.gearMetadataFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureOperation-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcoustic-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcoustic-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcoustic-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,55 @@
+<!--
+ #%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 validators PUBLIC
+ "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+
+ <field name="model.voyageId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyage.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.vesselId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.vessel.required"/>
+ </field-validator>
+ </field>
+
+ <field name="regionsFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.regionsFile.file!=null</param>
+ <message key="echobase.error.import.regionsFile.required"/>
+ </field-validator>
+ </field>
+
+ <field name="associationFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.associationFile.file!=null</param>
+ <message key="echobase.error.import.associationFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeAcoustic-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml (from rev 303, trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticRegionData-validation.xml)
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -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%
+ -->
+<!DOCTYPE validators PUBLIC
+ "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+<validators>
+
+ <field name="model.voyageId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.voyage.required"/>
+ </field-validator>
+ </field>
+
+ <field name="lengthAgeKeyFile">
+ <field-validator type="nfieldexpression">
+ <param name="expression">model.lengthAgeKeyFile.file!=null ||
+ model.lengthWeightKeyFile.file!=null || model.echotypeFile.file!=null </param>
+ <message key="echobase.error.import.resultImportFile.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureResults-ConfigureResults-modeVoyage-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/CreateMission-createMission-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/CreateMission-createMission-validation.xml (rev 0)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/CreateMission-createMission-validation.xml 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 - 2012 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 validators PUBLIC
+ "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+
+<validators>
+
+ <field name="mission.name">
+ <field-validator type="requiredstring">
+ <message key="echobase.error.import.missionName.required"/>
+ </field-validator>
+ </field>
+
+ <field name="mission.missionAbstract">
+ <field-validator type="requiredstring">
+ <message key="echobase.error.import.missionAbstract.required"/>
+ </field-validator>
+ </field>
+
+</validators>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/CreateMission-createMission-validation.xml
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
===================================================================
--- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,8 +1,10 @@
echobase.action.applySqlQuery=Appliquer la requête
echobase.action.backToUserList=Retour à la liste des utilisateurs
echobase.action.cloneSqlQuery=Cloner la requête
+echobase.action.configureImport=Configurer l'import
echobase.action.create=Créer
echobase.action.createEmbeddedApplication=Créer l'application
+echobase.action.createMission=Créer la mission
echobase.action.delete=Suppression
echobase.action.deleteSqlQuery=Supprimer la requête
echobase.action.downloadEmbeddedApplicationFile=Télécharger l'application embarquée
@@ -24,15 +26,15 @@
echobase.common.acousticDensityUnit=acousticDensityUnit
echobase.common.acquisitionSoftwareVersionER60=acquisitionSoftwareVersion (ER60 instrument)
echobase.common.acquisitionSoftwareVersionME70=acquisitionSoftwareVersion (ME70 instrument)
+echobase.common.addDataAcquisition=Toujours créer des DataAcqusitions
echobase.common.admin=Administrateur
+echobase.common.cellPositionReference=cellPositionReference
echobase.common.digitThreshold=digitThreshold
echobase.common.echosounderSoundSpeed=echosounderSoundSpeed
echobase.common.email=Email
echobase.common.entityType=Type d'entité
echobase.common.importDataMode=Type d'import
-echobase.common.importMode=Type de mission
-echobase.common.importMode.createNewMission=Créer une nouvelle mission
-echobase.common.importMode.useExistingMission=Utiliser une mission existante
+echobase.common.importMode=Type d'import
echobase.common.importResult=Résultat \:
echobase.common.inProgress=en cours...
echobase.common.jdbcLogin=Login de connexion
@@ -61,14 +63,17 @@
echobase.error.export.name.requiredstring=Le nom de l'export est obligatoire
echobase.error.export.sqlQuery.requiredstring=La requête de l'export est obligatoire
echobase.error.export.sqlQuery.wrongformat=La requêtes n'est pas valide
+echobase.error.import.acousticDensityUnit.required=acousticDensityUnit non renseigné
echobase.error.import.acquisitionSoftwareVersionER60.required=acquisitionSoftwareVersionER60 non renseigné
echobase.error.import.acquisitionSoftwareVersionME70.required=acquisitionSoftwareVersionME70 non renseigné
echobase.error.import.areaOfOperation.required=La sélection d'une zone d'opération est obligatoire
echobase.error.import.associationFile.required=La sélection d'un fichier Association est obligatoire
+echobase.error.import.cellPositionReference.required=La sélection d'un cellPositionReference est obligatoire
echobase.error.import.datum.required=Datum de la campagne non rengeigné
echobase.error.import.digitThreshold.required=digitThreshold non renseigné
echobase.error.import.echosounderSoundSpeed.required=echosounderSoundSpeed non renseigné
echobase.error.import.echotypeFile.required=La sélection d'un fichier Echotype est obligatoire
+echobase.error.import.gearMetadataFile.required=La sélection d'un fichier GearMetadata est obligatoire
echobase.error.import.importMode.required=Le mode d'import est obligatoire
echobase.error.import.individualDataFile.required=La sélection d'un fichier individualData est obligatoire
echobase.error.import.lengthAgeKeyFile.required=La sélection d'un fichier lengthAgeKey est obligatoire
@@ -80,16 +85,18 @@
echobase.error.import.missionName.required=Le nom de la mission est obligatoire
echobase.error.import.moviesFile.required=La sélection d'un fichier Movies est obligatoire
echobase.error.import.notes.required=Note des DataProcessing non renseigné
+echobase.error.import.operationFile.required=La sélection d'un fichier Operation est obligatoire
+echobase.error.import.operationMetadataFile.required=La sélection d'un fichier OperationMetadata est obligatoire
echobase.error.import.pingDutyCycle.required=pingDutyCycle non renseigné
echobase.error.import.processingDescription.required=processingDescription non renseigné
echobase.error.import.processingTemplate.required=processingTemplate non renseigné
echobase.error.import.regionsFile.required=La sélection d'un fichier Region est obligatoire
+echobase.error.import.resultImportFile.required=Veuillez donner au moins un fichier à importer
+echobase.error.import.sampleDataFile.required=La sélection d'un fichier SampleData est obligatoire
+echobase.error.import.sampleFile.required=La sélection d'un fichier Sample est obligatoire
echobase.error.import.soundSpeedCalculationsER60.required=soundSpeedCalculationsER60 non renseigné
echobase.error.import.soundSpeedCalculationsME70.required=soundSpeedCalculationsME70 non renseigné
echobase.error.import.sounderConstant.required=sounderConstant non renseigné
-echobase.error.import.tblMensurationClasseFile.required=La sélection d'un fichier tblMensurationClasse est obligatoire
-echobase.error.import.tblMensurationFile.required=La sélection d'un fichier tblMensuration est obligatoire
-echobase.error.import.tlbeStationFile.required=La sélection d'un fichier tlbeStation est obligatoire
echobase.error.import.transceiverAcquisitionAbsorptionDescription.required=transceiverAcquisitionAbsorptionDescription non renseigné
echobase.error.import.transectBinUnitsPingAxis.required=BinUnitsPingAxis des transtects non rengeigné
echobase.error.import.transectFile.required=La sélection d'un fichier Transect est obligatoire
@@ -107,6 +114,7 @@
echobase.error.importHistorical.input.required=Le fichier d'import est obligatoire
echobase.error.login.unknown=Utilisateur inconnu
echobase.error.login.wrongLogin=Le login est déjà utilisé
+echobase.error.mission.name.already.exist=Nom de mission déjà utilisé
echobase.error.no.embeddedApplication.configurationFound=La configuration de création d'application embarquée non trouvée
echobase.error.no.embeddedApplication.exportFileFound=L'application embarquée générée non trouvée
echobase.error.no.exportDb.configurationFound=La configuration de l'export de la base non trouvée
@@ -124,6 +132,8 @@
echobase.info.user.create=L'utilisateur '%s' a été créée
echobase.info.user.delete=L'utilisateur '%s' a été supprimé
echobase.info.user.update=L'utilisateur '%s' a été mis à jour
+echobase.information.create.mission=Si la mission n'existe, suivez le lien pour en créer une nouvelle.
+echobase.information.mission.created=La mission %s a été créée
echobase.label.admin.user.create=Création d'un utilisateur
echobase.label.admin.user.delete=Suppression d'un utilisateur
echobase.label.admin.user.edit=Mise à jour d'un utilisateur
@@ -161,7 +171,8 @@
echobase.legend.importData.configuration.resume=Résumé de la configuration d'import
echobase.legend.importData.configuration.selectImportType=Sélection du type d'import
echobase.legend.importData.configure=Configurer l'import
-echobase.legend.importData.configure.commonDataComplete.selectMission=Sélection de la mission
+echobase.legend.importData.configure.CommonData.selectMission=Sélection de la mission
+echobase.legend.importData.createMission=Caractéristiques de la nouvelle mission
echobase.legend.importDb.configuration.files=Choix du fichier d'import de la base complête (fichier zip)
echobase.legend.importFileResult=Résultat de l'import %s
echobase.legend.sqlQuery.configuration=Configuration de la requête
@@ -183,6 +194,7 @@
echobase.message.warnImportInProgress=Merci de ne pas fermer la fenêtre pour pouvoir accéder aux résultats de l'import.
echobase.title.connectToDbInformations=Informations de connection à la base de données
echobase.title.createEmbeddedApplication=Création de l'application embarquée
+echobase.title.createMission=Créer une mission
echobase.title.dbEditor=Modification de la base
echobase.title.embeddedApplicationProgress=Création de l'application embarquée en cours
echobase.title.embeddedApplicationResult=Résultat de la création de l'application embarquée
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -27,8 +27,9 @@
<script type="text/javascript"
src="<s:url value='/js/gridHelper.js' />"></script>
-<title>Configuration <s:text
- name="echobase.common.importDataMode.accousticData"/></title>
+<title>
+ Configuration <s:text name="echobase.common.importDataMode.accousticData"/>
+</title>
<s:url id="getTransitsUrl" action="getTransits" namespace="/importData"/>
<s:url id="getVesselsUrl" action="getVessels" namespace="/importData"/>
@@ -66,28 +67,29 @@
console.info("reload voyageId " + voyageId);
voyageSelectBox.change(voyageId);
- $.updateSelectBoxContent('${getTransitsUrl}',
- {voyageId:voyageId},
- 'transits',
- transitSelectBox,
- function() {
+ $.updateSelectBoxContent(
+ '${getTransitsUrl}',
+ {voyageId:voyageId},
+ 'transits',
+ transitSelectBox,
+ function () {
- var transitId = "${model.transitId}";
- if (transitId) {
+ var transitId = "${model.transitId}";
+ if (transitId) {
- transitSelectBox.val(transitId);
- $.updateSelectBoxContent('${getVesselsUrl}',
- {transitId:transitId},
- 'vessels',
- vesselSelectBox, function() {
+ transitSelectBox.val(transitId);
+ $.updateSelectBoxContent('${getVesselsUrl}',
+ {transitId:transitId},
+ 'vessels',
+ vesselSelectBox, function () {
- var vesselId = "${model.vesselId}";
- if (vesselId) {
- vesselSelectBox.val(vesselId);
- }
- });
- }
- }
+ var vesselId = "${model.vesselId}";
+ if (vesselId) {
+ vesselSelectBox.val(vesselId);
+ }
+ });
+ }
+ }
);
}
@@ -111,6 +113,13 @@
<sj:select key="model.vesselId" required="true"
label='%{getText("echobase.common.vessel")}'/>
+ <s:select key="model.cellPositionReference" required="true"
+ label='%{getText("echobase.common.cellPositionReference")}'
+ list="cellPositionReferences" headerKey="" headerValue=""/>
+
+ <s:checkbox key="model.addDataAcquisition" required="true"
+ label='%{getText("echobase.common.addDataAcquisition")}'/>
+
<s:textfield key="model.transceiverAcquisitionAbsorptionDescription"
size="100" required="true"
label='%{getText("echobase.common.transceiverAcquisitionAbsorptionDescription")}'/>
@@ -167,7 +176,7 @@
</fieldset>
<br/>
<s:submit action="configureAccousticData"
- value='%{getText("echobase.action.import")}'/>
+ value='%{getText("echobase.action.configureImport")}'/>
</s:form>
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticRegionData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticRegionData.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticRegionData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,65 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title>Configuration <s:text
- name="echobase.common.importDataMode.accousticRegionData"/></title>
-
-<script type="text/javascript">
-
- jQuery(document).ready(function () {
-
- });
-</script>
-
-<s:form namespace="/importData" method="POST" enctype="multipart/form-data">
-
- <fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configure"/>
- </legend>
-
- <s:select key="model.voyageId" required="true"
- label='%{getText("echobase.common.voyage")}'
- list="voyages" headerKey="" headerValue=""/>
-
- <s:select key="model.vesselId" required="true"
- label='%{getText("echobase.common.vessel")}'
- list="vessels" headerKey="" headerValue=""/>
-
- <s:file key="regionsFile" required="true"
- label='%{getText("echobase.common.regionsFile")}'/>
-
- <s:file key="associationFile" required="true"
- label='%{getText("echobase.common.associationFile")}'/>
-
- </fieldset>
-
- <br/>
- <s:submit action="configureAccousticRegionData"
- value='%{getText("echobase.action.import")}'/>
-
-
-</s:form>
\ No newline at end of file
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -24,8 +24,9 @@
<%@page contentType="text/html" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
-<title>Configuration <s:text
- name="echobase.common.importDataMode.catchesData"/></title>
+<title>
+ Configuration <s:text name="echobase.common.importDataMode.catchesData"/>
+</title>
<script type="text/javascript">
@@ -45,23 +46,20 @@
label='%{getText("echobase.common.voyage")}'
list="voyages" headerKey="" headerValue=""/>
- <s:file key="tlbeStationFile" required="true"
- label='%{getText("echobase.common.tlbeStationFile")}'/>
+ <s:select key="model.vesselId" required="true"
+ label='%{getText("echobase.common.vessel")}'
+ list="vessels" headerKey="" headerValue=""/>
- <s:file key="xtblTriFile" required="true"
- label='%{getText("echobase.common.xtblTriFile")}'/>
+ <s:file key="sampleFile" required="true"
+ label='%{getText("echobase.common.sampleFile")}'/>
- <s:file key="tblMensurationFile" required="true"
- label='%{getText("echobase.common.tblMensurationFile")}'/>
-
- <s:file key="tblMensurationClasseFile" required="true"
- label='%{getText("echobase.common.tblMensurationClasseFile")}'/>
-
+ <s:file key="sampleDataFile" required="true"
+ label='%{getText("echobase.common.sampleDataFile")}'/>
</fieldset>
<br/>
<s:submit action="configureCatchesData"
- value='%{getText("echobase.action.import")}'/>
+ value='%{getText("echobase.action.configureImport")}'/>
</s:form>
\ No newline at end of file
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesIndividualData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesIndividualData.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesIndividualData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,60 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title>Configuration <s:text
- name="echobase.common.importDataMode.catchesIndividualData"/></title>
-
-<script type="text/javascript">
-
- jQuery(document).ready(function () {
-
- });
-</script>
-
-<s:form namespace="/importData" method="POST" enctype="multipart/form-data">
-
- <fieldset>
- <legend>
- <s:text
- name="echobase.legend.importData.configure"/>
- </legend>
-
- <s:select key="model.voyageId" required="true"
- label='%{getText("echobase.common.voyage")}'
- list="voyages" headerKey="" headerValue=""/>
-
-
- <s:file key="individualDataFile" required="true"
- label='%{getText("echobase.common.individualDataFile")}'/>
-
- </fieldset>
-
- <br/>
- <s:submit action="configureCatchesIndividualData"
- value='%{getText("echobase.action.import")}'/>
-
-
-</s:form>
\ No newline at end of file
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesReference.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesReference.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesReference.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,57 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title>Configuration <s:text
- name="echobase.common.importDataMode.catchesReferences"/></title>
-
-<script type="text/javascript">
-
- jQuery(document).ready(function () {
-
- });
-</script>
-
-<s:form namespace="/importData" method="POST" enctype="multipart/form-data">
-
- <fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configure"/>
- </legend>
-
- <s:file key="lengthAgeKeyFile" required="true"
- label='%{getText("echobase.common.lengthAgeKeyFile")}'/>
-
- <s:file key="lengthWeightKeyFile" required="true"
- label='%{getText("echobase.common.lengthWeightKeyFile")}'/>
-
- </fieldset>
-
- <br/>
- <s:submit action="configureCatchesReference"
- value='%{getText("echobase.action.import")}'/>
-
-
-</s:form>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp (from rev 303, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataComplete.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,161 @@
+<%--
+ #%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>
+ Configuration <s:text name="echobase.common.importDataMode.commonData"/>
+</title>
+
+<script type="text/javascript">
+
+ jQuery(document).ready(function () {
+
+ $('[name="model.importMode"]').change(function (event) {
+ $('[class~="importMode"]').hide();
+ $('#' + this.value).show();
+ $('#' + this.value+' .errorMessage').hide();
+ });
+
+ var incomingVal = $('[name="model.importMode"][checked="checked"]').val();
+ $('#' + incomingVal).show();
+
+ });
+</script>
+
+<s:radio id='mode' key='model.importMode' list="importModes" cssClass="cleanBoth"
+ label='%{getText("echobase.common.importMode")}'
+ required="true" template="myradiomap"/>
+
+<hr/>
+
+<%--Import mode = ALL--%>
+
+<s:form id="ALL" namespace="/importData" method="POST"
+ enctype="multipart/form-data" cssClass="hidden importMode">
+
+ <fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:select key="model.missionId" required="true"
+ label='%{getText("echobase.common.mission")} (*)'
+ list="missions" headerKey="" headerValue=""/>
+ <br/>
+
+ <s:hidden key="model.importMode" value="ALL" label=''/>
+
+ <s:select key="model.areaOfOperationId" required="true"
+ label='%{getText("echobase.common.areaOfOperation")}'
+ list="areaOfOperations" headerKey="" headerValue=""/>
+
+ <s:select key="model.vesselId" required="true"
+ label='%{getText("echobase.common.vessel")}'
+ list="vessels" headerKey="" headerValue=""/>
+
+ <s:textfield key="model.voyageDescription" size="40" required="true"
+ label='%{getText("echobase.common.voyageDescription")}'/>
+
+ <s:textfield key="model.datum" size="40" required="true"
+ label='%{getText("echobase.common.datum")}'/>
+
+ <s:textfield key="model.transitRelatedActivity" size="40" required="true"
+ label='%{getText("echobase.common.transitRelatedActivity")}'/>
+
+ <s:textfield key="model.transectLicence" size="40" required="true"
+ label='%{getText("echobase.common.transectLicence")}'/>
+
+ <s:textfield key="model.transectGeospatialVerticalPositive" size="40"
+ required="true"
+ label='%{getText("echobase.common.transectGeospatialVerticalPositive")}'/>
+
+ <s:textfield key="model.transectBinUnitsPingAxis" size="40" required="true"
+ label='%{getText("echobase.common.transectBinUnitsPingAxis")}'/>
+
+ <s:file key="voyageFile" required="true"
+ label='%{getText("echobase.common.voyageFile")}'/>
+
+ <s:file key="transitFile" required="true"
+ label='%{getText("echobase.common.transitFile")}'/>
+
+ <s:file key="transectFile" required="true"
+ label='%{getText("echobase.common.transectFile")}'/>
+
+ </fieldset>
+
+ <br/>
+ (*) <s:a namespace="/importData" action="createMission" method="input">
+ <s:text name="echobase.information.create.mission"/>
+</s:a>
+ <br/>
+ <s:submit action="ConfigureCommonData-modeAll"
+ value='%{getText("echobase.action.configureImport")}'/>
+
+</s:form>
+
+<%--Import mode = TRANSECT --%>
+
+<s:form id='TRANSECT' namespace="/importData" method="POST"
+ enctype="multipart/form-data" cssClass="hidden importMode">
+
+ <fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:hidden key="model.importMode" value="TRANSECT" label=''/>
+
+ <s:select key="model.voyageId" required="true"
+ label='%{getText("echobase.common.voyage")}'
+ list="voyages" headerKey="" headerValue=""/>
+
+ <s:select key="model.vesselId" required="true"
+ label='%{getText("echobase.common.vessel")}'
+ list="vessels" headerKey="" headerValue=""/>
+
+ <s:textfield key="model.datum" size="40" required="true"
+ label='%{getText("echobase.common.datum")}'/>
+
+ <s:textfield key="model.transectLicence" size="40" required="true"
+ label='%{getText("echobase.common.transectLicence")}'/>
+
+ <s:textfield key="model.transectGeospatialVerticalPositive" size="40"
+ required="true"
+ label='%{getText("echobase.common.transectGeospatialVerticalPositive")}'/>
+
+ <s:textfield key="model.transectBinUnitsPingAxis" size="40" required="true"
+ label='%{getText("echobase.common.transectBinUnitsPingAxis")}'/>
+
+ <s:file key="transectFile" required="true"
+ label='%{getText("echobase.common.transectFile")}'/>
+
+ </fieldset>
+
+ <br/>
+ <s:submit action="ConfigureCommonData-modeTransect"
+ value='%{getText("echobase.action.configureImport")}'/>
+
+
+</s:form>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonData.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataComplete.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataComplete.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataComplete.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,168 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title>Configuration <s:text
- name="echobase.common.importDataMode.commonDataComplete"/></title>
-
-<script type="text/javascript">
-
- jQuery(document).ready(function () {
-
- $('[name="importMode"]').change(function (event) {
- $('[class="importMode"]').hide();
- $('#' + this.value).show();
- });
- var val = $('[name="importMode"][checked="checked"]').val();
- $('[class="importMode"]').hide();
- $("#" + val).show();
- });
-</script>
-
-<s:form namespace="/importData" method="POST" enctype="multipart/form-data">
-
- <fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configure"/>
- </legend>
-
- <fieldset>
- <legend>
- <s:text
- name="echobase.legend.importData.configure.commonDataComplete.selectMission"/>
- </legend>
-
- <s:radio key='importMode' list="importModes"
- label='%{getText("echobase.common.importMode")}'
- required="true"/>
-
- <div id='USE_EXISTING_MISSION' class='importMode'>
- <s:select key="model.missionId" required="true"
- label='%{getText("echobase.common.mission")}'
- list="missions" headerKey="" headerValue=""/>
- </div>
-
- <div id='CREATE_NEW_MISSION' class='importMode'>
-
- <s:textfield key="mission.name" size="40" required="true"
- label='%{getText("echobase.common.name")}'/>
-
- <s:textfield key="mission.missionAbstract" size="40" required="true"
- label='%{getText("echobase.common.missionAbstract")}'/>
-
- <s:textfield key="mission.litteratureReferences" size="40"
- label='%{getText("echobase.common.litteratureReferences")}'/>
-
- <s:textfield key="mission.project"
- label='%{getText("echobase.common.project")}'/>
-
- <s:textfield key="mission.platform"
- label='%{getText("echobase.common.platform")}'/>
-
- <s:textfield key="mission.institution"
- label='%{getText("echobase.common.institution")}'/>
-
- <s:textfield key="mission.keywords"
- label='%{getText("echobase.common.keywords")}'/>
-
- <s:textfield key="mission.dataCentre"
- label='%{getText("echobase.common.dataCentre")}'/>
-
- <s:textfield key="mission.dataCentreEmail"
- label='%{getText("echobase.common.dataCentreEmail")}'/>
-
- <s:textfield key="mission.author"
- label='%{getText("echobase.common.author")}'/>
-
- <s:textfield key="mission.authorEmail"
- label='%{getText("echobase.common.authorEmail")}'/>
-
- <s:textfield key="mission.principalInvestigator"
- label='%{getText("echobase.common.principalInvestigator")}'/>
-
- <s:textfield key="mission.principalInvestigatorEmail"
- label='%{getText("echobase.common.principalInvestigatorEmail")}'/>
-
- <s:textfield key="mission.organisationReferences"
- label='%{getText("echobase.common.organisationReferences")}'/>
-
- <s:textfield key="mission.distributionStatement"
- label='%{getText("echobase.common.distributionStatement")}'/>
-
- <s:textfield key="mission.organisationLevelAcknowledgements"
- label='%{getText("echobase.common.organisationLevelAcknowledgements")}'/>
-
- <s:textfield key="mission.source"
- label='%{getText("echobase.common.source")}'/>
- </div>
- </fieldset>
- <br/>
- <s:select key="model.areaOfOperationId" required="true"
- label='%{getText("echobase.common.areaOfOperation")}'
- list="areaOfOperations" headerKey="" headerValue=""/>
-
- <s:select key="model.vesselId" required="true"
- label='%{getText("echobase.common.vessel")}'
- list="vessels" headerKey="" headerValue=""/>
-
- <s:textfield key="model.voyageDescription" size="40" required="true"
- label='%{getText("echobase.common.voyageDescription")}'/>
-
- <s:textfield key="model.datum" size="40" required="true"
- label='%{getText("echobase.common.datum")}'/>
-
- <s:textfield key="model.transitRelatedActivity" size="40" required="true"
- label='%{getText("echobase.common.transitRelatedActivity")}'/>
-
- <s:textfield key="model.transectLicence" size="40" required="true"
- label='%{getText("echobase.common.transectLicence")}'/>
-
- <s:textfield key="model.transectGeospatialVerticalPositive" size="40"
- required="true"
- label='%{getText("echobase.common.transectGeospatialVerticalPositive")}'/>
-
- <s:textfield key="model.transectBinUnitsPingAxis" size="40" required="true"
- label='%{getText("echobase.common.transectBinUnitsPingAxis")}'/>
-
- <s:file key="voyageFile" required="true"
- label='%{getText("echobase.common.voyageFile")}'/>
-
- <s:file key="transitFile" required="true"
- label='%{getText("echobase.common.transitFile")}'/>
-
- <s:file key="transectFile" required="true"
- label='%{getText("echobase.common.transectFile")}'/>
-
- <s:file key="echotypeFile" required="true"
- label='%{getText("echobase.common.echotypeFile")}'/>
-
- </fieldset>
-
- <br/>
- <s:submit action="configureCommonDataComplete"
- value='%{getText("echobase.action.import")}'/>
-
-
-</s:form>
\ No newline at end of file
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataFromTransect.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataFromTransect.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataFromTransect.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,76 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title>Configuration <s:text
- name="echobase.common.importDataMode.commonDataFromTransect"/></title>
-
-<script type="text/javascript">
-
- jQuery(document).ready(function () {
-
- });
-</script>
-
-<s:form namespace="/importData" method="POST" enctype="multipart/form-data">
-
- <fieldset>
- <legend>
- <s:text
- name="echobase.legend.importData.configure"/>
- </legend>
-
- <s:select key="model.voyageId" required="true"
- label='%{getText("echobase.common.voyage")}'
- list="voyages" headerKey="" headerValue=""/>
-
- <s:select key="model.vesselId" required="true"
- label='%{getText("echobase.common.vessel")}'
- list="vessels" headerKey="" headerValue=""/>
-
- <s:textfield key="model.datum" size="40" required="true"
- label='%{getText("echobase.common.datum")}'/>
-
- <s:textfield key="model.transectLicence" size="40" required="true"
- label='%{getText("echobase.common.transectLicence")}'/>
-
- <s:textfield key="model.transectGeospatialVerticalPositive" size="40"
- required="true"
- label='%{getText("echobase.common.transectGeospatialVerticalPositive")}'/>
-
- <s:textfield key="model.transectBinUnitsPingAxis" size="40" required="true"
- label='%{getText("echobase.common.transectBinUnitsPingAxis")}'/>
-
- <s:file key="transectFile" required="true"
- label='%{getText("echobase.common.transectFile")}'/>
-
- </fieldset>
-
- <br/>
- <s:submit action="configureCommonDataFromTransect"
- value='%{getText("echobase.action.import")}'/>
-
-
-</s:form>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp (from rev 303, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataFromTransect.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,70 @@
+<%--
+ #%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>
+ Configuration <s:text name="echobase.common.importDataMode.operation"/>
+</title>
+
+<script type="text/javascript">
+
+ jQuery(document).ready(function () {
+
+ });
+</script>
+
+<s:form namespace="/importData" method="POST" enctype="multipart/form-data">
+
+ <fieldset>
+ <legend>
+ <s:text
+ name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:select key="model.voyageId" required="true"
+ label='%{getText("echobase.common.voyage")}'
+ list="voyages" headerKey="" headerValue=""/>
+
+ <s:select key="model.vesselId" required="true"
+ label='%{getText("echobase.common.vessel")}'
+ list="vessels" headerKey="" headerValue=""/>
+
+ <s:file key="operationFile" required="true"
+ label='%{getText("echobase.common.operationFile")}'/>
+
+ <s:file key="operationMetadataFile" required="true"
+ label='%{getText("echobase.common.operationMetadataFile")}'/>
+
+ <s:file key="gearMetadataFile" required="true"
+ label='%{getText("echobase.common.gearMetadataFile")}'/>
+
+ </fieldset>
+
+ <br/>
+ <s:submit action="configureOperation"
+ value='%{getText("echobase.action.configureImport")}'/>
+
+
+</s:form>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperation.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp (from rev 303, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticRegionData.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,112 @@
+<%--
+ #%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>
+ Configuration <s:text name="echobase.common.importDataMode.results"/>
+</title>
+
+<script type="text/javascript">
+
+ jQuery(document).ready(function () {
+
+ $('[name="model.importMode"]').change(function (event) {
+ $('[class~="importMode"]').hide();
+ $('#' + this.value).show();
+ $('#' + this.value+' .errorMessage').hide();
+ });
+
+ var incomingVal = $('[name="model.importMode"][checked="checked"]').val();
+ $('#' + incomingVal).show();
+
+ });
+</script>
+
+<s:radio id='mode' key='model.importMode' list="importModes" cssClass="cleanBoth"
+ label='%{getText("echobase.common.importMode")}'
+ required="true" template="myradiomap"/>
+
+<s:form id="VOYAGE" namespace="/importData" method="POST"
+ enctype="multipart/form-data" cssClass="hidden importMode">
+
+ <fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:hidden key="model.importMode" value="VOYAGE" label=''/>
+
+ <s:select key="model.voyageId" required="true"
+ label='%{getText("echobase.common.voyage")}'
+ list="voyages" headerKey="" headerValue=""/>
+
+ <s:file key="lengthAgeKeyFile" required="true"
+ label='%{getText("echobase.common.lengthAgeKeyFile")}'/>
+
+ <s:file key="lengthWeightKeyFile" required="true"
+ label='%{getText("echobase.common.lengthWeightKeyFile")}'/>
+
+ <s:file key="echotypeFile" required="true"
+ label='%{getText("echobase.common.echotypeFile")}'/>
+
+ </fieldset>
+
+ <br/>
+ <s:submit action="ConfigureResults-modeVoyage"
+ value='%{getText("echobase.action.configureImport")}'/>
+
+</s:form>
+
+<s:form id="ACOUSTIC" namespace="/importData" method="POST"
+ enctype="multipart/form-data" cssClass="hidden importMode">
+
+ <fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configure"/>
+ </legend>
+
+ <s:hidden key="model.importMode" value="ACOUSTIC" label=''/>
+
+ <s:select key="model.voyageId" required="true"
+ label='%{getText("echobase.common.voyage")}'
+ list="voyages" headerKey="" headerValue=""/>
+
+ <s:select key="model.vesselId" required="true"
+ label='%{getText("echobase.common.vessel")}'
+ list="vessels" headerKey="" headerValue=""/>
+
+ <s:file key="regionsFile" required="true"
+ label='%{getText("echobase.common.regionsFile")}'/>
+
+ <s:file key="associationFile" required="true"
+ label='%{getText("echobase.common.associationFile")}'/>
+
+ </fieldset>
+
+ <br/>
+ <s:submit action="ConfigureResults-modeAcoustic"
+ value='%{getText("echobase.action.configureImport")}'/>
+
+</s:form>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResults.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/createMission.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/createMission.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/createMission.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,95 @@
+<%--
+ #%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.createMission"/></title>
+
+<s:form namespace="/importData" method="POST">
+
+ <fieldset>
+ <legend>
+ <s:text
+ name="echobase.legend.importData.createMission"/>
+ </legend>
+
+ <s:textfield key="mission.name" size="40" required="true"
+ label='%{getText("echobase.common.name")}'/>
+
+ <s:textfield key="mission.missionAbstract" size="40" required="true"
+ label='%{getText("echobase.common.missionAbstract")}'/>
+
+ <s:textfield key="mission.litteratureReferences" size="40"
+ label='%{getText("echobase.common.litteratureReferences")}'/>
+
+ <s:textfield key="mission.project"
+ label='%{getText("echobase.common.project")}'/>
+
+ <s:textfield key="mission.platform"
+ label='%{getText("echobase.common.platform")}'/>
+
+ <s:textfield key="mission.institution"
+ label='%{getText("echobase.common.institution")}'/>
+
+ <s:textfield key="mission.keywords"
+ label='%{getText("echobase.common.keywords")}'/>
+
+ <s:textfield key="mission.dataCentre"
+ label='%{getText("echobase.common.dataCentre")}'/>
+
+ <s:textfield key="mission.dataCentreEmail"
+ label='%{getText("echobase.common.dataCentreEmail")}'/>
+
+ <s:textfield key="mission.author"
+ label='%{getText("echobase.common.author")}'/>
+
+ <s:textfield key="mission.authorEmail"
+ label='%{getText("echobase.common.authorEmail")}'/>
+
+ <s:textfield key="mission.principalInvestigator"
+ label='%{getText("echobase.common.principalInvestigator")}'/>
+
+ <s:textfield key="mission.principalInvestigatorEmail"
+ label='%{getText("echobase.common.principalInvestigatorEmail")}'/>
+
+ <s:textfield key="mission.organisationReferences"
+ label='%{getText("echobase.common.organisationReferences")}'/>
+
+ <s:textfield key="mission.distributionStatement"
+ label='%{getText("echobase.common.distributionStatement")}'/>
+
+ <s:textfield key="mission.organisationLevelAcknowledgements"
+ label='%{getText("echobase.common.organisationLevelAcknowledgements")}'/>
+
+ <s:textfield key="mission.source"
+ label='%{getText("echobase.common.source")}'/>
+
+ </fieldset>
+
+ <br/>
+
+ <s:submit action="createMission"
+ value='%{getText("echobase.action.createMission")}'/>
+
+</s:form>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/createMission.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -28,8 +28,10 @@
<s:url id="url" action="import-AccousticData" namespace="/importData"/>
<meta http-equiv="refresh" content="1;url=${url}"/>
-<title><s:text name="echobase.common.importDataMode.accousticData"/> <s:text
- name="echobase.common.inProgress"/></title>
+<title>
+ <s:text name="echobase.common.importDataMode.accousticData"/>
+ <s:text name="echobase.common.inProgress"/>
+</title>
<%-- TODO letellier 20111104 : Add warn icon --%>
<p><s:text name="echobase.message.warnImportInProgress"/></p>
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticRegionData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticRegionData.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticRegionData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,41 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 - 2012 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-
-<s:url id="url" action="import-AccousticRegionData" namespace="/importData"/>
-<meta http-equiv="refresh" content="1;url=${url}"/>
-
-<title><s:text name="echobase.common.importDataMode.accousticRegionData"/>
- <s:text name="echobase.common.inProgress"/></title>
-
-<%-- TODO letellier 20111104 : Add warn icon --%>
-<p><s:text name="echobase.message.warnImportInProgress"/></p>
-
-<br/>
-
-<div>
- <sj:progressbar value="%{model.progression}"/>
-</div>
\ No newline at end of file
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -28,8 +28,10 @@
<s:url id="url" action="import-CatchesData" namespace="/importData"/>
<meta http-equiv="refresh" content="1;url=${url}"/>
-<title><s:text name="echobase.common.importDataMode.catchesData"/> <s:text
- name="echobase.common.inProgress"/></title>
+<title>
+ <s:text name="echobase.common.importDataMode.catchesData"/>
+ <s:text name="echobase.common.inProgress"/>
+</title>
<%-- TODO letellier 20111104 : Add warn icon --%>
<p><s:text name="echobase.message.warnImportInProgress"/></p>
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesIndividualData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesIndividualData.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesIndividualData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,41 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 - 2012 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-
-<s:url id="url" action="import-CatchesIndividualData" namespace="/importData"/>
-<meta http-equiv="refresh" content="1;url=${url}"/>
-
-<title><s:text name="echobase.common.importDataMode.accousticRegionData"/>
- <s:text name="echobase.common.inProgress"/></title>
-
-<%-- TODO letellier 20111104 : Add warn icon --%>
-<p><s:text name="echobase.message.warnImportInProgress"/></p>
-
-<br/>
-
-<div>
- <sj:progressbar value="%{model.progression}"/>
-</div>
\ No newline at end of file
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesReference.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesReference.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCatchesReference.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,41 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 - 2012 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-
-<s:url id="url" action="import-CatchesReference" namespace="/importData"/>
-<meta http-equiv="refresh" content="1;url=${url}"/>
-
-<title><s:text name="echobase.common.importDataMode.catchesReferences"/> <s:text
- name="echobase.common.inProgress"/></title>
-
-<%-- TODO letellier 20111104 : Add warn icon --%>
-<p><s:text name="echobase.message.warnImportInProgress"/></p>
-
-<br/>
-
-<div>
- <sj:progressbar value="%{model.progression}"/>
-</div>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp (from rev 303, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonDataComplete.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,43 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+
+<s:url id="url" action="import-CommonData" namespace="/importData"/>
+<meta http-equiv="refresh" content="1;url=${url}"/>
+
+<title>
+ <s:text name="echobase.common.importDataMode.commonData"/>
+ <s:text name="echobase.common.inProgress"/>
+</title>
+
+<%-- TODO letellier 20111104 : Add warn icon --%>
+<p><s:text name="echobase.message.warnImportInProgress"/></p>
+
+<br/>
+
+<div>
+ <sj:progressbar value="%{model.progression}"/>
+</div>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonData.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonDataComplete.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonDataComplete.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonDataComplete.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,41 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 - 2012 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-
-<s:url id="url" action="import-CommonDataComplete" namespace="/importData"/>
-<meta http-equiv="refresh" content="1;url=${url}"/>
-
-<title><s:text name="echobase.common.importDataMode.commonDataComplete"/>
- <s:text name="echobase.common.inProgress"/></title>
-
-<%-- TODO letellier 20111104 : Add warn icon --%>
-<p><s:text name="echobase.message.warnImportInProgress"/></p>
-
-<br/>
-
-<div>
- <sj:progressbar value="%{model.progression}"/>
-</div>
\ No newline at end of file
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonDataFromTransect.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonDataFromTransect.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonDataFromTransect.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,42 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 - 2012 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
-
-<s:url id="url" action="import-CommonDataFromTransect" namespace="/importData"/>
-<meta http-equiv="refresh" content="1;url=${url}"/>
-
-<title>
- <s:text name="echobase.common.importDataMode.commonDataFromTransect"/> <s:text
- name="echobase.common.inProgress"/></title>
-
-<%-- TODO letellier 20111104 : Add warn icon --%>
-<p><s:text name="echobase.message.warnImportInProgress"/></p>
-
-<br/>
-
-<div>
- <sj:progressbar value="%{model.progression}"/>
-</div>
\ No newline at end of file
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp (from rev 303, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressCommonDataFromTransect.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,43 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+
+<s:url id="url" action="import-Operation" namespace="/importData"/>
+<meta http-equiv="refresh" content="1;url=${url}"/>
+
+<title>
+ <s:text name="echobase.common.importDataMode.operation"/>
+ <s:text name="echobase.common.inProgress"/>
+</title>
+
+<%-- TODO letellier 20111104 : Add warn icon --%>
+<p><s:text name="echobase.message.warnImportInProgress"/></p>
+
+<br/>
+
+<div>
+ <sj:progressbar value="%{model.progression}"/>
+</div>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressOperation.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp (from rev 303, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressAccousticRegionData.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,43 @@
+<%--
+ #%L
+ EchoBase :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2011 - 2012 Ifremer, Codelutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+
+<s:url id="url" action="import-Results" namespace="/importData"/>
+<meta http-equiv="refresh" content="1;url=${url}"/>
+
+<title>
+ <s:text name="echobase.common.importDataMode.results"/>
+ <s:text name="echobase.common.inProgress"/>
+</title>
+
+<%-- TODO letellier 20111104 : Add warn icon --%>
+<p><s:text name="echobase.message.warnImportInProgress"/></p>
+
+<br/>
+
+<div>
+ <sj:progressbar value="%{model.progression}"/>
+</div>
\ No newline at end of file
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/progressResults.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -24,15 +24,15 @@
<%@page contentType="text/html" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
-<title><s:text name="echobase.common.importResult"/> <s:text
- name="echobase.common.importDataMode.accousticData"/></title>
+<title>
+ <s:text name="echobase.common.importResult"/>
+ <s:text name="echobase.common.importDataMode.accousticData"/>
+</title>
<fieldset>
<legend>
<s:text name="echobase.legend.importData.configuration.resume"/>
</legend>
- <s:label value="%{model.mission.missionName}"
- key='echobase.common.missionName'/>
</fieldset>
<br/>
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticRegionData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticRegionData.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticRegionData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,40 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title><s:text name="echobase.common.importResult"/> <s:text
- name="echobase.common.importDataMode.accousticRegionData"/></title>
-
-<fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configuration.resume"/>
- </legend>
- <s:label value="%{model.mission.missionName}"
- key='echobase.common.missionName'/>
-
-</fieldset>
-<br/>
-
-<div>TODO Result</div>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -24,15 +24,15 @@
<%@page contentType="text/html" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
-<title><s:text name="echobase.common.importResult"/> <s:text
- name="echobase.common.importDataMode.catchesData"/></title>
+<title>
+ <s:text name="echobase.common.importResult"/>
+ <s:text name="echobase.common.importDataMode.catchesData"/>
+</title>
<fieldset>
<legend>
<s:text name="echobase.legend.importData.configuration.resume"/>
</legend>
- <s:label value="%{model.mission.missionName}"
- key='echobase.common.missionName'/>
</fieldset>
<br/>
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesIndividualData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesIndividualData.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesIndividualData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,40 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title><s:text name="echobase.common.importResult"/> <s:text
- name="echobase.common.importDataMode.catchesIndividualData"/></title>
-
-<fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configuration.resume"/>
- </legend>
- <s:label value="%{model.mission.missionName}"
- key='echobase.common.missionName'/>
-
-</fieldset>
-<br/>
-
-<div>TODO Result</div>
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesReference.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesReference.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCatchesReference.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,40 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title><s:text name="echobase.common.importResult"/> <s:text
- name="echobase.common.importDataMode.catchesReferences"/></title>
-
-<fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configuration.resume"/>
- </legend>
- <s:label value="%{model.mission.missionName}"
- key='echobase.common.missionName'/>
-
-</fieldset>
-<br/>
-
-<div>TODO Result</div>
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp (from rev 303, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonDataComplete.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,42 @@
+<%--
+ #%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.common.importResult"/>
+ <s:text name="echobase.common.importDataMode.commonData"/>
+</title>
+
+<fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configuration.resume"/>
+ </legend>
+ <s:label value="%{model.mission.missionName}"
+ key='echobase.common.missionName'/>
+
+</fieldset>
+<br/>
+
+<div>TODO Result</div>
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonData.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonDataComplete.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonDataComplete.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonDataComplete.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,40 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title><s:text name="echobase.common.importResult"/> <s:text
- name="echobase.common.importDataMode.commonDataComplete"/></title>
-
-<fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configuration.resume"/>
- </legend>
- <s:label value="%{model.mission.missionName}"
- key='echobase.common.missionName'/>
-
-</fieldset>
-<br/>
-
-<div>TODO Result</div>
Deleted: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonDataFromTransect.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonDataFromTransect.jsp 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonDataFromTransect.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -1,40 +0,0 @@
-<%--
- #%L
- EchoBase :: UI
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2011 Ifremer, Codelutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@page contentType="text/html" pageEncoding="UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<title><s:text name="echobase.common.importResult"/> <s:text
- name="echobase.common.importDataMode.commonDataFromTransect"/></title>
-
-<fieldset>
- <legend>
- <s:text name="echobase.legend.importData.configuration.resume"/>
- </legend>
- <s:label value="%{model.mission.missionName}"
- key='echobase.common.missionName'/>
-
-</fieldset>
-<br/>
-
-<div>TODO Result</div>
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp (from rev 303, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultCommonDataFromTransect.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,40 @@
+<%--
+ #%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.common.importResult"/>
+ <s:text name="echobase.common.importDataMode.operation"/>
+</title>
+
+<fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configuration.resume"/>
+ </legend>
+
+</fieldset>
+<br/>
+
+<div>TODO Result</div>
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultOperation.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Copied: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp (from rev 303, trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultAccousticRegionData.jsp)
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp (rev 0)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,40 @@
+<%--
+ #%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.common.importResult"/>
+ <s:text name="echobase.common.importDataMode.results"/>
+</title>
+
+<fieldset>
+ <legend>
+ <s:text name="echobase.legend.importData.configuration.resume"/>
+ </legend>
+
+</fieldset>
+<br/>
+
+<div>TODO Result</div>
Property changes on: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/resultResults.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-ui/src/main/webapp/css/screen.css
===================================================================
--- trunk/echobase-ui/src/main/webapp/css/screen.css 2012-01-30 19:18:07 UTC (rev 303)
+++ trunk/echobase-ui/src/main/webapp/css/screen.css 2012-02-02 22:58:29 UTC (rev 304)
@@ -269,3 +269,13 @@
padding-left: 25px;
margin-left:0px;
}
+
+div#wwctrl_mode ul{
+ margin: 5px;
+ padding-left: 5px;
+}
+div#wwctrl_mode ul li{
+ list-style: none;
+ padding-left: 25px;
+ margin-left:0px;
+}
Copied: trunk/src/doc/reunions/reunion-2012-02-01.txt (from rev 303, trunk/src/doc/reunions/reunion-2012-01-12.txt)
===================================================================
--- trunk/src/doc/reunions/reunion-2012-02-01.txt (rev 0)
+++ trunk/src/doc/reunions/reunion-2012-02-01.txt 2012-02-02 22:58:29 UTC (rev 304)
@@ -0,0 +1,120 @@
+projet echobase
+---------------
+
+Mercredi 01 février 2012 (Ifremer)
+
+Présents : Mathieu et Tony
+
+Planning
+--------
+
+- import nouvelles données
+
+Import nouvelles données
+------------------------
+
+- pouvoir créer une nouvelle mission en indépendant (un autre écran)
+
+1) Un seul écran pour importer les données communes :
+
+mode 1: import d'un nouveau voyage / transit / transect
+mode 2: import d'un nouveau transect (renseigné par un voyage + un navire)
+
+OK.
+
+2) Import Operations
+
+- voyage
+- navire (connus dans les transects du voyage)
+
+- format des fichiers à définir
+Operation / OperationMetaData / GearMetaData
+
+OK.
+
+3) Import Samples
+
+- voyage
+- navire
+- fichier Sample
+- fichier SampleData
+- on utilisera une clef temporaire pour lier les Sample et SampleData)
+- pour retrouver les Operations, on se basera sur Operation#id
+
+4) Import Acoustic data
+
+mode 1: (celui implanté) va créer les data acquisition trouvées dans le fichier movie
+mode 2: (a faire) on créer le dataAcquisition uniquement s'il n'existe pas déjà pour le transect.
+
+OK.
+
+Rajouté un boolean (ajout de nouvelles données acoustiques) = mode 2
+OK
+
+- voyage
+- transit
+- navire
+
+- Cell Position Reference rajouter 3 jours une combobox Start - Mid - End pour retrouver
+les metadata à utiliser sur les data ESDU (suffix saufMid-> Bary)
+
+OK.
+
+- prendre en compte le nouveau format movies (suppression colonne) + comment sélectionner les acousticInstrument.
+
+OK réalisé.
+
+5) Import résultats
+
+mode 1: import au niveau du voyage
+ - sélection voyage
+ - fichier echotype
+ - relations taille-poids
+ - relations taille-age
+
+Chaque import est indépendant et optionnel.
+
+OK réalisé.
+
+mode 2: import acoustique
+ - sélection voyage
+ - sélection navire
+
+ on retrouvera les transits via les plages temporelles
+
+- ajoute les celles régions
+
+- et les résultats ???
+
+Charte graphique
+----------------
+
+- pour le désign globale c'est ok
+
+- revoir le logo, mathieu préfère celui en bas à gauche mais changer la police
+(celle du milieu conviennent mieux) et jouer sur le contraste pour le rendre
+plus lisible. ou bien celui avec les cercle concentriques 2ième ne partant du
+bas à droite mais changer la police!!!
+
+Ok envoyé à Aurelie.
+
+Action
+------
+
+- CodeLutin
+
+ - infra des imports
+ - finir import acoustic
+ - commencer import results
+ - relancer Aurelie pour la charte graphique
+ - corriger le journal de bords lors d'un import d'une table (problème de comparaison sur la nulitté).
+
+- Mathieu
+
+ - import operation (format et fichiers à fournir)
+ - import "sample" (format et fichiers à fournir)
+ - import "résultats" (echotype, taille-poids-age), + clarifier la partie acoustic
+
+Prochaine réunion :
+
+ - mercredi 8/02 14h30
\ No newline at end of file
1
0
r303 - in trunk: echobase-entities/src/main/java/fr/ifremer/echobase echobase-services/src/main/java/fr/ifremer/echobase/services echobase-services/src/test/java/fr/ifremer/echobase echobase-services/src/test/java/fr/ifremer/echobase/services echobase-tools/src/test/java/fr/ifremer/echobase/tools echobase-ui/src/main/java/fr/ifremer/echobase/ui echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor
by tchemit@users.forge.codelutin.com 30 Jan '12
by tchemit@users.forge.codelutin.com 30 Jan '12
30 Jan '12
Author: tchemit
Date: 2012-01-30 20:18:07 +0100 (Mon, 30 Jan 2012)
New Revision: 303
Url: http://forge.codelutin.com/repositories/revision/echobase/303
Log:
replace supplier of rootContext by rootContext directly
fix some api broken
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTopiaRootContextFactory.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContextImpl.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EmbeddedApplicationService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/FilterPagerBean.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDbService.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/TestHelper.java
trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/AbstractEchoBaseServiceTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/AbstractToolTest.java
trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/TestHelper.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationContext.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseTopiaTransactionFilter.java
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTopiaRootContextFactory.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTopiaRootContextFactory.java 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseTopiaRootContextFactory.java 2012-01-30 19:18:07 UTC (rev 303)
@@ -23,7 +23,6 @@
*/
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;
@@ -52,22 +51,8 @@
private static final Log log =
LogFactory.getLog(EchoBaseTopiaRootContextFactory.class);
- protected static class EchoBaseTopiaRootContextSupplier implements Supplier<TopiaContext> {
+ public TopiaContext newEmbeddedDatabase(File dir) {
- 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, "db");
String databaseAbsolutePath = databaseFile.getAbsolutePath();
@@ -94,7 +79,7 @@
// add topiaReplicationService in the context
properties.setProperty(TopiaReplicationService.TOPIA_SERVICE_NAME,
- TopiaReplicationServiceImpl.class.getName());
+ TopiaReplicationServiceImpl.class.getName());
TopiaContext rootContext;
try {
@@ -107,17 +92,17 @@
log.debug("will output database in " + databaseAbsolutePath);
}
- return new EchoBaseTopiaRootContextSupplier(rootContext);
+ return rootContext;
}
- public Supplier<TopiaContext> newDatabaseFromConfig(EchoBaseConfiguration config) {
+ public TopiaContext newDatabaseFromConfig(EchoBaseConfiguration config) {
Properties properties = config.getProperties();
return newDatabaseFromProperties(properties);
}
- public Supplier<TopiaContext> newDatabaseFromProperties(Properties properties) {
+ public TopiaContext newDatabaseFromProperties(Properties properties) {
if (log.isDebugEnabled()) {
log.debug("Database settings are :");
@@ -143,6 +128,6 @@
throw new TopiaRuntimeException(e);
}
- return new EchoBaseTopiaRootContextSupplier(rootContext);
+ return rootContext;
}
}
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2012-01-30 19:18:07 UTC (rev 303)
@@ -37,7 +37,6 @@
import fr.ifremer.echobase.services.csv.EntityCsvModel;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaException;
@@ -52,7 +51,6 @@
import org.nuiton.util.csv.ImportExportModel;
import org.nuiton.util.csv.ImportableColumn;
import org.nuiton.util.decorator.JXPathDecorator;
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import java.util.Collection;
import java.util.List;
@@ -182,15 +180,15 @@
ruleFilter = propertyName + " in ( Select f From " + columnMeta.getType().getName() + " f where " + subQuery + ")";
} else {
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
} else {
if (columnMeta.isNumber()) {
- if (columnMeta.getType()==int.class ||
- columnMeta.getType()==Integer.class) {
+ if (columnMeta.getType() == int.class ||
+ columnMeta.getType() == Integer.class) {
realData = Integer.valueOf(data);
} else {
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContextImpl.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContextImpl.java 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EchoBaseServiceContextImpl.java 2012-01-30 19:18:07 UTC (rev 303)
@@ -24,11 +24,9 @@
package fr.ifremer.echobase.services;
import com.google.common.base.Preconditions;
-import com.google.common.base.Supplier;
import fr.ifremer.echobase.EchoBaseConfiguration;
import fr.ifremer.echobase.entities.meta.DbMeta;
import org.nuiton.topia.TopiaContext;
-import org.nuiton.topia.TopiaException;
import java.util.Locale;
@@ -63,19 +61,6 @@
public static EchoBaseServiceContext newContext(
Locale locale,
- Supplier<TopiaContext> topiaContextSupplier,
- EchoBaseConfiguration configuration,
- DbMeta dbMeta,
- EchoBaseServiceFactory serviceFactory) throws TopiaException {
- return newContext(locale,
- topiaContextSupplier.get().beginTransaction(),
- configuration,
- dbMeta,
- serviceFactory);
- }
-
- public static EchoBaseServiceContext newContext(
- Locale locale,
TopiaContext transaction,
EchoBaseConfiguration configuration,
DbMeta dbMeta,
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EmbeddedApplicationService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EmbeddedApplicationService.java 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/EmbeddedApplicationService.java 2012-01-30 19:18:07 UTC (rev 303)
@@ -25,7 +25,6 @@
import com.google.common.base.Charsets;
import com.google.common.base.Preconditions;
-import com.google.common.base.Supplier;
import fr.ifremer.echobase.EchoBaseIOUtil;
import fr.ifremer.echobase.EchoBaseTechnicalException;
import fr.ifremer.echobase.EchoBaseTopiaRootContextFactory;
@@ -176,11 +175,9 @@
model.incrementsProgression();
// create new h2 db
- Supplier<TopiaContext> topiaContextSupplier =
+ TopiaContext rootContext =
new EchoBaseTopiaRootContextFactory().newEmbeddedDatabase(zipDirectory);
- TopiaContext rootContext = topiaContextSupplier.get();
-
TopiaContext topiaContext = rootContext.beginTransaction();
try {
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/FilterPagerBean.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/FilterPagerBean.java 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/FilterPagerBean.java 2012-01-30 19:18:07 UTC (rev 303)
@@ -26,7 +26,6 @@
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.nuiton.util.PagerUtil;
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import java.io.Serializable;
import java.util.Collection;
@@ -176,14 +175,14 @@
in {
@Override
public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
},
/** Not is among operator. */
ni {
@Override
public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
};
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDbService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDbService.java 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ImportDbService.java 2012-01-30 19:18:07 UTC (rev 303)
@@ -163,7 +163,7 @@
static class MyImportToMap extends ImportToMap {
- public static MyImportToMap newImport(ImportModel<Map<String, Object>> model,
+ public static MyImportToMap newImportToMap(ImportModel<Map<String, Object>> model,
Reader reader) {
return new MyImportToMap(model, reader);
}
@@ -194,7 +194,7 @@
AssociationMeta meta = (AssociationMeta) entry;
ImportModel<Map<String, Object>> model =
importService.buildForImport(meta);
- ImportToMap importer = MyImportToMap.newImport(model, reader);
+ ImportToMap importer = MyImportToMap.newImportToMap(model, reader);
try {
importAssociationfile(meta, importer, csvResult);
Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/TestHelper.java
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/TestHelper.java 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/TestHelper.java 2012-01-30 19:18:07 UTC (rev 303)
@@ -23,7 +23,6 @@
*/
package fr.ifremer.echobase;
-import com.google.common.base.Supplier;
import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
import org.apache.commons.io.FileUtils;
import org.junit.Ignore;
@@ -70,9 +69,8 @@
EchoBaseTopiaRootContextFactory factory =
new EchoBaseTopiaRootContextFactory();
- Supplier<TopiaContext> topiaContextSupplier =
- factory.newEmbeddedDatabase(dbDir);
- return topiaContextSupplier.get();
+ TopiaContext context = factory.newEmbeddedDatabase(dbDir);
+ return context;
}
/**
Modified: trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/AbstractEchoBaseServiceTest.java
===================================================================
--- trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/AbstractEchoBaseServiceTest.java 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-services/src/test/java/fr/ifremer/echobase/services/AbstractEchoBaseServiceTest.java 2012-01-30 19:18:07 UTC (rev 303)
@@ -23,7 +23,6 @@
*/
package fr.ifremer.echobase.services;
-import com.google.common.base.Supplier;
import fr.ifremer.echobase.EchoBaseConfiguration;
import fr.ifremer.echobase.EchoBaseTopiaRootContextFactory;
import fr.ifremer.echobase.TestHelper;
@@ -67,8 +66,7 @@
new EchoBaseTopiaRootContextFactory();
File basedir = TestHelper.getBasedir();
File target = new File(basedir, "/target");
- Supplier<TopiaContext> topiaContextSupplier = factory.newEmbeddedDatabase(target);
- TopiaContext rootContext = topiaContextSupplier.get();
+ TopiaContext rootContext = factory.newEmbeddedDatabase(target);
transaction = rootContext.beginTransaction();
}
return transaction;
Modified: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/AbstractToolTest.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/AbstractToolTest.java 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/AbstractToolTest.java 2012-01-30 19:18:07 UTC (rev 303)
@@ -23,7 +23,6 @@
*/
package fr.ifremer.echobase.tools;
-import com.google.common.base.Supplier;
import fr.ifremer.echobase.EchoBaseConfiguration;
import fr.ifremer.echobase.EchoBaseTopiaRootContextFactory;
import fr.ifremer.echobase.entities.EchoBaseDAOHelper;
@@ -64,7 +63,7 @@
protected EchoBaseServiceContext serviceContext;
- protected Supplier<TopiaContext> topiaContextSupplier;
+ protected TopiaContext topiaContext;
protected File testdir;
@@ -91,11 +90,11 @@
EchoBaseTopiaRootContextFactory factory =
new EchoBaseTopiaRootContextFactory();
- topiaContextSupplier = factory.newEmbeddedDatabase(testdir);
+ topiaContext = factory.newEmbeddedDatabase(testdir);
serviceContext = EchoBaseServiceContextImpl.newContext(
Locale.getDefault(),
- topiaContextSupplier,
+ topiaContext,
configuration,
DbMeta.newDbMeta(),
new EchoBaseServiceFactory()
@@ -108,7 +107,7 @@
try {
serviceContext.getTransaction().closeContext();
} finally {
- topiaContextSupplier.get().closeContext();
+ topiaContext.closeContext();
}
}
Modified: trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/TestHelper.java
===================================================================
--- trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/TestHelper.java 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-tools/src/test/java/fr/ifremer/echobase/tools/TestHelper.java 2012-01-30 19:18:07 UTC (rev 303)
@@ -23,7 +23,6 @@
*/
package fr.ifremer.echobase.tools;
-import com.google.common.base.Supplier;
import fr.ifremer.echobase.EchoBaseTopiaRootContextFactory;
import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
import org.apache.commons.io.FileUtils;
@@ -99,9 +98,8 @@
EchoBaseTopiaRootContextFactory factory =
new EchoBaseTopiaRootContextFactory();
- Supplier<TopiaContext> topiaContextSupplier =
- factory.newEmbeddedDatabase(dbDir);
- return topiaContextSupplier.get();
+ TopiaContext context = factory.newEmbeddedDatabase(dbDir);
+ return context;
}
/**
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationContext.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationContext.java 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationContext.java 2012-01-30 19:18:07 UTC (rev 303)
@@ -23,7 +23,6 @@
*/
package fr.ifremer.echobase.ui;
-import com.google.common.base.Supplier;
import fr.ifremer.echobase.EchoBaseConfiguration;
import fr.ifremer.echobase.entities.meta.DbMeta;
import org.nuiton.topia.TopiaContext;
@@ -35,9 +34,10 @@
public class EchoBaseApplicationContext {
protected EchoBaseConfiguration configuration;
+
protected DbMeta dbMeta;
- protected Supplier<TopiaContext> rootContextSupplier;
+ protected TopiaContext rootContext;
public EchoBaseConfiguration getConfiguration() {
return configuration;
@@ -47,12 +47,12 @@
this.configuration = configuration;
}
- public Supplier<TopiaContext> getRootContextSupplier() {
- return rootContextSupplier;
+ public TopiaContext getRootContext() {
+ return rootContext;
}
- public void setRootContextSupplier(Supplier<TopiaContext> rootContextSupplier) {
- this.rootContextSupplier = rootContextSupplier;
+ public void setRootContext(TopiaContext rootContext) {
+ this.rootContext = rootContext;
}
public DbMeta getDbMeta() {
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseApplicationListener.java 2012-01-30 19:18:07 UTC (rev 303)
@@ -23,7 +23,6 @@
*/
package fr.ifremer.echobase.ui;
-import com.google.common.base.Supplier;
import fr.ifremer.echobase.EchoBaseConfiguration;
import fr.ifremer.echobase.EchoBaseTechnicalException;
import fr.ifremer.echobase.EchoBaseTopiaRootContextFactory;
@@ -45,7 +44,6 @@
import org.nuiton.i18n.init.DefaultI18nInitializer;
import org.nuiton.topia.TopiaContext;
import org.nuiton.topia.TopiaException;
-import org.nuiton.topia.framework.TopiaContextImplementor;
import org.nuiton.topia.framework.TopiaUtil;
import org.nuiton.util.converter.ConverterUtil;
@@ -54,7 +52,6 @@
import java.util.Date;
import java.util.List;
import java.util.Locale;
-import java.util.Properties;
/**
* To listen start or end of the application.
@@ -73,7 +70,7 @@
protected static final Log log =
LogFactory.getLog(EchoBaseApplicationListener.class);
- private Supplier<TopiaContext> rootContextSupplier;
+ private TopiaContext rootContext;
@Override
public void contextInitialized(ServletContextEvent sce) {
@@ -100,8 +97,8 @@
}
EchoBaseTopiaRootContextFactory factory =
new EchoBaseTopiaRootContextFactory();
- rootContextSupplier = factory.newDatabaseFromConfig(configuration);
- applicationContext.setRootContextSupplier(rootContextSupplier);
+ rootContext = factory.newDatabaseFromConfig(configuration);
+ applicationContext.setRootContext(rootContext);
DbMeta dbMeta = DbMeta.newDbMeta();
applicationContext.setDbMeta(dbMeta);
@@ -115,11 +112,24 @@
// init database (and create minimal admin user if required)
try {
- boolean schemaExist = isSchemaCreated();
+ boolean schemaExist = TopiaUtil.isSchemaExist(
+ rootContext,
+ EchoBaseUserImpl.class.getName()
+ );
if (!schemaExist ||
- configuration.getOptionAsBoolean(EchoBaseConfiguration.OPTION_UPDATE_SCHEMA)) {
+ configuration.getOptionAsBoolean(EchoBaseConfiguration.OPTION_UPDATE_SCHEMA)) {
- updateSchema(configuration, schemaExist);
+ if (schemaExist) {
+ if (log.isInfoEnabled()) {
+ log.info("Will update schema...");
+ }
+ rootContext.updateSchema();
+ } else {
+ if (log.isInfoEnabled()) {
+ log.info("Will create schema...");
+ }
+ rootContext.createSchema();
+ }
}
createAdminUser(applicationContext);
@@ -134,11 +144,10 @@
if (log.isInfoEnabled()) {
log.info("Application is ending at " + new Date() + "...");
}
- if (rootContextSupplier != null) {
+ if (rootContext != null) {
if (log.isInfoEnabled()) {
log.info("Shuting down RootContextSupplier...");
}
- TopiaContext rootContext = rootContextSupplier.get();
if (!rootContext.isClosed()) {
try {
rootContext.closeContext();
@@ -151,36 +160,6 @@
}
}
- protected void updateSchema(EchoBaseConfiguration configuration, boolean isCreated) throws TopiaException {
- if (log.isInfoEnabled()) {
- log.info("Will create or update schema for db.");
- }
- // must create the schema
-
- Properties dbConf = configuration.getProperties();
-
- dbConf.put("hibernate.hbm2ddl.auto", isCreated?"update": "create");
-
- EchoBaseTopiaRootContextFactory factory =
- new EchoBaseTopiaRootContextFactory();
- Supplier<TopiaContext> topiaContextSupplier =
- factory.newDatabaseFromProperties(dbConf);
-
- // start a connexion to load schema
- TopiaContext tx = null;
-
- try {
- tx = topiaContextSupplier.get().beginTransaction();
-
- } finally {
-
- // no more update of schema...
- dbConf.put("hibernate.hbm2ddl.auto", "none");
-
- closeTransaction(tx);
- }
- }
-
/**
* Creates the adminsitrator ({@code admin/admin}) on the database.
*
@@ -194,7 +173,7 @@
EchoBaseServiceFactory serviceFactory =
new EchoBaseServiceFactory();
- TopiaContext transaction = rootContextSupplier.get().beginTransaction();
+ TopiaContext transaction = rootContext.beginTransaction();
try {
EchoBaseServiceContext serviceContext = EchoBaseServiceContextImpl.newContext(
@@ -215,7 +194,7 @@
// no users in database create the admin user
if (log.isInfoEnabled()) {
log.info("No user in database, will create default " +
- "admin user (password admin).");
+ "admin user (password admin).");
}
service.createDefaultUsers();
@@ -225,24 +204,6 @@
}
}
- protected boolean isSchemaCreated() throws TopiaException {
-
- TopiaContextImplementor tx =
- (TopiaContextImplementor)
- rootContextSupplier.get();
- try {
- boolean schemaFound = TopiaUtil.isSchemaExist(
- tx,
- EchoBaseUserImpl.class.getName()
- );
-
- return schemaFound;
-
- } finally {
- closeTransaction(tx);
- }
- }
-
/**
* Try to close the given transaction.
*
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseTopiaTransactionFilter.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseTopiaTransactionFilter.java 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/EchoBaseTopiaTransactionFilter.java 2012-01-30 19:18:07 UTC (rev 303)
@@ -23,7 +23,6 @@
*/
package fr.ifremer.echobase.ui;
-import com.google.common.base.Supplier;
import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -48,10 +47,8 @@
protected TopiaContext beginTransaction() throws TopiaRuntimeException {
EchoBaseApplicationContext applicationContext =
EchoBaseActionSupport.getEchoBaseApplicationContext();
- Supplier<TopiaContext> rootContextSupplier =
- applicationContext.getRootContextSupplier();
- TopiaContext rootContext = rootContextSupplier.get();
+ TopiaContext rootContext = applicationContext.getRootContext();
try {
TopiaContext transaction = rootContext.beginTransaction();
if (log.isDebugEnabled()) {
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2012-01-27 22:17:32 UTC (rev 302)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2012-01-30 19:18:07 UTC (rev 303)
@@ -279,12 +279,6 @@
searchoptions="{sopt:['eq','ne','cn','nc','bw','bn','ew','en','lt','le','gt','ge','nu','nn']}"
sortable="true"/>
</s:elseif>
- <%--s:elseif test="#meta.number">
- <sjg:gridColumn name="%{#meta.name}"
- title="%{#meta.name}"
- searchoptions="{sopt:['eq','ne','cn','nc','bw','bn','ew','en','lt','le','gt','ge','nu','nn']}"
- sortable="true"/>
- </s:elseif--%>
<s:else>
<sjg:gridColumn name="%{#meta.name}"
title="%{#meta.name}"
1
0
r302 - in trunk: echobase-entities/src/main/java/fr/ifremer/echobase/entities/meta echobase-services/src/main/java/fr/ifremer/echobase/services echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor
by tchemit@users.forge.codelutin.com 27 Jan '12
by tchemit@users.forge.codelutin.com 27 Jan '12
27 Jan '12
Author: tchemit
Date: 2012-01-27 23:17:32 +0100 (Fri, 27 Jan 2012)
New Revision: 302
Url: http://forge.codelutin.com/repositories/revision/echobase/302
Log:
Evolution #673: Rendre op?\195?\169rationnel les filtres sur l'?\195?\169diteur d'entit?\195?\169
Modified:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/meta/ColumnMeta.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/FilterPagerBean.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/GetEntities.java
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp
Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/meta/ColumnMeta.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/meta/ColumnMeta.java 2012-01-27 18:06:10 UTC (rev 301)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/meta/ColumnMeta.java 2012-01-27 22:17:32 UTC (rev 302)
@@ -24,6 +24,7 @@
package fr.ifremer.echobase.entities.meta;
import org.nuiton.topia.persistence.TopiaEntity;
+import org.nuiton.util.ObjectUtil;
import java.io.Serializable;
import java.util.Date;
@@ -75,13 +76,17 @@
}
public boolean isDate() {
- return Date.class.equals(type);
+ return Date.class.isAssignableFrom(type);
}
public boolean isBoolean() {
return boolean.class.equals(type);
}
+ public boolean isNumber() {
+ return !isBoolean() && (type.isPrimitive() || Number.class.isAssignableFrom(type));
+ }
+
protected ColumnMeta(String name, Class<?> type) {
this.name = name;
this.type = type;
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2012-01-27 18:06:10 UTC (rev 301)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2012-01-27 22:17:32 UTC (rev 302)
@@ -37,6 +37,7 @@
import fr.ifremer.echobase.services.csv.EntityCsvModel;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.TopiaException;
@@ -50,6 +51,8 @@
import org.nuiton.util.csv.ExportableColumn;
import org.nuiton.util.csv.ImportExportModel;
import org.nuiton.util.csv.ImportableColumn;
+import org.nuiton.util.decorator.JXPathDecorator;
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import java.util.Collection;
import java.util.List;
@@ -136,65 +139,76 @@
if (pager != null && pager.canFilter()) {
+ DecoratorService decoratorService = getDecoratorService();
+
// prepare the filter hql code
List<FilterPagerBean.FilterRule> rules = pager.getRules();
List<String> strFilterRules = Lists.newLinkedList();
+ long timestamp = System.currentTimeMillis();
+ int index = 0;
for (FilterPagerBean.FilterRule rule : rules) {
String ruleFilter = null;
String field = rule.getField();
+
+ ColumnMeta columnMeta = tableMeta.getColumns(field);
+ Preconditions.checkNotNull(
+ columnMeta, "no property named " + columnMeta);
+
FilterPagerBean.Operation op = rule.getOp();
String data = rule.getData();
- String paramName = field + "_" + System.currentTimeMillis();
+ String paramName = field + "_" + timestamp + (index++);
String propertyName = "e." + field;
- switch (op) {
- case eq:
- ruleFilter = propertyName + " = :" + paramName;
- filterParams.put(paramName, data);
- break;
- case ne:
- ruleFilter = propertyName + " != :" + paramName;
- filterParams.put(paramName, data);
- break;
- case cn:
- ruleFilter = propertyName + " like :" + paramName;
- filterParams.put(paramName, data);
- break;
- case nc:
- ruleFilter = propertyName + " not like :" + paramName;
- filterParams.put(paramName, data);
- break;
- case bw:
- break;
- case bn:
- break;
- case ew:
- break;
- case en:
- break;
- case lt:
- break;
- case le:
- break;
- case gt:
- break;
- case ge:
- break;
- case nu:
- ruleFilter = propertyName + " is null";
- break;
- case nn:
- ruleFilter = propertyName + " is not null";
- break;
- case in:
- break;
- case ni:
- break;
+ Object realData = data;
+ if (columnMeta.isFK()) {
+
+ // must do a select in using the decoration pattern
+
+ JXPathDecorator<?> decorator =
+ (JXPathDecorator<?>) decoratorService.getDecorator(getLocale(),
+ columnMeta.getType(),
+ null);
+
+ if (decorator.getNbToken() == 1) {
+
+ // simple case one token
+ String token = "f." + decorator.getProperty(0);
+
+ String subQuery = op.toHql(paramName,
+ token,
+ data,
+ filterParams);
+
+ ruleFilter = propertyName + " in ( Select f From " + columnMeta.getType().getName() + " f where " + subQuery + ")";
+ } else {
+
+ throw new NotImplementedException();
+ }
+
+
+ } else {
+
+ if (columnMeta.isNumber()) {
+ if (columnMeta.getType()==int.class ||
+ columnMeta.getType()==Integer.class) {
+ realData = Integer.valueOf(data);
+ } else {
+
+ realData = Double.valueOf(data);
+ }
+ } else if (columnMeta.isDate()) {
+ propertyName = "str(" + propertyName + ")";
+ }
+ ruleFilter = op.toHql(paramName,
+ propertyName,
+ realData,
+ filterParams);
+
}
- if (ruleFilter != null) {
- ruleFilter = "(" + ruleFilter + ")";
- strFilterRules.add(ruleFilter);
- }
+
+
+ strFilterRules.add("(" + ruleFilter + ")");
+
}
if (CollectionUtils.isNotEmpty(strFilterRules)) {
@@ -217,6 +231,11 @@
countQuery.addParam(paramName, paramValue);
}
countQuery.addWhere(filterHql);
+
+ String fullQuery = countQuery.fullQuery();
+ if (log.isInfoEnabled()) {
+ log.info("fullquery = " + fullQuery);
+ }
}
int count = dao.countByQuery(countQuery);
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/FilterPagerBean.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/FilterPagerBean.java 2012-01-27 18:06:10 UTC (rev 301)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/FilterPagerBean.java 2012-01-27 22:17:32 UTC (rev 302)
@@ -26,6 +26,7 @@
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.nuiton.util.PagerUtil;
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import java.io.Serializable;
import java.util.Collection;
@@ -48,37 +49,145 @@
public enum Operation {
/** Equals operator. */
- eq,
+ eq {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " = :" + paramName;
+ filterParams.put(paramName, data);
+ return ruleFilter;
+ }
+ },
/** Not equals operator. */
- ne,
+ ne {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " != :" + paramName;
+ filterParams.put(paramName, data);
+ return ruleFilter;
+ }
+ },
/** Contains operator. */
- cn,
+ cn {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " like :" + paramName;
+ filterParams.put(paramName, "%" + data + "%");
+ return ruleFilter;
+ }
+ },
/** Not contains operator. */
- nc,
+ nc {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " not like :" + paramName;
+ filterParams.put(paramName, "%" + data + "%");
+ return ruleFilter;
+ }
+ },
/** Begins with operator. */
- bw,
+ bw {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " like :" + paramName;
+ filterParams.put(paramName, data + "%");
+ return ruleFilter;
+ }
+ },
/** Not between with operator. */
- bn,
+ bn {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " not like :" + paramName;
+ filterParams.put(paramName, data + "%");
+ return ruleFilter;
+ }
+ },
/** Ends with operator. */
- ew,
+ ew {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " like :" + paramName;
+ filterParams.put(paramName, "%" + data);
+ return ruleFilter;
+ }
+ },
/** Not End with operator. */
- en,
+ en {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " not like :" + paramName;
+ filterParams.put(paramName, "%" + data);
+ return ruleFilter;
+ }
+ },
/** Lesser than operator. */
- lt,
+ lt {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " < :" + paramName;
+ filterParams.put(paramName, data);
+ return ruleFilter;
+ }
+ },
/** Lesser or equals operator. */
- le,
+ le {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " <= :" + paramName;
+ filterParams.put(paramName, data);
+ return ruleFilter;
+ }
+ },
/** Greater than operator. */
- gt,
+ gt {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " > :" + paramName;
+ filterParams.put(paramName, data);
+ return ruleFilter;
+ }
+ },
/** Greater or equals operator. */
- ge,
+ ge {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " >= :" + paramName;
+ filterParams.put(paramName, data);
+ return ruleFilter;
+ }
+ },
/** Is null operator. */
- nu,
+ nu {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " is null";
+ return ruleFilter;
+ }
+ },
/** Is not null operator. */
- nn,
+ nn {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ String ruleFilter = propertyName + " is not null";
+ return ruleFilter;
+ }
+ },
/** Is among operator. */
- in,
+ in {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ throw new NotImplementedException();
+ }
+ },
/** Not is among operator. */
- ni
+ ni {
+ @Override
+ public String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams) {
+ throw new NotImplementedException();
+ }
+ };
+
+ public abstract String toHql(String paramName, String propertyName, Object data, Map<String, Object> filterParams);
}
public static class FilterRule implements Serializable {
@@ -122,7 +231,7 @@
}
public boolean canFilter() {
- return groupOp!=null && CollectionUtils.isNotEmpty(rules);
+ return groupOp != null && CollectionUtils.isNotEmpty(rules);
}
protected OperationGroup groupOp;
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/GetEntities.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/GetEntities.java 2012-01-27 18:06:10 UTC (rev 301)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/GetEntities.java 2012-01-27 22:17:32 UTC (rev 302)
@@ -92,10 +92,6 @@
log.debug("sord = " + ascendantOrder);
}
- if (log.isInfoEnabled()) {
- log.info("filter " + getFilters());
- }
-
DbEditorService service = newService(DbEditorService.class);
datas = service.getDatas(
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2012-01-27 18:06:10 UTC (rev 301)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2012-01-27 22:17:32 UTC (rev 302)
@@ -253,7 +253,7 @@
rowList="10,15,20,50,100,250,500" rowNum="10"
onSelectRowTopics="datas-rowSelect"
onCompleteTopics="datas-clearSelect,datas-CompleteTopics"
- navigatorSearchOptions="{multipleGroup:false,multipleSearch:true,sopt:['eq','ne','cn','nc','lt','gt','nu','nn']}">
+ navigatorSearchOptions="{multipleGroup:false,multipleSearch:true,sopt:['eq','ne','cn','nc','bw','bn','ew','en','lt','le','gt','ge','nu','nn']}">
<%--navigatorSearchOptions="{multipleGroup:false,showQuery:true,multipleSearch:true,sopt:['eq','ne','cn','nc','bw','bn','ew','en','lt','le','gt','ge','nu','nn','in','ni']}"--%>
@@ -265,20 +265,32 @@
<sjg:gridColumn name="%{#meta.name}"
title="%{#meta.name}"
formatter='formatEntityLabel'
+ searchoptions="{sopt:['eq','ne','cn','nc','bw','bn','ew','en','nu','nn']}"
sortable="true"/>
</s:if>
<s:elseif test="#meta.name == 'id'">
<sjg:gridColumn name="ID"
title="id"
- sortable="true" editable="true"/>
+ sortable="true"/>
</s:elseif>
+ <s:elseif test="#meta.date || #meta.number">
+ <sjg:gridColumn name="%{#meta.name}"
+ title="%{#meta.name}"
+ searchoptions="{sopt:['eq','ne','cn','nc','bw','bn','ew','en','lt','le','gt','ge','nu','nn']}"
+ sortable="true"/>
+ </s:elseif>
+ <%--s:elseif test="#meta.number">
+ <sjg:gridColumn name="%{#meta.name}"
+ title="%{#meta.name}"
+ searchoptions="{sopt:['eq','ne','cn','nc','bw','bn','ew','en','lt','le','gt','ge','nu','nn']}"
+ sortable="true"/>
+ </s:elseif--%>
<s:else>
<sjg:gridColumn name="%{#meta.name}"
title="%{#meta.name}"
- sortable="true" editable="true"/>
+ searchoptions="{sopt:['eq','ne','cn','nc','bw','bn','ew','en','nu','nn']}"
+ sortable="true"/>
</s:else>
-
-
</s:iterator>
</sjg:grid>
1
0
r301 - in trunk: echobase-services/src/main/java/fr/ifremer/echobase/services echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor
by tchemit@users.forge.codelutin.com 27 Jan '12
by tchemit@users.forge.codelutin.com 27 Jan '12
27 Jan '12
Author: tchemit
Date: 2012-01-27 19:06:10 +0100 (Fri, 27 Jan 2012)
New Revision: 301
Url: http://forge.codelutin.com/repositories/revision/echobase/301
Log:
Evolution #673: Rendre op?\195?\169rationnel les filtres sur l'?\195?\169diteur d'entit?\195?\169
Added:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/FilterPagerBean.java
Modified:
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/AbstractJSONPaginedAction.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/GetEntities.java
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2012-01-27 15:50:00 UTC (rev 300)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2012-01-27 18:06:10 UTC (rev 301)
@@ -24,6 +24,7 @@
package fr.ifremer.echobase.services;
import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import fr.ifremer.echobase.EchoBaseTechnicalException;
import fr.ifremer.echobase.entities.EchoBaseEntityEnum;
@@ -34,6 +35,7 @@
import fr.ifremer.echobase.entities.meta.TableMeta;
import fr.ifremer.echobase.services.csv.CsvModelUtil;
import fr.ifremer.echobase.services.csv.EntityCsvModel;
+import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -88,7 +90,7 @@
//TODO Use an object to filter datas
public Map<?, ?>[] getDatas(EchoBaseEntityEnum entityType,
- PagerUtil.PagerBean pager,
+ FilterPagerBean pager,
String sidx,
Boolean ascendantOrder) {
@@ -115,7 +117,7 @@
}
public <E extends TopiaEntity> List<E> getEntities(TableMeta tableMeta,
- PagerUtil.PagerBean pager,
+ FilterPagerBean pager,
String sidx,
Boolean ascendantOrder,
String extraWhereQuery) {
@@ -128,6 +130,95 @@
// first query to count datas
TopiaQuery countQuery = dao.createQuery("e");
countQuery.addSelect("count(*)");
+ String filterHql = null;
+
+ Map<String, Object> filterParams = Maps.newHashMap();
+
+ if (pager != null && pager.canFilter()) {
+
+ // prepare the filter hql code
+ List<FilterPagerBean.FilterRule> rules = pager.getRules();
+ List<String> strFilterRules = Lists.newLinkedList();
+ for (FilterPagerBean.FilterRule rule : rules) {
+ String ruleFilter = null;
+
+ String field = rule.getField();
+ FilterPagerBean.Operation op = rule.getOp();
+ String data = rule.getData();
+ String paramName = field + "_" + System.currentTimeMillis();
+ String propertyName = "e." + field;
+ switch (op) {
+ case eq:
+ ruleFilter = propertyName + " = :" + paramName;
+ filterParams.put(paramName, data);
+ break;
+ case ne:
+ ruleFilter = propertyName + " != :" + paramName;
+ filterParams.put(paramName, data);
+ break;
+ case cn:
+ ruleFilter = propertyName + " like :" + paramName;
+ filterParams.put(paramName, data);
+ break;
+ case nc:
+ ruleFilter = propertyName + " not like :" + paramName;
+ filterParams.put(paramName, data);
+ break;
+ case bw:
+ break;
+ case bn:
+ break;
+ case ew:
+ break;
+ case en:
+ break;
+ case lt:
+ break;
+ case le:
+ break;
+ case gt:
+ break;
+ case ge:
+ break;
+ case nu:
+ ruleFilter = propertyName + " is null";
+ break;
+ case nn:
+ ruleFilter = propertyName + " is not null";
+ break;
+ case in:
+ break;
+ case ni:
+ break;
+ }
+ if (ruleFilter != null) {
+ ruleFilter = "(" + ruleFilter + ")";
+ strFilterRules.add(ruleFilter);
+ }
+ }
+
+ if (CollectionUtils.isNotEmpty(strFilterRules)) {
+ FilterPagerBean.OperationGroup groupOp = pager.getGroupOp();
+ filterHql = StringUtils.join(strFilterRules, groupOp.name());
+ }
+ }
+
+ if (filterHql != null) {
+ if (log.isInfoEnabled()) {
+ log.info("filterHql = " + filterHql);
+ }
+ for (Map.Entry<String, Object> e : filterParams.entrySet()) {
+ String paramName = e.getKey();
+ Object paramValue = e.getValue();
+ if (log.isInfoEnabled()) {
+ log.info("filterParam = " +
+ paramName + "/" + paramValue);
+ }
+ countQuery.addParam(paramName, paramValue);
+ }
+ countQuery.addWhere(filterHql);
+ }
+
int count = dao.countByQuery(countQuery);
TopiaQuery query = dao.createQuery("e");
@@ -148,6 +239,15 @@
log.debug("pageCount= " + pager.getPagesNumber());
}
+ if (filterHql != null) {
+ for (Map.Entry<String, Object> entry : filterParams.entrySet()) {
+ String paramName = entry.getKey();
+ Object paramValue = entry.getValue();
+ query.addParam(paramName, paramValue);
+ }
+ query.addWhere(filterHql);
+ }
+
if (StringUtils.isNotEmpty(sidx)) {
if (ascendantOrder) {
query.addOrder(sidx);
Added: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/FilterPagerBean.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/FilterPagerBean.java (rev 0)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/FilterPagerBean.java 2012-01-27 18:06:10 UTC (rev 301)
@@ -0,0 +1,186 @@
+/*
+ * #%L
+ * EchoBase :: Services
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.collect.Lists;
+import org.apache.commons.collections.CollectionUtils;
+import org.nuiton.util.PagerUtil;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Pager bean with filtering datas.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class FilterPagerBean extends PagerUtil.PagerBean {
+
+ private static final long serialVersionUID = 1L;
+
+ public enum OperationGroup {
+ OR, AND
+ }
+
+ public enum Operation {
+ /** Equals operator. */
+ eq,
+ /** Not equals operator. */
+ ne,
+ /** Contains operator. */
+ cn,
+ /** Not contains operator. */
+ nc,
+ /** Begins with operator. */
+ bw,
+ /** Not between with operator. */
+ bn,
+ /** Ends with operator. */
+ ew,
+ /** Not End with operator. */
+ en,
+ /** Lesser than operator. */
+ lt,
+ /** Lesser or equals operator. */
+ le,
+ /** Greater than operator. */
+ gt,
+ /** Greater or equals operator. */
+ ge,
+ /** Is null operator. */
+ nu,
+ /** Is not null operator. */
+ nn,
+ /** Is among operator. */
+ in,
+ /** Not is among operator. */
+ ni
+ }
+
+ public static class FilterRule implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected final Operation op;
+
+ protected final String field;
+
+ protected final String data;
+
+ public FilterRule(Operation op,
+ String field,
+ String data) {
+ this.op = op;
+ this.field = field;
+ this.data = data;
+ }
+
+ public Operation getOp() {
+ return op;
+ }
+
+ public String getField() {
+ return field;
+ }
+
+ public String getData() {
+ return data;
+ }
+ }
+
+ public static FilterPagerBeanBuilder newFilterPagerBeanBuilder(String operationGroup) {
+ OperationGroup operationGroup1 = OperationGroup.valueOf(operationGroup);
+ FilterPagerBeanBuilder builder = new FilterPagerBeanBuilder(operationGroup1);
+ return builder;
+ }
+
+ public FilterPagerBean() {
+ }
+
+ public boolean canFilter() {
+ return groupOp!=null && CollectionUtils.isNotEmpty(rules);
+ }
+
+ protected OperationGroup groupOp;
+
+ private List<FilterRule> rules;
+
+ public OperationGroup getGroupOp() {
+ return groupOp;
+ }
+
+ public void setGroupOp(OperationGroup groupOp) {
+ this.groupOp = groupOp;
+ }
+
+ public List<FilterRule> getRules() {
+ return rules;
+ }
+
+ public void setRules(List<FilterRule> rules) {
+ this.rules = rules;
+ }
+
+ public static class FilterPagerBeanBuilder {
+
+ protected final OperationGroup groupOp;
+
+ protected final List<FilterRule> rules;
+
+ public FilterPagerBeanBuilder(OperationGroup groupOp) {
+ this.groupOp = groupOp;
+ rules = Lists.newLinkedList();
+ }
+
+ public FilterPagerBeanBuilder addOperations(Collection<Map<String, String>> operations) {
+ for (Map<String, String> operation : operations) {
+ addRule(operation);
+ }
+ return this;
+ }
+
+ public FilterPagerBeanBuilder addRule(Map<String, String> ruleMap) {
+ String op = ruleMap.get("op");
+ String property = ruleMap.get("field");
+ String value = ruleMap.get("data");
+ Operation operator = Operation.valueOf(op);
+ return addRule(new FilterRule(operator, property, value));
+ }
+
+ public FilterPagerBeanBuilder addRule(FilterRule rule) {
+ rules.add(rule);
+ return this;
+ }
+
+ public void flush(FilterPagerBean bean) {
+ bean.setGroupOp(groupOp);
+ bean.setRules(rules);
+ }
+
+
+ }
+}
Property changes on: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/FilterPagerBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/AbstractJSONPaginedAction.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/AbstractJSONPaginedAction.java 2012-01-27 15:50:00 UTC (rev 300)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/AbstractJSONPaginedAction.java 2012-01-27 18:06:10 UTC (rev 301)
@@ -23,11 +23,14 @@
*/
package fr.ifremer.echobase.ui.actions;
+import fr.ifremer.echobase.services.FilterPagerBean;
import org.apache.commons.lang3.StringUtils;
import org.apache.struts2.json.JSONException;
import org.apache.struts2.json.JSONUtil;
-import org.nuiton.util.PagerUtil;
+import java.util.Collection;
+import java.util.Map;
+
/**
* Abstract JSON action with pagination support.
*
@@ -46,7 +49,7 @@
public abstract Integer getRecords();
- protected PagerUtil.PagerBean pager = PagerUtil.newPagerBean();
+ protected FilterPagerBean pager = new FilterPagerBean();
// sorting order - asc or desc
protected String sord;
@@ -108,11 +111,19 @@
return StringUtils.isNotEmpty(sidx);
}
- protected Object getFilterObject() throws JSONException {
- Object filterObject = null;
+ protected void initFilter() throws JSONException {
+
if (StringUtils.isNotEmpty(filters)) {
- filterObject = JSONUtil.deserialize(filters);
+ Map<String, Object> filterObject =
+ (Map<String, Object>) JSONUtil.deserialize(filters);
+
+ String groupOp = (String) filterObject.get("groupOp");
+ Collection<Map<String, String>> rules =
+ (Collection<Map<String, String>>) filterObject.get("rules");
+
+ FilterPagerBean.newFilterPagerBeanBuilder(groupOp).
+ addOperations(rules).
+ flush(pager);
}
- return filterObject;
}
}
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/GetEntities.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/GetEntities.java 2012-01-27 15:50:00 UTC (rev 300)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/GetEntities.java 2012-01-27 18:06:10 UTC (rev 301)
@@ -83,15 +83,19 @@
Boolean ascendantOrder = isSortAscendant();
String sortColumn = getSortColumn();
- Object filterObject = getFilterObject();
+ initFilter();
+
if (log.isDebugEnabled()) {
log.debug("filters = " + getFilters());
- log.debug("filterObject = " + filterObject);
log.debug("sidx = " + sortColumn);
log.debug("sord = " + ascendantOrder);
}
+ if (log.isInfoEnabled()) {
+ log.info("filter " + getFilters());
+ }
+
DbEditorService service = newService(DbEditorService.class);
datas = service.getDatas(
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2012-01-27 15:50:00 UTC (rev 300)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2012-01-27 18:06:10 UTC (rev 301)
@@ -253,8 +253,10 @@
rowList="10,15,20,50,100,250,500" rowNum="10"
onSelectRowTopics="datas-rowSelect"
onCompleteTopics="datas-clearSelect,datas-CompleteTopics"
- navigatorSearchOptions="{multipleGroup:false,showQuery:true,multipleSearch:true,sopt:['eq','ne','cn','nc','bw','bn','ew','en','lt','le','gt','ge','nu','nn','in','ni']}">
+ navigatorSearchOptions="{multipleGroup:false,multipleSearch:true,sopt:['eq','ne','cn','nc','lt','gt','nu','nn']}">
+ <%--navigatorSearchOptions="{multipleGroup:false,showQuery:true,multipleSearch:true,sopt:['eq','ne','cn','nc','bw','bn','ew','en','lt','le','gt','ge','nu','nn','in','ni']}"--%>
+
<sjg:gridColumn name="id" title="id" hidden="true" editable="true"/>
<s:iterator value="columnMetas" var="meta" status="status">
1
0
r300 - in trunk/echobase-ui/src/main: resources/template resources/template/themes resources/template/themes/echobase-theme webapp/WEB-INF/includes webapp/WEB-INF/jsp webapp/WEB-INF/jsp/dbeditor webapp/WEB-INF/jsp/exportQuery webapp/WEB-INF/jsp/user webapp/css webapp/js
by tchemit@users.forge.codelutin.com 27 Jan '12
by tchemit@users.forge.codelutin.com 27 Jan '12
27 Jan '12
Author: tchemit
Date: 2012-01-27 16:50:00 +0100 (Fri, 27 Jan 2012)
New Revision: 300
Url: http://forge.codelutin.com/repositories/revision/echobase/300
Log:
preparation mise en place theme jquery (echobase-theme)
Added:
trunk/echobase-ui/src/main/resources/template/themes/
trunk/echobase-ui/src/main/resources/template/themes/echobase-theme/
trunk/echobase-ui/src/main/resources/template/themes/echobase-theme/images/
Modified:
trunk/echobase-ui/src/main/webapp/WEB-INF/includes/metas.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportQuery/exportQueryResult.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/modificationLogs.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp
trunk/echobase-ui/src/main/webapp/css/screen.css
trunk/echobase-ui/src/main/webapp/js/gridHelper.js
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/metas.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/includes/metas.jsp 2012-01-27 13:35:03 UTC (rev 299)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/metas.jsp 2012-01-27 15:50:00 UTC (rev 300)
@@ -33,4 +33,6 @@
<link rel="icon" type="image/png"
href="<s:url value='/images/logo_codelutin.png' />"/>
<sj:head jqueryui="true" jquerytheme="start"/>
+ <%--Use echobase-theme when ready--%>
+ <%--<sj:head jqueryui="true" jquerytheme="echobase-theme"/>--%>
</head>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2012-01-27 13:35:03 UTC (rev 299)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2012-01-27 15:50:00 UTC (rev 300)
@@ -68,6 +68,8 @@
$('#editForm').hide();
});
+ $.addEvenAndOddClasses('datas');
+
// on row selection, let's load the edit form
$.addRowSelectTopic('datas', function (event) {
@@ -250,7 +252,7 @@
navigatorDelete="false" navigatorAdd="false"
rowList="10,15,20,50,100,250,500" rowNum="10"
onSelectRowTopics="datas-rowSelect"
- onCompleteTopics="datas-clearSelect"
+ onCompleteTopics="datas-clearSelect,datas-CompleteTopics"
navigatorSearchOptions="{multipleGroup:false,showQuery:true,multipleSearch:true,sopt:['eq','ne','cn','nc','bw','bn','ew','en','lt','le','gt','ge','nu','nn','in','ni']}">
<sjg:gridColumn name="id" title="id" hidden="true" editable="true"/>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportQuery/exportQueryResult.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportQuery/exportQueryResult.jsp 2012-01-27 13:35:03 UTC (rev 299)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/exportQuery/exportQueryResult.jsp 2012-01-27 15:50:00 UTC (rev 300)
@@ -26,6 +26,19 @@
<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags" %>
+
+<script type="text/javascript"
+ src="<s:url value='/js/gridHelper.js' />"></script>
+
+
+<script type="text/javascript">
+
+ jQuery(document).ready(function () {
+
+ $.addEvenAndOddClasses('datas');
+ });
+
+</script>
<s:if test="hasActionErrors()">
<div class="info_error">
<s:actionerror/>
@@ -54,6 +67,7 @@
navigatorEdit="false" navigatorDelete="false"
navigatorSearch="false" navigatorRefresh="false"
navigatorAdd="false" rowList="10,15,20,50,100,250,500"
+ onCompleteTopics="datas-CompleteTopics"
rowNum="10" viewrecords="true">
<s:iterator value="columnNames" var="name" status="status">
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/modificationLogs.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/modificationLogs.jsp 2012-01-27 13:35:03 UTC (rev 299)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/modificationLogs.jsp 2012-01-27 15:50:00 UTC (rev 300)
@@ -39,6 +39,7 @@
console.info("Clear selection = ");
$('#modificationTextContainter').html("${emptySelection}");
});
+ $.addEvenAndOddClasses('datas');
});
</script>
@@ -54,7 +55,7 @@
navigatorDelete="false" navigatorAdd="false"
rowList="10,15,20,50,100,250,500" rowNum="10"
onSelectRowTopics='datas-rowSelect'
- onCompleteTopics="datas-clearSelect">
+ onCompleteTopics="datas-clearSelect,datas-CompleteTopics">
<sjg:gridColumn name="entityType" sortable="true"
title="%{getText('echobase.common.entityType')}"/>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp 2012-01-27 13:35:03 UTC (rev 299)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp 2012-01-27 15:50:00 UTC (rev 300)
@@ -44,6 +44,7 @@
$.addAddRowTopic('users', '${addUrl}');
$.addSingleRowTopic('users', 'Update', '${updateUrl}', 'user.topiaId');
$.addSingleRowTopic('users', 'Delete', '${delUrl}', 'user.topiaId');
+ $.addEvenAndOddClasses('users');
});
</script>
@@ -52,7 +53,7 @@
pager="true" pagerButtons="true" pagerInput="true"
navigator="true" rownumbers="false" autowidth="true"
onSelectRowTopics='users-rowSelect'
- onCompleteTopics='users-cleanSelect'
+ onCompleteTopics='users-cleanSelect,users-CompleteTopics'
navigatorEdit="false" navigatorDelete="false"
navigatorSearch="false" navigatorRefresh="false"
navigatorAdd="false" viewrecords="true"
Modified: trunk/echobase-ui/src/main/webapp/css/screen.css
===================================================================
--- trunk/echobase-ui/src/main/webapp/css/screen.css 2012-01-27 13:35:03 UTC (rev 299)
+++ trunk/echobase-ui/src/main/webapp/css/screen.css 2012-01-27 15:50:00 UTC (rev 300)
@@ -25,6 +25,28 @@
font-family: sans-serif;
}
+/*address this input echobse-theme when ready*/
+.ui-jqgrid-view tr.odd {
+ background-attachment: scroll;
+ background-clip: border-box;
+ background-color: white !important;
+ background-image: none;
+ background-origin: padding-box;
+ background-position: 0 0;
+ background-repeat: repeat;
+ background-size: auto auto;
+}
+.ui-jqgrid-view tr.even{
+ background-attachment: scroll;
+ background-clip: border-box;
+ background-color: lightgrey !important;
+ background-image: none;
+ background-origin: padding-box;
+ background-position: 0 0;
+ background-repeat: repeat;
+ background-size: auto auto;
+}
+
.inline {
display:inline;
}
Modified: trunk/echobase-ui/src/main/webapp/js/gridHelper.js
===================================================================
--- trunk/echobase-ui/src/main/webapp/js/gridHelper.js 2012-01-27 13:35:03 UTC (rev 299)
+++ trunk/echobase-ui/src/main/webapp/js/gridHelper.js 2012-01-27 15:50:00 UTC (rev 300)
@@ -21,7 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
-( function($) {
+( function ($) {
$.fn.extend(
{
@@ -155,6 +155,17 @@
callback();
}
});
+ },
+
+ // Ajoute les classes even et odd à tous les tableaux de la page
+ addEvenAndOddClasses:function (gridId) {
+
+ // On souscrit au topic qui appelle la fonction addEvenAndOddClasses
+ $.subscribe(gridId + '-CompleteTopics', function () {
+ $('table tr:even').addClass('even');
+ $('table tr:odd').addClass('odd');
+ });
+
}
});
@@ -186,6 +197,9 @@
},
updateSelectBoxContent:function (url, params, jsonTarget, target, callback) {
return $(document).updateSelectBoxContent(url, params, jsonTarget, target, callback);
+ },
+ addEvenAndOddClasses:function (gridId) {
+ return $(document).addEvenAndOddClasses(gridId);
}
});
})(jQuery);
1
0
r299 - in trunk: . echobase-ui/src/main/webapp/WEB-INF/includes
by tchemit@users.forge.codelutin.com 27 Jan '12
by tchemit@users.forge.codelutin.com 27 Jan '12
27 Jan '12
Author: tchemit
Date: 2012-01-27 14:35:03 +0100 (Fri, 27 Jan 2012)
New Revision: 299
Url: http://forge.codelutin.com/repositories/revision/echobase/299
Log:
update deps + use start jquery-ui theme
Modified:
trunk/echobase-ui/src/main/webapp/WEB-INF/includes/metas.jsp
trunk/pom.xml
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/includes/metas.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/includes/metas.jsp 2012-01-26 18:22:55 UTC (rev 298)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/includes/metas.jsp 2012-01-27 13:35:03 UTC (rev 299)
@@ -32,5 +32,5 @@
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="cupertino"/>
+ <sj:head jqueryui="true" jquerytheme="start"/>
</head>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-01-26 18:22:55 UTC (rev 298)
+++ trunk/pom.xml 2012-01-27 13:35:03 UTC (rev 299)
@@ -116,14 +116,14 @@
<msaccessImporterVersion>1.4.1</msaccessImporterVersion>
<struts2Version>2.3.1.2</struts2Version>
<jqueryPluginVersion>3.2.1</jqueryPluginVersion>
- <seleniumVersion>2.16.1</seleniumVersion>
+ <seleniumVersion>2.17.0</seleniumVersion>
<h2Version>1.3.163</h2Version>
<postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion>
<slf4jVersion>1.6.4</slf4jVersion>
<!--<jettyVersion>7.5.3.v20111011</jettyVersion>-->
<jackcessVersion>1.2.6</jackcessVersion>
<!-- This version does not work (missing javax.el api in overlay) -->
- <jettyVersion>8.1.0.RC2</jettyVersion>
+ <jettyVersion>8.1.0.RC5</jettyVersion>
<hibernateVersion>3.6.9.Final</hibernateVersion>
1
0
r298 - in trunk/echobase-ui/src/main: resources/i18n webapp/WEB-INF/jsp/importData webapp/js
by tchemit@users.forge.codelutin.com 26 Jan '12
by tchemit@users.forge.codelutin.com 26 Jan '12
26 Jan '12
Author: tchemit
Date: 2012-01-26 19:22:55 +0100 (Thu, 26 Jan 2012)
New Revision: 298
Url: http://forge.codelutin.com/repositories/revision/echobase/298
Log:
fix validation for import data configuration screens
Modified:
trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticRegionData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesIndividualData.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataComplete.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataFromTransect.jsp
trunk/echobase-ui/src/main/webapp/js/gridHelper.js
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 2012-01-26 16:33:38 UTC (rev 297)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-01-26 18:22:55 UTC (rev 298)
@@ -66,6 +66,7 @@
echobase.error.import.areaOfOperation.required=La sélection d'une zone d'opération est obligatoire
echobase.error.import.associationFile.required=La sélection d'un fichier Association est obligatoire
echobase.error.import.datum.required=Datum de la campagne non rengeigné
+echobase.error.import.digitThreshold.required=digitThreshold non renseigné
echobase.error.import.echosounderSoundSpeed.required=echosounderSoundSpeed non renseigné
echobase.error.import.echotypeFile.required=La sélection d'un fichier Echotype est obligatoire
echobase.error.import.importMode.required=Le mode d'import est obligatoire
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp 2012-01-26 16:33:38 UTC (rev 297)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp 2012-01-26 18:22:55 UTC (rev 298)
@@ -37,28 +37,60 @@
jQuery(document).ready(function () {
+ var voyageSelectBox = $('[name="model.voyageId"]');
var transitSelectBox = $('[name="model.transitId"]');
var vesselSelectBox = $('[name="model.vesselId"]');
- $('[name="model.voyageId"]').change({transitSelectBox:transitSelectBox,
- vesselSelectBox:vesselSelectBox}, function (event) {
+ voyageSelectBox.change({transitSelectBox:transitSelectBox,
+ vesselSelectBox:vesselSelectBox}, function (event) {
$.updateSelectBoxContent('${getTransitsUrl}',
{voyageId:this.value},
'transits',
event.data.transitSelectBox
- );
+ );
event.data.vesselSelectBox.html("");
});
+ transitSelectBox.change({vesselSelectBox:vesselSelectBox}, function (event) {
- $('[name="model.transitId"]').change({vesselSelectBox:vesselSelectBox}, function (event) {
-
$.updateSelectBoxContent('${getVesselsUrl}',
{transitId:this.value},
'vessels',
event.data.vesselSelectBox);
});
+
+ var voyageId = "${model.voyageId}";
+
+ if (voyageId) {
+
+ console.info("reload voyageId " + voyageId);
+ voyageSelectBox.change(voyageId);
+ $.updateSelectBoxContent('${getTransitsUrl}',
+ {voyageId:voyageId},
+ 'transits',
+ transitSelectBox,
+ function() {
+
+ var transitId = "${model.transitId}";
+ if (transitId) {
+
+ transitSelectBox.val(transitId);
+ $.updateSelectBoxContent('${getVesselsUrl}',
+ {transitId:transitId},
+ 'vessels',
+ vesselSelectBox, function() {
+
+ var vesselId = "${model.vesselId}";
+ if (vesselId) {
+ vesselSelectBox.val(vesselId);
+ }
+ });
+ }
+ }
+ );
+ }
+
});
</script>
@@ -69,7 +101,7 @@
<s:text name="echobase.legend.importData.configure"/>
</legend>
- <s:select key="model.voyageId" value="''" required="true"
+ <s:select key="model.voyageId" required="true"
label='%{getText("echobase.common.voyage")}'
list="voyages" headerKey="" headerValue=""/>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticRegionData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticRegionData.jsp 2012-01-26 16:33:38 UTC (rev 297)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticRegionData.jsp 2012-01-26 18:22:55 UTC (rev 298)
@@ -41,11 +41,11 @@
<s:text name="echobase.legend.importData.configure"/>
</legend>
- <s:select key="model.voyageId" value="''" required="true"
+ <s:select key="model.voyageId" required="true"
label='%{getText("echobase.common.voyage")}'
list="voyages" headerKey="" headerValue=""/>
- <s:select key="model.vesselId" value="''" required="true"
+ <s:select key="model.vesselId" required="true"
label='%{getText("echobase.common.vessel")}'
list="vessels" headerKey="" headerValue=""/>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp 2012-01-26 16:33:38 UTC (rev 297)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesData.jsp 2012-01-26 18:22:55 UTC (rev 298)
@@ -41,7 +41,7 @@
<s:text name="echobase.legend.importData.configure"/>
</legend>
- <s:select key="model.voyageId" value="''" required="true"
+ <s:select key="model.voyageId" required="true"
label='%{getText("echobase.common.voyage")}'
list="voyages" headerKey="" headerValue=""/>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesIndividualData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesIndividualData.jsp 2012-01-26 16:33:38 UTC (rev 297)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesIndividualData.jsp 2012-01-26 18:22:55 UTC (rev 298)
@@ -42,7 +42,7 @@
name="echobase.legend.importData.configure"/>
</legend>
- <s:select key="model.voyageId" value="''" required="true"
+ <s:select key="model.voyageId" required="true"
label='%{getText("echobase.common.voyage")}'
list="voyages" headerKey="" headerValue=""/>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataComplete.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataComplete.jsp 2012-01-26 16:33:38 UTC (rev 297)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataComplete.jsp 2012-01-26 18:22:55 UTC (rev 298)
@@ -59,7 +59,7 @@
required="true"/>
<div id='USE_EXISTING_MISSION' class='importMode'>
- <s:select key="model.missionId" value="''" required="true"
+ <s:select key="model.missionId" required="true"
label='%{getText("echobase.common.mission")}'
list="missions" headerKey="" headerValue=""/>
</div>
@@ -119,11 +119,11 @@
</div>
</fieldset>
<br/>
- <s:select key="model.areaOfOperationId" value="''" required="true"
+ <s:select key="model.areaOfOperationId" required="true"
label='%{getText("echobase.common.areaOfOperation")}'
list="areaOfOperations" headerKey="" headerValue=""/>
- <s:select key="model.vesselId" value="''" required="true"
+ <s:select key="model.vesselId" required="true"
label='%{getText("echobase.common.vessel")}'
list="vessels" headerKey="" headerValue=""/>
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataFromTransect.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataFromTransect.jsp 2012-01-26 16:33:38 UTC (rev 297)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonDataFromTransect.jsp 2012-01-26 18:22:55 UTC (rev 298)
@@ -42,11 +42,11 @@
name="echobase.legend.importData.configure"/>
</legend>
- <s:select key="model.voyageId" value="''" required="true"
+ <s:select key="model.voyageId" required="true"
label='%{getText("echobase.common.voyage")}'
list="voyages" headerKey="" headerValue=""/>
- <s:select key="model.vesselId" value="''" required="true"
+ <s:select key="model.vesselId" required="true"
label='%{getText("echobase.common.vessel")}'
list="vessels" headerKey="" headerValue=""/>
Modified: trunk/echobase-ui/src/main/webapp/js/gridHelper.js
===================================================================
--- trunk/echobase-ui/src/main/webapp/js/gridHelper.js 2012-01-26 16:33:38 UTC (rev 297)
+++ trunk/echobase-ui/src/main/webapp/js/gridHelper.js 2012-01-26 18:22:55 UTC (rev 298)
@@ -134,7 +134,7 @@
return result;
},
- updateSelectBoxContent:function (url, params, jsonTarget, target) {
+ updateSelectBoxContent:function (url, params, jsonTarget, target, callback) {
// call url to obtain datas to injetc in target select box
jQuery.getJSON(url, params, function (result) {
@@ -149,6 +149,11 @@
// change the target html code
target.html(html);
+
+ // calback
+ if (callback) {
+ callback();
+ }
});
}
});
@@ -179,8 +184,8 @@
prepareUrl:function (url, params) {
return $(document).prepareUrl(url, params);
},
- updateSelectBoxContent:function (url, params, jsonTarget, target) {
- return $(document).updateSelectBoxContent(url, params, jsonTarget, target);
+ updateSelectBoxContent:function (url, params, jsonTarget, target, callback) {
+ return $(document).updateSelectBoxContent(url, params, jsonTarget, target, callback);
}
});
})(jQuery);
1
0
26 Jan '12
Author: tchemit
Date: 2012-01-26 17:33:38 +0100 (Thu, 26 Jan 2012)
New Revision: 297
Url: http://forge.codelutin.com/repositories/revision/echobase/297
Log:
remove usage of DTO (for json, just use a nicely Binder) + do not expose entity impl in ui
Removed:
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EchoBaseUserImpl.java
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntityModificationLogImpl.java
trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/ExportQueryImpl.java
Modified:
trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties
trunk/echobase-entities/src/main/xmi/echobase.zargo
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportQueryService.java
trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/UserService.java
trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/EchoBaseDbCreator.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportQuery/ManageExportQuery.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/Create.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/Delete.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/GetUsers.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/Update.java
trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/Delete.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/Update.jsp
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp
Deleted: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EchoBaseUserImpl.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EchoBaseUserImpl.java 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EchoBaseUserImpl.java 2012-01-26 16:33:38 UTC (rev 297)
@@ -1,50 +0,0 @@
-/*
- * #%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.setId(getTopiaId());
- return dto;
- }
-
- @Override
- public void fromDTO(EchoBaseUserDTO dto) {
- setAdmin(dto.isAdmin());
- setEmail(dto.getEmail());
- }
-}
Deleted: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntityModificationLogImpl.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntityModificationLogImpl.java 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/EntityModificationLogImpl.java 2012-01-26 16:33:38 UTC (rev 297)
@@ -1,46 +0,0 @@
-/*
- * #%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 {@link EntityModificationLog}.
- *
- * @author tchemit <chemit(a)codelutin.com>
- * @since 0.1
- */
-public class EntityModificationLogImpl extends EntityModificationLogAbstract {
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public EntityModificationLogDTO toDTO() {
- EntityModificationLogDTO result = new EntityModificationLogDTOImpl();
- result.setEntityType(getEntityType());
- result.setEntityId(getEntityId());
- result.setModificationDate(getModificationDate());
- result.setModificationText(getModificationText());
- result.setModificationUser(getModificationUser());
- return result;
- }
-}
Deleted: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/ExportQueryImpl.java
===================================================================
--- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/ExportQueryImpl.java 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/entities/ExportQueryImpl.java 2012-01-26 16:33:38 UTC (rev 297)
@@ -1,47 +0,0 @@
-/*
- * #%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());
- dto.setName(getName());
- dto.setSqlQuery(getSqlQuery());
- return dto;
- }
-}
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 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-entities/src/main/resources/i18n/echobase-entities_fr_FR.properties 2012-01-26 16:33:38 UTC (rev 297)
@@ -67,7 +67,6 @@
echobase.common.digitThreshold=
echobase.common.distributionStatement=distributionStatement
echobase.common.echoBaseUser=Utilisateur
-echobase.common.echoBaseUserDTO=
echobase.common.echosounderSoundSpeed=
echobase.common.echotype=
echobase.common.echotypeCategory=
@@ -80,10 +79,8 @@
echobase.common.enginePower=
echobase.common.entityId=Identifiant de l'entité
echobase.common.entityModificationLog=Journal des modifications
-echobase.common.entityModificationLogDTO=
echobase.common.entityType=Type de l'entité
echobase.common.exportQuery=Requête d'export
-echobase.common.exportQueryDTO=
echobase.common.fillValue=
echobase.common.fishingGear=
echobase.common.flagMeanings=
@@ -272,6 +269,3 @@
echobase.common.vesselType=
echobase.common.voyage=Campagne
echobase.config.data.directory.description=Chemin de l'application
-echobase.error.import.acousticDensityUnit.required=acousticDensityUnit non renseigné
-echobase.error.import.digitThreshold.required=digitThreshold non renseigné
-echobase.error.import.processingDescription.required=processingDescription non renseigné
Modified: trunk/echobase-entities/src/main/xmi/echobase.zargo
===================================================================
(Binary files differ)
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportQueryService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportQueryService.java 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/ExportQueryService.java 2012-01-26 16:33:38 UTC (rev 297)
@@ -60,7 +60,7 @@
public ExportQuery getExportQuery(String topiaId) {
ExportQuery exportQuery = getEntityById(ExportQuery.class, topiaId);
- ExportQuery entityToSave = new ExportQueryImpl();
+ ExportQuery entityToSave = newExportQuery();
entityToSave.setTopiaId(exportQuery.getTopiaId());
entityToSave.setName(exportQuery.getName());
entityToSave.setDescription(exportQuery.getDescription());
@@ -167,6 +167,10 @@
}
}
+ public ExportQuery newExportQuery() {
+ return new ExportQueryImpl();
+ }
+
private static class GenericSQLQuery extends TopiaSQLQuery<Map<String, Object>> {
protected String[] columnNames;
Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/UserService.java
===================================================================
--- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/UserService.java 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/UserService.java 2012-01-26 16:33:38 UTC (rev 297)
@@ -27,8 +27,7 @@
import fr.ifremer.echobase.EchoBaseTechnicalException;
import fr.ifremer.echobase.entities.EchoBaseUser;
import fr.ifremer.echobase.entities.EchoBaseUserDAO;
-import fr.ifremer.echobase.entities.EchoBaseUserDTO;
-import fr.ifremer.echobase.entities.EchoBaseUserDTOImpl;
+import fr.ifremer.echobase.entities.EchoBaseUserImpl;
import org.apache.commons.lang3.StringUtils;
import org.nuiton.topia.TopiaException;
import org.nuiton.topia.framework.TopiaQuery;
@@ -89,36 +88,37 @@
}
}
- public void createOrUpdate(EchoBaseUserDTO userDTO) {
+ public void createOrUpdate(EchoBaseUser user) {
try {
EchoBaseUserDAO dao = getDAO();
- EchoBaseUser user;
+ EchoBaseUser userToCreateOrUpdate;
// No id, creating new one entity
- String id = userDTO.getId();
+ String id = user.getTopiaId();
if (StringUtils.isEmpty(id)) {
- user = dao.create();
+ userToCreateOrUpdate = dao.create();
} else {
- user = dao.findByTopiaId(id);
+ userToCreateOrUpdate = dao.findByTopiaId(id);
}
- user.fromDTO(userDTO);
+ userToCreateOrUpdate.setAdmin(user.isAdmin());
+ userToCreateOrUpdate.setEmail(user.getEmail());
- String password = userDTO.getPassword();
+ String password = user.getPassword();
if (StringUtils.isNotEmpty(password)) {
- user.setPassword(encodePassword(password));
+ userToCreateOrUpdate.setPassword(encodePassword(password));
}
- dao.update(user);
+ dao.update(userToCreateOrUpdate);
commitTransaction("Could not create or update user");
} catch (TopiaException eee) {
throw new EchoBaseTechnicalException(eee);
}
}
- public void delete(EchoBaseUserDTO userDTO) {
+ public void delete(EchoBaseUser user) {
try {
EchoBaseUserDAO dao = getDAO();
- EchoBaseUser user = dao.findByTopiaId(userDTO.getId());
- dao.delete(user);
+ EchoBaseUser userToDelete = dao.findByTopiaId(user.getTopiaId());
+ dao.delete(userToDelete);
commitTransaction("Could not delete user");
} catch (TopiaException eee) {
throw new EchoBaseTechnicalException(eee);
@@ -132,18 +132,19 @@
}
public void createDefaultUsers() {
- EchoBaseUserDTO userDTO;
- userDTO = new EchoBaseUserDTOImpl();
- userDTO.setEmail(DEFAULT_ADMIN_EMAIL);
- userDTO.setPassword(DEFAULT_ADMIN_PASSWORD);
- userDTO.setAdmin(true);
- createOrUpdate(userDTO);
+ EchoBaseUser user;
- userDTO = new EchoBaseUserDTOImpl();
- userDTO.setEmail(DEFAULT_USER_EMAIL);
- userDTO.setPassword(DEFAULT_USER_PASSWORD);
- userDTO.setAdmin(false);
- createOrUpdate(userDTO);
+ user = new EchoBaseUserImpl();
+ user.setEmail(DEFAULT_ADMIN_EMAIL);
+ user.setPassword(DEFAULT_ADMIN_PASSWORD);
+ user.setAdmin(true);
+ createOrUpdate(user);
+
+ user = new EchoBaseUserImpl();
+ user.setEmail(DEFAULT_USER_EMAIL);
+ user.setPassword(DEFAULT_USER_PASSWORD);
+ user.setAdmin(false);
+ createOrUpdate(user);
}
public static String encodePassword(String password) {
@@ -154,4 +155,8 @@
protected EchoBaseUserDAO getDAO() throws TopiaException {
return (EchoBaseUserDAO) getDAO(EchoBaseUser.class);
}
+
+ public EchoBaseUser newUser() {
+ return new EchoBaseUserImpl();
+ }
}
Modified: trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/EchoBaseDbCreator.java
===================================================================
--- trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/EchoBaseDbCreator.java 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-tools/src/main/java/fr/ifremer/echobase/tools/EchoBaseDbCreator.java 2012-01-26 16:33:38 UTC (rev 297)
@@ -23,6 +23,7 @@
*/
package fr.ifremer.echobase.tools;
+import com.google.common.base.Charsets;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.Sets;
@@ -37,15 +38,11 @@
import org.nuiton.topia.TopiaException;
import org.nuiton.util.FileUtil;
import org.nuiton.util.csv.Export;
-import org.nuiton.util.csv.ExportModel;
-import org.nuiton.util.csv.ExportableColumn;
-import org.nuiton.util.csv.ModelBuilder;
import org.nuiton.util.csv.ValueFormatter;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
-import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -116,7 +113,7 @@
if (log.isInfoEnabled()) {
log.info("Generate to " + destination.getName());
}
- exporter.exportToFile(destination);
+ exporter.write(destination, Charsets.UTF_8);
}
}
@@ -163,13 +160,10 @@
EchoBaseIOUtil.compressZipFile(zipFile, outputDir, false);
}
- private static class MSAccessToCsvExportModel implements ExportModel<Map<String, Object>> {
+ private static class MSAccessToCsvExportModel extends CsvModelUtil.AbstractExportModel<Map<String, Object>> {
- protected ModelBuilder<Map<String, Object>> modelBuilder =
- new ModelBuilder<Map<String, Object>>();
-
public MSAccessToCsvExportModel(Table table) {
-
+ super(';');
List<Column> columns = table.getColumns();
Set<String> skipColumns = Sets.newHashSet(
@@ -183,23 +177,12 @@
if (skipColumns.contains(name)) {
continue;
}
- modelBuilder.newColumnForExport(
+ newColumnForExport(
name,
CsvModelUtil.newMapProperty(name),
(ValueFormatter<Object>) CsvModelUtil.TO_STRING_FORMATTER
);
}
}
-
- @Override
- public char getSeparator() {
- return ';';
- }
-
- @Override
- public Collection<ExportableColumn<Map<String, Object>, Object>> getColumnsForExport() {
- Collection columnsForExport = modelBuilder.getColumnsForExport();
- return columnsForExport;
- }
}
}
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportQuery/ManageExportQuery.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportQuery/ManageExportQuery.java 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/exportQuery/ManageExportQuery.java 2012-01-26 16:33:38 UTC (rev 297)
@@ -25,7 +25,6 @@
import com.opensymphony.xwork2.Preparable;
import fr.ifremer.echobase.entities.ExportQuery;
-import fr.ifremer.echobase.entities.ExportQueryImpl;
import fr.ifremer.echobase.services.ExportQueryService;
import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
import org.apache.commons.lang3.StringUtils;
@@ -49,9 +48,18 @@
/** Selected query loaded from database if his id is not empty. */
protected ExportQuery query;
+ protected transient ExportQueryService service;
+
+ public ExportQueryService getService() {
+ if (service == null) {
+ service = newService(ExportQueryService.class);
+ }
+ return service;
+ }
+
public ExportQuery getQuery() {
if (query == null) {
- query = new ExportQueryImpl();
+ query = getService().newExportQuery();
}
return query;
}
@@ -67,10 +75,9 @@
public String saveQuery() throws Exception {
//TODO : do validation
- ExportQueryService service = newService(ExportQueryService.class);
- query = service.createOrUpdate(getQuery(),
- getEchoBaseSession().getEchoBaseUser()
+ query = getService().createOrUpdate(getQuery(),
+ getEchoBaseSession().getEchoBaseUser()
);
return SUCCESS;
}
@@ -78,11 +85,10 @@
public String cloneQuery() throws Exception {
//TODO : do validation
- ExportQueryService service = newService(ExportQueryService.class);
getQuery().setTopiaId(null);
- query = service.createOrUpdate(getQuery(),
- getEchoBaseSession().getEchoBaseUser()
+ query = getService().createOrUpdate(getQuery(),
+ getEchoBaseSession().getEchoBaseUser()
);
return SUCCESS;
}
@@ -90,7 +96,6 @@
public String deleteQuery() throws Exception {
//TODO : do validation
- ExportQueryService service = newService(ExportQueryService.class);
service.delete(getQuery().getTopiaId());
query = null;
return SUCCESS;
@@ -98,10 +103,9 @@
@Override
public void prepare() throws Exception {
- ExportQueryService service = newService(ExportQueryService.class);
Collection<ExportQuery> sqlQueries =
- service.getEntities(ExportQuery.class);
+ getService().getEntities(ExportQuery.class);
queries = sortAndDecorate(sqlQueries, null);
if (sqlQueries.isEmpty()) {
@@ -118,7 +122,7 @@
} else {
// load query from database
- query = service.getExportQuery(selectedQueryId);
+ query = getService().getExportQuery(selectedQueryId);
}
}
}
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/Create.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/Create.java 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/Create.java 2012-01-26 16:33:38 UTC (rev 297)
@@ -24,8 +24,6 @@
package fr.ifremer.echobase.ui.actions.user;
import fr.ifremer.echobase.entities.EchoBaseUser;
-import fr.ifremer.echobase.entities.EchoBaseUserDTO;
-import fr.ifremer.echobase.entities.EchoBaseUserDTOImpl;
import fr.ifremer.echobase.services.UserService;
import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
import org.apache.commons.lang3.StringUtils;
@@ -46,7 +44,7 @@
protected transient UserService userService;
- protected EchoBaseUserDTO user;
+ protected EchoBaseUser user;
public UserService getUserService() {
if (userService == null) {
@@ -56,7 +54,7 @@
}
public String execute() throws Exception {
- EchoBaseUserDTO userToCreate = getUser();
+ EchoBaseUser userToCreate = getUser();
String userEmail = userToCreate.getEmail();
if (log.isInfoEnabled()) {
@@ -74,7 +72,7 @@
@Override
public void validate() {
- EchoBaseUserDTO userToValidate = getUser();
+ EchoBaseUser userToValidate = getUser();
String userEmail = userToValidate.getEmail();
// login + password required
@@ -111,9 +109,9 @@
}
- public EchoBaseUserDTO getUser() {
+ public EchoBaseUser getUser() {
if (user == null) {
- user = new EchoBaseUserDTOImpl();
+ user = getUserService().newUser();
}
return user;
}
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/Delete.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/Delete.java 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/Delete.java 2012-01-26 16:33:38 UTC (rev 297)
@@ -25,8 +25,6 @@
import com.opensymphony.xwork2.Preparable;
import fr.ifremer.echobase.entities.EchoBaseUser;
-import fr.ifremer.echobase.entities.EchoBaseUserDTO;
-import fr.ifremer.echobase.entities.EchoBaseUserDTOImpl;
import fr.ifremer.echobase.services.UserService;
import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
import org.apache.commons.lang3.StringUtils;
@@ -47,7 +45,7 @@
protected transient UserService userService;
- protected EchoBaseUserDTO user;
+ protected EchoBaseUser user;
public UserService getUserService() {
if (userService == null) {
@@ -58,7 +56,7 @@
public String execute() throws Exception {
- EchoBaseUserDTO userToDelete = getUser();
+ EchoBaseUser userToDelete = getUser();
String userEmail = userToDelete.getEmail();
if (log.isInfoEnabled()) {
@@ -73,20 +71,20 @@
return SUCCESS;
}
- public EchoBaseUserDTO getUser() {
+ public EchoBaseUser getUser() {
if (user == null) {
- user = new EchoBaseUserDTOImpl();
+ user = getUserService().newUser();
}
return user;
}
@Override
public void prepare() throws Exception {
- String userId = getUser().getId();
+ String userId = getUser().getTopiaId();
if (!StringUtils.isEmpty(userId)) {
// load user
- user = getUserService().getEntityById(EchoBaseUser.class, userId).toDTO();
+ user = getUserService().getEntityById(EchoBaseUser.class, userId);
if (log.isInfoEnabled()) {
log.info("Selected user " + user.getEmail());
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/GetUsers.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/GetUsers.java 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/GetUsers.java 2012-01-26 16:33:38 UTC (rev 297)
@@ -23,13 +23,14 @@
*/
package fr.ifremer.echobase.ui.actions.user;
-import com.google.common.collect.Lists;
import fr.ifremer.echobase.entities.EchoBaseUser;
-import fr.ifremer.echobase.entities.EchoBaseUserDTO;
import fr.ifremer.echobase.services.UserService;
import fr.ifremer.echobase.ui.actions.AbstractJSONPaginedAction;
+import org.nuiton.util.beans.Binder;
+import org.nuiton.util.beans.BinderFactory;
import java.util.List;
+import java.util.Map;
/**
* Obtains all users of the echobase internal database.
@@ -41,9 +42,9 @@
private static final long serialVersionUID = 1L;
- protected List<EchoBaseUserDTO> users;
+ protected transient Map<String, Object>[] users;
- public List<EchoBaseUserDTO> getUsers() {
+ public Map<String, Object>[] getUsers() {
return users;
}
@@ -73,9 +74,15 @@
List<EchoBaseUser> allUsers =
newService(UserService.class).getUsers(pager);
- users = Lists.newArrayList();
+ users = new Map[allUsers.size()];
+ Binder<EchoBaseUser, EchoBaseUser> binder =
+ BinderFactory.newBinder(EchoBaseUser.class);
+
+ int index = 0;
for (EchoBaseUser user : allUsers) {
- users.add(user.toDTO());
+ Map<String, Object> data = binder.obtainProperties(user);
+ data.put("id", user.getTopiaId());
+ users[index++] = data;
}
return SUCCESS;
Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/Update.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/Update.java 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/user/Update.java 2012-01-26 16:33:38 UTC (rev 297)
@@ -25,8 +25,6 @@
import com.opensymphony.xwork2.Preparable;
import fr.ifremer.echobase.entities.EchoBaseUser;
-import fr.ifremer.echobase.entities.EchoBaseUserDTO;
-import fr.ifremer.echobase.entities.EchoBaseUserDTOImpl;
import fr.ifremer.echobase.services.UserService;
import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
import org.apache.commons.lang3.StringUtils;
@@ -47,7 +45,7 @@
protected transient UserService userService;
- protected EchoBaseUserDTO user;
+ protected EchoBaseUser user;
public UserService getUserService() {
if (userService == null) {
@@ -58,7 +56,7 @@
@Override
public String execute() throws Exception {
- EchoBaseUserDTO userToUpdate = getUser();
+ EchoBaseUser userToUpdate = getUser();
String userEmail = userToUpdate.getEmail();
if (log.isInfoEnabled()) {
@@ -75,11 +73,11 @@
@Override
public void prepare() throws Exception {
- String userId = getUser().getId();
+ String userId = getUser().getTopiaId();
if (!StringUtils.isEmpty(userId)) {
// load user
- user = getUserService().getEntityById(EchoBaseUser.class, userId).toDTO();
+ user = getUserService().getEntityById(EchoBaseUser.class, userId);
if (log.isInfoEnabled()) {
log.info("Selected user " + user.getEmail());
@@ -87,9 +85,9 @@
}
}
- public EchoBaseUserDTO getUser() {
+ public EchoBaseUser getUser() {
if (user == null) {
- user = new EchoBaseUserDTOImpl();
+ user = getUserService().newUser();
}
return user;
}
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 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-01-26 16:33:38 UTC (rev 297)
@@ -61,6 +61,8 @@
echobase.error.export.name.requiredstring=Le nom de l'export est obligatoire
echobase.error.export.sqlQuery.requiredstring=La requête de l'export est obligatoire
echobase.error.export.sqlQuery.wrongformat=La requêtes n'est pas valide
+echobase.error.import.acquisitionSoftwareVersionER60.required=acquisitionSoftwareVersionER60 non renseigné
+echobase.error.import.acquisitionSoftwareVersionME70.required=acquisitionSoftwareVersionME70 non renseigné
echobase.error.import.areaOfOperation.required=La sélection d'une zone d'opération est obligatoire
echobase.error.import.associationFile.required=La sélection d'un fichier Association est obligatoire
echobase.error.import.datum.required=Datum de la campagne non rengeigné
@@ -70,35 +72,33 @@
echobase.error.import.individualDataFile.required=La sélection d'un fichier individualData est obligatoire
echobase.error.import.lengthAgeKeyFile.required=La sélection d'un fichier lengthAgeKey est obligatoire
echobase.error.import.lengthWeightKeyFile.required=La sélection d'un fichier lengthWeightKey est obligatoire
+echobase.error.import.loggedDataDatatype.required=loggedDataDatatype non renseigné
+echobase.error.import.loggedDataFormat.required=loggedDataFormat non renseigné
echobase.error.import.mission.required=La sélection d'une mission est obligatoire
echobase.error.import.missionAbstract.required=Le résumé de la mission est obligatoire
echobase.error.import.missionName.required=Le nom de la mission est obligatoire
echobase.error.import.moviesFile.required=La sélection d'un fichier Movies est obligatoire
echobase.error.import.notes.required=Note des DataProcessing non renseigné
-echobase.error.import.regionsFile.required=La sélection d'un fichier Region est obligatoire
+echobase.error.import.pingDutyCycle.required=pingDutyCycle non renseigné
echobase.error.import.processingDescription.required=processingDescription non renseigné
echobase.error.import.processingTemplate.required=processingTemplate non renseigné
+echobase.error.import.regionsFile.required=La sélection d'un fichier Region est obligatoire
+echobase.error.import.soundSpeedCalculationsER60.required=soundSpeedCalculationsER60 non renseigné
+echobase.error.import.soundSpeedCalculationsME70.required=soundSpeedCalculationsME70 non renseigné
echobase.error.import.sounderConstant.required=sounderConstant non renseigné
-echobase.error.import.soundSpeedCalculationsME70.required=soundSpeedCalculationsME70 non renseigné
-echobase.error.import.soundSpeedCalculationsER60.required=soundSpeedCalculationsER60 non renseigné
-echobase.error.import.pingDutyCycle.required=pingDutyCycle non renseigné
-echobase.error.import.loggedDataDatatype.required=loggedDataDatatype non renseigné
-echobase.error.import.loggedDataFormat.required=loggedDataFormat non renseigné
-echobase.error.import.acquisitionSoftwareVersionER60.required=acquisitionSoftwareVersionER60 non renseigné
-echobase.error.import.acquisitionSoftwareVersionME70.required=acquisitionSoftwareVersionME70 non renseigné
-echobase.error.import.transceiverAcquisitionAbsorptionDescription.required=transceiverAcquisitionAbsorptionDescription non renseigné
echobase.error.import.tblMensurationClasseFile.required=La sélection d'un fichier tblMensurationClasse est obligatoire
echobase.error.import.tblMensurationFile.required=La sélection d'un fichier tblMensuration est obligatoire
echobase.error.import.tlbeStationFile.required=La sélection d'un fichier tlbeStation est obligatoire
+echobase.error.import.transceiverAcquisitionAbsorptionDescription.required=transceiverAcquisitionAbsorptionDescription non renseigné
echobase.error.import.transectBinUnitsPingAxis.required=BinUnitsPingAxis des transtects non rengeigné
echobase.error.import.transectFile.required=La sélection d'un fichier Transect est obligatoire
echobase.error.import.transectGeospatialVerticalPositive.required=GeospatialVerticalPositive des transtects non rengeigné
echobase.error.import.transectLicence.required=Licence des transtects non rengeigné
+echobase.error.import.transit.required=La sélection d'un transit est obligatoire
echobase.error.import.transitFile.required=La sélection d'un fichier Transit est obligatoire
echobase.error.import.transitRelatedActivity.required=RelatedActivity des transits non rengeigné
echobase.error.import.vessel.required=La sélection d'un navire est obligatoire
echobase.error.import.voyage.required=La sélection d'une campagne est obligatoire
-echobase.error.import.transit.required=La sélection d'un transit est obligatoire
echobase.error.import.voyageDescription.required=Description de la campagne non rengeigné
echobase.error.import.voyageFile.required=La sélection d'un fichier Voyage est obligatoire
echobase.error.import.xtblTriFile.required=La sélection d'un fichier xtblTri est obligatoire
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/Delete.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/Delete.jsp 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/Delete.jsp 2012-01-26 16:33:38 UTC (rev 297)
@@ -32,7 +32,7 @@
<legend>
<s:text name="echobase.common.user"/>
</legend>
- <s:hidden name="user.id" label=""/>
+ <s:hidden name="user.topiaId" label=""/>
<s:textfield key="user.email" label="%{getText('echobase.common.email')}"
size="40" disabled="true"/>
<s:checkbox value="%{user.admin}" key="echobase.common.admin"
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/Update.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/Update.jsp 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/Update.jsp 2012-01-26 16:33:38 UTC (rev 297)
@@ -32,7 +32,7 @@
<legend>
<s:text name="echobase.common.user"/>
</legend>
- <s:hidden key="user.id" label=""/>
+ <s:hidden key="user.topiaId" label=""/>
<s:textfield key="user.email" label="%{getText('echobase.common.email')}"
size="40" readonly="true"/>
<s:password name="user.password" value=""
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp 2012-01-26 15:35:35 UTC (rev 296)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/user/userList.jsp 2012-01-26 16:33:38 UTC (rev 297)
@@ -32,7 +32,7 @@
<s:url id="addUrl" action="user-Create" namespace="/user" escapeAmp="false" method="input"/>
-<s:url id="editUrl" action="user-Update" namespace="/user" escapeAmp="false" method="input"/>
+<s:url id="updateUrl" action="user-Update" namespace="/user" escapeAmp="false" method="input"/>
<s:url id="delUrl" action="user-Delete" namespace="/user" escapeAmp="false" method="input"/>
@@ -42,8 +42,8 @@
$.addRowSelectTopic('users');
$.addClearSelectTopic('users');
$.addAddRowTopic('users', '${addUrl}');
- $.addSingleRowTopic('users', 'Update', '${editUrl}', 'user.id');
- $.addSingleRowTopic('users', 'Delete', '${delUrl}', 'user.id');
+ $.addSingleRowTopic('users', 'Update', '${updateUrl}', 'user.topiaId');
+ $.addSingleRowTopic('users', 'Delete', '${delUrl}', 'user.topiaId');
});
</script>
1
0
r296 - in trunk/echobase-ui/src/main: java/fr/ifremer/echobase/ui/actions/importData resources/config resources/fr/ifremer/echobase/ui/actions/importData resources/i18n webapp/WEB-INF webapp/WEB-INF/jsp/importData webapp/css webapp/js
by tchemit@users.forge.codelutin.com 26 Jan '12
by tchemit@users.forge.codelutin.com 26 Jan '12
26 Jan '12
Author: tchemit
Date: 2012-01-26 16:35:35 +0100 (Thu, 26 Jan 2012)
New Revision: 296
Url: http://forge.codelutin.com/repositories/revision/echobase/296
Log:
continue import data (acoustic data) (ui part)
Added:
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetTransits.java
trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetVessels.java
Modified:
trunk/echobase-ui/src/main/resources/config/struts-importData.xml
trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData-validation.xml
trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties
trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml
trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp
trunk/echobase-ui/src/main/webapp/css/screen.css
trunk/echobase-ui/src/main/webapp/js/gridHelper.js
Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetTransits.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetTransits.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetTransits.java 2012-01-26 15:35:35 UTC (rev 296)
@@ -0,0 +1,92 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.importData;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Maps;
+import fr.ifremer.echobase.entities.data.Transit;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.services.EchoBaseServiceSupport;
+import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
+import org.apache.commons.lang3.StringUtils;
+import org.nuiton.util.decorator.Decorator;
+
+import java.util.Map;
+
+/**
+ * Given a voyage, obtain all his transits.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class GetTransits extends EchoBaseActionSupport {
+
+ private static final long serialVersionUID = 1L;
+
+
+ protected String voyageId;
+
+ protected Map<String, String> transits;
+
+ public void setVoyageId(String voyageId) {
+ this.voyageId = voyageId;
+ }
+
+ public Map<String, String> getTransits() {
+ return transits;
+ }
+
+ @Override
+ public String execute() throws Exception {
+
+ transits = Maps.newLinkedHashMap();
+
+ if (StringUtils.isNotEmpty(voyageId)) {
+
+ EchoBaseServiceSupport service =
+ newService(EchoBaseServiceSupport.class);
+
+ Voyage voyage = service.getEntityById(Voyage.class, voyageId);
+
+ Preconditions.checkNotNull(
+ voyage,
+ "Could not find voyage with id " + voyageId);
+
+ if (!voyage.isTransitEmpty()) {
+
+ Decorator<Transit> decorator =
+ getDecoratorService().getDecorator(getLocale(),
+ Transit.class,
+ null);
+
+ for (Transit transit : voyage.getTransit()) {
+ String value = decorator.toString(transit);
+ transits.put(transit.getTopiaId(), value);
+ }
+ }
+ }
+
+ return SUCCESS;
+ }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetTransits.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetVessels.java
===================================================================
--- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetVessels.java (rev 0)
+++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetVessels.java 2012-01-26 15:35:35 UTC (rev 296)
@@ -0,0 +1,95 @@
+/*
+ * #%L
+ * EchoBase :: UI
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 - 2012 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.importData;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Maps;
+import fr.ifremer.echobase.entities.data.Transect;
+import fr.ifremer.echobase.entities.data.Transit;
+import fr.ifremer.echobase.entities.data.Voyage;
+import fr.ifremer.echobase.entities.references.Vessel;
+import fr.ifremer.echobase.services.EchoBaseServiceSupport;
+import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport;
+import org.apache.commons.lang3.StringUtils;
+import org.nuiton.util.decorator.Decorator;
+
+import java.util.Map;
+
+/**
+ * Given a voyage, obtain all his transits.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.3
+ */
+public class GetVessels extends EchoBaseActionSupport {
+
+ private static final long serialVersionUID = 1L;
+
+
+ protected String transitId;
+
+ protected Map<String, String> vessels;
+
+ public void setTransitId(String transitId) {
+ this.transitId = transitId;
+ }
+
+ public Map<String, String> getVessels() {
+ return vessels;
+ }
+
+ @Override
+ public String execute() throws Exception {
+
+ vessels = Maps.newLinkedHashMap();
+
+ if (StringUtils.isNotEmpty(transitId)) {
+
+ EchoBaseServiceSupport service =
+ newService(EchoBaseServiceSupport.class);
+
+ Transit transit = service.getEntityById(Transit.class, transitId);
+
+ Preconditions.checkNotNull(transit,
+ "Could not find transit with id " + transitId);
+ if (!transit.isTransectEmpty()) {
+
+ Decorator<Vessel> decorator =
+ getDecoratorService().getDecorator(getLocale(),
+ Vessel.class,
+ null);
+
+ for (Transect transect : transit.getTransect()) {
+ String id = transect.getTopiaId();
+ if (!vessels.containsKey(id)) {
+ String value = decorator.toString(transect.getVessel());
+ vessels.put(id, value);
+ }
+ }
+ }
+ }
+
+ return SUCCESS;
+ }
+}
Property changes on: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/importData/GetVessels.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: trunk/echobase-ui/src/main/resources/config/struts-importData.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/config/struts-importData.xml 2012-01-26 15:35:06 UTC (rev 295)
+++ trunk/echobase-ui/src/main/resources/config/struts-importData.xml 2012-01-26 15:35:35 UTC (rev 296)
@@ -64,6 +64,18 @@
<result>/WEB-INF/jsp/importData/result{1}.jsp</result>
</action>
+ <!-- Get transits for a given voyage id -->
+ <action name="getTransits"
+ class="fr.ifremer.echobase.ui.actions.importData.GetTransits">
+ <result type="json"/>
+ </action>
+
+ <!-- Get vessels (of transects) for a given transit id -->
+ <action name="getVessels"
+ class="fr.ifremer.echobase.ui.actions.importData.GetVessels">
+ <result type="json"/>
+ </action>
+
</package>
</struts>
Modified: trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData-validation.xml
===================================================================
--- trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData-validation.xml 2012-01-26 15:35:06 UTC (rev 295)
+++ trunk/echobase-ui/src/main/resources/fr/ifremer/echobase/ui/actions/importData/ConfigureAccousticData-validation.xml 2012-01-26 15:35:35 UTC (rev 296)
@@ -32,25 +32,106 @@
</field-validator>
</field>
+ <field name="model.transitId">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transit.required"/>
+ </field-validator>
+ </field>
+
<field name="model.vesselId">
<field-validator type="nrequiredstring">
<message key="echobase.error.import.vessel.required"/>
</field-validator>
</field>
+ <field name="model.transceiverAcquisitionAbsorptionDescription">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.transceiverAcquisitionAbsorptionDescription.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.acquisitionSoftwareVersionER60">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.acquisitionSoftwareVersionER60.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.acquisitionSoftwareVersionME70">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.acquisitionSoftwareVersionME70.required"/>
+ </field-validator>
+ </field>
+
<field name="model.echosounderSoundSpeed">
<field-validator type="nrequiredstring">
<message key="echobase.error.import.echosounderSoundSpeed.required"/>
</field-validator>
</field>
- <field name="model.soundSpeedCalculations">
+ <field name="model.loggedDataFormat">
<field-validator type="nrequiredstring">
+ <message key="echobase.error.import.loggedDataFormat.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.loggedDataDatatype">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.loggedDataDatatype.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.pingDutyCycle">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.pingDutyCycle.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.soundSpeedCalculationsER60">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.soundSpeedCalculationsER60.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.soundSpeedCalculationsME70">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.soundSpeedCalculationsME70.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.sounderConstant">
+ <field-validator type="nrequiredstring">
+ <message key="echobase.error.import.sounderConstant.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.processingTemplate">
+ <field-validator type="nrequiredstring">
<message
- key="echobase.error.import.soundSpeedCalculations.required"/>
+ key="echobase.error.import.processingTemplate.required"/>
</field-validator>
</field>
+ <field name="model.processingDescription">
+ <field-validator type="nrequiredstring">
+ <message
+ key="echobase.error.import.processingDescription.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.digitThreshold">
+ <field-validator type="nrequiredstring">
+ <message
+ key="echobase.error.import.digitThreshold.required"/>
+ </field-validator>
+ </field>
+
+ <field name="model.acousticDensityUnit">
+ <field-validator type="nrequiredstring">
+ <message
+ key="echobase.error.import.acousticDensityUnit.required"/>
+ </field-validator>
+ </field>
+
<field name="model.notes">
<field-validator type="nrequiredstring">
<message key="echobase.error.import.notes.required"/>
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 2012-01-26 15:35:06 UTC (rev 295)
+++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-01-26 15:35:35 UTC (rev 296)
@@ -43,10 +43,12 @@
echobase.common.notes=notes
echobase.common.password=Mot de passe
echobase.common.pingDutyCycle=pingDutyCycle
-echobase.common.soundSpeedCalculations=soundSpeedCalculations
+echobase.common.processingDescription=processingDescription
+echobase.common.processingTemplate=processingTemplate
echobase.common.soundSpeedCalculationsER60=soundSpeedCalculations (ER60 instrument)
echobase.common.soundSpeedCalculationsME70=soundSpeedCalculations (ME70 instrument)
echobase.common.sounderConstant=sounderConstant
+echobase.common.transceiverAcquisitionAbsorptionDescription=transceiverAcquisitionAbsorptionDescription
echobase.common.transectBinUnitsPingAxis=BinUnitsPingAxis (transect)
echobase.common.transectGeospatialVerticalPositive=GeospatialVerticalPositive (transect)
echobase.common.transectLicence=Licence (transect)
@@ -74,7 +76,17 @@
echobase.error.import.moviesFile.required=La sélection d'un fichier Movies est obligatoire
echobase.error.import.notes.required=Note des DataProcessing non renseigné
echobase.error.import.regionsFile.required=La sélection d'un fichier Region est obligatoire
-echobase.error.import.soundSpeedCalculations.required=soundSpeedCalculations non renseigné
+echobase.error.import.processingDescription.required=processingDescription non renseigné
+echobase.error.import.processingTemplate.required=processingTemplate non renseigné
+echobase.error.import.sounderConstant.required=sounderConstant non renseigné
+echobase.error.import.soundSpeedCalculationsME70.required=soundSpeedCalculationsME70 non renseigné
+echobase.error.import.soundSpeedCalculationsER60.required=soundSpeedCalculationsER60 non renseigné
+echobase.error.import.pingDutyCycle.required=pingDutyCycle non renseigné
+echobase.error.import.loggedDataDatatype.required=loggedDataDatatype non renseigné
+echobase.error.import.loggedDataFormat.required=loggedDataFormat non renseigné
+echobase.error.import.acquisitionSoftwareVersionER60.required=acquisitionSoftwareVersionER60 non renseigné
+echobase.error.import.acquisitionSoftwareVersionME70.required=acquisitionSoftwareVersionME70 non renseigné
+echobase.error.import.transceiverAcquisitionAbsorptionDescription.required=transceiverAcquisitionAbsorptionDescription non renseigné
echobase.error.import.tblMensurationClasseFile.required=La sélection d'un fichier tblMensurationClasse est obligatoire
echobase.error.import.tblMensurationFile.required=La sélection d'un fichier tblMensuration est obligatoire
echobase.error.import.tlbeStationFile.required=La sélection d'un fichier tlbeStation est obligatoire
@@ -86,6 +98,7 @@
echobase.error.import.transitRelatedActivity.required=RelatedActivity des transits non rengeigné
echobase.error.import.vessel.required=La sélection d'un navire est obligatoire
echobase.error.import.voyage.required=La sélection d'une campagne est obligatoire
+echobase.error.import.transit.required=La sélection d'un transit est obligatoire
echobase.error.import.voyageDescription.required=Description de la campagne non rengeigné
echobase.error.import.voyageFile.required=La sélection d'un fichier Voyage est obligatoire
echobase.error.import.xtblTriFile.required=La sélection d'un fichier xtblTri est obligatoire
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml 2012-01-26 15:35:06 UTC (rev 295)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/decorators.xml 2012-01-26 15:35:35 UTC (rev 296)
@@ -32,6 +32,7 @@
<pattern>/dbeditor/getForeignEntities*</pattern>
<pattern>/dbeditor/doExport*</pattern>
<pattern>/exportQuery/exportQueryResult*</pattern>
+ <pattern>/importData/get*</pattern>
</excludes>
<decorator name="layout-default" page="layout-default.jsp">
Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp
===================================================================
--- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp 2012-01-26 15:35:06 UTC (rev 295)
+++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAccousticData.jsp 2012-01-26 15:35:35 UTC (rev 296)
@@ -23,14 +23,42 @@
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sj" uri="/struts-jquery-tags" %>
+<script type="text/javascript"
+ src="<s:url value='/js/gridHelper.js' />"></script>
<title>Configuration <s:text
name="echobase.common.importDataMode.accousticData"/></title>
+<s:url id="getTransitsUrl" action="getTransits" namespace="/importData"/>
+<s:url id="getVesselsUrl" action="getVessels" namespace="/importData"/>
+
<script type="text/javascript">
jQuery(document).ready(function () {
+ var transitSelectBox = $('[name="model.transitId"]');
+ var vesselSelectBox = $('[name="model.vesselId"]');
+
+ $('[name="model.voyageId"]').change({transitSelectBox:transitSelectBox,
+ vesselSelectBox:vesselSelectBox}, function (event) {
+
+ $.updateSelectBoxContent('${getTransitsUrl}',
+ {voyageId:this.value},
+ 'transits',
+ event.data.transitSelectBox
+ );
+ event.data.vesselSelectBox.html("");
+ });
+
+
+ $('[name="model.transitId"]').change({vesselSelectBox:vesselSelectBox}, function (event) {
+
+ $.updateSelectBoxContent('${getVesselsUrl}',
+ {transitId:this.value},
+ 'vessels',
+ event.data.vesselSelectBox);
+ });
});
</script>
@@ -41,61 +69,64 @@
<s:text name="echobase.legend.importData.configure"/>
</legend>
- <s:select name="model.voyageId" value="''" required="true"
+ <s:select key="model.voyageId" value="''" required="true"
label='%{getText("echobase.common.voyage")}'
list="voyages" headerKey="" headerValue=""/>
- <s:select name="model.transitId" value="''" required="true"
- label='%{getText("echobase.common.transit")}'
- list="transits" headerKey="" headerValue=""/>
+ <sj:select key="model.transitId" required="true"
+ label='%{getText("echobase.common.transit")}'/>
- <s:select name="model.vesselId" value="''" required="true"
- label='%{getText("echobase.common.vessel")}'
- list="vessels" headerKey="" headerValue=""/>
+ <sj:select key="model.vesselId" required="true"
+ label='%{getText("echobase.common.vessel")}'/>
- <s:textfield key="model.transceiverAcquisitionAbsorptionDescription" size="40" required="true"
+ <s:textfield key="model.transceiverAcquisitionAbsorptionDescription"
+ size="100" required="true"
label='%{getText("echobase.common.transceiverAcquisitionAbsorptionDescription")}'/>
- <s:textfield key="model.acquisitionSoftwareVersionER60" size="40" required="true"
+ <s:textfield key="model.acquisitionSoftwareVersionER60" size="100"
+ required="true"
label='%{getText("echobase.common.acquisitionSoftwareVersionER60")}'/>
- <s:textfield key="model.acquisitionSoftwareVersionME70" size="40" required="true"
+ <s:textfield key="model.acquisitionSoftwareVersionME70" size="100"
+ required="true"
label='%{getText("echobase.common.acquisitionSoftwareVersionME70")}'/>
- <s:textfield key="model.loggedDataFormat" size="40" required="true"
+ <s:textfield key="model.loggedDataFormat" size="100" required="true"
label='%{getText("echobase.common.loggedDataFormat")}'/>
- <s:textfield key="model.loggedDataDatatype" size="40" required="true"
+ <s:textfield key="model.loggedDataDatatype" size="100" required="true"
label='%{getText("echobase.common.loggedDataDatatype")}'/>
- <s:textfield key="model.pingDutyCycle" size="40" required="true"
+ <s:textfield key="model.pingDutyCycle" size="100" required="true"
label='%{getText("echobase.common.pingDutyCycle")}'/>
- <s:textfield key="model.echosounderSoundSpeed" size="40" required="true"
+ <s:textfield key="model.echosounderSoundSpeed" size="100" required="true"
label='%{getText("echobase.common.echosounderSoundSpeed")}'/>
- <s:textfield key="model.soundSpeedCalculationsER60" size="40" required="true"
+ <s:textfield key="model.soundSpeedCalculationsER60" size="100"
+ required="true"
label='%{getText("echobase.common.soundSpeedCalculationsER60")}'/>
- <s:textfield key="model.soundSpeedCalculationsME70" size="40" required="true"
+ <s:textfield key="model.soundSpeedCalculationsME70" size="100"
+ required="true"
label='%{getText("echobase.common.soundSpeedCalculationsME70")}'/>
- <s:textfield key="model.sounderConstant" size="40" required="true"
+ <s:textfield key="model.sounderConstant" size="100" required="true"
label='%{getText("echobase.common.sounderConstant")}'/>
- <s:textfield key="model.processingTemplate" size="40" required="true"
+ <s:textfield key="model.processingTemplate" size="100" required="true"
label='%{getText("echobase.common.processingTemplate")}'/>
- <s:textfield key="model.processingDescription" size="40" required="true"
+ <s:textfield key="model.processingDescription" size="100" required="true"
label='%{getText("echobase.common.processingDescription")}'/>
- <s:textfield key="model.digitThreshold" size="40" required="true"
+ <s:textfield key="model.digitThreshold" size="100" required="true"
label='%{getText("echobase.common.digitThreshold")}'/>
- <s:textfield key="model.acousticDensityUnit" size="40" required="true"
+ <s:textfield key="model.acousticDensityUnit" size="100" required="true"
label='%{getText("echobase.common.acousticDensityUnit")}'/>
- <s:textfield key="model.notes" size="40" required="true"
+ <s:textfield key="model.notes" size="100" required="true"
label='%{getText("echobase.common.notes")}'/>
<s:file key="moviesFile" required="true"
Modified: trunk/echobase-ui/src/main/webapp/css/screen.css
===================================================================
--- trunk/echobase-ui/src/main/webapp/css/screen.css 2012-01-26 15:35:06 UTC (rev 295)
+++ trunk/echobase-ui/src/main/webapp/css/screen.css 2012-01-26 15:35:35 UTC (rev 296)
@@ -135,7 +135,7 @@
.wwlbl {
float: left;
clear: both;
- width: 300px;
+ width: 350px;
/*# text-align: right;*/
}
.wwctrl {
Modified: trunk/echobase-ui/src/main/webapp/js/gridHelper.js
===================================================================
--- trunk/echobase-ui/src/main/webapp/js/gridHelper.js 2012-01-26 15:35:06 UTC (rev 295)
+++ trunk/echobase-ui/src/main/webapp/js/gridHelper.js 2012-01-26 15:35:35 UTC (rev 296)
@@ -25,8 +25,8 @@
$.fn.extend(
{
- addRowSelectTopic: function(gridId, callback) {
- $.subscribe(gridId + '-rowSelect', function(event) {
+ addRowSelectTopic:function (gridId, callback) {
+ $.subscribe(gridId + '-rowSelect', function (event) {
if (event.originalEvent) {
var gridId = event.data.id;
var opts = jQuery.struts2_jquery[gridId] = {};
@@ -43,8 +43,8 @@
}, {id:gridId, callback:callback});
},
- addClearSelectTopic: function (gridId, callback) {
- $.subscribe(gridId + '-clearSelect', function(event) {
+ addClearSelectTopic:function (gridId, callback) {
+ $.subscribe(gridId + '-clearSelect', function (event) {
var gridId = event.data.id;
jQuery.struts2_jquery[gridId] = {};
var callback = event.data.callback;
@@ -54,15 +54,15 @@
}, {id:gridId, callback:callback});
},
- addAddRowTopic: function (gridId, url) {
- $.subscribe(gridId + '-rowAdd', function(event) {
+ addAddRowTopic:function (gridId, url) {
+ $.subscribe(gridId + '-rowAdd', function (event) {
var url = event.data.url;
window.location = url;
}, {id:gridId, url:url});
},
- addSingleRowTopic: function (gridId, action, url, parameterName) {
- $.subscribe(gridId + '-row' + action, function(event) {
+ addSingleRowTopic:function (gridId, action, url, parameterName) {
+ $.subscribe(gridId + '-row' + action, function (event) {
var gridId = event.data.id;
var opts = jQuery.struts2_jquery[gridId];
if (opts && opts['selectedRow']) {
@@ -75,8 +75,8 @@
}
}, {id:gridId, url:url, parameterName:parameterName});
},
- addMultiRowTopic: function (gridId, action, target, checkboxName, callback) {
- $.subscribe(gridId + '-row' + action, function(event) {
+ addMultiRowTopic:function (gridId, action, target, checkboxName, callback) {
+ $.subscribe(gridId + '-row' + action, function (event) {
var gridId = event.data.id;
var prefix = 'jqg_' + gridId + '_';
var prefixLength = prefix.length;
@@ -86,7 +86,7 @@
if (inputs && inputs.length) {
var checkboxName = event.data.checkboxName;
- inputs.each(function() {
+ inputs.each(function () {
var id = this.id;
var newId = id.substring(prefixLength);
$.attr(this, "name", checkboxName);
@@ -105,7 +105,7 @@
callback:callback});
},
- serializeCheckboxs: function(id, params, newId) {
+ serializeCheckboxs:function (id, params, newId) {
var all = $(':checkbox[name="' + id + '"]');
var selected = $(':checked[name="' + id + '"]');
@@ -113,7 +113,7 @@
// apply a year filter
var list = [];
- selected.each(function() {
+ selected.each(function () {
list.push(this.value);
});
if (!newId) {
@@ -123,7 +123,7 @@
}
},
- prepareUrl: function (url, params) {
+ prepareUrl:function (url, params) {
var result = url;
if (url.indexOf("?") > -1) {
result += "&";
@@ -132,34 +132,55 @@
}
result += $.param(params);
return result;
+ },
+
+ updateSelectBoxContent:function (url, params, jsonTarget, target) {
+
+ // call url to obtain datas to injetc in target select box
+ jQuery.getJSON(url, params, function (result) {
+
+ // will contains selectBox html code
+ var html = "<option/>";
+
+ // iterate on found datas (each data gives a select option)
+ $.each(result[jsonTarget], function (propertyName, value) {
+ html += '<option value="' + propertyName + '">' + value + '</option>'
+ });
+
+ // change the target html code
+ target.html(html);
+ });
}
});
$.extend({
- addRowSelectTopic:function(gridId, callback) {
+ addRowSelectTopic:function (gridId, callback) {
return $(document).addRowSelectTopic(gridId, callback);
},
- addClearSelectTopic:function(gridId, callback) {
+ addClearSelectTopic:function (gridId, callback) {
return $(document).addClearSelectTopic(gridId, callback);
},
- addAddRowTopic:function(gridId, url) {
+ addAddRowTopic:function (gridId, url) {
return $(document).addAddRowTopic(gridId, url);
},
- addSingleRowTopic:function(gridId, action, url, parameterName) {
+ addSingleRowTopic:function (gridId, action, url, parameterName) {
return $(document).addSingleRowTopic(gridId, action, url, parameterName);
},
- addMultiRowTopic:function(gridId, action, target, checkboxName, calbback) {
+ addMultiRowTopic:function (gridId, action, target, checkboxName, calbback) {
return $(document).addMultiRowTopic(gridId, action, target, checkboxName, calbback);
},
- serializeCheckboxs: function(id, params, newId) {
+ serializeCheckboxs:function (id, params, newId) {
return $(document).serializeCheckboxs(id, params, newId);
},
- prepareUrl:function(url, params) {
+ prepareUrl:function (url, params) {
return $(document).prepareUrl(url, params);
+ },
+ updateSelectBoxContent:function (url, params, jsonTarget, target) {
+ return $(document).updateSelectBoxContent(url, params, jsonTarget, target);
}
});
})(jQuery);
1
0