/trunk/bibliotheque/dao/TraitementDao.php |
---|
37,6 → 37,20 |
} |
/** |
* Retourne l'ensemble des traitements en attente. |
* |
* @param string le code du projet de référentiel. |
* @return mixed un tableau contenant les informations sur les traitements en attente ou false en cas d'échec. |
*/ |
public function getTraitementsEnAttente($code_projet) { |
$url = $this->url."/EnAttente/$code_projet"; |
$json = $this->envoyerRequeteConsultation($url); |
$traitements = json_decode($json, true); |
return $traitements; |
} |
/** |
* Retourne l'ensemble des traitements en cours. |
* |
* @param string le code du projet de référentiel. |
/trunk/bibliotheque/dao/Dao.php |
---|
58,6 → 58,7 |
// MÉTHODES |
protected function envoyerRequeteConsultation($url) { |
$url = $this->traiterUrlParametres($url); |
$retour = $this->envoyerRequete($url, 'GET'); |
return $retour; |
} |
107,6 → 108,24 |
return $contenu; |
} |
private function traiterUrlParametres($url) { |
$parametres = array(); |
if (! is_null($this->getLimiteDebut())) { |
$parametres[] = 'start='.$this->getLimiteDebut(); |
} |
if (! is_null($this->getLimiteNbre())) { |
$parametres[] = 'limit='.$this->getLimiteNbre(); |
} |
if ($this->getDistinction() != 0) { |
$parametres[] = 'distinct='.$this->getDistinction(); |
} |
if (count($parametres) > 0) { |
$url_parametres = implode('&', $parametres); |
$url = $url.'?'.$url_parametres; |
} |
return $url; |
} |
private function traiterEntete($entetes, $uri) { |
$infos = $this->analyserEntete($entetes, $uri); |
$this->traiterEnteteDebug($infos); |
/trunk/bibliotheque/dao/ReferentielDao.php |
---|
23,21 → 23,28 |
*/ |
public function getReferentielsDispo() { |
$url = $this->url_jrest.self::SERVICE."/Dispo"; |
$json = file_get_contents($url); |
$json = $this->envoyerRequeteConsultation($url); |
$noms = json_decode($json, true); |
return $noms; |
} |
/** |
* Retourne l'ensemble des information sur les colonnes d'une table. |
* Retourne l'ensemble des information sur les noms d'un référentiel. |
* |
* @param string le nom de la table. |
* @return array un tableau contenant les informations sur les colonnes de la table. |
* @param string le code du référentiel. |
* @return array un tableau contenant les informations sur les noms du référentiel. |
*/ |
public function getTout($code_projet) { |
$url = $this->url_jrest.self::SERVICE."/Tout/$code_projet"; |
$json = file_get_contents($url); |
$noms = json_decode($json, true); |
$nbre = $this->getNombre($code_projet); |
$noms = array(); |
$pas = 1000; |
for ($i = 0; $i < $nbre ; $i += $pas) { |
$this->setLimitation($i, $pas); |
$json = $this->envoyerRequeteConsultation($url); |
$noms_partiel = json_decode($json, true); |
$noms = array_merge($noms, $noms_partiel); |
} |
return $noms; |
} |
49,10 → 56,8 |
*/ |
public function getNombre($code_projet) { |
$url = $this->url_jrest.self::SERVICE."/Nombre/$code_projet"; |
$json = file_get_contents($url); |
$json = $this->envoyerRequeteConsultation($url); |
$nbre = json_decode($json, true); |
return $nbre; |
} |
} |