Subversion Repositories eFlore/Applications.coel-consultation

Compare Revisions

Ignore whitespace Rev 19 → Rev 20

/trunk/modeles/CollectionDao.php
17,6 → 17,7
const SERVICE_COLLECTION_A_PERSONNE = 'CoelCollectionAPersonne';
const SERVICE_COLLECTION_A_PUBLICATION = 'CoelCollectionAPublication';
const SERVICE_COLLECTION_A_COMMENTAIRE = 'CoelCollectionACommentaire';
/**
* Retourne l'ensemble des information sur une collection.
*
/trunk/modeles/Ontologie.php
53,7 → 53,22
$retour = $liste;
}
return $retour;
}
}
 
public static function getListeTrieeParAbreviation($id_liste) {
$retour = false;
$liste = self::getListe($id_liste);
if ($liste !== false) {
$liste_par_abr = array();
foreach ($liste as $cle => $valeur) {
$valeur_fromatee = self::formaterTableauValeur($valeur);
$abreviation = $valeur_fromatee['abreviation'];
$liste_par_abr[$abreviation] = $valeur_fromatee;
}
$retour = $liste_par_abr;
}
return $retour;
}
public static function chargerValeur($id_valeur) {
$retour = true;
103,7 → 118,8
$valeur_formatee = array();
if (is_array($valeur) && count($valeur) > 0) {
$valeur_formatee = array(
'parent' => $valeur['cmlv_id_valeur'],
'id' => $valeur['cmlv_id_valeur'],
'parent' => $valeur['cmlv_ce_parent'],
'projet' => $valeur['cmlv_ce_projet'],
'nom' => $valeur['cmlv_nom'],
'abreviation' => $valeur['cmlv_abreviation'],
/trunk/modeles/RechercheDao.php
20,8 → 20,8
* @return array un tableau contenant des objets d'informations sur les collections
*/
public function chercherStructureNbre($parametres) {
$mots = urlencode($parametres['mots']);
$url = $this->url_jrest.self::SERVICE."/Nombre/$mots";
$url = $this->construireUrlRecherche('Nombre', $parametres, false);
$json = file_get_contents($url);
$donnees = json_decode($json);
return $donnees;
32,12 → 32,34
* @return array un tableau contenant des objets d'informations sur les collections
*/
public function chercher($parametres) {
$mots = urlencode($parametres['mots']);
$url = $this->url_jrest.self::SERVICE."/ParDefaut/$mots";
$url .= ($this->avoirLimitation() ? "?start={$this->getLimiteDebut()}&limit={$this->getLimiteNbre()}" : '');
$url = $this->construireUrlRecherche('ParDefaut', $parametres);
Debug::printr($url);
$json = file_get_contents($url);
$donnees = json_decode($json, true);
return $donnees;
}
private function construireUrlRecherche($type, $parametres, $limitation = true) {
$url = $this->url_jrest.self::SERVICE.'/'.$type;
$params_a_passer = array('mots', 'sci', 'bot', 'zg', 'p', 'pr');
foreach ($params_a_passer as $param_cle) {
if (isset($parametres[$param_cle]) && $parametres[$param_cle] != '') {
$valeur = urlencode($parametres[$param_cle]);
$url .= '/'.$valeur;
} else {
$url .= '/*';
}
}
if ($limitation) {
$url .= ($this->avoirLimitation() ? "?start={$this->getLimiteDebut()}&limit={$this->getLimiteNbre()}" : '');
$url .= "&distinct={$this->getDistinction()}";
} else {
$url .= "?distinct={$this->getDistinction()}";
}
return $url;
}
}
?>