Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Ignore whitespace Rev 967 → Rev 968

/trunk/services/modules/0.1/baseflor/CommunGraphiques.php
51,8 → 51,8
$this->initialiserConfiguration();
$resultats = '';
$this->traiterRessources();
$requete = $this->assemblerLaRequete();
$resultat = $this->resultat = $this->Bdd->recupererTous($requete);
 
$resultat = $this->resultat = $this->Bdd->recupererTous($this->assemblerLaRequete());
$versionResultat = $this->obtenirResultat($resultat);
return $versionResultat;
}
65,7 → 65,7
$this->Bdd = $conteneur->getBdd();
$this->config = $conteneur->getParametre('Graphiques');
$this->convertisseur = $this->config['convertisseur'];
$this->graduations_id = $this->getParametreTableau('graduations_id');
$this->graduations_id = $this->getParametreTableau('Paramètres.graduations_id');
$this->champs_ontologiques = $this->getParametreTableau('Paramètres.champs_ontologiques');
$this->cheminGraphBase = $this->config['chemin'];
$cacheOptions = array('mise_en_cache' => $this->config['cache_miseEnCache'],
209,8 → 209,7
//+--------------------------FONCTIONS D'ASSEMBLAGE DE LA REQUETE-------------------------------------------+
 
public function assemblerLaRequete() {
$requete = ' SELECT '.$this->requete_champs.' FROM '.$this->table.' '.$this->retournerRequeteCondition();
return $requete;
return ' SELECT '.$this->requete_champs.' FROM '.$this->table.' '.Informations::retournerRequeteCondition($this->requete_condition);
}
 
public function retournerRequeteCondition() {
224,11 → 223,11
//+-------------------------- formatage du résultat -------------------------------------------+
 
public function obtenirResultat($resultat) {
if ($resultat == ""){
$message = 'La requête SQL formée comporte une erreur!';
$code = RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE;
throw new Exception($message, $code);
}elseif ($resultat) {
if ($resultat == '') {
throw new Exception(
'La requête SQL formée comporte une erreur!',
RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE);
} elseif ($resultat) {
if ((count($this->ressources)) != 0) {
//$Atraiter = array_filter($resultat[0],function($var){return ($var != '');});
foreach ($resultat[0] as $champs => $valeur) {
238,7 → 237,7
}
if (!empty($Atraiter)) {
$this->traiterValeursEcologiques($Atraiter);
$svg = $this->genererSVG();
$svg = $this->genererSVG($this->cheminGraphBase.$this->nomGraphique.".svg");
$resultat = new ResultatService();
$resultat->corps = ($this->parametres['retour'] == 'image/png') ? $this->convertirEnPNG($svg) : $svg;
$resultat->mime = $this->parametres['retour'];
292,15 → 291,13
 
}
 
public function genererSVG(){
public function genererSVG($fichierSvg){
$svg = null;
$this->dom = new DOMDocument('1.0', 'UTF-8');
$this->dom->validateOnParse = true;
$fichierSvg = $this->cheminGraphBase."".$this->nomGraphique.".svg";
$this->dom->load($fichierSvg);
$this->changerValeursSVG();
$svg = $this->dom->saveXML();
return $svg;
return $this->dom->saveXML();
}
 
abstract function changerValeursSVG();