Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 1425 → Rev 1426

/trunk/jrest/services/InventoryImportExcel.php
273,7 → 273,7
$info_transmettre = $this->traiterTransmettre($line[TRANSMETTRE][$i]);
break;
case ESPECE:
$chercheur_infos_taxon = new RechercheInfosTaxon($this->config);
$chercheur_infos_taxon = new RechercheInfosTaxonBeta($this->config);
$resultat_recherche_espece = $chercheur_infos_taxon->rechercherInfosSurTexteCodeOuNumTax($line[ESPECE][$i]);
if (isset($resultat_recherche_espece['en_id_nom']) && $resultat_recherche_espece['en_id_nom']!='') {
$info_espece['nom_sel'] = $resultat_recherche_espece['nom_sel'];
286,7 → 286,6
} else {
$info_espece['nom_sel'] = $line[ESPECE][$i];
}
break;
case IMAGE:
$info_image=$this->traiterImage($line[IMAGE][$i],$utilisateur); // Image separee par des / + utilisateur
break;
/trunk/jrest/services/NameMap.php
41,24 → 41,8
$nt = null;
 
if(isset($uid[0])) {
$recherche_infos_taxon = new RechercheInfosTaxonBeta($this->config);
$nt = $recherche_infos_taxon->rechercherNumTaxSurNumNom($uid[0]);
}
$retour = array('');
// si le taxon cherché existe
if ($nt) {
$file = EF_URL_CARTO."france_BDNFF_4.02_nt".$nt.".png";
$file_headers = @get_headers($file);
if ($file_headers[0] == 'HTTP/1.1 404 Not Found') {
}
else {
$service=EF_URL_CHORO.$uid[0].'/chorologie';
@get_headers($service);
}
$file = 'http://localhost/service:eflore:0.1/chorodep/cartes/nn%3A'.$uid[0].'?retour.format=587&retour=image%2Fpng';
$retour = array($file);
}
 
/trunk/jrest/services/NameSearch.php
49,12 → 49,8
if(isset($uid[1])) {
$espece = $uid[1];
}
 
$chercheur_infos_taxon = new RechercheInfosTaxonBeta($this->config);
$infos = $chercheur_infos_taxon->taxonEstPresentDansDepartement('1320','75');
echo '<pre>'.print_r($infos,true).'</pre>';exit;
$infos = $chercheur_infos_taxon->rechercherInformationsComplementairesSurNom('Iris australis Tod.');
$liste_genre_espece = $chercheur_infos_taxon->rechercherGenreEspeceSurPrefixe($genre,$espece);
$this->envoyerJson($liste_genre_espece);
/trunk/jrest/services/NameImage.php
41,95 → 41,24
class NameImage extends Cel {
 
function getElement($uid){
 
$nt = null;
 
if(isset($uid[0])) {
$recherche_infos_taxon = new RechercheInfosTaxonBeta($this->config);
$nt = $recherche_infos_taxon->rechercherNumTaxSurNumNom($uid[0]);
}
 
$projet_photo = 'photoflora';
$tab_retour[$projet_photo]=chercherIllustrationsServiceXml(sprintf(EF_URL_PHOTOFLORA_SERVICE, $nt));
$image = array();
$value=array('null','null');
foreach ($tab_retour[$projet_photo] as $cle => $illustration) {
if (preg_match(EF_URL_PHOTOFLORA_REGEXP_01, $illustration['about'], $match)) {
$abreviation = $match[1];
$fichier = $match[2];
}
else {
if (preg_match(EF_URL_PHOTOFLORA_REGEXP_02, $illustration['about'], $match)) {
$abreviation = $match[1];
$fichier = $match[2];
}
if(isset($uid[0])) {
$url = 'http://photoflora.free.fr/eflore-photoflora/services/index.php/0.1/projets/photoflora/images?masque.nn='.$uid[0].'&navigation.limite=1';
$resultat = @file_get_contents($url);
$resultat = json_decode($resultat);
if(is_object($resultat) && isset($resultat->resultats)) {
$element = (array)$resultat->resultats;
$element = array_pop($element);
$image = array($element->{'binaire.href'}, $element->{'binaire.hrefmax'});
}
if (isset($abreviation)) {
$url_miniature = sprintf(EF_URL_PHOTOFLORA_IMG_MIN, $abreviation, $fichier);;
$url_max = $illustration['about'];
$value=array($url_miniature,$url_max);
// Priorite aux images en png
if (strstr($fichier, '.png')) {
break;
}
}
}
$this->envoyerJson($value);
$this->envoyerJson($image);
return true;
}
}
 
function chercherIllustrationsServiceXml($url)
{
return analyserFichierRdf($url);
}
function analyserFichierRdf($chemin)
{
$aso_info = array();
$dom = new DOMDocument();
$dom->validateOnParse = true;
if (preg_match('/^http:\/\//', $chemin)) {
@$dom->loadXML(file_get_contents($chemin));
} else {
@$dom->load($chemin);
}
$tab_infos = array();
foreach ($dom->getElementsByTagNameNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'Description') as $rdf_description) {
$aso_info['about'] = $rdf_description->getAttribute('about');
$aso_info['dc:identifier'] = $rdf_description->getAttribute('identifier');
$aso_info['dc:title'] = utf8_decode($rdf_description->getAttribute('title'));
$aso_info['dc:creator'] = utf8_decode($rdf_description->getAttribute('creator'));
$aso_info['dc:contributor'] = utf8_decode($rdf_description->getAttribute('contributor'));
$aso_info['dc:publisher'] = utf8_decode($rdf_description->getAttribute('publisher'));
$aso_info['dc:type'] = utf8_decode($rdf_description->getAttribute('type'));
$aso_info['dc:format'] = utf8_decode($rdf_description->getAttribute('format'));
if (function_exists('date_default_timezone_set')) {
date_default_timezone_set('Europe/Paris');
}
if (preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/', $rdf_description->getAttribute('created'))) {
$aso_info['dcterms:created'] = date('j-m-Y à H:i:s', strtotime($rdf_description->getAttribute('created')));
} else {
$aso_info['dcterms:created'] = $rdf_description->getAttribute('created');
}
$aso_info['dcterms:dateSubmitted'] = utf8_decode($rdf_description->getAttribute('dateSubmitted'));
$aso_info['dcterms:spatial'] = utf8_decode($rdf_description->getAttribute('spatial'));
$aso_info['dcterms:licence'] = utf8_decode($rdf_description->getAttribute('licence'));
$tab_infos[$rdf_description->getAttribute('identifier')] = $aso_info;
}
return $tab_infos;
}
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log$
* Revision 1.4 2008-11-13 11:29:12 ddelon