Author: chatellier Date: 2011-01-19 18:23:34 +0000 (Wed, 19 Jan 2011) New Revision: 531 Log: Telechargement des donn?\195?\169es des graphs. Generation des grah ordon?\195?\169 et avec trou. Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/com/GraphCsvAction.java trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/GraphCsvAction.java Modified: 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-web/src/main/java/fr/ifremer/coser/web/actions/com/GraphDataAction.java trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package.properties trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties trunk/coser-web/src/main/webapp/WEB-INF/content/com/graph.jsp trunk/coser-web/src/main/webapp/WEB-INF/content/com/indicator.jsp trunk/coser-web/src/main/webapp/WEB-INF/content/pop/graph.jsp trunk/coser-web/src/main/webapp/WEB-INF/decorators/layout.jsp 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 2011-01-19 10:16:47 UTC (rev 530) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/PublicationService.java 2011-01-19 18:23:34 UTC (rev 531) @@ -42,6 +42,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.SortedMap; import java.util.TreeMap; import org.apache.commons.collections.CollectionUtils; @@ -84,6 +85,7 @@ import fr.ifremer.coser.data.Catch; import fr.ifremer.coser.data.Length; import fr.ifremer.coser.storage.DataStorage; +import fr.ifremer.coser.storage.MemoryDataStorage; /** * Publication service (charts, reports, export, pdf...) @@ -648,24 +650,62 @@ } /** - * @param resultDirectory - * @param rsufiResult - * @param locale - * @return + * Retourne le nom d'affichage d'une especes. + * + * @param project project + * @param species species code + * @return species display name + */ + protected String getSpeciesDisplayName(Project project, String species) { + String displayName = null; + + // load reftax in memory + Iterator<String[]> reftax = project.getRefTaxSpecies().iterator(true); + while (reftax.hasNext()) { + String[] tuple = reftax.next(); + + // "C_Perm","NumSys","NivSys","C_VALIDE","L_VALIDE","AA_VALIDE","C_TxP\u00E8re","Taxa" + String speciesCode = tuple[3]; + if (speciesCode.equals(species)) { + // nom + auteur (sans ajout de parenthese : important) + displayName = tuple[4] + " " + tuple[5]; + break; + } + } + + return displayName; + } + + /** + * Generate community graph for selected indicator. + * Used by web ui. + * + * @param project project + * @param resultDirectory result directory + * @param rsufiResult rsufiresult + * @param indicator indicator + * @param indicatorName indicatorName localized + * @return generated graph image (temp file) * @throws CoserBusinessException */ - public File getRsufiResultComChart(File resultDirectory, - RSufiResult rsufiResult, String indicator, String locale) throws CoserBusinessException { + public File getRsufiResultComChart(Project project, File resultDirectory, + RSufiResult rsufiResult, String indicator, String indicatorName) throws CoserBusinessException { File result = null; + // get graph title + String title = projectService.getProjectSurveyName(resultDirectory, rsufiResult); + title += " - " + indicatorName; + // le fichier estcomind File estComIndFile = new File(resultDirectory, rsufiResult.getEstComIndName()); // Campagne Indicateur Liste Strate Annee Estimation EcartType CV DataStorage dataStorage = importService.loadCSVFile(estComIndFile, CoserConstants.CSV_RESULT_SEPARATOR_CHAR); - DefaultStatisticalCategoryDataset statisticalDataset = new DefaultStatisticalCategoryDataset(); + int minYear = Integer.MAX_VALUE; + int maxYear = Integer.MIN_VALUE; + Map<Integer, Double[]> graphData = new HashMap<Integer, Double[]>(); Iterator<String[]> estPopIndIterator = dataStorage.iterator(true); while (estPopIndIterator.hasNext()) { String[] tuple = estPopIndIterator.next(); @@ -674,17 +714,36 @@ if (indicatorCode.equals(indicator)) { Double estimation = Double.parseDouble(tuple[5]); Double ecart = Double.parseDouble(tuple[6]); - String year = tuple[4]; - statisticalDataset.add(estimation, ecart, "Serie1", year); + int year = Integer.parseInt(tuple[4]); + + if (year < minYear) { + minYear = year; + } + if (year > maxYear) { + maxYear = year; + } + graphData.put(year, new Double[]{estimation, ecart}); } } + // generate dataset with sorted data + DefaultStatisticalCategoryDataset statisticalDataset = new DefaultStatisticalCategoryDataset(); + for (int indexYear = minYear ; indexYear <= maxYear ; ++indexYear) { + Double[] entry = graphData.get(indexYear); + if (entry != null) { + statisticalDataset.add(entry[0], entry[1], "Serie1", (Comparable)indexYear); + } + else { + statisticalDataset.add(null, null, "Serie1", (Comparable)indexYear); + } + } + // configure chart CategoryAxis categoryAxis = new CategoryAxis(_("coser.business.common.year")); categoryAxis.setCategoryMargin(0); + categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90); // label horizontaux - categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90); - ValueAxis valueAxis = new NumberAxis(_("coser.business.common.number")); + ValueAxis valueAxis = new NumberAxis(indicatorName); valueAxis.setUpperMargin(0.1); CategoryItemRenderer renderer = new StatisticalLineAndShapeRenderer(false, true); @@ -696,9 +755,12 @@ CategoryPlot plot = new CategoryPlot(statisticalDataset, categoryAxis, valueAxis, renderer); plot.setOrientation(PlotOrientation.VERTICAL); - JFreeChart chart = new JFreeChart("Titre", + JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, true); + // remove series legend + chart.removeLegend(); + try { result = File.createTempFile("coser-", ".chart"); result.deleteOnExit(); @@ -711,26 +773,36 @@ } /** - * @param resultDirectory - * @param rsufiResult - * @param species - * @param indicator - * @param locale - * @return + * 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 indicatorName indicatorName localized + * @return generated image file (temp file) * @throws CoserBusinessException */ - public File getRsufiResultPopChart(File resultDirectory, - RSufiResult rsufiResult, String species, String indicator, String locale) throws CoserBusinessException { + public File getRsufiResultPopChart(Project project, File resultDirectory, + RSufiResult rsufiResult, String species, String indicator, String indicatorName) throws CoserBusinessException { File result = null; + // get graph title + String title = projectService.getProjectSurveyName(resultDirectory, rsufiResult); + title += " - " + indicatorName; + title += " - " + getSpeciesDisplayName(project, species); + // le fichier estcomind File estPopIndFile = new File(resultDirectory, rsufiResult.getEstPopIndName()); // Campagne Indicateur Liste Species Strate Annee Estimation EcartType CV DataStorage dataStorage = importService.loadCSVFile(estPopIndFile, CoserConstants.CSV_RESULT_SEPARATOR_CHAR); - DefaultStatisticalCategoryDataset statisticalDataset = new DefaultStatisticalCategoryDataset(); + int minYear = Integer.MAX_VALUE; + int maxYear = Integer.MIN_VALUE; + Map<Integer, Double[]> graphData = new HashMap<Integer, Double[]>(); Iterator<String[]> estPopIndIterator = dataStorage.iterator(true); while (estPopIndIterator.hasNext()) { String[] tuple = estPopIndIterator.next(); @@ -740,21 +812,40 @@ if (speciesCode.equals(species) && indicatorCode.equals(indicator)) { Double estimation = Double.parseDouble(tuple[6]); Double ecart = Double.parseDouble(tuple[7]); - String year = tuple[5]; - statisticalDataset.add(estimation, ecart, "Serie1", year); + int year = Integer.parseInt(tuple[5]); + + if (year < minYear) { + minYear = year; + } + if (year > maxYear) { + maxYear = year; + } + graphData.put(year, new Double[]{estimation, ecart}); } } - + + // generate dataset with sorted data + DefaultStatisticalCategoryDataset statisticalDataset = new DefaultStatisticalCategoryDataset(); + for (int indexYear = minYear ; indexYear <= maxYear ; ++indexYear) { + Double[] entry = graphData.get(indexYear); + if (entry != null) { + statisticalDataset.add(entry[0], entry[1], "Serie1", (Comparable)indexYear); + } + else { + statisticalDataset.add(null, null, "Serie1", (Comparable)indexYear); + } + } + // configure chart CategoryAxis categoryAxis = new CategoryAxis(_("coser.business.common.year")); categoryAxis.setCategoryMargin(0); + categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90); // label horizontaux - categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90); - ValueAxis valueAxis = new NumberAxis(_("coser.business.common.number")); + ValueAxis valueAxis = new NumberAxis(indicatorName); 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); @@ -762,9 +853,12 @@ CategoryPlot plot = new CategoryPlot(statisticalDataset, categoryAxis, valueAxis, renderer); plot.setOrientation(PlotOrientation.VERTICAL); - JFreeChart chart = new JFreeChart("Titre", + JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, true); - + + // remove series legend + chart.removeLegend(); + try { result = File.createTempFile("coser-", ".chart"); result.deleteOnExit(); @@ -775,5 +869,98 @@ return result; } - + + /** + * Genere un sous fichier CSV (qui contient un sous ensemble de estPopInd) + * et qui a servit a generer le graphique. + * + * @param resultDirectory result directory + * @param rsufiResult rsufi result + * @param indicator indicator + * @return generated csv file (temp file) + * @throws CoserBusinessException + */ + public File getRsufiResultComChartData(File resultDirectory, + RSufiResult rsufiResult, String indicator) throws CoserBusinessException { + + File result = null; + + try { + result = File.createTempFile("coser-", ".csv"); + + // le fichier estcomind + File estComIndFile = new File(resultDirectory, rsufiResult.getEstComIndName()); + + // Campagne Indicateur Liste Strate Annee Estimation EcartType CV + DataStorage dataStorage = importService.loadCSVFile(estComIndFile, CoserConstants.CSV_RESULT_SEPARATOR_CHAR); + DataStorage subDataStorage = new MemoryDataStorage(); + Iterator<String[]> estComIndIterator = dataStorage.iterator(); + // manage header + String[] headers = estComIndIterator.next(); + subDataStorage.add(headers); + + while (estComIndIterator.hasNext()) { + String[] tuple = estComIndIterator.next(); + + String indicatorCode = tuple[1]; + if (indicatorCode.equals(indicator)) { + subDataStorage.add(tuple); + } + } + + importService.storeDataWhithoutQuote(subDataStorage, result); + } catch (IOException ex) { + throw new CoserBusinessException("Can't save csv file", ex); + } + + return result; + } + + /** + * Genere un sous fichier CSV (qui contient un sous ensemble de estPopInd) + * et qui a servit a generer le graphique. + * + * @param resultDirectory result directory + * @param rsufiResult rsufi result + * @param species species + * @param indicator indicator + * @return generated csv file (temp file) + * @throws CoserBusinessException + */ + public File getRsufiResultPopChartData(File resultDirectory, + RSufiResult rsufiResult, String species, String indicator) throws CoserBusinessException { + + File result = null; + + try { + result = File.createTempFile("coser-", ".csv"); + + // le fichier estcomind + File estPopIndFile = new File(resultDirectory, rsufiResult.getEstPopIndName()); + + // Campagne Indicateur Liste Species Strate Annee Estimation EcartType CV + DataStorage dataStorage = importService.loadCSVFile(estPopIndFile, CoserConstants.CSV_RESULT_SEPARATOR_CHAR); + DataStorage subDataStorage = new MemoryDataStorage(); + Iterator<String[]> estPopIndIterator = dataStorage.iterator(); + // manage header + String[] headers = estPopIndIterator.next(); + subDataStorage.add(headers); + + while (estPopIndIterator.hasNext()) { + String[] tuple = estPopIndIterator.next(); + + String speciesCode = tuple[3]; + String indicatorCode = tuple[1]; + if (speciesCode.equals(species) && indicatorCode.equals(indicator)) { + subDataStorage.add(tuple); + } + } + + importService.storeDataWhithoutQuote(subDataStorage, result); + } catch (IOException ex) { + throw new CoserBusinessException("Can't save csv file", ex); + } + + return result; + } } Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java =================================================================== --- trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java 2011-01-19 10:16:47 UTC (rev 530) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java 2011-01-19 18:23:34 UTC (rev 531) @@ -1369,11 +1369,17 @@ // extraction des especes pour le résultat demandé if (rsufiResult.getZone() != null && rsufiResult.getZone().equals(zone)) { + // load project (without data to get reftax data) + Project project = projectService.openProject(projectFile.getName(), projectsDirectory); + String indicatorName = (String)indicatorsMap.get(indicator, locale); + if (species == null) { - result = publicationService.getRsufiResultComChart(resultFile, rsufiResult, indicator, locale); + // title = surveyName - indicateur + result = publicationService.getRsufiResultComChart(project, resultFile, rsufiResult, indicator, indicatorName); } else { - result = publicationService.getRsufiResultPopChart(resultFile, rsufiResult, species, indicator, locale); + // title = surveyName - indicateur - species + result = publicationService.getRsufiResultPopChart(project, resultFile, rsufiResult, species, indicator, indicatorName); } break; } @@ -1389,7 +1395,69 @@ 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 indicator indicator + * @param locale locale ({@code fr} ou {@code en}) + * @return la liste des indicateurs + * @throws CoserBusinessException + */ + public File getChartData(String zone, String species, String indicator, String locale) throws CoserBusinessException { + File result = null; + // parcours des resultats disponibles + File projectsDirectory = config.getWebProjectsDirectory(); + 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.getZone() != null && rsufiResult.getZone().equals(zone)) { + + if (species == null) { + // title = surveyName - indicateur + result = publicationService.getRsufiResultComChartData(resultFile, rsufiResult, indicator); + } + else { + // title = surveyName - indicateur - species + result = publicationService.getRsufiResultPopChartData(resultFile, rsufiResult, species, indicator); + } + break; + } + } + } + } + } + } + } + } + } + } + + return result; + } + /** * Recupere le fichier image de la carte demandées en fonction de la zone * et de l'espece. Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/com/GraphCsvAction.java =================================================================== --- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/com/GraphCsvAction.java (rev 0) +++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/com/GraphCsvAction.java 2011-01-19 18:23:34 UTC (rev 531) @@ -0,0 +1,104 @@ +/* + * #%L + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2010 - 2011 Ifremer, Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +package fr.ifremer.coser.web.actions.com; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.Locale; + +import org.apache.struts2.convention.annotation.Action; +import org.apache.struts2.convention.annotation.Result; + +import com.opensymphony.xwork2.ActionSupport; + +import fr.ifremer.coser.CoserBusinessException; +import fr.ifremer.coser.services.WebService; +import fr.ifremer.coser.web.CoserWebException; +import fr.ifremer.coser.web.ServiceFactory; + +/** + * Télécharge les données qui ont servi a généré le graph au format CSV. + * + * Parametre : zone, species, indicator. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class GraphCsvAction extends ActionSupport { + + /** serialVersionUID. */ + private static final long serialVersionUID = 3385467755357775199L; + + protected String zone; + + protected String indicator; + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getIndicator() { + return indicator; + } + + public void setIndicator(String indicator) { + this.indicator = indicator; + } + + @Action(results= {@Result(type="stream", params={"contentType", "text/csv", "inputName", "inputStream", "contentDisposition", "attachment; filename=\"${filename}\""})}) + public String execute() { + return SUCCESS; + } + + public String getFilename() { + return indicator + ".csv"; + } + + public InputStream getInputStream() { + WebService webService = ServiceFactory.getWebService(); + + Locale locale = getLocale(); + String localeCode = locale.getLanguage(); + + InputStream input = null; + try { + File mapImage = webService.getChartData(zone, null, indicator, localeCode); + input = new FileInputStream(mapImage); + } catch (CoserBusinessException ex) { + throw new CoserWebException("Can't get map file", ex); + } catch (FileNotFoundException ex) { + throw new CoserWebException("Can't get map file", ex); + } + + return input; + } +} Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/com/GraphCsvAction.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/com/GraphDataAction.java =================================================================== --- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/com/GraphDataAction.java 2011-01-19 10:16:47 UTC (rev 530) +++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/com/GraphDataAction.java 2011-01-19 18:23:34 UTC (rev 531) @@ -41,7 +41,7 @@ /** * Affiche le graphique demandé. * - * Parametre : zone, species, indicator. + * Parametre : zone, indicator. * * @author chatellier * @version $Revision$ @@ -58,8 +58,6 @@ protected String indicator; - protected String chartUrl; - public String getZone() { return zone; } Added: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/GraphCsvAction.java =================================================================== --- trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/GraphCsvAction.java (rev 0) +++ trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/GraphCsvAction.java 2011-01-19 18:23:34 UTC (rev 531) @@ -0,0 +1,114 @@ +/* + * #%L + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2010 - 2011 Ifremer, Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +package fr.ifremer.coser.web.actions.pop; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.util.Locale; + +import org.apache.struts2.convention.annotation.Action; +import org.apache.struts2.convention.annotation.Result; + +import com.opensymphony.xwork2.ActionSupport; + +import fr.ifremer.coser.CoserBusinessException; +import fr.ifremer.coser.services.WebService; +import fr.ifremer.coser.web.CoserWebException; +import fr.ifremer.coser.web.ServiceFactory; + +/** + * Télécharge les données qui ont servi a généré le graph au format CSV. + * + * Parametre : zone, species, indicator. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class GraphCsvAction extends ActionSupport { + + /** serialVersionUID. */ + private static final long serialVersionUID = 3385467755357775199L; + + protected String zone; + + protected String species; + + protected String indicator; + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getIndicator() { + return indicator; + } + + public void setIndicator(String indicator) { + this.indicator = indicator; + } + + public String getSpecies() { + return species; + } + + public void setSpecies(String species) { + this.species = species; + } + + @Action(results= {@Result(type="stream", params={"contentType", "text/csv", "inputName", "inputStream", "contentDisposition", "attachment; filename=\"${filename}\""})}) + public String execute() { + return SUCCESS; + } + + public String getFilename() { + return indicator + ".csv"; + } + + public InputStream getInputStream() { + WebService webService = ServiceFactory.getWebService(); + + Locale locale = getLocale(); + String localeCode = locale.getLanguage(); + + InputStream input = null; + try { + File mapImage = webService.getChartData(zone, null, indicator, localeCode); + input = new FileInputStream(mapImage); + } catch (CoserBusinessException ex) { + throw new CoserWebException("Can't get map file", ex); + } catch (FileNotFoundException ex) { + throw new CoserWebException("Can't get map file", ex); + } + + return input; + } +} Property changes on: trunk/coser-web/src/main/java/fr/ifremer/coser/web/actions/pop/GraphCsvAction.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Modified: trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package.properties =================================================================== --- trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package.properties 2011-01-19 10:16:47 UTC (rev 530) +++ trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package.properties 2011-01-19 18:23:34 UTC (rev 531) @@ -23,6 +23,7 @@ ### message.com.title=Indices de communaut\u00E9s message.com.paragraph1=Des indices de communaut\u00E9 sont calcul\u00E9s pour un ensemble d''esp\u00E8ces dans chaque s\u00E9rie. La liste des esp\u00E8ces incluses pour le calcul de chaque indice varie selon les donn\u00E9es disponibles pour la r\u00E9alisation des calculs. +message.com.downloadascsv=Download as CSV message.layout.title=Populations and communities indices, resulting from Ifremer monitoring halieutics survey message.layout.oceanicdatatitle=Gestion des donn\u00E9es des campagnes oc\u00E9anographiques message.layout.oceanicdata1=le Syst\u00E8me d'informations scientifiques pour la mer de l'Ifremer (SISMER) @@ -58,6 +59,7 @@ message.map.title=Cartes de distribution message.map.warning=Warning message.map.warningcontent=Les cartes pr\u00E9sent\u00E9es ne doivent pas \u00EAtre interpr\u00E9t\u00E9es comme des cartes de distribution des esp\u00E8ces mais comme celle des zones o\u00F9 elles sont captur\u00E9es lors des campagnes scientifiques. Les campagnes \u00E9tant r\u00E9alis\u00E9es avec des chaluts diff\u00E9rents et \u00E0 diff\u00E9rentes saisons, les esp\u00E8ces peuvent avoir des capturabilit\u00E9s tr\u00E8s diff\u00E9rentes entre les s\u00E9ries de campagnes, donc d''une zone \u00E0 l''autre. +message.pop.downloadascsv=Download as CSV message.pop.title=Indices biologiques message.pop.paragraph1=Les indices pr\u00E9sent\u00E9s ont \u00E9t\u00E9 s\u00E9lectionn\u00E9s en r\u00E9f\u00E9rence \u00E0 leur aptitude \u00E0 renseigner sur l''impact de la p\u00EAche, en vue de leur int\u00E9gration dans des tableaux de bord d\u2019indicateurs d''\u00E9volution d''\u00E9cosyst\u00E8mes exploit\u00E9s par la p\u00EAche. message.pop.paragraph2=Les donn\u00E9es disponibles sur le site sont les valeurs de chaque indice. Les informations ont \u00E9t\u00E9 valid\u00E9es par un groupe de travail dans une approche int\u00E9grative d\u2019indicateurs de populations et de communaut\u00E9s. Les r\u00E9sultats sont donn\u00E9s par zone g\u00E9ographique et par esp\u00E8ce pour l''ensemble de la s\u00E9rie de donn\u00E9es disponible. L''utilisateur peut s\u00E9lectionner la zone g\u00E9ographique, la saison (dans le cas de s\u00E9ries saisonni\u00E8res), l''esp\u00E8ce et l''indice. Pour les s\u00E9lections pour lesquelles une information est disponible, le syst\u00E8me produit un graphe pr\u00E9sentant la distribution temporelle de l''indice, avec une repr\u00E9sentation de l''\u00E9cart-type. Il fournit la possibilit\u00E9 d\u2019extraire la table des donn\u00E9es correspondantes, incluant la valeur de l\u2019indice par ann\u00E9e, ainsi que son \u00E9cart-type et son coefficient de variation. 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 2011-01-19 10:16:47 UTC (rev 530) +++ trunk/coser-web/src/main/resources/fr/ifremer/coser/web/package_fr.properties 2011-01-19 18:23:34 UTC (rev 531) @@ -21,6 +21,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # #L% ### +message.com.downloadascsv=T\u00E9l\u00E9charger en CSV message.com.title=Indices de communaut\u00E9s message.com.paragraph1=Des indices de communaut\u00E9 sont calcul\u00E9s pour un ensemble d''esp\u00E8ces dans chaque s\u00E9rie. La liste des esp\u00E8ces incluses pour le calcul de chaque indice varie selon les donn\u00E9es disponibles pour la r\u00E9alisation des calculs. message.layout.title=Indices de populations et de communaut\u00E9s issus des campagnes de surveillance halieutique de l''Ifremer @@ -58,6 +59,7 @@ message.map.title=Cartes de distribution message.map.warning=Avertissement message.map.warningcontent=Les cartes pr\u00E9sent\u00E9es ne doivent pas \u00EAtre interpr\u00E9t\u00E9es comme des cartes de distribution des esp\u00E8ces mais comme celle des zones o\u00F9 elles sont captur\u00E9es lors des campagnes scientifiques. Les campagnes \u00E9tant r\u00E9alis\u00E9es avec des chaluts diff\u00E9rents et \u00E0 diff\u00E9rentes saisons, les esp\u00E8ces peuvent avoir des capturabilit\u00E9s tr\u00E8s diff\u00E9rentes entre les s\u00E9ries de campagnes, donc d''une zone \u00E0 l''autre. +message.pop.downloadascsv=T\u00E9l\u00E9charger en CSV message.pop.title=Indices biologiques message.pop.paragraph1=Les indices pr\u00E9sent\u00E9s ont \u00E9t\u00E9 s\u00E9lectionn\u00E9s en r\u00E9f\u00E9rence \u00E0 leur aptitude \u00E0 renseigner sur l''impact de la p\u00EAche, en vue de leur int\u00E9gration dans des tableaux de bord d\u2019indicateurs d''\u00E9volution d''\u00E9cosyst\u00E8mes exploit\u00E9s par la p\u00EAche. message.pop.paragraph2=Les donn\u00E9es disponibles sur le site sont les valeurs de chaque indice. Les informations ont \u00E9t\u00E9 valid\u00E9es par un groupe de travail dans une approche int\u00E9grative d\u2019indicateurs de populations et de communaut\u00E9s. Les r\u00E9sultats sont donn\u00E9s par zone g\u00E9ographique et par esp\u00E8ce pour l''ensemble de la s\u00E9rie de donn\u00E9es disponible. L''utilisateur peut s\u00E9lectionner la zone g\u00E9ographique, la saison (dans le cas de s\u00E9ries saisonni\u00E8res), l''esp\u00E8ce et l''indice. Pour les s\u00E9lections pour lesquelles une information est disponible, le syst\u00E8me produit un graphe pr\u00E9sentant la distribution temporelle de l''indice, avec une repr\u00E9sentation de l''\u00E9cart-type. Il fournit la possibilit\u00E9 d\u2019extraire la table des donn\u00E9es correspondantes, incluant la valeur de l\u2019indice par ann\u00E9e, ainsi que son \u00E9cart-type et son coefficient de variation. Modified: trunk/coser-web/src/main/webapp/WEB-INF/content/com/graph.jsp =================================================================== --- trunk/coser-web/src/main/webapp/WEB-INF/content/com/graph.jsp 2011-01-19 10:16:47 UTC (rev 530) +++ trunk/coser-web/src/main/webapp/WEB-INF/content/com/graph.jsp 2011-01-19 18:23:34 UTC (rev 531) @@ -38,6 +38,12 @@ <s:param name="zone" value="%{zone}" /> <s:param name="indicator" value="%{indicator}" /> </s:url>" /> + + <p><s:a action="graph-csv"> + <s:param name="zone" value="%{zone}" /> + <s:param name="indicator" value="%{indicator}" /> + <s:text name="message.com.downloadascsv"></s:text> + </s:a>.</p> </body> </html> \ No newline at end of file Modified: trunk/coser-web/src/main/webapp/WEB-INF/content/com/indicator.jsp =================================================================== --- trunk/coser-web/src/main/webapp/WEB-INF/content/com/indicator.jsp 2011-01-19 10:16:47 UTC (rev 530) +++ trunk/coser-web/src/main/webapp/WEB-INF/content/com/indicator.jsp 2011-01-19 18:23:34 UTC (rev 531) @@ -39,7 +39,6 @@ <s:form action="graph" method="get"> <s:select name="indicator" list="indicators" label="%{getText('message.common.selectindicator')}" /> <s:hidden name="zone" property="zone"/> - <s:hidden name="species" property="species"/> <s:submit label="Suite"/> </s:form> </body> Modified: trunk/coser-web/src/main/webapp/WEB-INF/content/pop/graph.jsp =================================================================== --- trunk/coser-web/src/main/webapp/WEB-INF/content/pop/graph.jsp 2011-01-19 10:16:47 UTC (rev 530) +++ trunk/coser-web/src/main/webapp/WEB-INF/content/pop/graph.jsp 2011-01-19 18:23:34 UTC (rev 531) @@ -41,5 +41,12 @@ <s:param name="species" value="%{species}" /> <s:param name="indicator" value="%{indicator}" /> </s:url>" /> + + <p><s:a action="graph-csv"> + <s:param name="zone" value="%{zone}" /> + <s:param name="species" value="%{species}" /> + <s:param name="indicator" value="%{indicator}" /> + <s:text name="message.com.downloadascsv"></s:text> + </s:a>.</p> </body> </html> \ No newline at end of file Modified: trunk/coser-web/src/main/webapp/WEB-INF/decorators/layout.jsp =================================================================== --- trunk/coser-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2011-01-19 10:16:47 UTC (rev 530) +++ trunk/coser-web/src/main/webapp/WEB-INF/decorators/layout.jsp 2011-01-19 18:23:34 UTC (rev 531) @@ -49,6 +49,7 @@ <div id="middle" class="clearfix"> <div class="page"> + <span class="clt"></span> <div class="content"> <div class="degrade"> <div class="top_content">