r809 - in trunk: . coser-business/src/main/java/fr/ifremer/coser/services
Author: chatellier Date: 2011-04-14 08:58:00 +0000 (Thu, 14 Apr 2011) New Revision: 809 Log: Fix result upload merge after upload (could have one type change instead of no type all all) Modified: trunk/changelog.txt trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java Modified: trunk/changelog.txt =================================================================== --- trunk/changelog.txt 2011-04-14 08:57:10 UTC (rev 808) +++ trunk/changelog.txt 2011-04-14 08:58:00 UTC (rev 809) @@ -4,6 +4,8 @@ 1.0.4 ----- + * Fix result upload merge after upload (could have one type change instead + of no type all all) * Fix year axis label (not depend from website locale) 1.0.3 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-04-14 08:57:10 UTC (rev 808) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/services/WebService.java 2011-04-14 08:58:00 UTC (rev 809) @@ -691,9 +691,10 @@ // suppression des resultats qui ont été envoyé mais // ne sont ni maps result, ni indicator result - List<String> noTypeResultZoneIds = getZonesIds(tempDirectory, false, false); - cleanCurrentProjectDirectory(projectsDirectory, noTypeResultZoneIds); - cleanCurrentProjectDirectory(mapsDirectory, noTypeResultZoneIds); + List<String> noIndicatorsResultZoneIds = getZonesIds(tempDirectory, false, null); + cleanCurrentProjectDirectory(projectsDirectory, noIndicatorsResultZoneIds); + List<String> noMapsResultZoneIds = getZonesIds(tempDirectory, null, false); + cleanCurrentProjectDirectory(mapsDirectory, noMapsResultZoneIds); // recuperation des noms zone des nouveau fichiers List<String> indicatorsResultZoneIds = getZonesIds(tempDirectory, true, false); @@ -834,13 +835,16 @@ /** * Recupere dans un repertoire donné, les zoneid des resultat. * + * Les boolean sont des grands {@code Boolean} car si la valeur + * est {@code null}, on ne tient pas compte du critere lors de la recherche. + * * @param scanDirectory le repertoire a scanner * @param indicatorResults if true get indicator results * @param mapResults if true get map results * @return la liste des resultid * @throws CoserBusinessException */ - protected List<String> getZonesIds(File scanDirectory, boolean indicatorResults, boolean mapResults) throws CoserBusinessException { + protected List<String> getZonesIds(File scanDirectory, Boolean indicatorResults, Boolean mapResults) throws CoserBusinessException { List<String> resultIds = new ArrayList<String>(); File[] projectFiles = scanDirectory.listFiles(); @@ -862,8 +866,9 @@ RSufiResult rsufiResult = projectService.getRSufiResult(resultFile); // return result depending on result type - if ( rsufiResult.isIndicatorsResult() == indicatorResults && - rsufiResult.isMapsResult() == mapResults ) { + if ( ( indicatorResults == null || rsufiResult.isIndicatorsResult() == indicatorResults ) + && + ( mapResults == null || rsufiResult.isMapsResult() == mapResults ) ) { String resultResultId = rsufiResult.getZone(); if (StringUtils.isNotBlank(resultResultId)) { resultIds.add(resultResultId); @@ -1574,11 +1579,11 @@ if (species == null) { // title = surveyName - indicateur - result = publicationService.getRsufiResultComChart(project, resultFile, rsufiResult, indicator, zoneDisplayName, indicatorName, unit); + result = publicationService.getRsufiResultComChart(project, resultFile, rsufiResult, indicator, zoneDisplayName, indicatorName, unit, locale); } else { // title = surveyName - indicateur - species - result = publicationService.getRsufiResultPopChart(project, resultFile, rsufiResult, species, indicator, zoneDisplayName, indicatorName, unit); + result = publicationService.getRsufiResultPopChart(project, resultFile, rsufiResult, species, indicator, zoneDisplayName, indicatorName, unit, locale); } break; }
participants (1)
-
chatellier@users.labs.libre-entreprise.org