Subversion Repositories eFlore/Projets.eflore-projets

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
163 jpm 1
<?php
2
/**
3
* Description :
4
* Classe principale de chargement des services d'eFlore.
5
*
6
* Encodage en entrée : utf8
7
* Encodage en sortie : utf8
8
* @package eflore-projets
9
* @author Jennifer DHÉ <jennifer.dhe@tela-botanica.org>
10
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
11
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
12
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
13
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
14
* @version 0.1
15
* @copyright 1999-2011 Tela Botanica (accueil@tela-botanica.org)
16
*/
17
class Projets extends RestService {
18
 
19
	private $conteneur = null;
20
 
21
	public function __construct() {
22
		$this->utilisationParametresBruts = true;
23
	}
24
 
25
	public function consulter($ressources, $parametres) {
26
		$resultat = '';
27
		$reponseHttp = new ReponseHttp();
28
		try {
29
			$this->initialiserConteneur($ressources, $parametres);
215 jpm 30
			$projet = $this->conteneur->getProjet();
31
			$projet->verifier();
32
			$resultat = $projet->consulter();
163 jpm 33
			$reponseHttp->setResultatService($resultat);
34
		} catch (Exception $e) {
35
			$reponseHttp->ajouterErreur($e);
36
		}
37
		$reponseHttp->emettreLesEntetes();
38
		$corps = $reponseHttp->getCorps();
39
		return $corps;
40
	}
41
 
42
	private function initialiserConteneur($ressources, $parametres) {
43
		$this->conteneur = new Conteneur();
44
		$this->conteneur->setParametre('ressources', $ressources);
45
		$this->conteneur->setParametre('parametres', $parametres);
46
		$this->conteneur->setParametre('cheminBase', dirname(__FILE__).DS);
47
	}
48
}
49
?>