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
January 2011
- 1 participants
- 174 discussions
r467 - in trunk/coser-business/src: main/java/fr/ifremer/coser main/java/fr/ifremer/coser/services test/java/fr/ifremer/coser/services test/resources test/resources/web
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
05 Jan '11
Author: chatellier
Date: 2011-01-05 17:20:52 +0000 (Wed, 05 Jan 2011)
New Revision: 467
Log:
Ajout du merge des resulats lors de l'upload (suivante l'id zone/sous zone)
Added:
trunk/coser-business/src/test/java/fr/ifremer/coser/services/WebServiceTest.java
trunk/coser-business/src/test/resources/web/
trunk/coser-business/src/test/resources/web/upload1.zip
trunk/coser-business/src/test/resources/web/upload2.zip
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/java/fr/ifremer/coser/services/WebService.java
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/CoserBusinessConfig.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/CoserBusinessConfig.java 2011-01-05 15:05:00 UTC (rev 466)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/CoserBusinessConfig.java 2011-01-05 17:20:52 UTC (rev 467)
@@ -122,13 +122,23 @@
return result;
}
- public String getWebUploadPassword() {
- String result = getOption(CoserBusinessOption.WEB_UPLOAD_PASSWORD.key);
+ public File getWebServerDirectory() {
+ File result = getOptionAsFile(CoserBusinessOption.WEB_SERVER_DIRECTORY.key);
return result;
}
+
+ public File getWebProjectsDirectory() {
+ File result = getOptionAsFile(CoserBusinessOption.WEB_PROJECTS_DIRECTORY.key);
+ return result;
+ }
+
+ public File getMatchIndicatorsFile() {
+ File result = getOptionAsFile(CoserBusinessOption.WEB_MATCH_INDICATORS.key);
+ return result;
+ }
- public File getWebServerDirectory() {
- File result = getOptionAsFile(CoserBusinessOption.WEB_SERVER_DIRECTORY.key);
+ public File getMatchZonesFile() {
+ File result = getOptionAsFile(CoserBusinessOption.WEB_MATCH_ZONES.key);
return result;
}
@@ -152,10 +162,12 @@
/** 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);
+ WEB_SERVER_DIRECTORY("coser.web.server.directory", _("coser.config.web.server.directory.description"), "${" + DATABASE_DIRECTORY.key + "}" + File.separator + "web", String.class, false, false),
+ WEB_PROJECTS_DIRECTORY("coser.web.projects.directory", _("coser.config.web.projects.directory.description"), "${" + WEB_SERVER_DIRECTORY.key + "}" + File.separator + "projects", String.class, false, false),
+ WEB_MATCH_INDICATORS("coser.web.matchindicators.file", _("coser.config.web.matchindicators.file.description"), "${" + WEB_SERVER_DIRECTORY.key + "}" + File.separator + "correspondanceindicateurs.txt", String.class, false, false),
+ WEB_MATCH_ZONES("coser.web.matchzones.file", _("coser.config.web.matchzones.file.description"), "${" + WEB_SERVER_DIRECTORY.key + "}" + File.separator + "correspondancezones.txt", String.class, false, false);
protected String key;
protected String description;
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 2011-01-05 15:05:00 UTC (rev 466)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ProjectService.java 2011-01-05 17:20:52 UTC (rev 467)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2010 Codelutin, Chatellier Eric
+ * Copyright (C) 2010 - 2011 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
@@ -550,28 +550,9 @@
if (resultsDirectories != null) {
for (File resultDirectory : resultsDirectories) {
if (resultDirectory.isDirectory()) {
- RSufiResult rsufiResult = new RSufiResult();
+ RSufiResult rsufiResult = getRSufiResult(resultDirectory);
rsufiResult.setName(resultDirectory.getName());
results.add(rsufiResult);
-
- // relecture des informations du resultat (properties)
- File resultPropertiesFile = new File(resultDirectory, "result.properties");
- InputStream inputStream = null;
- try {
- Properties props = new Properties();
- inputStream = new FileInputStream(resultPropertiesFile);
- props.load(inputStream);
- rsufiResult.fromProperties(props);
-
- if (log.isDebugEnabled()) {
- log.debug("Read result properties file : " + resultPropertiesFile);
- }
- } catch (IOException ex) {
- throw new CoserBusinessException("Can't read result properties file", ex);
- }
- finally {
- IOUtils.closeQuietly(inputStream);
- }
}
}
}
@@ -580,6 +561,39 @@
}
/**
+ * Retourne un object {@code RSufiResult} initialise avec les données
+ * du resultat du répertoire demandé.
+ *
+ * @param resultDirectory result directory (base)
+ * @return initialized RSufiResult
+ * @throws CoserBusinessException
+ */
+ public RSufiResult getRSufiResult(File resultDirectory) throws CoserBusinessException {
+ RSufiResult rsufiResult = new RSufiResult();
+ rsufiResult.setName(resultDirectory.getName());
+
+ // relecture des informations du resultat (properties)
+ File resultPropertiesFile = new File(resultDirectory, "result.properties");
+ InputStream inputStream = null;
+ try {
+ Properties props = new Properties();
+ inputStream = new FileInputStream(resultPropertiesFile);
+ props.load(inputStream);
+ rsufiResult.fromProperties(props);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Read result properties file : " + resultPropertiesFile);
+ }
+ } catch (IOException ex) {
+ throw new CoserBusinessException("Can't read result properties file", ex);
+ }
+ finally {
+ IOUtils.closeQuietly(inputStream);
+ }
+ return rsufiResult;
+ }
+
+ /**
* Load control data in an initialized project.
*
* @param project project
@@ -2933,8 +2947,8 @@
MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
// password param
- StringBody passwordBody = new StringBody(config.getWebUploadPassword(), Charset.forName("UTF-8"));
- reqEntity.addPart("password", passwordBody);
+ //StringBody passwordBody = new StringBody(config.getWebUploadPassword(), Charset.forName("UTF-8"));
+ //reqEntity.addPart("password", passwordBody);
// file param
ProgressStream stream = new ProgressStream(new FileInputStream(prepareZip), progress);
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java 2011-01-05 15:05:00 UTC (rev 466)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java 2011-01-05 17:20:52 UTC (rev 467)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2010 Codelutin, Chatellier Eric
+ * Copyright (C) 2010 - 2011 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
@@ -27,8 +27,10 @@
import java.io.File;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.TreeMap;
@@ -36,6 +38,7 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.FileUtil;
import org.nuiton.util.ZipUtil;
import fr.ifremer.coser.CoserBusinessConfig;
@@ -44,11 +47,10 @@
import fr.ifremer.coser.bean.Project;
import fr.ifremer.coser.bean.RSufiResult;
import fr.ifremer.coser.bean.Selection;
-import fr.ifremer.coser.data.Catch;
import fr.ifremer.coser.storage.DataStorage;
/**
- * Service for web server.
+ * Service specifique à l'interface web de visualisation.
*
* @author chatellier
* @version $Revision$
@@ -77,27 +79,164 @@
* Traite le fichier uploade par l'application client et l'enregistre
* dans le stockage coté web.
*
+ * Le nouveau fichier uploadé est mergé avec l'ancien, c'est à dire:
+ * <ul>
+ * <li>dezipage dans un fichier temporaire
+ * <li>recuperation des noms zone/souszone-campagne des nouveau fichiers
+ * <li>suppression dans l'ancien répertoire des resultat deja present dans le nouveau (pour les conlfits)
+ * <li>suppression des selections vide
+ * <li>suppression des projets vide
+ * <li>copie (avec ecrasement) des nouveaux fichiers dans l'ancien répertoire
+ * </ul>
+ *
* @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();
+ File projectsDirectory = config.getWebProjectsDirectory();
+ // dezipage dans un fichier temporaire
+ File tempDirectory = FileUtil.createTempDirectory("coser", ".tmp");
+ ZipUtil.uncompress(archiveFile, tempDirectory);
+
+ // recuperation des noms zone/souszone-campagne des nouveau fichiers
+ List<String> newResultIds = getResultIds(tempDirectory);
+
+ // suppression dans l'ancien répertoire des resultat deja present
+ // dans le nouveau (pour les conflits)
+ cleanCurrentProjectDirectory(projectsDirectory, newResultIds);
+
+ // copie (avec ecrasement) des nouveaux fichiers dans l'ancien répertoire
+ FileUtils.copyDirectory(tempDirectory, projectsDirectory);
+ FileUtils.deleteDirectory(tempDirectory);
+
if (log.isInfoEnabled()) {
- log.info("Unzipping file " + archiveFile + " to " + newDirectory);
+ log.info("Unzipping file " + archiveFile + " to " + projectsDirectory);
}
- ZipUtil.uncompress(archiveFile, newDirectory);
+
} catch (IOException ex) {
throw new CoserBusinessException("Can't uncompress file", ex);
}
}
/**
+ * Recupere dans un repertoire donné, les resultid des resultat (zone /
+ * sous-zone-campagne)
+ *
+ * @param scanDirectory le repertoire a scanner
+ * @return la liste des resultid
+ * @throws CoserBusinessException
+ */
+ protected List<String> getResultIds(File scanDirectory) throws CoserBusinessException {
+
+ List<String> resultIds = new ArrayList<String>();
+ File[] projectFiles = scanDirectory.listFiles();
+ if (projectFiles != null) {
+ for (File projectFile : projectFiles) {
+ if (projectFile.isDirectory()) {
+
+ File selectionsDirectory = new File(projectFile, CoserConstants.STORAGE_SELECTION_DIRECTORY);
+ File[] selectionFiles = selectionsDirectory.listFiles();
+ if (selectionFiles != null) {
+ for (File selectionFile : selectionFiles) {
+ if (selectionFile.isDirectory()) {
+
+ File resultsDirectory = new File(selectionFile, CoserConstants.STORAGE_RESULTS_DIRECTORY);
+ File[] resultFiles = resultsDirectory.listFiles();
+ if (resultFiles != null) {
+ for (File resultFile : resultFiles) {
+ if (resultFile.isDirectory()) {
+ RSufiResult rsufiResult = projectService.getRSufiResult(resultFile);
+ String resultResultId = rsufiResult.getZone();
+ if (StringUtils.isNotBlank(resultResultId)) {
+ resultIds.add(resultResultId);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return resultIds;
+ }
+
+ /**
+ * Fait le menage dans le dossier courant des projets en supprimant
+ * tout les resulat qui ont un result id non present dans la liste
+ * {@code newResultIds}.
+ *
+ * Supprime egalement les selections qui n'ont plus de résultats et
+ * les projets qui n'ont plus de selection.
+ *
+ * @param projectsDirectory projectsDirectory
+ * @param newResultIds new ids
+ * @throws CoserBusinessException
+ */
+ protected void cleanCurrentProjectDirectory(File projectsDirectory, List<String> newResultIds) throws CoserBusinessException {
+
+ try {
+ File[] projectFiles = projectsDirectory.listFiles();
+ if (projectFiles != null) {
+ for (File projectFile : projectFiles) {
+ if (projectFile.isDirectory()) {
+ int projectSelectionCount = 0;
+
+ File selectionsDirectory = new File(projectFile, CoserConstants.STORAGE_SELECTION_DIRECTORY);
+ File[] selectionFiles = selectionsDirectory.listFiles();
+ if (selectionFiles != null) {
+ for (File selectionFile : selectionFiles) {
+ if (selectionFile.isDirectory()) {
+ int selectionResultCount = 0;
+
+ File resultsDirectory = new File(selectionFile, CoserConstants.STORAGE_RESULTS_DIRECTORY);
+ File[] resultFiles = resultsDirectory.listFiles();
+ if (resultFiles != null) {
+ for (File resultFile : resultFiles) {
+ if (resultFile.isDirectory()) {
+ RSufiResult rsufiResult = projectService.getRSufiResult(resultFile);
+ String resultResultId = rsufiResult.getZone();
+ if (newResultIds.contains(resultResultId)) {
+ // un nouveau resulat utilsera ce resultid
+ FileUtils.deleteDirectory(resultFile);
+ }
+ else {
+ // un resultat valid trouvé, selection non a supprimer
+ selectionResultCount++;
+ }
+ }
+ }
+ }
+
+ // si aucun resultat valide, suppression de la seletion
+ if (selectionResultCount == 0) {
+ FileUtils.deleteDirectory(selectionFile);
+ }
+ else {
+ projectSelectionCount++;
+ }
+ }
+ }
+ }
+
+ // si aucune selection avec resultat, suppression du projet
+ if (projectSelectionCount == 0) {
+ FileUtils.deleteDirectory(projectFile);
+ }
+ }
+ }
+ }
+ } catch (IOException ex) {
+ throw new CoserBusinessException("Can't delete directory", ex);
+ }
+ }
+
+ /**
* Recuperer la liste des populations pour une zone données.
*
* @param zone zone
@@ -109,13 +248,12 @@
Map<String, String> result = new TreeMap<String, String>();
// parcours des resultats disponibles
- File webDirectory = config.getWebServerDirectory();
- File newDirectory = new File(webDirectory, "tutu");
- File[] projectFiles = newDirectory.listFiles();
+ File projectsDirectory = config.getWebProjectsDirectory();
+ File[] projectFiles = projectsDirectory.listFiles();
if (projectFiles != null) {
for (File projectFile : projectFiles) {
if (projectFile.isDirectory()) {
- Project project = projectService.openProject(projectFile.getName(), newDirectory);
+ Project project = projectService.openProject(projectFile.getName(), projectsDirectory);
for (Selection selection : project.getSelections().values()) {
boolean resultFound = false;
@@ -174,9 +312,8 @@
// get this selection data
// un peu lourd mais reconstruit le path jusqu'au fichier estcomind
- File webDirectory = config.getWebServerDirectory();
- File newDirectory = new File(webDirectory, "tutu");
- File projectDirectory = new File(newDirectory, project.getName());
+ File projectsDirectory = config.getWebProjectsDirectory();
+ File projectDirectory = new File(projectsDirectory, project.getName());
File selectionsDirectory = new File(projectDirectory, CoserConstants.STORAGE_SELECTION_DIRECTORY);
File selectionDirectory = new File(selectionsDirectory, selection.getName());
File resultsDirectory = new File(selectionDirectory, CoserConstants.STORAGE_RESULTS_DIRECTORY);
@@ -214,13 +351,12 @@
Map<String, String> indicators = new TreeMap<String, String>();
// parcours des resultats disponibles
- File webDirectory = config.getWebServerDirectory();
- File newDirectory = new File(webDirectory, "tutu");
- File[] projectFiles = newDirectory.listFiles();
+ File projectsDirectory = config.getWebProjectsDirectory();
+ File[] projectFiles = projectsDirectory.listFiles();
if (projectFiles != null) {
for (File projectFile : projectFiles) {
if (projectFile.isDirectory()) {
- Project project = projectService.openProject(projectFile.getName(), newDirectory);
+ Project project = projectService.openProject(projectFile.getName(), projectsDirectory);
for (Selection selection : project.getSelections().values()) {
boolean resultFound = false;
@@ -264,9 +400,8 @@
Map<String, String> result = new HashMap<String, String>();
// on peu lours mais reconstruit le path jusqu'au fichier estcomind
- File webDirectory = config.getWebServerDirectory();
- File newDirectory = new File(webDirectory, "tutu");
- File projectDirectory = new File(newDirectory, project.getName());
+ File projectsDirectory = config.getWebProjectsDirectory();
+ File projectDirectory = new File(projectsDirectory, project.getName());
File selectionsDirectory = new File(projectDirectory, CoserConstants.STORAGE_SELECTION_DIRECTORY);
File selectionDirectory = new File(selectionsDirectory, selection.getName());
File resultsDirectory = new File(selectionDirectory, CoserConstants.STORAGE_RESULTS_DIRECTORY);
@@ -309,13 +444,12 @@
// charge du fichier EstComInd_survey.txt ou EstPopInd_survey.txt
// suivant le type de resultat demandé (communauté/population)
- File webDirectory = config.getWebServerDirectory();
- File newDirectory = new File(webDirectory, "tutu");
- File[] projectFiles = newDirectory.listFiles();
+ File projectsDirectory = config.getWebProjectsDirectory();
+ File[] projectFiles = projectsDirectory.listFiles();
if (projectFiles != null) {
for (File projectFile : projectFiles) {
if (projectFile.isDirectory()) {
- Project project = projectService.openProject(projectFile.getName(), newDirectory);
+ Project project = projectService.openProject(projectFile.getName(), projectsDirectory);
for (Selection selection : project.getSelections().values()) {
boolean resultFound = false;
Added: trunk/coser-business/src/test/java/fr/ifremer/coser/services/WebServiceTest.java
===================================================================
--- trunk/coser-business/src/test/java/fr/ifremer/coser/services/WebServiceTest.java (rev 0)
+++ trunk/coser-business/src/test/java/fr/ifremer/coser/services/WebServiceTest.java 2011-01-05 17:20:52 UTC (rev 467)
@@ -0,0 +1,88 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 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.net.URL;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import fr.ifremer.coser.CoserBusinessException;
+
+/**
+ * Test du service de l'interface web.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class WebServiceTest extends CoserTestAbstract {
+
+ protected void assertFileExists(String filepath) {
+ File file = new File(filepath.replace('/', File.separatorChar));
+ System.out.println("testing file " + file);
+ Assert.assertTrue(file.exists());
+ }
+
+ protected void assertFileNotExists(String filepath) {
+ File file = new File(filepath.replace('/', File.separatorChar));
+ System.out.println("testing file " + file);
+ Assert.assertFalse(file.exists());
+ }
+
+ /**
+ * Test que les upload successible merge bien les resultats en fonction
+ * des idenfiants des zones auquels ils sont affectés et que les resulats
+ * en conflit sont bien supprimé (avec si besoins leurs selections et projets).
+ * @throws CoserBusinessException
+ */
+ @Test
+ public void testUploadDirectoyMerge() throws CoserBusinessException {
+ WebService webService = new WebService(config);
+
+ URL firstUpload = WebServiceTest.class.getResource("/web/upload1.zip");
+ File firstUploadFile = new File(firstUpload.getFile());
+ webService.registerNewUploadedResults(firstUploadFile);
+
+ // second upload with merge
+ URL secondUpload = WebServiceTest.class.getResource("/web/upload2.zip");
+ File secondUploadFile = new File(secondUpload.getFile());
+ webService.registerNewUploadedResults(secondUploadFile);
+
+ // some tests (from first)
+ assertFileNotExists(config.getWebProjectsDirectory() + "/projet1/selections/selection11/results/result111");
+ assertFileExists(config.getWebProjectsDirectory() + "/projet1/selections/selection11/results/result112");
+ assertFileNotExists(config.getWebProjectsDirectory() + "/projet1/selections/selection12");
+ assertFileNotExists(config.getWebProjectsDirectory() + "/projet2");
+ // some tests (from second)
+ assertFileExists(config.getWebProjectsDirectory() + "/projet1/selections/selection11/results/result113");
+ assertFileExists(config.getWebProjectsDirectory() + "/projet1/selections/selection11/results/result114");
+ assertFileExists(config.getWebProjectsDirectory() + "/projet3/selections/selection31/results/result311");
+ }
+}
Property changes on: trunk/coser-business/src/test/java/fr/ifremer/coser/services/WebServiceTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/coser-business/src/test/resources/web/upload1.zip
===================================================================
(Binary files differ)
Property changes on: trunk/coser-business/src/test/resources/web/upload1.zip
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/coser-business/src/test/resources/web/upload2.zip
===================================================================
(Binary files differ)
Property changes on: trunk/coser-business/src/test/resources/web/upload2.zip
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
r466 - trunk/coser-business/src/main/java/fr/ifremer/coser/services
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
05 Jan '11
Author: chatellier
Date: 2011-01-05 15:05:00 +0000 (Wed, 05 Jan 2011)
New Revision: 466
Log:
Ajout des nom des auteurs dans les nom des especes
Modified:
trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java 2011-01-05 14:54:03 UTC (rev 465)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java 2011-01-05 15:05:00 UTC (rev 466)
@@ -165,7 +165,8 @@
// "C_Perm","NumSys","NivSys","C_VALIDE","L_VALIDE","AA_VALIDE","C_TxP\u00E8re","Taxa"
String speciesCode = tuple[3];
- String speciesName = tuple[4];
+ // nom + auteur (sans ajout de parenthese : important)
+ String speciesName = tuple[4] + " " + tuple[5];
speciesNames.put(speciesCode, speciesName);
}
1
0
r465 - in trunk/coser-business/src: main/java/fr/ifremer/coser/storage test/java/fr/ifremer/coser test/java/fr/ifremer/coser/storage
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
05 Jan '11
Author: chatellier
Date: 2011-01-05 14:54:03 +0000 (Wed, 05 Jan 2011)
New Revision: 465
Log:
Fix un petit bug sur le parsing memoire csv. Ajout d'un test.
Added:
trunk/coser-business/src/test/java/fr/ifremer/coser/storage/
trunk/coser-business/src/test/java/fr/ifremer/coser/storage/MemoryDataStorageTest.java
Modified:
trunk/coser-business/src/main/java/fr/ifremer/coser/storage/MemoryDataStorage.java
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/storage/MemoryDataStorage.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/storage/MemoryDataStorage.java 2011-01-05 14:19:47 UTC (rev 464)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/storage/MemoryDataStorage.java 2011-01-05 14:54:03 UTC (rev 465)
@@ -25,10 +25,16 @@
package fr.ifremer.coser.storage;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import au.com.bytecode.opencsv.CSVReader;
+import au.com.bytecode.opencsv.CSVWriter;
+
/**
* Stockage mémoire des String[] sous forme de String simple.
*
@@ -181,10 +187,10 @@
protected String[] stringToArray(String data) {
return parseLine(data);
}
-
+
protected static final char separator = ',';
protected static final char quotechar = '\"';
- protected static final char escapechar = '\"';
+ protected static final char escapechar = '\\';
// Copied from CSVWriter and improved
protected String writeNext(String[] nextLine) {
Added: trunk/coser-business/src/test/java/fr/ifremer/coser/storage/MemoryDataStorageTest.java
===================================================================
--- trunk/coser-business/src/test/java/fr/ifremer/coser/storage/MemoryDataStorageTest.java (rev 0)
+++ trunk/coser-business/src/test/java/fr/ifremer/coser/storage/MemoryDataStorageTest.java 2011-01-05 14:54:03 UTC (rev 465)
@@ -0,0 +1,58 @@
+/*
+ * #%L
+ *
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2011 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.storage;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import fr.ifremer.coser.services.CoserTestAbstract;
+
+/**
+ * Test for MemoryDataStorage class.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class MemoryDataStorageTest extends CoserTestAbstract {
+
+ /**
+ * Test que les format speciaux ne pose pas de problème.
+ */
+ @Test
+ public void testCSVParsing() {
+ MemoryDataStorage storage = new MemoryDataStorage();
+ storage.add(new String[]{"11", "te\"st", "test, test"});
+
+ String[] data = storage.get(0);
+ Assert.assertEquals(3, data.length);
+ Assert.assertEquals("11", data[0]);
+ Assert.assertEquals("te\"st", data[1]);
+ Assert.assertEquals("test, test", data[2]);
+ }
+}
Property changes on: trunk/coser-business/src/test/java/fr/ifremer/coser/storage/MemoryDataStorageTest.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
1
0
r464 - in trunk/coser-web/src/main: java/fr/ifremer/coser/web java/fr/ifremer/coser/web/actions java/fr/ifremer/coser/web/actions/pop resources resources/fr/ifremer/coser/web resources/ftl webapp/WEB-INF/content webapp/WEB-INF/content/pop webapp/WEB-INF/decorators
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
05 Jan '11
Author: chatellier
Date: 2011-01-05 14:19:47 +0000 (Wed, 05 Jan 2011)
New Revision: 464
Log:
Refactoring navigation pop/com
Added:
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/QualityAction.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/com/
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/GraphAction.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/IndicatorAction.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/SpeciesAction.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/ZoneAction.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/pop/
trunk/coser-web/src/main/resources/ftl/
trunk/coser-web/src/main/resources/ftl/decharge.ftl
trunk/coser-web/src/main/webapp/WEB-INF/content/pop/
trunk/coser-web/src/main/webapp/WEB-INF/content/pop/graph.jsp
trunk/coser-web/src/main/webapp/WEB-INF/content/pop/indicator.jsp
trunk/coser-web/src/main/webapp/WEB-INF/content/pop/species.jsp
trunk/coser-web/src/main/webapp/WEB-INF/content/pop/zone.jsp
trunk/coser-web/src/main/webapp/WEB-INF/content/quality.jsp
Removed:
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectIndicatorAction.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/java/fr/ifremer/coser/web/actions/ShowGraphAction.java
trunk/coser-web/src/main/webapp/WEB-INF/content/select-indicator.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/WEB-INF/content/show-graph.jsp
Modified:
trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebConfig.java
trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package.properties
trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp
trunk/coser-web/src/main/webapp/WEB-INF/content/upload-result-success.jsp
trunk/coser-web/src/main/webapp/WEB-INF/content/upload-result.jsp
trunk/coser-web/src/main/webapp/WEB-INF/decorators/footer.jsp
trunk/coser-web/src/main/webapp/WEB-INF/decorators/header.jsp
trunk/coser-web/src/main/webapp/WEB-INF/decorators/layout.jsp
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 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/CoserWebConfig.java 2011-01-05 14:19:47 UTC (rev 464)
@@ -47,6 +47,16 @@
}
/**
+ * Get administrator email.
+ *
+ * @return admin email
+ */
+ public String getAdminEmail() {
+ String result = getOption(CoserWebOption.ADMIN_EMAIL.key);
+ return result;
+ }
+
+ /**
* Get admin password.
*
* @return admin password
@@ -69,9 +79,8 @@
public enum CoserWebOption {
CONFIG_FILE(CONFIG_FILE_NAME, _("coser.config.config.file.description"), "coserweb.properties"),
-
+ ADMIN_EMAIL("coser.admin.email", _("coser.config.config.file.description"), "harmonie at ifremer.fr"),
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;
Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/QualityAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/QualityAction.java (rev 0)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/QualityAction.java 2011-01-05 14:19:47 UTC (rev 464)
@@ -0,0 +1,54 @@
+/*
+ * #%L
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2010 - 2011 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;
+
+import fr.ifremer.coser.web.CoserWebConfig;
+import fr.ifremer.coser.web.ServiceFactory;
+
+/**
+ * Quality action.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class QualityAction extends ActionSupport {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1663244944108703571L;
+
+ /**
+ * Recupere l'email dans la configuration.
+ *
+ * @return admin email
+ */
+ public String getAdminEmail() {
+ CoserWebConfig config = ServiceFactory.getCoserConfig();
+ String email = config.getAdminEmail();
+ return email;
+ }
+}
Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/QualityAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Deleted: 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 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectIndicatorAction.java 2011-01-05 14:19:47 UTC (rev 464)
@@ -1,96 +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 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 SelectIndicatorAction extends ActionSupport {
-
- /** serialVersionUID. */
- private static final long serialVersionUID = 1663244944108703571L;
-
- private static final Log log = LogFactory.getLog(SelectIndicatorAction.class);
-
- protected String zone;
-
- protected String species;
-
- protected Map<String, String> indicators;
-
- public String getZone() {
- return zone;
- }
-
- public void setZone(String zone) {
- this.zone = zone;
- }
-
- public String getSpecies() {
- return species;
- }
-
- public void setSpecies(String species) {
- this.species = species;
- }
-
- public Map<String, String> getIndicators() {
- return indicators;
- }
-
- @Override
- public String execute() {
-
- if (log.isInfoEnabled()) {
- log.info(String.format("Looking for indicator for zone %s and species %s", zone, species));
- }
-
- WebService webService = ServiceFactory.getWebService();
-
- try {
- indicators = webService.getIndicators(zone, species);
- } catch (CoserBusinessException ex) {
- throw new CoserWebException("Can't get indicators", ex);
- }
-
- return SUCCESS;
- }
-}
Deleted: 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 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectSpeciesAction.java 2011-01-05 14:19:47 UTC (rev 464)
@@ -1,90 +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 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;
- }
-}
Deleted: 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 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectZoneAction.java 2011-01-05 14:19:47 UTC (rev 464)
@@ -1,46 +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;
-
-/**
- * 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;
- }
-}
Deleted: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/ShowGraphAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/ShowGraphAction.java 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/ShowGraphAction.java 2011-01-05 14:19:47 UTC (rev 464)
@@ -1,127 +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;
-
-import fr.ifremer.coser.web.CoserWebConfig;
-import fr.ifremer.coser.web.ServiceFactory;
-
-/**
- * Affiche le graphique demandé.
- *
- * Parametre : zone, species, indicator.
- *
- * Based on eastwoood, same doc as google chart api :
- * http://code.google.com/apis/chart/docs/making_charts.html
- *
- * chart?cht=<chart_type>&chd=<chart_data>&chs=<chart_size>&...additional_parameters...
- *
- * Dans ce cas, on va faire un graphe avec des points pour les valeurs
- * et des traits (en dessous/au dessus) pour les ecarts types.
- * chd=t:
- * 12,16,16,24,26,28,41,51,66,68,13,45,81|
- * 16,14,22,34,22,31,31,48,71,64,15,38,84|
- * 8,6,4,5,2,13,9,8,7,6,1,8,8
- * chm=
- * o,0000FF,0,-1,0|
- * h,FF0000,0,0:9:,5|
- * h,FF0000,0,0:9:,5
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class ShowGraphAction extends ActionSupport {
-
- /** serialVersionUID. */
- private static final long serialVersionUID = 3385467755357775199L;
-
- protected String zone;
-
- protected String species;
-
- protected String indicator;
-
- protected String chartUrl;
-
- public String getZone() {
- return zone;
- }
-
- public void setZone(String zone) {
- this.zone = zone;
- }
-
- public String getSpecies() {
- return species;
- }
-
- public void setSpecies(String species) {
- this.species = species;
- }
-
- public String getIndicator() {
- return indicator;
- }
-
- public void setIndicator(String indicator) {
- this.indicator = indicator;
- }
-
- public String getChartUrl() {
- return chartUrl;
- }
-
-
- @Override
- public String execute() {
-
- CoserWebConfig config = ServiceFactory.getCoserConfig();
-
- chartUrl = config.getEastWoodUrl() + "/chart?";
-
- // chart type
- chartUrl += "&cht=lxy";
- // data
- chartUrl += "&chd=t:10,20,40,80,90,95,99|20,30,40,50,60,70,80";
- // legend
- chartUrl += "&chdl=Species";
- // legend position
- chartUrl += "&chdlp=b";
- // markers (plot)
- chartUrl += "&chm=o,FF0000,0,-1,5";
- // display x y axis
- chartUrl += "&chxt=x,y";
- // taille
- chartUrl += "&chs=600x300";
- // taille de la courbe
- chartUrl += "&chls=2";
- // titre du graphique
- chartUrl += "&chtt=" + zone + ";" + species + ";" + indicator;
-
- return SUCCESS;
- }
-}
Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/GraphAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/GraphAction.java (rev 0)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/GraphAction.java 2011-01-05 14:19:47 UTC (rev 464)
@@ -0,0 +1,127 @@
+/*
+ * #%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.pop;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+import fr.ifremer.coser.web.CoserWebConfig;
+import fr.ifremer.coser.web.ServiceFactory;
+
+/**
+ * Affiche le graphique demandé.
+ *
+ * Parametre : zone, species, indicator.
+ *
+ * Based on eastwoood, same doc as google chart api :
+ * http://code.google.com/apis/chart/docs/making_charts.html
+ *
+ * chart?cht=<chart_type>&chd=<chart_data>&chs=<chart_size>&...additional_parameters...
+ *
+ * Dans ce cas, on va faire un graphe avec des points pour les valeurs
+ * et des traits (en dessous/au dessus) pour les ecarts types.
+ * chd=t:
+ * 12,16,16,24,26,28,41,51,66,68,13,45,81|
+ * 16,14,22,34,22,31,31,48,71,64,15,38,84|
+ * 8,6,4,5,2,13,9,8,7,6,1,8,8
+ * chm=
+ * o,0000FF,0,-1,0|
+ * h,FF0000,0,0:9:,5|
+ * h,FF0000,0,0:9:,5
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class GraphAction extends ActionSupport {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3385467755357775199L;
+
+ protected String zone;
+
+ protected String species;
+
+ protected String indicator;
+
+ protected String chartUrl;
+
+ public String getZone() {
+ return zone;
+ }
+
+ public void setZone(String zone) {
+ this.zone = zone;
+ }
+
+ public String getSpecies() {
+ return species;
+ }
+
+ public void setSpecies(String species) {
+ this.species = species;
+ }
+
+ public String getIndicator() {
+ return indicator;
+ }
+
+ public void setIndicator(String indicator) {
+ this.indicator = indicator;
+ }
+
+ public String getChartUrl() {
+ return chartUrl;
+ }
+
+
+ @Override
+ public String execute() {
+
+ CoserWebConfig config = ServiceFactory.getCoserConfig();
+
+ chartUrl = config.getEastWoodUrl() + "/chart?";
+
+ // chart type
+ chartUrl += "&cht=lxy";
+ // data
+ chartUrl += "&chd=t:10,20,40,80,90,95,99|20,30,40,50,60,70,80";
+ // legend
+ chartUrl += "&chdl=Species";
+ // legend position
+ chartUrl += "&chdlp=b";
+ // markers (plot)
+ chartUrl += "&chm=o,FF0000,0,-1,5";
+ // display x y axis
+ chartUrl += "&chxt=x,y";
+ // taille
+ chartUrl += "&chs=600x300";
+ // taille de la courbe
+ chartUrl += "&chls=2";
+ // titre du graphique
+ chartUrl += "&chtt=" + zone + ";" + species + ";" + indicator;
+
+ return SUCCESS;
+ }
+}
Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/GraphAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/IndicatorAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/IndicatorAction.java (rev 0)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/IndicatorAction.java 2011-01-05 14:19:47 UTC (rev 464)
@@ -0,0 +1,96 @@
+/*
+ * #%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.pop;
+
+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 IndicatorAction extends ActionSupport {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1663244944108703571L;
+
+ private static final Log log = LogFactory.getLog(IndicatorAction.class);
+
+ protected String zone;
+
+ protected String species;
+
+ protected Map<String, String> indicators;
+
+ public String getZone() {
+ return zone;
+ }
+
+ public void setZone(String zone) {
+ this.zone = zone;
+ }
+
+ public String getSpecies() {
+ return species;
+ }
+
+ public void setSpecies(String species) {
+ this.species = species;
+ }
+
+ public Map<String, String> getIndicators() {
+ return indicators;
+ }
+
+ @Override
+ public String execute() {
+
+ if (log.isInfoEnabled()) {
+ log.info(String.format("Looking for indicator for zone %s and species %s", zone, species));
+ }
+
+ WebService webService = ServiceFactory.getWebService();
+
+ try {
+ indicators = webService.getIndicators(zone, species);
+ } catch (CoserBusinessException ex) {
+ throw new CoserWebException("Can't get indicators", ex);
+ }
+
+ return SUCCESS;
+ }
+}
Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/IndicatorAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/SpeciesAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/SpeciesAction.java (rev 0)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/SpeciesAction.java 2011-01-05 14:19:47 UTC (rev 464)
@@ -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.pop;
+
+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 SpeciesAction extends ActionSupport {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 1663244944108703571L;
+
+ private static final Log log = LogFactory.getLog(SpeciesAction.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 ex) {
+ throw new CoserWebException("Can't get zone species", ex);
+ }
+
+ return SUCCESS;
+ }
+}
Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/SpeciesAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/ZoneAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/ZoneAction.java (rev 0)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/ZoneAction.java 2011-01-05 14:19:47 UTC (rev 464)
@@ -0,0 +1,70 @@
+/*
+ * #%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.pop;
+
+import java.util.HashMap;
+import java.util.Map;
+
+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 ZoneAction extends ActionSupport {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 3385467755357775199L;
+
+ protected Map<String, String> zones;
+
+ public Map<String, String> getZones() {
+ return zones;
+ }
+
+ @Override
+ public String execute() {
+
+ zones = new HashMap<String, String>();
+ zones.put("manchecgfs", "Plateau - Manche CGFS");
+ zones.put("celtiqueevhoe", "Plateau - Celtique EVHOE");
+ zones.put("gascogneevhoe", "Plateau - Gascogne EVHOE");
+ zones.put("gascogneressgasc01", "Plateau - Gascogne RESSGASC_01");
+ zones.put("gascogneressgasc02", "Plateau - Gascogne RESSGASC_02");
+ zones.put("gascogneressgasc03", "Plateau - Gascogne RESSGASC_03");
+ zones.put("gascogneressgasc04", "Plateau - Gascogne RESSGASC_04");
+ zones.put("lionmedtis", "Plateau - Lion MEDITS");
+ zones.put("estcorsemedits", "Plateau - Est-Corse MEDITS");
+ zones.put("sommenoursom", "Baie - Somme NOURSOM");
+ zones.put("seinenoursei", "Baie - Seine NOURSEI");
+ zones.put("vilainenourvil", "Baie - Vilaine NOURVIL");
+ zones.put("crustaflamjuin", "Cap - Flamanville CRUSTAFLAM Juin");
+
+ return SUCCESS;
+ }
+}
Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/ZoneAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package.properties
===================================================================
--- trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package.properties 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package.properties 2011-01-05 14:19:47 UTC (rev 464)
@@ -39,3 +39,9 @@
message.index.quotemessage=Ifremer {0,date,yyyy}. Indices de populations et de communautés issus des campagnes de surveillance halieutique de l''Ifremer. {1} ({0,date,dd MMMM})
message.index.qualitytitle=Avertissement qualit\u00E9
message.index.qualitymessage=Avertissement qualit\u00E9
+message.quality.title=Avertissement qualit\u00E9
+message.quality.paragraph1=Bien que les donn\u00E9es aient \u00E9t\u00E9 pr\u00E9cautionneusement contr\u00F4l\u00E9es par l''Ifremer, des d\u00E9fauts inh\u00E9rents \u00E0 l''agr\u00E9gation des informations peuvent persister. Par exemple\u00A0:
+message.quality.paragraph2=En d\u00E9pit du fait que toutes les donn\u00E9es de toutes les s\u00E9ries de campagnes soient pr\u00E9sent\u00E9es selon le m\u00EAme format, sauf cas particuliers des diff\u00E9rences dans les strat\u00E9gies d''observation emp\u00EAchent la combinaison de donn\u00E9es de diff\u00E9rentes campagnes dans une m\u00EAme analyse. Par exemple, la capturabilit\u00E9 d\'une m\u00EAme esp\u00E8ce varie selon le type d''engin d''\u00E9chantillonnage utilis\u00E9. Il en r\u00E9sulte que chaque engin capture un sous-ensemble particulier des bioc\u00E9noses \u00E9chantillonn\u00E9es.
+message.quality.paragraph3=Une propri\u00E9t\u00E9 commune aux s\u00E9ries d''observations \u00E0 la mer est l''\u00E9volution dans le temps de la comp\u00E9tence des \u00E9quipes embarqu\u00E9es pour la d\u00E9termination des esp\u00E8ces. Il peut en r\u00E9sulter des apparitions, des disparitions ou des assignations sous un m\u00EAme nom de taxons proches dans les jeux de donn\u00E9es, non repr\u00E9sentatifs de l''\u00E9volution des populations concern\u00E9es dans l''\u00E9cosyst\u00E8me.
+message.quality.paragraph4=Pour les campagnes d\'une m\u00EAme s\u00E9rie, des changements dans les proc\u00E9dures d''\u00E9chantillonnage, dans les caract\u00E9ristiques des engins, dans la p\u00E9riode de r\u00E9alisation de la campagne et la zone couverte peuvent influencer les captures. Pour pr\u00E9venir les risques de biais dans les analyses en raison de ces facteurs, les jeux de donn\u00E9es doivent \u00EAtre pr\u00E9alablement filtr\u00E9s ad\u00E9quatement.
+message.quality.paragraph5=Il est vivement recommand\u00E9 aux utilisateurs de donn\u00E9es de les traiter avec pr\u00E9caution. Si des utilisateurs s''interrogent sur la validit\u00E9 de donn\u00E9es, ils sont invit\u00E9s \u00E0 contacter l''administrateur de la base de donn\u00E9es ({0}).
Added: trunk/coser-web/src/main/resources/ftl/decharge.ftl
===================================================================
--- trunk/coser-web/src/main/resources/ftl/decharge.ftl (rev 0)
+++ trunk/coser-web/src/main/resources/ftl/decharge.ftl 2011-01-05 14:19:47 UTC (rev 464)
@@ -0,0 +1,79 @@
+Réaction
+========
+Merci d'avoir téléchargé des données de ce site. Si vous avez identifié des
+problèmes dans ces données, ou souhaitez fournir des remarques pour aider à
+améliorer le service, vous êtes invités à adresser un courriel à
+l'administrateur du site (harmonie at ifremer.fr).
+
+Important
+=========
+Les données téléchargées sont issues de la série CGFS.
+
+Vous êtes invités à consulter les informations relatives à cette série de
+campagnes... Ce site comprend des informations spécifiques concernant l'usage de
+ces données, les limitations et les problèmes connus.
+
+Vous vous engagez à citer la source de ces données dans tout produit et
+publication utilisant ces données. En téléchargeant des données à partir du
+site http://www.ifremer.fr/SIH-indices-campagnes/, vous acceptez les termes et
+conditions d'usage décrites dans ce document et dans tout document cité dans ce
+texte.
+
+Contact
+=======
+Pour toute question concernant les données téléchargées du site
+http://www.ifremer.fr/SIH-indices-campagnes/, vous pouvez adresser un courriel à
+l'administrateur du site (harmonie at ifremer.fr).
+
+Informations particulières sur les données téléchargées
+=======================================================
+Les données des campagnes halieutiques de ce site sont mises à libre disposition
+pour téléchargement. En dépit des soins mis à la préparation de ces données, des
+défauts inhérents à l'agrégation des informations peuvent persister.
+Par exemple :
+
+* En dépit du fait que toutes les données de toutes les séries de campagnes
+ soient présentées selon le même format, sauf cas particuliers des différences
+ dans les stratégies d'observation empêchent la combinaison de données de
+ différentes campagnes dans une même analyse. Par exemple, la capturabilité
+ d'une même espèce varie selon le type d'engin d'échantillonnage utilisé.
+ Il en résulte que chaque engin capture un sous-ensemble particulier des
+ biocénoses échantillonnées.
+
+* Une propriété commune aux séries d'observations à la mer est l'évolution dans
+ le temps de la compétence des équipes embarquées pour la détermination des
+ espèces. Il peut en résulter des apparitions, des disparitions ou des
+ assignations sous un même nom de taxons proches dans les jeux de données, non
+ représentatifs de l'évolution des populations concernées dans l'écosystème.
+
+* Pour les campagnes d'une même série, des changements dans les procédures
+d'échantillonnage, dans les caractéristiques des engins, dans la période de
+réalisation de la campagne et la zone couverte peuvent influencer les captures.
+Pour prévenir les risques de biais dans les analyses en raison de ces facteurs,
+les jeux de données doivent être préalablement filtrés adéquatement.
+
+Il est vivement recommandé aux utilisateurs de données de les traiter avec
+précaution. Si des utilisateurs s'interrogent sur la validité de données, ils
+sont invités à contacter l'administrateur de la base de données
+(harmonie at ifremer.fr).
+
+Citation de l'origine des données
+=================================
+Ifremer ANNEE. Données des campagnes de surveillance halieutique de l’Ifremer.
+http://www.ifremer.fr/SIH-indices-campagnes/ (JOUR MOIS).
+
+Conditions d'usage des données
+==============================
+L'Ifremer met les données des campagnes de surveillance halieutique conduites
+par l'institut en libre accès, mais :
+- l'interprétation et l'usage approprié de ces données sont de la seule
+ responsabilité de leurs utilisateurs,
+- les utilisateurs des données ne doivent d'aucune façon impliquer l'Ifremer en
+ tant que fournisseur de données dans leurs résultats, conclusions et/ou
+ recommandations.
+- la source des données doit être dûment citée,
+- les utilisateurs de données doivent respecter toutes les restrictions
+ d'usage et de reproduction des données, incluant les restrictions pour un
+ usage commercial,
+- les utilisateurs des données doivent informer l'Ifremer de tout problème
+ soupçonné dans les données.
Modified: trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -24,7 +24,7 @@
<%@ 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">
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><s:text name="message.index.title" /></title>
</head>
@@ -41,10 +41,10 @@
<p>
<span style="font-weight:bold"><s:text name="message.index.datatypetitle" /> :</span><br />
<ul>
- <li><s:a action="select-zone"><s:text name="message.index.datatype1" /></s:a></li>
- <li><s:a action="select-zone"><s:text name="message.index.datatype2" /></s:a></li>
- <li><s:a action="select-zone"><s:text name="message.index.datatype3" /></s:a></li>
- <li><s:a action="select-zone"><s:text name="message.index.datatype4" /></s:a></li>
+ <li><s:a action="zone"><s:text name="message.index.datatype1" /></s:a></li>
+ <li><s:a action="map/zone"><s:text name="message.index.datatype2" /></s:a></li>
+ <li><s:a action="pop/zone"><s:text name="message.index.datatype3" /></s:a></li>
+ <li><s:a action="com/zone"><s:text name="message.index.datatype4" /></s:a></li>
</ul>
</p>
Added: trunk/coser-web/src/main/webapp/WEB-INF/content/pop/graph.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/pop/graph.jsp (rev 0)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/pop/graph.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -0,0 +1,37 @@
+<!--
+ #%L
+ Coser :: Web
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 - 2011 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">
+ <head>
+ <title>Coser</title>
+ </head>
+ <body>
+
+ <img src="<s:property value="chartUrl"/>" />
+
+ </body>
+</html>
\ No newline at end of file
Added: trunk/coser-web/src/main/webapp/WEB-INF/content/pop/indicator.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/pop/indicator.jsp (rev 0)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/pop/indicator.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -0,0 +1,44 @@
+<!--
+ #%L
+ Coser :: Web
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 - 2011 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">
+ <head>
+ <title>Coser</title>
+ </head>
+ <body>
+ <img src="<s:url value='/images/zonesmap.jpg' />" />
+
+ <br />
+
+ <s:form action="graph" method="get">
+ <s:select name="indicator" list="indicators" label="Select an indicator" />
+ <s:hidden name="zone" property="zone"/>
+ <s:hidden name="species" property="species"/>
+ <s:submit label="Suite"/>
+ </s:form>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/coser-web/src/main/webapp/WEB-INF/content/pop/species.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/pop/species.jsp (rev 0)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/pop/species.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -0,0 +1,44 @@
+<!--
+ #%L
+ Coser :: Web
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 - 2011 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">
+ <head>
+ <title>Coser</title>
+ </head>
+ <body>
+
+ <img src="<s:url value='/images/zonesmap.jpg' />" />
+
+ <br />
+
+ <s:form action="indicator" method="get">
+ <s:select name="species" list="species" label="Select a species" />
+ <s:hidden name="zone" property="zone"/>
+ <s:submit label="Suite"/>
+ </s:form>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/coser-web/src/main/webapp/WEB-INF/content/pop/zone.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/pop/zone.jsp (rev 0)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/pop/zone.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -0,0 +1,42 @@
+<!--
+ #%L
+ Coser :: Web
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 - 2011 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">
+ <head>
+ <title>Coser</title>
+ </head>
+ <body>
+
+ <img src="<s:url value='/images/zonesmap.jpg' />" />
+
+ <br />
+
+ <s:form action="species" method="get">
+ <s:select name="zone" list="zones" label="Select a zone" />
+ <s:submit label="Suite"/>
+ </s:form>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/coser-web/src/main/webapp/WEB-INF/content/quality.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/quality.jsp (rev 0)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/quality.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -0,0 +1,49 @@
+<!--
+ #%L
+ Coser :: Web
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2010 - 2011 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">
+ <head>
+ <title><s:text name="message.quality.title" /></title>
+ </head>
+ <body>
+
+ <div class="maintitle">
+ <s:text name="message.quality.title" />
+ </div>
+
+ <p><s:text name="message.quality.paragraph1" /></p>
+ <ul>
+ <li><s:text name="message.quality.paragraph2" /></li>
+ <li><s:text name="message.quality.paragraph3" /></li>
+ <li><s:text name="message.quality.paragraph4" /></li>
+ </ul>
+ <p>
+ <s:text name="message.quality.paragraph5">
+ <s:param value="adminEmail"/>
+ </s:text>
+ </p>
+ </body>
+</html>
\ No newline at end of file
Deleted: trunk/coser-web/src/main/webapp/WEB-INF/content/select-indicator.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/select-indicator.jsp 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/select-indicator.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -1,44 +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>
- <title>Coser</title>
- </head>
- <body>
- <img src="images/zonesmap.jpg" />
-
- <br />
-
- <s:form action="show-graph" method="get">
- <s:select name="indicator" list="indicators" label="Select an indicator" />
- <s:hidden name="zone" property="zone"/>
- <s:hidden name="species" property="species"/>
- <s:submit label="Suite"/>
- </s:form>
- </body>
-</html>
\ No newline at end of file
Deleted: trunk/coser-web/src/main/webapp/WEB-INF/content/select-species.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/select-species.jsp 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/select-species.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -1,44 +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>
- <title>Coser</title>
- </head>
- <body>
-
- <img src="images/zonesmap.jpg" />
-
- <br />
-
- <s:form action="select-indicator" method="get">
- <s:select name="species" list="species" label="Select a species" />
- <s:hidden name="zone" property="zone"/>
- <s:submit label="Suite"/>
- </s:form>
- </body>
-</html>
\ No newline at end of file
Deleted: trunk/coser-web/src/main/webapp/WEB-INF/content/select-zone.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/select-zone.jsp 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/select-zone.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -1,57 +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>
- <title>Coser</title>
- </head>
- <body>
-
- <img src="images/zonesmap.jpg" />
-
- <br />
-
- <s:form action="select-species" method="get">
- <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>
- </body>
-</html>
\ No newline at end of file
Deleted: trunk/coser-web/src/main/webapp/WEB-INF/content/show-graph.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/show-graph.jsp 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/show-graph.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -1,37 +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>
- <title>Coser</title>
- </head>
- <body>
-
- <img src="<s:property value="chartUrl"/>" />
-
- </body>
-</html>
\ No newline at end of file
Modified: trunk/coser-web/src/main/webapp/WEB-INF/content/upload-result-success.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/upload-result-success.jsp 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/upload-result-success.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ Copyright (C) 2010 - 2011 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
@@ -24,7 +24,7 @@
<%@ 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">
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hello World</title>
</head>
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 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/upload-result.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ Copyright (C) 2010 - 2011 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
@@ -24,7 +24,7 @@
<%@ 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">
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hello World</title>
</head>
Modified: trunk/coser-web/src/main/webapp/WEB-INF/decorators/footer.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/decorators/footer.jsp 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/webapp/WEB-INF/decorators/footer.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ Copyright (C) 2010 - 2011 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
Modified: trunk/coser-web/src/main/webapp/WEB-INF/decorators/header.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/decorators/header.jsp 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/webapp/WEB-INF/decorators/header.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ Copyright (C) 2010 - 2011 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
@@ -25,8 +25,8 @@
<%@taglib uri="/struts-tags" prefix="s" %>
<div>
- <img src="images/logo_ifremer.gif" style="width:333px;heigth:69px" />
- <img src="images/logo_sih.png" style="width:178px;heigth:89px" />
+ <img src="<s:url value='/images/logo_ifremer.gif' />" style="width:333px;heigth:69px" />
+ <img src="<s:url value='/images/logo_sih.png' />" style="width:178px;heigth:89px" />
<s:url id="localeEN" namespace="/" action="locale">
<s:param name="request_locale" >en</s:param>
@@ -35,8 +35,8 @@
<s:param name="request_locale" >fr</s:param>
</s:url>
- <s:a href="%{localeEN}"><img src="images/gb.png" /></s:a>
- <s:a href="%{localeFR}"><img src="images/fr.png" /></s:a>
+ <s:a href="%{localeEN}"><img src="<s:url value='/images/gb.png' />" /></s:a>
+ <s:a href="%{localeFR}"><img src="<s:url value='/images/fr.png' />" /></s:a>
</div>
Modified: trunk/coser-web/src/main/webapp/WEB-INF/decorators/layout.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2011-01-05 13:11:17 UTC (rev 463)
+++ trunk/coser-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2011-01-05 14:19:47 UTC (rev 464)
@@ -25,11 +25,11 @@
<!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" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><decorator:title default="Coser"/></title>
- <link rel="stylesheet" type="text/css" href="styles/coser.css" />
+ <link rel="stylesheet" type="text/css" href="<s:url value='/styles/coser.css' />" />
<decorator:head/>
</head>
<body>
1
0
r463 - trunk/coser-business/src/main/java/fr/ifremer/coser/storage
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
05 Jan '11
Author: chatellier
Date: 2011-01-05 13:11:17 +0000 (Wed, 05 Jan 2011)
New Revision: 463
Log:
Add doc
Modified:
trunk/coser-business/src/main/java/fr/ifremer/coser/storage/MemoryDataStorage.java
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/storage/MemoryDataStorage.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/storage/MemoryDataStorage.java 2011-01-05 13:09:13 UTC (rev 462)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/storage/MemoryDataStorage.java 2011-01-05 13:11:17 UTC (rev 463)
@@ -58,11 +58,17 @@
lineIndexStorage = new ArrayList<String>();
}
+ /**
+ * Iterator sur les donnnées.
+ *
+ * {@link #lineIndexIterator} est aussi géré, seulement pour que le
+ * remove reste cohérent.
+ */
public class StringListIterator implements Iterator<String[]> {
protected Iterator<String> listIterator;
protected Iterator<String> lineIndexIterator;
-
+
public StringListIterator(Iterator<String> internalIterator, Iterator<String> lineIndexIterator) {
this.listIterator = internalIterator;
this.lineIndexIterator = lineIndexIterator;
1
0
r462 - trunk/coser-business/src/main/java/fr/ifremer/coser/storage
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
05 Jan '11
Author: chatellier
Date: 2011-01-05 13:09:13 +0000 (Wed, 05 Jan 2011)
New Revision: 462
Log:
Add doc
Modified:
trunk/coser-business/src/main/java/fr/ifremer/coser/storage/MemoryDataStorage.java
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/storage/MemoryDataStorage.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/storage/MemoryDataStorage.java 2011-01-05 10:20:01 UTC (rev 461)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/storage/MemoryDataStorage.java 2011-01-05 13:09:13 UTC (rev 462)
@@ -5,7 +5,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2010 Codelutin, Chatellier Eric
+ * Copyright (C) 2010 - 2011 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
@@ -47,7 +47,10 @@
*/
public class MemoryDataStorage implements DataStorage {
+ /** Stockage des données. */
protected List<String> listStorage;
+
+ /** Stockage des numero de ligne (String) pour une recherche indexOf plus rapide. */
protected List<String> lineIndexStorage;
public MemoryDataStorage() {
1
0
r461 - in trunk/coser-web/src/main: java/fr/ifremer/coser/web/actions resources/fr/ifremer/coser/web webapp/WEB-INF/content webapp/WEB-INF/decorators
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
by chatellier@users.labs.libre-entreprise.org 05 Jan '11
05 Jan '11
Author: chatellier
Date: 2011-01-05 10:20:01 +0000 (Wed, 05 Jan 2011)
New Revision: 461
Log:
Update struts i18n
Added:
trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package.properties
trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_en.properties
trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties
Removed:
trunk/coser-web/src/main/resources/fr/ifremer/coser/web/actions/
Modified:
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/IndexAction.java
trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp
trunk/coser-web/src/main/webapp/WEB-INF/decorators/layout.jsp
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 2011-01-04 17:25:09 UTC (rev 460)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/IndexAction.java 2011-01-05 10:20:01 UTC (rev 461)
@@ -3,7 +3,7 @@
* $Id$
* $HeadURL$
* %%
- * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ * Copyright (C) 2010 - 2011 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
@@ -40,7 +40,7 @@
import fr.ifremer.coser.web.ServiceFactory;
/**
- * Action index, ecupere la date de derniere mise à jour.
+ * Action index, recupere la date de derniere mise à jour.
*
* @author chatellier
* @version $Revision$
Copied: trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package.properties (from rev 454, trunk/coser-web/src/main/resources/fr/ifremer/coser/web/actions/IndexAction.properties)
===================================================================
--- trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package.properties (rev 0)
+++ trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package.properties 2011-01-05 10:20:01 UTC (rev 461)
@@ -0,0 +1,41 @@
+###
+# #%L
+# Coser :: Web
+#
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2010 - 2011 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%
+###
+message.layout.title=Populations and communities indices, resulting from Ifremer monitoring halieutics survey
+message.layout.oceanicdatatitle=Gestion des donn\u00E9es des campagnes oc\u00E9anographiques
+message.layout.oceanicdata1=le Syst\u00E8me d'informations scientifiques pour la mer de l'Ifremer (SISMER)
+message.layout.oceanicdata2=le Syst\u00E8me d'information halieutique de l'Ifremer (SIH)
+message.index.title=Home
+message.index.paragraph1=Ce site a \u00E9t\u00E9 con\u00E7u pour fournir en libre acc\u00E8s des donn\u00E9es brutes et des donn\u00E9es \u00E9labor\u00E9es relatives aux campagnes scientifiques d''observation halieutique conduites par l''Ifremer le long des c\u00F4tes fran\u00E7aises.
+message.index.paragraph2=Toutes les donn\u00E9es mises \u00E0 disposition ont fait l''objet de qualification selon des protocoles sp\u00E9cifiques. La qualit\u00E9 des interpr\u00E9tations \u00E9tant directement li\u00E9e \u00E0 la nature des donn\u00E9es source, les utilisateurs de donn\u00E9es sont invit\u00E9s \u00E0 consid\u00E9rer avec attention les descriptions des protocoles mis en \u0153uvre ainsi que les niveaux de qualit\u00E9 contr\u00F4l\u00E9s.
+message.index.paragraph3=Chaque s\u00E9rie de campagnes est conduite selon une strat\u00E9gie d''\u00E9chantillonnage sp\u00E9cifique. Sauf cas particuliers, les analyses et interpr\u00E9tations doivent \u00EAtre conduites par s\u00E9rie, en prenant en compte les strat\u00E9gies d''\u00E9chantillonnage propres \u00E0 chacune de ces s\u00E9ries. Sur le site, les donn\u00E9es sont pr\u00E9sent\u00E9es par s\u00E9rie.
+message.index.paragraph4=Dans les tables de donn\u00E9es, toutes les esp\u00E8ces sont identifi\u00E9es selon le r\u00E9f\u00E9rentiel taxinomique du Syst\u00E8me d''informations halieutiques de l''Ifremer ({0}).
+message.index.datatypetitle=Quatre types de donn\u00E9es sont pr\u00E9sent\u00E9es
+message.index.datatype1=Des donn\u00E9es par op\u00E9ration d''\u00E9chantillonnage (en g\u00E9n\u00E9ral par trait de chalut)
+message.index.datatype2=Des cartes de distribution par esp\u00E8ce et par zone
+message.index.datatype3=Des indices biologiques par esp\u00E8ce et par zone
+message.index.datatype4=Des indices de communaut\u00E9 par zone.
+message.index.quotetitle=Pour citer ce site
+message.index.quotemessage=Ifremer {0,date,yyyy}. Indices de populations et de communautés issus des campagnes de surveillance halieutique de l''Ifremer. {1} ({0,date,dd MMMM})
+message.index.qualitytitle=Avertissement qualit\u00E9
+message.index.qualitymessage=Avertissement qualit\u00E9
Copied: trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_en.properties (from rev 454, trunk/coser-web/src/main/resources/fr/ifremer/coser/web/actions/IndexAction_en.properties)
===================================================================
--- trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_en.properties (rev 0)
+++ trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_en.properties 2011-01-05 10:20:01 UTC (rev 461)
@@ -0,0 +1,41 @@
+###
+# #%L
+# Coser :: Web
+#
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2010 - 2011 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%
+###
+message.layout.title=Populations and communities indices, resulting from Ifremer monitoring halieutics survey
+message.layout.oceanicdatatitle=Gestion des donn\u00E9es des campagnes oc\u00E9anographiques
+message.layout.oceanicdata1=le Syst\u00E8me d'informations scientifiques pour la mer de l'Ifremer (SISMER)
+message.layout.oceanicdata2=le Syst\u00E8me d'information halieutique de l'Ifremer (SIH)
+message.index.title=Home
+message.index.paragraph1=Ce site a \u00E9t\u00E9 con\u00E7u pour fournir en libre acc\u00E8s des donn\u00E9es brutes et des donn\u00E9es \u00E9labor\u00E9es relatives aux campagnes scientifiques d''observation halieutique conduites par l''Ifremer le long des c\u00F4tes fran\u00E7aises.
+message.index.paragraph2=Toutes les donn\u00E9es mises \u00E0 disposition ont fait l''objet de qualification selon des protocoles sp\u00E9cifiques. La qualit\u00E9 des interpr\u00E9tations \u00E9tant directement li\u00E9e \u00E0 la nature des donn\u00E9es source, les utilisateurs de donn\u00E9es sont invit\u00E9s \u00E0 consid\u00E9rer avec attention les descriptions des protocoles mis en \u0153uvre ainsi que les niveaux de qualit\u00E9 contr\u00F4l\u00E9s.
+message.index.paragraph3=Chaque s\u00E9rie de campagnes est conduite selon une strat\u00E9gie d''\u00E9chantillonnage sp\u00E9cifique. Sauf cas particuliers, les analyses et interpr\u00E9tations doivent \u00EAtre conduites par s\u00E9rie, en prenant en compte les strat\u00E9gies d''\u00E9chantillonnage propres \u00E0 chacune de ces s\u00E9ries. Sur le site, les donn\u00E9es sont pr\u00E9sent\u00E9es par s\u00E9rie.
+message.index.paragraph4=Dans les tables de donn\u00E9es, toutes les esp\u00E8ces sont identifi\u00E9es selon le r\u00E9f\u00E9rentiel taxinomique du Syst\u00E8me d''informations halieutiques de l''Ifremer ({0}).
+message.index.datatypetitle=Quatre types de donn\u00E9es sont pr\u00E9sent\u00E9es
+message.index.datatype1=Des donn\u00E9es par op\u00E9ration d''\u00E9chantillonnage (en g\u00E9n\u00E9ral par trait de chalut)
+message.index.datatype2=Des cartes de distribution par esp\u00E8ce et par zone
+message.index.datatype3=Des indices biologiques par esp\u00E8ce et par zone
+message.index.datatype4=Des indices de communaut\u00E9 par zone.
+message.index.quotetitle=Pour citer ce site
+message.index.quotemessage=Ifremer {0,date,yyyy}. Indices de populations et de communautés issus des campagnes de surveillance halieutique de l''Ifremer. {1} ({0,date,dd MMMM})
+message.index.qualitytitle=Avertissement qualit\u00E9
+message.index.qualitymessage=Avertissement qualit\u00E9
Copied: trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties (from rev 454, trunk/coser-web/src/main/resources/fr/ifremer/coser/web/actions/IndexAction_fr.properties)
===================================================================
--- trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties (rev 0)
+++ trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties 2011-01-05 10:20:01 UTC (rev 461)
@@ -0,0 +1,41 @@
+###
+# #%L
+# Coser :: Web
+#
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2010 - 2011 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%
+###
+message.layout.title=Indices de populations et de communauté issus des campagnes de surveillance halieutique de l'Ifremer
+message.layout.oceanicdatatitle=Gestion des donn\u00E9es des campagnes oc\u00E9anographiques
+message.layout.oceanicdata1=le Syst\u00E8me d'informations scientifiques pour la mer de l'Ifremer (SISMER)
+message.layout.oceanicdata2=le Syst\u00E8me d'information halieutique de l'Ifremer (SIH)
+message.index.title=Accueil
+message.index.paragraph1=Ce site a \u00E9t\u00E9 con\u00E7u pour fournir en libre acc\u00E8s des donn\u00E9es brutes et des donn\u00E9es \u00E9labor\u00E9es relatives aux campagnes scientifiques d''observation halieutique conduites par l''Ifremer le long des c\u00F4tes fran\u00E7aises.
+message.index.paragraph2=Toutes les donn\u00E9es mises \u00E0 disposition ont fait l''objet de qualification selon des protocoles sp\u00E9cifiques. La qualit\u00E9 des interpr\u00E9tations \u00E9tant directement li\u00E9e \u00E0 la nature des donn\u00E9es source, les utilisateurs de donn\u00E9es sont invit\u00E9s \u00E0 consid\u00E9rer avec attention les descriptions des protocoles mis en \u0153uvre ainsi que les niveaux de qualit\u00E9 contr\u00F4l\u00E9s.
+message.index.paragraph3=Chaque s\u00E9rie de campagnes est conduite selon une strat\u00E9gie d''\u00E9chantillonnage sp\u00E9cifique. Sauf cas particuliers, les analyses et interpr\u00E9tations doivent \u00EAtre conduites par s\u00E9rie, en prenant en compte les strat\u00E9gies d''\u00E9chantillonnage propres \u00E0 chacune de ces s\u00E9ries. Sur le site, les donn\u00E9es sont pr\u00E9sent\u00E9es par s\u00E9rie.
+message.index.paragraph4=Dans les tables de donn\u00E9es, toutes les esp\u00E8ces sont identifi\u00E9es selon le r\u00E9f\u00E9rentiel taxinomique du Syst\u00E8me d''informations halieutiques de l''Ifremer ({0}).
+message.index.datatypetitle=Quatre types de donn\u00E9es sont pr\u00E9sent\u00E9es
+message.index.datatype1=Des donn\u00E9es par op\u00E9ration d''\u00E9chantillonnage (en g\u00E9n\u00E9ral par trait de chalut)
+message.index.datatype2=Des cartes de distribution par esp\u00E8ce et par zone
+message.index.datatype3=Des indices biologiques par esp\u00E8ce et par zone
+message.index.datatype4=Des indices de communaut\u00E9 par zone.
+message.index.quotetitle=Pour citer ce site
+message.index.quotemessage=Ifremer {0,date,yyyy}. Indices de populations et de communautés issus des campagnes de surveillance halieutique de l''Ifremer. {1} ({0,date,dd MMMM})
+message.index.qualitytitle=Avertissement qualit\u00E9
+message.index.qualitymessage=Avertissement qualit\u00E9
Modified: trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp 2011-01-04 17:25:09 UTC (rev 460)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp 2011-01-05 10:20:01 UTC (rev 461)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ Copyright (C) 2010 - 2011 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
@@ -26,64 +26,44 @@
<%@taglib uri="/struts-tags" prefix="s" %>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
- <title>Coser</title>
+ <title><s:text name="message.index.title" /></title>
</head>
<body>
- <div class="maintitle"><s:text name="message.index.title" /></div>
+ <div class="maintitle">
+ <s:text name="message.index.title" />
+ </div>
- <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 style="text-align:center">
- <a href="http://www.ifremer.fr/SIH-indices-campagnes/fichiers/Web_EstPopInd_Presenta…">X</a>
- </td>
- <td />
- <td style="text-align:center">
- <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 style="text-align:center">
- <s:a action="select-zone">X</s:a>
- </td>
- <td />
- <td style="text-align:center">
- <s:a action="select-zone">X</s:a>
- </td>
- </tr>
- </table>
+ <p><s:text name="message.index.paragraph1" /></p>
+ <p><s:text name="message.index.paragraph2" /></p>
+ <p><s:text name="message.index.paragraph3" /></p>
- <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.
- <span style="white-space: nowrap;"><s:property value="contextUrl"/></span> (<s:date name="dataUpdateDate" format="dd MMMM" />).</p>
+ <p>
+ <span style="font-weight:bold"><s:text name="message.index.datatypetitle" /> :</span><br />
+ <ul>
+ <li><s:a action="select-zone"><s:text name="message.index.datatype1" /></s:a></li>
+ <li><s:a action="select-zone"><s:text name="message.index.datatype2" /></s:a></li>
+ <li><s:a action="select-zone"><s:text name="message.index.datatype3" /></s:a></li>
+ <li><s:a action="select-zone"><s:text name="message.index.datatype4" /></s:a></li>
+ </ul>
+ </p>
+
+ <p>
+ <s:text name="message.index.paragraph4">
+ <s:param><a href="http://www.ifremer.fr/sih/">www.ifremer.fr/sih/</a></s:param>
+ </s:text>
+ </p>
+
+ <p>
+ <span style="font-weight:bold"><s:text name="message.index.qualitytitle"/> :</span>
+ <s:a action="quality"><s:text name="message.index.qualitymessage" /></s:a>
+ </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>
-
+ <p>
+ <span style="font-weight:bold"><s:text name="message.index.quotetitle"/> :</span>
+ <s:text name="message.index.quotemessage">
+ <s:param value="dataUpdateDate"/>
+ <s:param value="contextUrl"/>
+ </s:text></p>
</body>
</html>
\ No newline at end of file
Modified: trunk/coser-web/src/main/webapp/WEB-INF/decorators/layout.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2011-01-04 17:25:09 UTC (rev 460)
+++ trunk/coser-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2011-01-05 10:20:01 UTC (rev 461)
@@ -5,7 +5,7 @@
$Id$
$HeadURL$
%%
- Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+ Copyright (C) 2010 - 2011 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
@@ -36,10 +36,18 @@
<%@ include file="header.jsp" %>
+ <s:text name="message.layout.title" />
+
<div class="main">
<decorator:body/>
</div>
+ <p><s:text name="message.layout.oceanicdatatitle" />
+ <ul>
+ <li><a href="http://www.ifremer.fr/sismer/index_FR.htm"><s:text name="message.layout.oceanicdata1" /></a></li>
+ <li><a href="http://www.ifremer.fr/sih"><s:text name="message.layout.oceanicdata2" /></a></li>
+ </ul></p>
+
<%@ include file="footer.jsp" %>
</body>
</html>
\ No newline at end of file
1
0
r460 - trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common
by chatellier@users.labs.libre-entreprise.org 04 Jan '11
by chatellier@users.labs.libre-entreprise.org 04 Jan '11
04 Jan '11
Author: chatellier
Date: 2011-01-04 17:25:09 +0000 (Tue, 04 Jan 2011)
New Revision: 460
Log:
Utilisation des filtres de nuiton matrix pour avoir de la coh?\195?\169rence entre le graphique et les donn?\195?\169es
Added:
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common/LengthStructureMatrixFilter.java
Removed:
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common/LengthStructureMatrixRenderer.java
Modified:
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common/DataHandler.java
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common/DataHandler.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common/DataHandler.java 2011-01-03 16:20:32 UTC (rev 459)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common/DataHandler.java 2011-01-04 17:25:09 UTC (rev 460)
@@ -32,6 +32,7 @@
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;
@@ -73,8 +74,9 @@
JFrame matrixViewerFrame = new JFrame(_("coser.ui.graph.lengthStructure"));
matrixViewerFrame.setName("lengthstructureframe");
MatrixViewerPanel panel = new MatrixViewerPanel();
- panel.addMatrixRenderer(new LengthStructureMatrixRenderer(project, container));
+ panel.addMatrixRenderer(new MatrixChartRenderer());
panel.addMatrixRenderer(new MatrixInfoTableRenderer());
+ panel.addMatrixFilter(new LengthStructureMatrixFilter(project, container));
panel.addMatrix(matrix);
matrixViewerFrame.add(panel);
matrixViewerFrame.pack();
Copied: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common/LengthStructureMatrixFilter.java (from rev 421, trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common/LengthStructureMatrixRenderer.java)
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common/LengthStructureMatrixFilter.java (rev 0)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common/LengthStructureMatrixFilter.java 2011-01-04 17:25:09 UTC (rev 460)
@@ -0,0 +1,127 @@
+/*
+ * #%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.ui.common;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jfree.util.Log;
+import org.nuiton.math.matrix.MatrixFactory;
+import org.nuiton.math.matrix.MatrixND;
+import org.nuiton.math.matrix.viewer.MatrixFilter;
+
+import fr.ifremer.coser.bean.AbstractDataContainer;
+import fr.ifremer.coser.bean.Project;
+import fr.ifremer.coser.bean.Selection;
+
+/**
+ * Filtre qui ajoute les trou dans les données (valeur intermédiares absentes)
+ * et qui supprime les bornes sans valeures ensuite.
+ *
+ * Modifie egalement le titre de la matrice.
+ *
+ * @author chatellier
+ * @version $Revision$
+ *
+ * Last update : $Date$
+ * By : $Author$
+ */
+public class LengthStructureMatrixFilter implements MatrixFilter {
+
+ protected Project project;
+
+ protected AbstractDataContainer container;
+
+ public LengthStructureMatrixFilter(Project project, AbstractDataContainer container) {
+ this.project = project;
+ this.container = container;
+ }
+
+ @Override
+ public MatrixND filter(MatrixND matrix) {
+
+ // modifie le titre de la matrice
+ String title = "Coser: " + project.getName();
+ if (container instanceof Selection) {
+ title += ": " + ((Selection)container).getName();
+ }
+ matrix.setName(title);
+
+ MatrixND filteredMatrix = matrix;
+
+ String semantic0Name = matrix.getDimensionName(0);
+ if ("coser.business.common.length".equals(semantic0Name)) {
+
+ List<?> semantic0 = matrix.getSemantic(0);
+ double first = (Double)matrix.getSemantic(0).get(0);
+ double last = (Double)matrix.getSemantic(0).get(matrix.getSemantic(0).size() - 1);
+
+ // on cherche les bornes qui ont des valeurs sup à 0.0
+ // sinon, ya du vide autour des choses demandées
+ // mais le vide entre est requis (trou de données)
+ for (Object categorySem : matrix.getSemantic(0)) {
+ for (Object serieSem : matrix.getSemantic(1)) {
+ Double value = matrix.getValue(new Object[] { categorySem, serieSem });
+ if (value > 0.0) {
+ double category = (Double)categorySem;
+ if (first > category) {
+ first = category;
+ }
+ if (last < category) {
+ last = category;
+ }
+ }
+ }
+ }
+
+ // on verifie toutes les valeurs pour savoir si c'est un
+ // pas entier ou un demi pas
+ boolean haltStep = false;
+ for (Object number : semantic0) {
+ double dNumber = (Double)number;
+ if (dNumber - Math.floor(dNumber) > 0) {
+ haltStep = true;
+ break;
+ }
+ }
+
+ List<Double> newLengthSemantic = new ArrayList<Double>();
+ for (double index = first ; index <= last ; index += (haltStep) ? 0.5 : 1) {
+ newLengthSemantic.add(index);
+ }
+
+ // nouvelle matrix remplit avec des zero
+ // avec la nouvelle semantique pour les tailles
+ List<?>[] semantics = new List<?>[matrix.getSemantics().length];
+ semantics[0] = newLengthSemantic;
+ System.arraycopy(matrix.getSemantics(), 1, semantics, 1, matrix.getSemantics().length - 1);
+ filteredMatrix = MatrixFactory.getInstance().create(matrix.getName(), semantics);
+
+ // copy des elements en fonction des semantiques
+ filteredMatrix.pasteSemantics(matrix);
+ }
+
+ return filteredMatrix;
+ }
+}
Deleted: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common/LengthStructureMatrixRenderer.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common/LengthStructureMatrixRenderer.java 2011-01-03 16:20:32 UTC (rev 459)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/common/LengthStructureMatrixRenderer.java 2011-01-04 17:25:09 UTC (rev 460)
@@ -1,144 +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 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.ui.common;
-
-import static org.nuiton.i18n.I18n._;
-
-import java.util.List;
-
-import org.jfree.chart.JFreeChart;
-import org.jfree.data.category.CategoryDataset;
-import org.jfree.data.category.DefaultCategoryDataset;
-import org.nuiton.math.matrix.MatrixND;
-import org.nuiton.math.matrix.viewer.renderer.MatrixChartRenderer;
-import org.nuiton.math.matrix.viewer.renderer.jfreechart.GraphMatrixNDDataset;
-
-import fr.ifremer.coser.bean.AbstractDataContainer;
-import fr.ifremer.coser.bean.Project;
-import fr.ifremer.coser.bean.Selection;
-
-/**
- * JFreeChart matrix panel renderer.
- *
- * Only redefine {@link #getCategoryDataset(MatrixND)} because in coser, we need to
- * generate graph with missing value.
- *
- * @author chatellier
- * @version $Revision$
- *
- * Last update : $Date$
- * By : $Author$
- */
-public class LengthStructureMatrixRenderer extends MatrixChartRenderer {
-
- protected Project project;
-
- protected AbstractDataContainer container;
-
- public LengthStructureMatrixRenderer(Project project, AbstractDataContainer container) {
- this.project = project;
- this.container = container;
- }
-
- /**
- * Pour modification du titre du graphique.
- *
- * Coser : projecttitle : selectiontitle
- */
- protected JFreeChart getJFreeChart(MatrixND matrix) {
- String title = "Coser: " + project.getName();
- if (container instanceof Selection) {
- title += ": " + ((Selection)container).getName();
- }
- JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
- getCategoryPlot(matrix), true);
- return chart;
- }
-
- @Override
- protected CategoryDataset getCategoryDataset(MatrixND matrix) {
- return getLengthStructureDataSet(matrix);
- }
-
- protected CategoryDataset getLengthStructureDataSet(MatrixND matrix) {
- CategoryDataset dataset = null;
-
- String semantic0Name = matrix.getDimensionName(0);
- if ("coser.business.common.length".equals(semantic0Name)) {
- DefaultCategoryDataset defaultDataset = new DefaultCategoryDataset();
- List<?> semantic0 = matrix.getSemantic(0);
- double first = Double.MAX_VALUE;
- double last = Double.MIN_VALUE;
-
- // on cherche les bornes qui ont des valeurs sup à 0.0
- // sinon, ya du vide autour des choses demandées
- // mais le vide entre est requis (trou de données)
- for (Object categorySem : matrix.getSemantic(0)) {
- for (Object serieSem : matrix.getSemantic(1)) {
- Double value = matrix.getValue(new Object[] { categorySem, serieSem });
- if (value > 0.0) {
- double category = (Double)categorySem;
- if (first > category) {
- first = category;
- }
- if (last < category) {
- last = category;
- }
- }
- }
- }
-
- // on verifie toutes les valeurs pour savoir si c'est un
- // pas entier ou un demi pas
- boolean haltStep = false;
- for (Object number : semantic0) {
- double dNumber = (Double)number;
- if (dNumber - Math.floor(dNumber) > 0) {
- haltStep = true;
- break;
- }
- }
-
- for (double index = first ; index <= last ; index += (haltStep) ? 0.5 : 1) {
-
- for (Object serieSem : matrix.getSemantic(1)) {
- Double value = null;
-
- // il n'y a pas de valeur dans la matrices
- // pour les pas intermédiaires ajouté
- if (semantic0.contains(index)) {
- value = matrix.getValue(new Object[] { index, serieSem });
- }
-
- defaultDataset.setValue((Number)value, (Comparable)serieSem, (Comparable)index);
- }
- }
- dataset = defaultDataset;
- }
- else {
- dataset = new GraphMatrixNDDataset(matrix);
- }
- return dataset;
- }
-}
1
0
r459 - in trunk/src/site: . resources resources/images rst rst/user
by chatellier@users.labs.libre-entreprise.org 03 Jan '11
by chatellier@users.labs.libre-entreprise.org 03 Jan '11
03 Jan '11
Author: chatellier
Date: 2011-01-03 16:20:32 +0000 (Mon, 03 Jan 2011)
New Revision: 459
Log:
Update du site (screenshots)
Added:
trunk/src/site/resources/
trunk/src/site/resources/images/
trunk/src/site/resources/images/01-noproject.png
trunk/src/site/resources/images/02-createproject.png
trunk/src/site/resources/images/03-openproject.png
trunk/src/site/resources/images/04-projectsummary.png
trunk/src/site/resources/images/10-controlmain.png
trunk/src/site/resources/images/20-selectiondetail.png
trunk/src/site/resources/images/21-selectionyears.png
trunk/src/site/resources/images/22-selectionstrata.png
trunk/src/site/resources/images/23-selectionspecies.png
trunk/src/site/resources/images/24-selectionlists.png
trunk/src/site/resources/images/25-selectionresults.png
trunk/src/site/resources/images/90-configurationpath.png
trunk/src/site/resources/images/91-configurationvalues.png
trunk/src/site/resources/images/Sans titre.xcf
trunk/src/site/rst/user/configuration.rst
trunk/src/site/rst/user/controls.rst
trunk/src/site/rst/user/faq.rst
Removed:
trunk/src/site/rst/user/validation.rst
Modified:
trunk/src/site/rst/index.rst
trunk/src/site/site_fr.xml
Added: trunk/src/site/resources/images/01-noproject.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/01-noproject.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/resources/images/02-createproject.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/02-createproject.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/resources/images/03-openproject.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/03-openproject.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/resources/images/04-projectsummary.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/04-projectsummary.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/resources/images/10-controlmain.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/10-controlmain.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/resources/images/20-selectiondetail.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/20-selectiondetail.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/resources/images/21-selectionyears.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/21-selectionyears.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/resources/images/22-selectionstrata.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/22-selectionstrata.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/resources/images/23-selectionspecies.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/23-selectionspecies.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/resources/images/24-selectionlists.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/24-selectionlists.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/resources/images/25-selectionresults.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/25-selectionresults.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/resources/images/90-configurationpath.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/90-configurationpath.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/resources/images/91-configurationvalues.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/91-configurationvalues.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/site/resources/images/Sans titre.xcf
===================================================================
(Binary files differ)
Property changes on: trunk/src/site/resources/images/Sans titre.xcf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/src/site/rst/index.rst
===================================================================
--- trunk/src/site/rst/index.rst 2011-01-03 16:19:58 UTC (rev 458)
+++ trunk/src/site/rst/index.rst 2011-01-03 16:20:32 UTC (rev 459)
@@ -5,7 +5,7 @@
.. * $Id$
.. * $HeadURL$
.. * %%
-.. * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric
+.. * Copyright (C) 2010 - 2011 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
@@ -22,8 +22,26 @@
.. * <http://www.gnu.org/licenses/lgpl-3.0.html>.
.. * #L%
.. -
-Coser
-=====
+Accueil
+=======
-Contrôle et Sélection RSufi.
+Coser (Contrôle et Sélection RSufi) est une application de contrôle de données
+(export CSV à partir d'une base de données) et de sélection de données avant
+traitement par une application externe : RSufi.
+Les résultats issus de RSufi sont ensuite enregistrés dans l'application coser
+en vue d'être sélectionné pour être publié sur le site :
+http://www.ifremer.fr/SIH-indices-campagnes/.
+
+
+Fonctionnalités
+===============
+
+ * gestion des 4 fichiers de données (captures, strates, tailles, traits).
+ * controle des erreurs sur le format des données
+ * controle en lien avec le référentiel taxonomique (reftax)
+ * historisation des modifications
+ * rapport de modification
+ * génération de graphique
+ * selection des listes d'especes pour RSUfi (L1, L2, L3, L4)
+ * enregistrement des résultats RSUfi
Added: trunk/src/site/rst/user/configuration.rst
===================================================================
--- trunk/src/site/rst/user/configuration.rst (rev 0)
+++ trunk/src/site/rst/user/configuration.rst 2011-01-03 16:20:32 UTC (rev 459)
@@ -0,0 +1,29 @@
+.. -
+.. * #%L
+.. * Coser
+.. *
+.. * $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%
+.. -
+Configuration
+=============
+
+Source : http://struts.apache.org/2.x/docs/validation.html
+
Copied: trunk/src/site/rst/user/controls.rst (from rev 207, trunk/src/site/rst/user/validation.rst)
===================================================================
--- trunk/src/site/rst/user/controls.rst (rev 0)
+++ trunk/src/site/rst/user/controls.rst 2011-01-03 16:20:32 UTC (rev 459)
@@ -0,0 +1,29 @@
+.. -
+.. * #%L
+.. * Coser
+.. *
+.. * $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%
+.. -
+Validation
+==========
+
+Source : http://struts.apache.org/2.x/docs/validation.html
+
Added: trunk/src/site/rst/user/faq.rst
===================================================================
--- trunk/src/site/rst/user/faq.rst (rev 0)
+++ trunk/src/site/rst/user/faq.rst 2011-01-03 16:20:32 UTC (rev 459)
@@ -0,0 +1,32 @@
+.. -
+.. * #%L
+.. * Coser
+.. *
+.. * $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%
+.. -
+Foire aux questions
+===================
+
+.. contents::
+
+Au lancement de l'application JavaWebStart le message "Impossible de lancer l'application" apparait
+---------------------------------------------------------------------------------------------------
+
Deleted: trunk/src/site/rst/user/validation.rst
===================================================================
--- trunk/src/site/rst/user/validation.rst 2011-01-03 16:19:58 UTC (rev 458)
+++ trunk/src/site/rst/user/validation.rst 2011-01-03 16:20:32 UTC (rev 459)
@@ -1,29 +0,0 @@
-.. -
-.. * #%L
-.. * Coser
-.. *
-.. * $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%
-.. -
-Validation
-==========
-
-Source : http://struts.apache.org/2.x/docs/validation.html
-
Modified: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml 2011-01-03 16:19:58 UTC (rev 458)
+++ trunk/src/site/site_fr.xml 2011-01-03 16:20:32 UTC (rev 459)
@@ -57,7 +57,11 @@
<item name="Accueil" href="index.html" />
<item name="Lancement" href="download.html" />
<item name="Utilisateur" href="user.html">
- <item name="Validation" href="user/validation.html" />
+ <item name="Configuration" href="user/configuration.html" />
+ <item name="Projet" href="user/guide_project.html" />
+ <item name="Control" href="user/guide_project.html" />
+ <item name="Controles" href="user/controls.html" />
+ <item name="FAQ" href="user/faq.html" />
</item>
<item name="Développeur" href="developer.html">
<item name="Coser Project layout" href="directory.html" />
1
0
r458 - in trunk: coser-business/src/main/java/fr/ifremer/coser coser-business/src/main/java/fr/ifremer/coser/services coser-web/src/main/java/fr/ifremer/coser/web/actions coser-web/src/main/webapp/WEB-INF/content
by chatellier@users.labs.libre-entreprise.org 03 Jan '11
by chatellier@users.labs.libre-entreprise.org 03 Jan '11
03 Jan '11
Author: chatellier
Date: 2011-01-03 16:19:58 +0000 (Mon, 03 Jan 2011)
New Revision: 458
Log:
Fix des indicateurs en fonction des especes
Modified:
trunk/coser-business/src/main/java/fr/ifremer/coser/CoserConstants.java
trunk/coser-business/src/main/java/fr/ifremer/coser/services/ImportService.java
trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectIndicatorAction.java
trunk/coser-web/src/main/webapp/WEB-INF/content/select-indicator.jsp
trunk/coser-web/src/main/webapp/WEB-INF/content/select-species.jsp
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/CoserConstants.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/CoserConstants.java 2011-01-03 14:14:02 UTC (rev 457)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/CoserConstants.java 2011-01-03 16:19:58 UTC (rev 458)
@@ -41,6 +41,9 @@
/** CSV Separator. */
public static final char CSV_SEPARATOR_CHAR = ';';
+ /** CSV Separator for result file (estcomind/estpopind). */
+ public static final char CSV_RESULT_SEPARATOR_CHAR = '\t';
+
/** CSV File encoding. */
public static final String CSV_FILE_ENCODING = "UTF-8";
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/ImportService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/ImportService.java 2011-01-03 14:14:02 UTC (rev 457)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/ImportService.java 2011-01-03 16:19:58 UTC (rev 458)
@@ -88,7 +88,7 @@
* @param project project
* @param category category
* @param file file to load
- * @return project
+ * @return data storage with file content
* @throws CoserBusinessException
*/
public DataStorage loadCSVFile(Project project, Category category, File file) throws CoserBusinessException {
@@ -102,7 +102,7 @@
* @param category category
* @param file file to load
* @param progress progress monitor (can be null)
- * @return project
+ * @return data storage with file content
* @throws CoserBusinessException
*/
public DataStorage loadCSVFile(Project project, Category category, File file, ProgressMonitor progress) throws CoserBusinessException {
@@ -118,7 +118,7 @@
* @param progress progress monitor (can be null)
* @param originalLoading dans le cas d'un reload, la colonne "line" est a prendre en compte
* pour les data (elle est absente dans les jeux de données originaux)
- * @return project
+ * @return data storage with file content
* @throws CoserBusinessException
*/
public DataStorage loadCSVFile(Project project, Category category, File file, ProgressMonitor progress, boolean originalLoading) throws CoserBusinessException {
@@ -327,4 +327,49 @@
return content;
}
+
+ /**
+ * Charge un fichier de résultat (estcomind/estpopind). C'est a peu pret
+ * le meme code qu'au dessus, sauf que le storage est simplement retourné
+ * et que les séparateurs ne sont pas les même.
+ *
+ * @param file file to load
+ * @return data storage with file content
+ * @throws CoserBusinessException
+ */
+ public DataStorage loadResultCSVFile(File file) throws CoserBusinessException {
+
+ DataStorage content = new MemoryDataStorage();
+
+ CSVReader csvReader = null;
+ try {
+
+ InputStream stream = new FileInputStream(file);
+ Reader reader = new BufferedReader(new InputStreamReader(stream, CoserConstants.CSV_FILE_ENCODING));
+ csvReader = new CSVReader(reader, CoserConstants.CSV_RESULT_SEPARATOR_CHAR);
+
+ // check header
+ String[] line = csvReader.readNext();
+ if (line == null || line.length <= 1) {
+ throw new CoserBusinessException(_("Can't read file '%s'. Check CSV file separator",
+ file.getAbsolutePath()));
+ }
+ else {
+ content.add(line);
+ }
+
+ while ((line = csvReader.readNext()) != null) {
+ if (line.length>1) {
+ content.add(line);
+ }
+ }
+ } catch (IOException ex) {
+ throw new CoserBusinessException("Can't read file", ex);
+ }
+ finally {
+ IOUtils.closeQuietly(csvReader);
+ }
+
+ return content;
+ }
}
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java 2011-01-03 14:14:02 UTC (rev 457)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java 2011-01-03 16:19:58 UTC (rev 458)
@@ -40,10 +40,12 @@
import fr.ifremer.coser.CoserBusinessConfig;
import fr.ifremer.coser.CoserBusinessException;
+import fr.ifremer.coser.CoserConstants;
import fr.ifremer.coser.bean.Project;
import fr.ifremer.coser.bean.RSufiResult;
import fr.ifremer.coser.bean.Selection;
import fr.ifremer.coser.data.Catch;
+import fr.ifremer.coser.storage.DataStorage;
/**
* Service for web server.
@@ -60,11 +62,14 @@
protected CoserBusinessConfig config;
+ protected ImportService importService;
+
protected ProjectService projectService;
public WebService(CoserBusinessConfig config) {
this.config = config;
+ importService = new ImportService(config);
projectService = new ProjectService(config);
}
@@ -103,6 +108,7 @@
Map<String, String> result = new TreeMap<String, String>();
+ // parcours des resultats disponibles
File webDirectory = config.getWebServerDirectory();
File newDirectory = new File(webDirectory, "tutu");
File[] projectFiles = newDirectory.listFiles();
@@ -110,13 +116,14 @@
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()) {
+
+ // extraction des especes pour le résultat demandé
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;
@@ -139,13 +146,14 @@
* Recupere la liste de toutes les especes nom sci et nom off à partir
* d'un resultat.
*
- * @param project
- * @param selection
- * @param rsufiResult
- * @return
+ * @param project project
+ * @param selection selection
+ * @param rsufiResult rsufi result
+ * @return map with each species code/species name
+ * @throws CoserBusinessException
*/
protected Map<String, String> getRsufiResultSpecies(Project project,
- Selection selection, RSufiResult rsufiResult) {
+ Selection selection, RSufiResult rsufiResult) throws CoserBusinessException {
Map<String, String> result = new HashMap<String, String>();
// load reftax in memory
@@ -163,61 +171,129 @@
}
// 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];
+
+ // un peu lourd mais reconstruit le path jusqu'au fichier estcomind
+ File webDirectory = config.getWebServerDirectory();
+ File newDirectory = new File(webDirectory, "tutu");
+ File projectDirectory = new File(newDirectory, project.getName());
+ File selectionsDirectory = new File(projectDirectory, CoserConstants.STORAGE_SELECTION_DIRECTORY);
+ File selectionDirectory = new File(selectionsDirectory, selection.getName());
+ File resultsDirectory = new File(selectionDirectory, CoserConstants.STORAGE_RESULTS_DIRECTORY);
+ File resultDirectory = new File(resultsDirectory, rsufiResult.getName());
+ File estPopIndFile = new File(resultDirectory, rsufiResult.getEstPopIndName());
+
+ // Campagne Indicateur Liste Espece Strate Annee Estimation EcartType CV
+ DataStorage dataStorage = importService.loadResultCSVFile(estPopIndFile);
+
+ Iterator<String[]> estPopIndIterator = dataStorage.iterator();
+ estPopIndIterator.next(); // skip header
+ while (estPopIndIterator.hasNext()) {
+ String[] tuple = estPopIndIterator.next();
+
+ String specyCode = tuple[3];
String specyName = speciesNames.get(specyCode);
-
+
if (StringUtils.isNotEmpty(specyName)) {
result.put(specyCode, specyName);
}
}
-
+
return result;
}
/**
- * Retourne les indicateurs calculables.
+ * Retourne les indicateurs calculés.
*
* @param zone zone
* @param species especes
* @return la liste des indicateurs
+ * @throws CoserBusinessException
*/
- public Map<String, String> getIndicators(String zone, String species) {
+ public Map<String, String> getIndicators(String zone, String species) throws CoserBusinessException {
Map<String, String> indicators = new TreeMap<String, String>();
- // populations
- indicators.put("Abundance", "Abundance");
- indicators.put("lnN", "lnN");
- //indicators.put("Dbar", "Dbar");
- indicators.put("Wbar", "Wbar");
- indicators.put("Biomass", "Biomass");
- indicators.put("Lbar", "Lbar");
- //indicators.put("propMat", "propMat");
- indicators.put("L50", "L50");
- //indicators.put("sexRatio", "sexRatio");
- //indicators.put("Zmoy", "Zmoy");
+ // parcours des resultats disponibles
+ 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);
- // communauté
- indicators.put("Delta", "Delta");
- indicators.put("Gtot", "Gtot");
- //indicators.put("Shannonmod", "Shannonmod");
- indicators.put("meanWbar", "meanWbar");
- indicators.put("NBWtot", "NBWtot");
- //indicators.put("propL", "propL");
- indicators.put("propLW", "propLW");
- indicators.put("meanQuant", "meanQuant");
- //indicators.put("biomSmall", "biomSmall");
- //indicators.put("biomBig", "biomBig");
+ for (Selection selection : project.getSelections().values()) {
+ boolean resultFound = false;
+
+ for (RSufiResult rsufiResult : selection.getRsufiResults()) {
+
+ // extraction des especes pour le résultat demandé
+ if (rsufiResult.getZone() != null && rsufiResult.getZone().equals(zone)) {
+ // data loading not necessary here
+ Map<String, String> resultIndicators = getRsufiResultIndicators(project, selection, rsufiResult, species);
+ indicators.putAll(resultIndicators);
+ resultFound = true;
+ break;
+ }
+ }
+
+ if (resultFound) {
+ break;
+ }
+ }
+ }
+ }
+ }
return indicators;
}
/**
+ * Recupere la liste de toutes les especes nom sci et nom off à partir
+ * d'un resultat.
+ *
+ * @param project
+ * @param selection
+ * @param rsufiResult
+ * @param species to get indicator
+ * @return indicator for species
+ * @throws CoserBusinessException
+ */
+ protected Map<String, String> getRsufiResultIndicators(Project project,
+ Selection selection, RSufiResult rsufiResult, String species) throws CoserBusinessException {
+ Map<String, String> result = new HashMap<String, String>();
+
+ // on peu lours mais reconstruit le path jusqu'au fichier estcomind
+ File webDirectory = config.getWebServerDirectory();
+ File newDirectory = new File(webDirectory, "tutu");
+ File projectDirectory = new File(newDirectory, project.getName());
+ File selectionsDirectory = new File(projectDirectory, CoserConstants.STORAGE_SELECTION_DIRECTORY);
+ File selectionDirectory = new File(selectionsDirectory, selection.getName());
+ File resultsDirectory = new File(selectionDirectory, CoserConstants.STORAGE_RESULTS_DIRECTORY);
+ File resultDirectory = new File(resultsDirectory, rsufiResult.getName());
+
+ // le fichier estcomind
+ File estPopIndFile = new File(resultDirectory, rsufiResult.getEstPopIndName());
+
+ // Campagne Indicateur Liste Espece Strate Annee Estimation EcartType CV
+ DataStorage dataStorage = importService.loadResultCSVFile(estPopIndFile);
+
+ Iterator<String[]> estPopIndIterator = dataStorage.iterator();
+ estPopIndIterator.next(); // skip header
+ while (estPopIndIterator.hasNext()) {
+ String[] tuple = estPopIndIterator.next();
+
+ String specyCode = tuple[3];
+ if (specyCode.equals(species)) {
+
+ String indicatorCode = tuple[1];
+ result.put(indicatorCode, indicatorCode);
+ }
+ }
+
+ return result;
+ }
+
+ /**
* Generer les données du graph et genere la liste des parametres pour
* les generateurs de graph (eastwood ou jfreechart).
*
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 2011-01-03 14:14:02 UTC (rev 457)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/SelectIndicatorAction.java 2011-01-03 16:19:58 UTC (rev 458)
@@ -24,9 +24,14 @@
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;
/**
@@ -43,6 +48,8 @@
/** serialVersionUID. */
private static final long serialVersionUID = 1663244944108703571L;
+ private static final Log log = LogFactory.getLog(SelectIndicatorAction.class);
+
protected String zone;
protected String species;
@@ -72,10 +79,18 @@
@Override
public String execute() {
+ if (log.isInfoEnabled()) {
+ log.info(String.format("Looking for indicator for zone %s and species %s", zone, species));
+ }
+
WebService webService = ServiceFactory.getWebService();
-
- indicators = webService.getIndicators(zone, species);
+ try {
+ indicators = webService.getIndicators(zone, species);
+ } catch (CoserBusinessException ex) {
+ throw new CoserWebException("Can't get indicators", ex);
+ }
+
return SUCCESS;
}
}
Modified: trunk/coser-web/src/main/webapp/WEB-INF/content/select-indicator.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/select-indicator.jsp 2011-01-03 14:14:02 UTC (rev 457)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/select-indicator.jsp 2011-01-03 16:19:58 UTC (rev 458)
@@ -36,8 +36,8 @@
<s:form action="show-graph" method="get">
<s:select name="indicator" list="indicators" label="Select an indicator" />
- <s:hidden name="zone" value="zone" />
- <s:hidden name="species" value="species" />
+ <s:hidden name="zone" property="zone"/>
+ <s:hidden name="species" property="species"/>
<s:submit label="Suite"/>
</s:form>
</body>
Modified: trunk/coser-web/src/main/webapp/WEB-INF/content/select-species.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/select-species.jsp 2011-01-03 14:14:02 UTC (rev 457)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/select-species.jsp 2011-01-03 16:19:58 UTC (rev 458)
@@ -37,7 +37,7 @@
<s:form action="select-indicator" method="get">
<s:select name="species" list="species" label="Select a species" />
- <s:hidden name="zone" value="zone" />
+ <s:hidden name="zone" property="zone"/>
<s:submit label="Suite"/>
</s:form>
</body>
1
0