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
November 2012
- 1 participants
- 17 discussions
Author: echatellier
Date: 2012-11-21 17:48:17 +0100 (Wed, 21 Nov 2012)
New Revision: 1088
Url: http://forge.codelutin.com/repositories/revision/coser/1088
Log:
Mise ?\195?\160 jour de nuiton utils
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-11-21 16:33:41 UTC (rev 1087)
+++ trunk/pom.xml 2012-11-21 16:48:17 UTC (rev 1088)
@@ -349,7 +349,7 @@
<!-- Versions -->
<jaxx.version>2.5.6</jaxx.version>
<i18n.version>2.5</i18n.version>
- <struts.version>2.3.7</struts.version>
+ <struts.version>2.3.4.1</struts.version>
</properties>
<scm>
1
0
Author: echatellier
Date: 2012-11-21 17:33:41 +0100 (Wed, 21 Nov 2012)
New Revision: 1087
Url: http://forge.codelutin.com/repositories/revision/coser/1087
Log:
Mise ?\195?\160 jour de nuiton utils
fixes #1727: mise ?\195?\160 jour de struts
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-11-16 16:22:16 UTC (rev 1086)
+++ trunk/pom.xml 2012-11-21 16:33:41 UTC (rev 1087)
@@ -117,14 +117,14 @@
<dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-utils</artifactId>
- <version>2.6.3</version>
+ <version>2.6.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.nuiton</groupId>
<artifactId>nuiton-validator</artifactId>
- <version>2.6.3</version>
+ <version>2.6.4</version>
<scope>compile</scope>
</dependency>
@@ -349,7 +349,7 @@
<!-- Versions -->
<jaxx.version>2.5.6</jaxx.version>
<i18n.version>2.5</i18n.version>
- <struts.version>2.3.4.1</struts.version>
+ <struts.version>2.3.7</struts.version>
</properties>
<scm>
1
0
r1086 - trunk/coser-web/src/main/resources/fr/ifremer/coser/web
by echatellier@users.forge.codelutin.com 16 Nov '12
by echatellier@users.forge.codelutin.com 16 Nov '12
16 Nov '12
Author: echatellier
Date: 2012-11-16 17:22:16 +0100 (Fri, 16 Nov 2012)
New Revision: 1086
Url: http://forge.codelutin.com/repositories/revision/coser/1086
Log:
faute
Modified:
trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties
Modified: trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties
===================================================================
--- trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties 2012-11-16 15:56:23 UTC (rev 1085)
+++ trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties 2012-11-16 16:22:16 UTC (rev 1086)
@@ -131,7 +131,7 @@
message.search.extract.updatelists=Mise � jour des listes
message.search.extract.waittitle=Extraction en cours...
message.search.extract.waitparagraph1=Les donn�es sont en cours d''extraction. Merci de patienter.
-message.search.extract.waitparagraph2=Cette op�ration peut prendre plusieurs minute dans le cas o� de nombreux graphiques doivent �tre g�n�r�s.
+message.search.extract.waitparagraph2=Cette op�ration peut prendre plusieurs minutes dans le cas o� de nombreux graphiques doivent �tre g�n�r�s.
message.search.extract.zonetype=Zone et type de donn�es
message.source.download=T�l�charger
message.source.paragraph1=Les donn�es de base sont pr�sent�es selon quatre tables fournissant des informations de base �lev�es � l''op�ration d''�chantillonnage (en g�n�ral un trait de chalut) et organis�es selon des unit�s g�ographiques d�finies en relation avec le plan d''�chantillonnage. Une table suppl�mentaire pr�sente le r�f�rentiel taxinomique associ� aux donn�es. Il s''agit des donn�es utilis�es pour r�aliser les calculs des indicateurs pr�sent�s. Ces donn�es ont fait l''objet de filtrages et de regroupements �ventuels par rapport aux donn�es de base de chaque s�rie, afin d''assurer la coh�rence des jeux de donn�es en vue du calcul des indicateurs. Ainsi, pour certaines s�ries, des groupes entiers (e.g. les amphihalins) ont pu �tre retir�s. Pour certaines s�ries, certaines ann�es ou certaines strates ont �t� retir�es afin de pr�server l''homog�n�it� de la s�rie. Dans des cas d''�volution du niveau de d�termination au cours de la s�rie, plusieurs taxons ont �t� regroup�s � un niveau sup�rieur.
1
0
Author: echatellier
Date: 2012-11-16 16:56:23 +0100 (Fri, 16 Nov 2012)
New Revision: 1085
Url: http://forge.codelutin.com/repositories/revision/coser/1085
Log:
Fix dependencies
Modified:
trunk/coser-ui/pom.xml
trunk/pom.xml
Modified: trunk/coser-ui/pom.xml
===================================================================
--- trunk/coser-ui/pom.xml 2012-11-16 15:25:34 UTC (rev 1084)
+++ trunk/coser-ui/pom.xml 2012-11-16 15:56:23 UTC (rev 1085)
@@ -41,6 +41,10 @@
<artifactId>nuiton-utils</artifactId>
</dependency>
<dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-validator</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.nuiton.i18n</groupId>
<artifactId>nuiton-i18n</artifactId>
</dependency>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-11-16 15:25:34 UTC (rev 1084)
+++ trunk/pom.xml 2012-11-16 15:56:23 UTC (rev 1085)
@@ -122,6 +122,13 @@
</dependency>
<dependency>
+ <groupId>org.nuiton</groupId>
+ <artifactId>nuiton-validator</artifactId>
+ <version>2.6.3</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.nuiton.matrix</groupId>
<artifactId>nuiton-matrix</artifactId>
<version>2.3.2</version>
1
0
16 Nov '12
Author: echatellier
Date: 2012-11-16 16:25:34 +0100 (Fri, 16 Nov 2012)
New Revision: 1084
Url: http://forge.codelutin.com/repositories/revision/coser/1084
Log:
fixes #1614: Extraction des indicateurs et donn?\195?\169es depuis une recherche
Added:
trunk/coser-business/src/main/java/fr/ifremer/coser/util/DataType.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/search/
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/search/ExtractAction.java
trunk/coser-web/src/main/webapp/WEB-INF/content/search/
trunk/coser-web/src/main/webapp/WEB-INF/content/search/extract-input.jsp
trunk/coser-web/src/main/webapp/WEB-INF/content/search/extract-success.jsp
trunk/coser-web/src/main/webapp/WEB-INF/content/search/extract-wait.jsp
trunk/coser-web/src/main/webapp/images/stock_select_clear.png
trunk/coser-web/src/main/webapp/images/stock_select_table.png
Modified:
trunk/coser-business/src/main/java/fr/ifremer/coser/services/CommonService.java
trunk/coser-business/src/main/java/fr/ifremer/coser/services/PublicationService.java
trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java
trunk/coser-business/src/main/resources/ftl/decharge_en.ftl
trunk/coser-business/src/main/resources/ftl/decharge_fr.ftl
trunk/coser-business/src/main/resources/i18n/coser-business_en_GB.properties
trunk/coser-business/src/main/resources/i18n/coser-business_fr_FR.properties
trunk/coser-business/src/test/java/fr/ifremer/coser/services/WebServiceTest.java
trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionHandler.java
trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/admin/DeleteProjectsAction.java
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_es.properties
trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties
trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp
trunk/coser-web/src/main/webapp/js/coser.js
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/CommonService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/CommonService.java 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/CommonService.java 2012-11-16 15:25:34 UTC (rev 1084)
@@ -300,6 +300,7 @@
* @param category category used to replace species output field if needed (can be null)
*
* @throws CoserBusinessException
+ * @deprecated since 1.4, prefer use of {@link storeDataWhithoutQuote(DataStorage, Writer, Map, Category)}
*/
public void storeDataWhithoutQuote(DataStorage content, File file, Map<String, String> refTaxSpecies, Category category) throws CoserBusinessException {
@@ -307,7 +308,29 @@
Writer writer = null;
try {
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), CoserConstants.CSV_FILE_ENCODING));
+ storeDataWhithoutQuote(content, writer, refTaxSpecies, category);
+ } catch (IOException ex) {
+ throw new CoserBusinessException("Can't save data", ex);
+ } finally {
+ IOUtils.closeQuietly(writer);
+ }
+ }
+
+ /**
+ * Store data without quoting every columns with "" (r specific demand).
+ *
+ * @param content content to save
+ * @param file file to save to
+ * @param project project used only to get species output field (can be null)
+ * @param category category used to replace species output field if needed (can be null)
+ *
+ * @throws CoserBusinessException
+ * @since 1.4
+ */
+ public void storeDataWhithoutQuote(DataStorage content, Writer writer, Map<String, String> refTaxSpecies, Category category) throws CoserBusinessException {
+ // save content
+ try {
Iterator<String[]> itContent = content.iterator();
while (itContent.hasNext()) {
String[] contentDatas = itContent.next();
@@ -341,8 +364,6 @@
}
} catch (IOException ex) {
throw new CoserBusinessException("Can't save data", ex);
- } finally {
- IOUtils.closeQuietly(writer);
}
}
Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/PublicationService.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/services/PublicationService.java 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/PublicationService.java 2012-11-16 15:25:34 UTC (rev 1084)
@@ -51,6 +51,8 @@
import java.util.TreeMap;
import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.keyvalue.MultiKey;
+import org.apache.commons.collections.map.MultiKeyMap;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
@@ -303,7 +305,7 @@
File exportHtmlFile = null;
Writer out = null;
try {
- exportHtmlFile = File.createTempFile("errors-", ".html");
+ exportHtmlFile = File.createTempFile("coser-errors-", ".html");
exportHtmlFile.deleteOnExit();
if (log.isInfoEnabled()) {
log.info("Generating HTML report to " + exportHtmlFile.getAbsolutePath());
@@ -339,8 +341,7 @@
List<ControlError> validationErrors, Writer out, boolean includeProjectInfo) throws CoserBusinessException, IOException {
List<String> speciesGraph = new ArrayList<String>();
- File imageDirectory = FileUtil.createTempDirectory("images", "pdf");
- imageDirectory.mkdirs();
+ File imageDirectory = FileUtil.createTempDirectory("coser-images-", "-tmp");
imageDirectory.deleteOnExit();
out.write("<html><head>");
@@ -581,7 +582,7 @@
File exportHtmlFile = null;
Writer out = null;
try {
- exportHtmlFile = File.createTempFile("log-", ".html");
+ exportHtmlFile = File.createTempFile("coser-log-", ".html");
exportHtmlFile.deleteOnExit();
if (log.isInfoEnabled()) {
log.info("Generating HTML report to " + exportHtmlFile.getAbsolutePath());
@@ -824,7 +825,7 @@
* @param unit data unit
* @param locale locale
* @return generated graph image (temp file)
- * @throws CoserBusinessException
+ * @throws CoserBusinessException
*/
public File getRsufiResultComChart(Project project, File resultDirectory,
RSufiResult rsufiResult, File codeTypeEspecesFile, String indicator,
@@ -836,6 +837,10 @@
// le fichier estcomind
File estComIndFile = new File(resultDirectory, rsufiResult.getEstComIndName());
+ if (log.isDebugEnabled()) {
+ log.debug("Reading estComIndFile : " + estComIndFile);
+ }
+
// Campagne Indicateur Liste Strate Annee Estimation EcartType CV
DataStorage dataStorage = commonService.loadCSVFile(estComIndFile, CoserConstants.CSV_RESULT_SEPARATOR_CHAR);
@@ -844,9 +849,14 @@
// on prend dans ce cas la premiere valeur trouvée
String localList = list;
+ if (log.isDebugEnabled()) {
+ log.debug("Searching list for indicator : " + indicator);
+ }
+
int multiplicator = 1;
int minYear = Integer.MAX_VALUE;
int maxYear = Integer.MIN_VALUE;
+ boolean indicatorFound = false;
Map<Integer, Double[]> graphData = new HashMap<Integer, Double[]>();
Iterator<String[]> estComIndIterator = dataStorage.iterator(true);
while (estComIndIterator.hasNext()) {
@@ -856,6 +866,7 @@
String indicatorList = tuple[2];
if (indicatorCode.equals(indicator)) {
+ indicatorFound = true;
// si pas de list selectionnée, on prend la premiere
if (StringUtils.isBlank(localList)) {
@@ -887,109 +898,114 @@
}
}
- // get graph title
- String chartTitle = zoneDisplayName;
- chartTitle += " - " + indicatorName;
-
- // ajout de la traduction de la liste d'indicateur
- // les liste sont a1, T1, T2 ...
- String listLetter = String.valueOf(localList.charAt(0));
- DataStorage dataStorageType = commonService.loadCSVFile(codeTypeEspecesFile, CoserConstants.CSV_SEPARATOR_CHAR);
- Iterator<String[]> typeIterator = dataStorageType.iterator(true);
- while (typeIterator.hasNext()) {
- // "Types";"Commentaire";"NumSys min";"NumSys max";"Code"
- String[] tuple = typeIterator.next();
- if (tuple[4].equals(listLetter)) {
- /// gestion du groupe "Tous"
- // cas special, c'est la seule valeur du fichier
- // code type espece qui a besoin d'une traduction
- if (tuple[4].equalsIgnoreCase("T")) {
- if ("fr".equals(locale.getLanguage())) {
- chartTitle += " - " + "Tous Liste " + localList.charAt(1);
- } else if ("es".equals(locale.getLanguage())) {
- chartTitle += " - " + "Todo Lista " + localList.charAt(1);
- } else {
- chartTitle += " - " + "All List " + localList.charAt(1);
+ // avec l'extraction des données, on peut demander a générer un graphique
+ // sur un indicateur qui n'est pas présent dans le projet courant,
+ // dans ce cas, on retourne null
+ if (indicatorFound) {
+ // get graph title
+ String chartTitle = zoneDisplayName;
+ chartTitle += " - " + indicatorName;
+
+ // ajout de la traduction de la liste d'indicateur
+ // les liste sont a1, T1, T2 ...
+ String listLetter = String.valueOf(localList.charAt(0));
+ DataStorage dataStorageType = commonService.loadCSVFile(codeTypeEspecesFile, CoserConstants.CSV_SEPARATOR_CHAR);
+ Iterator<String[]> typeIterator = dataStorageType.iterator(true);
+ while (typeIterator.hasNext()) {
+ // "Types";"Commentaire";"NumSys min";"NumSys max";"Code"
+ String[] tuple = typeIterator.next();
+ if (tuple[4].equals(listLetter)) {
+ /// gestion du groupe "Tous"
+ // cas special, c'est la seule valeur du fichier
+ // code type espece qui a besoin d'une traduction
+ if (tuple[4].equalsIgnoreCase("T")) {
+ if ("fr".equals(locale.getLanguage())) {
+ chartTitle += " - " + "Tous Liste " + localList.charAt(1);
+ } else if ("es".equals(locale.getLanguage())) {
+ chartTitle += " - " + "Todo Lista " + localList.charAt(1);
+ } else {
+ chartTitle += " - " + "All List " + localList.charAt(1);
+ }
}
+ else {
+ // ajout de la traduction du nom de liste plus le numéro
+ if ("fr".equals(locale.getLanguage())) {
+ chartTitle += " - " + tuple[0] + " Liste " + localList.charAt(1);
+ } else if ("es".equals(locale.getLanguage())) {
+ chartTitle += " - " + tuple[0] + " Lista " + localList.charAt(1);
+ } else {
+ chartTitle += " - " + tuple[0] + " List " + localList.charAt(1);
+ }
+ }
+ break;
}
+ }
+
+ // generate dataset with sorted data
+ DefaultStatisticalCategoryDataset statisticalDataset = new DefaultStatisticalCategoryDataset();
+ for (int indexYear = minYear ; indexYear <= maxYear ; ++indexYear) {
+ Double[] entry = graphData.get(indexYear);
+ if (entry != null) {
+ Double estimation = entry[0] / multiplicator;
+ Double ecart = entry[1] / multiplicator;
+ statisticalDataset.add(estimation, ecart, "Serie1", (Comparable)indexYear);
+ }
else {
- // ajout de la traduction du nom de liste plus le numéro
- if ("fr".equals(locale.getLanguage())) {
- chartTitle += " - " + tuple[0] + " Liste " + localList.charAt(1);
- } else if ("es".equals(locale.getLanguage())) {
- chartTitle += " - " + tuple[0] + " Lista " + localList.charAt(1);
- } else {
- chartTitle += " - " + tuple[0] + " List " + localList.charAt(1);
- }
+ statisticalDataset.add(null, null, "Serie1", (Comparable)indexYear);
}
- break;
}
- }
-
- // generate dataset with sorted data
- DefaultStatisticalCategoryDataset statisticalDataset = new DefaultStatisticalCategoryDataset();
- for (int indexYear = minYear ; indexYear <= maxYear ; ++indexYear) {
- Double[] entry = graphData.get(indexYear);
- if (entry != null) {
- Double estimation = entry[0] / multiplicator;
- Double ecart = entry[1] / multiplicator;
- statisticalDataset.add(estimation, ecart, "Serie1", (Comparable)indexYear);
+
+ // configure chart
+ //CategoryAxis categoryAxis = new CategoryAxis(_("coser.business.common.year"));
+ // FIXME echatellier 20110414 hack just for year, need a real locale object here
+ // to call _(locale, i18nkey)
+ String yearAxis = "Year";
+ if ("fr".equals(locale.getLanguage())) {
+ yearAxis = "Ann\u00E9e";
+ } else if ("es".equals(locale.getLanguage())) {
+ yearAxis = "A\u00F1o";
}
- else {
- statisticalDataset.add(null, null, "Serie1", (Comparable)indexYear);
+ CategoryAxis categoryAxis = new CategoryAxis(yearAxis);
+ categoryAxis.setCategoryMargin(0);
+ categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
+ // label horizontaux
+ String legendY = indicatorName;
+ if (multiplicator != 1) {
+ // affiche par exemple : cm * 1000
+ legendY += " (" + unit + "*" + multiplicator + ")";
}
+ else if (StringUtils.isNotEmpty(unit)) {
+ legendY += " (" + unit + ")";
+ }
+ ValueAxis valueAxis = new NumberAxis(legendY);
+ valueAxis.setUpperMargin(0.1);
+
+ CategoryItemRenderer renderer = new StatisticalLineAndShapeRenderer(false, true);
+
+ // n'affiche pas les nombre sur le graphique
+ //StandardCategoryItemLabelGenerator itemLabelGenerator = new StandardCategoryItemLabelGenerator();
+ //renderer.setBaseItemLabelGenerator(itemLabelGenerator);
+ //renderer.setBaseItemLabelsVisible(true);
+
+ CategoryPlot plot = new CategoryPlot(statisticalDataset, categoryAxis, valueAxis, renderer);
+ plot.setOrientation(PlotOrientation.VERTICAL);
+ JFreeChart chart = new JFreeChart(chartTitle,
+ JFreeChart.DEFAULT_TITLE_FONT, plot, true);
+
+ // remove series legend
+ chart.removeLegend();
+ // white background
+ chart.setBackgroundPaint(Color.WHITE);
+
+ try {
+ result = File.createTempFile("coser-chart-", ".png");
+ result.deleteOnExit();
+ ChartUtilities.saveChartAsPNG(result, chart, 800, 400);
+ } catch (IOException ex) {
+ throw new CoserBusinessException("Can't save chart", ex);
+ }
}
- // configure chart
- //CategoryAxis categoryAxis = new CategoryAxis(_("coser.business.common.year"));
- // FIXME echatellier 20110414 hack just for year, need a real locale object here
- // to call _(locale, i18nkey)
- String yearAxis = "Year";
- if ("fr".equals(locale.getLanguage())) {
- yearAxis = "Ann\u00E9e";
- } else if ("es".equals(locale.getLanguage())) {
- yearAxis = "A\u00F1o";
- }
- CategoryAxis categoryAxis = new CategoryAxis(yearAxis);
- categoryAxis.setCategoryMargin(0);
- categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
- // label horizontaux
- String legendY = indicatorName;
- if (multiplicator != 1) {
- // affiche par exemple : cm * 1000
- legendY += " (" + unit + "*" + multiplicator + ")";
- }
- else if (StringUtils.isNotEmpty(unit)) {
- legendY += " (" + unit + ")";
- }
- ValueAxis valueAxis = new NumberAxis(legendY);
- valueAxis.setUpperMargin(0.1);
-
- CategoryItemRenderer renderer = new StatisticalLineAndShapeRenderer(false, true);
-
- // n'affiche pas les nombre sur le graphique
- //StandardCategoryItemLabelGenerator itemLabelGenerator = new StandardCategoryItemLabelGenerator();
- //renderer.setBaseItemLabelGenerator(itemLabelGenerator);
- //renderer.setBaseItemLabelsVisible(true);
-
- CategoryPlot plot = new CategoryPlot(statisticalDataset, categoryAxis, valueAxis, renderer);
- plot.setOrientation(PlotOrientation.VERTICAL);
- JFreeChart chart = new JFreeChart(chartTitle,
- JFreeChart.DEFAULT_TITLE_FONT, plot, true);
-
- // remove series legend
- chart.removeLegend();
- // white background
- chart.setBackgroundPaint(Color.WHITE);
-
- try {
- result = File.createTempFile("coser-", ".chart");
- result.deleteOnExit();
- ChartUtilities.saveChartAsPNG(result, chart, 800, 400);
- } catch (IOException ex) {
- throw new CoserBusinessException("Can't save chart", ex);
- }
-
return result;
}
@@ -1023,6 +1039,7 @@
int multiplicator = 1;
int minYear = Integer.MAX_VALUE;
int maxYear = Integer.MIN_VALUE;
+ boolean indicatorFound = false;
Map<Integer, Double[]> graphData = new HashMap<Integer, Double[]>();
Iterator<String[]> estPopIndIterator = dataStorage.iterator(true);
while (estPopIndIterator.hasNext()) {
@@ -1031,7 +1048,8 @@
String speciesCode = tuple[3];
String indicatorCode = tuple[1];
if (speciesCode.equals(species) && indicatorCode.equals(indicator)) {
-
+ indicatorFound = true;
+
// XXX echatellier, maybe take care of list here ?
Double estimation = Double.parseDouble(tuple[6]);
@@ -1057,76 +1075,474 @@
}
}
- // get graph title
- String title = zoneDisplayName;
- title += " - " + indicatorName;
- title += " - " + commonService.getReportDisplayName(project, species);
-
- // generate dataset with sorted data
- DefaultStatisticalCategoryDataset statisticalDataset = new DefaultStatisticalCategoryDataset();
- for (int indexYear = minYear ; indexYear <= maxYear ; ++indexYear) {
- Double[] entry = graphData.get(indexYear);
- if (entry != null) {
- Double estimation = entry[0] / multiplicator;
- Double ecart = entry[1] / multiplicator;
- statisticalDataset.add(estimation, ecart, "Serie1", (Comparable)indexYear);
+ // avec l'extraction des données, on peut demander a générer un graphique
+ // sur un indicateur qui n'est pas présent dans le projet courant,
+ // dans ce cas, on retourne null
+ if (indicatorFound) {
+ // get graph title
+ String title = zoneDisplayName;
+ title += " - " + indicatorName;
+ title += " - " + commonService.getReportDisplayName(project, species);
+
+ // generate dataset with sorted data
+ DefaultStatisticalCategoryDataset statisticalDataset = new DefaultStatisticalCategoryDataset();
+ for (int indexYear = minYear ; indexYear <= maxYear ; ++indexYear) {
+ Double[] entry = graphData.get(indexYear);
+ if (entry != null) {
+ Double estimation = entry[0] / multiplicator;
+ Double ecart = entry[1] / multiplicator;
+ statisticalDataset.add(estimation, ecart, "Serie1", (Comparable)indexYear);
+ }
+ else {
+ statisticalDataset.add(null, null, "Serie1", (Comparable)indexYear);
+ }
}
- else {
- statisticalDataset.add(null, null, "Serie1", (Comparable)indexYear);
+
+
+ // configure chart
+ //CategoryAxis categoryAxis = new CategoryAxis(_("coser.business.common.year"));
+ // FIXME echatellier 20110414 hack just for year, need a real locale object here
+ // to call _(locale, i18nkey)
+ String yearAxis = "Year";
+ if ("fr".equals(locale.getLanguage())) {
+ yearAxis = "Ann\u00E9e";
+ } else if ("es".equals(locale.getLanguage())) {
+ yearAxis = "Ann\u00E9e";
}
+ CategoryAxis categoryAxis = new CategoryAxis(yearAxis);
+ categoryAxis.setCategoryMargin(0);
+ categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
+ // label horizontaux
+ String legendY = indicatorName;
+ if (multiplicator != 1) {
+ // affiche par exemple : cm * 1000
+ legendY += " (" + unit + "*" + multiplicator + ")";
+ }
+ else if (StringUtils.isNotEmpty(unit)) {
+ legendY += " (" + unit + ")";
+ }
+ ValueAxis valueAxis = new NumberAxis(legendY);
+ valueAxis.setUpperMargin(0.1);
+
+ CategoryItemRenderer renderer = new StatisticalLineAndShapeRenderer(false, true);
+
+ // n'affiche pas les nombre sur le graphique
+ //StandardCategoryItemLabelGenerator itemLabelGenerator = new StandardCategoryItemLabelGenerator();
+ //renderer.setBaseItemLabelGenerator(itemLabelGenerator);
+ //renderer.setBaseItemLabelsVisible(true);
+
+ CategoryPlot plot = new CategoryPlot(statisticalDataset, categoryAxis, valueAxis, renderer);
+ plot.setOrientation(PlotOrientation.VERTICAL);
+ JFreeChart chart = new JFreeChart(title,
+ JFreeChart.DEFAULT_TITLE_FONT, plot, true);
+
+ // remove series legend
+ chart.removeLegend();
+ // white background
+ chart.setBackgroundPaint(Color.WHITE);
+
+ try {
+ result = File.createTempFile("coser-chart-", ".png");
+ result.deleteOnExit();
+ ChartUtilities.saveChartAsPNG(result, chart, 800, 400);
+ } catch (IOException ex) {
+ throw new CoserBusinessException("Can't save chart", ex);
+ }
}
-
- // configure chart
- //CategoryAxis categoryAxis = new CategoryAxis(_("coser.business.common.year"));
- // FIXME echatellier 20110414 hack just for year, need a real locale object here
- // to call _(locale, i18nkey)
- String yearAxis = "Year";
- if ("fr".equals(locale.getLanguage())) {
- yearAxis = "Ann\u00E9e";
- } else if ("es".equals(locale.getLanguage())) {
- yearAxis = "Ann\u00E9e";
+ return result;
+ }
+
+ /**
+ * Generate community graph for selected indicators.
+ * Used by web ui extraction.
+ *
+ * @param project project
+ * @param resultDirectory result directory
+ * @param rsufiResult rsufiresult
+ * @param codeTypeEspecesFile le fichier contenant les code type espece (specifique au projet)
+ * @param indicator indicator
+ * @param zoneDisplayName zone full name
+ * @param indicatorName indicatorName localized
+ * @param unit data unit
+ * @param locale locale
+ * @param width graph width
+ * @param height graph height
+ * @return generated graph image (temp file) and data
+ * @throws CoserBusinessException
+ */
+ public Map<String, Object[]> getRsufiResultComCharts(Project project, File resultDirectory,
+ RSufiResult rsufiResult, File codeTypeEspecesFile, Collection<String> indicators,
+ String zoneDisplayName, MultiKeyMap indicatorMap, Locale locale,
+ int width, int height) throws CoserBusinessException {
+
+ Map<String, Object[]> result = new HashMap<String, Object[]>();
+
+ // le fichier estcomind
+ File estComIndFile = new File(resultDirectory, rsufiResult.getEstComIndName());
+
+ if (log.isDebugEnabled()) {
+ log.debug("Reading estComIndFile : " + estComIndFile);
}
- CategoryAxis categoryAxis = new CategoryAxis(yearAxis);
- categoryAxis.setCategoryMargin(0);
- categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
- // label horizontaux
- String legendY = indicatorName;
- if (multiplicator != 1) {
- // affiche par exemple : cm * 1000
- legendY += " (" + unit + "*" + multiplicator + ")";
+
+ // Campagne Indicateur Liste Strate Annee Estimation EcartType CV
+ DataStorage dataStorage = commonService.loadCSVFile(estComIndFile, CoserConstants.CSV_RESULT_SEPARATOR_CHAR);
+
+ int multiplicator = 1;
+ int minYear = Integer.MAX_VALUE;
+ int maxYear = Integer.MIN_VALUE;
+
+ Map<String, Map<Integer, Double[]>> indicatorGraphData = new HashMap<String, Map<Integer, Double[]>>();
+ Map<String, String> indicatorLists = new HashMap<String, String>();
+ Map<String, DataStorage> indicatorStorages = new HashMap<String, DataStorage>();
+ Iterator<String[]> estComIndIterator = dataStorage.iterator(true);
+ while (estComIndIterator.hasNext()) {
+ // Campagne Indicateur Liste Strate Annee Estimation EcartType CV
+ String[] tuple = estComIndIterator.next();
+ String indicatorCode = tuple[1];
+ String indicatorList = tuple[2];
+
+ if (indicators.contains(indicatorCode)) {
+
+ // si pas de list selectionnée, on prend la premiere
+ String localList = indicatorLists.get(indicatorCode);
+ if (StringUtils.isBlank(localList)) {
+ localList = indicatorList;
+ indicatorLists.put(indicatorCode, localList);
+ }
+
+ if (indicatorList.equals(localList)) {
+ Double estimation = Double.parseDouble(tuple[5]);
+ Double ecart = Double.parseDouble(tuple[6]);
+ int year = Integer.parseInt(tuple[4]);
+
+ if (year < minYear) {
+ minYear = year;
+ }
+ if (year > maxYear) {
+ maxYear = year;
+ }
+ Map<Integer, Double[]> graphData = indicatorGraphData.get(indicatorCode);
+ if (graphData == null) {
+ graphData = new HashMap<Integer, Double[]>();
+ indicatorGraphData.put(indicatorCode, graphData);
+ }
+ graphData.put(year, new Double[]{estimation, ecart});
+
+ // si les données sont énormes, on affiche les données
+ // / multiplicator et on le mentionne dans la légende
+ if (estimation > 1e9) {
+ multiplicator = 1000000;
+ }
+ if (estimation > 1e6 && multiplicator < 1000000) {
+ multiplicator = 1000;
+ }
+
+ // for data part
+ DataStorage subDataStorage = indicatorStorages.get(indicatorCode);
+ if (subDataStorage == null) {
+ subDataStorage = new MemoryDataStorage();
+ indicatorStorages.put(indicatorCode, subDataStorage);
+ }
+ subDataStorage.add(tuple);
+ }
+ }
}
- else if (StringUtils.isNotEmpty(unit)) {
- legendY += " (" + unit + ")";
+
+ // avec l'extraction des données, on peut demander a générer un graphique
+ // sur un indicateur qui n'est pas présent dans le projet courant,
+ // dans ce cas, on retourne null
+ for (String indicator : indicatorGraphData.keySet()) {
+ // get graph title
+ String chartTitle = zoneDisplayName;
+ String indicatorName = (String)indicatorMap.get(indicator, locale.getLanguage());
+ String unit = (String)indicatorMap.get(indicator, "unit");
+ chartTitle += " - " + indicatorName;
+
+ // ajout de la traduction de la liste d'indicateur
+ // les liste sont a1, T1, T2 ...
+ String localList = indicatorLists.get(indicator);
+ String listLetter = String.valueOf(localList.charAt(0));
+ DataStorage dataStorageType = commonService.loadCSVFile(codeTypeEspecesFile, CoserConstants.CSV_SEPARATOR_CHAR);
+ Iterator<String[]> typeIterator = dataStorageType.iterator(true);
+ while (typeIterator.hasNext()) {
+ // "Types";"Commentaire";"NumSys min";"NumSys max";"Code"
+ String[] tuple = typeIterator.next();
+ if (tuple[4].equals(listLetter)) {
+ /// gestion du groupe "Tous"
+ // cas special, c'est la seule valeur du fichier
+ // code type espece qui a besoin d'une traduction
+ if (tuple[4].equalsIgnoreCase("T")) {
+ if ("fr".equals(locale.getLanguage())) {
+ chartTitle += " - " + "Tous Liste " + localList.charAt(1);
+ } else if ("es".equals(locale.getLanguage())) {
+ chartTitle += " - " + "Todo Lista " + localList.charAt(1);
+ } else {
+ chartTitle += " - " + "All List " + localList.charAt(1);
+ }
+ } else {
+ // ajout de la traduction du nom de liste plus le numéro
+ if ("fr".equals(locale.getLanguage())) {
+ chartTitle += " - " + tuple[0] + " Liste " + localList.charAt(1);
+ } else if ("es".equals(locale.getLanguage())) {
+ chartTitle += " - " + tuple[0] + " Lista " + localList.charAt(1);
+ } else {
+ chartTitle += " - " + tuple[0] + " List " + localList.charAt(1);
+ }
+ }
+ break;
+ }
+ }
+
+ // generate dataset with sorted data
+ Map<Integer, Double[]> graphData = indicatorGraphData.get(indicator);
+ DefaultStatisticalCategoryDataset statisticalDataset = new DefaultStatisticalCategoryDataset();
+ for (int indexYear = minYear ; indexYear <= maxYear ; ++indexYear) {
+ Double[] entry = graphData.get(indexYear);
+ if (entry != null) {
+ Double estimation = entry[0] / multiplicator;
+ Double ecart = entry[1] / multiplicator;
+ statisticalDataset.add(estimation, ecart, "Serie1", (Comparable)indexYear);
+ } else {
+ statisticalDataset.add(null, null, "Serie1", (Comparable)indexYear);
+ }
+ }
+
+ // configure chart
+ //CategoryAxis categoryAxis = new CategoryAxis(_("coser.business.common.year"));
+ // FIXME echatellier 20110414 hack just for year, need a real locale object here
+ // to call _(locale, i18nkey)
+ String yearAxis = "Year";
+ if ("fr".equals(locale.getLanguage())) {
+ yearAxis = "Ann\u00E9e";
+ } else if ("es".equals(locale.getLanguage())) {
+ yearAxis = "A\u00F1o";
+ }
+ CategoryAxis categoryAxis = new CategoryAxis(yearAxis);
+ categoryAxis.setCategoryMargin(0);
+ categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
+ // label horizontaux
+ String legendY = indicatorName;
+ if (multiplicator != 1) {
+ // affiche par exemple : cm * 1000
+ legendY += " (" + unit + "*" + multiplicator + ")";
+ } else if (StringUtils.isNotEmpty(unit)) {
+ legendY += " (" + unit + ")";
+ }
+ ValueAxis valueAxis = new NumberAxis(legendY);
+ valueAxis.setUpperMargin(0.1);
+
+ CategoryItemRenderer renderer = new StatisticalLineAndShapeRenderer(false, true);
+
+ // n'affiche pas les nombre sur le graphique
+ //StandardCategoryItemLabelGenerator itemLabelGenerator = new StandardCategoryItemLabelGenerator();
+ //renderer.setBaseItemLabelGenerator(itemLabelGenerator);
+ //renderer.setBaseItemLabelsVisible(true);
+
+ CategoryPlot plot = new CategoryPlot(statisticalDataset, categoryAxis, valueAxis, renderer);
+ plot.setOrientation(PlotOrientation.VERTICAL);
+ JFreeChart chart = new JFreeChart(chartTitle,
+ JFreeChart.DEFAULT_TITLE_FONT, plot, true);
+
+ // remove series legend
+ chart.removeLegend();
+ // white background
+ chart.setBackgroundPaint(Color.WHITE);
+
+ try {
+ File chartFile = File.createTempFile("coser-chart-", ".png");
+ chartFile.deleteOnExit();
+ ChartUtilities.saveChartAsPNG(chartFile, chart, width, height);
+ //ByteArrayOutputStream out = new ByteArrayOutputStream();
+ //ChartUtilities.writeChartAsPNG(out, chart, width, height);
+
+ // data extraction
+ DataStorage subDataStorage = indicatorStorages.get(indicator);
+ StringWriter writer = new StringWriter();
+ commonService.storeDataWhithoutQuote(subDataStorage, writer, null, null);
+
+ // add chart file dans chart data in result
+ result.put(indicator, new Object[]{chartFile, writer.toString()});
+ } catch (IOException ex) {
+ throw new CoserBusinessException("Can't save chart", ex);
+ }
}
- ValueAxis valueAxis = new NumberAxis(legendY);
- valueAxis.setUpperMargin(0.1);
- CategoryItemRenderer renderer = new StatisticalLineAndShapeRenderer(false, true);
+ return result;
+ }
- // n'affiche pas les nombre sur le graphique
- //StandardCategoryItemLabelGenerator itemLabelGenerator = new StandardCategoryItemLabelGenerator();
- //renderer.setBaseItemLabelGenerator(itemLabelGenerator);
- //renderer.setBaseItemLabelsVisible(true);
+ /**
+ * Generate population graph for selected species and indicator.
+ *
+ * @param project project
+ * @param resultDirectory result directory
+ * @param rsufiResult rsufi result
+ * @param species species
+ * @param indicator indicator
+ * @param zoneDisplayName zone full name
+ * @param indicatorName indicatorName localized
+ * @param unit data unit
+ * @param locale locale
+ * @param width graph width
+ * @param height graph height
+ * @return generated image file (temp file)
+ * @throws CoserBusinessException
+ */
+ public Map<String, Object[]> getRsufiResultPopCharts(Project project, File resultDirectory,
+ RSufiResult rsufiResult, Collection<String> species, Collection<String> indicators,
+ String zoneDisplayName, MultiKeyMap indicatorMap, Locale locale,
+ int width, int height) throws CoserBusinessException {
- CategoryPlot plot = new CategoryPlot(statisticalDataset, categoryAxis, valueAxis, renderer);
- plot.setOrientation(PlotOrientation.VERTICAL);
- JFreeChart chart = new JFreeChart(title,
- JFreeChart.DEFAULT_TITLE_FONT, plot, true);
+ Map<String, Object[]> result = new HashMap<String, Object[]>();
- // remove series legend
- chart.removeLegend();
- // white background
- chart.setBackgroundPaint(Color.WHITE);
+ // le fichier estcomind
+ File estPopIndFile = new File(resultDirectory, rsufiResult.getEstPopIndName());
- try {
- result = File.createTempFile("coser-", ".chart");
- result.deleteOnExit();
- ChartUtilities.saveChartAsPNG(result, chart, 800, 400);
- } catch (IOException ex) {
- throw new CoserBusinessException("Can't save chart", ex);
+ // Campagne Indicateur Liste Species Strate Annee Estimation EcartType CV
+ DataStorage dataStorage = commonService.loadCSVFile(estPopIndFile, CoserConstants.CSV_RESULT_SEPARATOR_CHAR);
+
+ int multiplicator = 1;
+ int minYear = Integer.MAX_VALUE;
+ int maxYear = Integer.MIN_VALUE;
+
+ MultiKeyMap indicatorGraphData = new MultiKeyMap();
+ MultiKeyMap indicatorStorages = new MultiKeyMap();
+ Iterator<String[]> estPopIndIterator = dataStorage.iterator(true);
+ while (estPopIndIterator.hasNext()) {
+ String[] tuple = estPopIndIterator.next();
+
+ String speciesCode = tuple[3];
+ String indicatorCode = tuple[1];
+ if (species.contains(speciesCode) && indicators.contains(indicatorCode)) {
+
+ // XXX echatellier, maybe take care of list here ?
+
+ Double estimation = Double.parseDouble(tuple[6]);
+ Double ecart = Double.parseDouble(tuple[7]);
+ int year = Integer.parseInt(tuple[5]);
+
+ if (year < minYear) {
+ minYear = year;
+ }
+ if (year > maxYear) {
+ maxYear = year;
+ }
+ Map<Integer, Double[]> graphData = (Map<Integer, Double[]>)indicatorGraphData.get(indicatorCode, speciesCode);
+ if (graphData == null) {
+ graphData = new HashMap<Integer, Double[]>();
+ indicatorGraphData.put(indicatorCode, speciesCode, graphData);
+ }
+ graphData.put(year, new Double[]{estimation, ecart});
+
+ // si les données sont énormes, on affiche les données
+ // / multiplicator et on le mentionne dans la légende
+ if (estimation > 1e9) {
+ multiplicator = 1000000;
+ }
+ if (estimation > 1e6 && multiplicator < 1000000) {
+ multiplicator = 1000;
+ }
+
+ // for data part
+ DataStorage subDataStorage = (DataStorage)indicatorStorages.get(indicatorCode, speciesCode);
+ if (subDataStorage == null) {
+ subDataStorage = new MemoryDataStorage();
+ indicatorStorages.put(indicatorCode, speciesCode, subDataStorage);
+ }
+ subDataStorage.add(tuple);
+ }
}
-
+
+
+ // avec l'extraction des données, on peut demander a générer un graphique
+ // sur un indicateur qui n'est pas présent dans le projet courant,
+ // dans ce cas, on retourne null
+ for (MultiKey indicatorSpecies : (Set<MultiKey>)indicatorGraphData.keySet()) {
+ String indicator = (String)indicatorSpecies.getKey(0);
+ String aSpecies = (String)indicatorSpecies.getKey(1);
+ // get graph title
+ String title = zoneDisplayName;
+ String indicatorName = (String)indicatorMap.get(indicator, locale.getLanguage());
+ String unit = (String)indicatorMap.get(indicator, "unit");
+ title += " - " + indicatorName;
+ title += " - " + commonService.getReportDisplayName(project, aSpecies);
+
+ // generate dataset with sorted data
+ DefaultStatisticalCategoryDataset statisticalDataset = new DefaultStatisticalCategoryDataset();
+ Map<Integer, Double[]> graphData = (Map<Integer, Double[]>)indicatorGraphData.get(indicator, aSpecies);
+ for (int indexYear = minYear ; indexYear <= maxYear ; ++indexYear) {
+ Double[] entry = graphData.get(indexYear);
+ if (entry != null) {
+ Double estimation = entry[0] / multiplicator;
+ Double ecart = entry[1] / multiplicator;
+ statisticalDataset.add(estimation, ecart, "Serie1", (Comparable)indexYear);
+ } else {
+ statisticalDataset.add(null, null, "Serie1", (Comparable)indexYear);
+ }
+ }
+
+
+ // configure chart
+ //CategoryAxis categoryAxis = new CategoryAxis(_("coser.business.common.year"));
+ // FIXME echatellier 20110414 hack just for year, need a real locale object here
+ // to call _(locale, i18nkey)
+ String yearAxis = "Year";
+ if ("fr".equals(locale.getLanguage())) {
+ yearAxis = "Ann\u00E9e";
+ } else if ("es".equals(locale.getLanguage())) {
+ yearAxis = "Ann\u00E9e";
+ }
+ CategoryAxis categoryAxis = new CategoryAxis(yearAxis);
+ categoryAxis.setCategoryMargin(0);
+ categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
+ // label horizontaux
+ String legendY = indicatorName;
+ if (multiplicator != 1) {
+ // affiche par exemple : cm * 1000
+ legendY += " (" + unit + "*" + multiplicator + ")";
+ }
+ else if (StringUtils.isNotEmpty(unit)) {
+ legendY += " (" + unit + ")";
+ }
+ ValueAxis valueAxis = new NumberAxis(legendY);
+ valueAxis.setUpperMargin(0.1);
+
+ CategoryItemRenderer renderer = new StatisticalLineAndShapeRenderer(false, true);
+
+ // n'affiche pas les nombre sur le graphique
+ //StandardCategoryItemLabelGenerator itemLabelGenerator = new StandardCategoryItemLabelGenerator();
+ //renderer.setBaseItemLabelGenerator(itemLabelGenerator);
+ //renderer.setBaseItemLabelsVisible(true);
+
+ CategoryPlot plot = new CategoryPlot(statisticalDataset, categoryAxis, valueAxis, renderer);
+ plot.setOrientation(PlotOrientation.VERTICAL);
+ JFreeChart chart = new JFreeChart(title,
+ JFreeChart.DEFAULT_TITLE_FONT, plot, true);
+
+ // remove series legend
+ chart.removeLegend();
+ // white background
+ chart.setBackgroundPaint(Color.WHITE);
+
+ try {
+ File chartFile = File.createTempFile("coser-chart-", ".png");
+ chartFile.deleteOnExit();
+ ChartUtilities.saveChartAsPNG(chartFile, chart, width, height);
+ //ByteArrayOutputStream out = new ByteArrayOutputStream();
+ //ChartUtilities.writeChartAsPNG(out, chart, width, height);
+
+ // data extraction
+ DataStorage subDataStorage = (DataStorage)indicatorStorages.get(indicator, aSpecies);
+ StringWriter writer = new StringWriter();
+ commonService.storeDataWhithoutQuote(subDataStorage, writer, null, null);
+
+ // add chart file dans chart data in result
+ result.put(indicator + "-" + aSpecies, new Object[]{chartFile, writer.toString()});
+ } catch (IOException ex) {
+ throw new CoserBusinessException("Can't save chart", ex);
+ }
+ }
+
return result;
}
@@ -1147,7 +1563,7 @@
File result = null;
try {
- result = File.createTempFile("coser-", ".csv");
+ result = File.createTempFile("coser-chart-", ".csv");
result.deleteOnExit();
// le fichier estcomind
@@ -1171,14 +1587,16 @@
String indicatorCode = tuple[1];
String indicatorList = tuple[2];
- if (indicatorCode.equals(indicator) && indicatorList.equals(localList)) {
+ if (indicatorCode.equals(indicator)) {
// si pas de list selectionnée, on prend la premiere
if (StringUtils.isBlank(localList)) {
localList = indicatorList;
}
-
- subDataStorage.add(tuple);
+
+ if (indicatorList.equals(localList)) {
+ subDataStorage.add(tuple);
+ }
}
}
@@ -1207,7 +1625,7 @@
File result = null;
try {
- result = File.createTempFile("coser-", ".csv");
+ result = File.createTempFile("coser-graph-", ".csv");
result.deleteOnExit();
// le fichier estpopind
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 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java 2012-11-16 15:25:34 UTC (rev 1084)
@@ -26,6 +26,7 @@
package fr.ifremer.coser.services;
import static org.nuiton.i18n.I18n._;
+import static org.nuiton.i18n.I18n.l_;
import java.io.File;
import java.io.FileFilter;
@@ -41,6 +42,7 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
@@ -48,12 +50,17 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Properties;
+import java.util.Set;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.regex.Matcher;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.MapUtils;
+import org.apache.commons.collections.keyvalue.MultiKey;
import org.apache.commons.collections.map.MultiKeyMap;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
@@ -91,6 +98,7 @@
import fr.ifremer.coser.bean.Selection;
import fr.ifremer.coser.storage.DataStorage;
import fr.ifremer.coser.storage.MemoryDataStorage;
+import fr.ifremer.coser.util.DataType;
import fr.ifremer.coser.util.ProgressMonitor;
import fr.ifremer.coser.util.ProgressStream;
import freemarker.cache.ClassTemplateLoader;
@@ -701,7 +709,7 @@
try {
// dezipage dans un fichier temporaire
- File tempDirectory = FileUtil.createTempDirectory("coser", ".tmp");
+ File tempDirectory = FileUtil.createTempDirectory("coser-upload-", "-tmp");
ZipUtil.uncompress(archiveFile, tempDirectory);
File projectsDirectory = config.getWebIndicatorsProjectsDirectory();
@@ -1159,7 +1167,7 @@
* Pour une zone principale, recupere la liste des couples sous-zone /
* campagne qui sont disponible dans cette zone principale.
*
- * @param facade facade (le nom de la facade principale)
+ * @param facade facade (le nom de la facade principale) (can be {@code null} : don't filter on facade)
* @param onlyWithSource retourn zone liste with available source data
* @param forMap look in map directory
* @return couple subzoneid/sub
@@ -1174,7 +1182,7 @@
while (itZone.hasNext()) {
// "id";"facadeid";"facade";"zone";"periode";"serie";"comment";"comment_en";"comment_es";"map"
String[] tuple = itZone.next();
- if (tuple[1].equals(facade)) {
+ if (facade == null || tuple[1].equals(facade)) {
subZones.add(tuple[0]);
}
}
@@ -1317,7 +1325,19 @@
* @throws CoserBusinessException
*/
public Map<String, String> getSpecies(String zone, boolean forMap) throws CoserBusinessException {
+ return getSpecies(Collections.singleton(zone), forMap);
+ }
+ /**
+ * Recuperer la liste des populations pour un ensemble de zones donnée.
+ *
+ * @param zones zones ids
+ * @return map species nom info>nom officiel
+ * @param forMap for map directory
+ * @throws CoserBusinessException
+ */
+ public Map<String, String> getSpecies(Collection<String> zones, boolean forMap) throws CoserBusinessException {
+
Map<String, String> result = new TreeMap<String, String>();
File projectsDirectory = null;
@@ -1328,8 +1348,9 @@
projectsDirectory = config.getWebIndicatorsProjectsDirectory();
}
+ File[] projectFiles = projectsDirectory.listFiles();
+
// parcours des resultats disponibles
- File[] projectFiles = projectsDirectory.listFiles();
if (projectFiles != null) {
for (File projectFile : projectFiles) {
if (projectFile.isDirectory()) {
@@ -1350,14 +1371,13 @@
RSufiResult rsufiResult = projectService.getRSufiResult(resultFile);
// extraction des especes pour le résultat demandé
- if (rsufiResult.getZone() != null && rsufiResult.getZone().equals(zone)) {
+ if (rsufiResult.getZone() != null && zones.contains(rsufiResult.getZone())) {
// load project (without data to get reftax data)
Project project = projectService.openProject(projectFile.getName(), projectsDirectory);
Map<String, String> resultSpecies = getRsufiResultSpecies(project, resultFile, rsufiResult);
result.putAll(resultSpecies);
- break;
}
}
}
@@ -1425,7 +1445,7 @@
* pour la zone et l'especes souhaitées.
*
* @param zone zone id
- * @param species especes (if {@code null} look for com indicators
+ * @param species especes (if {@code null} look for com indicators)
* @param locale locale
* @return la liste des indicateurs
* @throws CoserBusinessException
@@ -1481,14 +1501,77 @@
return indicators;
}
+
+ /**
+ * Retourne les indicateurs calculés avec leurs traductions scientifique
+ * pour les zones souhaitées. Retournes les indicateurs de populations
+ * de de communauté à la fois.
+ *
+ * @param zones zones id
+ * @param dataTypes data type
+ * @param locale locale
+ * @return la liste des indicateurs
+ * @throws CoserBusinessException
+ * @since 1.4
+ */
+ public Map<String, String> getIndicators(Collection<String> zones, DataType dataType, Locale locale) throws CoserBusinessException {
+ Map<String, String> indicators = new TreeMap<String, String>();
+ // parcours des resultats disponibles
+ File projectsDirectory = config.getWebIndicatorsProjectsDirectory();
+ File[] projectFiles = projectsDirectory.listFiles();
+ if (projectFiles != null) {
+ for (File projectFile : projectFiles) {
+ if (projectFile.isDirectory()) {
+ File selectionsDirectory = new File(projectFile, CoserConstants.STORAGE_SELECTION_DIRECTORY);
+ File[] selectionFiles = selectionsDirectory.listFiles();
+
+ // selection iteration
+ if (selectionFiles != null) {
+ for (File selectionFile : selectionFiles) {
+ if (selectionFile.isDirectory()) {
+ File resultsDirectory = new File(selectionFile, CoserConstants.STORAGE_RESULTS_DIRECTORY);
+ File[] resultFiles = resultsDirectory.listFiles();
+
+ // result iteration
+ if (resultFiles != null) {
+ for (File resultFile : resultFiles) {
+ if (resultFile.isDirectory()) {
+ RSufiResult rsufiResult = projectService.getRSufiResult(resultFile);
+
+ // extraction des especes pour le résultat demandé
+ if (zones.contains(rsufiResult.getZone())) {
+
+ Map<String, String> resultIndicators = null;
+ if (dataType == DataType.COMMUNITY) {
+ resultIndicators = getRsufiResultComIndicators(resultFile, rsufiResult, locale);
+ indicators.putAll(resultIndicators);
+ }
+ if (dataType == DataType.POPULATION) {
+ resultIndicators = getRsufiResultPopIndicators(resultFile, rsufiResult, null, locale);
+ indicators.putAll(resultIndicators);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return indicators;
+ }
+
/**
* Recupere la liste de toutes les especes nom sci et nom off à partir
* d'un resultat.
*
* @param resultDirectory rsufi result directory
* @param rsufiResult result
- * @param species to get indicator
+ * @param species to get indicator (can be {@code null} to not filter on species)
* @param locale locale
* @return indicator for species
* @throws CoserBusinessException
@@ -1508,7 +1591,7 @@
String[] tuple = estPopIndIterator.next();
String specyCode = tuple[3];
- if (specyCode.equals(species)) {
+ if (species == null || specyCode.equals(species)) {
String indicatorCode = tuple[1];
String translations = getIndicatorValue(indicatorCode, locale.getLanguage());
@@ -1848,7 +1931,7 @@
try {
// cas community (zip avec fichier meta)
if (species == null) {
- File tempDir = FileUtil.createTempDirectory("coser-", ".tmp");
+ File tempDir = FileUtil.createTempDirectory("coser-chartdata-", "-tmp");
String surveyName = projectService.getProjectSurveyName(resultDirectory, rSufiResult);
File baseDir = new File(tempDir, surveyName);
@@ -1857,6 +1940,7 @@
File csvFile = publicationService.getRsufiResultComChartData(resultDirectory, rSufiResult, indicator, list);
File csvFileCopied = new File(baseDir, indicator + ".csv");
FileUtils.copyFile(csvFile, csvFileCopied);
+ csvFile.delete();
// ajout du fichier d'information sur les espèces incluses dans
// les calculs des indicateurs de communautés
@@ -1868,7 +1952,7 @@
FileUtils.copyFile(metaFile, metaFileCopied);
// make zip
- result = File.createTempFile("coserchartdatazip-", ".zip");
+ result = File.createTempFile("coser-chartdata-", ".zip");
result.deleteOnExit();
ZipUtil.compress(result, baseDir);
@@ -2045,14 +2129,13 @@
File resultZip = null;
try {
- File tempDir = FileUtil.createTempDirectory("coser-", ".tmp");
+ File tempDir = FileUtil.createTempDirectory("coser-source-", "-tmp");
// il ne faut pas les fichiers de selection, mais leurs
// export rsufi (sans les lignes, et les quotes)
File archiveDir = projectService.extractRSUfiData(project, selection, tempDir, true);
// add decharge file
- File dechargePDF = generateDechargePDF(resultDirectory, rSufiResult, locale);
String filename = null;
if (locale != null && "fr".equals(locale.getLanguage())) {
filename = "DechargeDonnees.pdf";
@@ -2061,7 +2144,8 @@
} else {
filename = "DataDisclaimer.pdf";
}
- FileUtils.copyFile(dechargePDF, new File(archiveDir, filename));
+ File dechargePDF = new File(archiveDir, filename);
+ generateDechargePDF(dechargePDF, resultDirectory, rSufiResult, locale);
// ajout du reftax dans le zip
File projectsDirectory = config.getWebIndicatorsProjectsDirectory();
@@ -2070,7 +2154,7 @@
FileUtils.copyFileToDirectory(reftaxFile, archiveDir);
// make zip
- resultZip = File.createTempFile("coserresultzip-", ".zip");
+ resultZip = File.createTempFile("coser-source-", ".zip");
resultZip.deleteOnExit();
ZipUtil.compress(resultZip, archiveDir);
@@ -2086,13 +2170,14 @@
/**
* Genere le PDF dynamique de decharge à partir du template freemarker.
*
+ * @param disclamerPdf pdf file to generate
* @param resultDirectory rsufi result directory
* @param rSufiResult rsufi result
* @param locale generated pdf locale
* @return le fichier généré
* @throws CoserBusinessException
*/
- protected File generateDechargePDF(File resultDirectory, RSufiResult rSufiResult, Locale locale) throws CoserBusinessException {
+ protected File generateDechargePDF(File disclamerPdf, File resultDirectory, RSufiResult rSufiResult, Locale locale) throws CoserBusinessException {
File result = null;
@@ -2101,7 +2186,14 @@
try {
// get some info to put into pdf
Date updateDate = getLastDataUpdateDate();
- String surveyName = projectService.getProjectSurveyName(resultDirectory, rSufiResult);
+
+ // il se peut que pour l'extraction un fichier de décharge ne soit
+ // pas généré pour une campagne en particulier
+ // on passe un nom vide a freemarker
+ String surveyName = "";
+ if (resultDirectory != null && rSufiResult != null) {
+ surveyName = projectService.getProjectSurveyName(resultDirectory, rSufiResult);
+ }
// render freemarker template
Template mapTemplate = freemarkerConfiguration.getTemplate("decharge.ftl", locale);
@@ -2118,9 +2210,7 @@
Document document = CoserUtils.parseDocument(out.toString());
// render template output as pdf
- result = File.createTempFile("coserdecharge-", ".pdf");
- result.deleteOnExit();
- os = new FileOutputStream(result);
+ os = new FileOutputStream(disclamerPdf);
ITextRenderer renderer = new ITextRenderer();
renderer.setDocument(document, null);
@@ -2294,7 +2384,7 @@
Document document = CoserUtils.parseDocument(out.toString());
// render template output as pdf
- result = File.createTempFile("cosermetainfo-", ".pdf");
+ result = File.createTempFile("coser-metainfo-", ".pdf");
result.deleteOnExit();
os = new FileOutputStream(result);
@@ -2407,4 +2497,414 @@
public void deleteMapsResult(List<String> deleteZoneId) throws CoserBusinessException {
cleanCurrentProjectDirectory(config.getWebMapsProjectsDirectory(), deleteZoneId);
}
+
+ /**
+ * Extrait de toutes les données les informations demandées restreintes
+ * sur certaines zone, certaines espèces et certains indicateurs.
+ *
+ * Ajout en plus dans le zip les cartes, les sources... suivant les
+ * types selectionnés.
+ *
+ * @param selectZones zones
+ * @param selectTypes types
+ * @param selectSpecies species
+ * @param comIndicators indicators
+ * @param popIndicators indicators
+ * @return le zip
+ * @since 1.4
+ */
+ public File extractData(List<String> zones, List<DataType> types, List<String> species,
+ List<String> comIndicators, List<String> popIndicators, Locale locale) throws CoserBusinessException {
+
+ File resultZip = null;
+ File tempDir = null;
+ try {
+ tempDir = FileUtil.createTempDirectory("coser-extract-", "-tmp");
+
+ File subDir = new File(tempDir, "extract");
+ subDir.mkdirs();
+
+ // les sources se retrouve dans le zip a cote du pdf
+ if (types.contains(DataType.SOURCE)) {
+ if (log.isDebugEnabled()) {
+ log.debug("Extracting sources");
+ }
+ File srcDir = new File(subDir, "sources");
+ extractSource(zones, srcDir);
+ }
+
+ // les cartes et des graphiques doivent se retroiver dans le pdf
+ MultiKeyMap pdfMaps = null;
+ if (types.contains(DataType.MAP)) {
+ if (log.isDebugEnabled()) {
+ log.debug("Extracting maps");
+ }
+ File mapDir = new File(subDir, "maps");
+ pdfMaps = extractDataMap(zones, species, mapDir);
+ }
+
+ // les graphiques sont également dans le pdf
+ Map<String, Object[]> pdfCharts = null;
+ if (CollectionUtils.isNotEmpty(comIndicators) || CollectionUtils.isNotEmpty(popIndicators)) {
+ if (log.isDebugEnabled()) {
+ log.debug("Extracting charts");
+ }
+ pdfCharts = extractCharts(zones, species, comIndicators, popIndicators, locale);
+ }
+
+ // generate pdf if necessary
+ if (MapUtils.isNotEmpty(pdfMaps) || MapUtils.isNotEmpty(pdfCharts)) {
+ File pdfFile = new File(subDir, "extract.pdf");
+ generateExtractPDF(pdfFile, pdfMaps, pdfCharts, locale);
+ }
+
+ // fichier de décharge en pdf
+ String filename = null;
+ if (locale != null && "fr".equals(locale.getLanguage())) {
+ filename = "DechargeDonnees.pdf";
+ } else if (locale != null && "es".equals(locale.getLanguage())) {
+ filename = "DatosDeExencionDeResponsabilidad.pdf";
+ } else {
+ filename = "DataDisclaimer.pdf";
+ }
+ File dechargePDF = new File(subDir, filename);
+ generateDechargePDF(dechargePDF, null, null, locale);
+
+ // make zip
+ resultZip = File.createTempFile("coser-extract-", ".zip");
+ resultZip.deleteOnExit();
+ ZipUtil.compress(resultZip, subDir);
+
+ // clean directory
+ FileUtils.deleteDirectory(tempDir);
+ } catch (IOException ex) {
+ throw new CoserBusinessException("Can't create zip file", ex);
+ } finally {
+ // clean directory
+ FileUtils.deleteQuietly(tempDir);
+ }
+ return resultZip;
+ }
+
+ /**
+ * Extrait les cartes
+ *
+ * @param zones zones (zoneid)
+ * @param species species
+ * @param directory
+ * @return map file
+ * @throws CoserBusinessException
+ * @throws IOException
+ * @since 1.4
+ */
+ protected MultiKeyMap extractDataMap(Collection<String> zones, Collection<String> species, File directory) throws CoserBusinessException, IOException {
+
+ MultiKeyMap mapForZoneAndSpecies = new MultiKeyMap();
+
+ // parcours des resultats disponibles
+ File projectsDirectory = config.getWebMapsProjectsDirectory();
+ File[] projectFiles = projectsDirectory.listFiles();
+ if (projectFiles != null) {
+ for (File projectFile : projectFiles) {
+ if (projectFile.isDirectory()) {
+ File selectionsDirectory = new File(projectFile, CoserConstants.STORAGE_SELECTION_DIRECTORY);
+ File[] selectionFiles = selectionsDirectory.listFiles();
+
+ // selection iteration
+ if (selectionFiles != null) {
+ for (File selectionFile : selectionFiles) {
+ if (selectionFile.isDirectory()) {
+ File resultsDirectory = new File(selectionFile, CoserConstants.STORAGE_RESULTS_DIRECTORY);
+ File[] resultFiles = resultsDirectory.listFiles();
+
+ // result iteration
+ if (resultFiles != null) {
+ for (File resultFile : resultFiles) {
+ if (resultFile.isDirectory()) {
+ RSufiResult rsufiResult = projectService.getRSufiResult(resultFile);
+
+ // extraction des especes pour le résultat demandé
+ if (rsufiResult.isMapsResult() && zones.contains(rsufiResult.getZone())) {
+
+ // load project (to get user display species name)
+ Project project = projectService.openProject(projectFile.getName(), projectsDirectory);
+
+ // get survey name (other condition)
+ String surveyName = projectService.getProjectSurveyName(resultFile, rsufiResult);
+
+ File mapsDirectory = new File(resultFile, CoserConstants.STORAGE_MAPS_DIRECTORY);
+ for (String aSpecies : species) {
+ String mapName = surveyName + "_" + aSpecies.toUpperCase() + ".png";
+ File mapFile = new File(mapsDirectory, mapName);
+ if (mapFile.isFile()) {
+ String speciesName = project.getDisplaySpeciesText(aSpecies);
+ mapForZoneAndSpecies.put(rsufiResult.getZone(), speciesName, mapFile);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return mapForZoneAndSpecies;
+ }
+
+ /**
+ * Genere un fichier zip des sources d'un projet.
+ *
+ * Contient:
+ * <ul>
+ * <li>les 4 fichiers apres sélection
+ * </ul>
+ *
+ * @param zone zone (zoneid-surveyname)
+ * @param locale locale
+ * @return zip source file (auto delete when jvm shutdown)
+ * @throws CoserBusinessException
+ * @since 1.4
+ */
+ protected File extractSource(Collection<String> zones, File directory) throws CoserBusinessException {
+
+ File result = null;
+
+ // parcours des resultats disponibles
+ File projectsDirectory = config.getWebIndicatorsProjectsDirectory();
+ File[] projectFiles = projectsDirectory.listFiles();
+ if (projectFiles != null) {
+ for (File projectFile : projectFiles) {
+ if (projectFile.isDirectory()) {
+ File selectionsDirectory = new File(projectFile, CoserConstants.STORAGE_SELECTION_DIRECTORY);
+ File[] selectionFiles = selectionsDirectory.listFiles();
+
+ // selection iteration
+ if (selectionFiles != null) {
+ for (File selectionFile : selectionFiles) {
+ if (selectionFile.isDirectory()) {
+ File resultsDirectory = new File(selectionFile, CoserConstants.STORAGE_RESULTS_DIRECTORY);
+ File[] resultFiles = resultsDirectory.listFiles();
+
+ // result iteration
+ if (resultFiles != null) {
+ for (File resultFile : resultFiles) {
+ if (resultFile.isDirectory()) {
+ RSufiResult rsufiResult = projectService.getRSufiResult(resultFile);
+
+ // extraction des especes pour le résultat demandé
+ if (rsufiResult.isDataAllowed() && zones.contains(rsufiResult.getZone())) {
+
+ // load project (with data to get original file names)
+ Project project = projectService.openProject(projectFile.getName(), projectsDirectory);
+
+ // load selection data (to do data export rsufi)
+ Selection selection = project.getSelections().get(selectionFile.getName());
+
+ // be sure that data are available for this project
+ // or it will fail
+ projectService.loadSelectionData(projectsDirectory, project, selection);
+
+ // il ne faut pas les fichiers de selection, mais leurs
+ // export rsufi (sans les lignes, et les quotes)
+ File zoneDirectory = new File(directory, rsufiResult.getZone());
+ zoneDirectory.mkdirs();
+ projectService.extractRSUfiData(project, selection, zoneDirectory, true);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Retourne les indicateurs calculés avec leurs traductions scientifique
+ * pour la zone et l'especes souhaitées.
+ *
+ * @param zone zone id
+ * @param species especes (if {@code null} look for com indicators
+ * @param comIndicator comIndicator
+ * @param popIndicators popIndicators
+ * @param locale locale
+ * @return la liste des indicateurs
+ * @throws CoserBusinessException
+ */
+ protected Map<String, Object[]> extractCharts(Collection<String> zones, Collection<String> species,
+ Collection<String> comIndicators, Collection<String> popIndicators, Locale locale) throws CoserBusinessException {
+
+ Map<String, Object[]> chartFileAndDatas = new HashMap<String, Object[]>();
+
+ // parcours des resultats disponibles
+ File projectsDirectory = config.getWebIndicatorsProjectsDirectory();
+ File[] projectFiles = projectsDirectory.listFiles();
+ if (projectFiles != null) {
+ for (File projectFile : projectFiles) {
+ if (projectFile.isDirectory()) {
+ File selectionsDirectory = new File(projectFile, CoserConstants.STORAGE_SELECTION_DIRECTORY);
+ File[] selectionFiles = selectionsDirectory.listFiles();
+
+ // selection iteration
+ if (selectionFiles != null) {
+ for (File selectionFile : selectionFiles) {
+ if (selectionFile.isDirectory()) {
+ File resultsDirectory = new File(selectionFile, CoserConstants.STORAGE_RESULTS_DIRECTORY);
+ File[] resultFiles = resultsDirectory.listFiles();
+
+ // result iteration
+ if (resultFiles != null) {
+ for (File resultFile : resultFiles) {
+ if (resultFile.isDirectory()) {
+ RSufiResult rsufiResult = projectService.getRSufiResult(resultFile);
+
+ // extraction des especes pour le résultat demandé
+ if (zones.contains(rsufiResult.getZone())) {
+
+ if (log.isDebugEnabled()) {
+ log.debug("Extracting charts for result " + resultFile);
+ }
+
+ // load project (without data to get reftax data)
+ Project project = projectService.openProject(projectFile.getName(), projectsDirectory);
+ String zoneDisplayName = getZoneFullName(rsufiResult.getZone());
+
+ // le fichier contenant le code type espece (utile
+ // pour les traductions des list d'indicateur)
+ File codeTypeEspecesFile = new File(projectFile, CoserConstants.Category.TYPE_ESPECES.getStorageFileName());
+
+ if (CollectionUtils.isNotEmpty(comIndicators)) {
+ Map<String, Object[]> chartFileAndDataCom = publicationService.getRsufiResultComCharts(project,
+ resultFile, rsufiResult, codeTypeEspecesFile, comIndicators,
+ zoneDisplayName, getIndicatorsMap(), locale, 650, 430);
+ chartFileAndDatas.putAll(chartFileAndDataCom);
+ }
+
+ if (CollectionUtils.isNotEmpty(popIndicators)) {
+ Map<String, Object[]> chartFileAndDataPop = publicationService.getRsufiResultPopCharts(project,
+ resultFile, rsufiResult, species, popIndicators,
+ zoneDisplayName, getIndicatorsMap(), locale, 650, 430);
+
+ chartFileAndDatas.putAll(chartFileAndDataPop);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return chartFileAndDatas;
+ }
+
+ /**
+ * Generate pdf file filled with maps and charts.
+ *
+ * @param pdfFile pdf file to generate to
+ * @param pdfMaps pdf maps (can be {@code null})
+ * @param pdfCharts pdf charts (can be {@code null})
+ * @throws CoserBusinessException
+ */
+ protected void generateExtractPDF(File pdfFile,
+ MultiKeyMap pdfMaps, Map<String, Object[]> pdfCharts, Locale locale) throws CoserBusinessException {
+
+ Collection<File> toDelete = new ArrayList<File>();
+ OutputStream os = null;
+
+ try {
+ StringBuilder htmlContent = new StringBuilder();
+ htmlContent.append("<html><head>");
+ htmlContent.append("<title>" + l_(locale, "coser.business.extract.extracttitle")+ "</title>");
+ htmlContent.append("<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />");
+ htmlContent.append("</head><body>");
+
+ if (pdfMaps != null) {
+ for (Entry<MultiKey, File> mapEntry : (Set<Entry<MultiKey, File>>)pdfMaps.entrySet()) {
+ String zoneId = (String)mapEntry.getKey().getKey(0);
+ String speciesName = (String)mapEntry.getKey().getKey(1);
+ File file = mapEntry.getValue();
+
+ String zoneName = getZoneFullName(zoneId);
+ htmlContent.append("<div style='page-break-after: always'>");
+ htmlContent.append("<p>" + zoneName + " - " + speciesName + "</p>");
+ htmlContent.append("<img src='file://" + file.getAbsolutePath() + "' />");
+ htmlContent.append("</div>");
+ }
+ }
+
+ if (pdfCharts != null) {
+ for (Entry<String, Object[]> chartFileAndData : pdfCharts.entrySet()) {
+ //String key = chartFileAndData.getKey();
+ File chartFile = (File)chartFileAndData.getValue()[0];
+ String content = (String)chartFileAndData.getValue()[1];
+
+ htmlContent.append("<div style='page-break-after: always'>");
+ htmlContent.append("<img src='file://" + chartFile.getAbsolutePath() + "' />");
+
+ htmlContent.append("Données du graphique :");
+ htmlContent.append("<pre>").append(content).append("</pre>");
+ htmlContent.append("</div>");
+
+ // les graphiques ont été générés, a supprimer donc
+ // a ne surtout pas faire avec les cartes !!!
+ toDelete.add(chartFile);
+ }
+ }
+
+ htmlContent.append("</body></html>");
+
+ // get content as w3c document
+ Document document = CoserUtils.parseDocument(htmlContent.toString());
+
+ // render template output as pdf
+ os = new FileOutputStream(pdfFile);
+
+ ITextRenderer renderer = new ITextRenderer();
+ /* plus rapide, mais ne fonctionne pas, les images n'apparaissent pas
+ renderer.getSharedContext().setUserAgentCallback(new ITextUserAgent(renderer.getOutputDevice()) {
+ @Override
+ protected InputStream resolveAndOpenStream(String uri) {
+ String localuri = StringUtils.removeStart(uri, "file://");
+ Object[] chartData = chartFileAndDatas.get(localuri);
+ InputStream is;
+ if (chartData != null) {
+ byte[] os = (byte[])chartData[0];
+ is = new ByteArrayInputStream(os);
+ } else {
+ is = super.resolveAndOpenStream(uri);
+ }
+ return is;
+ }
+ });*/
+ renderer.setDocument(document, null);
+ renderer.layout();
+ renderer.createPDF(os);
+
+ os.close();
+ } catch (IOException ex) {
+ throw new CoserBusinessException("Can't generate log pdf", ex);
+ } catch (DocumentException ex) {
+ throw new CoserBusinessException("Can't generate log pdf", ex);
+ } finally {
+ IOUtils.closeQuietly(os);
+
+ // delete file collection
+ for (File file : toDelete) {
+ file.delete();
+ }
+ }
+
+ }
}
Added: trunk/coser-business/src/main/java/fr/ifremer/coser/util/DataType.java
===================================================================
--- trunk/coser-business/src/main/java/fr/ifremer/coser/util/DataType.java (rev 0)
+++ trunk/coser-business/src/main/java/fr/ifremer/coser/util/DataType.java 2012-11-16 15:25:34 UTC (rev 1084)
@@ -0,0 +1,39 @@
+/*
+ * #%L
+ * Coser :: Business
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 Ifremer, Codelutin, Chatellier Eric
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+package fr.ifremer.coser.util;
+
+/**
+ * Les types de données gérées par le site internet, sur lesquelle il est
+ * possible de filtrer dans le formulaire de recherche.
+ *
+ * @author echatellier
+ * @since 1.4
+ */
+public enum DataType {
+ MAP,
+ POPULATION,
+ COMMUNITY,
+ SOURCE
+}
Property changes on: trunk/coser-business/src/main/java/fr/ifremer/coser/util/DataType.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: trunk/coser-business/src/main/resources/ftl/decharge_en.ftl
===================================================================
--- trunk/coser-business/src/main/resources/ftl/decharge_en.ftl 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-business/src/main/resources/ftl/decharge_en.ftl 2012-11-16 15:25:34 UTC (rev 1084)
@@ -31,6 +31,7 @@
send an email to the webmaster at harmonie(a)ifremer.fr.
</p>
+<#if surveyName?length > 0>
<h2>Important</h2>
<p>
The data are derived from the ${surveyName} series.
@@ -45,6 +46,7 @@
you are accepting the terms and conditions described in this document and in all
documents cited therein.
</p>
+</#if>
<h2>Contact</h2>
<p>
Modified: trunk/coser-business/src/main/resources/ftl/decharge_fr.ftl
===================================================================
--- trunk/coser-business/src/main/resources/ftl/decharge_fr.ftl 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-business/src/main/resources/ftl/decharge_fr.ftl 2012-11-16 15:25:34 UTC (rev 1084)
@@ -32,6 +32,7 @@
l'administrateur du site (harmonie(a)ifremer.fr)
</p>
+<#if surveyName?length > 0>
<h2>Important</h2>
<p>
Les données téléchargées sont issues de la série ${surveyName}.
@@ -48,6 +49,7 @@
conditions d'usage décrites dans ce document et dans tout document cité dans ce
texte.
</p>
+</#if>
<h2>Contact</h2>
<p>
Modified: trunk/coser-business/src/main/resources/i18n/coser-business_en_GB.properties
===================================================================
--- trunk/coser-business/src/main/resources/i18n/coser-business_en_GB.properties 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-business/src/main/resources/i18n/coser-business_en_GB.properties 2012-11-16 15:25:34 UTC (rev 1084)
@@ -102,6 +102,7 @@
coser.business.control.step.observation=Checking observation number \: %s (%d%%)
coser.business.control.step.xworks=Line checks \: %s (%d%%)
coser.business.extract.creationdate=Creation date \:
+coser.business.extract.extracttitle=Extract
coser.business.extract.projectAuthor=Project author \:
coser.business.extract.projectComment=Project comment \:
coser.business.extract.projectName=Project name \:
Modified: trunk/coser-business/src/main/resources/i18n/coser-business_fr_FR.properties
===================================================================
--- trunk/coser-business/src/main/resources/i18n/coser-business_fr_FR.properties 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-business/src/main/resources/i18n/coser-business_fr_FR.properties 2012-11-16 15:25:34 UTC (rev 1084)
@@ -102,6 +102,7 @@
coser.business.control.step.observation=Vérification du nombre d'observation \: %s (%d%%)
coser.business.control.step.xworks=Validation par lignes \: %s (%d%%)
coser.business.extract.creationdate=Date de création \:
+coser.business.extract.extracttitle=Extraction
coser.business.extract.projectAuthor=Auteur du projet \:
coser.business.extract.projectComment=Commentaire du projet \:
coser.business.extract.projectName=Nom du project \:
Modified: trunk/coser-business/src/test/java/fr/ifremer/coser/services/WebServiceTest.java
===================================================================
--- trunk/coser-business/src/test/java/fr/ifremer/coser/services/WebServiceTest.java 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-business/src/test/java/fr/ifremer/coser/services/WebServiceTest.java 2012-11-16 15:25:34 UTC (rev 1084)
@@ -27,7 +27,12 @@
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -41,6 +46,7 @@
import fr.ifremer.coser.CoserBusinessException;
import fr.ifremer.coser.storage.DataStorage;
+import fr.ifremer.coser.util.DataType;
/**
* Test du service de l'interface web.
@@ -182,14 +188,14 @@
registerUploadedResult("/web/upload2.zip");
File zip = webService.getSourceZip("testzone1", Locale.ENGLISH);
- File tempDir = FileUtil.createTempDirectory("coser", ".tmp");
+ File tempDir = FileUtil.createTempDirectory("coser-source-", "-tmp");
ZipUtil.uncompress(zip, tempDir);
Assert.assertTrue(new File(tempDir, "RSUFI_DATA_projet1" + File.separator + "testcatch.csv").isFile());
Assert.assertTrue(new File(tempDir, "RSUFI_DATA_projet1" + File.separator + "DataDisclaimer.pdf").isFile());
FileUtils.deleteDirectory(tempDir);
zip = webService.getSourceZip("testzone1", Locale.FRENCH);
- tempDir = FileUtil.createTempDirectory("coser", ".tmp");
+ tempDir = FileUtil.createTempDirectory("coser-source-", "-tmp");
ZipUtil.uncompress(zip, tempDir);
Assert.assertTrue(new File(tempDir, "RSUFI_DATA_projet1" + File.separator + "DechargeDonnees.pdf").isFile());
// test que le reftax est dans le zip
@@ -277,4 +283,52 @@
Assert.assertEquals("Type2 List 1", lists.get("m1"));
Assert.assertEquals("Type2 List 2", lists.get("m2"));
}
+
+ /**
+ * Test des modifications de methodes suite à l'intoduction du
+ * moteur de recherche pour extraire les données.
+ *
+ * @throws CoserBusinessException
+ */
+ @Test
+ public void testGetAllZoneSpeciesAndIndicators() throws CoserBusinessException {
+ registerUploadedResult("/web/upload2.zip");
+
+ Map<String, String> zones = webService.getZoneForFacade(null, false, false);
+ List<String> zoneIds = new ArrayList<String>(zones.keySet());
+ Assert.assertEquals(Arrays.asList("ecorse"), zoneIds);
+
+ Map<String, String> species = webService.getSpecies(zoneIds, false);
+ List<String> speciesIds = new ArrayList<String>(species.keySet());
+ Assert.assertEquals(Arrays.asList("COSER_SPECIES1", "COSER_SPECIES2"), speciesIds);
+
+ Map<String, String> indicators = webService.getIndicators(zoneIds, DataType.COMMUNITY, Locale.FRENCH);
+ List<String> indicatorIds = new ArrayList<String>(indicators.keySet());
+ Assert.assertEquals(Arrays.asList("Delta", "Lbcomm", "biomSmall"), indicatorIds);
+
+ indicators = webService.getIndicators(zoneIds, DataType.POPULATION, Locale.FRENCH);
+ indicatorIds = new ArrayList<String>(indicators.keySet());
+ Assert.assertEquals(Arrays.asList("Abundance", "Biomass", "Wbar", "lnN"), indicatorIds);
+ }
+
+ /**
+ * Test une validation de formulaire web pour extraire parmis toutes les
+ * données celle choisie sous forme de zip.
+ *
+ * @throws CoserBusinessException
+ */
+ @Test
+ public void testExtractDataAsZip() throws CoserBusinessException {
+ registerUploadedResult("/web/upload2.zip");
+
+ List<String> zones = Arrays.asList("ecorse");
+ List<DataType> types = Arrays.asList(DataType.MAP, DataType.POPULATION, DataType.COMMUNITY, DataType.SOURCE);
+ List<String> species = Arrays.asList("COSER_SPECIES1", "COSER_SPECIES2");
+ List<String> comIndicators = Arrays.asList("Delta", "Lbcomm", "biomSmall");
+ List<String> popIndicators = Arrays.asList("Abundance", "Biomass", "Wbar", "lnN");
+
+ File file = webService.extractData(zones, types, species, comIndicators, popIndicators, Locale.FRENCH);
+ Assert.assertTrue(file.length() > 0);
+ }
}
+
Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionHandler.java
===================================================================
--- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionHandler.java 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/selection/SelectionHandler.java 2012-11-16 15:25:34 UTC (rev 1084)
@@ -835,8 +835,7 @@
JOptionPane.showMessageDialog(view, _("coser.ui.selection.selectionCreated"),
_("coser.ui.selection.selectionTitle"), JOptionPane.INFORMATION_MESSAGE);
- }
- else {
+ } else {
projectService.saveProjectSelection(project, selection);
JOptionPane.showMessageDialog(view, _("coser.ui.selection.selectionSaved"),
@@ -1272,8 +1271,7 @@
for (Object selectedSingleSpecies : selectedSpecies) {
graphSpecies.add((String)selectedSingleSpecies);
}
- }
- else {
+ } else {
// merge both lists
Object[] selectedSpecies = view.getFilteredSpeciesList().getSelectedValues();
for (Object selectedSingleSpecies : selectedSpecies) {
@@ -1344,18 +1342,15 @@
ProjectService projectService = view.getContextValue(ProjectService.class);
List<File> otherFiles = view.getOtherDataFileListModel().getFiles();
-
RSufiResult newResult = view.getRsufiResult();
try {
projectService.saveRsufiResults(project, selection, newResult, otherFiles);
- }
- catch (CoserBusinessException ex) {
+ view.dispose();
+ } catch (CoserBusinessException ex) {
JOptionPane.showMessageDialog(view, ex.getMessage(), _("coser.ui.result.saveError"), JOptionPane.ERROR_MESSAGE);
- }
- finally {
+ } finally {
setDefaultCursor(view);
}
- view.dispose();
}
/**
@@ -1394,8 +1389,7 @@
try {
List<File> newOthersFile = view.getOtherDataFileListModel().getFiles();
projectService.editRsufiResults(project, selection, editedResult, newOthersFile);
- }
- catch (CoserBusinessException ex) {
+ } catch (CoserBusinessException ex) {
JOptionPane.showMessageDialog(view, ex.getMessage(), _("coser.ui.result.saveError"), JOptionPane.ERROR_MESSAGE);
}
view.dispose();
@@ -1638,8 +1632,7 @@
try {
List<File> newOthersFile = view.getSelectionFilesListModel().getFiles();
projectService.editSelectionOptions(project, selection, newOthersFile);
- }
- catch (CoserBusinessException ex) {
+ } catch (CoserBusinessException ex) {
JOptionPane.showMessageDialog(view, ex.getMessage(), _("coser.ui.result.saveError"), JOptionPane.ERROR_MESSAGE);
}
view.dispose();
Modified: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/admin/DeleteProjectsAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/admin/DeleteProjectsAction.java 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/admin/DeleteProjectsAction.java 2012-11-16 15:25:34 UTC (rev 1084)
@@ -22,7 +22,6 @@
package fr.ifremer.coser.web.actions.admin;
-import java.util.Arrays;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/search/ExtractAction.java
===================================================================
--- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/search/ExtractAction.java (rev 0)
+++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/search/ExtractAction.java 2012-11-16 15:25:34 UTC (rev 1084)
@@ -0,0 +1,295 @@
+/*
+ * #%L
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2012 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.search;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.InterceptorRef;
+import org.apache.struts2.convention.annotation.InterceptorRefs;
+import org.apache.struts2.convention.annotation.Result;
+import org.apache.struts2.interceptor.ServletRequestAware;
+
+import fr.ifremer.coser.CoserBusinessException;
+import fr.ifremer.coser.services.WebService;
+import fr.ifremer.coser.util.DataType;
+import fr.ifremer.coser.web.CoserWebException;
+import fr.ifremer.coser.web.ServiceFactory;
+import fr.ifremer.coser.web.actions.common.CoserAction;
+
+/**
+ * Affiche le formulaire de recherche pour extraction d'un zip contenant
+ * les sources des projets choisit, et un pdf avec les graphiques et les données
+ * des graphiques.
+ *
+ * @author echatellier
+ * @since 1.4
+ */
+@InterceptorRefs({
+ @InterceptorRef("defaultStack"),
+ @InterceptorRef(value="execAndWait",
+ params={"excludeMethods","execute,quality"})
+})
+public class ExtractAction extends CoserAction implements ServletRequestAware {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 8497086194191374797L;
+
+ private static final Log log = LogFactory.getLog(ExtractAction.class);
+
+ protected Map<String, String> zones;
+
+ protected List<String> selectZones;
+
+ protected List<DataType> selectTypes;
+
+ protected Map<String, String> species;
+
+ protected List<String> selectSpecies;
+
+ protected Map<String, String> comIndicators;
+
+ protected List<String> selectComIndicators;
+
+ protected Map<String, String> popIndicators;
+
+ protected List<String> selectPopIndicators;
+
+ protected String submitAction;
+
+ protected boolean accepted;
+
+ protected HttpServletRequest request;
+
+ /**
+ * Pour le hack du execute and wait.
+ * On met des choses dans la session pour pouvoir les récupérer.
+ */
+ @Override
+ public void setServletRequest(HttpServletRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public String execute() {
+
+ String result;
+
+ if (StringUtils.isNotBlank(submitAction)) {
+ result = SUCCESS;
+ } else {
+ result = INPUT;
+ Locale locale = getLocale();
+ WebService webService = ServiceFactory.getWebService();
+
+ try {
+ // renvoi la liste des id subzone-survey et leurs label associé
+ zones = webService.getZoneForFacade(null, false, false);
+ if (CollectionUtils.isNotEmpty(selectZones)) {
+ species = webService.getSpecies(selectZones, false);
+
+ if (selectTypes != null && selectTypes.contains(DataType.COMMUNITY)) {
+ comIndicators = webService.getIndicators(selectZones, DataType.COMMUNITY, locale);
+ }
+ if (selectTypes != null && selectTypes.contains(DataType.POPULATION)) {
+ popIndicators = webService.getIndicators(selectZones, DataType.POPULATION, locale);
+ }
+ }
+ } catch (CoserBusinessException ex) {
+ throw new CoserWebException("Can't get zone map", ex);
+ }
+ }
+
+ return result;
+ }
+
+ public Map<String, String> getZones() {
+ return zones;
+ }
+
+ public List<String> getSelectZones() {
+ return selectZones;
+ }
+
+ public void setSelectZones(List<String> selectZones) {
+ this.selectZones = selectZones;
+ }
+
+ public List<DataType> getSelectTypes() {
+ return selectTypes;
+ }
+
+ public void setSelectTypes(List<DataType> selectTypes) {
+ this.selectTypes = selectTypes;
+ }
+
+ public List<String> getSelectSpecies() {
+ return selectSpecies;
+ }
+
+ public void setSelectSpecies(List<String> selectSpecies) {
+ this.selectSpecies = selectSpecies;
+ }
+
+ public List<String> getSelectComIndicators() {
+ return selectComIndicators;
+ }
+
+ public void setSelectComIndicators(List<String> selectComIndicators) {
+ this.selectComIndicators = selectComIndicators;
+ }
+
+ public List<String> getSelectPopIndicators() {
+ return selectPopIndicators;
+ }
+
+ public void setSelectPopIndicators(List<String> selectPopIndicators) {
+ this.selectPopIndicators = selectPopIndicators;
+ }
+
+ public Map<String, String> getSpecies() {
+ return species;
+ }
+
+ public Map<String, String> getComIndicators() {
+ return comIndicators;
+ }
+
+ public Map<String, String> getPopIndicators() {
+ return popIndicators;
+ }
+
+ public void setSubmitAction(String submitAction) {
+ this.submitAction = submitAction;
+ }
+
+ public void setAccepted(boolean accepted) {
+ this.accepted = accepted;
+ }
+
+ @Action(value="extract-quality",
+ results= {
+ @Result(location="/WEB-INF/content/search/extract-success.jsp"),
+ @Result(name="download", type="redirect", params={
+ "location", "${location}"})})
+ public String quality() {
+ String result;
+ if (!accepted) {
+ addFieldError("accepted", getText("message.quality.notaccepted"));
+ result = "success";
+ } else {
+
+ // petit hack pour mettre la locale dans la session car
+ // après, on n'a plus accès au context dans le executeAndWait
+ request.getSession().setAttribute("locale", getLocale());
+ result = "download";
+ }
+ return result;
+ }
+
+ /**
+ * C'est super dur des faire une redirection sur une url.
+ * Construction d'une url complete.
+ *
+ * @return l'url de redirection
+ */
+ public String getLocation() {
+ String url = "extract-download?accepted=true";
+ if (selectZones != null) {
+ for (String zone : selectZones) {
+ url += "&selectZones=" + zone;
+ }
+ }
+ if (selectTypes != null) {
+ for (DataType type : selectTypes) {
+ url += "&selectTypes=" + type;
+ }
+ }
+ if (selectSpecies != null) {
+ for (String species : selectSpecies) {
+ url += "&selectSpecies=" + species;
+ }
+ }
+ if (selectComIndicators != null) {
+ for (String selectComIndicator : selectComIndicators) {
+ url += "&selectComIndicators=" + selectComIndicator;
+ }
+ }
+ if (selectPopIndicators != null) {
+ for (String selectPopIndicator : selectPopIndicators) {
+ url += "&selectPopIndicators=" + selectPopIndicator;
+ }
+ }
+ return url;
+ }
+
+ protected File zipFile;
+
+ @Action(value="extract-download",
+ results={
+ @Result(name="wait", location="/WEB-INF/content/search/extract-wait.jsp"),
+ @Result(type="stream", params={"contentType", "application/zip", "inputName", "inputStream", "contentDisposition", "attachment; filename=\"${filename}\""})})
+ public String download() {
+ try {
+ Locale locale = (Locale)request.getSession().getAttribute("locale");
+ WebService webService = ServiceFactory.getWebService();
+
+ zipFile = webService.extractData(selectZones, selectTypes, selectSpecies,
+ selectComIndicators, selectPopIndicators, locale);
+ } catch (Exception ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't extract data", ex);
+ }
+ throw new CoserWebException("Can't extract data", ex);
+ }
+ return "success";
+ }
+
+ public InputStream getInputStream() {
+ InputStream is = null;
+ try {
+ is = new FileInputStream(zipFile);
+ } catch (Exception ex) {
+ if (log.isErrorEnabled()) {
+ log.error("Can't extract data", ex);
+ }
+ throw new CoserWebException("Can't extract data", ex);
+ }
+ return is;
+ }
+
+ public String getFilename() {
+ return "extract.zip";
+ }
+}
Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/search/ExtractAction.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 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package.properties 2012-11-16 15:25:34 UTC (rev 1084)
@@ -29,7 +29,7 @@
message.admin.listprojects.indicatorsprojects.comment=Removing an indicator project will also delete projet data source.
message.admin.listprojects.mapsprojects=Maps projects by zones
message.admin.login=Login
-message.admin.loginrequiered=Autentication required
+message.admin.loginrequiered=Authentication required
message.admin.password=Password
message.com.downloadascsv=Download as CSV
message.com.downloadaszip=Download as ZIP
@@ -39,17 +39,23 @@
message.com.selectindicatorlist=Select a data list
message.com.title=Community indices
message.common.anchortop=Top
+message.common.community=community
message.common.facade=Sea
+message.common.indicatorsof=Indicators of
message.common.jsreadmore=Read more
message.common.noresults=No results available
+message.common.population=population
message.common.selectfacade=Select an area
message.common.selectindicator=Select an indicator
message.common.selectpop=Select a population
message.common.selectspecies=Select a species
message.common.selectsurvey=Select a survey
message.common.selectzone=Select an area
+message.common.species=Species
message.common.validform=Valid
message.common.zone=Zone
+message.common.zones=Zones
+message.common.datatypes=Data types
message.documents.genparagraph1=Grands invert�br�s et poissons observ�s par les campagnes scientifiques. Atlas de distribution. Bilan 2008. 2009. {0}
message.documents.genparagraph2=Grands invert�br�s et poissons observ�s par les campagnes scientifiques. Bilan 2007. 2009. {0}
message.documents.genparagraph3=L''�tat des communaut�s exploit�es au large des c\u00F4tes de France. Application d''indicateurs � l''�valuation de l''impact de la p�che. Bilan 2004 Edition 2009. {0}
@@ -67,17 +73,21 @@
message.documents.indicatorparagraph1=Dreves L., C. Abernot-Le Gac, E. Antajan, P. Clabaut, P. Claquin, M.L. Cochard, P. Monbet, J. Morin, A. T�tard, C. Warenbourg & H. Thillaye du Boullay, 2010. Synth�se hydrobiologique du site �lectronucl�aire de Penly. Ifremer. DOP/LER/2010.05. 280 p.
message.documents.indicatortitle3=Travaux ayant utilis� les r�sultats du groupe de travail sur les indicateurs de populations et de peuplements
message.documents.title=Documents
-message.index.datatypecom=Community indices by area.
+message.index.datatypecom=Community indices by area
message.index.datatypemap=Species distribution maps by area
message.index.datatypepop=Population indices by species by area
message.index.datatypesource=Raw data by sampling unit (generally by haul)
-message.index.datatypetitle=Four data products are presented
+message.index.datatypesource.short=Raw data by sampling unit
+message.index.datatypetitle=Viewing data online
message.index.documentsmessage=Documents
message.index.documentstitle=Documents
+message.index.extractdatatitle=Extract data
+message.index.extractdatalink=Search form
message.index.paragraph1=This web site has been created to provide easy access to the raw data and index estimates derived from the scientific surveys carried out by Ifremer along the French coasts.
message.index.paragraph2=All data made available have passed rigorous quality checks. However, as the reliability of results interpretations depends directly on the data used, users are cordially invited to study carefully the survey and quality check protocols.
message.index.paragraph3=Each survey is carried out using a specific sampling design. Data analyses and interpretation of each time series must therefore take into account the sampling designs. The data are presented by survey series on the web site.
message.index.paragraph4=The species codes used in the data tables are those of the taxinomic reference file of the Syst�me d''informations halieutiques de l''Ifremer ({0}).
+message.index.paragraph5=The link below allows you to extract the elements of the site (graphics and data) in the form of a .zip file (containing a pdf document and data)
message.index.partnertitle=Group members
message.index.partnerparagraph1=The results presented on this web site are the fruit of an internal Ifremer working group which has been active since 2001 with the objective of developing population and community indicators for the survey data collected since the end of the 1970s along the French coasts. The main group members are (by Ifremer location and in alphabetical order): Florence Sanchez (Anglet), Franck Coppin, Sandrine Vaz and Yves V�rin (Boulogne-sur-mer), Andr� Battaglia and Jean-Pierre L�aut� (L''Houmeau), Jean-Claude Mah� and Mich�le Salaun (Lorient), Jacques Bertrand, Anik Brind''Amour, Yves D�saunay, Pascal Laffargue, Olivier Le Pape, J�r�my Lobry, Pascal Lorance, Jean-Charles Poulard, Marie-Jo\u00EBlle Rochet and Verena Trenkel (Nantes), Marie-Laure Cochard, Jocelyne Morin and Ivan Schlaich (Port-en-Bessin), Ang�lique Jadaud and Arnaud Souplet (S�te). The quality process is managed by Vincent Badts. The data-processing is supported by Olivier Berthel�.
message.index.qualitymessage=Quality warning
@@ -115,6 +125,14 @@
message.quality.paragraph4=For any given survey time series, any changes in the sampling procedure, gear, period and area covered might influence the catches. Therefore to avoid the risk of any bias in the analysis, the data must be carefully filtered before use.
message.quality.paragraph5=It is strongly recommended to use the data with care. In the case of doubts about the validity of the data, please contact the administrator of the data base ({0}).
message.quality.title=Quality warning
+message.search.extract.extract=Extract
+message.search.extract.speciesindicators=Indicators and species
+message.search.extract.title=Extract data
+message.search.extract.updatelists=Update lists
+message.search.extract.waittitle=Extracting data...
+message.search.extract.waitparagraph1=Data are being extracting. Please wait.
+message.search.extract.waitparagraph2=This operation take several minutes in the case of many graphics should be generated.
+message.search.extract.zonetype=Zone and data types
message.source.download=Download
message.source.paragraph1=The raw data are presented in four tables which contain the basic information by sampling unit (generally a haul) as well as the relevant information on the sampling design (strata). An additional table provides the latin names for the species codes used in the data files. Il s''agit des donn�es utilis�es pour r�aliser les calculs des indicateurs pr�sent�s. Ces donn�es ont fait l''objet de filtrages et de regroupements �ventuels par rapport aux donn�es de base de chaque s�rie, afin d''assurer la coh�rence des jeux de donn�es en vue du calcul des indicateurs. Ainsi, pour certaines s�ries, des groupes entiers (e.g. les amphihalins) ont pu �tre retir�s. Pour certaines s�ries, certaines ann�es ou certaines strates ont �t� retir�es afin de pr�server l''homog�n�it� de la s�rie. Dans des cas d''�volution du niveau de d�termination au cours de la s�rie, plusieurs taxons ont �t� regroup�s � un niveau sup�rieur.
message.source.paragraph2=Les donn�es IBTS (donn�es fran\u00E7aises et donn�es des autres pays) issues de la base Datras du CIEM (http://datras.ices.dk) ont fait l''objet des m�mes contr\u00F4les de qualit� que les autres s�ries de donn�es utilis�es, ainsi que de filtrages et de regroupements taxinomiques pour en pr�server la coh�rence vis-�-vis du pr�sent objectif de production d''indicateurs de tendances.
Modified: trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_en.properties
===================================================================
--- trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_en.properties 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_en.properties 2012-11-16 15:25:34 UTC (rev 1084)
@@ -29,7 +29,7 @@
message.admin.listprojects.indicatorsprojects.comment=Removing an indicator project will also delete projet data source.
message.admin.listprojects.mapsprojects=Maps projects by zones
message.admin.login=Login
-message.admin.loginrequiered=Autentication required
+message.admin.loginrequiered=Authentication required
message.admin.password=Password
message.com.downloadascsv=Download as CSV
message.com.downloadaszip=Download as ZIP
@@ -39,17 +39,23 @@
message.com.selectindicatorlist=Select a data list
message.com.title=Community indices
message.common.anchortop=Top
+message.common.community=community
message.common.facade=Sea
+message.common.indicatorsof=Indicators of
message.common.jsreadmore=Read more
message.common.noresults=No results available
+message.common.population=population
message.common.selectfacade=Select an area
message.common.selectindicator=Select an indicator
message.common.selectpop=Select a population
message.common.selectspecies=Select a species
message.common.selectsurvey=Select a survey
message.common.selectzone=Select an area
+message.common.species=Species
message.common.validform=Valid
message.common.zone=Zone
+message.common.zones=Zones
+message.common.datatypes=Data types
message.documents.genparagraph1=Grands invert�br�s et poissons observ�s par les campagnes scientifiques. Atlas de distribution. Bilan 2008. 2009. {0}
message.documents.genparagraph2=Grands invert�br�s et poissons observ�s par les campagnes scientifiques. Bilan 2007. 2009. {0}
message.documents.genparagraph3=L''�tat des communaut�s exploit�es au large des c\u00F4tes de France. Application d''indicateurs � l''�valuation de l''impact de la p�che. Bilan 2004 Edition 2009. {0}
@@ -67,17 +73,21 @@
message.documents.indicatorparagraph1=Dreves L., C. Abernot-Le Gac, E. Antajan, P. Clabaut, P. Claquin, M.L. Cochard, P. Monbet, J. Morin, A. T�tard, C. Warenbourg & H. Thillaye du Boullay, 2010. Synth�se hydrobiologique du site �lectronucl�aire de Penly. Ifremer. DOP/LER/2010.05. 280 p.
message.documents.indicatortitle3=Travaux ayant utilis� les r�sultats du groupe de travail sur les indicateurs de populations et de peuplements
message.documents.title=Documents
-message.index.datatypecom=Community indices by area.
+message.index.datatypecom=Community indices by area
message.index.datatypemap=Species distribution maps by area
message.index.datatypepop=Population indices by species by area
message.index.datatypesource=Raw data by sampling unit (generally by haul)
-message.index.datatypetitle=Four data products are presented
+message.index.datatypesource.short=Raw data by sampling unit
+message.index.datatypetitle=Viewing data online
message.index.documentsmessage=Documents
message.index.documentstitle=Documents
+message.index.extractdatatitle=Extract data
+message.index.extractdatalink=Search form
message.index.paragraph1=This web site has been created to provide easy access to the raw data and index estimates derived from the scientific surveys carried out by Ifremer along the French coasts.
message.index.paragraph2=All data made available have passed rigorous quality checks. However, as the reliability of results interpretations depends directly on the data used, users are cordially invited to study carefully the survey and quality check protocols.
message.index.paragraph3=Each survey is carried out using a specific sampling design. Data analyses and interpretation of each time series must therefore take into account the sampling designs. The data are presented by survey series on the web site.
message.index.paragraph4=The species codes used in the data tables are those of the taxinomic reference file of the Syst�me d''informations halieutiques de l''Ifremer ({0}).
+message.index.paragraph5=The link below allows you to extract the elements of the site (graphics and data) in the form of a .zip file (containing a pdf document and data)
message.index.partnertitle=Group members
message.index.partnerparagraph1=The results presented on this web site are the fruit of an internal Ifremer working group which has been active since 2001 with the objective of developing population and community indicators for the survey data collected since the end of the 1970s along the French coasts. The main group members are (by Ifremer location and in alphabetical order): Florence Sanchez (Anglet), Franck Coppin, Sandrine Vaz and Yves V�rin (Boulogne-sur-mer), Andr� Battaglia and Jean-Pierre L�aut� (L''Houmeau), Jean-Claude Mah� and Mich�le Salaun (Lorient), Jacques Bertrand, Anik Brind''Amour, Yves D�saunay, Pascal Laffargue, Olivier Le Pape, J�r�my Lobry, Pascal Lorance, Jean-Charles Poulard, Marie-Jo\u00EBlle Rochet and Verena Trenkel (Nantes), Marie-Laure Cochard, Jocelyne Morin and Ivan Schlaich (Port-en-Bessin), Ang�lique Jadaud and Arnaud Souplet (S�te). The quality process is managed by Vincent Badts. The data-processing is supported by Olivier Berthel�.
message.index.qualitymessage=Quality warning
@@ -115,6 +125,14 @@
message.quality.paragraph4=For any given survey time series, any changes in the sampling procedure, gear, period and area covered might influence the catches. Therefore to avoid the risk of any bias in the analysis, the data must be carefully filtered before use.
message.quality.paragraph5=It is strongly recommended to use the data with care. In the case of doubts about the validity of the data, please contact the administrator of the data base ({0}).
message.quality.title=Quality warning
+message.search.extract.extract=Extract
+message.search.extract.speciesindicators=Indicators and species
+message.search.extract.title=Extract data
+message.search.extract.updatelists=Update lists
+message.search.extract.waittitle=Extracting data...
+message.search.extract.waitparagraph1=Data are being extracting. Please wait.
+message.search.extract.waitparagraph2=This operation take several minutes in the case of many graphics should be generated.
+message.search.extract.zonetype=Zone and data types
message.source.download=Download
message.source.paragraph1=The raw data are presented in four tables which contain the basic information by sampling unit (generally a haul) as well as the relevant information on the sampling design (strata). An additional table provides the latin names for the species codes used in the data files. Il s''agit des donn�es utilis�es pour r�aliser les calculs des indicateurs pr�sent�s. Ces donn�es ont fait l''objet de filtrages et de regroupements �ventuels par rapport aux donn�es de base de chaque s�rie, afin d''assurer la coh�rence des jeux de donn�es en vue du calcul des indicateurs. Ainsi, pour certaines s�ries, des groupes entiers (e.g. les amphihalins) ont pu �tre retir�s. Pour certaines s�ries, certaines ann�es ou certaines strates ont �t� retir�es afin de pr�server l''homog�n�it� de la s�rie. Dans des cas d''�volution du niveau de d�termination au cours de la s�rie, plusieurs taxons ont �t� regroup�s � un niveau sup�rieur.
message.source.paragraph2=Les donn�es IBTS (donn�es fran\u00E7aises et donn�es des autres pays) issues de la base Datras du CIEM (http://datras.ices.dk) ont fait l''objet des m�mes contr\u00F4les de qualit� que les autres s�ries de donn�es utilis�es, ainsi que de filtrages et de regroupements taxinomiques pour en pr�server la coh�rence vis-�-vis du pr�sent objectif de production d''indicateurs de tendances.
Modified: trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_es.properties
===================================================================
--- trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_es.properties 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_es.properties 2012-11-16 15:25:34 UTC (rev 1084)
@@ -39,17 +39,23 @@
message.com.selectindicatorlist=S�lectionner une liste de donn�es
message.com.title=Indices de communaut�s
message.common.anchortop=Haut
+message.common.community=community
message.common.facade=Facade
+message.common.indicatorsof=Indicateurs de
message.common.jsreadmore=Voir la suite
message.common.noresults=Aucun r�sultat disponible.
+message.common.population=population
message.common.selectfacade=S�lectionnez une fa�ade
message.common.selectindicator=S�lectionnez un indicateur
message.common.selectpop=S�lectionnez une population
message.common.selectspecies=S�lectionnez une esp�ce
message.common.selectsurvey=S�lectionnez une campagne
message.common.selectzone=S�lectionnez une zone
+message.common.species=Species
message.common.validform=Valider
message.common.zone=Zone
+message.common.zones=Zones
+message.common.datatypes=Type de donn�es
message.documents.genparagraph1=Grands invert�br�s et poissons observ�s par les campagnes scientifiques. Atlas de distribution. Bilan 2008. 2009. {0}
message.documents.genparagraph2=Grands invert�br�s et poissons observ�s par les campagnes scientifiques. Bilan 2007. 2009. {0}
message.documents.genparagraph3=L''�tat des communaut�s exploit�es au large des c�tes de France. Application d''indicateurs � l''�valuation de l''impact de la p�che. Bilan 2004 Edition 2009. {0}
@@ -67,17 +73,21 @@
message.documents.indicatorparagraph1=Dreves L., C. Abernot-Le Gac, E. Antajan, P. Clabaut, P. Claquin, M.L. Cochard, P. Monbet, J. Morin, A. T�tard, C. Warenbourg & H. Thillaye du Boullay, 2010. Synth�se hydrobiologique du site �lectronucl�aire de Penly. Ifremer. DOP/LER/2010.05. 280 p.
message.documents.indicatortitle3=Travaux ayant utilis� les r�sultats du groupe de travail sur les indicateurs de populations et de peuplements
message.documents.title=Documents
-message.index.datatypecom=Des indices de communaut� par zone.
+message.index.datatypecom=Des indices de communaut� par zone
message.index.datatypemap=Des cartes de distribution par esp�ce et par zone
message.index.datatypepop=Des indices biologiques par esp�ce et par zone
message.index.datatypesource=Des donn�es par op�ration d''�chantillonnage (en g�n�ral par trait de chalut)
-message.index.datatypetitle=Quatre types de donn�es sont pr�sent�es
+message.index.datatypesource.short=Des donn�es par op�ration d''�chantillonnage
+message.index.datatypetitle=Consultation des donn�es en ligne
message.index.documentsmessage=Documents
message.index.documentstitle=Documents
+message.index.extractdatatitle=Extraction des donn�es
+message.index.extractdatalink=Formulaire de recherche
message.index.paragraph1=Ce site a �t� con�u pour fournir en libre acc�s des donn�es brutes et des donn�es �labor�es relatives aux campagnes scientifiques d''observation halieutique conduites par l''Ifremer le long des c�tes fran�aises.
message.index.paragraph2=Toutes les donn�es mises � disposition ont fait l''objet de qualification selon des protocoles sp�cifiques. La qualit� des interpr�tations �tant directement li�e � la nature des donn�es source, les utilisateurs de donn�es sont invit�s � consid�rer avec attention les descriptions des protocoles mis en \u0153uvre ainsi que les niveaux de qualit� contr�l�s.
message.index.paragraph3=Chaque s�rie de campagnes est conduite selon une strat�gie d''�chantillonnage sp�cifique. Sauf cas particuliers, les analyses et interpr�tations doivent �tre conduites par s�rie, en prenant en compte les strat�gies d''�chantillonnage propres � chacune de ces s�ries. Sur le site, les donn�es sont pr�sent�es par s�rie.
message.index.paragraph4=Dans les tables de donn�es, toutes les esp�ces sont identifi�es selon le r�f�rentiel taxinomique du Syst�me d''informations halieutiques de l''Ifremer ({0}).
+message.index.paragraph5=Les liens ci-dessous vous permet d''extraire les �l�ments du site (graphique et donn�es) sous la forme d''un fichier .zip (contenant un document pdf et les donn�es)
message.index.partnertitle=Membres du groupe
message.index.partnerparagraph1=Les r�sultats pr�sent�s sur ce site sont le produit de l''activit� d''un groupe de travail de l''Ifremer qui se r�unit chaque ann�e depuis 2001 pour d�velopper des indicateurs de populations et de peuplements � partir des donn�es des s�ries de campagnes halieutiques standardis�es conduites depuis la fin des ann�es 1970 par l''Ifremer le long des c�tes de France m�tropolitaine. Les principaux membres du groupe sont (par ordre alphab�tique de site et de patronyme)\u00A0: Florence Sanchez (Anglet), Franck Coppin, Sandrine Vaz et Yves V�rin (Boulogne-sur-mer), Andr� Battaglia et Jean-Pierre L�aut� (L''Houmeau), Jean-Claude Mah� et Mich�le Salaun (Lorient), Jacques Bertrand, Anik Brind''Amour, Yves D�saunay, Pascal Laffargue, Olivier Le Pape, J�r�my Lobry, Pascal Lorance, Jean-Charles Poulard, Marie-Jo\u00EBlle Rochet et Verena Trenkel (Nantes), Marie-Laure Cochard, Jocelyne Morin et Ivan Schlaich (Port-en-Bessin), Ang�lique Jadaud et Arnaud Souplet (S�te). La d�marche qualit� est g�r�e par Vincent Badts. Le support informatique de gestion des donn�es est assur� par Olivier Berthel�.
message.index.qualitymessage=Avertissement qualit�
@@ -115,6 +125,15 @@
message.quality.paragraph4=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.
message.quality.paragraph5=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 ({0}).
message.quality.title=Avertissement Qualit�
+message.search.extract.extract=Extraire
+message.search.extract.speciesindicators=Esp�ces et indicateurs
+message.search.extract.title=Extraction des donn�es
+message.search.extract.updatelists=Mise � jour des listes
+message.search.extract.waittitle=Extraction en cours...
+message.search.extract.waitparagraph1=Les donn�es sont en cours d'extraction. Merci de patienter.
+message.search.extract.waitparagraph2=Cette op�ration peut prendre plusieurs minute dans le cas ou de nombreux graphiques doivent �tre g�n�r�s.
+message.search.extract.zonetype=Zone et type de donn�es
+message.search.extract.title=Extraction des donn�es
message.source.download=T�l�charger
message.source.paragraph1=Les donn�es de base sont pr�sent�es selon quatre tables fournissant des informations de base �lev�es � l''op�ration d''�chantillonnage (en g�n�ral un trait de chalut) et organis�es selon des unit�s g�ographiques d�finies en relation avec le plan d''�chantillonnage. Une table suppl�mentaire pr�sente le r�f�rentiel taxinomique associ� aux donn�es. Il s''agit des donn�es utilis�es pour r�aliser les calculs des indicateurs pr�sent�s. Ces donn�es ont fait l''objet de filtrages et de regroupements �ventuels par rapport aux donn�es de base de chaque s�rie, afin d''assurer la coh�rence des jeux de donn�es en vue du calcul des indicateurs. Ainsi, pour certaines s�ries, des groupes entiers (e.g. les amphihalins) ont pu �tre retir�s. Pour certaines s�ries, certaines ann�es ou certaines strates ont �t� retir�es afin de pr�server l''homog�n�it� de la s�rie. Dans des cas d''�volution du niveau de d�termination au cours de la s�rie, plusieurs taxons ont �t� regroup�s � un niveau sup�rieur.
message.source.paragraph2=Les donn�es IBTS (donn�es fran�aises et donn�es des autres pays) issues de la base Datras du CIEM (http://datras.ices.dk) ont fait l''objet des m�mes contr�les de qualit� que les autres s�ries de donn�es utilis�es, ainsi que de filtrages et de regroupements taxinomiques pour en pr�server la coh�rence vis-�-vis du pr�sent objectif de production d''indicateurs de tendances.
Modified: trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties
===================================================================
--- trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties 2012-11-16 15:25:34 UTC (rev 1084)
@@ -39,17 +39,23 @@
message.com.selectindicatorlist=S�lectionner une liste de donn�es
message.com.title=Indices de communaut�s
message.common.anchortop=Haut
+message.common.community=communaut�
message.common.facade=Facade
+message.common.indicatorsof=Indicateurs de
message.common.jsreadmore=Voir la suite
message.common.noresults=Aucun r�sultat disponible.
+message.common.population=population
message.common.selectfacade=S�lectionnez une fa�ade
message.common.selectindicator=S�lectionnez un indicateur
message.common.selectpop=S�lectionnez une population
message.common.selectspecies=S�lectionnez une esp�ce
message.common.selectsurvey=S�lectionnez une campagne
message.common.selectzone=S�lectionnez une zone
+message.common.species=Esp�ces
message.common.validform=Valider
message.common.zone=Zone
+message.common.zones=Zones
+message.common.datatypes=Type de donn�es
message.documents.genparagraph1=Grands invert�br�s et poissons observ�s par les campagnes scientifiques. Atlas de distribution. Bilan 2008. 2009. {0}
message.documents.genparagraph2=Grands invert�br�s et poissons observ�s par les campagnes scientifiques. Bilan 2007. 2009. {0}
message.documents.genparagraph3=L''�tat des communaut�s exploit�es au large des c�tes de France. Application d''indicateurs � l''�valuation de l''impact de la p�che. Bilan 2004 Edition 2009. {0}
@@ -67,17 +73,21 @@
message.documents.indicatorparagraph1=Dreves L., C. Abernot-Le Gac, E. Antajan, P. Clabaut, P. Claquin, M.L. Cochard, P. Monbet, J. Morin, A. T�tard, C. Warenbourg & H. Thillaye du Boullay, 2010. Synth�se hydrobiologique du site �lectronucl�aire de Penly. Ifremer. DOP/LER/2010.05. 280 p.
message.documents.indicatortitle3=Travaux ayant utilis� les r�sultats du groupe de travail sur les indicateurs de populations et de peuplements
message.documents.title=Documents
-message.index.datatypecom=Des indices de communaut� par zone.
+message.index.datatypecom=Des indices de communaut� par zone
message.index.datatypemap=Des cartes de distribution par esp�ce et par zone
message.index.datatypepop=Des indices biologiques par esp�ce et par zone
message.index.datatypesource=Des donn�es par op�ration d''�chantillonnage (en g�n�ral par trait de chalut)
-message.index.datatypetitle=Quatre types de donn�es sont pr�sent�es
+message.index.datatypesource.short=Des donn�es par op�ration d''�chantillonnage
+message.index.datatypetitle=Consultation des donn�es en ligne
message.index.documentsmessage=Documents
message.index.documentstitle=Documents
+message.index.extractdatatitle=Extraction des donn�es
+message.index.extractdatalink=Formulaire de recherche
message.index.paragraph1=Ce site a �t� con�u pour fournir en libre acc�s des donn�es brutes et des donn�es �labor�es relatives aux campagnes scientifiques d''observation halieutique conduites par l''Ifremer le long des c�tes fran�aises.
message.index.paragraph2=Toutes les donn�es mises � disposition ont fait l''objet de qualification selon des protocoles sp�cifiques. La qualit� des interpr�tations �tant directement li�e � la nature des donn�es source, les utilisateurs de donn�es sont invit�s � consid�rer avec attention les descriptions des protocoles mis en \u0153uvre ainsi que les niveaux de qualit� contr�l�s.
message.index.paragraph3=Chaque s�rie de campagnes est conduite selon une strat�gie d''�chantillonnage sp�cifique. Sauf cas particuliers, les analyses et interpr�tations doivent �tre conduites par s�rie, en prenant en compte les strat�gies d''�chantillonnage propres � chacune de ces s�ries. Sur le site, les donn�es sont pr�sent�es par s�rie.
message.index.paragraph4=Dans les tables de donn�es, toutes les esp�ces sont identifi�es selon le r�f�rentiel taxinomique du Syst�me d''informations halieutiques de l''Ifremer ({0}).
+message.index.paragraph5=Les liens ci-dessous vous permet d''extraire les �l�ments du site (graphique et donn�es) sous la forme d''un fichier .zip (contenant un document pdf et les donn�es)
message.index.partnertitle=Membres du groupe
message.index.partnerparagraph1=Les r�sultats pr�sent�s sur ce site sont le produit de l''activit� d''un groupe de travail de l''Ifremer qui se r�unit chaque ann�e depuis 2001 pour d�velopper des indicateurs de populations et de peuplements � partir des donn�es des s�ries de campagnes halieutiques standardis�es conduites depuis la fin des ann�es 1970 par l''Ifremer le long des c�tes de France m�tropolitaine. Les principaux membres du groupe sont (par ordre alphab�tique de site et de patronyme)\u00A0: Florence Sanchez (Anglet), Franck Coppin, Sandrine Vaz et Yves V�rin (Boulogne-sur-mer), Andr� Battaglia et Jean-Pierre L�aut� (L''Houmeau), Jean-Claude Mah� et Mich�le Salaun (Lorient), Jacques Bertrand, Anik Brind''Amour, Yves D�saunay, Pascal Laffargue, Olivier Le Pape, J�r�my Lobry, Pascal Lorance, Jean-Charles Poulard, Marie-Jo\u00EBlle Rochet et Verena Trenkel (Nantes), Marie-Laure Cochard, Jocelyne Morin et Ivan Schlaich (Port-en-Bessin), Ang�lique Jadaud et Arnaud Souplet (S�te). La d�marche qualit� est g�r�e par Vincent Badts. Le support informatique de gestion des donn�es est assur� par Olivier Berthel�.
message.index.qualitymessage=Avertissement qualit�
@@ -115,6 +125,14 @@
message.quality.paragraph4=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.
message.quality.paragraph5=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 ({0}).
message.quality.title=Avertissement Qualit�
+message.search.extract.extract=Extraire
+message.search.extract.speciesindicators=Esp�ces et indicateurs
+message.search.extract.title=Extraction des donn�es
+message.search.extract.updatelists=Mise � jour des listes
+message.search.extract.waittitle=Extraction en cours...
+message.search.extract.waitparagraph1=Les donn�es sont en cours d''extraction. Merci de patienter.
+message.search.extract.waitparagraph2=Cette op�ration peut prendre plusieurs minute dans le cas o� de nombreux graphiques doivent �tre g�n�r�s.
+message.search.extract.zonetype=Zone et type de donn�es
message.source.download=T�l�charger
message.source.paragraph1=Les donn�es de base sont pr�sent�es selon quatre tables fournissant des informations de base �lev�es � l''op�ration d''�chantillonnage (en g�n�ral un trait de chalut) et organis�es selon des unit�s g�ographiques d�finies en relation avec le plan d''�chantillonnage. Une table suppl�mentaire pr�sente le r�f�rentiel taxinomique associ� aux donn�es. Il s''agit des donn�es utilis�es pour r�aliser les calculs des indicateurs pr�sent�s. Ces donn�es ont fait l''objet de filtrages et de regroupements �ventuels par rapport aux donn�es de base de chaque s�rie, afin d''assurer la coh�rence des jeux de donn�es en vue du calcul des indicateurs. Ainsi, pour certaines s�ries, des groupes entiers (e.g. les amphihalins) ont pu �tre retir�s. Pour certaines s�ries, certaines ann�es ou certaines strates ont �t� retir�es afin de pr�server l''homog�n�it� de la s�rie. Dans des cas d''�volution du niveau de d�termination au cours de la s�rie, plusieurs taxons ont �t� regroup�s � un niveau sup�rieur.
message.source.paragraph2=Les donn�es IBTS (donn�es fran�aises et donn�es des autres pays) issues de la base Datras du CIEM (http://datras.ices.dk) ont fait l''objet des m�mes contr�les de qualit� que les autres s�ries de donn�es utilis�es, ainsi que de filtrages et de regroupements taxinomiques pour en pr�server la coh�rence vis-�-vis du pr�sent objectif de production d''indicateurs de tendances.
Modified: trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/index.jsp 2012-11-16 15:25:34 UTC (rev 1084)
@@ -36,6 +36,9 @@
<p>
<h2><s:text name="message.index.datatypetitle" /></h2>
+ <s:text name="message.index.paragraph4">
+ <s:param><a href="http://sih.ifremer.fr/">sih.ifremer.fr</a></s:param>
+ </s:text>
<ul class="datalist">
<li><s:a action="facade" namespace='/map'><s:text name="message.index.datatypemap" /></s:a></li>
<li><s:a action="facade" namespace='/pop'><s:text name="message.index.datatypepop" /></s:a></li>
@@ -45,9 +48,11 @@
</p>
<p>
- <s:text name="message.index.paragraph4">
- <s:param><a href="http://sih.ifremer.fr/">sih.ifremer.fr</a></s:param>
- </s:text>
+ <h2><s:text name="message.index.extractdatatitle" /></h2>
+ <p><s:text name="message.index.paragraph5" /></p>
+ <s:a action="extract" namespace="/search">
+ <s:text name="message.index.extractdatalink" />
+ </s:a>
</p>
<p>
Added: trunk/coser-web/src/main/webapp/WEB-INF/content/search/extract-input.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/search/extract-input.jsp (rev 0)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/search/extract-input.jsp 2012-11-16 15:25:34 UTC (rev 1084)
@@ -0,0 +1,168 @@
+<!--
+ #%L
+ Coser :: Web
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2012 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.search.extract.title" /></title>
+ </head>
+ <body>
+
+ <form action="<s:url action="extract" />" method="post">
+
+ <h2><s:text name="message.search.extract.zonetype" /></h2>
+
+ <table style="width:100%">
+ <tr>
+ <td><s:text name="message.common.zones" /> :</td>
+ <td>
+ <select name="selectZones" multiple="multiple" style="width:100%" id="selectZones">
+ <s:iterator value="zones" var="zone">
+ <option value="<s:property value="key" />"
+ <s:if test="selectZones.contains(#zone.key)">
+ selected="selected"
+ </s:if>>
+ <s:property value="value" /></option>
+ </s:iterator>
+ </select></td>
+ <td style="vertical-align:top">
+ <img src="<s:url value='/images/stock_select_table.png' />"
+ onClick="javascript:coserSelectAll($('#selectZones'))" />
+ <br />
+ <img src="<s:url value='/images/stock_select_clear.png' />"
+ onClick="javascript:coserUnSelectAll($('#selectZones'))" /></td>
+ </tr>
+ <tr>
+ <td><s:text name="message.common.datatypes" /> :</td>
+ <td>
+ <select name="selectTypes" multiple="multiple" style="width:100%" id="selectTypes">
+ <option value="<s:property value="@fr.ifremer.coser.util.DataType@MAP" />"
+ <s:if test="selectTypes.contains(@fr.ifremer.coser.util.DataType@MAP)">
+ selected="selected"
+ </s:if>>
+ <s:text name="message.index.datatypemap" /></option>
+ <option value="<s:property value="@fr.ifremer.coser.util.DataType@POPULATION" />"
+ <s:if test="selectTypes.contains(@fr.ifremer.coser.util.DataType@POPULATION)">
+ selected="selected"
+ </s:if>>
+ <s:text name="message.index.datatypepop" /></option>
+ <option value="<s:property value="@fr.ifremer.coser.util.DataType@COMMUNITY" />"
+ <s:if test="selectTypes.contains(@fr.ifremer.coser.util.DataType@COMMUNITY)">
+ selected="selected"
+ </s:if>>
+ <s:text name="message.index.datatypecom" /></option>
+ <option value="<s:property value="@fr.ifremer.coser.util.DataType@SOURCE" />"
+ <s:if test="selectTypes.contains(@fr.ifremer.coser.util.DataType@SOURCE)">
+ selected="selected"
+ </s:if>>
+ <s:text name="message.index.datatypesource.short" /></option>
+ </select></td>
+ <td style="vertical-align:top">
+ <img src="<s:url value='/images/stock_select_table.png' />"
+ onClick="javascript:coserSelectAll($('#selectTypes'))" />
+ <br />
+ <img src="<s:url value='/images/stock_select_clear.png' />"
+ onClick="javascript:coserUnSelectAll($('#selectTypes'))" /></td>
+ </tr>
+ <tr>
+ <td colspan="2"><s:submit value="%{getText('message.search.extract.updatelists')}" /></td>
+ </tr>
+ </table>
+
+ <s:if test="!selectZones.empty">
+ <h2><s:text name="message.search.extract.speciesindicators" /></h2>
+
+ <table style="width:100%">
+ <tr>
+ <td><s:text name="message.common.species" /> :</td>
+ <td>
+ <select name="selectSpecies" multiple="multiple" style="width:100%" size="10" id="selectSpecies">
+ <s:iterator value="species" var="specy">
+ <option value="<s:property value="key" />"
+ <s:if test="selectSpecies.contains(#specy.key)">
+ selected="selected"
+ </s:if>>
+ <s:property value="value" /></option>
+ </s:iterator>
+ </select></td>
+ <td style="vertical-align:top">
+ <img src="<s:url value='/images/stock_select_table.png' />"
+ onClick="javascript:coserSelectAll($('#selectSpecies'))" />
+ <br />
+ <img src="<s:url value='/images/stock_select_clear.png' />"
+ onClick="javascript:coserUnSelectAll($('#selectSpecies'))" /></td>
+ </tr>
+ <s:if test="comIndicators.size() != 0">
+ <tr>
+ <td><s:text name="message.common.indicatorsof" /><br />
+ <s:text name="message.common.community" /> :</td>
+ <td>
+ <select name="selectComIndicators" multiple="multiple" style="width:100%" size="10" id="selectComIndicators">
+ <s:iterator value="comIndicators" var="comIndicator">
+ <option value="<s:property value="key" />"
+ <s:if test="selectComIndicators.contains(#comIndicator.key)">
+ selected="selected"
+ </s:if>>
+ <s:property value="value" /></option>
+ </s:iterator>
+ </select></td>
+ <td style="vertical-align:top">
+ <img src="<s:url value='/images/stock_select_table.png' />"
+ onClick="javascript:coserSelectAll($('#selectComIndicators'))" />
+ <br />
+ <img src="<s:url value='/images/stock_select_clear.png' />"
+ onClick="javascript:coserUnSelectAll($('#selectComIndicators'))" /></td>
+ </tr>
+ </s:if>
+ <s:if test="popIndicators.size() != 0">
+ <tr>
+ <td><s:text name="message.common.indicatorsof" /><br />
+ <s:text name="message.common.population" /> :</td>
+ <td>
+ <select name="selectPopIndicators" multiple="multiple" style="width:100%" size="10" id="selectPopIndicators">
+ <s:iterator value="popIndicators" var="popIndicator">
+ <option value="<s:property value="key" />"
+ <s:if test="selectPopIndicators.contains(#popIndicator.key)">
+ selected="selected"
+ </s:if>>
+ <s:property value="value" /></option>
+ </s:iterator>
+ </select></td>
+ <td style="vertical-align:top">
+ <img src="<s:url value='/images/stock_select_table.png' />"
+ onClick="javascript:coserSelectAll($('#selectPopIndicators'))" />
+ <br />
+ <img src="<s:url value='/images/stock_select_clear.png' />"
+ onClick="javascript:coserUnSelectAll($('#selectPopIndicators'))" /></td>
+ </tr>
+ </s:if>
+ <tr>
+ <td colspan="2"><s:submit name="submitAction" value="%{getText('message.search.extract.extract')}" /></td>
+ </tr>
+ </table>
+ </s:if>
+ </form>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/coser-web/src/main/webapp/WEB-INF/content/search/extract-success.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/search/extract-success.jsp (rev 0)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/search/extract-success.jsp 2012-11-16 15:25:34 UTC (rev 1084)
@@ -0,0 +1,69 @@
+<!--
+ #%L
+ Coser :: Web
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2012 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.search.extract.title" /></title>
+ </head>
+ <body>
+
+ <h2><s:text name="message.search.extract.title" /></h2>
+
+ <h3><s:text name="message.quality.title" /></h3>
+
+ <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><a href="mailto:<s:property value='adminEmail' />"><s:property value='adminEmail' /></a></s:param>
+ </s:text>
+ </p>
+
+ <s:form action="extract-quality" method="post">
+ <s:iterator value="selectZones">
+ <input type="hidden" name="selectZones" value="<s:property />" />
+ </s:iterator>
+ <s:iterator value="selectTypes">
+ <input type="hidden" name="selectTypes" value="<s:property />" />
+ </s:iterator>
+ <s:iterator value="selectSpecies">
+ <input type="hidden" name="selectSpecies" value="<s:property />" />
+ </s:iterator>
+ <s:iterator value="selectPopIndicators">
+ <input type="hidden" name="selectPopIndicators" value="<s:property />" />
+ </s:iterator>
+ <s:iterator value="selectComIndicators">
+ <input type="hidden" name="selectComIndicators" value="<s:property />" />
+ </s:iterator>
+ <s:checkbox name="accepted" fieldValue="true" label="%{getText('message.quality.acceptance')}"/>
+ <s:submit value="%{getText('message.source.download')}"></s:submit>
+ </s:form>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/coser-web/src/main/webapp/WEB-INF/content/search/extract-wait.jsp
===================================================================
--- trunk/coser-web/src/main/webapp/WEB-INF/content/search/extract-wait.jsp (rev 0)
+++ trunk/coser-web/src/main/webapp/WEB-INF/content/search/extract-wait.jsp 2012-11-16 15:25:34 UTC (rev 1084)
@@ -0,0 +1,40 @@
+<!--
+ #%L
+ Coser :: Web
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2012 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.search.extract.title" /></title>
+ <meta http-equiv="refresh" content="5;url=<s:url includeParams="all" />"/>
+ </head>
+ <body>
+
+ <h2><s:text name="message.search.extract.title" /></h2>
+
+ <h3><s:text name="message.search.extract.waittitle" /></h3>
+ <p><s:text name="message.search.extract.waitparagraph1" /></p>
+ <p><s:text name="message.search.extract.waitparagraph2" /></p>
+ </body>
+</html>
\ No newline at end of file
Added: trunk/coser-web/src/main/webapp/images/stock_select_clear.png
===================================================================
(Binary files differ)
Property changes on: trunk/coser-web/src/main/webapp/images/stock_select_clear.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: trunk/coser-web/src/main/webapp/images/stock_select_table.png
===================================================================
(Binary files differ)
Property changes on: trunk/coser-web/src/main/webapp/images/stock_select_table.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Modified: trunk/coser-web/src/main/webapp/js/coser.js
===================================================================
--- trunk/coser-web/src/main/webapp/js/coser.js 2012-11-14 10:49:43 UTC (rev 1083)
+++ trunk/coser-web/src/main/webapp/js/coser.js 2012-11-16 15:25:34 UTC (rev 1084)
@@ -28,3 +28,13 @@
// affiche la carte selectionnee
$('#' + prefix + $(select).val()).show();
}
+
+// selection tous les elements d'un select
+function coserSelectAll(select) {
+ $(select).children("option").prop('selected',true);
+}
+
+// deselection tous les elements d'un select
+function coserUnSelectAll(select) {
+ $(select).children("option").prop('selected',false);
+}
1
0
r1083 - trunk/coser-web/src/main/webapp/images/zones
by echatellier@users.forge.codelutin.com 14 Nov '12
by echatellier@users.forge.codelutin.com 14 Nov '12
14 Nov '12
Author: echatellier
Date: 2012-11-14 11:49:43 +0100 (Wed, 14 Nov 2012)
New Revision: 1083
Url: http://forge.codelutin.com/repositories/revision/coser/1083
Log:
Wrong commit
Removed:
trunk/coser-web/src/main/webapp/images/zones/es.png
Deleted: trunk/coser-web/src/main/webapp/images/zones/es.png
===================================================================
(Binary files differ)
1
0
Author: echatellier
Date: 2012-11-14 11:19:36 +0100 (Wed, 14 Nov 2012)
New Revision: 1082
Url: http://forge.codelutin.com/repositories/revision/coser/1082
Log:
Update to itextpdf 5.3.4
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-10-30 09:50:42 UTC (rev 1081)
+++ trunk/pom.xml 2012-11-14 10:19:36 UTC (rev 1082)
@@ -270,7 +270,7 @@
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
- <version>5.3.2</version>
+ <version>5.3.4</version>
<scope>compile</scope>
</dependency>
1
0