Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1468 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
* NameMap.php 
15
* NameMap.php 
16
* 
16
* 
17
* in utf8
17
* in utf8
18
* out utf8 
18
* out utf8 
19
* 
19
* 
20
* Cas d'utilisation :
20
* Cas d'utilisation :
21
* Service recherche d'image a partir d'un numero nomenclatural
21
* Service recherche d'image a partir d'un numero nomenclatural
22
* 
22
* 
23
* 1: Le service recoit un numero nomenclatural
23
* 1: Le service recoit un référentiell et un numero nomenclatural
24
* 2: Le service calcul le numero taxonomique associe
-
 
25
* 3: Le service recherche une carte disponible
24
* 2: Le service recherche une carte disponible
26
* 		A: Pas de carte disponible, generation de l'image
-
 
27
*/
25
*/
28
 
26
 
29
class NameMap extends Cel  {
27
class NameMap extends Cel  {
30
 
28
 
31
	function getElement($uid){
29
	function getElement($uid){
32
		$url_service_chorologie = $this->config['eflore']['url_service_chorologie_carte'];
-
 
33
		$nt = null;
30
		$retour = array('');
34
 
-
 
35
		if(isset($uid[0])) {
31
		if(isset($uid[0]) && isset($uid[1])) {
36
        $retour = array('');
32
			$uid[0] = $uid[0] != '' ? $uid[0] : 'bdtfx';
37
        	$file = $url_service_chorologie.'/nn%3A'.$uid[0].'?retour.format=587&retour=image%2Fpng';
-
 
38
			$retour = array($file);
33
			$retour = $this->obtenirCarteChorologie($uid[0], $uid[1]);
39
        }    	    
34
		}  	    
40
 
35
 
41
		$this->envoyerJson($retour);			
36
		$this->envoyerJson($retour);			
42
		return true;	
37
		return true;	
43
	}
38
	}
-
 
39
	
-
 
40
	function obtenirCarteChorologie($referentiel_taxo, $nn) {
-
 
41
		// TODO: gérer ici les cartes d'autres référentiels si celles si sont disponibles
-
 
42
		$retour = array('');
-
 
43
		switch($referentiel_taxo) {
-
 
44
			case 'bdtfx':
-
 
45
				$url_service_chorologie = $this->config['eflore']['url_service_chorologie_carte'];
-
 
46
				$file = $url_service_chorologie.'/nn%3A'.$nn.'?retour.format=587&retour=image%2Fpng';
-
 
47
				$retour = array($file);
-
 
48
			break;
-
 
49
			
-
 
50
			default:
-
 
51
			break;
-
 
52
		}
-
 
53
		return $retour;	
-
 
54
	}
44
}
55
}
45
/* +--Fin du code ---------------------------------------------------------------------------------------+
56
/* +--Fin du code ---------------------------------------------------------------------------------------+
46
* $Log$
57
* $Log$
47
* Revision 1.1  2008-01-30 08:57:28  ddelon
58
* Revision 1.1  2008-01-30 08:57:28  ddelon
48
* fin mise en place mygwt
59
* fin mise en place mygwt
49
*
60
*
50
* Revision 1.1  2007-06-06 13:31:16  ddelon
61
* Revision 1.1  2007-06-06 13:31:16  ddelon
51
* v0.09
62
* v0.09
52
*/
63
*/
53
?>
64
?>