Coser-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
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
December 2010
- 2 participants
- 139 discussions
Author: chatellier
Date: 2010-12-23 13:46:37 +0000 (Thu, 23 Dec 2010)
New Revision: 443
Log:
Update nuiton-util, nuiton-i18n, nuiton-widgets
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-12-23 13:45:50 UTC (rev 442)
+++ trunk/pom.xml 2010-12-23 13:46:37 UTC (rev 443)
@@ -103,7 +103,7 @@
<dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-utils</artifactId>
- <version>1.5.1</version>
+ <version>1.5.2</version>
<scope>compile</scope>
</dependency>
@@ -179,7 +179,7 @@
<dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-widgets</artifactId>
- <version>1.1-SNAPSHOT</version>
+ <version>1.1</version>
<scope>compile</scope>
</dependency>
@@ -278,7 +278,7 @@
<!-- Versions -->
<jaxx.version>2.2.4-SNAPSHOT</jaxx.version>
- <i18n.version>2.0</i18n.version>
+ <i18n.version>2.0.1</i18n.version>
<struts.version>2.2.1.1</struts.version>
</properties>
1
0
r442 - in trunk: coser-business/src/main/java/fr/ifremer/coser/bean coser-business/src/main/java/fr/ifremer/coser/services coser-ui/src/main/java/fr/ifremer/coser/ui/result coser-ui/src/main/resources/fr/ifremer/coser/bean coser-ui/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 23 Dec '10
by chatellier@users.labs.libre-entreprise.org 23 Dec '10
23 Dec '10
Author: chatellier
Date: 2010-12-23 13:45:50 +0000 (Thu, 23 Dec 2010)
New Revision: 442
Log:
Rename datafile1 et datafile2 to estPopInd and estComInd
Modified:
trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java
trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/ResultTableModel.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/SelectionAddResultDialog.jaxx
trunk/coser-ui/src/main/resources/fr/ifremer/coser/bean/RSufiResult-error-validation.xml
trunk/coser-ui/src/main/resources/i18n/coser-ui_en_GB.properties
trunk/coser-ui/src/main/resources/i18n/coser-ui_fr_FR.properties
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java 2010-12-22 15:27:46 UTC (rev 441)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java 2010-12-23 13:45:50 UTC (rev 442)
@@ -48,14 +48,14 @@
protected String zone;
/** Utilisé seulement pour la validation (sinon, non valorisé). */
- protected String dataFile1Path;
+ protected String estComIndPath;
/** Utilisé seulement pour la validation (sinon, non valorisé). */
- protected String dataFile2Path;
+ protected String estPopIndPath;
- protected String dataFile1Name;
+ protected String estComIndName;
- protected String dataFile2Name;
+ protected String estPopIndName;
public String getName() {
return name;
@@ -87,44 +87,44 @@
getPropertyChangeSupport().firePropertyChange("zone", oldValue, zone);
}
- public String getDataFile1Path() {
- return dataFile1Path;
+ public String getEstComIndPath() {
+ return estComIndPath;
}
- public void setDataFile1Path(String dataFile1Path) {
- String oldValue = this.dataFile1Path;
- this.dataFile1Path = dataFile1Path;
- getPropertyChangeSupport().firePropertyChange("dataFile1Path", oldValue, dataFile1Path);
+ public void setEstComIndPath(String estComIndPath) {
+ String oldValue = this.estComIndPath;
+ this.estComIndPath = estComIndPath;
+ getPropertyChangeSupport().firePropertyChange("estComIndPath", oldValue, estComIndPath);
}
- public String getDataFile2Path() {
- return dataFile2Path;
+ public String getEstPopIndPath() {
+ return estPopIndPath;
}
- public void setDataFile2Path(String dataFile2Path) {
- String oldValue = this.dataFile2Path;
- this.dataFile2Path = dataFile2Path;
- getPropertyChangeSupport().firePropertyChange("dataFile2Path", oldValue, dataFile2Path);
+ public void setEstPopIndPath(String estPopIndPath) {
+ String oldValue = this.estPopIndPath;
+ this.estPopIndPath = estPopIndPath;
+ getPropertyChangeSupport().firePropertyChange("estPopIndPath", oldValue, estPopIndPath);
}
- public String getDataFile1Name() {
- return dataFile1Name;
+ public String getEstComIndName() {
+ return estComIndName;
}
- public void setDataFile1Name(String dataFile1Name) {
- String oldValue = this.dataFile1Name;
- this.dataFile1Name = dataFile1Name;
- getPropertyChangeSupport().firePropertyChange("dataFile1Name", oldValue, dataFile1Name);
+ public void setEstComIndName(String estComIndName) {
+ String oldValue = this.estComIndName;
+ this.estComIndName = estComIndName;
+ getPropertyChangeSupport().firePropertyChange("estComIndName", oldValue, estComIndName);
}
- public String getDataFile2Name() {
- return dataFile2Name;
+ public String getEstPopIndName() {
+ return estPopIndName;
}
- public void setDataFile2Name(String dataFile2Name) {
- String oldValue = this.dataFile2Name;
- this.dataFile2Name = dataFile2Name;
- getPropertyChangeSupport().firePropertyChange("dataFile2Name", oldValue, dataFile2Name);
+ public void setEstPopIndName(String estPopIndName) {
+ String oldValue = this.estPopIndName;
+ this.estPopIndName = estPopIndName;
+ getPropertyChangeSupport().firePropertyChange("estPopIndName", oldValue, estPopIndName);
}
public Properties toProperties() {
@@ -135,11 +135,11 @@
if (getZone() != null) {
props.setProperty("result.zone", getZone());
}
- if (getDataFile1Name() != null) {
- props.setProperty("result.datafile1name", getDataFile1Name());
+ if (getEstComIndName() != null) {
+ props.setProperty("result.estComIndName", getEstComIndName());
}
- if (getDataFile2Name() != null) {
- props.setProperty("result.datafile2name", getDataFile2Name());
+ if (getEstPopIndName() != null) {
+ props.setProperty("result.estPopIndName", getEstPopIndName());
}
return props;
}
@@ -151,11 +151,11 @@
if (props.containsKey("result.zone")) {
setZone(props.getProperty("result.zone"));
}
- if (props.containsKey("result.datafile1name")) {
- setDataFile1Name(props.getProperty("result.datafile1name"));
+ if (props.containsKey("result.estComIndName")) {
+ setEstComIndName(props.getProperty("result.estComIndName"));
}
- if (props.containsKey("result.datafile2name")) {
- setDataFile2Name(props.getProperty("result.datafile2name"));
+ if (props.containsKey("result.estPopIndName")) {
+ setEstPopIndName(props.getProperty("result.estPopIndName"));
}
}
}
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-12-22 15:27:46 UTC (rev 441)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-12-23 13:45:50 UTC (rev 442)
@@ -1041,12 +1041,12 @@
OutputStream outputStream = null;
try {
// sauvegarde des 2 fichiers obligatoires
- File dataFile1 = new File(rsufiResult.getDataFile1Path());
- File dataFile2 = new File(rsufiResult.getDataFile2Path());
- rsufiResult.setDataFile1Name(dataFile1.getName());
- rsufiResult.setDataFile2Name(dataFile2.getName());
- FileUtils.copyFileToDirectory(dataFile1, rsufiResultDirectory);
- FileUtils.copyFileToDirectory(dataFile2, rsufiResultDirectory);
+ File estComIndFile = new File(rsufiResult.getEstComIndPath());
+ File estPopIndFile = new File(rsufiResult.getEstPopIndPath());
+ rsufiResult.setEstComIndName(estComIndFile.getName());
+ rsufiResult.setEstPopIndName(estPopIndFile.getName());
+ FileUtils.copyFileToDirectory(estComIndFile, rsufiResultDirectory);
+ FileUtils.copyFileToDirectory(estPopIndFile, rsufiResultDirectory);
// sauvegarde des fichiers autre
File otherFilesDirectory = new File(rsufiResultDirectory, "others");
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/ResultTableModel.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/ResultTableModel.java 2010-12-22 15:27:46 UTC (rev 441)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/ResultTableModel.java 2010-12-23 13:45:50 UTC (rev 442)
@@ -85,10 +85,10 @@
name = _("coser.ui.result.table.rsufiVersion");
break;
case 2:
- name = _("coser.ui.result.table.dataFile1");
+ name = _("coser.ui.result.table.estComIndFile");
break;
case 3:
- name = _("coser.ui.result.table.dataFile2");
+ name = _("coser.ui.result.table.estPopIndFile");
break;
}
return name;
@@ -110,10 +110,10 @@
result = rsufiResult.getRsufiVersion();
break;
case 2:
- result = rsufiResult.getDataFile1Name();
+ result = rsufiResult.getEstComIndName();
break;
case 3:
- result = rsufiResult.getDataFile2Name();
+ result = rsufiResult.getEstPopIndName();
break;
}
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/SelectionAddResultDialog.jaxx
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/SelectionAddResultDialog.jaxx 2010-12-22 15:27:46 UTC (rev 441)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/SelectionAddResultDialog.jaxx 2010-12-23 13:45:50 UTC (rev 442)
@@ -34,8 +34,8 @@
errorTableModel="errorsTableModel">
<field name="name" component="resultNameField" />
<field name="rsufiVersion" component="resultRsufiVersion" />
- <field name="dataFile1Path" component="dataFile1TextField" />
- <field name="dataFile2Path" component="dataFile2TextField" />
+ <field name="estComIndPath" component="estComIndFileTextField" />
+ <field name="estPopIndPath" component="estPopIndFileTextField" />
</BeanValidator>
<row>
@@ -62,32 +62,43 @@
</row>
<row>
<cell anchor="west">
- <JLabel text="coser.ui.result.dataFile1" />
+ <JLabel text="coser.ui.result.zone" />
</cell>
+ <cell fill="horizontal" columns="2">
+ <JTextField id="resultZone" />
+ <javax.swing.text.Document javaBean="resultZone.getDocument()"
+ onInsertUpdate='getRsufiResult().setZone(resultZone.getText())'
+ onRemoveUpdate='getRsufiResult().setZone(resultZone.getText())' />
+ </cell>
+ </row>
+ <row>
+ <cell anchor="west">
+ <JLabel text="coser.ui.result.estComIndFile" />
+ </cell>
<cell weightx="1" fill="horizontal">
- <JTextField id="dataFile1TextField" />
- <javax.swing.text.Document javaBean="dataFile1TextField.getDocument()"
- onInsertUpdate='getRsufiResult().setDataFile1Path(dataFile1TextField.getText())'
- onRemoveUpdate='getRsufiResult().setDataFile1Path(dataFile1TextField.getText())' />
+ <JTextField id="estComIndFileTextField" />
+ <javax.swing.text.Document javaBean="estComIndFileTextField.getDocument()"
+ onInsertUpdate='getRsufiResult().setEstComIndPath(estComIndFileTextField.getText())'
+ onRemoveUpdate='getRsufiResult().setEstComIndPath(estComIndFileTextField.getText())' />
</cell>
<cell fill="horizontal">
<JButton text="coser.ui.common.selectFile"
- onActionPerformed="getHandler().selectResultFile(this, dataFile1TextField)" />
+ onActionPerformed="getHandler().selectResultFile(this, estComIndFileTextField)" />
</cell>
</row>
<row>
<cell anchor="west">
- <JLabel text="coser.ui.result.dataFile2" />
+ <JLabel text="coser.ui.result.estPopIndFile" />
</cell>
<cell fill="horizontal">
- <JTextField id="dataFile2TextField" />
- <javax.swing.text.Document javaBean="dataFile2TextField.getDocument()"
- onInsertUpdate='getRsufiResult().setDataFile2Path(dataFile2TextField.getText())'
- onRemoveUpdate='getRsufiResult().setDataFile2Path(dataFile2TextField.getText())' />
+ <JTextField id="estPopIndFileTextField" />
+ <javax.swing.text.Document javaBean="estPopIndFileTextField.getDocument()"
+ onInsertUpdate='getRsufiResult().setEstPopIndPath(estPopIndFileTextField.getText())'
+ onRemoveUpdate='getRsufiResult().setEstPopIndPath(estPopIndFileTextField.getText())' />
</cell>
<cell fill="horizontal">
<JButton text="coser.ui.common.selectFile"
- onActionPerformed="getHandler().selectResultFile(this, dataFile2TextField)" />
+ onActionPerformed="getHandler().selectResultFile(this, estPopIndFileTextField)" />
</cell>
</row>
<row>
Modified: trunk/coser-ui/src/main/resources/fr/ifremer/coser/bean/RSufiResult-error-validation.xml
===================================================================
--- trunk/coser-ui/src/main/resources/fr/ifremer/coser/bean/RSufiResult-error-validation.xml 2010-12-22 15:27:46 UTC (rev 441)
+++ trunk/coser-ui/src/main/resources/fr/ifremer/coser/bean/RSufiResult-error-validation.xml 2010-12-23 13:45:50 UTC (rev 442)
@@ -39,16 +39,16 @@
<message>coser.ui.result.requiredrsufiVersion</message>
</field-validator>
</field>
- <field name="dataFile1Path">
+ <field name="estComIndPath">
<field-validator type="requiredstring">
<param name="trim">true</param>
- <message>coser.ui.result.requireddataFile1Path</message>
+ <message>coser.ui.result.requiredestComIndPath</message>
</field-validator>
</field>
- <field name="dataFile2Path">
+ <field name="estPopIndPath">
<field-validator type="requiredstring">
<param name="trim">true</param>
- <message>coser.ui.result.requireddataFile2Path</message>
+ <message>coser.ui.result.requiredestPopIndPath</message>
</field-validator>
</field>
</validators>
Modified: trunk/coser-ui/src/main/resources/i18n/coser-ui_en_GB.properties
===================================================================
--- trunk/coser-ui/src/main/resources/i18n/coser-ui_en_GB.properties 2010-12-22 15:27:46 UTC (rev 441)
+++ trunk/coser-ui/src/main/resources/i18n/coser-ui_en_GB.properties 2010-12-23 13:45:50 UTC (rev 442)
@@ -128,25 +128,26 @@
coser.ui.result.addOtherDataFile=Add file
coser.ui.result.availableDataTitle=Available results \:
coser.ui.result.cancel=Cancel
-coser.ui.result.dataFile1=ESTPOPind file \:
-coser.ui.result.dataFile2=ESTCOMind file \:
+coser.ui.result.estComIndFile=ESTCOMind file \:
+coser.ui.result.estPopIndFile=ESTPOPind file \:
coser.ui.result.extractDataButton=Extract as Rsufi format
coser.ui.result.extractDataLabel=Extraction directory \:
coser.ui.result.extractDataTitle=Extract RSufi data
coser.ui.result.newResult=New Result
coser.ui.result.otherDataFile=Other files \:
-coser.ui.result.requireddataFile1Path=ESTPOPind file is required
-coser.ui.result.requireddataFile2Path=ESTCOMind file is required
+coser.ui.result.requiredestComIndPath=ESTCOMind file is required
+coser.ui.result.requiredestPopIndPath=ESTPOPind file is required
coser.ui.result.requiredname=Result name is required
coser.ui.result.requiredrsufiVersion=Rsufi version is required
coser.ui.result.resultName=Result name \:
coser.ui.result.rsufiVersion=RSufi version \:
coser.ui.result.saveError=Save error
-coser.ui.result.table.dataFile1=ESTPOPind file
-coser.ui.result.table.dataFile2=ESTCOMind file
+coser.ui.result.table.estComIndFile=ESTCOMind file
+coser.ui.result.table.estPopIndFile=ESTPOPind file
coser.ui.result.table.resultName=Result name
coser.ui.result.table.rsufiVersion=RSufi Version
coser.ui.result.validNewResult=Add this result
+coser.ui.result.zone=Zone \:
coser.ui.selection.allSpecies=L1 \: All species (%d/%d)
coser.ui.selection.comment=Comment \:
coser.ui.selection.createError=Creation error
Modified: trunk/coser-ui/src/main/resources/i18n/coser-ui_fr_FR.properties
===================================================================
--- trunk/coser-ui/src/main/resources/i18n/coser-ui_fr_FR.properties 2010-12-22 15:27:46 UTC (rev 441)
+++ trunk/coser-ui/src/main/resources/i18n/coser-ui_fr_FR.properties 2010-12-23 13:45:50 UTC (rev 442)
@@ -128,25 +128,26 @@
coser.ui.result.addOtherDataFile=Ajouter un fichier
coser.ui.result.availableDataTitle=R\u00E9sultats disponibles
coser.ui.result.cancel=Annuler
-coser.ui.result.dataFile1=Fichier ESTPOPind \:
-coser.ui.result.dataFile2=Fichier ESTCOMind \:
+coser.ui.result.estComIndFile=Fichier ESTCOMind \:
+coser.ui.result.estPopIndFile=Fichier ESTPOPind \:
coser.ui.result.extractDataButton=Extraire au format RSufi
coser.ui.result.extractDataLabel=Dossier d'extraction \:
coser.ui.result.extractDataTitle=Extraction des donn\u00E9es RSufi
coser.ui.result.newResult=Nouveau r\u00E9sultat
coser.ui.result.otherDataFile=Autre fichiers \:
-coser.ui.result.requireddataFile1Path=Le fichier ESTPOPind est requis
-coser.ui.result.requireddataFile2Path=le fichier ESTCOMind est requis
+coser.ui.result.requiredestComIndPath=Le fichier ESTCOMind est requis
+coser.ui.result.requiredestPopIndPath=Le fichier ESTPOPind est requis
coser.ui.result.requiredname=Le nom du r\u00E9sultat est requis
coser.ui.result.requiredrsufiVersion=Le champ 'rsufiVersion' est requis
coser.ui.result.resultName=Nom du r\u00E9sultat \:
coser.ui.result.rsufiVersion=Version de RSufi \:
coser.ui.result.saveError=Erreur de sauvegarde
-coser.ui.result.table.dataFile1=Fichier ESTPOPind
-coser.ui.result.table.dataFile2=Fichier ESTCOMind
+coser.ui.result.table.estComIndFile=Fichier ESTCOMind
+coser.ui.result.table.estPopIndFile=Fichier ESTPOPind
coser.ui.result.table.resultName=Nom du r\u00E9sultat
coser.ui.result.table.rsufiVersion=Version de RSufi
coser.ui.result.validNewResult=Ajouter le r\u00E9sultat
+coser.ui.result.zone=Zone \:
coser.ui.selection.allSpecies=L1 \: Toutes les esp\u00E8ces (%d/%d)
coser.ui.selection.comment=Commentaire \:
coser.ui.selection.createError=Erreur de cr\u00E9action
1
0
r441 - in trunk: coser-business/src/main/java/fr/ifremer/coser/services coser-web coser-web/src/main/java/fr/ifremer/coser/web coser-web/src/main/java/fr/ifremer/coser/web/actions coser-web/src/main/resources coser-web/src/main/resources/i18n coser-web/src/main/webapp coser-web/src/main/webapp/WEB-INF/content coser-web/src/main/webapp/images coser-web/src/main/webapp/styles
by chatellier@users.labs.libre-entreprise.org 22 Dec '10
by chatellier@users.labs.libre-entreprise.org 22 Dec '10
22 Dec '10
Author: chatellier
Date: 2010-12-22 15:27:46 +0000 (Wed, 22 Dec 2010)
New Revision: 441
Log:
Update web code (receive uploaded zip by application)
Added:
trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebConstants.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebException.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/ServiceFactory.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectSpeciesAction.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectZoneAction.java
trunk/coser-web/src/main/resources/log4j.properties
trunk/coser-web/src/main/resources/struts.xml
trunk/coser-web/src/main/webapp/WEB-INF/content/footer.jsp
trunk/coser-web/src/main/webapp/WEB-INF/content/header.jsp
trunk/coser-web/src/main/webapp/WEB-INF/content/select-species.jsp
trunk/coser-web/src/main/webapp/WEB-INF/content/select-zone.jsp
trunk/coser-web/src/main/webapp/images/
trunk/coser-web/src/main/webapp/images/logo_ifremer.gif
trunk/coser-web/src/main/webapp/images/logo_sih.gif
trunk/coser-web/src/main/webapp/images/zonesmap.jpg
trunk/coser-web/src/main/webapp/styles/
trunk/coser-web/src/main/webapp/styles/coser.css
Removed:
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/WelcomeUserAction.java
trunk/coser-web/src/main/webapp/WEB-INF/content/welcome-user.jsp
Modified:
trunk/coser-web/pom.xml
trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebConfig.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/IndexAction.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectIndicatorAction.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/UploadResultAction.java
trunk/coser-web/src/main/resources/i18n/coser-web_en_GB.properties
trunk/coser-web/src/main/resources/i18n/coser-web_fr_FR.properties
trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp
trunk/coser-web/src/main/webapp/WEB-INF/content/upload-result.jsp
Added: trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java (rev 0)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java 2010-12-22 15:27:46 UTC (rev 441)
@@ -0,0 +1,182 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.coser.services;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.ZipUtil;
+
+import fr.ifremer.coser.CoserBusinessConfig;
+import fr.ifremer.coser.CoserBusinessException;
+import fr.ifremer.coser.bean.Project;
+import fr.ifremer.coser.bean.RSufiResult;
+import fr.ifremer.coser.bean.Selection;
+import fr.ifremer.coser.data.Catch;
+
+/**
+ * Service for web server.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class WebService {
+
+ private static final Log log = LogFactory.getLog(WebService.class);
+
+ protected CoserBusinessConfig config;
+
+ protected ProjectService projectService;
+
+ public WebService(CoserBusinessConfig config) {
+ this.config = config;
+
+ projectService = new ProjectService(config);
+ }
+
+ /**
+ * Traite le fichier uploade par l'application client et l'enregistre
+ * dans le stockage coté web.
+ *
+ * @param archiveFile uploaded file
+ * @throws CoserBusinessException
+ */
+ public void registerNewUploadedResults(File archiveFile) throws CoserBusinessException {
+
+ File webDirectory = config.getWebServerDirectory();
+ File newDirectory = new File(webDirectory, "tutu");
+ try {
+ FileUtils.deleteDirectory(newDirectory);
+ newDirectory.mkdirs();
+
+ if (log.isInfoEnabled()) {
+ log.info("Unzipping file " + archiveFile + " to " + newDirectory);
+ }
+ ZipUtil.uncompress(archiveFile, newDirectory);
+ } catch (IOException ex) {
+ throw new CoserBusinessException("Can't uncompress file", ex);
+ }
+ }
+
+ /**
+ * Recuperer la liste des populations pour une zone données.
+ *
+ * @param zone zone
+ * @return map species nom info>nom officiel
+ * @throws CoserBusinessException
+ */
+ public Map<String, String> getSpecies(String zone) throws CoserBusinessException {
+
+ Map<String, String> result = new TreeMap<String, String>();
+
+ File webDirectory = config.getWebServerDirectory();
+ File newDirectory = new File(webDirectory, "tutu");
+ File[] projectFiles = newDirectory.listFiles();
+ if (projectFiles != null) {
+ for (File projectFile : projectFiles) {
+ if (projectFile.isDirectory()) {
+ Project project = projectService.openProject(projectFile.getName(), newDirectory);
+
+ for (Selection selection : project.getSelections().values()) {
+ boolean resultFound = false;
+
+ for (RSufiResult rsufiResult : selection.getRsufiResults()) {
+ if (rsufiResult.getZone() != null && rsufiResult.getZone().equals(zone)) {
+ projectService.loadSelectionData(project, selection);
+ Map<String, String> resultSpecies = getRsufiResultSpecies(project, selection, rsufiResult);
+ result.putAll(resultSpecies);
+ resultFound = true;
+ break;
+ }
+ }
+
+ if (resultFound) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Recupere la liste de toutes les especes nom sci et nom off à partir
+ * d'un resultat.
+ *
+ * @param project
+ * @param selection
+ * @param rsufiResult
+ * @return
+ */
+ protected Map<String, String> getRsufiResultSpecies(Project project,
+ Selection selection, RSufiResult rsufiResult) {
+ Map<String, String> result = new HashMap<String, String>();
+
+ // load reftax in memory
+ Map<String, String> speciesNames = new HashMap<String, String>();
+ Iterator<String[]> reftax = project.getRefTaxSpecies().iterator();
+ reftax.next(); // skip header
+ while (reftax.hasNext()) {
+ String[] tuple = reftax.next();
+
+ // "C_Perm","NumSys","NivSys","C_VALIDE","L_VALIDE","AA_VALIDE","C_TxP\u00E8re","Taxa"
+ String speciesCode = tuple[3];
+ String speciesName = tuple[4];
+
+ speciesNames.put(speciesCode, speciesName);
+ }
+
+ // get this selection data
+ // FIXME echatellier sould be result data, but there is no such data
+ Iterator<String[]> catchIterator = selection.getCatch().iterator();
+ catchIterator.next(); // skip header
+ while (catchIterator.hasNext()) {
+ String[] tuple = catchIterator.next();
+
+ String specyCode = tuple[Catch.INDEX_SPECIES];
+ String specyName = speciesNames.get(specyCode);
+
+ if (StringUtils.isNotEmpty(specyName)) {
+ result.put(specyCode, specyName);
+ }
+ }
+
+ return result;
+ }
+}
Property changes on: trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/coser-web/pom.xml
===================================================================
--- trunk/coser-web/pom.xml 2010-12-22 15:26:32 UTC (rev 440)
+++ trunk/coser-web/pom.xml 2010-12-22 15:27:46 UTC (rev 441)
@@ -21,6 +21,15 @@
<scope>compile</scope>
</dependency>
<dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-utils</artifactId>
</dependency>
Modified: trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebConfig.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebConfig.java 2010-12-22 15:26:32 UTC (rev 440)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebConfig.java 2010-12-22 15:27:46 UTC (rev 441)
@@ -24,8 +24,6 @@
import static org.nuiton.i18n.I18n._;
-import java.io.File;
-
import fr.ifremer.coser.CoserBusinessConfig;
/**
@@ -49,20 +47,33 @@
}
/**
- * Get coser web result directory.
+ * Get admin password.
*
- * @return
+ * @return admin password
*/
- public File getResultDirectory() {
- File result = getOptionAsFile(CoserWebOption.RESULT_DIRECTORY.key);
+ public String getAdminPassword() {
+ String result = getOption(CoserWebOption.ADMIN_PASSWORD.key);
return result;
}
+ /**
+ * Get eastwood server url to use.
+ *
+ * @return eastwood context url
+ */
+ public String getEastWoodUrl() {
+ String result = getOption(CoserWebOption.EASTWOOD_URL.key);
+ return result;
+ }
+
public enum CoserWebOption {
+
CONFIG_FILE(CONFIG_FILE_NAME, _("coser.config.config.file.description"), "coserweb.properties"),
- RESULT_DIRECTORY("coser.web.directory", _("coser.config.config.file.description"), "${java.io.tmpdir}" + File.separator + "coserweb");
+ ADMIN_PASSWORD("coser.admin.password", _("coser.config.admin.password.description"), null),
+ EASTWOOD_URL("coser.eastwood.url", _("coser.config.eastwood.url.description"), "http://www.ifremer.fr/eastwood");
+
protected String key;
protected String description;
protected String defaultValue;
Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebConstants.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebConstants.java (rev 0)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebConstants.java 2010-12-22 15:27:46 UTC (rev 441)
@@ -0,0 +1,41 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.coser.web;
+
+/**
+ * Constantes cote web.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class CoserWebConstants {
+
+ /** Nom du fichier de proprietes du serveur. */
+ public static final String WEB_PROPERTIES_NAME = "web.properties";
+}
Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebConstants.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebException.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebException.java (rev 0)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebException.java 2010-12-22 15:27:46 UTC (rev 441)
@@ -0,0 +1,59 @@
+/*
+ * #%L
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.coser.web;
+
+/**
+ * Coser web runtime exception.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class CoserWebException extends RuntimeException {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -1002725698959514244L;
+
+ /**
+ * Constructs a new exception with the specified detail message.
+ *
+ * @param message the detail message
+ */
+ public CoserWebException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new exception with the specified detail message and cause.
+ *
+ * @param message the detail message
+ * @param cause the cause
+ */
+ public CoserWebException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/ServiceFactory.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/ServiceFactory.java (rev 0)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/ServiceFactory.java 2010-12-22 15:27:46 UTC (rev 441)
@@ -0,0 +1,75 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.coser.web;
+
+import org.nuiton.util.ArgumentsParserException;
+
+import fr.ifremer.coser.services.WebService;
+
+/**
+ * Coser service singleton factory.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class ServiceFactory {
+
+ protected static CoserWebConfig coserConfig;
+
+ protected static WebService webService;
+
+ /**
+ * Get application config configuration.
+ *
+ * @return configuration
+ */
+ public static synchronized CoserWebConfig getCoserConfig() {
+ if (coserConfig == null) {
+ coserConfig = new CoserWebConfig();
+ try {
+ coserConfig.parse(new String[0]);
+ } catch (ArgumentsParserException ex) {
+ throw new CoserWebException("Can't read configuration", ex);
+ }
+ }
+ return coserConfig;
+ }
+
+ /**
+ * Get web service.
+ *
+ * @return web service
+ */
+ public static synchronized WebService getWebService() {
+ if (webService == null) {
+ webService = new WebService(getCoserConfig());
+ }
+ return webService;
+ }
+}
Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/ServiceFactory.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/IndexAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/IndexAction.java 2010-12-22 15:26:32 UTC (rev 440)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/IndexAction.java 2010-12-22 15:27:46 UTC (rev 441)
@@ -23,14 +23,18 @@
package fr.ifremer.coser.web.actions;
import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Properties;
-import org.nuiton.util.ArgumentsParserException;
-
import com.opensymphony.xwork2.ActionSupport;
import fr.ifremer.coser.web.CoserWebConfig;
+import fr.ifremer.coser.web.CoserWebConstants;
+import fr.ifremer.coser.web.CoserWebException;
+import fr.ifremer.coser.web.ServiceFactory;
/**
* Action index, recupere la liste des resultats.
@@ -46,31 +50,34 @@
/** serialVersionUID. */
private static final long serialVersionUID = 1663244944108703571L;
- protected List<String> results;
+ protected Date dataUpdateDate;
- public List<String> getResults() {
- return results;
+ public Date getDataUpdateDate() {
+ return dataUpdateDate;
}
@Override
public String execute() {
+
+ CoserWebConfig config = ServiceFactory.getCoserConfig();
+ File webProperties = new File(config.getWebServerDirectory(), CoserWebConstants.WEB_PROPERTIES_NAME);
- CoserWebConfig config = new CoserWebConfig();
+ // get update date
+ Properties props = new Properties();
try {
- config.parse(new String[]{});
- } catch (ArgumentsParserException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ props.load(new FileInputStream(webProperties));
- File directory = config.getResultDirectory();
- File[] subDirectories = directory.listFiles();
+ if (props.containsKey("updateDate")) {
+ String date = props.getProperty("updateDate");
+ long time = Long.parseLong(date);
+ dataUpdateDate = new Date(time);
+ }
+ else {
+ dataUpdateDate = new Date(0);
+ }
- results = new ArrayList<String>();
- for (File subDirectory : subDirectories) {
- if (subDirectory.isDirectory()) {
- results.add(subDirectory.getName());
- }
+ } catch (IOException ex) {
+ throw new CoserWebException("Can't save properties file", ex);
}
return SUCCESS;
Modified: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectIndicatorAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectIndicatorAction.java 2010-12-22 15:26:32 UTC (rev 440)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectIndicatorAction.java 2010-12-22 15:27:46 UTC (rev 441)
@@ -22,15 +22,10 @@
package fr.ifremer.coser.web.actions;
-import java.io.File;
import java.util.List;
-import org.nuiton.util.ArgumentsParserException;
-
import com.opensymphony.xwork2.ActionSupport;
-import fr.ifremer.coser.web.CoserWebConfig;
-
/**
* Action index, recupere la liste des resultats.
*
@@ -67,20 +62,7 @@
@Override
public String execute() {
-
- CoserWebConfig config = new CoserWebConfig();
- try {
- config.parse(new String[]{});
- } catch (ArgumentsParserException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- File directory = config.getResultDirectory();
- File resultDirectory = new File(directory, result);
-
-
-
return SUCCESS;
}
}
Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectSpeciesAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectSpeciesAction.java (rev 0)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectSpeciesAction.java 2010-12-22 15:27:46 UTC (rev 441)
@@ -0,0 +1,90 @@
+/*
+ * #%L
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ * %%
+ * 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.coser.web.actions;
+
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+import fr.ifremer.coser.CoserBusinessException;
+import fr.ifremer.coser.services.WebService;
+import fr.ifremer.coser.web.CoserWebException;
+import fr.ifremer.coser.web.ServiceFactory;
+
+/**
+ * Action index, recupere la liste des resultats.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class SelectSpeciesAction extends ActionSupport {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1663244944108703571L;
+
+ private static final Log log = LogFactory.getLog(SelectSpeciesAction.class);
+
+ protected String zone;
+
+ protected Map<String, String> species;
+
+ public String getZone() {
+ return zone;
+ }
+
+ public void setZone(String zone) {
+ this.zone = zone;
+ }
+
+ public Map<String, String> getSpecies() {
+ return species;
+ }
+
+ @Override
+ public String execute() {
+
+ if (log.isInfoEnabled()) {
+ log.info("Looking for species for zone " + zone);
+ }
+
+ WebService webService = ServiceFactory.getWebService();
+
+ try {
+ species = webService.getSpecies(zone);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Species are : " + species);
+ }
+ } catch (CoserBusinessException e) {
+ throw new CoserWebException("Can't get zone species");
+ }
+
+ return SUCCESS;
+ }
+}
Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectSpeciesAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectZoneAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectZoneAction.java (rev 0)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectZoneAction.java 2010-12-22 15:27:46 UTC (rev 441)
@@ -0,0 +1,46 @@
+/*
+ * #%L
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ * %%
+ * 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.coser.web.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ * Action index, affiche une liste fixe de 10 zones.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class SelectZoneAction extends ActionSupport {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3385467755357775199L;
+
+ @Override
+ public String execute() {
+
+ return SUCCESS;
+ }
+}
Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectZoneAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/UploadResultAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/UploadResultAction.java 2010-12-22 15:26:32 UTC (rev 440)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/UploadResultAction.java 2010-12-22 15:27:46 UTC (rev 441)
@@ -23,51 +23,121 @@
package fr.ifremer.coser.web.actions;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Properties;
-import com.opensymphony.xwork2.ActionSupport;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import com.opensymphony.xwork2.Action;
+
+import fr.ifremer.coser.CoserBusinessException;
+import fr.ifremer.coser.services.WebService;
+import fr.ifremer.coser.web.CoserWebConfig;
+import fr.ifremer.coser.web.CoserWebConstants;
+import fr.ifremer.coser.web.CoserWebException;
+import fr.ifremer.coser.web.ServiceFactory;
+
/**
+ * Upload results action.
*
+ * Cette action est appelée par l'interface swing cliente.
+ *
* @author chatellier
* @version $Revision$
*
* Last update : $Date$
* By : $Author$
*/
-public class UploadResultAction extends ActionSupport {
+public class UploadResultAction implements Action {
/** serialVersionUID. */
private static final long serialVersionUID = 3887268253160622587L;
- protected File resultFile;
-
- protected File resultFileFileName;
+ private static final Log log = LogFactory.getLog(UploadResultAction.class);
+ private File resultFile;
+
+ private String password;
+
public void setResultFile(File resultFile) {
+ System.out.println("resultFile = " + resultFile);
this.resultFile = resultFile;
}
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
public File getResultFile() {
return resultFile;
}
- public File getResultFileFileName() {
- return resultFileFileName;
+ public String getPassword() {
+ return password;
}
- public void setResultFileFileName(File resultFileFileName) {
- this.resultFileFileName = resultFileFileName;
- }
+ public String execute() {
- //@Action(params={"allowedTypes", "application/zip"})
- public String execute() {
- if (resultFile == null) {
- System.out.println("File size = " + null);
- return INPUT;
+ // check
+ CoserWebConfig config = ServiceFactory.getCoserConfig();
+ if (config.getAdminPassword() == null) {
+ if (log.isWarnEnabled()) {
+ log.warn("No admin password set, cannot enable result upload");
+ }
}
else {
- System.out.println("File size = " + resultFile.length());
- return SUCCESS;
+
+ if (config.getAdminPassword().equals(password)) {
+ if (resultFile != null) {
+ WebService webService = ServiceFactory.getWebService();
+ try {
+ webService.registerNewUploadedResults(resultFile);
+
+ updateDataProperties();
+ } catch (CoserBusinessException ex) {
+ throw new CoserWebException("Can't register new result file", ex);
+ }
+ return SUCCESS;
+ }
+ else {
+ if (log.isWarnEnabled()) {
+ log.warn("File is null");
+ }
+ }
+ }
+ else {
+ if (log.isWarnEnabled()) {
+ log.warn("Wrong password");
+ }
+ }
}
+
+ return INPUT;
}
+
+ /**
+ * Met à jour certaines proprietes apres la mise à jour des données.
+ */
+ protected void updateDataProperties() {
+
+ CoserWebConfig config = ServiceFactory.getCoserConfig();
+ File webProperties = new File(config.getWebServerDirectory(), CoserWebConstants.WEB_PROPERTIES_NAME);
+
+ Properties props = new Properties();
+ try {
+ props.load(new FileInputStream(webProperties));
+
+ props.setProperty("updateDate", String.valueOf(new Date().getTime()));
+ props.store(new FileOutputStream(webProperties), "Update data");
+ } catch (IOException ex) {
+ throw new CoserWebException("Can't save properties file", ex);
+ }
+
+
+ }
}
Deleted: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/WelcomeUserAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/WelcomeUserAction.java 2010-12-22 15:26:32 UTC (rev 440)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/WelcomeUserAction.java 2010-12-22 15:27:46 UTC (rev 441)
@@ -1,64 +0,0 @@
-/*
- * #%L
- * $Id$
- * $HeadURL$
- * %%
- * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
- * %%
- * 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.coser.web.actions;
-
-import com.opensymphony.xwork2.ActionSupport;
-
-/**
- * TODO add comment here.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class WelcomeUserAction extends ActionSupport {
-
- /** serialVersionUID. */
- private static final long serialVersionUID = 3887268253160622587L;
-
- private String userName;
- private String message;
-
- public String execute() {
- message = "Welcome " + userName;
- return SUCCESS;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public String getMessage() {
- return message;
- }
-}
Modified: trunk/coser-web/src/main/resources/i18n/coser-web_en_GB.properties
===================================================================
--- trunk/coser-web/src/main/resources/i18n/coser-web_en_GB.properties 2010-12-22 15:26:32 UTC (rev 440)
+++ trunk/coser-web/src/main/resources/i18n/coser-web_en_GB.properties 2010-12-22 15:27:46 UTC (rev 441)
@@ -1 +1,3 @@
+coser.config.admin.password.description=
coser.config.config.file.description=
+coser.config.eastwood.url.description=
Modified: trunk/coser-web/src/main/resources/i18n/coser-web_fr_FR.properties
===================================================================
--- trunk/coser-web/src/main/resources/i18n/coser-web_fr_FR.properties 2010-12-22 15:26:32 UTC (rev 440)
+++ trunk/coser-web/src/main/resources/i18n/coser-web_fr_FR.properties 2010-12-22 15:27:46 UTC (rev 441)
@@ -1 +1,3 @@
+coser.config.admin.password.description=
coser.config.config.file.description=
+coser.config.eastwood.url.description=
Added: trunk/coser-web/src/main/resources/log4j.properties
===================================================================
--- trunk/coser-web/src/main/resources/log4j.properties (rev 0)
+++ trunk/coser-web/src/main/resources/log4j.properties 2010-12-22 15:27:46 UTC (rev 441)
@@ -0,0 +1,35 @@
+###
+# #%L
+#
+#
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+
+# Global logging configuration
+log4j.rootLogger=ERROR, stdout
+
+# Console output
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss} %-5p %c:%L - %m%n
+
+# Categories
+log4j.category.fr.ifremer.coser=INFO
Added: trunk/coser-web/src/main/resources/struts.xml
===================================================================
--- trunk/coser-web/src/main/resources/struts.xml (rev 0)
+++ trunk/coser-web/src/main/resources/struts.xml 2010-12-22 15:27:46 UTC (rev 441)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
+<struts>
+ <constant name="struts.multipart.maxSize" value="100097152"/>
+
+
+</struts>
Added: trunk/coser-web/src/main/webapp/WEB-INF/content/footer.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/footer.jsp (rev 0)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/footer.jsp 2010-12-22 15:27:46 UTC (rev 441)
@@ -0,0 +1,29 @@
+<!--
+ #%L
+ Coser :: Web
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
+<%@taglib uri="/struts-tags" prefix="s" %>
+
+ <div>
+ Copyright 2010 Ifremer
+ </div>
\ No newline at end of file
Added: trunk/coser-web/src/main/webapp/WEB-INF/content/header.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/header.jsp (rev 0)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/header.jsp 2010-12-22 15:27:46 UTC (rev 441)
@@ -0,0 +1,33 @@
+<!--
+ #%L
+ Coser :: Web
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
+<%@taglib uri="/struts-tags" prefix="s" %>
+
+ <div>
+ <img src="images/logo_sih.gif" />
+ <img src="images/logo_ifremer.gif" />
+ </div>
+
+ <hr />
+
Modified: trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp 2010-12-22 15:26:32 UTC (rev 440)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp 2010-12-22 15:27:46 UTC (rev 441)
@@ -27,21 +27,64 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Hello World</title>
+ <title>Coser</title>
+ <link rel="stylesheet" type="text/css" href="styles/coser.css" />
</head>
<body>
- <s:form action="upload-result" method="post" enctype="multipart/form-data">
- <s:actionerror />
- <s:file name="resultFile" label="Result archive" />
- <s:submit />
- </s:form>
- <s:form action="welcome-user">
- <s:textfield name="userName" label="User Name" />
- <s:submit />
- </s:form>
- <hr />
- <s:form action="select-indicator">
- <s:select name="result" list="results" label="Result name"/>
- </s:form>
+ <h2>Indices de populations et de communauté issus des campagnes de surveillance halieutique de l'Ifremer</h2>
+
+ <p>Ce site présente des indices de populations et de communauté calculés à partir des
+ données du réseau des campagnes de surveillance halieutiques opérées par l'Ifremer
+ en mer du Nord, Manche, Atlantique et Méditerranée.
+ Il contient des informations relatives à 15 séries de campagnes</p>
+
+ <a href="http://www.ifremer.fr/SIH-indices-campagnes/fichiers/Web_EstPopInd_Presenta…"
+ target="_blank">Les campagnes de surveillance halieutique de l'Ifremer</a>
+
+ <h3>Les indices de populations et de communauté</h3>
+ <ul>
+ <li>10 indices de populations et 4 indices de communauté</li>
+ <li>168 taxons pris en compte</li>
+ </ul>
+
+ <table>
+ <tr>
+ <td>Informations sur les</td>
+ <td>populations</td>
+ <td>/</td>
+ <td>Communautés</td>
+ </tr>
+ <tr>
+ <td>Les indices calculés</td>
+ <td>
+ <a href="http://www.ifremer.fr/SIH-indices-campagnes/fichiers/Web_EstPopInd_Presenta…">X</a>
+ </td>
+ <td />
+ <td>
+ <a href="http://www.ifremer.fr/SIH-indices-campagnes/fichiers/Web_EstComInd_Presenta…">X</a>
+ </td>
+ </tr>
+ <tr>
+ <td>Accès aux données</td>
+ <td>
+ <s:a action="select-zone">X</s:a>
+ </td>
+ <td />
+ <td>
+ <s:a action="select-zone">X</s:a>
+ </td>
+ </tr>
+ </table>
+
+ <p><b>Pour citer ce site :</b> Ifremer <s:date name="dataUpdateDate" format="yyyy" />. Indices de populations et de communautés
+ issus des campagnes de surveillance halieutique de l'Ifremer.
+ http://www.ifremer.fr/SIH-indices-campagnes/ <s:date name="dataUpdateDate" format="dd MMMM" />.</p>
+
+ <p>Gestion des données des campagnes océanographiques :
+ <ul>
+ <li><a href="http://www.ifremer.fr/sismer/index_FR.htm">le Système d'informations scientifiques pour la mer de l'Ifremer (SISMER)</a></li>
+ <li><a href="http://www.ifremer.fr/sih">le Système d'information halieutique de l'Ifremer (SIH)</a></li>
+ </ul></p>
+
</body>
</html>
\ No newline at end of file
Added: trunk/coser-web/src/main/webapp/WEB-INF/content/select-species.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/select-species.jsp (rev 0)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/select-species.jsp 2010-12-22 15:27:46 UTC (rev 441)
@@ -0,0 +1,50 @@
+<!--
+ #%L
+ Coser :: Web
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<%@taglib uri="/struts-tags" prefix="s" %>
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>Coser</title>
+ <link rel="stylesheet" type="text/css" href="styles/coser.css" />
+ </head>
+ <body>
+
+ <%@ include file="header.jsp" %>
+
+ <img src="images/zonesmap.jpg" />
+
+ <br />
+
+ <s:form action="select-indicator">
+
+ <s:select name="species" list="species" label="Select a country" />
+ <s:hidden name="zone" value="zone" />
+ </s:form>
+
+ <%@ include file="footer.jsp" %>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/coser-web/src/main/webapp/WEB-INF/content/select-zone.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/select-zone.jsp (rev 0)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/select-zone.jsp 2010-12-22 15:27:46 UTC (rev 441)
@@ -0,0 +1,63 @@
+<!--
+ #%L
+ Coser :: Web
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ -->
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<%@taglib uri="/struts-tags" prefix="s" %>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>Coser</title>
+ <link rel="stylesheet" type="text/css" href="styles/coser.css" />
+ </head>
+ <body>
+
+ <%@ include file="header.jsp" %>
+
+ <img src="images/zonesmap.jpg" />
+
+ <br />
+
+ <s:form action="select-species">
+ <select name="zone">
+ <option value="manchecgfs">Plateau - Manche CGFS</option>
+ <option value="celtiqueevhoe">Plateau - Celtique EVHOE</option>
+ <option value="gascogneevhoe">Plateau - Gascogne EVHOE</option>
+ <option value="gascogneressgasc01">Plateau - Gascogne RESSGASC_01</option>
+ <option value="gascogneressgasc02">Plateau - Gascogne RESSGASC_02</option>
+ <option value="gascogneressgasc03">Plateau - Gascogne RESSGASC_03</option>
+ <option value="gascogneressgasc04">Plateau - Gascogne RESSGASC_04</option>
+ <option value="lionmedtis">Plateau - Lion MEDITS</option>
+ <option value="estcorsemedits">Plateau - Est-Corse MEDITS</option>
+ <option value="sommenoursom">Baie - Somme NOURSOM</option>
+ <option value="seinenoursei">Baie - Seine NOURSEI</option>
+ <option value="vilainenourvil">Baie - Vilaine NOURVIL</option>
+ <option value="crustaflamjuin">Cap - Flamanville CRUSTAFLAM Juin</option>
+ <option value="crustaflamsept">Cap - Flamanville CRUSTAFLAM Septembre</option>
+ </select>
+ <s:submit label="Suite"/>
+ </s:form>
+
+ <%@ include file="footer.jsp" %>
+ </body>
+</html>
\ No newline at end of file
Modified: trunk/coser-web/src/main/webapp/WEB-INF/content/upload-result.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/upload-result.jsp 2010-12-22 15:26:32 UTC (rev 440)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/upload-result.jsp 2010-12-22 15:27:46 UTC (rev 441)
@@ -35,6 +35,7 @@
<s:form action="upload-result" method="post" enctype="multipart/form-data">
<s:actionerror />
<s:file name="resultFile" label="Result archive" />
+ <s:textfield name="password" label="Password" />
<s:submit />
</s:form>
</body>
Deleted: trunk/coser-web/src/main/webapp/WEB-INF/content/welcome-user.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/welcome-user.jsp 2010-12-22 15:26:32 UTC (rev 440)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/welcome-user.jsp 2010-12-22 15:27:46 UTC (rev 441)
@@ -1,35 +0,0 @@
-<!--
- #%L
- Coser :: Web
-
- $Id$
- $HeadURL$
- %%
- Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- -->
-<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<%@taglib uri="/struts-tags" prefix="s" %>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>Welcome User</title>
- </head>
- <body>
- <h1>Hi : ${message}</h1>
- </body>
-</html>
\ No newline at end of file
Added: trunk/coser-web/src/main/webapp/images/logo_ifremer.gif
===================================================================
(Binary files differ)
Property changes on: trunk/coser-web/src/main/webapp/images/logo_ifremer.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/coser-web/src/main/webapp/images/logo_sih.gif
===================================================================
(Binary files differ)
Property changes on: trunk/coser-web/src/main/webapp/images/logo_sih.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/coser-web/src/main/webapp/images/zonesmap.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/coser-web/src/main/webapp/images/zonesmap.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/coser-web/src/main/webapp/styles/coser.css
===================================================================
--- trunk/coser-web/src/main/webapp/styles/coser.css (rev 0)
+++ trunk/coser-web/src/main/webapp/styles/coser.css 2010-12-22 15:27:46 UTC (rev 441)
@@ -0,0 +1,13 @@
+body {
+ background-color: #1F7DCB;
+ color: #2A2A2A;
+}
+
+a {
+ color: #2C9FF;
+}
+
+a:hover {
+ color: #165A97;
+}
+
1
0
22 Dec '10
Author: chatellier
Date: 2010-12-22 15:26:32 +0000 (Wed, 22 Dec 2010)
New Revision: 440
Log:
Doc about struts
Added:
trunk/src/site/rst/devel/
trunk/src/site/rst/devel/struts.rst
Added: trunk/src/site/rst/devel/struts.rst
===================================================================
--- trunk/src/site/rst/devel/struts.rst (rev 0)
+++ trunk/src/site/rst/devel/struts.rst 2010-12-22 15:26:32 UTC (rev 440)
@@ -0,0 +1,5 @@
+Struts 2
+========
+
+Links :
+ * http://old.nabble.com/Updating-the-Struts-2-Guice-plugin-td30364219.html
\ No newline at end of file
1
0
r439 - trunk/coser-web/src/main/webapp/WEB-INF
by chatellier@users.labs.libre-entreprise.org 22 Dec '10
by chatellier@users.labs.libre-entreprise.org 22 Dec '10
22 Dec '10
Author: chatellier
Date: 2010-12-22 15:19:18 +0000 (Wed, 22 Dec 2010)
New Revision: 439
Log:
Strange string in file
Modified:
trunk/coser-web/src/main/webapp/WEB-INF/web.xml
Modified: trunk/coser-web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/web.xml 2010-12-22 15:18:28 UTC (rev 438)
+++ trunk/coser-web/src/main/webapp/WEB-INF/web.xml 2010-12-22 15:19:18 UTC (rev 439)
@@ -37,7 +37,6 @@
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
- actionPackages
<init-param>
<param-name>actionPackages</param-name>
<param-value>fr.ifremer.coser.web</param-value>
1
0
r438 - trunk/coser-business/src/test/resources
by chatellier@users.labs.libre-entreprise.org 22 Dec '10
by chatellier@users.labs.libre-entreprise.org 22 Dec '10
22 Dec '10
Author: chatellier
Date: 2010-12-22 15:18:28 +0000 (Wed, 22 Dec 2010)
New Revision: 438
Log:
Bad comment
Modified:
trunk/coser-business/src/test/resources/log4j.properties
Modified: trunk/coser-business/src/test/resources/log4j.properties
===================================================================
--- trunk/coser-business/src/test/resources/log4j.properties 2010-12-22 15:17:39 UTC (rev 437)
+++ trunk/coser-business/src/test/resources/log4j.properties 2010-12-22 15:18:28 UTC (rev 438)
@@ -1,7 +1,7 @@
###
# #%L
-# Vradi :: Business
#
+#
# $Id$
# $HeadURL$
# %%
1
0
r437 - in trunk: coser-business/src/main/java/fr/ifremer/coser coser-business/src/main/java/fr/ifremer/coser/services coser-business/src/main/resources/i18n coser-ui/src/main/java/fr/ifremer/coser/ui coser-ui/src/main/java/fr/ifremer/coser/ui/control coser-ui/src/main/java/fr/ifremer/coser/ui/result coser-ui/src/main/resources/i18n
by chatellier@users.labs.libre-entreprise.org 22 Dec '10
by chatellier@users.labs.libre-entreprise.org 22 Dec '10
22 Dec '10
Author: chatellier
Date: 2010-12-22 15:17:39 +0000 (Wed, 22 Dec 2010)
New Revision: 437
Log:
Add result selection and upload to coser web frontend.
Added:
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/ResultHandler.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/RsufiResultRenderer.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/RsufiResultTreeModel.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/SelectUploadResultView.jaxx
Modified:
trunk/coser-business/src/main/java/fr/ifremer/coser/CoserBusinessConfig.java
trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java
trunk/coser-business/src/main/resources/i18n/coser-business_en_GB.properties
trunk/coser-business/src/main/resources/i18n/coser-business_fr_FR.properties
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrame.jaxx
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java
trunk/coser-ui/src/main/resources/i18n/coser-ui_en_GB.properties
trunk/coser-ui/src/main/resources/i18n/coser-ui_fr_FR.properties
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/CoserBusinessConfig.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/CoserBusinessConfig.java 2010-12-22 15:14:42 UTC (rev 436)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/CoserBusinessConfig.java 2010-12-22 15:17:39 UTC (rev 437)
@@ -117,6 +117,21 @@
return result;
}
+ public String getWebUploadURL() {
+ String result = getOption(CoserBusinessOption.WEB_UPLOAD_URL.key);
+ return result;
+ }
+
+ public String getWebUploadPassword() {
+ String result = getOption(CoserBusinessOption.WEB_UPLOAD_PASSWORD.key);
+ return result;
+ }
+
+ public File getWebServerDirectory() {
+ File result = getOptionAsFile(CoserBusinessOption.WEB_SERVER_DIRECTORY.key);
+ return result;
+ }
+
public static enum CoserBusinessOption implements OptionDef {
DATABASE_DIRECTORY("coser.database.directory", _("coser.config.database.directory.description"), "${user.home}" + File.separator + "coser", String.class, false, false),
@@ -132,8 +147,16 @@
CONTROL_DIFF_CATCH_LENGTH("coser.control.diffcatchlength", _("coser.config.control.diffcatchlength.description"), "5.0", Double.class, false, false),
CONTROL_TYPE_FISH("coser.control.typeFish", _("coser.config.control.typeFish.description"), "Pisces + Agnatha", String.class, false, false),
SELECTION_FILTER_OCCURRENCE("coser.selection.occurrenceFilter", _("coser.config.selection.occurrenceFilter.description"), "5.0", Double.class, false, false),
- SELECTION_FILTER_DENSITY("coser.selection.densityFilter", _("coser.config.selection.densityFilter.description"), "5.0", Double.class, false, false);
+ SELECTION_FILTER_DENSITY("coser.selection.densityFilter", _("coser.config.selection.densityFilter.description"), "5.0", Double.class, false, false),
+ /** Client side. */
+ WEB_FRONT_END("coser.web.frontend", _("coser.config.web.frontend.description"), "http://www.ifremer.fr/coser", String.class, false, false),
+ WEB_UPLOAD_URL("coser.web.uploadurl", _("coser.config.web.uploadurl.description"), "${" + WEB_FRONT_END.key + "}/upload-result.action", String.class, false, false),
+ WEB_UPLOAD_PASSWORD("coser.web.uploadpassword", _("coser.config.web.uploadpassword.description"), "", String.class, false, false),
+
+ /** Server side. */
+ WEB_SERVER_DIRECTORY("coser.web.server.directory", _("coser.config.web.server.directory.description"), "${" + DATABASE_DIRECTORY.key + "}" + File.separator + "web", String.class, false, false);
+
protected String key;
protected String description;
protected String defaultValue;
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-12-22 15:14:42 UTC (rev 436)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2010-12-22 15:17:39 UTC (rev 437)
@@ -31,6 +31,7 @@
import java.beans.Introspector;
import java.io.BufferedOutputStream;
import java.io.File;
+import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@@ -38,6 +39,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
+import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -63,10 +65,21 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.math.util.MathUtils;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.mime.HttpMultipartMode;
+import org.apache.http.entity.mime.MultipartEntity;
+import org.apache.http.entity.mime.content.InputStreamBody;
+import org.apache.http.entity.mime.content.StringBody;
+import org.apache.http.impl.client.DefaultHttpClient;
import org.nuiton.math.matrix.DimensionHelper;
import org.nuiton.math.matrix.MatrixFactory;
import org.nuiton.math.matrix.MatrixND;
import org.nuiton.math.matrix.MatrixProvider;
+import org.nuiton.util.FileUtil;
+import org.nuiton.util.ZipUtil;
import fr.ifremer.coser.CoserBusinessConfig;
import fr.ifremer.coser.CoserBusinessException;
@@ -89,6 +102,7 @@
import fr.ifremer.coser.data.Strata;
import fr.ifremer.coser.storage.DataStorage;
import fr.ifremer.coser.util.ProgressMonitor;
+import fr.ifremer.coser.util.ProgressStream;
/**
* Service business method relative to project.
@@ -126,8 +140,10 @@
File[] projects = projectsDirectory.listFiles();
if (projects != null) {
for (File existingProject : projects) {
- String projectName = existingProject.getName();
- result.add(projectName);
+ if (existingProject.isDirectory()) {
+ String projectName = existingProject.getName();
+ result.add(projectName);
+ }
}
}
return result;
@@ -387,9 +403,26 @@
* @throws CoserBusinessException
*/
public Project openProject(String projectName) throws CoserBusinessException {
+ return openProject(projectName, null);
+ }
+ /**
+ * Open project without loading data.
+ *
+ * Just load non category data (reftax).
+ *
+ * @param projectName project name to open
+ * @param parentDirectory optionnal custom parent directory (for results)
+ * @return loaded project with data
+ * @throws CoserBusinessException
+ */
+ public Project openProject(String projectName, File parentDirectory) throws CoserBusinessException {
+
// check project existence
- File projectsDirectory = config.getProjectsDirectory();
+ File projectsDirectory = parentDirectory;
+ if (projectsDirectory == null) {
+ projectsDirectory = config.getProjectsDirectory();
+ }
File projectDirectory = new File(projectsDirectory, projectName);
if (!projectDirectory.isDirectory()) {
throw new CoserBusinessException(_("Project %s doesn't exists !", projectName));
@@ -501,10 +534,6 @@
return project;
}
- protected void readSelectionFile() {
-
- }
-
/**
* Load rsufi result in specified directory.
*
@@ -2797,4 +2826,225 @@
return contents;
}
+
+ /**
+ * Retourne tous les projets qui ont des résultats.
+ *
+ * De la forme d'une liste de de path (à la tree path) :
+ * ProjetName/SelectionName/ResultName
+ *
+ * @return results path
+ */
+ public List<String[]> findAllProjectWithResult() {
+ List<String[]> results = new ArrayList<String[]>();
+
+ // loop on projets
+ File projectsDirectory = config.getProjectsDirectory();
+ File[] projects = projectsDirectory.listFiles();
+ if (projects != null) {
+ for (File existingProject : projects) {
+ if (existingProject.isDirectory()) {
+ String projectName = existingProject.getName();
+ Project p = new Project();
+ p.setName(projectName);
+
+ // loop on selections
+ File selectionsDirectory = new File(existingProject, CoserConstants.STORAGE_SELECTION_DIRECTORY);
+ File[] selections = selectionsDirectory.listFiles();
+ if (selections != null) {
+ for (File existingSelection : selections) {
+ if (existingSelection.isDirectory()) {
+ String selectionName = existingSelection.getName();
+ Selection s = new Selection();
+ s.setName(selectionName);
+
+ // loop on result
+ File rsufisDirectory = new File(existingSelection, CoserConstants.STORAGE_RESULTS_DIRECTORY);
+ File[] rSufiResults = rsufisDirectory.listFiles();
+ if (rSufiResults != null) {
+ for (File rSufiResult : rSufiResults) {
+ if (rSufiResult.isDirectory()) {
+ String resultName = rSufiResult.getName();
+ RSufiResult r = new RSufiResult();
+ r.setName(resultName);
+
+ String[] result = new String[] {projectName, selectionName, resultName};
+ results.add(result);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return results;
+ }
+
+ /**
+ * Upload user selected result to coser web front-end using common http
+ * client.
+ *
+ * @param selectedResults selected result (collection of project/selection/rsufiresultname)
+ * @param progress progress monitor
+ * @throws CoserBusinessException
+ */
+ public void performResultUpload(Collection<String[]> selectedResults, ProgressMonitor progress) throws CoserBusinessException {
+
+ // first copy prepare directory with only necessary data
+ // ie project with only selected selections
+ // and selection with only selected results
+
+ progress.setText(_("coser.business.uploadresult.preparezip"));
+ progress.setCurrent(0);
+
+ File prepareZip = null;
+ try {
+ prepareZip = File.createTempFile("coserprepare-", ".zip");
+ prepareZip.deleteOnExit();
+
+ // copy selectively all data to target directory
+ MultipleFileFilter mFileFilters = new MultipleFileFilter();
+ for (String[] path : selectedResults) {
+ OneResultFileFilter oneRFF = new OneResultFileFilter(config, path[0], path[1], path[2]);
+ mFileFilters.add(oneRFF);
+ }
+
+ // create zip temp file
+ File projectsDirectory = config.getProjectsDirectory();
+
+ //ZipUtil.compress(prepareZip, projectsDirectory, mFileFilters);
+ // compress les projets à la racines de l'archive
+ // sans le dossier "projects"
+ Collection<File> files = FileUtil.getFilteredElements(projectsDirectory, mFileFilters, true);
+ ZipUtil.compressFiles(prepareZip, projectsDirectory, files, false);
+ } catch (IOException ex) {
+ throw new CoserBusinessException("Can't prepare upload data", ex);
+ }
+
+ progress.setText(_("coser.business.uploadresult.sendzip"));
+ progress.setTotal((int)prepareZip.length());
+
+ // then upload zip file to website
+ try {
+ HttpClient httpclient = new DefaultHttpClient();
+ MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
+
+ // password param
+ StringBody passwordBody = new StringBody(config.getWebUploadPassword(), Charset.forName("UTF-8"));
+ reqEntity.addPart("password", passwordBody);
+
+ // file param
+ ProgressStream stream = new ProgressStream(new FileInputStream(prepareZip), progress);
+ InputStreamBody fileBody = new InputStreamBody(stream, "application/zip", prepareZip.getName());
+ reqEntity.addPart("resultFile", fileBody);
+
+ HttpPost httppost = new HttpPost(config.getWebUploadURL());
+ httppost.setEntity(reqEntity);
+
+ if (log.isInfoEnabled()) {
+ log.info("Uploading " + prepareZip + " to " + httppost.getURI());
+ }
+
+ HttpResponse response = httpclient.execute(httppost);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Upload response code : " + response.getStatusLine());
+ }
+ } catch (ClientProtocolException ex) {
+ throw new CoserBusinessException("Can't upload file", ex);
+ } catch (IOException ex) {
+ throw new CoserBusinessException("Can't upload file", ex);
+ }
+ }
+
+ /**
+ * Aggrege plusieurs file filters.
+ */
+ protected static class MultipleFileFilter implements FileFilter {
+ protected Collection<FileFilter> fileFilters = new ArrayList<FileFilter>();
+
+ public void add(FileFilter f) {
+ fileFilters.add(f);
+ }
+
+ /*
+ * @see java.io.FileFilter#accept(java.io.File)
+ */
+ @Override
+ public boolean accept(File pathname) {
+
+ boolean result = false;
+ Iterator<FileFilter> it = fileFilters.iterator();
+ while (it.hasNext() && !result) {
+ result = it.next().accept(pathname);
+ }
+ return result;
+ }
+ }
+
+ /**
+ * Filter pour un resultat donné.
+ *
+ * Attention, implémentation que ne doit fonctionner que avec ZipUtil
+ * car meme si on refuse en répertoire, il redemande quand même
+ * les fils (et il faut qu'il les demande)
+ */
+ protected static class OneResultFileFilter implements FileFilter {
+ protected CoserBusinessConfig config;
+ protected String project;
+ protected String selection;
+ protected String rsufi;
+
+ public OneResultFileFilter(CoserBusinessConfig config, String project, String selection, String rsufi) {
+ this.config = config;
+ this.project = project;
+ this.selection = selection;
+ this.rsufi = rsufi;
+ }
+
+ /*
+ * @see java.io.FileFilter#accept(java.io.File)
+ */
+ @Override
+ public boolean accept(File pathname) {
+
+ boolean result = false;
+
+ try {
+ String currentPathName = pathname.getCanonicalPath() + File.separator;
+
+ File projectDirectory = new File(config.getProjectsDirectory(), project);
+ File selectionsDirectory = new File(projectDirectory, CoserConstants.STORAGE_SELECTION_DIRECTORY);
+ File selectionDirectory = new File(selectionsDirectory, selection);
+ File resultsDirectory = new File(selectionDirectory, CoserConstants.STORAGE_RESULTS_DIRECTORY);
+ File resultDirectory = new File(resultsDirectory, rsufi);
+
+ String projectPath = projectDirectory.getCanonicalPath() + File.separator;
+ String selectionsPath = selectionsDirectory.getCanonicalPath() + File.separator;
+ String selectionPath = selectionDirectory.getCanonicalPath() + File.separator;
+ String resultsPath = resultsDirectory.getCanonicalPath() + File.separator;
+ String resultPath = resultDirectory.getCanonicalPath() + File.separator;
+
+ // on prend
+ // - tout ce qu'il y a dans le projet
+ // - sauf le répertoire "selections"
+ // - ou la selection entierement
+ // - sauf le répertoire result
+ // - ou le resultat entierrement
+ result = (currentPathName.startsWith(projectPath)
+ && !currentPathName.startsWith(selectionsPath))
+ || (currentPathName.startsWith(selectionPath)
+ && !currentPathName.startsWith(resultsPath))
+ || currentPathName.startsWith(resultPath);
+
+ } catch (IOException ex) {
+ throw new RuntimeException("Can't get system canonical path");
+ }
+
+ return result;
+ }
+ }
}
Modified: trunk/coser-business/src/main/resources/i18n/coser-business_en_GB.properties
===================================================================
--- trunk/coser-business/src/main/resources/i18n/coser-business_en_GB.properties 2010-12-22 15:14:42 UTC (rev 436)
+++ trunk/coser-business/src/main/resources/i18n/coser-business_en_GB.properties 2010-12-22 15:17:39 UTC (rev 437)
@@ -90,6 +90,8 @@
coser.business.publication.stratafilename=Strata file name
coser.business.result.rsufiResultAlreadyExists=Result %s already exists \!
coser.business.selection.notValidatedControl=Not validated control \!
+coser.business.uploadresult.preparezip=Preparing zip archive\u2026
+coser.business.uploadresult.sendzip=Sending zip archive\u2026
coser.config.control.diffcatchlength.description=Percentage difference allowed between catch and length (in percent, for example 5% set 5.0)
coser.config.control.nobsmin.description=Minimal observation number
coser.config.control.typeFish.description=Fish species code type
@@ -101,6 +103,10 @@
coser.config.selection.densityFilter.description=Default density filter value
coser.config.selection.occurrenceFilter.description=Default occurrence filter value
coser.config.validator.directory.description=Validation files directory location
+coser.config.web.frontend.description=Coser server url
+coser.config.web.server.directory.description=Coser server storage directory
+coser.config.web.uploadpassword.description=Coser server upload result admin password
+coser.config.web.uploadurl.description=Coser server upload result url
depth\ attribute\ is\ not\ a\ valid\ double=
haul\ name\ is\ not\ valid=
lat\ attribute\ is\ not\ a\ valid\ double=
Modified: trunk/coser-business/src/main/resources/i18n/coser-business_fr_FR.properties
===================================================================
--- trunk/coser-business/src/main/resources/i18n/coser-business_fr_FR.properties 2010-12-22 15:14:42 UTC (rev 436)
+++ trunk/coser-business/src/main/resources/i18n/coser-business_fr_FR.properties 2010-12-22 15:17:39 UTC (rev 437)
@@ -90,6 +90,8 @@
coser.business.publication.stratafilename=Nom du fichier strates
coser.business.result.rsufiResultAlreadyExists=Le r\u00E9sultat %D existe d\u00E9j\u00E0 \!
coser.business.selection.notValidatedControl=Contr\u00F4le non valid\u00E9 \!
+coser.business.uploadresult.preparezip=Pr\u00E9paration de l'archive zip\u2026
+coser.business.uploadresult.sendzip=Envoi de l'archive zip\u2026
coser.config.control.diffcatchlength.description=Pourcentage d'\u00E9cart tol\u00E9r\u00E9 entre les captures et les tailles (en pourcent, par exemple pour 5% mettre 5.0)
coser.config.control.nobsmin.description=Nombre minimal d'observation
coser.config.control.typeFish.description=Nom du type d'esp\u00E8ces correspondant aux poissons
@@ -101,6 +103,10 @@
coser.config.selection.densityFilter.description=Filtre par d\u00E9faut sur la moyenne des densit\u00E9s
coser.config.selection.occurrenceFilter.description=Filtre par d\u00E9faut sur la moyenne des occurrences
coser.config.validator.directory.description=Emplacement des fichiers de validations
+coser.config.web.frontend.description=Adresse du serveur web coser
+coser.config.web.server.directory.description=Dossier de stockage des projets sur le serveur
+coser.config.web.uploadpassword.description=Mot de passe pour l'envoi des r\u00E9sultats
+coser.config.web.uploadurl.description=Adresse d'envoi des r\u00E9sultats
depth\ attribute\ is\ not\ a\ valid\ double=L'attribut ProfMoy n'est pas un r\u00E9el valide
haul\ name\ is\ not\ valid=L'attribut Trait n'est pas valide
lat\ attribute\ is\ not\ a\ valid\ double=L'attribut Lat n'est pas un r\u00E9el valide
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrame.jaxx
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrame.jaxx 2010-12-22 15:14:42 UTC (rev 436)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrame.jaxx 2010-12-22 15:17:39 UTC (rev 437)
@@ -36,6 +36,8 @@
<JMenuItem text="coser.ui.mainframe.menu.editProject" onActionPerformed="getHandler().showProjectEditView()" enabled="{getProject() != null}" />
<JMenuItem text="coser.ui.mainframe.menu.closeProject" onActionPerformed="getHandler().closeProject()" enabled="{getProject() != null}" />
<JSeparator/>
+ <JMenuItem text="coser.ui.mainframe.menu.uploadResult" onActionPerformed="getHandler().showUploadResultView()"/>
+ <JSeparator/>
<JMenuItem text="coser.ui.mainframe.menu.quit" onActionPerformed="getHandler().quit()"/>
</JMenu>
@@ -48,7 +50,7 @@
<JMenu id='menuOptions' text="coser.ui.mainframe.menu.options">
<JMenuItem text="coser.ui.mainframe.menu.configuration" onActionPerformed="getHandler().showCoserConfiguration()"/>
- <JMenuItem text="coser.ui.mainframe.menu.validators" onActionPerformed="getHandler().showValidatorsConfiguration()" enabled="false"/>
+ <JMenuItem text="coser.ui.mainframe.menu.validators" onActionPerformed="getHandler().showValidatorsConfiguration()" />
<JSeparator/>
<JMenuItem actionIcon="i18n-fr" text="coser.ui.mainframe.menu.locale.fr" onActionPerformed="getHandler().switchLanguage(this, Locale.FRANCE)"/>
<JMenuItem actionIcon="i18n-gb" text="coser.ui.mainframe.menu.locale.uk" onActionPerformed="getHandler().switchLanguage(this, Locale.UK)"/>
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2010-12-22 15:14:42 UTC (rev 436)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2010-12-22 15:17:39 UTC (rev 437)
@@ -33,6 +33,7 @@
import java.io.IOException;
import java.net.URI;
import java.net.URL;
+import java.util.List;
import java.util.Locale;
import javax.swing.JDialog;
@@ -40,6 +41,7 @@
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileFilter;
+import jaxx.runtime.SwingUtil;
import jaxx.runtime.swing.editor.config.ConfigUI;
import jaxx.runtime.swing.editor.config.ConfigUIHelper;
@@ -63,6 +65,9 @@
import fr.ifremer.coser.ui.project.ProjectHandler;
import fr.ifremer.coser.ui.project.ProjectOpenView;
import fr.ifremer.coser.ui.project.ProjectSummaryView;
+import fr.ifremer.coser.ui.result.ResultHandler;
+import fr.ifremer.coser.ui.result.RsufiResultRenderer;
+import fr.ifremer.coser.ui.result.SelectUploadResultView;
import fr.ifremer.coser.ui.selection.SelectionHandler;
import fr.ifremer.coser.ui.selection.SelectionView;
import fr.ifremer.coser.ui.widgets.LookAndFeelViewMenuItem;
@@ -166,6 +171,8 @@
modelBuilder.addOption(CoserBusinessConfig.CoserBusinessOption.PROJECTS_DIRECTORY);
modelBuilder.addOption(CoserBusinessConfig.CoserBusinessOption.REFERENCE_SPECIES);
modelBuilder.addOption(CoserBusinessConfig.CoserBusinessOption.REFERENCE_TYPE_ESPECES);
+ modelBuilder.addOption(CoserBusinessConfig.CoserBusinessOption.WEB_FRONT_END);
+ modelBuilder.addOption(CoserBusinessConfig.CoserBusinessOption.WEB_UPLOAD_PASSWORD);
// category control
modelBuilder.addCategory(_("coser.config.category.configuration"), _("coser.config.category.configuration.description"));
@@ -475,4 +482,19 @@
}
}
}
+
+ /**
+ * Display ui to select result to upload to website.
+ */
+ public void showUploadResultView() {
+ ProjectService projectService = view.getContextValue(ProjectService.class);
+ List<String[]> results = projectService.findAllProjectWithResult();
+
+ SelectUploadResultView selectUploadResultView = new SelectUploadResultView(view);
+ selectUploadResultView.setHandler(new ResultHandler());
+ SwingUtil.fixTableColumnWidth(selectUploadResultView.getSelectedProjectTable(), 1, 25);
+ selectUploadResultView.getSelectedProjectTable().setDefaultRenderer(String[].class, new RsufiResultRenderer());
+ selectUploadResultView.getSelectedProjectTableModel().setResultPath(results);
+ setMainComponent(selectUploadResultView);
+ }
}
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java 2010-12-22 15:14:42 UTC (rev 436)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java 2010-12-22 15:17:39 UTC (rev 437)
@@ -42,7 +42,6 @@
import java.util.Set;
import java.util.UUID;
-import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
@@ -53,7 +52,6 @@
import javax.swing.JTextField;
import javax.swing.JViewport;
import javax.swing.ListSelectionModel;
-import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
@@ -70,10 +68,6 @@
import org.apache.commons.logging.LogFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
-import org.nuiton.math.matrix.MatrixND;
-import org.nuiton.math.matrix.viewer.MatrixViewerPanel;
-import org.nuiton.math.matrix.viewer.renderer.MatrixChartRenderer;
-import org.nuiton.math.matrix.viewer.renderer.MatrixInfoTableRenderer;
import org.nuiton.widget.SwingSession;
import fr.ifremer.coser.CoserBusinessException;
@@ -385,12 +379,13 @@
long before = System.currentTimeMillis();
@Override
- public List<ControlError> doInBackground() {
+ protected List<ControlError> doInBackground() {
List<ControlError> validationErrors = validationService.validateData(project, project.getControl(), progressBar);
return validationErrors;
}
+ @Override
protected void done() {
if (log.isInfoEnabled()) {
Added: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/ResultHandler.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/ResultHandler.java (rev 0)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/ResultHandler.java 2010-12-22 15:17:39 UTC (rev 437)
@@ -0,0 +1,122 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.coser.ui.result;
+
+import static org.nuiton.i18n.I18n._;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutionException;
+
+import javax.swing.JOptionPane;
+import javax.swing.SwingWorker;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jfree.chart.JFreeChart;
+
+import fr.ifremer.coser.CoserBusinessException;
+import fr.ifremer.coser.CoserException;
+import fr.ifremer.coser.CoserConstants.ValidationLevel;
+import fr.ifremer.coser.control.ControlError;
+import fr.ifremer.coser.services.ProjectService;
+import fr.ifremer.coser.services.PublicationService;
+import fr.ifremer.coser.ui.common.CommonHandler;
+import fr.ifremer.coser.ui.util.CoserProgressBar;
+
+/**
+ * Handler for rsufi result management.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class ResultHandler extends CommonHandler {
+
+ private static final Log log = LogFactory.getLog(ResultHandler.class);
+
+ /**
+ * Perform file upload to coser server after selection by user.
+ *
+ * @param view view
+ */
+ public void performResultUpload(final SelectUploadResultView view) {
+
+ int response = JOptionPane.showConfirmDialog(view, _("coser.ui.uploadresult.confirmupload"), _("coser.ui.uploadresult.title"),
+ JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
+
+ if (response == JOptionPane.YES_OPTION) {
+
+ // get result selected by user
+ final Collection<String[]> selectedResult = view.getSelectedProjectTableModel().getSelectedResult();
+ if (CollectionUtils.isNotEmpty(selectedResult)) {
+
+ SwingWorker<Void, Void> task = new SwingWorker<Void, Void>() {
+
+ @Override
+ protected Void doInBackground() {
+
+ try {
+ // get progress bar
+ CoserProgressBar progressBar = view.getUploadProgressBar();
+ ProjectService projectService = view.getContextValue(ProjectService.class);
+ projectService.performResultUpload(selectedResult, progressBar);
+ }
+ catch (CoserBusinessException ex) {
+ throw new CoserException("Can't send results", ex);
+ }
+ return null;
+ }
+
+ @Override
+ protected void done() {
+
+ // laisser cet appel, sinon les exceptions sont silencieuse
+ try {
+ get();
+ } catch (Exception ex) {
+ throw new CoserException("Can't send results", ex);
+ }
+
+ JOptionPane.showMessageDialog(view, _("coser.ui.uploadresult.resultsuploaded"),
+ _("coser.ui.uploadresult.title"), JOptionPane.INFORMATION_MESSAGE);
+ }
+ };
+ task.execute();
+ }
+ }
+ else {
+ if (log.isDebugEnabled()) {
+ log.debug("Upload result skipped");
+ }
+ }
+ }
+}
Property changes on: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/ResultHandler.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/RsufiResultRenderer.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/RsufiResultRenderer.java (rev 0)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/RsufiResultRenderer.java 2010-12-22 15:17:39 UTC (rev 437)
@@ -0,0 +1,61 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.coser.ui.result;
+
+import java.awt.Component;
+
+import javax.swing.JTable;
+import javax.swing.table.DefaultTableCellRenderer;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * TODO add comment here.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class RsufiResultRenderer extends DefaultTableCellRenderer {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = -9030155088814184637L;
+
+ @Override
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+
+ Object localValue = value;
+ if (value instanceof String[]) {
+ String[] arrayValue = (String[])value;
+ localValue = StringUtils.join(arrayValue, '/');
+ }
+ return super.getTableCellRendererComponent(table, localValue, isSelected, hasFocus,
+ row, column);
+ }
+}
Property changes on: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/RsufiResultRenderer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/RsufiResultTreeModel.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/RsufiResultTreeModel.java (rev 0)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/RsufiResultTreeModel.java 2010-12-22 15:17:39 UTC (rev 437)
@@ -0,0 +1,154 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser 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 Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.coser.ui.result;
+
+import static org.nuiton.i18n.I18n._;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.swing.table.AbstractTableModel;
+
+/**
+ * Model represantant la liste de tous les resultats rsufi present
+ * dans le dossier de stockage de coser, tous projets confondu.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class RsufiResultTreeModel extends AbstractTableModel {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 6404018386062830677L;
+
+ protected List<String[]> resultPath;
+
+ protected Set<String[]> selectedResult;
+
+ public void setResultPath(List<String[]> resultPath) {
+ this.resultPath = resultPath;
+ selectedResult = new HashSet<String[]>();
+ fireTableDataChanged();
+ }
+
+ public Set<String[]> getSelectedResult() {
+ return selectedResult;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getRowCount()
+ */
+ @Override
+ public int getRowCount() {
+ int result = 0;
+ if (resultPath != null) {
+ result = resultPath.size();
+ }
+ return result;
+ }
+
+ @Override
+ public String getColumnName(int column) {
+ String result = null;
+ switch(column) {
+ case 0:
+ result = _("coser.ui.uploadresult.path");
+ break;
+ case 1:
+ result = _("coser.ui.uploadresult.selected");
+ break;
+ }
+ return result;
+ }
+
+ @Override
+ public Class<?> getColumnClass(int columnIndex) {
+ Class<?> result = null;
+ switch(columnIndex) {
+ case 0:
+ result = String[].class;
+ break;
+ case 1:
+ result = Boolean.class;
+ break;
+ }
+ return result;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getColumnCount()
+ */
+ @Override
+ public int getColumnCount() {
+ return 2;
+ }
+
+ /*
+ * @see javax.swing.table.TableModel#getValueAt(int, int)
+ */
+ @Override
+ public Object getValueAt(int rowIndex, int columnIndex) {
+
+ Object result = null;
+
+ String[] data = resultPath.get(rowIndex);
+ switch (columnIndex) {
+ case 0:
+ result = data;
+ break;
+ case 1:
+ // c'est pas tres safe tu les hashcode des tableaux
+ // mais bon...
+ result = selectedResult.contains(data);
+ }
+
+ return result;
+ }
+
+ @Override
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ return columnIndex == 1;
+ }
+
+ @Override
+ public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
+
+ if (aValue instanceof Boolean) {
+ String[] data = resultPath.get(rowIndex);
+ Boolean bValue = (Boolean)aValue;
+ if (bValue.booleanValue()) {
+ selectedResult.add(data);
+ }
+ else {
+ selectedResult.remove(data);
+ }
+ }
+ }
+}
Property changes on: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/RsufiResultTreeModel.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/SelectUploadResultView.jaxx
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/SelectUploadResultView.jaxx (rev 0)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/result/SelectUploadResultView.jaxx 2010-12-22 15:17:39 UTC (rev 437)
@@ -0,0 +1,52 @@
+<!--
+ #%L
+ Coser :: UI
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU 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 General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+<Table>
+ <ResultHandler id="handler" javaBean="null" />
+
+ <row>
+ <cell weightx="1" fill="horizontal">
+ <JLabel text="coser.ui.uploadresult.explanation" />
+ </cell>
+ </row>
+ <row>
+ <cell weightx="1" fill="both">
+ <JScrollPane>
+ <RsufiResultTreeModel id="selectedProjectTableModel" />
+ <JTable id="selectedProjectTable" model="{getSelectedProjectTableModel()}"/>
+ </JScrollPane>
+ </cell>
+ </row>
+ <row>
+ <cell weightx="1" anchor="east">
+ <JButton text="coser.ui.uploadresult.upload"
+ onActionPerformed="getHandler().performResultUpload(this)"/>
+ </cell>
+ </row>
+ <row>
+ <cell weightx="1" fill="horizontal">
+ <fr.ifremer.coser.ui.util.CoserProgressBar id="uploadProgressBar" stringPainted="true" />
+ </cell>
+ </row>
+</Table>
Modified: trunk/coser-ui/src/main/resources/i18n/coser-ui_en_GB.properties
===================================================================
--- trunk/coser-ui/src/main/resources/i18n/coser-ui_en_GB.properties 2010-12-22 15:14:42 UTC (rev 436)
+++ trunk/coser-ui/src/main/resources/i18n/coser-ui_en_GB.properties 2010-12-22 15:17:39 UTC (rev 437)
@@ -83,6 +83,7 @@
coser.ui.mainframe.menu.openProject=Open project
coser.ui.mainframe.menu.options=Options
coser.ui.mainframe.menu.quit=Quit
+coser.ui.mainframe.menu.uploadResult=Results publication
coser.ui.mainframe.menu.validators=Controls
coser.ui.mainframe.menu.view=View
coser.ui.mainframe.menu.view.lookandfeel=Look and feel
@@ -210,6 +211,13 @@
coser.ui.selection.tab.details=Selection details
coser.ui.selection.tab.lists=Species lists
coser.ui.selection.tab.rsufi=RSufi
+coser.ui.uploadresult.confirmupload=Are you sure you want to upload this results ?
+coser.ui.uploadresult.explanation=Welcome in results server publication interface. Only administrators with password can use this interface.
+coser.ui.uploadresult.path=Result path
+coser.ui.uploadresult.resultsuploaded=Results published.
+coser.ui.uploadresult.selected=\u2026
+coser.ui.uploadresult.title=Results publication
+coser.ui.uploadresult.upload=Send results
coser.ui.validators.cancel=Cancel
coser.ui.validators.deleteValidator=Delete
coser.ui.validators.description=Application must be restarted after validators modification.
Modified: trunk/coser-ui/src/main/resources/i18n/coser-ui_fr_FR.properties
===================================================================
--- trunk/coser-ui/src/main/resources/i18n/coser-ui_fr_FR.properties 2010-12-22 15:14:42 UTC (rev 436)
+++ trunk/coser-ui/src/main/resources/i18n/coser-ui_fr_FR.properties 2010-12-22 15:17:39 UTC (rev 437)
@@ -83,6 +83,7 @@
coser.ui.mainframe.menu.openProject=Ouvrir un projet
coser.ui.mainframe.menu.options=Options
coser.ui.mainframe.menu.quit=Quitter
+coser.ui.mainframe.menu.uploadResult=Publication des r\u00E9sultats
coser.ui.mainframe.menu.validators=Contr\u00F4les
coser.ui.mainframe.menu.view=Vue
coser.ui.mainframe.menu.view.lookandfeel=Th\u00E8me
@@ -210,6 +211,13 @@
coser.ui.selection.tab.details=D\u00E9tails de la s\u00E9lection
coser.ui.selection.tab.lists=Listes des esp\u00E8ces
coser.ui.selection.tab.rsufi=RSufi
+coser.ui.uploadresult.confirmupload=\u00CAtes vous s\u00FBr de vouloir publier ces r\u00E9sultats ?
+coser.ui.uploadresult.explanation=Bienvenue dans l'interface de s\u00E9lection des r\u00E9sultats \u00E0 envoyer sur le serveur Coser. Seul les administrateurs disposant du mot de passe peuvent effectuer cette action.
+coser.ui.uploadresult.path=Chemin du r\u00E9sultats
+coser.ui.uploadresult.resultsuploaded=R\u00E9sultats publi\u00E9s.
+coser.ui.uploadresult.selected=\u2026
+coser.ui.uploadresult.title=Publication des r\u00E9sultats
+coser.ui.uploadresult.upload=Envoyer les r\u00E9sultats
coser.ui.validators.cancel=Annuler
coser.ui.validators.deleteValidator=Supprimer
coser.ui.validators.description=L'application doit \u00EAtre red\u00E9marr\u00E9e apr\u00E8s la modification des validateurs.
1
0
r436 - trunk/coser-business/src/main/java/fr/ifremer/coser/bean
by chatellier@users.labs.libre-entreprise.org 22 Dec '10
by chatellier@users.labs.libre-entreprise.org 22 Dec '10
22 Dec '10
Author: chatellier
Date: 2010-12-22 15:14:42 +0000 (Wed, 22 Dec 2010)
New Revision: 436
Log:
Add zone field to rsufi result
Modified:
trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java 2010-12-21 15:44:00 UTC (rev 435)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java 2010-12-22 15:14:42 UTC (rev 436)
@@ -45,6 +45,8 @@
protected String rsufiVersion;
+ protected String zone;
+
/** Utilisé seulement pour la validation (sinon, non valorisé). */
protected String dataFile1Path;
@@ -75,6 +77,16 @@
getPropertyChangeSupport().firePropertyChange("name", oldValue, name);
}
+ public String getZone() {
+ return zone;
+ }
+
+ public void setZone(String zone) {
+ String oldValue = this.zone;
+ this.zone = zone;
+ getPropertyChangeSupport().firePropertyChange("zone", oldValue, zone);
+ }
+
public String getDataFile1Path() {
return dataFile1Path;
}
@@ -120,6 +132,9 @@
if (getRsufiVersion() != null) {
props.setProperty("result.rsufiversion", getRsufiVersion());
}
+ if (getZone() != null) {
+ props.setProperty("result.zone", getZone());
+ }
if (getDataFile1Name() != null) {
props.setProperty("result.datafile1name", getDataFile1Name());
}
@@ -133,6 +148,9 @@
if (props.containsKey("result.rsufiversion")) {
setRsufiVersion(props.getProperty("result.rsufiversion"));
}
+ if (props.containsKey("result.zone")) {
+ setZone(props.getProperty("result.zone"));
+ }
if (props.containsKey("result.datafile1name")) {
setDataFile1Name(props.getProperty("result.datafile1name"));
}
1
0
r435 - trunk/coser-business/src/main/java/fr/ifremer/coser/services
by chatellier@users.labs.libre-entreprise.org 21 Dec '10
by chatellier@users.labs.libre-entreprise.org 21 Dec '10
21 Dec '10
Author: chatellier
Date: 2010-12-21 15:44:00 +0000 (Tue, 21 Dec 2010)
New Revision: 435
Log:
Fix javadoc
Modified:
trunk/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java 2010-12-21 14:32:50 UTC (rev 434)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ControlService.java 2010-12-21 15:44:00 UTC (rev 435)
@@ -562,7 +562,7 @@
* @param control data container
* @param progress progress
*
- * @see PublicationService#getCompareCatchLengthGraph(Project, Control, String) for details
+ * @see PublicationService#getCompareCatchLengthGraph(Project, AbstractDataContainer, Collection) for details
* @see CoserBusinessConfig#getControlDiffCatchLength() for option
*
* @return errors
1
0
Author: chatellier
Date: 2010-12-21 14:32:50 +0000 (Tue, 21 Dec 2010)
New Revision: 434
Log:
Update struts
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-12-21 14:27:07 UTC (rev 433)
+++ trunk/pom.xml 2010-12-21 14:32:50 UTC (rev 434)
@@ -279,7 +279,7 @@
<!-- Versions -->
<jaxx.version>2.2.4-SNAPSHOT</jaxx.version>
<i18n.version>2.0</i18n.version>
- <struts.version>2.2.1</struts.version>
+ <struts.version>2.2.1.1</struts.version>
</properties>
<scm>
1
0