Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 2457 → Rev 2458

/trunk/jrest/services/NameMap.php
1,49 → 1,42
<?php
// declare(encoding='UTF-8');
/**
* PHP Version 5
*
* @category PHP
* @package jrest
* @author David Delon <david.delon@clapas.net>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version SVN: <svn_id>
* @link /doc/jrest/
*/
 
/**
* NameMap.php
*
* in utf8
* out utf8
*
* Cas d'utilisation :
* Service recherche d'image a partir d'un numero nomenclatural
*
* 1: Le service recoit un référentiell et un numero nomenclatural
* 2: Le service recherche une carte disponible
*/
 
* Service recherche d'une carte de chorologie a partir d'un numero nomenclatural et d'un code de référentiel.
*
* Cas d'utilisation :
* 1: Le service recoit un référentiel et un numero nomenclatural
* 2: Le service recherche une carte disponible
*
* @internal Mininum PHP version : 5.2
* @category CEL
* @package Services
* @subpackage Cartes
* @version 0.1
* @author Mathias CHOUET <mathias@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @author Aurelien PERONNET <aurelien@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @copyright 1999-2014 Tela Botanica <accueil@tela-botanica.org>
*/
class NameMap extends Cel {
 
function getElement($uid){
public function getElement($uid){
$retour = array('');
if(isset($uid[0]) && isset($uid[1])) {
if (isset($uid[0]) && isset($uid[1])) {
$uid[0] = $uid[0] != '' ? $uid[0] : 'bdtfx';
$retour = $this->obtenirCarteChorologie($uid[0], $uid[1]);
}
}
$this->envoyerJson($retour);
return true;
}
 
$this->envoyerJson($retour);
return true;
}
function obtenirCarteChorologie($referentiel_taxo, $nn) {
private function obtenirCarteChorologie($referentiel_taxo, $nn) {
// TODO: gérer ici les cartes d'autres référentiels si celles si sont disponibles
$retour = array('');
$chercheur_infos_taxon = new RechercheInfosTaxonBeta($this->config, $referentiel_taxo);
$nt = $chercheur_infos_taxon->rechercherNumTaxSurNumNom($nn);
 
$retour = array('');
switch($referentiel_taxo) {
case 'bdtfx':
$url_service_chorologie = $this->config['eflore']['url_service_chorologie_carte'];
50,7 → 43,7
$url_service_chorologie = str_replace('{referentiel_choro}','chorodep',$url_service_chorologie);
$file = $url_service_chorologie.'/nt%3A'.$nt.'?retour.format=587&retour=image%2Fpng';
$retour = array($file);
break;
break;
case 'bdtxa':
// En attendant mieux
$url_service_chorologie = $this->config['eflore']['url_service_chorologie_carte'];
57,20 → 50,8
$url_service_chorologie = str_replace('{referentiel_choro}','bdtxa',$url_service_chorologie);
$file = $url_service_chorologie.'/nt%3A'.$nt.'?retour.format=587&retour=image%2Fpng';
$retour = array($file);
break;
default:
break;
break;
}
return $retour;
return $retour;
}
}
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log$
* Revision 1.1 2008-01-30 08:57:28 ddelon
* fin mise en place mygwt
*
* Revision 1.1 2007-06-06 13:31:16 ddelon
* v0.09
*/
?>
}