/trunk/modeles/RechercheDao.php |
---|
13,18 → 13,33 |
* |
*/ |
class RechercheDao extends ColModele { |
const SERVICE = 'CoelRecherche'; |
/** |
* Recherche une collection en fonction de paramêtres |
* @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"; |
$json = file_get_contents($url); |
$donnees = json_decode($json); |
return $donnees; |
$requete = 'SELECT COUNT(cc_id_collection) AS nbre '. |
'FROM coel_collection LEFT JOIN coel_structure ON (cc_ce_structure = cs_id_structure) '. |
'WHERE ('. |
" cc_nom LIKE '%{$parametres['mots']}%' ". |
" OR cc_truk_nom_alternatif LIKE '%{$parametres['mots']}%' ". |
" OR cc_truk_code LIKE '%{$parametres['mots']}%' ". |
" OR cc_description LIKE '%{$parametres['mots']}%' ". |
" OR cc_description_specialiste LIKE '%{$parametres['mots']}%' ". |
" OR cc_historique LIKE '%{$parametres['mots']}%' ". |
" OR cs_nom LIKE '%{$parametres['mots']}%' ". |
" OR cs_adresse_01 LIKE '%{$parametres['mots']}%' ". |
" OR cs_adresse_02 LIKE '%{$parametres['mots']}%' ". |
" OR cs_ville LIKE '%{$parametres['mots']}%' ". |
" OR cs_truk_identifiant_alternatif LIKE '%{$parametres['mots']}%' ". |
') '. |
'ORDER BY cs_ville ASC, cc_nom ASC '; |
$donnees = $this->requeteUn($requete); |
//Debug::printr($requete); |
return $donnees['nbre']; |
} |
/** |
32,12 → 47,29 |
* @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()}" : ''); |
$json = file_get_contents($url); |
$donnees = json_decode($json, true); |
$requete = 'SELECT cs_id_structure, cs_ville, cs_nom, '. |
' cc_id_collection, cc_nom '. |
'FROM coel_collection LEFT JOIN coel_structure ON (cc_ce_structure = cs_id_structure) '. |
'WHERE ('. |
" cc_nom LIKE '%{$parametres['mots']}%' ". |
" OR cc_truk_nom_alternatif LIKE '%{$parametres['mots']}%' ". |
" OR cc_truk_code LIKE '%{$parametres['mots']}%' ". |
" OR cc_description LIKE '%{$parametres['mots']}%' ". |
" OR cc_description_specialiste LIKE '%{$parametres['mots']}%' ". |
" OR cc_historique LIKE '%{$parametres['mots']}%' ". |
" OR cs_nom LIKE '%{$parametres['mots']}%' ". |
" OR cs_adresse_01 LIKE '%{$parametres['mots']}%' ". |
" OR cs_adresse_02 LIKE '%{$parametres['mots']}%' ". |
" OR cs_ville LIKE '%{$parametres['mots']}%' ". |
" OR cs_truk_identifiant_alternatif LIKE '%{$parametres['mots']}%' ". |
') '. |
'ORDER BY cs_ville ASC, cc_nom ASC '. |
($this->avoirLimitation() ? "LIMIT {$this->getLimiteDebut()}, {$this->getLimiteNbre()} " : ''); |
$donnees = $this->requeteTous($requete); |
//Debug::printr($requete); |
return $donnees; |
} |
} |
} |
?> |
/trunk/modeles/PersonneDao.php |
---|
13,7 → 13,6 |
* |
*/ |
class PersonneDao extends ColModele { |
const SERVICE_PERSONNE = 'CoelPersonne'; |
/** |
* Retourne l'ensemble des information d'une personne. |
22,8 → 21,7 |
* @return array un tableau contenant les informations sur la personne. |
*/ |
public function getPersonne($id) { |
$url = $this->url_jrest.self::SERVICE_PERSONNE."/$id"; |
$json = file_get_contents($url); |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelPersonne/$id"); |
$donnees = json_decode($json, true); |
return $donnees; |
} |
/trunk/modeles/CollectionDao.php |
---|
13,10 → 13,7 |
* |
*/ |
class CollectionDao extends ColModele { |
const SERVICE_COLLECTION = 'CoelCollection'; |
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. |
* |
36,8 → 33,7 |
* @return array un tableau contenant les collections correspondant à l'id structure. |
*/ |
public function getParIdStructure($id_structure) { |
$url = $this->url_jrest.self::SERVICE_COLLECTION."/ParIdStructure/$id_structure"; |
$json = file_get_contents($url); |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelCollection/ParIdStructure/$id_structure"); |
$donnees = json_decode($json, true); |
$this->nettoyerTableauDeTableauxAssoc($donnees); |
return $donnees; |
50,8 → 46,7 |
* @return array un tableau contenant les informations sur les personnes liées à la collection. |
*/ |
public function getCollectionAPersonne($id_collection) { |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_PERSONNE."/$id_collection"; |
$json = file_get_contents($url); |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelCollectionAPersonne/$id_collection"); |
$donnees = json_decode($json, true); |
$this->nettoyerTableauDeTableauxAssoc($donnees); |
return $donnees; |
64,26 → 59,10 |
* @return array un tableau contenant les informations sur les publications liées à la collection. |
*/ |
public function getCollectionAPublication($id_collection) { |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_PUBLICATION."/$id_collection"; |
$json = file_get_contents($url); |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelCollectionAPublication/$id_collection"); |
$donnees = json_decode($json, true); |
$this->nettoyerTableauDeTableauxAssoc($donnees); |
return $donnees; |
} |
/** |
* Retourne l'ensemble des commentaires publics liés à une collection. |
* |
* @param integer l'id de la collection. |
* @return array un tableau contenant les informations sur les publications liées à la collection. |
*/ |
public function getCollectionACommentaire($id_collection) { |
$commentaire_public = '1'; |
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_COMMENTAIRE."/$id_collection/$commentaire_public"; |
$json = file_get_contents($url); |
$donnees = json_decode($json, true); |
$this->nettoyerTableauDeTableauxAssoc($donnees); |
return $donnees; |
} |
} |
?> |
/trunk/modeles/MetadonneeDao.php |
---|
13,8 → 13,7 |
* |
*/ |
class MetadonneeDao extends ColModele { |
const SERVICE_ONTOLOGIE = 'CoelValeurListe'; |
/** |
* Retourne l'ensemble des information d'une liste de valeurs. |
* |
22,8 → 21,7 |
* @return array un tableau contenant les valeurs de la liste. |
*/ |
public function getOntologie($id) { |
$url = $this->url_jrest.self::SERVICE_ONTOLOGIE."/id/$id?limit=500"; |
$json = file_get_contents($url); |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelValeurListe/id/$id?limit=500"); |
$donnees = json_decode($json, true); |
return $donnees; |
} |
35,8 → 33,7 |
* @return array un tableau contenant les valeurs. |
*/ |
public function getOntologieValeur($id_valeurs) { |
$url = $this->url_jrest.self::SERVICE_ONTOLOGIE."/idv/$id_valeurs"; |
$json = file_get_contents($url); |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelValeurListe/idv/$id_valeurs"); |
$donnees = json_decode($json, true); |
return $donnees; |
} |
/trunk/modeles/StructureDao.php |
---|
13,9 → 13,7 |
* |
*/ |
class StructureDao extends ColModele { |
const SERVICE_STRUCTURE = 'CoelStructure'; |
const SERVICE_STRUCTURE_A_PERSONNE = 'CoelStructureAPersonne'; |
/** |
* Retourne l'ensemble des information sur une structure. |
* |
23,8 → 21,7 |
* @return array un tableau contenant les informations sur la structure. |
*/ |
public function getStructure($id) { |
$url = $this->url_jrest.self::SERVICE_STRUCTURE."/*/$id/*"; |
$json = file_get_contents($url); |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelStructure/*/$id/*"); |
$donnees = json_decode($json, true); |
return $donnees[1]; |
} |
36,8 → 33,7 |
* @return array un tableau contenant les informations sur le personnel de la structure. |
*/ |
public function getPersonnel($id) { |
$url = $this->url_jrest.self::SERVICE_STRUCTURE_A_PERSONNE."/$id"; |
$json = file_get_contents($url); |
$json = file_get_contents("http://www.tela-botanica.org/eflore/coel/jrest/CoelStructureAPersonne/$id"); |
$donnees = json_decode($json, true); |
$this->nettoyerTableauDeTableauxAssoc($donnees); |
return $donnees; |