Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 168 → Rev 169

/trunk/configurations/config.defaut.ini
98,6 → 98,9
nomsStatsInitialesRangTpl = "{ref:nomsTpl}/stats/initiales?masque.rg={rang}"
nomsListeInitialesRangTpl = "{ref:nomsTpl}?masque={initiale}&recherche=etendue&masque.rg={rang}&navigation.limite=500"
nomsRechercheTpl = "{ref:nomsTpl}?masque={valeur}&recherche={type}&ns.format=txt&navigation.limite=3000"
nomsRechercheRetenuTpl = "{ref:nomsTpl}?masque={valeur}&recherche={type}&ns.format=txt&navigation.limite=3000"
nomsRechercheAlphabTpl = "{ref:nomsTpl}?masque={valeur}&recherche={type}&ns.format=txt&navigation.limite=3000"
nomsRechercheSynonymeTpl = "{ref:nomsTpl}?masque={valeur}&recherche={type}&ns.format=txt&navigation.limite=3000"
nomsRechercheDeterminationTpl = "{ref:nomsTpl}?masque={valeur}&recherche={type}&ns.format=txt&retour.champs=nom_retenu,nom_retenu.*&navigation.limite=3000"
nomsRechercheDecompoTpl = "{ref:nomsTpl}?masque={valeur}&recherche={type}&ns.format=txt&retour.champs=auteur,annee,biblio_origine,nom_addendum&navigation.limite=3000"
nomsVernaTpl = "{ref:baseUrlApiEflore}/noms-vernaculaires"
/trunk/tests/modules/RechercheTest.php
29,7 → 29,76
$this->assertContains('<input id="nom" name="nom" class="champ" size="30" maxlength="255" type="text" autocomplete="off" value="acer mons" />', $sortie);
$this->assertContains('<strong class="nom-sci-retenu"><span class="surlignage">Acer</span> <span class="surlignage">mons</span>pessulanum</strong>', $sortie);
}
 
public function testExecuterRechercheSimpleAlphab() {
$_GET['type_nom'] = 'nom_scientifique';
$_GET['nom'] = 'acer mons';
$_GET['resultat'] = 'alphab';
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
Config::charger($cheminRacine.'bdtfx.ini');
Registre::set('eFlore.urlBase', new Url(Config::get('base_url_application_index')));
Registre::set('parametres.referentiel', 'bdtfx');
$recherche = new Recherche();
$recherche->initialiser();
$recherche->executerRechercheSimple();
$donnees = Registre::get('donneesMoteur');
$resultat = Registre::get('resultats');
$sortie = implode('', $recherche->getSortie());
$this->assertEmpty($donnees, print_r($donnees, true));
$this->assertNotEmpty($resultat, print_r($resultat, true));
$this->assertEquals('6', $resultat['entete']['total']);
$this->assertEquals('6', count($resultat['resultat']));
}
public function testExecuterRechercheSimpleRetenu() {
$_GET['type_nom'] = 'nom_scientifique';
$_GET['nom'] = 'acer mons';
$_GET['resultat'] = 'retenu';
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
Config::charger($cheminRacine.'bdtfx.ini');
Registre::set('eFlore.urlBase', new Url(Config::get('base_url_application_index')));
Registre::set('parametres.referentiel', 'bdtfx');
$recherche = new Recherche();
$recherche->initialiser();
$recherche->executerRechercheSimple();
$donnees = Registre::get('donneesMoteur');
$resultat = Registre::get('resultats');
$sortie = implode('', $recherche->getSortie());
$this->assertEmpty($donnees, print_r($donnees, true));
$this->assertNotEmpty($resultat, print_r($resultat, true));
$this->assertEquals('6', $resultat['entete']['total']);
$this->assertEquals('6', count($resultat['resultat']));
}
public function testExecuterRechercheSimpleSynonyme() {
$_GET['type_nom'] = 'nom_scientifique';
$_GET['nom'] = 'acer mons';
$_GET['resultat'] = 'retenu';
$cheminRacine = realpath(dirname(__FILE__).'/../configurations/').'/';
Config::charger($cheminRacine.'bdtfx.ini');
Registre::set('eFlore.urlBase', new Url(Config::get('base_url_application_index')));
Registre::set('parametres.referentiel', 'bdtfx');
$recherche = new Recherche();
$recherche->initialiser();
$recherche->executerRechercheSimple();
$donnees = Registre::get('donneesMoteur');
$resultat = Registre::get('resultats');
$sortie = implode('', $recherche->getSortie());
$this->assertEmpty($donnees, print_r($donnees, true));
$this->assertNotEmpty($resultat, print_r($resultat, true));
$this->assertEquals('6', $resultat['entete']['total']);
$this->assertEquals('6', count($resultat['resultat']));
}
public function testExecuterRechercheSimpleResDecompo() {
$_GET['type_nom'] = 'nom_scientifique';
$_GET['nom'] = 'acer mons';
/trunk/metier/api_0.1/Noms.php
38,6 → 38,29
return $url;
}
// retourne les champs par defaut
private function getUrlRechercheAlphab($nom, $typeRech) {
$tpl = Config::get('nomsRechercheAlphabTpl');
$params = array('valeur' => $nom, 'type' => $typeRech);
$url = $this->formaterUrl($tpl, $params);
return $url;
}
// retourne les champs par defaut
private function getUrlRechercheRetenu($nom, $typeRech) {
$tpl = Config::get('nomsRechercheRetenuTpl');
$params = array('valeur' => $nom, 'type' => $typeRech);
$url = $this->formaterUrl($tpl, $params);
return $url;
}
private function getUrlRechercheSynonyme($nom, $typeRech) {
$tpl = Config::get('nomsRechercheSynonymeTpl');
$params = array('valeur' => $nom, 'type' => $typeRech);
$url = $this->formaterUrl($tpl, $params);
return $url;
}
// retourne les champs par defaut + nom retenu
private function getUrlRechercheDetermination($nom, $typeRech) {
$tpl = Config::get('nomsRechercheDeterminationTpl');