Subversion Repositories eFlore/Applications.cel

Rev

Rev 1426 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1426 Rev 1527
1
<?php
1
<?php
2
/**
2
/**
3
* PHP Version 5
3
* PHP Version 5
4
*
4
*
5
* @category  PHP
5
* @category  PHP
6
* @package   jrest
6
* @package   jrest
7
* @author    David Delon <david.delon@clapas.net>
7
* @author    David Delon <david.delon@clapas.net>
8
* @copyright 2010 Tela-Botanica
8
* @copyright 2010 Tela-Botanica
9
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
9
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
10
* @version   SVN: <svn_id>
10
* @version   SVN: <svn_id>
11
* @link      /doc/jrest/
11
* @link      /doc/jrest/
12
*/
12
*/
13
 
13
 
14
/**
14
/**
15
* 
15
* 
16
* in : utf8
16
* in : utf8
17
* out : utf8
17
* out : utf8
18
* 
18
* 
19
* NameSearch.php  
19
* NameSearch.php  
20
* 
20
* 
21
* Cas d'utilisation :
21
* Cas d'utilisation :
22
* Service completion nom scientifique
22
* Service completion nom scientifique
23
* 
23
* 
24
* 1 : L'application recoit un debut de nom scientifique 
24
* 1 : L'application recoit un debut de nom scientifique ainsi qu'un code de référentiel
25
* 2 : Si le genre recu est >1, l'application retourne les 50 premieres genre commencant par ce prefixe
25
* 2 : Si le genre recu est >1, l'application retourne les 50 premieres genre commencant par ce prefixe
26
* 3 : Si l'espece est presente  l'application retourne les 50 premieres genre+espece commencant par ce prefixe
26
* 3 : Si l'espece est presente  l'application retourne les 50 premieres genre+espece commencant par ce prefixe
27
*/
27
*/
28
class NameSearch extends Cel {
28
class NameSearch extends Cel {
29
	
29
	
30
	public function getRessource(){
30
	public function getRessource(){
31
		
31
		
32
			//TODO: description du service à renvoyer
32
			//TODO: description du service à renvoyer
33
			print "[]";
33
			print "[]";
34
            return;
34
            return;
35
	}
35
	}
36
 
36
 
37
	public function getElement($uid){
37
	public function getElement($uid){
38
	
38
	
39
		$liste_genre_espece = array();
39
		$liste_genre_espece = array();
40
		
-
 
-
 
40
		
41
		
41
		$referentiel = null;
42
		$genre = null;
42
		$genre = null;
43
		$espece = null;
43
		$espece = null;
44
		
44
		
45
		if(isset($uid[0])) {
45
		if(isset($uid[0])) {
46
			$genre = $uid[0];
46
			$referentiel = $uid[0];
47
		}
47
		}
48
		
48
		
49
		if(isset($uid[1])) {
49
		if(isset($uid[1])) {
-
 
50
			$genre = $uid[1];
-
 
51
		}
-
 
52
		
-
 
53
		if(isset($uid[2])) {
50
			$espece = $uid[1];
54
			$espece = $uid[2];
51
		}
55
		}
52
 
56
 
53
		$chercheur_infos_taxon = new RechercheInfosTaxonBeta($this->config);
57
		$chercheur_infos_taxon = new RechercheInfosTaxonBeta($this->config, $referentiel);
54
		$liste_genre_espece = $chercheur_infos_taxon->rechercherGenreEspeceSurPrefixe($genre,$espece);
58
		$liste_genre_espece = $chercheur_infos_taxon->rechercherGenreEspeceSurPrefixe($genre,$espece);
55
	                
59
	                
56
		$this->envoyerJson($liste_genre_espece);			
60
		$this->envoyerJson($liste_genre_espece);			
57
		return true;	
61
		return true;	
58
	}
62
	}
59
}
63
}
60
 
64
 
61
/* +--Fin du code ---------------------------------------------------------------------------------------+
65
/* +--Fin du code ---------------------------------------------------------------------------------------+
62
* $Log$
66
* $Log$
63
* Revision 1.6  2008-01-30 08:57:28  ddelon
67
* Revision 1.6  2008-01-30 08:57:28  ddelon
64
* fin mise en place mygwt
68
* fin mise en place mygwt
65
*
69
*
66
* Revision 1.5  2007-05-21 18:13:30  ddelon
70
* Revision 1.5  2007-05-21 18:13:30  ddelon
67
* Refactoring et documentation
71
* Refactoring et documentation
68
*
72
*
69
* 
73
* 
70
*/
74
*/
71
?>
75
?>