/trunk/serveur/generateur/eflore_generateur.js |
---|
New file |
0,0 → 1,10 |
function afficheSelection(listid) |
{ |
var liste = document.getElementById(listid); |
window.location.assign("http://localhost/serveurXML/generateur/eflore_afficher.php?"+listid+"="+liste.selectedItem.label); |
} |
function compileSelection(listid) |
{ |
window.location.assign("http://localhost/serveurXML/generateur/eflore_traducteur.php?"+listid+"="+listid); |
} |
/trunk/serveur/generateur/eflore_afficher.php |
---|
New file |
0,0 → 1,21 |
<? |
require_once '..\\eflore_config.php'; |
header('Content-type: text/xml'); |
if(!empty($_REQUEST['listemacroelements'])) { |
$nom='..\\'.$appConfig['def_macro'].$_REQUEST['listemacroelements']; |
$file = fopen($nom,'r'); |
$taille =fileSize($nom); |
$lecture = fread($file,$taille); |
fclose($file); |
echo $lecture; |
} |
if(!empty($_REQUEST['groupesmacroelements'])) { |
$nom='..\\'.$appConfig['def_groupes'].$_REQUEST['groupesmacroelements']; |
$file = fopen($nom,'r'); |
$taille =fileSize($nom); |
$lecture = fread($file,$taille); |
fclose($file); |
echo $lecture; |
} |
?> |
/trunk/serveur/generateur/xslt/macroelement.xslt |
---|
New file |
0,0 → 1,115 |
<?xml version="1.0" encoding="UTF-8"?> |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/> |
<xsl:template match="/macroelement"><? |
<xsl:apply-templates select="//balise2" mode="require_once"/> |
class <xsl:value-of select="@nom"/> extends macroElement { |
function getSQL() |
{ |
$contexte = array(); |
<xsl:apply-templates select="requetes/requete"/> |
return; |
} |
<!--function buildRoot() |
{ |
<xsl:apply_templates select="mapping" mode="root"/> |
} |
--> |
} |
?> |
</xsl:template> |
<xsl:template match="mapping" mode="root"> |
<xsl:apply-templates select="*[@root]" mode="level1root"/> |
</xsl:template> |
<xsl:template match="requete"> |
if (<xsl:apply-templates select="parametres/parametre" mode="isnull"/>) |
{ |
<xsl:apply-templates select="parametres/parametre" mode="contexte"/> |
if(<xsl:apply-templates select="parametres/parametre" mode="renseigne"/>) |
{ return "<xsl:value-of select="sql"/>"; } |
} |
</xsl:template> |
<xsl:template match="parametre[position()=last()]" mode="isnull">array_key_exists('<xsl:value-of select="@nom"/>',$this->contexteRef) </xsl:template> |
<xsl:template match="parametre" mode="isnull">array_key_exists('<xsl:value-of select="@nom"/>',$this->contexteRef) and </xsl:template> |
<xsl:template match="parametre" mode="contexte"> |
$contexte['<xsl:value-of select="@nom"/>']= $this->contexteRef['<xsl:value-of select="@nom"/>']; |
</xsl:template> |
<xsl:template match="parametre[position()=last()]" mode="renseigne">!empty($contexte['<xsl:value-of select="@nom"/>']) </xsl:template> |
<xsl:template match="parametre" mode="renseigne">!empty($contexte['<xsl:value-of select="@nom"/>']) and </xsl:template> |
<xsl:template match="*" mode="level1root"> |
$element= new domElement('<xsl:value-of select="name()"/>'); |
$this->baseDOM->appendChild($element); |
<xsl:apply-templates select="@*"/> |
<xsl:apply-templates select="text()"/> |
</xsl:template> |
<xsl:template match="mapping" mode="fetch"> |
<xsl:apply-templates select="*" mode="level1"/> |
</xsl:template> |
<xsl:template match="*" mode="level1"> |
$element= new domElement('<xsl:value-of select="name()"/>'); |
$this->baseDOM->appendChild($element); |
<xsl:apply-templates select="@*"/> |
<xsl:apply-templates select="text()"/> |
<xsl:apply-templates select="*" mode="level2"/> |
</xsl:template> |
<xsl:template match="*" mode="level2"> |
$this->baseDOM = $element; |
$element= new domElement('<xsl:value-of select="name()"/>'); |
$this->baseDOM->appendChild($element); |
<xsl:apply-templates select="@*"/> |
<xsl:apply-templates select="text()"/> |
<xsl:apply-templates select="*" mode="level3"/> |
</xsl:template> |
<xsl:template match="*" mode="level3"> |
$this->baseDOM = $element; |
$element= new domElement('<xsl:value-of select="name()"/>'); |
$this->baseDOM->appendChild($element); |
<xsl:apply-templates select="@*"/> |
<xsl:apply-templates select="text()"/> |
<xsl:apply-templates select="*" mode="level4"/> |
</xsl:template> |
<xsl:template match="*" mode="level4"> |
$this->baseDOM = $element; |
$element= new domElement('<xsl:value-of select="name()"/>'); |
$this->baseDOM->appendChild($element); |
<xsl:apply-templates select="@*"/> |
<xsl:apply-templates select="text()"/> |
</xsl:template> |
<xsl:template match="@*"> |
$element->setAttribute('<xsl:value-of select="name()"/>',<xsl:value-of select="."/>); |
</xsl:template> |
<xsl:template match="text()"> |
/*text(<xsl:value-of select="."/>)*/ |
</xsl:template> |
</xsl:stylesheet> |
/trunk/serveur/generateur/xslt/groupemacroelement.xslt |
---|
New file |
0,0 → 1,51 |
<?xml version="1.0" encoding="UTF-8"?> |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/> |
<xsl:template match="/groupemacroelement"><? |
class <xsl:value-of select="@classe"/> extends groupeMacroElement { |
function __construct($aConn) |
{ |
parent::__construct($aConn); |
} |
function construire() |
{ |
$this->dblock= new blockdedonnees('<xsl:value-of select="@nom"/>'); |
<xsl:apply-templates select="parametres" /> |
$this->buildContext(); |
$this->addMacroElement(); |
} |
function buildContext() |
{ |
} |
function addMacroElement() |
{ |
<xsl:apply-templates select="macroelement" /> |
} |
} |
?> |
</xsl:template> |
<xsl:template match="parametres" > |
<xsl:apply-templates select="parametre" /> |
</xsl:template> |
<xsl:template match="parametre" > |
if (array_key_exists('<xsl:value-of select="@nom"/>',$_REQUEST)) { $this->dblock->ajouterDonnee('<xsl:value-of select="@nom"/>',$_REQUEST['<xsl:value-of select="@nom"/>']); } |
</xsl:template> |
<xsl:template match="macroelement" > |
/*balise:<xsl:value-of select="@nom"/>*/ |
$aMacroElement = $this->macroElementFactory('<xsl:value-of select="@nom"/>',$this->dblock); |
$aMacroElement->construire(); |
</xsl:template> |
</xsl:stylesheet> |
/trunk/serveur/generateur/eflore_generateur.php |
---|
New file |
0,0 → 1,84 |
<? |
require_once '..\\eflore_config.php'; |
header("Content-type: application/vnd.mozilla.xul+xml"); |
echo '<?xml version="1.0" encoding="UTF-8" ?>'; |
echo '<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>'; |
function ecrirelisteFichier($chemin) |
{ |
$repertoire = openDir($chemin); |
while ($fichier = readDir($repertoire)) |
{ |
if (($fichier !='.') && ($fichier !='..')) |
{ |
echo "<listitem label='$fichier'/>"; |
} |
} |
closeDir($repertoire); |
} |
function ecrireFichierMap() |
{ |
$fichierServicesMap = fopen('..\\'.$appConfig['service_map'],"r"); |
$ligne = 0; |
while($donnee=fscanf($fichierServicesMap,"%s\t%s\t%s\t%s\t%s\t%s",$keyName,$serviceName,$viewName,$schema,$ratio,$style)) |
{ |
$ligne++; |
if ($ligne>1) |
{ |
echo "<listitem><listcell label='$keyName'/><listcell label='$serviceName'/><listcell label='$viewName'/><listcell label='$schema'/><listcell label='$ratio'/><listcell label='$style'/></listitem>"; |
} |
} |
fclose($fichierServicesMap); |
} |
?> |
<!DOCTYPE window> |
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" > |
<script type="application/x-javascript" src="eflore_generateur.js" /> |
<hbox flex="1"> |
<vbox flex="1"> |
<label value="Macro Elements"/> |
<listbox id="listemacroelements"> |
<? ecrireListeFichier('..\\'.$appConfig['def_macro']); ?> |
</listbox> |
<hbox> |
<button label="Tout compiler" onclick="compileSelection('listemacroelements')"/> |
<button label="Afficher" onclick="afficheSelection('listemacroelements')"/> |
</hbox> |
</vbox> |
<vbox flex="1"> |
<label value="Service Donnees"/> |
<listbox id="groupesmacroelements"> |
<? ecrireListeFichier('..\\'.$appConfig['def_groupes']); ?> |
</listbox> |
<hbox> |
<button label="Tout compiler" onclick="compileSelection('groupesmacroelements')"/> |
<button label="Afficher" onclick="afficheSelection('groupesmacroelements')"/> |
</hbox> |
</vbox> |
<vbox flex="1"> |
<label value="Publications HTML"/> |
<listbox> |
<? ecrireListeFichier('..\\'.$appConfig['publi_html']); ?> |
</listbox> |
<hbox><button label="Tout compiler"/><button label="Afficher"/></hbox> |
</vbox> |
<vbox flex="1"> |
<label value="Publications XML"/> |
<listbox> |
<? ecrireListeFichier('..\\'.$appConfig['publi_xml']); ?> |
</listbox> |
<hbox><button label="Tout compiler"/><button label="Afficher"/></hbox> |
</vbox> |
</hbox> |
<hbox flex="1" > |
<listbox flex="1"> |
<listcols><listcol flex="1" /><listcol flex="1" /><listcol flex="1" /><listcol flex="1" /><listcol flex="1" /><listcol flex="1" /></listcols> |
<listhead><listheader label="Clef"/><listheader label="Service"/><listheader label="Publication"/><listheader label="Schema a respecter"/><listheader label="Ratio de control"/><listheader label="Style"/></listhead> |
<? ecrireFichierMap(); ?> |
</listbox> |
</hbox> |
</window> |
/trunk/serveur/generateur/eflore_traducteur.php |
---|
New file |
0,0 → 1,67 |
<? |
require_once '..\\eflore_config.php'; |
if(!empty($_REQUEST['listemacroelements'])) |
{ |
genererTousMacroElements('..\\'.$appConfig['def_macro']); |
} |
if(!empty($_REQUEST['groupesmacroelements'])) |
{ |
genererTousGroupesMacroElements('..\\'.$appConfig['def_groupes']); |
} |
function genererTousGroupesMacroElements($chemin) |
{ |
global $appConfig; |
$repertoire = openDir($chemin); |
while ($fichier = readDir($repertoire)) |
{ |
if (($fichier !='.') && ($fichier !='..')) |
{ |
echo "<li>$fichier début de la génération"; |
$res='..\\'.$appConfig['auto_groupes'].$fichier.'.php'; |
genererFichier('xslt\groupemacroelement.xslt',$chemin.$fichier,$res); |
echo "fin de la génération"; |
} |
} |
closeDir($repertoire); |
} |
function genererTousMacroElements($chemin) |
{ |
global $appConfig; |
$repertoire = openDir($chemin); |
while ($fichier = readDir($repertoire)) |
{ |
if (($fichier !='.') && ($fichier !='..')) |
{ |
echo "<li>$fichier début de la génération"; |
$res='..\\'.$appConfig['auto_macro'].$fichier.'.php'; |
genererFichier('xslt\macroelement.xslt',$chemin.$fichier,$res); |
echo "fin de la génération"; |
} |
} |
closeDir($repertoire); |
} |
function genererFichier($xsltFilePath,$xmlFilePath,$resFilePath) |
{ |
$processeur = new XSLTprocessor(); |
$style = new domDocument(); |
$style->load($xsltFilePath); |
$processeur->importStyleSheet($style); |
$doc = new domDocument(); |
$doc->load($xmlFilePath); |
$handle = fopen ($resFilePath, "w"); |
fwrite($handle,$processeur->transformToXML($doc)); |
fclose($handle); |
} |
?> |
/trunk/serveur/configuration/eflore_config.php |
---|
New file |
0,0 → 1,126 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of eFlore-Serveur. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: eflore_config.php,v 1.1.1.1 2004-12-16 12:24:36 jpm Exp $ |
/** |
* Fichier de configuration d'eFlore-Serveur |
* |
* Ce fichier contient les constantes et éventuellement des variables globales contenant toutes les info |
* nécessaire à la configuration du programme eFlore-Serveur. |
* |
*@package eFlore-Serveur |
*@subpackage Configuration |
//Auteur original : |
*@author Frédéric LEGENS <flegens@free.fr> |
//Autres auteurs : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1.1.1 $ $Date: 2004-12-16 12:24:36 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
// Constante générale |
/** Constante stockant la version du programme.*/ |
define('EFSE_VERSION', '0.0.1'); |
/** Constante stockant l'intitulé de version du programme.*/ |
define('EFSE_VERSION_INTITULE', 'Version '.EFSE_VERSION); |
// +------------------------------------------------------------------------------------------------------+ |
// Constante de la base de données |
/** Constante stockant le nom du serveur de la base de donnée.*/ |
define('EFSE_BDD_SERVEUR', 'localhost'); |
/** Constante stockant le nom de la base de donnée.*/ |
define('EFSE_BDD_NOM', 'tela_test_eflore'); |
/** Constante stockant le nom de l'utilisateur.*/ |
define('EFSE_BDD_UTILISATEUR', 'eflorete'); |
/** Constante stockant le mot de passe de l'utilisateur.*/ |
define('EFSE_BDD_MOT_DE_PASSE', 'rcf8wvc'); |
// +------------------------------------------------------------------------------------------------------+ |
// Constante de chemin de dossier et fichier |
$separateur = strstr( PHP_OS, "WIN") ? '\\' : '/'; |
/** Constante stockant le séparateur de dossier qui dépend de l'OS.*/ |
define('EFSE_SEP', $separateur); |
/** Constante stockant le chemin vers la bibliothèque.*/ |
define('EFSE_CHEMIN_BIBLIO', 'bibliotheque'.EFSE_SEP); |
/** Constante stockant le chemin vers la bibliothèque des classes.*/ |
define('EFSE_CHEMIN_CLASSE', EFSE_CHEMIN_BIBLIO.'classes'.EFSE_SEP); |
/** Constante stockant le chemin vers la bibliothèque des interfaces.*/ |
define('EFSE_CHEMIN_INTERFACE', EFSE_CHEMIN_BIBLIO.'interfaces'.EFSE_SEP); |
/** Constante stockant le chemin vers le dossier des définitions.*/ |
define('EFSE_CHEMIN_DEFINITION', 'definitions'.EFSE_SEP); |
/** Constante stockant le chemin vers les groupes de macro-éléments.*/ |
define('EFSE_CHEMIN_DEF_MACRO', EFSE_CHEMIN_DEFINITION.'macro_elements'.EFSE_SEP); |
/** Constante stockant le chemin vers les groupes de macro-éléments.*/ |
define('EFSE_CHEMIN_DEF_MACRO_GROUPE', EFSE_CHEMIN_DEFINITION.'groupes_macro_elements'.EFSE_SEP); |
/** Constante stockant le chemin vers le dossier des publications au format xhtml.*/ |
define('EFSE_CHEMIN_DEF_PUBLI_XHTML', EFSE_CHEMIN_DEFINITION.'publications_html'.EFSE_SEP); |
/** Constante stockant le chemin vers le dossier des publications au format xml.*/ |
define('EFSE_CHEMIN_DEF_PUBLI_XML', EFSE_CHEMIN_DEFINITION.'publications_xml'.EFSE_SEP); |
/** Constante stockant le chemin vers le dossier des fichiers Modèles et Vues pouvant être générés.*/ |
define('EFSE_CHEMIN_MV', 'eflore_mv'.EFSE_SEP); |
/** Constante stockant le chemin vers le dossier des Modèles.*/ |
define('EFSE_CHEMIN_MV_MODELE', EFSE_CHEMIN_MV.'modeles'.EFSE_SEP); |
/** Constante stockant le chemin vers le dossier des Vues.*/ |
define('EFSE_CHEMIN_MV_VUE', EFSE_CHEMIN_MV.'vues'.EFSE_SEP); |
/** Constante stockant le chemin vers le dossier permettant d'automatiser la création de PHP pour les groupes de macro-éléments.*/ |
define('EFSE_CHEMIN_MV_MACRO_GROUPE', EFSE_CHEMIN_MV_MODELE.'groupes_macro_elements'.EFSE_SEP); |
/** Constante stockant le chemin vers le dossier permettant d'automatiser la création de PHP pour les macro-éléments.*/ |
define('EFSE_CHEMIN_MV_MACRO', EFSE_CHEMIN_MV_MODELE.'macro_elements'.EFSE_SEP); |
/** Constante stockant le chemin vers la carte des services principaux.*/ |
define('EFSE_FICHIER_MAP', EFSE_CHEMIN_MV.'eflore_services.map'); |
// Tableau stockant les différentes valeurs permettant de configurer l'appli. |
/* |
$appConfig = array( |
'mysql_host' => 'localhost', |
'mysql_database' => 'eflore-test', |
'mysql_user' => 'eflorete', |
'mysql_password' => 'rcf8wvc', |
'app_version' => 'Version 0.0.1', |
'service_map' => , |
'def_groupes'=>'definitions\\groupesmacroelements\\', |
'def_macro'=>'definitions\\macroelements\\', |
'service_map'=>'definitions\\eflore_services.map', |
'publi_html'=>'definitions\\publicationshtml\\', |
'publi_xml'=>'definitions\\publicationsxml\\', |
'auto_groupes'=>'phpautomatique\\groupesmacroelements\\', |
'auto_macro'=>'phpautomatique\\macroelements\\' |
); |
*/ |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/serveur/definitions/macro_elements/NOM_SELECTION |
---|
New file |
0,0 → 1,64 |
<?xml version="1.0"?> |
<macroelement nom="NOM_SELECTION"> |
<description>Permet de recuperer une liste de noms latin</description> |
<requetes> |
<requete id="r2"> |
<description>Retrouve la liste a partir d'un radical et pour un rang taxonomique donnee |
</description> |
<parametres> |
<parametre nom="radical" legende="radical recherche"/> |
<parametre nom="rang" legende="rang taxonomique"/> |
</parametres> |
<sql>SELECT nom.*, intitule.eni_intitule_nom |
FROM eflore_nom_intitule as intitule, |
eflore_nom as nom |
WHERE intitule.eni_intitule_nom like '%${contexte['radical']}%' |
and nom.en_id_nom = intitule.eni_id_nom |
and nom.en_ce_rang = ${contexte['rang']} |
</sql> |
</requete> |
<requete id="r1"> |
<description>Retrouve la liste a partir d'un radical |
</description> |
<parametres> |
<parametre nom="radical" legende="radical recherche"/> |
</parametres> |
<sql>SELECT nom.*, intitule.eni_intitule_nom |
FROM eflore_nom_intitule as intitule, |
eflore_nom as nom |
WHERE intitule.eni_intitule_nom like '%${contexte['radical']}%' |
and nom.en_id_nom = intitule.eni_id_nom |
</sql> |
</requete> |
</requetes> |
<publications> |
<publication id="" type="xml" default="true"> |
<description>ici la description de la publication</description> |
<dom> |
<liste_nom_latin root="true"> |
<nom nt="5"> |
<auteur>titi</auteur> |
</nom> |
<nom2/> |
</liste_nom_latin> |
</dom> |
</publication> |
<publication id="" type="xhtml"> |
<description>ici la description de la methode de publication</description> |
<dom> |
<A href="${donnees['en_id_nom']}">${donnees['en_nom_genre']}</A> |
</dom> |
</publication> |
<publication id="" type="rdf" default="true"> |
<description>ici la description de la publication</description> |
<dom> |
<liste_nom_latin root="true"> |
<nom nt="5"> |
<auteur>titi</auteur> |
</nom> |
<nom2/> |
</liste_nom_latin> |
</dom> |
</publication> |
</publications> |
</macroelement> |
/trunk/serveur/definitions/groupes_macro_elements/selectionnoms |
---|
New file |
0,0 → 1,9 |
<?xml version="1.0"?> |
<groupemacroelement classe="selectionnoms" nom="FICHE_LISTE_NOMS"> |
<description>Ici la description du groupedemacroelements</description> |
<parametres> |
<parametre nom="radical" legende="ici la legende du parametre radical"/> |
<parametre nom="rang" legende="ici la legende du parametre rang"/> |
</parametres> |
<macroelement nom="NOM_SELECTION"/> |
</groupemacroelement> |
/trunk/serveur/bibliotheque/interfaces/eflore_macro_element.interface.php |
---|
New file |
0,0 → 1,6 |
<? |
interface iMacroElement { |
function __construct($aConn,$parentDataBlock); |
function construire(); |
}; |
?> |
/trunk/serveur/bibliotheque/interfaces/eflore_vue.interface.php |
---|
New file |
0,0 → 1,6 |
<? |
interface iVue { |
function __construct($unBlock); |
function serialiser(); |
}; |
?> |
/trunk/serveur/bibliotheque/interfaces/eflore_model.interface.php |
---|
New file |
0,0 → 1,7 |
<? |
interface iModel { |
function __construct($aConn); |
function contruire(); |
function recupererBlockDeDonnees(); |
}; |
?> |
/trunk/serveur/bibliotheque/classes/eflore_collection_block_de_donnees.class.php |
---|
New file |
0,0 → 1,62 |
<? |
class collectionblockdedonnees{ |
protected $identifiant; |
protected $collection; |
protected $erreur; |
function __construct($identifiant) |
{ |
$this->identifiant = $identifiant; |
$this->collection = array(); |
} |
function affecterIdentifiant($identifiant) |
{ |
$this->identifiant = $identifiant; |
} |
function ajouterDonnees($donnees) |
{ |
$block = new blockdedonnees($this->identifiant); |
$block->affecterDonnees($donnees); |
$this->affecterBlockDeDonnees($block); |
} |
function affecterBlockDeDonnees($blockdonnees) |
{ |
array_push($this->collection,$blockdonnees); |
} |
function recupererBlocksDeDonnees() |
{ |
return $this->collection; |
} |
function recupererIdentifiant() |
{ |
return $this->identifiant; |
} |
function recupererErreur() |
{ |
return $this->erreur; |
} |
function afficher() |
{ |
echo "<LI><B>$this->identifiant</B></LI>"; |
for($i=0;$i<count($this->collection);$i++) |
{ |
$uneCollection =$this->collection[$i]; |
$uneCollection->afficher(); |
} |
} |
} |
?> |
/trunk/serveur/bibliotheque/classes/eflore_macro_element.class.php |
---|
New file |
0,0 → 1,80 |
<? |
class macroElement implements iMacroElement{ |
protected $identifiantblockdedonnees; |
protected $connexion; |
protected $contexteRef; |
protected $blockdedonneesParent; |
protected $collectionblockdedonnees; |
protected $idRes; |
function __construct($aConn,$aParentDataBlock,$identifiant) |
{ |
$this->connexion = $aConn; |
$this->blockdedonneesParent = $aParentDataBlock; |
$this->identifiantblockdedonnees = $identifiant; |
$this->contexteRef = $this->blockdedonneesParent->recupererDonnees(); |
} |
function construire() |
{ |
$sql=$this->getSQL(); |
if(!is_NULL($sql)) |
{ |
$this->openCursor($sql); |
while ($this->fetch()); |
$this->closeCursor(); |
} |
} |
function contruireparrecursiviteplate() |
{ |
construire(); |
$this->$contexteRef = $this->blockdedonnees; |
construire(); |
} |
function contruireparrecursivite() |
{ |
} |
function openCursor($sql) |
{ |
$res = mysql_query($sql,$this->connexion); |
if (!$res) echo mysql_errno() . ": " . mysql_error() . "\n"; |
$this->idRes= $res; |
$this->collectionblockdedonnees = new collectionblockdedonnees($this->identifiantblockdedonnees); |
$this->blockdedonneesParent->ajouterCollectionBlockFils($this->collectionblockdedonnees); |
} |
function fetch() |
{ |
$res=mysql_fetch_assoc($this->idRes); |
if (!$res) |
{} |
else |
{ |
//$this->blockdedonnees = new blockdedonnees($this->identifiantblockdedonnees); |
//$this->blockdedonnees->affecterDonnees($res); |
$this->collectionblockdedonnees->ajouterDonnees($res); |
} |
return $res; |
} |
function closeCursor() |
{ |
mysql_free_result($this->idRes); |
} |
} |
?> |
/trunk/serveur/bibliotheque/classes/eflore_groupe_macro_element.class.php |
---|
New file |
0,0 → 1,40 |
<? |
require_once 'eflore_macro_element.class.php'; |
abstract class groupeMacroElement implements iModel{ |
protected $connexion; |
protected $contexte; |
protected $newContexte; |
protected $dblock; |
function __construct($aConn) |
{ |
$this->connexion = $aConn; |
} |
function contruire() |
{ |
} |
function recupererBlockDeDonnees() |
{ |
return $this->dblock; |
} |
function macroElementFactory($macroElementName,$parentDataBlock) |
{ |
require_once EFSE_CHEMIN_MV_MACRO.$macroElementName.'.php'; |
$aMacroElement = new $macroElementName($this->connexion,$parentDataBlock,$macroElementName); |
return $aMacroElement; |
} |
} |
?> |
/trunk/serveur/bibliotheque/classes/eflore_block_de_donnees.class.php |
---|
New file |
0,0 → 1,100 |
<? |
class blockdedonnees{ |
protected $identifiant; |
protected $donnees; |
protected $collectionBlocksfils; |
protected $erreur; |
function __construct($identifiant) |
{ |
$this->identifiant = $identifiant; |
$this->donnees = array(); |
$this->collectionBlocksfils = array(); |
} |
function affecterIdentifiant($identifiant) |
{ |
$this->identifiant = $identifiant; |
} |
function affecterDonnees($donnees) |
{ |
$this->donnees = $donnees; |
} |
function recupererDonnees() |
{ |
return $this->donnees; |
} |
function ajouterDonnee($clef,$valeur) |
{ |
$this->donnees["$clef"] = $valeur; |
} |
function recupererDonnee($clef) |
{ |
return $this->donnees["$clef"]; |
} |
function recupererErreur() |
{ |
return $this->erreur; |
} |
function recupererBlockFils() |
{ |
return $this->blocksfils; |
} |
function ajouterCollectionBlockFils($collectionBlock) |
{ |
array_push($this->collectionBlocksfils,$collectionBlock); |
} |
function afficherPattern($chemin,$fonction) |
{ |
if($chemin==$this->identifiant) |
{ |
} |
else |
{ |
$etape_chemin = explode('>',$chemin); |
if($chemin==$etape_chemin[0]) |
{ |
for($i=0;$i<count($this->collectionBlocksfils);$i++) |
{ |
$collection =$this->collectionBlocksfils[$i]; |
if ($collection->recupererIdentifiant()==$etape_chemin[1]) |
{ |
array_shift($etape_chemin); |
afficherPattern(implode('>',$etape_chemin),$fonction); |
} |
} |
} |
} |
} |
function afficher() |
{ |
echo "<OL>"; |
foreach($this->donnees as $key => $value) |
{ |
echo "<li>$key:$value "; |
} |
echo "</OL>"; |
for($i=0;$i<count($this->collectionBlocksfils);$i++) |
{ |
$collection =$this->collectionBlocksfils[$i]; |
echo "<OL>"; |
$collection->afficher(); |
echo "</OL>"; |
} |
} |
} |
?> |
/trunk/serveur/eflore_serveur.php |
---|
New file |
0,0 → 1,119 |
<?php |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | PHP version 4.1 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of eFlore-Serveur. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: eflore_serveur.php,v 1.1.1.1 2004-12-16 12:24:36 jpm Exp $ |
/** |
* Fichier principal d'eFlore-Serveur |
* |
* Ce fichier initialise le programme lance la recherche des infos et transfères les données |
* à la vue demandée par l'action. |
* Abréviation du programme : EFSE |
* |
*@package eFlore-Serveur |
//Auteur original : |
*@author Frédéric LEGENS <flegens@free.fr> |
//Autres auteurs : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.1.1.1 $ $Date: 2004-12-16 12:24:36 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
// +------------------------------------------------------------------------------------------------------+ |
// | ENTETE du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
require_once 'configuration/eflore_config.php'; |
require_once EFSE_CHEMIN_INTERFACE.'eflore_model.interface.php'; |
require_once EFSE_CHEMIN_INTERFACE.'eflore_vue.interface.php'; |
require_once EFSE_CHEMIN_INTERFACE.'eflore_macro_element.interface.php'; |
require_once EFSE_CHEMIN_CLASSE.'eflore_block_de_donnees.class.php'; |
require_once EFSE_CHEMIN_CLASSE.'eflore_collection_block_de_donnees.class.php'; |
require_once EFSE_CHEMIN_CLASSE.'eflore_groupe_macro_element.class.php'; |
// +------------------------------------------------------------------------------------------------------+ |
// | CORPS du PROGRAMME | |
// +------------------------------------------------------------------------------------------------------+ |
$key = $_REQUEST['key']; |
/* Lecture du fichier donnant la carte des services disponibles */ |
$fichierServicesMap = fopen(EFSE_FICHIER_MAP,"r"); |
while($donnee = fscanf($fichierServicesMap, "%s\t%s\t%s\t%s\t%s\t%s", $keyName, $serviceName, $viewName, $schema, $ratio, $style)) { |
if ($key == $keyName) { |
runService($serviceName,$viewName,$schema,$ratio,$style); |
} |
} |
fclose($fichierServicesMap); |
// +------------------------------------------------------------------------------------------------------+ |
// | LISTE de FONCTIONS | |
// +------------------------------------------------------------------------------------------------------+ |
function runService($serviceName, $viewName, $schema, $ratio, $style) |
{ |
$aConn = ''; |
$dataBlock = ''; |
$aModel = fabriquerModel($serviceName); |
if ($aModel != null) { |
$aModel->construire(); |
$dataBlock = $aModel->recupererBlockDeDonnees(); |
} |
$uneVue = fabriquerVue($viewName, $dataBlock); |
if ($uneVue != null) { |
$uneVue->serialiser(); |
} |
} |
function fabriquerModel($modelName) |
{ |
require_once EFSE_CHEMIN_MV_MACRO_GROUPE.$modelName.'.php'; |
$aConn = donneConnexionBaseDeDonnees(); |
$aModel = new $modelName($aConn); |
return $aModel; |
} |
function fabriquerVue($viewName,$block) |
{ |
require_once EFSE_CHEMIN_MV_VUE.$viewName.'.php'; |
$uneVue = new $viewName($block); |
return $uneVue; |
} |
function donneConnexionBaseDeDonnees() { |
if (!$linkid = mysql_connect(EFSE_BDD_SERVEUR, EFSE_BDD_UTILISATEUR, EFSE_BDD_MOT_DE_PASSE)) { |
echo '<ERREUR>'; |
echo 'Impossible d\'établir de connexion à'.EFSE_BDD_SERVEUR; |
echo '</ERREUR>'; |
exit(0); |
} |
mysql_select_db(EFSE_BDD_NOM, $linkid); |
return $linkid; |
} |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |
?> |
/trunk/serveur/serveurXML.zip |
---|
New file |
0,0 → 1,86 |
PK \<1§Õhw _ definitions/eflore_services.map¥AÂ0ÏFêWôÜùEµê8Rìú{BOâÔ¼¶wV;b!C9â2hf¼Vaq@ç·%ªÁ¹Üz-Ò¾Ú]¼; CK¶kÄæÓïJ Ï0?ÏB:Ðe¤ÿA8AmÁýew§@?PK :<1>ªÞÊÆ . definitions/groupesmacroelements/selectionnomsÁ |
+^l-õ¡¤5qǽßAD'èB®mjìôhk0иF#±G tôcé¹f=J÷Öåñt¿^ßè|7 À4}vÊxåS4jÙôvµáÕb~ ¸ÒÖE¸Q÷É'mì!`Àóñõl1ûI9¾ $ÇGw 5·¯VäÓ·ã¤eFÆÎÑ,yÙgD.puÊ`\Á¬¾+¨-¶:`¨ÓG꯸å_úcìQ^55U 3h×Æ fà¿V$4-8Fh%í3潯P |
+Ã@ai2 =4yiËnäÑ8Qì¸æÀY;.H1áêÐ=4á¢ñظÔP<m]|jzþ|Ö¯t¯\g®!²Ñ÷ΡÐÆF" |
+¹sceÜ뿯Ïl®2vt·Û½õuÒûÌÂòñp3z+éO/q?'WÿÐÞ«áéð>¿PK ÷¬1-@fkö g eflore_config.php ÏNÃ0ÏTê;D&A5ÎÐîÀ;py»FJ,NÆöö¤É ]Ç£ýû¾Ø²òº1½É³<»cÞôÐ=«Xç<»+Ô÷\ÁªR7 cù8Å-8ØaB°ÚâÃkÈÚ90Ï}hÛ¦<%a~DKB©ý |
+¶.×åsbÂGÑ W`Ób'áFÛ4_*G(Zâ{«½A*ªúÊÙ^ú |
+«Q¢ÂÁ îäÅàÆú/·~ÝÍø¼wJÞ81j V#ð5')§Ó$wz~ðÆ |
+àÁãß7î÷æR Æê%Ï6õ'PK ïµ|1Fò¿Wb q " |