@Deprecated public class WebService extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
WebService.MultipleFileFilter
Deprecated.
Aggrege plusieurs file filters.
|
protected class |
WebService.OneResultFileFilter
Deprecated.
Filter pour un resultat donné.
|
Modifier and Type | Field and Description |
---|---|
protected CommonService |
commonService
Deprecated.
|
protected CoserBusinessConfig |
config
Deprecated.
|
protected freemarker.template.Configuration |
freemarkerConfiguration
Deprecated.
Freemarker
|
protected org.apache.commons.collections4.map.MultiKeyMap |
indicatorsMap
Deprecated.
Indicator map (id, locale > translation, id, "unit" > unit) (etat du service).
|
protected ProjectService |
projectService
Deprecated.
|
protected PublicationService |
publicationService
Deprecated.
|
protected DataStorage |
zonesMap
Deprecated.
Zones map (etat du service).
|
Constructor and Description |
---|
WebService(CoserBusinessConfig config)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkDataCollision(Collection<RSufiResultPath> selectedResults)
Deprecated.
Met à jour les fichiers de propriétés des resultats (maps, dataSource)
and check for duplicated couple (zoneid/resulttype (map) upload).
|
protected void |
cleanCurrentProjectDirectory(File projectsDirectory,
Collection<String> newResultIds)
Deprecated.
Fait le menage dans le dossier courant des projets en supprimant
tout les resulat qui ont un result id present dans la liste
newResultIds . |
protected void |
customCopyDirectory(File srcDir,
File destDir,
FileFilter indicatorsFileFilter)
Deprecated.
N'utilise pas la methode de commons-fileutils, car lorsqu'un répertoire
est refusé, il ne descend pas dans les sous répertoire alors que dans
notre cas il le faut.
|
void |
deleteIndicatorsResult(List<String> deleteZoneId)
Deprecated.
Supprime des résultats par leur identifiant de zone de ratachement (car
un seul resultat par zone).
|
void |
deleteMapsResult(List<String> deleteZoneId)
Deprecated.
Supprime des résultats par leur identifiant de zone de ratachement (car
un seul resultat par zone).
|
protected org.apache.commons.collections4.map.MultiKeyMap |
extractCharts(Collection<String> zones,
Collection<String> species,
Collection<String> comIndicators,
Collection<String> popIndicators,
Locale locale)
Deprecated.
Retourne les indicateurs calculés avec leurs traductions scientifique
pour la zone et l'especes souhaitées.
|
File |
extractData(List<String> zones,
List<DataType> types,
List<String> species,
List<String> comIndicators,
List<String> popIndicators,
Locale locale)
Deprecated.
Extrait de toutes les données les informations demandées restreintes
sur certaines zone, certaines espèces et certains indicateurs.
|
protected org.apache.commons.collections4.map.MultiKeyMap |
extractDataMap(Collection<String> zones,
Collection<String> species)
Deprecated.
Extrait les cartes.
|
protected File |
extractSource(Collection<String> zones,
File directory)
Deprecated.
Genere un fichier zip des sources d'un projet.
|
List<RSufiResultPath> |
findAllProjectWithResult(Date beginDate,
Date endDate,
boolean onlyPubliableResult)
Deprecated.
Retourne tous les projets qui ont des résultats.
|
File |
generateDechargePDF(File disclamerPdf,
File resultDirectory,
RSufiResult rSufiResult,
Locale locale)
Deprecated.
Genere le PDF dynamique de decharge à partir du template freemarker.
|
protected void |
generateExtractPDF(File directory,
List<String> zones,
org.apache.commons.collections4.map.MultiKeyMap pdfMaps,
org.apache.commons.collections4.map.MultiKeyMap pdfCharts,
Locale locale)
Deprecated.
Generate pdf file filled with maps and charts.
|
protected File |
generateMetaFilePDF(Project project,
Selection selection,
File resultDirectory,
RSufiResult rsufiResult,
String indicator,
Locale locale)
Deprecated.
Genere le fichier PDF d'information sur les espèces incluses dans les
calculs des indicateurs de communautés, à jointe à chaque téléchargement.
|
protected File |
generateSourceZip(Project project,
Selection selection,
File resultDirectory,
RSufiResult rSufiResult,
Locale locale)
Deprecated.
Generate zip for selection.
|
File |
getChart(String zone,
String species,
String indicator,
String list,
Locale locale)
Deprecated.
Retourne les indicateurs calculés avec leurs traductions scientifique
pour la zone et l'especes souhaitées.
|
File |
getChartData(String zone,
String species,
String indicator,
String list,
Locale locale)
Deprecated.
Retourne les indicateurs calculés avec leurs traductions scientifique
pour la zone et l'especes souhaitées.
|
protected File |
getChartDataFile(File projectsDirectory,
File projectDirectory,
File selectionDirectory,
File resultDirectory,
RSufiResult rSufiResult,
String species,
String indicator,
String list,
Locale locale)
Deprecated.
Generate chart data (as csv for population and as zip for community).
|
protected FileFilter |
getCopyFileFilter(File scanDirectory,
boolean mapResults)
Deprecated.
Retourne un file filter qui ne copiera que les dossiers resultat
correspondant au type demandé.
|
Map<String,String> |
getFacades()
Deprecated.
Get facades list (as facadeid/facadename).
|
Map<String,String> |
getIndicatorLists(String zone,
String indicator,
Locale locale)
Deprecated.
Retourne les listes sur lequel l'indicateur fournit a ete calculé.
|
Map<String,String> |
getIndicators(Collection<String> zones,
DataType dataType,
Locale locale)
Deprecated.
Retourne les indicateurs calculés avec leurs traductions scientifique
pour les zones souhaitées.
|
Map<String,String> |
getIndicators(String zone,
String species,
Locale locale)
Deprecated.
Retourne les indicateurs calculés avec leurs traductions scientifique
pour la zone et l'especes souhaitées.
|
protected org.apache.commons.collections4.map.MultiKeyMap |
getIndicatorsMap()
Deprecated.
Charge les indicateurs disponible depuis le fichier des indicateurs.
|
Map<String,String> |
getIndicatorsResultsPerZone()
Deprecated.
Recupere dans le repertoire des projets d'indicateur les resultats
disponible par zone (il ne peut y en avoir qu'un par zone).
|
protected String |
getIndicatorValue(String indicator,
String localeCode)
Deprecated.
Get indicator translation by checking correct locale.
|
Date |
getLastDataUpdateDate()
Deprecated.
Retourne la date de dernière mise à jour des données du site web.
|
File |
getMapFile(String zone,
String species)
Deprecated.
Recupere le fichier image de la carte demandées en fonction de la zone
et de l'espece.
|
Map<String,String> |
getMapsResultsPerZone()
Deprecated.
Recupere dans le repertoire des projets d'indicateur les resultats
disponible par zone (il ne peut y en avoir qu'un par zone).
|
protected Map<String,String> |
getResultsPerZone(File scanDirectory)
Deprecated.
Recupere dans le repertoire des projets d'indicateur les resultats
disponible par zone (il ne peut y en avoir qu'un par zone).
|
protected Map<String,String> |
getRsufiResultComIndicatorLists(File resultDirectory,
RSufiResult rsufiResult,
File codeTypeEspecesFile,
String indicator,
Locale locale)
Deprecated.
Recupere les nom des listes sur lesquelle ont été calculé les
indicateurs avec leurs traductions.
|
protected Map<String,String> |
getRsufiResultComIndicators(File resultDirectory,
RSufiResult rsufiResult,
Locale locale)
Deprecated.
Recupere la liste de toutes les especes nom sci et nom off à partir
d'un resultat.
|
protected Map<String,String> |
getRsufiResultPopIndicators(File resultDirectory,
RSufiResult rsufiResult,
String species,
Locale locale)
Deprecated.
Recupere la liste de toutes les especes nom sci et nom off à partir
d'un resultat.
|
protected Map<String,String> |
getRsufiResultSpecies(Project project,
File resultDirectory,
RSufiResult rsufiResult)
Deprecated.
Recupere la liste de toutes les especes nom sci et nom off à partir
d'un resultat.
|
File |
getSourceZip(String zone,
Locale locale)
Deprecated.
Genere un fichier zip des sources d'un projet.
|
Map<String,String> |
getSpecies(Collection<String> zones,
boolean forMap)
Deprecated.
Recuperer la liste des populations pour un ensemble de zones donnée.
|
Map<String,String> |
getSpecies(String zone,
boolean forMap)
Deprecated.
Recuperer la liste des populations pour une zone donnée.
|
Map<String,List<String>> |
getZoneByFacade()
Deprecated.
Retourne les zones disponible par facade.
|
Map<String,String> |
getZoneForFacade(String facade,
boolean onlyWithSource,
boolean forMap)
Deprecated.
Pour une zone principale, recupere la liste des couples sous-zone /
campagne qui sont disponible dans cette zone principale.
|
String |
getZoneFullName(String zoneId)
Deprecated.
Retourne les nom d'une zone (avec la facade, l'année et la serie) en
fonction de l'id de la zone.
|
Map<String,String> |
getZoneMetaInfo(Locale locale)
Deprecated.
Recupere la liste des meta info pour chaque id de zone sous forme de Map.
|
Map<String,String> |
getZonePictures()
Deprecated.
Recupere la liste des cartes pour chaque id de zone sous forme de Map.
|
protected Map<String,String> |
getZonesIds(File scanDirectory,
Boolean indicatorResults,
Boolean mapResults,
Boolean dataResults)
Deprecated.
Recupere dans un repertoire donné, les zoneid des resultat avec
pour chaque id, le nom du projet associé.
|
DataStorage |
getZonesMap()
Deprecated.
Charge les zones disponibles depuis le fichier des zones.
|
protected boolean |
isCandidateResult(RSufiResult rsufiResult,
Date beginDate,
Date endDate,
boolean onlyPubliableResult)
Deprecated.
Test if result is valid with filtering.
|
protected void |
modifyRSufiResults(Collection<RSufiResultPath> selectedResults,
Collection<RSufiResultPath> indicatorsResults,
Collection<RSufiResultPath> mapResults,
Collection<RSufiResultPath> publishDataResults)
Deprecated.
Modifie les types et options de certains résultats rsufi (map result,
data sources result).
|
File |
performResultExtract(Collection<RSufiResultPath> selectedResults,
Collection<RSufiResultPath> publishDataResults,
File extractDirectory)
Deprecated.
Extract directory to custom directory.
|
String |
performResultUpload(Collection<RSufiResultPath> selectedResults,
Collection<RSufiResultPath> indicatorsResults,
Collection<RSufiResultPath> mapResults,
Collection<RSufiResultPath> publishDataResults,
String login,
String password,
ProgressMonitor progress)
Deprecated.
Upload user selected result to coser web front-end using common http
client.
|
void |
registerNewUploadedResults(String login,
File archiveFile)
Deprecated.
Traite le fichier uploade par l'application client et l'enregistre
dans le stockage coté web.
|
protected void |
sendNewResultNotifications(String login,
int count,
String detail)
Deprecated.
Envoi un mail de notification apres la publication des resultat à la
liste des adresses email renseignées dans la configuration.
|
protected void |
updateDataProperties()
Deprecated.
Met à jour certaines proprietes apres la mise à jour des données.
|
protected CoserBusinessConfig config
protected CommonService commonService
protected ProjectService projectService
protected PublicationService publicationService
protected org.apache.commons.collections4.map.MultiKeyMap indicatorsMap
protected DataStorage zonesMap
protected freemarker.template.Configuration freemarkerConfiguration
public WebService(CoserBusinessConfig config)
protected org.apache.commons.collections4.map.MultiKeyMap getIndicatorsMap() throws CoserBusinessException
CoserBusinessException
protected String getIndicatorValue(String indicator, String localeCode) throws CoserBusinessException
indicator
- indicator codelocale
- localeCoserBusinessException
public DataStorage getZonesMap() throws CoserBusinessException
CoserBusinessException
public String getZoneFullName(String zoneId) throws CoserBusinessException
zoneId
- zone idnull
if not found)CoserBusinessException
public List<RSufiResultPath> findAllProjectWithResult(Date beginDate, Date endDate, boolean onlyPubliableResult) throws CoserBusinessException
beginDate
- begin date (can be null)endDate
- end date (can be null)onlyPubliableResult
- select only publiable resultsCoserBusinessException
protected boolean isCandidateResult(RSufiResult rsufiResult, Date beginDate, Date endDate, boolean onlyPubliableResult)
rsufiResult
- rsufi result to testbeginDate
- begin date (can be null)endDate
- end date (can be null)onlyPubliableResult
- select only publiable resultspublic File performResultExtract(Collection<RSufiResultPath> selectedResults, Collection<RSufiResultPath> publishDataResults, File extractDirectory) throws CoserBusinessException
selectedResults
- selected result pathsextractDirectory
- extract directory (can be null)publishDataResults
- result paths flaged with results exportCoserBusinessException
public String performResultUpload(Collection<RSufiResultPath> selectedResults, Collection<RSufiResultPath> indicatorsResults, Collection<RSufiResultPath> mapResults, Collection<RSufiResultPath> publishDataResults, String login, String password, ProgressMonitor progress) throws CoserBusinessException
selectedResults
- selected result (collection of project/selection/rsufiresult)indicatorsResults
- results selected as indicator resultsmapResults
- results selected as map resultpublishDataResults
- results selected as results published with datalogin
- remote admin loginpassword
- remote admin passwordprogress
- progress monitornull
if no errorCoserBusinessException
protected void modifyRSufiResults(Collection<RSufiResultPath> selectedResults, Collection<RSufiResultPath> indicatorsResults, Collection<RSufiResultPath> mapResults, Collection<RSufiResultPath> publishDataResults) throws CoserBusinessException
selectedResults
- selected result (collection of project/selection/rsufiresult)indicatorsResults
- results selected as indicator resultsmapResults
- map resultspublishDataResults
- publish data resultsCoserBusinessException
protected void checkDataCollision(Collection<RSufiResultPath> selectedResults) throws CoserBusinessException
selectedResults
- result id to checkCoserBusinessException
public void registerNewUploadedResults(String login, File archiveFile) throws CoserBusinessException
login
- user loginarchiveFile
- uploaded fileCoserBusinessException
protected void customCopyDirectory(File srcDir, File destDir, FileFilter indicatorsFileFilter) throws IOException
srcDir
- source directory to copydestDir
- destination directoryindicatorsFileFilter
- file filter for file to copyIOException
protected void updateDataProperties() throws CoserBusinessException
CoserBusinessException
public Date getLastDataUpdateDate() throws CoserBusinessException
CoserBusinessException
protected Map<String,String> getZonesIds(File scanDirectory, Boolean indicatorResults, Boolean mapResults, Boolean dataResults) throws CoserBusinessException
Boolean
car si la valeur
est null
, on ne tient pas compte du critere lors de la recherche.scanDirectory
- le repertoire a scannerindicatorResults
- if true get indicator resultsmapResults
- if true get map resultsdataResults
- if true get data allowed resultCoserBusinessException
protected FileFilter getCopyFileFilter(File scanDirectory, boolean mapResults) throws CoserBusinessException
scanDirectory
- directory containing result to copymapResults
- result type to getCoserBusinessException
protected void cleanCurrentProjectDirectory(File projectsDirectory, Collection<String> newResultIds) throws CoserBusinessException
newResultIds
.
Supprime egalement les selections qui n'ont plus de résultats et
les projets qui n'ont plus de selection.projectsDirectory
- projectsDirectorynewResultIds
- new idsCoserBusinessException
protected void sendNewResultNotifications(String login, int count, String detail)
login
- user logincount
- updated data countdetail
- body mail detailpublic Map<String,String> getFacades() throws CoserBusinessException
CoserBusinessException
public Map<String,String> getZoneForFacade(String facade, boolean onlyWithSource, boolean forMap) throws CoserBusinessException
facade
- facade (le nom de la facade principale) (can be null
: don't filter on facade)onlyWithSource
- retourn zone liste with available source dataforMap
- look in map directoryCoserBusinessException
public Map<String,List<String>> getZoneByFacade() throws CoserBusinessException
CoserBusinessException
public Map<String,String> getZonePictures() throws CoserBusinessException
CoserBusinessException
public Map<String,String> getZoneMetaInfo(Locale locale) throws CoserBusinessException
locale
- localeCoserBusinessException
public Map<String,String> getSpecies(String zone, boolean forMap) throws CoserBusinessException
zone
- zone idforMap
- for map directoryCoserBusinessException
public Map<String,String> getSpecies(Collection<String> zones, boolean forMap) throws CoserBusinessException
zones
- zones idsforMap
- for map directoryCoserBusinessException
protected Map<String,String> getRsufiResultSpecies(Project project, File resultDirectory, RSufiResult rsufiResult) throws CoserBusinessException
project
- projectresultDirectory
- rsufi result directoryrsufiResult
- rsufi resultCoserBusinessException
public Map<String,String> getIndicators(String zone, String species, Locale locale) throws CoserBusinessException
zone
- zone idspecies
- especes (if null
look for com indicators)locale
- localeCoserBusinessException
public Map<String,String> getIndicators(Collection<String> zones, DataType dataType, Locale locale) throws CoserBusinessException
zones
- zones iddataTypes
- data typelocale
- localeCoserBusinessException
protected Map<String,String> getRsufiResultPopIndicators(File resultDirectory, RSufiResult rsufiResult, String species, Locale locale) throws CoserBusinessException
resultDirectory
- rsufi result directoryrsufiResult
- resultspecies
- to get indicator (can be null
to not filter on species)locale
- localeCoserBusinessException
protected Map<String,String> getRsufiResultComIndicators(File resultDirectory, RSufiResult rsufiResult, Locale locale) throws CoserBusinessException
resultDirectory
- rsufi result directoryrsufiResult
- resultlocale
- localeCoserBusinessException
public Map<String,String> getIndicatorLists(String zone, String indicator, Locale locale) throws CoserBusinessException
zone
- zone idindicator
- indicatorlocale
- localeCoserBusinessException
protected Map<String,String> getRsufiResultComIndicatorLists(File resultDirectory, RSufiResult rsufiResult, File codeTypeEspecesFile, String indicator, Locale locale) throws CoserBusinessException
resultDirectory
- rsufi result directoryrsufiResult
- resultindicator
- indicatorlocale
- localeCoserBusinessException
public File getChart(String zone, String species, String indicator, String list, Locale locale) throws CoserBusinessException
zone
- zone idspecies
- especes (if null
look for com indicatorsindicator
- indicatorlist
- indicator's list (if null
look for pop indicators or no list selectedlocale
- localeCoserBusinessException
public File getChartData(String zone, String species, String indicator, String list, Locale locale) throws CoserBusinessException
zone
- zone idspecies
- especes (if null
look for com indicatorsindicator
- indicatorlist
- indicator's list (if null
look for pop indicators or no list selectedlocale
- localeCoserBusinessException
protected File getChartDataFile(File projectsDirectory, File projectDirectory, File selectionDirectory, File resultDirectory, RSufiResult rSufiResult, String species, String indicator, String list, Locale locale) throws CoserBusinessException
projectsDirectory
- projects storage directoryprojectDirectory
- current project directoryselectionDirectory
- selection directoryresultDirectory
- rsufi result directoryrSufiResult
- rsufi resultspecies
- species (can be null for community)indicator
- indicatorlist
- indicator's list (if null
look for pop indicators or no list selectedlocale
- localeCoserBusinessException
public File getMapFile(String zone, String species) throws CoserBusinessException
null
.zone
- zone (zoneid)species
- species or (null to get CoserBusinessException
public File getSourceZip(String zone, Locale locale) throws CoserBusinessException
zone
- zone (zoneid-surveyname)locale
- localeCoserBusinessException
protected File generateSourceZip(Project project, Selection selection, File resultDirectory, RSufiResult rSufiResult, Locale locale) throws CoserBusinessException
project
- projectselection
- selection with loaded dataresultDirectory
- rsufi result directoryrSufiResult
- rsufi resultlocale
- generated pdf localeCoserBusinessException
public File generateDechargePDF(File disclamerPdf, File resultDirectory, RSufiResult rSufiResult, Locale locale) throws CoserBusinessException
disclamerPdf
- pdf file to generateresultDirectory
- rsufi result directoryrSufiResult
- rsufi resultlocale
- generated pdf localeCoserBusinessException
protected File generateMetaFilePDF(Project project, Selection selection, File resultDirectory, RSufiResult rsufiResult, String indicator, Locale locale) throws CoserBusinessException
project
- projectselection
- selectionresultDirectory
- result directoryrsufiResult
- rsufi resultindicator
- indicatorlocale
- localeCoserBusinessException
public Map<String,String> getIndicatorsResultsPerZone() throws CoserBusinessException
CoserBusinessException
public Map<String,String> getMapsResultsPerZone() throws CoserBusinessException
CoserBusinessException
protected Map<String,String> getResultsPerZone(File scanDirectory) throws CoserBusinessException
scanDirectory
- le repertoire a scannerCoserBusinessException
public void deleteIndicatorsResult(List<String> deleteZoneId) throws CoserBusinessException
deleteZoneId
- CoserBusinessException
public void deleteMapsResult(List<String> deleteZoneId) throws CoserBusinessException
deleteZoneId
- CoserBusinessException
public File extractData(List<String> zones, List<DataType> types, List<String> species, List<String> comIndicators, List<String> popIndicators, Locale locale) throws CoserBusinessException
selectZones
- zonesselectTypes
- typesselectSpecies
- speciescomIndicators
- indicatorspopIndicators
- indicatorsCoserBusinessException
protected org.apache.commons.collections4.map.MultiKeyMap extractDataMap(Collection<String> zones, Collection<String> species) throws CoserBusinessException, IOException
zones
- zones (zoneid)species
- speciesCoserBusinessException
IOException
protected File extractSource(Collection<String> zones, File directory) throws CoserBusinessException
zone
- zone (zoneid-surveyname)locale
- localeCoserBusinessException
protected org.apache.commons.collections4.map.MultiKeyMap extractCharts(Collection<String> zones, Collection<String> species, Collection<String> comIndicators, Collection<String> popIndicators, Locale locale) throws CoserBusinessException
zone
- zone idspecies
- especes (if null
look for com indicatorscomIndicator
- comIndicatorpopIndicators
- popIndicatorslocale
- localeCoserBusinessException
protected void generateExtractPDF(File directory, List<String> zones, org.apache.commons.collections4.map.MultiKeyMap pdfMaps, org.apache.commons.collections4.map.MultiKeyMap pdfCharts, Locale locale) throws CoserBusinessException
directory
- directory to generate pdf tozones
- zones idspdfMaps
- pdf maps (can be null
)pdfCharts
- pdf charts (can be null
)CoserBusinessException
Copyright © 2010–2015 Ifremer. All rights reserved.