Subversion Repositories eFlore/Applications.del

Rev

Rev 1057 | Rev 1795 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1057 Rev 1661
Line 12... Line 12...
12
* @version 0.1
12
* @version 0.1
13
* @copyright 1999-2011 Tela Botanica (accueil@tela-botanica.org)
13
* @copyright 1999-2011 Tela Botanica (accueil@tela-botanica.org)
14
*/
14
*/
15
class Syndication extends RestService {
15
class Syndication extends RestService {
Line 16... Line -...
16
 
-
 
17
	
16
 
18
	private $parametres = array();
17
	private $parametres = array();
19
	private $ressources = array();
18
	private $ressources = array();
20
	private $methode = null;
19
	private $methode = null;
21
	private $projetNom = array();
20
	private $projetNom = array();
Line 29... Line 28...
29
	/** Indique si oui (true) ou non (false), on veut utiliser les paramètres bruts. */
28
	/** Indique si oui (true) ou non (false), on veut utiliser les paramètres bruts. */
30
	protected $utilisationParametresBruts = true;
29
	protected $utilisationParametresBruts = true;
Line 31... Line 30...
31
 
30
 
32
	public function __construct() {
31
	public function __construct() {
33
		$this->cheminCourant = dirname(__FILE__).DS;
32
		$this->cheminCourant = dirname(__FILE__).DS;
34
		$this->squelette_dossier = dirname(__FILE__).DIRECTORY_SEPARATOR.'syndication'.DIRECTORY_SEPARATOR.'squelettes'.DIRECTORY_SEPARATOR;
33
		$this->squelette_dossier = dirname(__FILE__).DS.'syndication'.DS.'squelettes'.DS;
Line 35... Line 34...
35
	}
34
	}
36
 
35
 
37
	public function consulter($ressources, $parametres) {
36
	public function consulter($ressources, $parametres) {
Line 57... Line 56...
57
		$this->ressources = $ressources;
56
		$this->ressources = $ressources;
58
		$this->parametres = $parametres;
57
		$this->parametres = $parametres;
59
	}
58
	}
Line 60... Line 59...
60
	
59
 
61
	private function verifierRessourcesEtParametres() {
-
 
62
		
60
	private function verifierRessourcesEtParametres() {
63
		$servicesDispos = Config::get('servicesDispo');
61
		$servicesDispos = Config::get('servicesDispo');
64
		if (!isset($this->ressources[0]) || !in_array($this->ressources[0], explode(',',$servicesDispos))) {
62
		if (!isset($this->ressources[0]) || !in_array($this->ressources[0], explode(',',$servicesDispos))) {
65
			$message = "Vous devez indiquer un nom de service valide, les services disponibles sont ".$servicesDispos;
63
			$message = "Vous devez indiquer un nom de service valide, les services disponibles sont ".$servicesDispos;
66
			$code = RestServeur::HTTP_CODE_ERREUR;
64
			$code = RestServeur::HTTP_CODE_ERREUR;
Line 79... Line 77...
79
	}
77
	}
Line 80... Line 78...
80
 
78
 
81
	private function traiterRessources() {
79
	private function traiterRessources() {
82
		$retour = '';
80
		$retour = '';
83
		$retour = $this->initialiserService();
-
 
84
 
81
		$retour = $this->initialiserService();
85
		return $retour;
82
		return $retour;
Line 86... Line 83...
86
	}
83
	}
87
	
84
 
88
	private function creerResultatService($donnees) {
85
	private function creerResultatService($donnees) {
89
		$resultat = new ResultatService();
86
		$resultat = new ResultatService();
90
		$resultat->mime = $this->getTypeMime();
-
 
91
		$resultat->corps = SquelettePhp::analyser($this->squelette_dossier.$this->format.'.tpl.xml', $donnees);
87
		$resultat->mime = $this->getTypeMime();
92
		
88
		$resultat->corps = SquelettePhp::analyser($this->squelette_dossier.$this->format.'.tpl.xml', $donnees);
Line 93... Line 89...
93
		return $resultat;
89
		return $resultat;
94
	}
90
	}