Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 1527 → Rev 2458

/trunk/jrest/services/NameSearch.php
1,75 → 1,41
<?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/
*/
/**
*
* in : utf8
* out : utf8
*
* NameSearch.php
*
* Cas d'utilisation :
* Service completion nom scientifique
*
* 1 : L'application recoit un debut de nom scientifique ainsi qu'un code de référentiel
* 2 : Si le genre recu est >1, l'application retourne les 50 premieres genre commencant par ce prefixe
* 3 : Si l'espece est presente l'application retourne les 50 premieres genre+espece commencant par ce prefixe
*/
* Service de complétion du nom scientifique.
*
* Cas d'utilisation :
* 1 : L'application recoit un debut de nom scientifique ainsi qu'un code de référentiel
* 2 : Si le genre recu est >1, l'application retourne les 50 premieres genre commencant par ce prefixe
* 3 : Si l'espece est presente l'application retourne les 50 premieres genre+espece commencant par ce prefixe
*
* @internal Mininum PHP version : 5.2
* @category CEL
* @package Services
* @subpackage Auto-complétions
* @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 NameSearch extends Cel {
 
public function getRessource(){
//TODO: description du service à renvoyer
print "[]";
return;
//TODO: description du service à renvoyer
print '[]';
return;
}
 
public function getElement($uid){
$liste_genre_espece = array();
$referentiel = null;
$genre = null;
$espece = null;
if(isset($uid[0])) {
$referentiel = $uid[0];
}
if(isset($uid[1])) {
$genre = $uid[1];
}
if(isset($uid[2])) {
$espece = $uid[2];
}
$referentiel = isset($uid[0]) ? $uid[0] : null;
$genre = isset($uid[1]) ? $uid[1] : null;
$espece = isset($uid[2]) ? $uid[2] : null;
 
$chercheur_infos_taxon = new RechercheInfosTaxonBeta($this->config, $referentiel);
$liste_genre_espece = $chercheur_infos_taxon->rechercherGenreEspeceSurPrefixe($genre,$espece);
$this->envoyerJson($liste_genre_espece);
return true;
$this->envoyerJson($liste_genre_espece);
return true;
}
}
 
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log$
* Revision 1.6 2008-01-30 08:57:28 ddelon
* fin mise en place mygwt
*
* Revision 1.5 2007-05-21 18:13:30 ddelon
* Refactoring et documentation
*
*
*/
?>
}