Subversion Repositories eFlore/Applications.coel

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1913 → Rev 1944

/tags/v1.11-okuzgozu/build.properties
New file
0,0 → 1,17
projectName = org.tela_botanica.Coel
# pour la compilation "rapide" (ant quick)
projectTestName = org.tela_botanica.Coel-dev
celhost = coel
 
# le répertoire "resources" de gxt (doit contenir "chart", "css", ...). Eg;
# svn co http://extjs-public.googlecode.com/svn/gxt-2.x/release/resources ~/gxt/gxt-2.2.5/resources
gxtresdir = ${user.home}/src/gwt/gxt/gxt-2.2.5/resources
 
# note: les répertoires de gwt et gwtext sont fixé relatif à $HOME dans build.xml
 
# pour la mise en -prod/-test tout en conservant plusieurs fichiers de configurations
# corrects en parallèle, eg:
# ant -Dapropos=war/config/apropos.test.js -Dconfigparams="Version de test spéciale eflore-test" config
desthost = sequoia
destdir= /home/telabotap/www/eflore-test/coel/
apropos = war/config/apropos.js
/tags/v1.11-okuzgozu/build.xml
New file
0,0 → 1,80
<project name="coel" xmlns:artifact="urn:maven-artifact-ant" basedir=".">
 
<property file="build.properties"/>
<property name="gxtdestdir" value="src/org/tela_botanica/public"/>
<property name="confparams" value=""/>
 
<path id="gwt">
<!-- todo: utiliser le mode de configuration des chemins du build.xml du CEL -->
<fileset includes="*.jar" dir="${user.home}/src/gwt/gwt/build/lib"/>
<fileset includes="*.jar" dir="${user.home}/src/gwt/gwt-google-apis/maps/build/lib"/>
<fileset includes="gxt-2.3.0-gwt22.jar" dir="${user.home}/src/gwt/gxt"/>
<pathelement location="src" />
</path>
 
<!-- todo: must be inside coel*.gwt.xml in some way -->
<target name="link-resources">
<mkdir dir="${gxtdestdir}"/>
<!-- doit lier "resources" dans upstream à src/org/.../public/gxt -->
<symlink overwrite="true" link="${gxtdestdir}/gxt" resource="${gxtresdir}"/>
</target>
 
 
<target name="test"><echoproperties/></target> <!-- sometimes useful -->
 
<target name="compile" depends="link-resources">
<!-- <java classname="com.google.gwt.dev.GWTCompiler" fork="true"> -->
<java classname="com.google.gwt.dev.Compiler" fork="true">
<arg line="-localWorkers 2 -style DETAILED ${projectName}"/>
<!-- <arg line="-out build/gwtOutput"/> -->
<classpath refid="gwt"/>
</java>
<exec resolveexecutable="true" executable="m4" input="war/config/apropos.js.m4" output="war/config/apropos.js">
<arg line="-D _JREST_SERVICES_PATH_=jrest/services -D _SUFFIX_='${confparams}'" />
</exec>
</target>
 
<target name="quick" depends="link-resources">
<java classname="com.google.gwt.dev.Compiler" fork="true">
<arg line="-style DETAILED -draftCompile ${projectTestName}" />
<classpath refid="gwt"/>
</java>
</target>
 
<!-- génération d'un fichier pour test:
ant -Dsuffix="Version de test" config -->
<target name="config">
<echo message="mise à jour de ${apropos}"/>
<exec resolveexecutable="true" executable="m4" input="war/config/apropos.js.m4" output="war/config/apropos.js">
<arg line="-D _JREST_SERVICES_PATH_=jrest/services -D _SUFFIX_='${confparams}'" />
</exec>
<echo message="please do # rsync -avuin --no-o --no-g --exclude=WEB-INF --exclude=config war/ ${desthost}:${destdir}/"/>
<echo message="scp -p ${apropos} ${desthost}:${destdir}/config/apropos.js"/>
</target>
 
 
 
<target name="debug" depends="link-resources">
<java classname="com.google.gwt.dev.Compiler" fork="true">
<arg line="-style DETAILED -logLevel DEBUG"/> <!-- TRACE -->
<arg value="${projectName}" />
<classpath refid="gwt"/>
</java>
</target>
 
 
<target name="testlive">
<java classname="com.google.gwt.dev.DevMode" spawn="true" fork="true">
<arg line="-startupUrl http://${celhost}/war/Coel.html -whitelist http://www.tela-botanica.org -noserver -codeServerPort auto ${projectTestName}" />
<classpath refid="gwt"/>
</java>
</target>
 
<target name="live">
<java classname="com.google.gwt.dev.DevMode" spawn="true" fork="true">
<arg line="-startupUrl http://${celhost}/war/Coel.html -whitelist http://www.tela-botanica.org -noserver -codeServerPort auto ${projectName}" />
<classpath refid="gwt"/>
</java>
</target>
 
</project>
/tags/v1.11-okuzgozu/Coel-classpath
New file
0,0 → 1,5
./src:
./war/WEB-INF/classes:
/opt/gwt-2.1.0/gwt-user.jar:
/opt/gwt-2.1.0/gwt-dev.jar:
/opt/gxt-2.2.0/gxt.jar
/tags/v1.11-okuzgozu/doc/xsd/coel_element.xsd
New file
0,0 → 1,30
<?xml version="1.0" encoding="UTF-8"?>
<!-- ==================================================================== -->
<!-- Introduction -->
<!-- ==================================================================== -->
<!-- Schema to declare an abstract data element for use in substitution -->
<!-- groups so that arbitrary lists of elements so derived can be used to -->
<!-- compose a record. For example, see DarwinRecord.xsd -->
<!-- History: -->
<!-- version 0.5 2007-02-14 Renato De Giovanni, John Wieczorek -->
<!-- Status: -->
<!-- Ready for testing. -->
<!-- See http://wiki.tdwg.org for current status of this standard -->
 
<!-- ==================================================================== -->
<!-- Schema -->
<!-- ==================================================================== -->
<xs:schema
targetNamespace="http://www.tela-botanica.org/schemas/coel/1.00/element"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" version="0.5">
 
<!-- ============================================================== -->
<!-- Elements -->
<!-- ============================================================== -->
<xs:element name="coelElement" abstract="true"/>
<xs:annotation>
<xs:documentation source="http://wiki.tdwg.org/twiki/bin/view/DarwinCore/DarwinElement" xml:lang="en"/>
</xs:annotation>
 
</xs:schema>
/tags/v1.11-okuzgozu/doc/xsd/coel_tapir_record_1_00.xsd
New file
0,0 → 1,30
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.tela-botanica.org/schemas/coel/1.00/record"
xmlns:coelcore="http://www.tela-botanica.org/schemas/coel/1.00"
elementFormDefault="qualified"
version="0.5">
<xs:import namespace="http://www.tela-botanica.org/schemas/coel/1.00" schemaLocation="http://www.tela-botanica.net/doc/coel/xsd/coel_tapir_1_00.xsd"/>
<xs:element name="RecordSet">
<xs:complexType>
<xs:sequence>
<xs:element name="Record" maxOccurs="unbounded">
<xs:complexType>
 
<xs:sequence>
<xs:element ref="coelcore:Id" />
<xs:element ref="coelcore:CeTable" />
<xs:element ref="coelcore:CleLigne" />
<xs:element ref="coelcore:Enregistrement" />
<xs:element ref="coelcore:DateModification" />
<xs:element ref="coelcore:CeEtat" />
</xs:sequence>
 
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
/tags/v1.11-okuzgozu/doc/xsd/tb_coel_str.xsd
New file
0,0 → 1,86
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- Introduction -->
<!-- ===================================================================== -->
<!-- Darwin Core XML schema -->
<!-- History: -->
<!-- version 0.7 2007-04-23 R. De Giovanni: Changed namespace -->
<!-- version 0.6 2007-04-17 R. De Giovanni: Added qualification for -->
<!-- types included from tdwg_basetypes.xsd -->
<!-- version 0.5 2007-02-14 J. Wieczorek, R. De Giovanni, J. de la Torre -->
<!-- Status: -->
<!-- Ready for testing -->
<!-- See http://wiki.tdwg.org for current status of this standard. -->
<!-- ===================================================================== -->
<!-- Schema -->
<!-- ===================================================================== -->
<xs:schema targetNamespace="http://www.tela-botanica.org/coel/str/" xmlns:cse="http://www.tela-botanica.org/coel/str/element" xmlns:cs="http://www.tela-botanica.org/coel/str/" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="0.1">
 
<!-- ============================================================== -->
<!-- Documentation -->
<!-- ============================================================== -->
<xs:annotation>
<xs:documentation>Protocole XML Schema pour COEL Structure. Pour la documentation complête voir http://www.tela-botanica.org/appli:coel/doc/v1.00/</xs:documentation>
</xs:annotation>
 
<!-- ============================================================== -->
<!-- Includes -->
<!-- ============================================================== -->
<!-- include - inclusions must be top-level elements (children of -->
<!-- the xs:schema element. Inclusion is restricted to the -->
<!-- definition of a single namespace. -->
<!-- ============================================================== -->
<xs:include schemaLocation="http://rs.tdwg.org/dwc/tdwg_basetypes.xsd"/>
 
<!-- ============================================================== -->
<!-- Imports -->
<!-- ============================================================== -->
<!-- import - must be used to import definitions from other -->
<!-- namespaces. -->
<!-- ============================================================== -->
<xs:import namespace="http://www.tela-botanica.org/coel/str/element" schemaLocation="http://localhost/coel/doc/xsd/tb_coel_str_element.xsd"/>
 
<!-- ============================================================== -->
<!-- Elements -->
<!-- ============================================================== -->
<xs:element name="IdStructure" type="xs:nonNegativeInteger" substitutionGroup="cse:coelStrElement" nillable="false">
<xs:annotation>
<xs:documentation source="http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_structure.html#cs_id_structure" xml:lang="fr"/>
</xs:annotation>
</xs:element>
<xs:element name="CeProjet" type="xs:nonNegativeInteger" substitutionGroup="cse:coelStrElement" nillable="false">
<xs:annotation>
<xs:documentation source="http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_structure.html#cs_ce_projet" xml:lang="fr"/>
</xs:annotation>
</xs:element>
<xs:element name="CeMere" type="xs:nonNegativeInteger" substitutionGroup="cse:coelStrElement" nillable="true">
<xs:annotation>
<xs:documentation source="http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_structure.html#cs_ce_mere" xml:lang="fr"/>
</xs:annotation>
</xs:element>
<xs:element name="Guid" type="xs:string" substitutionGroup="cse:coelStrElement" nillable="false">
<xs:annotation>
<xs:documentation source="http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_structure.html#cs_guid" xml:lang="fr"/>
</xs:annotation>
</xs:element>
<xs:element name="TrukIdentifiantAlternatif" type="xs:string" substitutionGroup="cse:coelStrElement" nillable="true">
<xs:annotation>
<xs:documentation source="http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_structure.html#cs_truk_identifiant_alternatif" xml:lang="fr"/>
</xs:annotation>
</xs:element>
<xs:element name="Nom" type="xs:string" substitutionGroup="cse:coelStrElement" nillable="true">
<xs:annotation>
<xs:documentation source="http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_structure.html#cs_nom" xml:lang="fr"/>
</xs:annotation>
</xs:element>
<xs:element name="DateModification" type="xs:dateTime">
<xs:annotation>
<xs:documentation source="http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_meta_historique_ligne.html#cmhl_date_modification" xml:lang="fr" />
</xs:annotation>
</xs:element>
<xs:element name="CeEtat" type="xs:nonNegativeInteger">
<xs:annotation>
<xs:documentation source="http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_meta_historique_ligne.html#cmhl_ce_etat" xml:lang="fr" />
</xs:annotation>
</xs:element>
</xs:schema>
/tags/v1.11-okuzgozu/doc/xsd/coel_tapir_1_00.xsd
New file
0,0 → 1,62
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- Introduction -->
<!-- ===================================================================== -->
<!-- COEL Core XML schema -->
<!-- Historique: -->
<!-- version 1.00 2010-02-11 J.-P. Milcent: création -->
<!-- Statut: -->
<!-- en test -->
 
<!-- ===================================================================== -->
<!-- Schema -->
<!-- ===================================================================== -->
 
<xs:schema targetNamespace="http://www.tela-botanica.org/schemas/coel/1.00"
xmlns:coele="http://www.tela-botanica.org/schemas/coel/1.00/element"
xmlns:coelc="http://www.tela-botanica.org/schemas/coel/1.00"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" version="1.00">
 
<!-- ============================================================== -->
<!-- Documentation -->
<!-- ============================================================== -->
<xs:annotation>
<xs:documentation> XML Schema pour COEL Core</xs:documentation>
</xs:annotation>
 
<!-- ============================================================== -->
<!-- Inclusion -->
<!-- ============================================================== -->
<!-- include - inclusions must be top-level elements (children of -->
<!-- the xs:schema element. Inclusion is restricted to the -->
<!-- definition of a single namespace. -->
<!-- ============================================================== -->
<xs:include schemaLocation="http://www.tela-botanica.net/doc/coel/xsd/tdwg_basetypes.xsd"/>
 
 
<!-- ============================================================== -->
<!-- Imports -->
<!-- ============================================================== -->
<!-- import - must be used to import definitions from other -->
<!-- namespaces. -->
<!-- ============================================================== -->
<xs:import namespace="http://www.tela-botanica.org/schemas/coel/1.00/element"
schemaLocation="http://www.tela-botanica.net/doc/coel/xsd/coel_element.xsd"/>
 
<!-- ============================================================== -->
<!-- Elements -->
<!-- ============================================================== -->
<xs:element name="Id" type="xs:string" substitutionGroup="coele:coelElement" nillable="false" />
 
<xs:element name="CeTable" type="xs:double" substitutionGroup="coele:coelElement" nillable="false" />
 
<xs:element name="CleLigne" type="xs:string" substitutionGroup="coele:coelElement" nillable="false" />
<xs:element name="Enregistrement" type="xs:string" substitutionGroup="coele:coelElement" nillable="false" />
<xs:element name="DateModification" type="xs:dateTime" substitutionGroup="coele:coelElement" nillable="false" />
<xs:element name="CeEtat" type="xs:double" substitutionGroup="coele:coelElement" nillable="false" />
 
</xs:schema>
/tags/v1.11-okuzgozu/doc/xsd/tdwg_basetypes.xsd
New file
0,0 → 1,88
<?xml version="1.0" encoding="UTF-8"?>
<!-- ==================================================================== -->
<!-- Introduction -->
<!-- ==================================================================== -->
<!-- Schema for a type library for darwin and extension data types. -->
<!-- History: -->
<!-- version 0.5 2007-02-14 John Wieczorek -->
<!-- Status: -->
<!-- Ready for testing. -->
<!-- Should be placed in a tdwg shared data types library. -->
<!-- See http://wiki.tdwg.org for current status of this standard -->
 
<!-- ==================================================================== -->
<!-- Schema -->
<!-- ==================================================================== -->
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified" version="0.5">
 
<!-- ============================================================== -->
<!-- Types -->
<!-- ============================================================== -->
<xs:simpleType name="positiveDouble">
<xs:restriction base="xs:double">
<xs:minExclusive value="0"/>
</xs:restriction>
</xs:simpleType>
 
<xs:simpleType name="dayOfYearDataType">
<xs:restriction base="xs:integer">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="366"/>
</xs:restriction>
</xs:simpleType>
 
<xs:simpleType name="decimalLatitudeDataType">
<xs:restriction base="xs:double">
 
<xs:minInclusive value="-90"/>
<xs:maxInclusive value="90"/>
</xs:restriction>
</xs:simpleType>
 
<xs:simpleType name="decimalLongitudeDataType">
<xs:restriction base="xs:double">
<xs:minInclusive value="-180"/>
<xs:maxInclusive value="180"/>
 
</xs:restriction>
</xs:simpleType>
 
<xs:simpleType name="spatialFitDataType">
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:double">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="0"/>
 
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:double">
<xs:minInclusive value="1"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
 
<xs:enumeration value="undefined"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
 
<xs:simpleType name="DateTimeISO">
<xs:annotation>
<xs:documentation xml:lang="en">
 
The date and time expressed in a way conforming to a subset of ISO 8601. Meant to be exactly the same as DateTimeISO defined in ABCD.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="\d\d\d\d(\-(0[1-9]|1[012])(\-((0[1-9])|1\d|2\d|3[01])(T(0\d|1\d|2[0-3])(:[0-5]\d){0,2})?)?)?|\-\-(0[1-9]|1[012])(\-(0[1-9]|1\d|2\d|3[01]))?|\-\-\-(0[1-9]|1\d|2\d|3[01])">
</xs:pattern>
</xs:restriction>
</xs:simpleType>
 
</xs:schema>
/tags/v1.11-okuzgozu/doc/xsd/tb_coel_str_element.xsd
New file
0,0 → 1,26
<?xml version="1.0" encoding="UTF-8"?>
<!-- ==================================================================== -->
<!-- Introduction -->
<!-- ==================================================================== -->
<!-- Schema to declare an abstract data element for use in substitution -->
<!-- groups so that arbitrary lists of elements so derived can be used to -->
<!-- compose a record. For example, see DarwinRecord.xsd -->
<!-- History: -->
<!-- version 0.5 2007-02-14 Renato De Giovanni, John Wieczorek -->
<!-- Status: -->
<!-- Ready for testing. -->
<!-- See http://wiki.tdwg.org for current status of this standard -->
<!-- ==================================================================== -->
<!-- Schema -->
<!-- ==================================================================== -->
<xs:schema targetNamespace="http://www.tela-botanica.org/coel/str/element" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="0.1">
 
<!-- ============================================================== -->
<!-- Elements -->
<!-- ============================================================== -->
<xs:element name="coelStrElement" abstract="true"/>
<xs:annotation>
<xs:documentation source="http://www.tela-botanica.org/appli:coel/doc/v1.00/coelStrElement" xml:lang="en"/>
</xs:annotation>
 
</xs:schema>
/tags/v1.11-okuzgozu/doc/cns/coel_1_00.xml
New file
0,0 → 1,40
<?xml version="1.0" encoding="UTF-8"?>
<cns>
<schema namespace="http://www.tela-botanica.org/schemas/coel/1.00">
<label>Coel v1.00</label>
<alias>coel_1_00</alias>
<location>http://www.tela-botanica.net/doc/coel/xsd/coel_tapir_1_00.xsd</location>
<concepts>
<concept id="http://www.tela-botanica.org/coel/doc/v1.00/concept/id" required="true">
<alias>Id</alias>
<datatype>http://www.w3.org/2001/XMLSchema#nonNegativeInteger</datatype>
<doc>http://www.tela-botanica.net/doc/coel/bdd/v1.00/coel_table_coel_historique_ligne.html#cmhl_id_historique_ligne</doc>
</concept>
<concept id="http://www.tela-botanica.org/coel/doc/v1.00/concept/ce_table" required="true">
<alias>CeTable</alias>
<datatype>http://www.w3.org/2001/XMLSchema#nonNegativeInteger</datatype>
<doc>http://www.tela-botanica.org/doc/coel/bdd/v1.00/coel_table_coel_historique_ligne.html#cmhl_ce_table</doc>
</concept>
<concept id="http://www.tela-botanica.org/coel/doc/v1.00/concept/cle_ligne" required="true">
<alias>CleLigne</alias>
<datatype>http://www.w3.org/2001/XMLSchema#String</datatype>
<doc>http://www.tela-botanica.org/doc/coel/bdd/v1.00/coel_table_coel_historique_ligne.html#cmhl_cle_ligne</doc>
</concept>
<concept id="http://www.tela-botanica.org/coel/doc/v1.00/concept/enregistrement" required="true">
<alias>Enregistrement</alias>
<datatype>http://www.w3.org/2001/XMLSchema#String</datatype>
<doc>http://www.tela-botanica.org/doc/coel/bdd/v1.00/coel_table_coel_historique_ligne.html#cmhl_enregistrement</doc>
</concept>
<concept id="http://www.tela-botanica.org/coel/doc/v1.00/concept/date_modification" required="true">
<alias>DateModification</alias>
<datatype>http://www.w3.org/2001/XMLSchema#dateTime</datatype>
<doc>http://www.tela-botanica.org/doc/coel/bdd/v1.00/coel_table_coel_meta_historique_ligne.html#cmhl_date_modification</doc>
</concept>
<concept id="http://www.tela-botanica.org/coel/doc/v1.00/concept/ce_etat" required="true">
<alias>CeEtat</alias>
<datatype>http://www.w3.org/2001/XMLSchema#nonNegativeInteger</datatype>
<doc>http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_meta_historique_ligne.html#cmhl_ce_etat</doc>
</concept>
</concepts>
</schema>
</cns>
/tags/v1.11-okuzgozu/doc/cns/coelstr_1_00.xml
New file
0,0 → 1,50
<?xml version="1.0" encoding="UTF-8"?>
<cns>
<schema namespace="http://www.tela-botanica.org/coel/str/">
<label>Coel Structure v1.00</label>
<alias>coelstr_1_00</alias>
<location>http://localhost/coel/doc/xsd/tb_coel_str.xsd</location>
<concepts>
<concept id="http://www.tela-botanica.org/appli:coel/doc/v1.00/concept/str/id_structure" required="true">
<alias>IdStructure</alias>
<datatype>http://www.w3.org/2001/XMLSchema#nonNegativeInteger</datatype>
<doc>http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_structure.html#cs_id_structure</doc>
</concept>
<concept id="http://www.tela-botanica.org/appli:coel/doc/v1.00/concept/str/ce_projet" required="true">
<alias>CeProjet</alias>
<datatype>http://www.w3.org/2001/XMLSchema#nonNegativeInteger</datatype>
<doc>http://www.tela-botanica.org/appli:coel/doc/v1.00//coel_table_coel_structure.html#cs_ce_projet</doc>
</concept>
<concept id="http://www.tela-botanica.org/appli:coel/doc/v1.00/concept/str/ce_mere">
<alias>CeMere</alias>
<datatype>http://www.w3.org/2001/XMLSchema#nonNegativeInteger</datatype>
<doc>http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_structure.html#cs_ce_mere</doc>
</concept>
<concept id="http://www.tela-botanica.org/appli:coel/doc/v1.00/concept/str/guid" required="true">
<alias>Guid</alias>
<datatype>http://www.w3.org/2001/XMLSchema#String</datatype>
<doc>http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_structure.html#cs_guid</doc>
</concept>
<concept id="http://www.tela-botanica.org/appli:coel/doc/v1.00/concept/str/truk_identifiant_alternatif">
<alias>TrukIdentifiantAlternatif</alias>
<datatype>http://www.w3.org/2001/XMLSchema#String</datatype>
<doc>http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_structure.html#cs_truk_identifiant_alternatif</doc>
</concept>
<concept id="http://www.tela-botanica.org/appli:coel/doc/v1.00/concept/str/nom" required="true">
<alias>Nom</alias>
<datatype>http://www.w3.org/2001/XMLSchema#String</datatype>
<doc>http://www.tela-botanica.org/appli:coel/doc/bdd/coel_table_coel_structure.html#cs_nom</doc>
</concept>
<concept id="http://www.tela-botanica.org/appli:coel/doc/v1.00/concept/str/date_modification" required="true">
<alias>DateModification</alias>
<datatype>http://www.w3.org/2001/XMLSchema#dateTime</datatype>
<doc>http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_meta_historique_ligne.html#cmhl_date_modification</doc>
</concept>
<concept id="http://www.tela-botanica.org/appli:coel/doc/v1.00/concept/str/ce_etat" required="true">
<alias>CeEtat</alias>
<datatype>http://www.w3.org/2001/XMLSchema#nonNegativeInteger</datatype>
<doc>http://www.tela-botanica.org/appli:coel/doc/v1.00/coel_table_coel_meta_historique_ligne.html#cmhl_ce_etat</doc>
</concept>
</concepts>
</schema>
</cns>
/tags/v1.11-okuzgozu/doc/modeles/coel_output_search_1_00.xml
New file
0,0 → 1,40
<?xml version="1.0" encoding="UTF-8"?>
<outputModel xmlns="http://rs.tdwg.org/tapir/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:coelrec="http://www.tela-botanica.org/schemas/coel/1.00/record"
xmlns:coelcore="http://www.tela-botanica.org/schemas/coel/1.00"
xsi:schemaLocation="http://rs.tdwg.org/tapir/1.0
http://ww2.biocase.org/svn/tapir/trunk/protocol/tapir.xsd
http://www.w3.org/2001/XMLSchema
http://www.w3.org/2001/XMLSchema.xsd">
<label>Coel Complet</label>
<documentation>Modèle de sortie mappant tous les conceptes de COEL.</documentation>
<structure>
<schema location="http://www.tela-botanica.net/doc/coel/xsd/coel_tapir_record_1_00.xsd"/>
</structure>
<indexingElement path="/coelrec:RecordSet/coelrec:Record"/>
<mapping>
 
<node path="/coelrec:RecordSet/coelrec:Record/coelcore:Id">
<concept id="http://www.tela-botanica.org/coel/doc/v1.00/concept/id" required="true"/>
</node>
<node path="/coelrec:RecordSet/coelrec:Record/coelcore:CeTable">
<concept id="http://www.tela-botanica.org/coel/doc/v1.00/concept/ce_table" required="true"/>
</node>
<node path="/coelrec:RecordSet/coelrec:Record/coelcore:CleLigne">
<concept id="http://www.tela-botanica.org/coel/doc/v1.00/concept/cle_ligne" required="true"/>
</node>
<node path="/coelrec:RecordSet/coelrec:Record/coelcore:Enregistrement">
<concept id="http://www.tela-botanica.org/coel/doc/v1.00/concept/enregistrement" required="true"/>
</node>
<node path="/coelrec:RecordSet/coelrec:Record/coelcore:DateModification">
<concept id="http://www.tela-botanica.org/coel/doc/v1.00/concept/date_modification" required="true"/>
</node>
<node path="/coelrec:RecordSet/coelrec:Record/coelcore:CeEtat">
<concept id="http://www.tela-botanica.org/coel/doc/v1.00/concept/ce_etat" required="true"/>
</node>
</mapping>
 
</outputModel>
/tags/v1.11-okuzgozu/doc/bdd/archives/coel.mwb
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/v1.11-okuzgozu/doc/bdd/archives/coel.mwb
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_personne.html
New file
0,0 → 1,713
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Personne - coel_personne</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Personne.html">Personne</a> > coel_personne</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_personne</h1>
<h2> Description générale </h2>
<p>
Contient les informations sur les personnes.<br />Par personne nous entendons à la fois les utilisateurs de l'application mais aussi les personnes contacts, les botanistes collecteurs, auteurs...<br />INFO : cp_fmt_nom_complet
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cp_id_personne" class="pair" >
<td> 1 </td>
<td> cp_id_personne </td>
<td> cp_id_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� primaire </td>
<td> oui </td>
<td> Identifiant d'un contact. </td>
</tr>
<tr id="cp_ce_projet" class="pair" >
<td> 2 </td>
<td> cp_ce_projet </td>
<td> cp_ce_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du projet auquel la personne appartient. Exemple : utilisateur appli coel, HUH, IPNI... </td>
</tr>
<tr id="cp_fmt_nom_complet" class="pair" >
<td> 3 </td>
<td> cp_fmt_nom_complet </td>
<td> cp_fnc </td>
<td> VARCHAR(100) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nom complet du contact formaté pour l'affichage (le format peut être différent en fonction du projet). </td>
</tr>
<tr id="cp_ce_truk_prefix" class="pair" >
<td> 4 </td>
<td> cp_ce_truk_prefix </td>
<td> cp_ce_tp </td>
<td> VARCHAR(20) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Préfixe du nom principal. Exemple : Dr., Prof., Mr., Lord, von... </td>
</tr>
<tr id="cp_prenom" class="pair" >
<td> 5 </td>
<td> cp_prenom </td>
<td> cp_p </td>
<td> VARCHAR(100) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Prénom principal (le plus connu, répandu) de la personne. Un point virgule peut séparer le prénom principal de prénoms secondaires à ne pas afficher dans le nom complet. </td>
</tr>
<tr id="cp_nom" class="pair" >
<td> 6 </td>
<td> cp_nom </td>
<td> cp_n </td>
<td> VARCHAR(100) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Indiquer les lieux de récolte (code ISO des pays) séparés par des points virgules. Après chaque code ISO indiqué les années de récolte séparées par des vigules ou des tirets pour les périodes continues). Si le pays de récolte est inconnu utilisé un point d'interogration. Exemple : FR#1905-1908,1910;PS#1912. </td>
</tr>
<tr id="cp_ce_truk_suffix" class="pair" >
<td> 7 </td>
<td> cp_ce_truk_suffix </td>
<td> cp_ce_ts </td>
<td> VARCHAR(20) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Suffixe du nom principal. Exemple : Jr, III. </td>
</tr>
<tr id="cp_truk_nom_autre" class="pair" >
<td> 8 </td>
<td> cp_truk_nom_autre </td>
<td> cp_tna </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nom(s) complet alternatif et surnoms. Pour les valeurs, séparez l'identifiant de l'abreviation par un symbole pipe "|". Exemple: HUH#105714|Sharp, Aaron John;APN#9544-1|Sharp, Aaron John ('Jack') </td>
</tr>
<tr id="cp_abreviation" class="pair" >
<td> 9 </td>
<td> cp_abreviation </td>
<td> cp_a </td>
<td> VARCHAR(50) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Abreviation retenu du nom. </td>
</tr>
<tr id="cp_truk_abreviation_autre" class="pair" >
<td> 10 </td>
<td> cp_truk_abreviation_autre </td>
<td> cp_taa </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Autres abréviations du nom. </td>
</tr>
<tr id="cp_naissance_date" class="pair" >
<td> 11 </td>
<td> cp_naissance_date </td>
<td> cp_nd </td>
<td> DATE </td>
<td> non </td>
<td> 0000-00-00 </td>
<td> standard </td>
<td> non </td>
<td> Date de naissance de la personne. </td>
</tr>
<tr id="cp_naissance_lieu" class="pair" >
<td> 12 </td>
<td> cp_naissance_lieu </td>
<td> cp_nl </td>
<td> VARCHAR(100) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Lieu de naissance de la personne. </td>
</tr>
<tr id="cp_ce_deces" class="pair" >
<td> 13 </td>
<td> cp_ce_deces </td>
<td> cp_ce_d </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Permet de savoir si la personne est décédée ou pas, ou que l'information est indéterminée. </td>
</tr>
<tr id="cp_deces_date" class="pair" >
<td> 14 </td>
<td> cp_deces_date </td>
<td> cp_dd </td>
<td> DATE </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Date de décés de la personne. Par défaut, si la personne n'est pas décédé le champ reste null. Si la personne est décédée mais que l'on ne connait pas la date mettre : 0000-00-00 </td>
</tr>
<tr id="cp_deces_lieu" class="pair" >
<td> 15 </td>
<td> cp_deces_lieu </td>
<td> cp_dl </td>
<td> VARCHAR(100) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Lieu de décés de la personne. </td>
</tr>
<tr id="cp_ce_sexe" class="pair" >
<td> 16 </td>
<td> cp_ce_sexe </td>
<td> cp_ce_s </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Indique si la personne est un homme ou une femme... </td>
</tr>
<tr id="cp_description" class="pair" >
<td> 17 </td>
<td> cp_description </td>
<td> cp_d </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Informations diverses sur la personne. </td>
</tr>
<tr id="cp_biographie" class="pair" >
<td> 18 </td>
<td> cp_biographie </td>
<td> cp_b </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Vie et renommée (locale, régionale, ...) de la personne. </td>
</tr>
<tr id="cp_adresse_01" class="pair" >
<td> 19 </td>
<td> cp_adresse_01 </td>
<td> cp_a0 </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Adresse de la personne. </td>
</tr>
<tr id="cp_adresse_02" class="pair" >
<td> 20 </td>
<td> cp_adresse_02 </td>
<td> cp_a0 </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Complément d'adresse personnelle. </td>
</tr>
<tr id="cp_ce_truk_region" class="pair" >
<td> 21 </td>
<td> cp_ce_truk_region </td>
<td> cp_ce_tr </td>
<td> VARCHAR(100) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du nom de la région (état, province) où vit la personne. Utiliser les noms du standard ISO-3166-2. Sinon utiliser "AUTRE" pour stocker d'éventuel valeur non présente dans ISO-3166-2. </td>
</tr>
<tr id="cp_bp" class="pair" >
<td> 22 </td>
<td> cp_bp </td>
<td> cp_b </td>
<td> VARCHAR(20) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Boite postale de l'adresse de la personne. </td>
</tr>
<tr id="cp_code_postal" class="pair" >
<td> 23 </td>
<td> cp_code_postal </td>
<td> cp_cp </td>
<td> VARCHAR(10) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Code postal (zip) personnel. </td>
</tr>
<tr id="cp_ville" class="pair" >
<td> 24 </td>
<td> cp_ville </td>
<td> cp_v </td>
<td> VARCHAR(100) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nom de la localité (ville) où vit la personne. </td>
</tr>
<tr id="cp_ce_truk_pays" class="pair" >
<td> 25 </td>
<td> cp_ce_truk_pays </td>
<td> cp_ce_tp </td>
<td> VARCHAR(100) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du pays où vit la personne. Utiliser les noms du standard ISO-3166-1. Sinon utiliser "AUTRE" pour stocker d'éventuel valeur non présente dans ISO-3166-1. </td>
</tr>
<tr id="cp_truk_telephone" class="pair" >
<td> 26 </td>
<td> cp_truk_telephone </td>
<td> cp_tt </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Numéro(s) de téléphone fixe (FIX), portable (GSM), Fax (FAX), pager (PAG)... personnels. </td>
</tr>
<tr id="cp_truk_courriel" class="pair" >
<td> 27 </td>
<td> cp_truk_courriel </td>
<td> cp_tc </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Adresse(s) de courriel personnel. Ajouter les adresses dans leur ordre d'importance. </td>
</tr>
<tr id="cp_truk_url" class="pair" >
<td> 28 </td>
<td> cp_truk_url </td>
<td> cp_tu </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> URL(s) de site web personnel. Ajouter les adresses dans leur ordre d'importance. </td>
</tr>
<tr id="cp_truk_logo" class="pair" >
<td> 29 </td>
<td> cp_truk_logo </td>
<td> cp_tl </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> URL(s) des logo, avatar, portrait ou photo de la personne. Ajouter les URL(s) dans leur ordre d'importance. </td>
</tr>
<tr id="cp_ce_truk_specialite" class="pair" >
<td> 30 </td>
<td> cp_ce_truk_specialite </td>
<td> cp_ce_ts </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Indiquer séparer par des points virgules ";" les spécialités naturalistes de la personne. </td>
</tr>
<tr id="cp_truk_recolte" class="pair" >
<td> 31 </td>
<td> cp_truk_recolte </td>
<td> cp_tr </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Indiquer les lieux de récolte séparés par des points virgules. Indiquer le référentiel géographique utilisé puis après un # mettre le code ou identitifiant de la zone géographique. Après chaque code ISO un peut signe pipe | peut être suivi des années de récolte séparées par des vigules ou des tirets pour les périodes continues). Si le pays de récolte est inconnu utilisé un point d'interogration. Exemple : ISO-3166-1#FR|1905-1908,1910;ISO-3166-1#PS|1912;ISO-3166-2#FR-34|1917. </td>
</tr>
<tr id="cp_ce_truk_role" class="pair" >
<td> 32 </td>
<td> cp_ce_truk_role </td>
<td> cp_ce_tr </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Rôle générale de la personne vis à vis de l'ensemble des projets : superadmin, admin... </td>
</tr>
<tr id="cp_mark_licence" class="pair" >
<td> 33 </td>
<td> cp_mark_licence </td>
<td> cp_ml </td>
<td> BOOL </td>
<td> non </td>
<td> 0 </td>
<td> standard </td>
<td> non </td>
<td> Indique quand la valeur vaut 1 que l'utilisateur a accepté la licence d'utilisation de l'application. </td>
</tr>
<tr id="cp_parametre" class="pair" >
<td> 34 </td>
<td> cp_parametre </td>
<td> cp_p </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Parametres de l'utilisateur vis à vis de l'application. </td>
</tr>
<tr id="cp_session_id" class="pair" >
<td> 35 </td>
<td> cp_session_id </td>
<td> cp_si </td>
<td> VARCHAR(100) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Identifiant de session de la personne utilisatrice de l'application. </td>
</tr>
<tr id="cp_login" class="pair" >
<td> 36 </td>
<td> cp_login </td>
<td> cp_l </td>
<td> VARCHAR(50) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Login de la personne pour accéder à l'application. </td>
</tr>
<tr id="cp_mot_de_passe" class="pair" >
<td> 37 </td>
<td> cp_mot_de_passe </td>
<td> cp_mdp </td>
<td> VARCHAR(100) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Mot de passe de la personne pour accéder à l'application. Encodé par SHA1. </td>
</tr>
<tr id="cp_ce_annuaire" class="pair" >
<td> 38 </td>
<td> cp_ce_annuaire </td>
<td> cp_ce_a </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant de la personne dans un annuaire (par défaut celui de Tela Botanica). </td>
</tr>
<tr id="cp_mark_public" class="pair" >
<td> 39 </td>
<td> cp_mark_public </td>
<td> cp_mp </td>
<td> BOOL </td>
<td> non </td>
<td> 0 </td>
<td> standard </td>
<td> non </td>
<td> Indique si oui (=1) ou non (=0) les données de cette personne sont publiques. </td>
</tr>
<tr id="cp_ce_meta" class="pair" >
<td> 40 </td>
<td> cp_ce_meta </td>
<td> cp_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cp_csap </td>
<td> cp_id_personne </td>
<td> csap_id_personne </td>
<td> <a href="coel_table_coel_structure_a_personne.html">coel_structure_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cp_ccap </td>
<td> cp_id_personne </td>
<td> ccap_id_personne </td>
<td> <a href="coel_table_coel_collection_a_personne.html">coel_collection_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cp_cpuap </td>
<td> cp_id_personne </td>
<td> cpuap_id_personne </td>
<td> <a href="coel_table_coel_publication_a_personne.html">coel_publication_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cp_cpar_01 </td>
<td> cp_id_personne </td>
<td> cpar_id_personne_01 </td>
<td> <a href="coel_table_coel_personne_a_relation.html">coel_personne_a_relation</a> </td>
</tr>
<tr class="pair" >
<td> 5 </td>
<td> fk_cpr_cp </td>
<td> cp_ce_projet </td>
<td> cpr_id_projet </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 6 </td>
<td> fk_cp_cpar_02 </td>
<td> cp_id_personne </td>
<td> cpar_id_personne_02 </td>
<td> <a href="coel_table_coel_personne_a_relation.html">coel_personne_a_relation</a> </td>
</tr>
<tr class="pair" >
<td> 7 </td>
<td> fk_cp_cmhl_modifier_par </td>
<td> cp_id_personne </td>
<td> cmhl_ce_modifier_par </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 8 </td>
<td> fk_cmhl_cp_meta </td>
<td> cp_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 9 </td>
<td> fk_cmlv_cp_prefix </td>
<td> cp_ce_truk_prefix </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 10 </td>
<td> fk_cmlv_cp_suffix </td>
<td> cp_ce_truk_suffix </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 11 </td>
<td> fk_cmlv_cp_sexe </td>
<td> cp_ce_sexe </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 12 </td>
<td> fk_cmlv_cp_specialite </td>
<td> cp_ce_truk_specialite </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 13 </td>
<td> fk_cmlv_cp_role </td>
<td> cp_ce_truk_role </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 14 </td>
<td> fk_cmlv_cp_deces </td>
<td> cp_ce_deces </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 15 </td>
<td> fk_cmlv_cp_pays </td>
<td> cp_ce_truk_pays </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 16 </td>
<td> fk_cmlv_cp_region </td>
<td> cp_ce_truk_region </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_personne">
discussion sur la table coel_personne
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_structure_valorisation.html
New file
0,0 → 1,301
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Structure - coel_structure_valorisation</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Structure.html">Structure</a> > coel_structure_valorisation</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_structure_valorisation</h1>
<h2> Description générale </h2>
<p>
Toutes les données spécifiques à la valorisation au sein d'une structure.
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="csv_id_structure" class="pair" >
<td> 1 </td>
<td> csv_id_structure </td>
<td> csv_id_s </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant de la structure. </td>
</tr>
<tr id="csv_mark_action" class="pair" >
<td> 2 </td>
<td> csv_mark_action </td>
<td> csv_ma </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Avez-vous réalisé des actions de valorisation de vos collections botaniques ou avez-vous été sollicités pour la valorisation de ces collections ? </td>
</tr>
<tr id="csv_truk_action" class="pair" >
<td> 3 </td>
<td> csv_truk_action </td>
<td> csv_ta </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Les actions de valorisation réalisées. </td>
</tr>
<tr id="csv_publication" class="pair" >
<td> 4 </td>
<td> csv_publication </td>
<td> csv_p </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Quelques titres des ouvrages, articles scientifiques, ... ? </td>
</tr>
<tr id="csv_collection_autre" class="pair" >
<td> 5 </td>
<td> csv_collection_autre </td>
<td> csv_ca </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> L'organisme dispose-t-il d'autres collections (permettant une valorisation pluridisciplinaire) ? </td>
</tr>
<tr id="csv_mark_action_future" class="pair" >
<td> 6 </td>
<td> csv_mark_action_future </td>
<td> csv_maf </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Envisagez-vous des actions de valorisation dans le cadre de votre politique culturelle ? </td>
</tr>
<tr id="csv_action_future" class="pair" >
<td> 7 </td>
<td> csv_action_future </td>
<td> csv_af </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Les actions de valorisation futures envisagées. </td>
</tr>
<tr id="csv_mark_recherche" class="pair" >
<td> 8 </td>
<td> csv_mark_recherche </td>
<td> csv_mr </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Vos collections botaniques sont-elles utilisées pour des recherches scientifiques ? </td>
</tr>
<tr id="csv_truk_recherche_provenance" class="pair" >
<td> 9 </td>
<td> csv_truk_recherche_provenance </td>
<td> csv_trp </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Si oui, par des chercheurs (professionnels ou amateurs ) de quelle provenance ? </td>
</tr>
<tr id="csv_truk_recherche_type" class="pair" >
<td> 10 </td>
<td> csv_truk_recherche_type </td>
<td> csv_trt </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Et pour quelles types de recherches ? </td>
</tr>
<tr id="csv_mark_acces_ss_motif" class="pair" >
<td> 11 </td>
<td> csv_mark_acces_ss_motif </td>
<td> csv_masm </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Peut-on consulter vos collections botaniques sans motif de recherches scientifiques ? </td>
</tr>
<tr id="csv_acces_ss_motif" class="pair" >
<td> 12 </td>
<td> csv_acces_ss_motif </td>
<td> csv_asm </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Si oui, quelles démarches doit-on faire pour les consulter ? </td>
</tr>
<tr id="csv_mark_visite_avec_motif" class="pair" >
<td> 13 </td>
<td> csv_mark_visite_avec_motif </td>
<td> csv_mvam </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Peut-on visiter vos collections botaniques en avec des objectifs de recherches scientifiques ? </td>
</tr>
<tr id="csv_visite_avec_motif" class="pair" >
<td> 14 </td>
<td> csv_visite_avec_motif </td>
<td> csv_vam </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Si oui, quelles démarches doit-on faire pour les visiter ? </td>
</tr>
<tr id="csv_ce_meta" class="pair" >
<td> 15 </td>
<td> csv_ce_meta </td>
<td> csv_ce_m </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cs_csv </td>
<td> csv_id_structure </td>
<td> cs_id_structure </td>
<td> <a href="coel_table_coel_structure.html">coel_structure</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cmhl_csv_meta </td>
<td> csv_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_structure_valorisation">
discussion sur la table coel_structure_valorisation
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel.css
New file
0,0 → 1,221
/*--------------------------------------------------------------------------------------------------------------*/
/* Structure de la page */
 
#zone_bandeau {
position : absolute;
top: 0%;
left: 0%;
width: 98%;
height: 60px;
margin: 5px 5px 5px 5px;
padding: 5px 5px 5px 5px;
}
 
#logo {
float : left;
height: 20%;
width: 40%;
}
 
#rapport_nom {
float : left;
line-height: 5%;
width: 40%;
}
 
#accessibilite {
position : absolute;
bottom: 0px;
right: 0px;
width: 40%;
margin: 0%;
padding: 0%;
text-align: right;
display: none;
}
 
#accessibilite li {
display: inline;
line-height: 5%;
}
 
/*
#zone_menu {
position : absolute;
top: 60px;
left: 0%;
width: 20%;
margin: 5px 0px 50px 5px;
padding: 5px 0px 50px 5px;
}
 
#zone_menu li ul {
display: none;
}
 
#zone_menu li:hover > ul {
display: block;
}
 
#zone_menu #menus_niveau_1 {
margin: 0px 0px 0px 5px;
padding: 0px 0px 0px 0px;
text-align: left;
}
 
#zone_menu #menus_niveau_2 {
margin: 0px 0px 0px 10px;
padding: 0px 0px 0px 0px;
text-align: left;
}
 
#zone_menu #menus_niveau_3 {
margin: 0px 0px 0px 10px;
padding: 0px 0px 0px 0px;
text-align: left;
}
 
#zone_menu #identification {
width: 100%;
}
*/
 
#zone_contenu {
position : absolute;
top: 80px;
left: 0%;
width: 98%;
margin: 5px 5px 5px 5px;
padding: 5px 5px 5px 5px;
}
 
#zone_contenu #zone_contenu_corps {
padding: 5px 5px 5px 5px;
}
 
#zone_contenu #zone_contenu_pied p {
text-align: center;
}
 
#zone_contenu #zone_pied p {
text-align: center;
}
 
#miniature {
float : right;
}
/*--------------------------------------------------------------------------------------------------------------*/
/* Décoration */
#rapport_nom {
font-size: 2.5em;
font-family: arial, verdana, sans-serif;
}
 
body {
font-size: 90%;
font-family: arial, verdana, sans-serif;
color:black;
background-color: #D7F2D7;
margin: 0px 0px 0px 0px;
}
 
h1 {
font-size: 2.1em;
color:green;
background-color:transparent;
text-align:left;
}
 
h2 {
font-size: 1.5em;
color:black;
background-color:transparent;
text-align:left;
}
 
h3 {
font-size: 1.6em;
color:black;
background-color:transparent;
text-align:left;
}
 
p {
background-color:transparent;
text-align:left;
margin-left:0px;
margin-right:0px;
}
 
li {
background-color:transparent;
text-align:left;
margin-left:0px;
margin-right:0px;
}
 
a {
font-weight: bold;
color: black;
background-color:transparent;
text-decoration:none;
}
 
a:link {
color: blue;
}
 
a:visited {
color: #8b008b;
}
 
a:hover {
background-color: #ffd700;
}
 
table {
border: medium solid #6495ed;
border-collapse: collapse;
width: 100%;
}
 
th {
font-family: monospace;
border: thin solid #6495ed;
padding: 5px;
background-color: #D0E3FA;
}
 
td {
font-family: sans-serif;
border: thin solid #6495ed;
padding: 5px
text-align: center;
background-color: #ffffff;
}
 
caption {
font-family: sans-serif;
}
 
#zone_bandeau {
}
 
#zone_bandeau #logo h1 {
font-size: 1em;
}
/*
#zone_menu {
border: 1px dashed blue;
}
 
#zone_menu ul {
font-size: 100%;
list-style-type: none;
}
*/
#zone_contenu_corps {
border: 1px dashed green;
background-color: white;
}
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_collection.html
New file
0,0 → 1,709
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Collection - coel_collection</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Collection.html">Collection</a> > coel_collection</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_collection</h1>
<h2> Description générale </h2>
<p>
Contient les informations sur les collections.INFO : cc_nom<br />
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cc_id_collection" class="pair" >
<td> 1 </td>
<td> cc_id_collection </td>
<td> cc_id_c </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� primaire </td>
<td> oui </td>
<td> Identifiant de la collection. </td>
</tr>
<tr id="cc_ce_projet" class="pair" >
<td> 2 </td>
<td> cc_ce_projet </td>
<td> cc_ce_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du projet dans lequel les informations de la collection sont saisies. </td>
</tr>
<tr id="cc_ce_mere" class="pair" >
<td> 3 </td>
<td> cc_ce_mere </td>
<td> cc_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> 0 </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant de la collection parente. Si la collection courrante n'a pas de parente laisser la valeur 0 par défaut. </td>
</tr>
<tr id="cc_ce_structure" class="pair" >
<td> 4 </td>
<td> cc_ce_structure </td>
<td> cc_ce_s </td>
<td> INTEGER </td>
<td> oui </td>
<td> 0 </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant de la structure habritant physiquement la collection. Si c'est un particulier, laisser la valeur 0 par défaut et utiliser la table liant les collections aux personnes. </td>
</tr>
<tr id="cc_guid" class="pair" >
<td> 5 </td>
<td> cc_guid </td>
<td> cc_g </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Identifiant global unique de type LSID ou URI. </td>
</tr>
<tr id="cc_truk_identifiant_alternatif" class="pair" >
<td> 6 </td>
<td> cc_truk_identifiant_alternatif </td>
<td> cc_tia </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Autres identifiants de la structure. </td>
</tr>
<tr id="cc_truk_code" class="pair" >
<td> 7 </td>
<td> cc_truk_code </td>
<td> cc_tc </td>
<td> VARCHAR(100) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Code(s) de la collection. </td>
</tr>
<tr id="cc_nom" class="pair" >
<td> 8 </td>
<td> cc_nom </td>
<td> cc_n </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nom de la collection dans la langue d'origine. Afficher vis à vis du public. </td>
</tr>
<tr id="cc_truk_nom_alternatif" class="pair" >
<td> 9 </td>
<td> cc_truk_nom_alternatif </td>
<td> cc_tna </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nom alternatif de la collection. </td>
</tr>
<tr id="cc_description" class="pair" >
<td> 10 </td>
<td> cc_description </td>
<td> cc_d </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Description principale de la collection pour un large public. </td>
</tr>
<tr id="cc_description_specialiste" class="pair" >
<td> 11 </td>
<td> cc_description_specialiste </td>
<td> cc_ds </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Description de la collection pour un public de spécialistes. </td>
</tr>
<tr id="cc_historique" class="pair" >
<td> 12 </td>
<td> cc_historique </td>
<td> cc_h </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Historique de la collection (acquisition, différentes interventions de restauration, de traitement ...). </td>
</tr>
<tr id="cc_truk_url" class="pair" >
<td> 13 </td>
<td> cc_truk_url </td>
<td> cc_tu </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> URL(s) du site web ou de la page concernant la collection (WEB), d'un web service (WS) ou d'une page permettant d'accèder à des informations sur les objets de la collection (OBJ). </td>
</tr>
<tr id="cc_truk_groupement_principe" class="pair" >
<td> 14 </td>
<td> cc_truk_groupement_principe </td>
<td> cc_tgp </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Principal but de groupement de la collection au niveau intélectuel plutôt que physique. </td>
</tr>
<tr id="cc_truk_groupement_but" class="pair" >
<td> 15 </td>
<td> cc_truk_groupement_but </td>
<td> cc_tgb </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Principal but de réalisation de la collection. </td>
</tr>
<tr id="cc_ce_type" class="pair" >
<td> 16 </td>
<td> cc_ce_type </td>
<td> cc_ce_t </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Type de la collection vis à vis du standard NCD. </td>
</tr>
<tr id="cc_ce_type_depot" class="pair" >
<td> 17 </td>
<td> cc_ce_type_depot </td>
<td> cc_ce_td </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Type de dépôt de la collection. </td>
</tr>
<tr id="cc_cote" class="pair" >
<td> 18 </td>
<td> cc_cote </td>
<td> cc_c </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Côte de la collection. </td>
</tr>
<tr id="cc_dimenssion" class="pair" >
<td> 19 </td>
<td> cc_dimenssion </td>
<td> cc_d </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Dimenssion, taille de la collection sous forme de texte libre. </td>
</tr>
<tr id="cc_condition_acces" class="pair" >
<td> 20 </td>
<td> cc_condition_acces </td>
<td> cc_ca </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Condition d'accès à la collection. Peut être définit par défaut par la structure. </td>
</tr>
<tr id="cc_condition_usage" class="pair" >
<td> 21 </td>
<td> cc_condition_usage </td>
<td> cc_cu </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Condition d'usages de la collection. Peut être définit par défaut par la structure. </td>
</tr>
<tr id="cc_truk_couverture_vernaculaire" class="pair" >
<td> 22 </td>
<td> cc_truk_couverture_vernaculaire </td>
<td> cc_tcv </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nature de la collection sous forme de nom(s) vernaculaire(s). </td>
</tr>
<tr id="cc_truk_couverture_taxonomique" class="pair" >
<td> 23 </td>
<td> cc_truk_couverture_taxonomique </td>
<td> cc_tct </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nom de famille ou de taxons supérieurs présent dans la collection. </td>
</tr>
<tr id="cc_truk_couverture_regne" class="pair" >
<td> 24 </td>
<td> cc_truk_couverture_regne </td>
<td> cc_tcr </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Liste des règnes couverts par la collection. </td>
</tr>
<tr id="cc_truk_couverture_temporelle" class="pair" >
<td> 25 </td>
<td> cc_truk_couverture_temporelle </td>
<td> cc_tct </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Période de temps couverte par la collection. </td>
</tr>
<tr id="cc_truk_couverture_vie" class="pair" >
<td> 26 </td>
<td> cc_truk_couverture_vie </td>
<td> cc_tcv </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Période de temps durant laquelle le matériel biologique était en vie. Inclu les périodes de temps paléontologiques. </td>
</tr>
<tr id="cc_truk_conservation_statut" class="pair" >
<td> 27 </td>
<td> cc_truk_conservation_statut </td>
<td> cc_tcs </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Indiquer la date d'une estimation séparée par un dièse du statut estimé utilisant l'échelle de McGinley. Plusieurs estimations seront séparés par un point virgule. </td>
</tr>
<tr id="cc_truk_preservation" class="pair" >
<td> 28 </td>
<td> cc_truk_preservation </td>
<td> cc_tp </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Liste indiquant les procédures ou techniques de conservation utilisées pour les collections non vivantes. </td>
</tr>
<tr id="cc_ce_developpement" class="pair" >
<td> 29 </td>
<td> cc_ce_developpement </td>
<td> cc_ce_d </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Indique le changement potentiel dans la portée de la collection. </td>
</tr>
<tr id="cc_truk_periode_constitution" class="pair" >
<td> 30 </td>
<td> cc_truk_periode_constitution </td>
<td> cc_tpc </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Liste de périodes de temps durant laquelle la collection a été assemblée. </td>
</tr>
<tr id="cc_truk_couverture_lieu" class="pair" >
<td> 31 </td>
<td> cc_truk_couverture_lieu </td>
<td> cc_tcl </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Liste de lieux (continent, pays, region, département, commune, autres lieux historique ou texte libre) desquels le matériel de la collection est originaire. </td>
</tr>
<tr id="cc_truk_coordonnee" class="pair" >
<td> 32 </td>
<td> cc_truk_coordonnee </td>
<td> cc_tc </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Liste de coordonnées décimales des lieux d'origine du matériel de la collection. </td>
</tr>
<tr id="cc_ce_specimen_type" class="pair" >
<td> 33 </td>
<td> cc_ce_specimen_type </td>
<td> cc_ce_st </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Y-a-t'il des échantillons-types? </td>
</tr>
<tr id="cc_specimen_type_nbre" class="pair" >
<td> 34 </td>
<td> cc_specimen_type_nbre </td>
<td> cc_stn </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nombre de spécimen type présent dans la collection. </td>
</tr>
<tr id="cc_ce_specimen_type_nbre_precision" class="pair" >
<td> 35 </td>
<td> cc_ce_specimen_type_nbre_precision </td>
<td> cc_ce_stnp </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du type de précision du nombre de spécimen type. </td>
</tr>
<tr id="cc_ce_specimen_type_classement" class="pair" >
<td> 36 </td>
<td> cc_ce_specimen_type_classement </td>
<td> cc_ce_stc </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Type de classement des specimens types. </td>
</tr>
<tr id="cc_expedition_nom" class="pair" >
<td> 37 </td>
<td> cc_expedition_nom </td>
<td> cc_en </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nom de l'expédition durant laquelle le matériel a été collecté. </td>
</tr>
<tr id="cc_truk_digital_medium" class="pair" >
<td> 38 </td>
<td> cc_truk_digital_medium </td>
<td> cc_tdm </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Pour les collections digitales, listes des types de support d'enregistrement. Ex. : DVD-R. </td>
</tr>
<tr id="cc_truk_digital_format" class="pair" >
<td> 39 </td>
<td> cc_truk_digital_format </td>
<td> cc_tdf </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Pour les collections digitales, listes des types MIME. </td>
</tr>
<tr id="cc_mark_public" class="pair" >
<td> 40 </td>
<td> cc_mark_public </td>
<td> cc_mp </td>
<td> BOOL </td>
<td> non </td>
<td> 0 </td>
<td> standard </td>
<td> non </td>
<td> Indique si oui (=1) ou non (=0) les données de cette collection sont publiques. </td>
</tr>
<tr id="cc_ce_meta" class="pair" >
<td> 41 </td>
<td> cc_ce_meta </td>
<td> cc_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cs_cc </td>
<td> cc_ce_structure </td>
<td> cs_id_structure </td>
<td> <a href="coel_table_coel_structure.html">coel_structure</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cc_cc_parente </td>
<td> cc_id_collection </td>
<td> cc_ce_mere </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cc_ccap </td>
<td> cc_id_collection </td>
<td> ccap_id_collection </td>
<td> <a href="coel_table_coel_collection_a_personne.html">coel_collection_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cc_ccb </td>
<td> cc_id_collection </td>
<td> ccb_id_collection </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 5 </td>
<td> fk_cc_ccapu </td>
<td> cc_id_collection </td>
<td> ccapu_id_collection </td>
<td> <a href="coel_table_coel_collection_a_publication.html">coel_collection_a_publication</a> </td>
</tr>
<tr class="pair" >
<td> 6 </td>
<td> fk_cpr_cc </td>
<td> cc_ce_projet </td>
<td> cpr_id_projet </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 7 </td>
<td> fk_cc_ccac </td>
<td> cc_id_collection </td>
<td> ccac_id_collection </td>
<td> <a href="coel_table_coel_collection_a_commentaire.html">coel_collection_a_commentaire</a> </td>
</tr>
<tr class="pair" >
<td> 8 </td>
<td> fk_cmhl_cc_meta </td>
<td> cc_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 9 </td>
<td> fk_cmlv_cc_type </td>
<td> cc_ce_type </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 10 </td>
<td> fk_cmlv_cc_developpement </td>
<td> cc_ce_developpement </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 11 </td>
<td> fk_cmlv_cc_specimen_type </td>
<td> cc_ce_specimen_type </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 12 </td>
<td> fk_cmlv_cc_specimen_type_classement </td>
<td> cc_ce_specimen_type_classement </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 13 </td>
<td> fk_cmlv_cc_type_depot </td>
<td> cc_ce_type_depot </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 14 </td>
<td> fk_cmlv_cc_type_nbre_precision </td>
<td> cc_ce_specimen_type_nbre_precision </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_collection">
discussion sur la table coel_collection
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/maj_v1.2.0.sql
New file
0,0 → 1,8
UPDATE coel_structure SET cs_longitude = REPLACE(cs_longitude, ",", "."), cs_latitude = REPLACE(cs_latitude, ",", ".");
ALTER TABLE coel_structure MODIFY cs_longitude DOUBLE(12,9) NULL DEFAULT NULL;
ALTER TABLE coel_structure MODIFY cs_latitude DOUBLE(12,9) NULL DEFAULT NULL;
UPDATE coel_structure SET cs_latitude = NULL, cs_longitude = NULL WHERE cs_latitude = "0" AND cs_longitude = "0";
UPDATE coel_structure SET cs_nbre_personne = NULL WHERE cs_nbre_personne = 0;
ALTER TABLE coel_structure_conservation MODIFY csc_mark_collection_commune TINYINT(1) NULL COMMENT 'Les collections botaniques sont-elles conservées avec d\'autres collections dans les mêmes locaux (problèe de conservation en commun) ?';
UPDATE coel_meta_liste_valeur SET cmlv_nom = 'Bretagne' WHERE cmlv_id_valeur = 4046;
UPDATE coel_meta_liste_valeur SET cmlv_nom = 'Corse' WHERE cmlv_id_valeur = 4049;
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_module_Structure.html
New file
0,0 → 1,95
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Structure</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > Structure</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<h1> Module Structure</h1>
<p id="miniature" >
<a href="images/modules/Structure.png" title="Voir cette image avec un zoom de 100%.">
<img src="images/miniatures/miniature_Structure.png" alt="Miniature du modèle du module Structure" />
</a>
</p>
<h2> Description générale </h2>
<p>
Module de gestion des Structures.<br />
<br />
<b>Révision : </b>1159
</p>
<h2> Liste des tables </h2>
<ol class="type_01">
<li><a href="coel_table_coel_structure.html">coel_structure</a> : Contient les informations sur les structures.<br />INFO : cs_nom</li>
<li><a href="coel_table_coel_structure_a_personne.html">coel_structure_a_personne</a> : Table de liaison permettant d'indiquer la composition de la structure en personnel.<br />Elle permet d'indiquer pour une personne vis à vis d'une structure :<br /> - si elle est contact<br /> - les informations de la personne spécifique à cette structure (ex. : téléphone du travail, fonction, service, statut...).</li>
<li><a href="coel_table_coel_structure_conservation.html">coel_structure_conservation</a> : Toutes les données spécifiques à la conservation au sein d'une structure.</li>
<li><a href="coel_table_coel_structure_valorisation.html">coel_structure_valorisation</a> : Toutes les données spécifiques à la valorisation au sein d'une structure.</li>
</ol>
<h2> Dépot SVN </h2>
<p>
Voir la page concernant ce module sur le dépot SVN :
<a href="http://svn.tela-botanica.net/websvn/filedetails.php?repname=Applications.coel&path=%2Ftrunk%2Fdoc%2Fbdd%2Fcoel.xml">
coel.xml
</a>
</p>
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant ce module :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_Structure">
discussion sur le module Structure
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
/tags/v1.11-okuzgozu/doc/bdd/archives/index.html
New file
0,0 → 1,160
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Accueil</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore//wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : Accueil</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<h1> Liste des modules </h1>
<p><a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">Pour revenir sur le Wikini d'eFlore, cliquer ici</a> ou sur le logo d'eFlore en haut à gauche.</p>
<h2> Tableau récapitulatif des modules </h2>
<!-- CONTENU_CORPS -->
<table class="eflore_table" border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> Numéro </th>
<th> Nom et liens vers la description du module </th>
<th> Abréviation </th>
<th> Etat du module </th>
<th> Etat de l'aide </th>
<th> Nbre tables </th>
<th> Révision </th>
<th> Commentaires </th>
</thead>
<tbody>
<tr>
<td> 1 </td>
<td> <a href="coel_module_Collection.html">Collection</a> </td>
<td> CC </td>
<td> OK </td>
<td> OK </td>
<td> 21 </td>
<td> 1159 </td>
<td> Module de gestion des Collections.<br /> </td>
</tr>
<tr>
<td> 2 </td>
<td> <a href="coel_module_Commentaire.html">Commentaire</a> </td>
<td> CCM </td>
<td> OK </td>
<td> OK </td>
<td> 21 </td>
<td> 1159 </td>
<td> Module contenant les tables permettant de gérer les commentaires.<br /> </td>
</tr>
<tr>
<td> 3 </td>
<td> <a href="coel_module_Metadonnee.html">Métadonnée</a> </td>
<td> CM </td>
<td> OK </td>
<td> OK </td>
<td> 21 </td>
<td> 1159 </td>
<td> Module de gestion des Métadonnées.<br /> </td>
</tr>
<tr>
<td> 4 </td>
<td> <a href="coel_module_Personne.html">Personne</a> </td>
<td> CP </td>
<td> OK </td>
<td> OK </td>
<td> 21 </td>
<td> 1159 </td>
<td> Module de gestion des Personnes.<br /> </td>
</tr>
<tr>
<td> 5 </td>
<td> <a href="coel_module_Projet.html">Projet</a> </td>
<td> CPR </td>
<td> OK </td>
<td> OK </td>
<td> 21 </td>
<td> 1159 </td>
<td> Module de gestion des Projets.<br /> </td>
</tr>
<tr>
<td> 6 </td>
<td> <a href="coel_module_Publication.html">Publication</a> </td>
<td> CPU </td>
<td> OK </td>
<td> OK </td>
<td> 21 </td>
<td> 1159 </td>
<td> Module de gestion des Publications.<br /> </td>
</tr>
<tr>
<td> 7 </td>
<td> <a href="coel_module_Structure.html">Structure</a> </td>
<td> CS </td>
<td> OK </td>
<td> OK </td>
<td> 21 </td>
<td> 1159 </td>
<td> Module de gestion des Structures.<br /> </td>
</tr>
</tbody>
</table>
<p>Nombre total de tables : 147</p>
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant les modules :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussionListeModules">
discussion sur la liste des modules
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/maj_v1.1.2.sql
New file
0,0 → 1,88
 
 
/****************************************************
COLLECTION BOTANIQUE
*****************************************************/
 
 
/* Champ ccb_truk_degradation_specimen */
 
SET @valeur = '%Très important [1]%';
UPDATE coel_collection_botanique
SET ccb_truk_degradation_specimen=REPLACE(ccb_truk_degradation_specimen,'Très important [1]','30748')
WHERE ccb_truk_degradation_specimen LIKE '%Très important [1]%';
 
SET @valeur = '%Important [2]%';
UPDATE coel_collection_botanique
SET ccb_truk_degradation_specimen=REPLACE(ccb_truk_degradation_specimen,'Important [2]','30749')
WHERE ccb_truk_degradation_specimen LIKE '%Important [2]%';
 
SET @valeur = '%Moyen [3]%';
UPDATE coel_collection_botanique
SET ccb_truk_degradation_specimen=REPLACE(ccb_truk_degradation_specimen,'Moyen [3]','30750')
WHERE ccb_truk_degradation_specimen LIKE '%Moyen [3]%';
 
SET @valeur = '%Faible [4]%';
UPDATE coel_collection_botanique
SET ccb_truk_degradation_specimen=REPLACE(ccb_truk_degradation_specimen,'Faible [4]','30751')
WHERE ccb_truk_degradation_specimen LIKE '%Faible [4]%';
 
SET @valeur = '%Très faible [5]%';
UPDATE coel_collection_botanique
SET ccb_truk_degradation_specimen=REPLACE(ccb_truk_degradation_specimen,'Très faible [5]','30752')
WHERE ccb_truk_degradation_specimen LIKE '%Très faible [5]%';
 
 
/* Champccb_truk_degradation_presentation */
 
UPDATE coel_collection_botanique
SET ccb_truk_degradation_presentation=REPLACE(ccb_truk_degradation_presentation,'Très important [1]','30748')
WHERE ccb_truk_degradation_presentation LIKE '%Très important [1]%';
 
 
UPDATE coel_collection_botanique
SET ccb_truk_degradation_presentation=REPLACE(ccb_truk_degradation_presentation,'Important [2]','30749')
WHERE ccb_truk_degradation_presentation LIKE '%Important [2]%';
 
 
UPDATE coel_collection_botanique
SET ccb_truk_degradation_presentation=REPLACE(ccb_truk_degradation_presentation,'Moyen [3]','30750')
WHERE ccb_truk_degradation_presentation LIKE '%Moyen [3]%';
 
 
UPDATE coel_collection_botanique
SET ccb_truk_degradation_presentation=REPLACE(ccb_truk_degradation_presentation,'Faible [4]','30751')
WHERE ccb_truk_degradation_presentation LIKE '%Faible [4]%';
 
 
UPDATE coel_collection_botanique
SET ccb_truk_degradation_presentation=REPLACE(ccb_truk_degradation_presentation,'Très faible [5]','30752')
WHERE ccb_truk_degradation_presentation LIKE '%Très faible [5]%';
 
 
/****************************************************
PERSONNE
*****************************************************/
 
UPDATE coel_personne
SET cp_truk_telephone=REPLACE(cp_truk_telephone,'FAX','30747')
WHERE cp_truk_telephone LIKE '%FAX%';
 
UPDATE coel_personne
SET cp_truk_telephone=REPLACE(cp_truk_telephone,'GSM','2014')
WHERE cp_truk_telephone LIKE '%GSM%';
 
UPDATE coel_personne
SET cp_truk_telephone=REPLACE(cp_truk_telephone,'FIX','2015')
WHERE cp_truk_telephone LIKE '%FIX%';
 
UPDATE coel_personne
SET cp_truk_telephone=REPLACE(cp_truk_telephone,'PAG','2016')
WHERE cp_truk_telephone LIKE '%PAG%';
 
 
 
 
 
 
 
/tags/v1.11-okuzgozu/doc/bdd/archives/maj_v1.1.3.sql
New file
0,0 → 1,242
SET @id_table_cmlv = '112';
SET @id_admin = '1';
SET @ip_admin = '162.38.234.1';
SET @id_meta = '';
SET @enrg = '';
#+--------------------------------------------------------------------------------------------------------------------+#
# MODIFICATION ONTOLOGIE
SET @id_etat_modif = '2';
 
# Mise à jour des abréviations de la liste 40 id 1043
SET @notes = 'Remplacement de l''abréviation numérique par un code.';
 
SET @id_valeur = '2246';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'PH',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2247';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'GY',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2248';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'AN',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2249';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'CR',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2250';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'AL',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2251';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'CH',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2252';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'LI',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2253';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'BR',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2254';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'PT',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
#+--------------------------------------------------------------------------------------------------------------------+#
# MODIFICATION PUBLICATION
ALTER TABLE tb_coel.coel_publication CHANGE
`cpu_date_parution` `cpu_date_parution` VARCHAR( 10 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL
COMMENT 'Année(s) de parution de la publication. Formats acceptés : AAAA-MM-JJ ou AAAA ou AAAA-AAAA.'
/tags/v1.11-okuzgozu/doc/bdd/archives/coel.sql.bz2
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/v1.11-okuzgozu/doc/bdd/archives/coel.sql.bz2
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_module_Commentaire.html
New file
0,0 → 1,89
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Commentaire</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > Commentaire</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<h1> Module Commentaire</h1>
<p id="miniature" >
<a href="images/modules/Commentaire.png" title="Voir cette image avec un zoom de 100%.">
<img src="images/miniatures/miniature_Commentaire.png" alt="Miniature du modèle du module Commentaire" />
</a>
</p>
<h2> Description générale </h2>
<p>
Module contenant les tables permettant de gérer les commentaires.<br />
<br />
<b>Révision : </b>1159
</p>
<h2> Liste des tables </h2>
<ol class="type_01">
<li><a href="coel_table_coel_commentaire.html">coel_commentaire</a> : Contient les commentaires.<br />INFO : ccm_titre</li>
</ol>
<h2> Dépot SVN </h2>
<p>
Voir la page concernant ce module sur le dépot SVN :
<a href="http://svn.tela-botanica.net/websvn/filedetails.php?repname=Applications.coel&path=%2Ftrunk%2Fdoc%2Fbdd%2Fcoel.xml">
coel.xml
</a>
</p>
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant ce module :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_Commentaire">
discussion sur le module Commentaire
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
/tags/v1.11-okuzgozu/doc/bdd/archives/maj_v1.8.0.sql
New file
0,0 → 1,8
ALTER TABLE `coel_publication` ADD `cpu_resume_motcle` TEXT NOT NULL ;
ALTER TABLE `coel_publication` CHANGE `cpu_fmt_nom_complet` `cpu_fmt_nom_complet` VARCHAR(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Intitulé de la publication complet : fmt_auteur, date_parution(année). titre. Editeur (nom), collection, fascicule, indication_nvt. pages.';
 
UPDATE `coel_meta_liste_valeur` SET `cmlv_nom` = '1. Entièrement déclassé' WHERE `coel_meta_liste_valeur`.`cmlv_id_valeur` = 2327;
UPDATE `coel_meta_liste_valeur` SET `cmlv_nom` = '2. Majoritairement déclassé' WHERE `coel_meta_liste_valeur`.`cmlv_id_valeur` = 2328;
UPDATE `coel_meta_liste_valeur` SET `cmlv_nom` = '3. Moyennement classé' WHERE `coel_meta_liste_valeur`.`cmlv_id_valeur` = 2329;
UPDATE `coel_meta_liste_valeur` SET `cmlv_nom` = '4. Majoritairement classé' WHERE `coel_meta_liste_valeur`.`cmlv_id_valeur` = 2330;
UPDATE `coel_meta_liste_valeur` SET `cmlv_nom` = '5. Entièrement classé' WHERE `coel_meta_liste_valeur`.`cmlv_id_valeur` = 2331;
/tags/v1.11-okuzgozu/doc/bdd/archives/correction_historique.sql
New file
0,0 → 1,27
UPDATE coel_meta_historique_ligne SET cmhl_ce_table = 107
WHERE cmhl_ce_table = 102
AND cmhl_cle_ligne NOT LIKE '%-%';
 
UPDATE coel_meta_historique_ligne SET cmhl_cle_ligne = CONCAT_WS('-',
IF (ExtractValue(cmhl_enregistrement, '//csap_id_personne') = '', 0, ExtractValue(cmhl_enregistrement, '//csap_id_personne')),
ExtractValue(cmhl_enregistrement, '//csap_id_role'),
ExtractValue(cmhl_enregistrement, '//csap_id_structure')
)
WHERE cmhl_ce_table = 121
AND cmhl_ce_etat = 1;
 
UPDATE coel_meta_historique_ligne SET cmhl_cle_ligne = CONCAT_WS('-',
SUBSTRING_INDEX(cmhl_cle_ligne, '-', 1), # Premier
SUBSTRING_INDEX(cmhl_cle_ligne, '-', -1), # Dernier
SUBSTRING_INDEX(SUBSTRING_INDEX(cmhl_cle_ligne, '-', 2), '-', -1)# Milieu
)
WHERE cmhl_ce_table = 121
AND cmhl_ce_etat = 2;
 
UPDATE coel_meta_historique_ligne SET cmhl_cle_ligne = CONCAT_WS('-',
SUBSTRING_INDEX(SUBSTRING_INDEX(cmhl_cle_ligne, '-', 2), '-', -1), # Milieu
SUBSTRING_INDEX(cmhl_cle_ligne, '-', -1), # Dernier
SUBSTRING_INDEX(cmhl_cle_ligne, '-', 1) # Premier
)
WHERE cmhl_ce_table = 121
AND cmhl_ce_etat = 3;
/tags/v1.11-okuzgozu/doc/bdd/archives/coel.xml
New file
0,0 → 1,2480
<?xml version="1.0" standalone="yes" ?>
<DBMODEL Version="4.0">
<SETTINGS>
<GLOBALSETTINGS ModelName="coel" IDModel="0" IDVersion="0" VersionStr="1.0.0.0" Comments="BDD_NOM : tb_coel" UseVersionHistroy="1" AutoIncVersion="1" DatabaseType="MySQL" ZoomFac="92.00" XPos="0" YPos="1574" DefaultDataType="5" DefaultTablePrefix="0" DefSaveDBConn="" DefSyncDBConn="" DefQueryDBConn="" Printer="" HPageCount="4.0" PageAspectRatio="1.440892512336408" PageOrientation="1" PageFormat="A4 (210x297 mm, 8.26x11.7 inches)" SelectedPages="" UsePositionGrid="0" PositionGridX="20" PositionGridY="20" TableNameInRefs="0" DefaultTableType="0" ActivateRefDefForNewRelations="0" FKPrefix="" FKPostfix="" CreateFKRefDefIndex="0" DBQuoteCharacter="`" CreateSQLforLinkedObjects="0" DefModelFont="nimbus sans l" CanvasWidth="4096" CanvasHeight="2842" />
<DATATYPEGROUPS>
<DATATYPEGROUP Name="Numeric Types" Icon="1" />
<DATATYPEGROUP Name="Date and Time Types" Icon="2" />
<DATATYPEGROUP Name="String Types" Icon="3" />
<DATATYPEGROUP Name="Blob and Text Types" Icon="4" />
<DATATYPEGROUP Name="User defined Types" Icon="5" />
<DATATYPEGROUP Name="Geographic Types" Icon="6" />
</DATATYPEGROUPS>
<DATATYPES>
<DATATYPE ID="1" IDGroup="0" TypeName="TINYINT" Description="A very small integer. The signed range is -128 to 127. The unsigned range is 0 to 255." ParamCount="1" OptionCount="2" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="UNSIGNED" Default="1" />
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="2" IDGroup="0" TypeName="SMALLINT" Description="A small integer. The signed range is -32768 to 32767. The unsigned range is 0 to 65535." ParamCount="1" OptionCount="2" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="UNSIGNED" Default="1" />
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="3" IDGroup="0" TypeName="MEDIUMINT" Description="A medium-size integer. The signed range is -8388608 to 8388607. The unsigned range is 0 to 16777215." ParamCount="1" OptionCount="2" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="UNSIGNED" Default="1" />
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="4" IDGroup="0" TypeName="INT" Description="A normal-size integer. The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295." ParamCount="1" OptionCount="2" ParamRequired="0" EditParamsAsString="0" SynonymGroup="1" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="UNSIGNED" Default="0" />
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="5" IDGroup="0" TypeName="INTEGER" Description="A normal-size integer. The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295." ParamCount="1" OptionCount="2" ParamRequired="0" EditParamsAsString="0" SynonymGroup="1" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="UNSIGNED" Default="1" />
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="6" IDGroup="0" TypeName="BIGINT" Description="A large integer. The signed range is -9223372036854775808 to 9223372036854775807. The unsigned range is 0 to 18446744073709551615." ParamCount="1" OptionCount="2" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="UNSIGNED" Default="0" />
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="7" IDGroup="0" TypeName="FLOAT" Description="A small (single-precision) floating-point number. Cannot be unsigned. Allowable values are -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to 3.402823466E+38." ParamCount="1" OptionCount="1" ParamRequired="1" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="precision" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="8" IDGroup="0" TypeName="FLOAT" Description="A small (single-precision) floating-point number. Cannot be unsigned. Allowable values are -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to 3.402823466E+38." ParamCount="2" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
<PARAM Name="decimals" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="9" IDGroup="0" TypeName="DOUBLE" Description="A normal-size (double-precision) floating-point number. Cannot be unsigned. Allowable values are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and 2.2250738585072014E-308 to 1.7976931348623157E+308." ParamCount="2" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="2" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
<PARAM Name="decimals" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="10" IDGroup="0" TypeName="DOUBLE PRECISION" Description="This is a synonym for DOUBLE." ParamCount="2" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="2" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
<PARAM Name="decimals" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="11" IDGroup="0" TypeName="REAL" Description="This is a synonym for DOUBLE." ParamCount="2" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="2" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
<PARAM Name="decimals" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="12" IDGroup="0" TypeName="DECIMAL" Description="An unpacked floating-point number. Cannot be unsigned. Behaves like a CHAR column." ParamCount="2" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="3" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
<PARAM Name="decimals" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="13" IDGroup="0" TypeName="NUMERIC" Description="This is a synonym for DECIMAL." ParamCount="2" OptionCount="1" ParamRequired="1" EditParamsAsString="0" SynonymGroup="3" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
<PARAM Name="decimals" />
</PARAMS>
<OPTIONS>
<OPTION Name="ZEROFILL" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="14" IDGroup="1" TypeName="DATE" Description="A date. The supported range is \a1000-01-01\a to \a9999-12-31\a." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="15" IDGroup="1" TypeName="DATETIME" Description="A date and time combination. The supported range is \a1000-01-01 00:00:00\a to \a9999-12-31 23:59:59\a." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="16" IDGroup="1" TypeName="TIMESTAMP" Description="A timestamp. The range is \a1970-01-01 00:00:00\a to sometime in the year 2037. The length can be 14 (or missing), 12, 10, 8, 6, 4, or 2 representing YYYYMMDDHHMMSS, ... , YYYYMMDD, ... , YY formats." ParamCount="1" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
</DATATYPE>
<DATATYPE ID="17" IDGroup="1" TypeName="TIME" Description="A time. The range is \a-838:59:59\a to \a838:59:59\a." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="18" IDGroup="1" TypeName="YEAR" Description="A year in 2- or 4-digit format (default is 4-digit)." ParamCount="1" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
</DATATYPE>
<DATATYPE ID="19" IDGroup="2" TypeName="CHAR" Description="A fixed-length string (1 to 255 characters) that is always right-padded with spaces to the specified length when stored. values are sorted and compared in case-insensitive fashion according to the default character set unless the BINARY keyword is given." ParamCount="1" OptionCount="1" ParamRequired="1" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="BINARY" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="20" IDGroup="2" TypeName="VARCHAR" Description="A variable-length string (1 to 255 characters). Values are sorted and compared in case-sensitive fashion unless the BINARY keyword is given." ParamCount="1" OptionCount="1" ParamRequired="1" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="length" />
</PARAMS>
<OPTIONS>
<OPTION Name="BINARY" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="21" IDGroup="2" TypeName="BIT" Description="This is a synonym for CHAR(1)." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="22" IDGroup="2" TypeName="BOOL" Description="This is a synonym for CHAR(1)." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="23" IDGroup="3" TypeName="TINYBLOB" Description="A column maximum length of 255 (2^8 - 1) characters. Values are sorted and compared in case-sensitive fashion." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="24" IDGroup="3" TypeName="BLOB" Description="A column maximum length of 65535 (2^16 - 1) characters. Values are sorted and compared in case-sensitive fashion." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="25" IDGroup="3" TypeName="MEDIUMBLOB" Description="A column maximum length of 16777215 (2^24 - 1) characters. Values are sorted and compared in case-sensitive fashion." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="26" IDGroup="3" TypeName="LONGBLOB" Description="A column maximum length of 4294967295 (2^32 - 1) characters. Values are sorted and compared in case-sensitive fashion." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="27" IDGroup="3" TypeName="TINYTEXT" Description="A column maximum length of 255 (2^8 - 1) characters." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="28" IDGroup="3" TypeName="TEXT" Description="A column maximum length of 65535 (2^16 - 1) characters." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="29" IDGroup="3" TypeName="MEDIUMTEXT" Description="A column maximum length of 16777215 (2^24 - 1) characters." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="30" IDGroup="3" TypeName="LONGTEXT" Description="A column maximum length of 4294967295 (2^32 - 1) characters." ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="31" IDGroup="3" TypeName="ENUM" Description="An enumeration. A string object that can have only one value, chosen from the list of values." ParamCount="1" OptionCount="0" ParamRequired="1" EditParamsAsString="1" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="values" />
</PARAMS>
</DATATYPE>
<DATATYPE ID="32" IDGroup="3" TypeName="SET" Description="A set. A string object that can have zero or more values, each of which must be chosen from the list of values." ParamCount="1" OptionCount="0" ParamRequired="1" EditParamsAsString="1" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<PARAMS>
<PARAM Name="values" />
</PARAMS>
</DATATYPE>
<DATATYPE ID="33" IDGroup="4" TypeName="Varchar(20)" Description="" ParamCount="0" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<OPTIONS>
<OPTION Name="BINARY" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="34" IDGroup="4" TypeName="Varchar(45)" Description="" ParamCount="0" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<OPTIONS>
<OPTION Name="BINARY" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="35" IDGroup="4" TypeName="Varchar(255)" Description="" ParamCount="0" OptionCount="1" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
<OPTIONS>
<OPTION Name="BINARY" Default="0" />
</OPTIONS>
</DATATYPE>
<DATATYPE ID="36" IDGroup="5" TypeName="GEOMETRY" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="38" IDGroup="5" TypeName="LINESTRING" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="39" IDGroup="5" TypeName="POLYGON" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="40" IDGroup="5" TypeName="MULTIPOINT" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="41" IDGroup="5" TypeName="MULTILINESTRING" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="42" IDGroup="5" TypeName="MULTIPOLYGON" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
<DATATYPE ID="43" IDGroup="5" TypeName="GEOMETRYCOLLECTION" Description="Geographic Datatype" ParamCount="0" OptionCount="0" ParamRequired="0" EditParamsAsString="0" SynonymGroup="0" PhysicalMapping="0" PhysicalTypeName="" >
</DATATYPE>
</DATATYPES>
<COMMON_DATATYPES>
<COMMON_DATATYPE ID="5" />
<COMMON_DATATYPE ID="8" />
<COMMON_DATATYPE ID="20" />
<COMMON_DATATYPE ID="15" />
<COMMON_DATATYPE ID="22" />
<COMMON_DATATYPE ID="28" />
<COMMON_DATATYPE ID="26" />
<COMMON_DATATYPE ID="33" />
<COMMON_DATATYPE ID="34" />
<COMMON_DATATYPE ID="35" />
</COMMON_DATATYPES>
<TABLEPREFIXES>
<TABLEPREFIX Name="Defaut (pas de prefixe)" />
</TABLEPREFIXES>
<REGIONCOLORS>
<REGIONCOLOR Color="Red=#FFEEEC" />
<REGIONCOLOR Color="Yellow=#FEFDED" />
<REGIONCOLOR Color="Green=#EAFFE5" />
<REGIONCOLOR Color="Cyan=#ECFDFF" />
<REGIONCOLOR Color="Blue=#F0F1FE" />
<REGIONCOLOR Color="Magenta=#FFEBFA" />
<REGIONCOLOR Color="Orange=#FFD980" />
<REGIONCOLOR Color="Vert=#E6FFBF" />
</REGIONCOLORS>
<POSITIONMARKERS>
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
<POSITIONMARKER ZoomFac="-1.0" X="0" Y="0" />
</POSITIONMARKERS>
</SETTINGS>
<METADATA>
<REGIONS>
<REGION ID="21985" RegionName="Commentaire" XPos="790" YPos="2355" Width="694" Height="287" RegionColor="6" TablePrefix="0" TableType="0" OverwriteTablePrefix="0" OverwriteTableType="0" Comments="Module contenant les tables permettant de g\195\169rer les commentaires.\nAbreviation : CCM\nAide : OK\nEtat: OK\nRevision : $Revision$" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="68" />
<REGION ID="1443" RegionName="Collection" XPos="28" YPos="924" Width="741" Height="1421" RegionColor="0" TablePrefix="0" TableType="0" OverwriteTablePrefix="0" OverwriteTableType="0" Comments="Module de gestion des Collections.\nAbreviation : CC\nAide : OK\nEtat: OK\nRevision : $Revision$" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="2" />
<REGION ID="18416" RegionName="Structure" XPos="785" YPos="1386" Width="701" Height="959" RegionColor="1" TablePrefix="0" TableType="0" OverwriteTablePrefix="0" OverwriteTableType="0" Comments="Module de gestion des Structures.\nAbreviation : CS\nAide : OK\nEtat: OK\nRevision : $Revision$" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="15" />
<REGION ID="18417" RegionName="Personne" XPos="784" YPos="505" Width="700" Height="872" RegionColor="2" TablePrefix="0" TableType="0" OverwriteTablePrefix="0" OverwriteTableType="0" Comments="Module de gestion des Personnes.\nAbreviation : CP\nAide : OK\nEtat: OK\nRevision : $Revision$" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="16" />
<REGION ID="18447" RegionName="M\195\169tadonn\195\169e" XPos="20" YPos="16" Width="1464" Height="480" RegionColor="3" TablePrefix="0" TableType="0" OverwriteTablePrefix="0" OverwriteTableType="0" Comments="Module de gestion des M\195\169tadonn\195\169es.\nAbreviation : CM\nAide : OK\nEtat: OK\nRevision : $Revision$" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="19" />
<REGION ID="21218" RegionName="Publication" XPos="24" YPos="2357" Width="747" Height="286" RegionColor="4" TablePrefix="0" TableType="0" OverwriteTablePrefix="0" OverwriteTableType="0" Comments="Module de gestion des Publications.\nAbreviation : CPU\nAide : OK\nEtat: OK\nRevision : $Revision$" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="64" />
<REGION ID="21340" RegionName="Projet" XPos="28" YPos="504" Width="744" Height="410" RegionColor="5" TablePrefix="0" TableType="0" OverwriteTablePrefix="0" OverwriteTableType="0" Comments="Module de gestion des Projets.\nAbreviation : CPR\nAide : OK\nEtat: OK\nRevision : $Revision$" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="75" />
</REGIONS>
<TABLES>
<TABLE ID="1444" Tablename="coel_collection" PrevTableName="Table_01" XPos="36" YPos="1151" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Contient les informations sur les collections.INFO : cc_nom\n" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="5" >
<COLUMNS>
<COLUMN ID="1449" ColName="cc_id_collection" PrevColName="" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Identifiant de la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21630" ColName="cc_ce_projet" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du projet dans lequel les informations de la collection sont saisies.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21167" ColName="cc_ce_mere" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="0" Comments="Identifiant de la collection parente. Si la collection courrante n\aa pas de parente laisser la valeur 0 par d\195\169faut.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20821" ColName="cc_ce_structure" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="0" Comments="Identifiant de la structure habritant physiquement la collection. Si c\aest un particulier, laisser la valeur 0 par d\195\169faut et utiliser la table liant les collections aux personnes.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21095" ColName="cc_guid" PrevColName="" Pos="7" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Identifiant global unique de type LSID ou URI.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21099" ColName="cc_truk_identifiant_alternatif" PrevColName="" Pos="9" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Autres identifiants de la structure.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21096" ColName="cc_truk_code" PrevColName="cc_truk_sigle_usage" Pos="8" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Code(s) de la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21100" ColName="cc_nom" PrevColName="" Pos="10" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom de la collection dans la langue d\aorigine. Afficher vis \195\160 vis du public.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21101" ColName="cc_truk_nom_alternatif" PrevColName="" Pos="11" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom alternatif de la collection.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21141" ColName="cc_description" PrevColName="" Pos="12" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Description principale de la collection pour un large public.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21142" ColName="cc_description_specialiste" PrevColName="" Pos="13" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Description de la collection pour un public de sp\195\169cialistes.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21187" ColName="cc_historique" PrevColName="" Pos="20" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Historique de la collection (acquisition, diff\195\169rentes interventions de restauration, de traitement ...).">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21182" ColName="cc_truk_url" PrevColName="cc_url" Pos="18" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="URL(s) du site web ou de la page concernant la collection (WEB), d\aun web service (WS) ou d\aune page permettant d\aacc\195\168der \195\160 des informations sur les objets de la collection (OBJ).">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21262" ColName="cc_truk_groupement_principe" PrevColName="cc_ce_truk_principe_groupe" Pos="21" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Principal but de groupement de la collection au niveau int\195\169lectuel plut\195\180t que physique.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21265" ColName="cc_truk_groupement_but" PrevColName="" Pos="22" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Principal but de r\195\169alisation de la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21146" ColName="cc_ce_type" PrevColName="" Pos="14" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Type de la collection vis \195\160 vis du standard NCD.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21177" ColName="cc_ce_type_depot" PrevColName="" Pos="17" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Type de d\195\169p\195\180t de la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21175" ColName="cc_cote" PrevColName="" Pos="15" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="C\195\180te de la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21176" ColName="cc_dimenssion" PrevColName="" Pos="16" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Dimenssion, taille de la collection sous forme de texte libre.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21307" ColName="cc_condition_acces" PrevColName="" Pos="23" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Condition d\aacc\195\168s \195\160 la collection. Peut \195\170tre d\195\169finit par d\195\169faut par la structure.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21308" ColName="cc_condition_usage" PrevColName="" Pos="24" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Condition d\ausages de la collection. Peut \195\170tre d\195\169finit par d\195\169faut par la structure.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21183" ColName="cc_truk_couverture_vernaculaire" PrevColName="cc_truk_nature" Pos="19" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nature de la collection sous forme de nom(s) vernaculaire(s).">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21313" ColName="cc_truk_couverture_taxonomique" PrevColName="cc_couverture_taxonomique" Pos="25" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom de famille ou de taxons sup\195\169rieurs pr\195\169sent dans la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21327" ColName="cc_truk_couverture_regne" PrevColName="" Pos="32" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Liste des r\195\168gnes couverts par la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21314" ColName="cc_truk_couverture_temporelle" PrevColName="cc_couverture_temporelle" Pos="26" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="P\195\169riode de temps couverte par la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21326" ColName="cc_truk_couverture_vie" PrevColName="cc_truk_couverture_periode_vie" Pos="31" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="P\195\169riode de temps durant laquelle le mat\195\169riel biologique \195\169tait en vie. Inclu les p\195\169riodes de temps pal\195\169ontologiques.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20841" ColName="cc_truk_conservation_statut" PrevColName="cc_ce_etat" Pos="6" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Indiquer la date d\aune estimation s\195\169par\195\169e par un di\195\168se du statut estim\195\169 utilisant l\a\195\169chelle de McGinley. Plusieurs estimations seront s\195\169par\195\169s par un point virgule.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21328" ColName="cc_truk_preservation" PrevColName="" Pos="33" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Liste indiquant les proc\195\169dures ou techniques de conservation utilis\195\169es pour les collections non vivantes.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21335" ColName="cc_ce_developpement" PrevColName="" Pos="35" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Indique le changement potentiel dans la port\195\169e de la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21337" ColName="cc_truk_periode_constitution" PrevColName="cc_truk_periode_formation" Pos="36" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Liste de p\195\169riodes de temps durant laquelle la collection a \195\169t\195\169 assembl\195\169e.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21338" ColName="cc_truk_couverture_lieu" PrevColName="" Pos="37" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Liste de lieux (continent, pays, region, d\195\169partement, commune, autres lieux historique ou texte libre) desquels le mat\195\169riel de la collection est originaire.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21339" ColName="cc_truk_coordonnee" PrevColName="" Pos="38" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Liste de coordonn\195\169es d\195\169cimales des lieux d\aorigine du mat\195\169riel de la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21325" ColName="cc_ce_specimen_type" PrevColName="cc_mark_specimen_type" Pos="30" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Y-a-t\ail des \195\169chantillons-types?">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21506" ColName="cc_specimen_type_nbre" PrevColName="" Pos="41" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nombre de sp\195\169cimen type pr\195\169sent dans la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27966" ColName="cc_ce_specimen_type_nbre_precision" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du type de pr\195\169cision du nombre de sp\195\169cimen type.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21508" ColName="cc_ce_specimen_type_classement" PrevColName="" Pos="42" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Type de classement des specimens types.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21345" ColName="cc_expedition_nom" PrevColName="" Pos="39" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom de l\aexp\195\169dition durant laquelle le mat\195\169riel a \195\169t\195\169 collect\195\169.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21323" ColName="cc_truk_digital_medium" PrevColName="" Pos="29" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Pour les collections digitales, listes des types de support d\aenregistrement. Ex. : DVD-R.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21322" ColName="cc_truk_digital_format" PrevColName="" Pos="28" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Pour les collections digitales, listes des types MIME.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27933" ColName="cc_mark_public" PrevColName="" Pos="41" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Indique si oui (=1) ou non (=0) les donn\195\169es de cette collection sont publiques.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20839" ColName="cc_ce_meta" PrevColName="cc_date_derniere_modif" Pos="4" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="20819" />
<RELATION_START ID="21108" />
<RELATION_START ID="21152" />
<RELATION_START ID="21223" />
<RELATION_START ID="22037" />
</RELATIONS_START>
<RELATIONS_END>
<RELATION_END ID="20817" />
<RELATION_END ID="20819" />
<RELATION_END ID="21628" />
<RELATION_END ID="22079" />
<RELATION_END ID="22158" />
<RELATION_END ID="22160" />
<RELATION_END ID="22162" />
<RELATION_END ID="22164" />
<RELATION_END ID="27872" />
<RELATION_END ID="27959" />
</RELATIONS_END>
<INDICES>
<INDEX ID="1450" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1449" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1445" Tablename="coel_structure" PrevTableName="Table_02" XPos="806" YPos="1410" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Contient les informations sur les structures.\nINFO : cs_nom" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="41" >
<COLUMNS>
<COLUMN ID="18411" ColName="cs_id_structure" PrevColName="idcoel_structure" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Identifiant de la structure.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21627" ColName="cs_ce_projet" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="0" Comments="Identifiant du projet dans lequel les informations de la structure sont saisies.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21165" ColName="cs_ce_mere" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="0" Comments="Identifiant de la structure m\195\168re.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18555" ColName="cs_guid" PrevColName="cs_uri" Pos="1" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="URI (LSID ou URL) de la structure. Dans le format RDF, cela sera utilis\195\169 comme URI des donn\195\169es de l\ainstitutions.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18561" ColName="cs_truk_identifiant_alternatif" PrevColName="cs_identifiant_alternatif" Pos="6" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Identifiant alternatif. Par exemple, l\aacronyme de l\aIndex Herbariorum ou du MNHN. S\195\169parer les diff\195\169rentes valeurs par un point virgule \A;\A et le type d\aidentifiant de sa valeur par un di\195\168ze \A#\A. Exemple : IH#MPU;MNHN#163">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18556" ColName="cs_nom" PrevColName="cs_intitule" Pos="2" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom officiel de la structure dans sa langue d\aorigine.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18557" ColName="cs_truk_nom_alternatif" PrevColName="cs_intitule_alternatif" Pos="3" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Autres noms de la structures. S\195\169parer les diff\195\169rentes valeurs par un point virgule \A;\A.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18560" ColName="cs_description" PrevColName="" Pos="5" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Description de la structure pour le public.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20789" ColName="cs_ce_type" PrevColName="cs_ce_statut" Pos="17" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du type de la structure vis \195\160 vis du standard NCD.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21169" ColName="cs_ce_truk_type_prive" PrevColName="" Pos="24" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Type priv\195\169 de structure.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21170" ColName="cs_ce_truk_type_public" PrevColName="" Pos="25" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Type public de structure.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20777" ColName="cs_adresse_01" PrevColName="" Pos="7" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Adresse principale.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20778" ColName="cs_adresse_02" PrevColName="" Pos="8" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Compl\195\169ment d\aadresse.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20780" ColName="cs_date_fondation" PrevColName="" Pos="9" idDatatype="14" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Date de fondation de la structure.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20781" ColName="cs_code_postal" PrevColName="" Pos="10" idDatatype="20" DatatypeParams="(16)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Code postal.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20782" ColName="cs_ville" PrevColName="" Pos="11" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Ville.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20783" ColName="cs_ce_truk_region" PrevColName="cs_region" Pos="12" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Identifiant du nom de la r\195\169gion (\195\169tat, province) o\195\185 est situ\195\169 la structure. Utiliser les noms du standard ISO-3166-2. Sinon utiliser \AAUTRE\A pour stocker d\a\195\169ventuel valeur non pr\195\169sente dans ISO-3166-2. ">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20784" ColName="cs_ce_truk_pays" PrevColName="cs_pays" Pos="13" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Identifiant du nom du pays de la structure. Utiliser les noms du standard ISO-3166-1. Sinon utiliser \AAUTRE\A pour stocker d\a\195\169ventuel valeur non pr\195\169sente dans ISO-3166-1.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27881" ColName="cs_latitude" PrevColName="" Pos="27" idDatatype="20" DatatypeParams="(15)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Latitude du local de la structure.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27882" ColName="cs_longitude" PrevColName="" Pos="28" idDatatype="20" DatatypeParams="(15)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Longitude du local de la structure.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20785" ColName="cs_truk_telephone" PrevColName="cs_telephone" Pos="14" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="T\195\169l\195\169phone(s) principaux de la structure (fixe, fax, portable...).">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20787" ColName="cs_courriel" PrevColName="" Pos="16" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Courriel principal de contact de l\aorganisation ex : accueil@organisation.org, pas de mail individuel.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21159" ColName="cs_truk_url" PrevColName="" Pos="22" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="URL(s) du site web principal de la structure, du logo de la structure ou d\aune page web particuli\195\168re.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20816" ColName="cs_nbre_personne" PrevColName="" Pos="19" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nombre de personne pr\195\169sentent dans la structure.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21310" ColName="cs_condition_acces" PrevColName="" Pos="26" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Conditions d\aacc\195\168s \195\160 la structure.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21311" ColName="cs_condition_usage" PrevColName="" Pos="27" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Conditions d\ausage g\195\169n\195\169rales des collections de la structure.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20825" ColName="cs_ce_meta" PrevColName="cs_date_derniere_modif" Pos="21" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="18419" />
<RELATION_START ID="20817" />
<RELATION_START ID="20859" />
<RELATION_START ID="20861" />
<RELATION_START ID="21163" />
<RELATION_START ID="21616" />
<RELATION_START ID="27904" />
</RELATIONS_START>
<RELATIONS_END>
<RELATION_END ID="21163" />
<RELATION_END ID="21625" />
<RELATION_END ID="21957" />
<RELATION_END ID="21959" />
<RELATION_END ID="21961" />
<RELATION_END ID="21964" />
</RELATIONS_END>
<INDICES>
<INDEX ID="18412" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="18411" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1446" Tablename="coel_personne" PrevTableName="Table_03" XPos="1204" YPos="540" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Contient les informations sur les personnes.\nPar personne nous entendons \195\160 la fois les utilisateurs de l\aapplication mais aussi les personnes contacts, les botanistes collecteurs, auteurs...\nINFO : cp_fmt_nom_complet" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="68" >
<COLUMNS>
<COLUMN ID="1456" ColName="cp_id_personne" PrevColName="cco_id_contact" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Identifiant d\aun contact.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21624" ColName="cp_ce_projet" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du projet auquel la personne appartient. Exemple : utilisateur appli coel, HUH, IPNI...">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1458" ColName="cp_fmt_nom_complet" PrevColName="cco_nom_complet" Pos="1" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom complet du contact format\195\169 pour l\aaffichage (le format peut \195\170tre diff\195\169rent en fonction du projet).">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1462" ColName="cp_ce_truk_prefix" PrevColName="cco_prefix" Pos="5" idDatatype="20" DatatypeParams="(20)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Pr\195\169fixe du nom principal. Exemple : Dr., Prof., Mr., Lord, von...">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1460" ColName="cp_prenom" PrevColName="cco_prenom" Pos="3" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Pr\195\169nom principal (le plus connu, r\195\169pandu) de la personne. Un point virgule peut s\195\169parer le pr\195\169nom principal de pr\195\169noms secondaires \195\160 ne pas afficher dans le nom complet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1459" ColName="cp_nom" PrevColName="cco_nom" Pos="2" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Indiquer les lieux de r\195\169colte (code ISO des pays) s\195\169par\195\169s par des points virgules. Apr\195\168s chaque code ISO indiqu\195\169 les ann\195\169es de r\195\169colte s\195\169par\195\169es par des vigules ou des tirets pour les p\195\169riodes continues). Si le pays de r\195\169colte est inconnu utilis\195\169 un point d\ainterogration. Exemple : FR#1905-1908,1910;PS#1912.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1463" ColName="cp_ce_truk_suffix" PrevColName="cco_suffix" Pos="6" idDatatype="20" DatatypeParams="(20)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Suffixe du nom principal. Exemple : Jr, III.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="1461" ColName="cp_truk_nom_autre" PrevColName="cco_nom_complement" Pos="4" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom(s) complet alternatif et surnoms. Pour les valeurs, s\195\169parez l\aidentifiant de l\aabreviation par un symbole pipe \A|\A. Exemple: HUH#105714|Sharp, Aaron John;APN#9544-1|Sharp, Aaron John (\aJack\a)">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21132" ColName="cp_abreviation" PrevColName="" Pos="35" idDatatype="20" DatatypeParams="(50)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Abreviation retenu du nom.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21133" ColName="cp_truk_abreviation_autre" PrevColName="" Pos="36" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Autres abr\195\169viations du nom.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21123" ColName="cp_naissance_date" PrevColName="cp_date_naissance" Pos="30" idDatatype="14" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0000-00-00" Comments="Date de naissance de la personne.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21126" ColName="cp_naissance_lieu" PrevColName="" Pos="32" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Lieu de naissance de la personne.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27943" ColName="cp_ce_deces" PrevColName="" Pos="40" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Permet de savoir si la personne est d\195\169c\195\169d\195\169e ou pas, ou que l\ainformation est ind\195\169termin\195\169e.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21124" ColName="cp_deces_date" PrevColName="cp_date_deces" Pos="31" idDatatype="14" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Date de d\195\169c\195\169s de la personne. Par d\195\169faut, si la personne n\aest pas d\195\169c\195\169d\195\169 le champ reste null. Si la personne est d\195\169c\195\169d\195\169e mais que l\aon ne connait pas la date mettre : 0000-00-00">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21127" ColName="cp_deces_lieu" PrevColName="" Pos="33" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Lieu de d\195\169c\195\169s de la personne.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21974" ColName="cp_ce_sexe" PrevColName="" Pos="38" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Indique si la personne est un homme ou une femme...">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21968" ColName="cp_description" PrevColName="" Pos="35" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Informations diverses sur la personne.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21258" ColName="cp_biographie" PrevColName="" Pos="35" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Vie et renomm\195\169e (locale, r\195\169gionale, ...) de la personne.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18392" ColName="cp_adresse_01" PrevColName="cco_perso_adresse" Pos="13" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Adresse de la personne.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18391" ColName="cp_adresse_02" PrevColName="cco_perso_adresse_complement" Pos="12" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Compl\195\169ment d\aadresse personnelle.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18394" ColName="cp_ce_truk_region" PrevColName="cco_perso_region" Pos="15" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du nom de la r\195\169gion (\195\169tat, province) o\195\185 vit la personne. Utiliser les noms du standard ISO-3166-2. Sinon utiliser \AAUTRE\A pour stocker d\a\195\169ventuel valeur non pr\195\169sente dans ISO-3166-2.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18390" ColName="cp_bp" PrevColName="cco_perso_bp" Pos="11" idDatatype="20" DatatypeParams="(20)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Boite postale de l\aadresse de la personne.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18395" ColName="cp_code_postal" PrevColName="cco_perso_code_postal" Pos="16" idDatatype="20" DatatypeParams="(10)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Code postal (zip) personnel.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18393" ColName="cp_ville" PrevColName="cco_perso_ville" Pos="14" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom de la localit\195\169 (ville) o\195\185 vit la personne.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18396" ColName="cp_ce_truk_pays" PrevColName="cco_perso_pays" Pos="17" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du pays o\195\185 vit la personne. Utiliser les noms du standard ISO-3166-1. Sinon utiliser \AAUTRE\A pour stocker d\a\195\169ventuel valeur non pr\195\169sente dans ISO-3166-1.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18400" ColName="cp_truk_telephone" PrevColName="cco_perso_tel_complement" Pos="21" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Num\195\169ro(s) de t\195\169l\195\169phone fixe (FIX), portable (GSM), Fax (FAX), pager (PAG)... personnels.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18401" ColName="cp_truk_courriel" PrevColName="cco_perso_courriel" Pos="22" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Adresse(s) de courriel personnel. Ajouter les adresses dans leur ordre d\aimportance.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18402" ColName="cp_truk_url" PrevColName="cco_perso_url" Pos="23" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="URL(s) de site web personnel. Ajouter les adresses dans leur ordre d\aimportance.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18403" ColName="cp_truk_logo" PrevColName="cco_perso_logo" Pos="24" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="URL(s) des logo, avatar, portrait ou photo de la personne. Ajouter les URL(s) dans leur ordre d\aimportance.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18436" ColName="cp_ce_truk_specialite" PrevColName="cp_bota_specialite" Pos="29" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Indiquer s\195\169parer par des points virgules \A;\A les sp\195\169cialit\195\169s naturalistes de la personne.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21129" ColName="cp_truk_recolte" PrevColName="" Pos="34" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Indiquer les lieux de r\195\169colte s\195\169par\195\169s par des points virgules. Indiquer le r\195\169f\195\169rentiel g\195\169ographique utilis\195\169 puis apr\195\168s un # mettre le code ou identitifiant de la zone g\195\169ographique. Apr\195\168s chaque code ISO un peut signe pipe | peut \195\170tre suivi des ann\195\169es de r\195\169colte s\195\169par\195\169es par des vigules ou des tirets pour les p\195\169riodes continues). Si le pays de r\195\169colte est inconnu utilis\195\169 un point d\ainterogration. Exemple : ISO-3166-1#FR|1905-1908,1910;ISO-3166-1#PS|1912;ISO-3166-2#FR-34|1917.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21554" ColName="cp_ce_truk_role" PrevColName="" Pos="36" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="R\195\180le g\195\169n\195\169rale de la personne vis \195\160 vis de l\aensemble des projets : superadmin, admin...">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18446" ColName="cp_mark_licence" PrevColName="cp_bool_licence" Pos="33" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Indique quand la valeur vaut 1 que l\autilisateur a accept\195\169 la licence d\autilisation de l\aapplication. ">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21972" ColName="cp_parametre" PrevColName="" Pos="37" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Parametres de l\autilisateur vis \195\160 vis de l\aapplication.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21966" ColName="cp_session_id" PrevColName="" Pos="34" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Identifiant de session de la personne utilisatrice de l\aapplication.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18438" ColName="cp_login" PrevColName="" Pos="31" idDatatype="20" DatatypeParams="(50)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Login de la personne pour acc\195\169der \195\160 l\aapplication.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18439" ColName="cp_mot_de_passe" PrevColName="" Pos="32" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Mot de passe de la personne pour acc\195\169der \195\160 l\aapplication. Encod\195\169 par SHA1.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21970" ColName="cp_ce_annuaire" PrevColName="cp_ce_annuaire_tela" Pos="36" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Identifiant de la personne dans un annuaire (par d\195\169faut celui de Tela Botanica).">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27938" ColName="cp_mark_public" PrevColName="" Pos="39" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Indique si oui (=1) ou non (=0) les donn\195\169es de cette personne sont publiques.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18405" ColName="cp_ce_meta" PrevColName="cco_" Pos="26" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="18425" />
<RELATION_START ID="21110" />
<RELATION_START ID="21239" />
<RELATION_START ID="21563" />
<RELATION_START ID="21666" />
<RELATION_START ID="21789" />
</RELATIONS_START>
<RELATIONS_END>
<RELATION_END ID="21622" />
<RELATION_END ID="22062" />
<RELATION_END ID="22099" />
<RELATION_END ID="22101" />
<RELATION_END ID="22133" />
<RELATION_END ID="22135" />
<RELATION_END ID="22137" />
<RELATION_END ID="27948" />
<RELATION_END ID="27950" />
<RELATION_END ID="27952" />
</RELATIONS_END>
<INDICES>
<INDEX ID="1457" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="1456" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="1447" Tablename="coel_structure_a_personne" PrevTableName="Table_04" XPos="1203" YPos="1523" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Table de liaison permettant d\aindiquer la composition de la structure en personnel.\nElle permet d\aindiquer pour une personne vis \195\160 vis d\aune structure :\n - si elle est contact\n - les informations de la personne sp\195\169cifique \195\160 cette structure (ex. : t\195\169l\195\169phone du travail, fonction, service, statut...)." Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="60" >
<COLUMNS>
<COLUMN ID="21568" ColName="csap_id_structure" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la structure.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21567" ColName="csap_id_personne" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant d\aune personne.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21609" ColName="csap_id_role" PrevColName="cspa_id_role" Pos="11" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="R\195\180le de la personne vis \195\160 vis de la structure.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18533" ColName="csap_ce_truk_fonction" PrevColName="csae_fonction" Pos="7" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Intitul\195\169 de la fonction de la personne dans son travail.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18534" ColName="csap_service" PrevColName="csae_service" Pos="8" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom du service ou d\195\169partement dans lequel la personne travaille.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18537" ColName="csap_ce_truk_statut" PrevColName="csae_statut" Pos="9" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Statut(s) de la personne : salari\195\169, b\195\169n\195\169vole...">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18433" ColName="csap_mark_contact" PrevColName="csae_bool_contact" Pos="2" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Si la personne est un contact la valeur vaut 1 sinon c\aest 0.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18546" ColName="csap_bota_travail_hebdo_tps" PrevColName="csae_bota_travail_hebdo_tps" Pos="10" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Date de la derni\195\168re modification sur cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18442" ColName="csap_ce_meta" PrevColName="csae_date_derniere_modif" Pos="4" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="18419" />
<RELATION_END ID="18425" />
<RELATION_END ID="22073" />
<RELATION_END ID="22142" />
<RELATION_END ID="22144" />
<RELATION_END ID="27941" />
</RELATIONS_END>
<INDICES>
<INDEX ID="20888" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21568" LengthParam="0" />
<INDEXCOLUMN idColumn="21567" LengthParam="0" />
<INDEXCOLUMN idColumn="21609" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="18452" Tablename="coel_meta_donnee" PrevTableName="Table_06" XPos="272" YPos="312" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Contient les champs suppl\195\169mentaires (non standard ou de sp\195\169cialisation) de la base de donn\195\169es." Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="30" >
<COLUMNS>
<COLUMN ID="18454" ColName="cmd_id_donnee" PrevColName="cmt_id_donnee" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Identifiant de la donn\195\169e.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21806" ColName="cmd_ce_table" PrevColName="" Pos="4" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la table.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20804" ColName="cmd_ce_ligne" PrevColName="cmd_ce_identifiant" Pos="3" idDatatype="20" DatatypeParams="(64)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Identifiant de la ligne \195\160 laquelle le champ dans la table d\aorigine appartient. Pour les tables \195\160 cl\195\169 primaire multi colonnes, bien respecter l\aordre des champs de la cl\195\169 et inscrire chaque valeur de cl\195\169 s\195\169par\195\169e par un tiret \A-\A.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21797" ColName="cmd_ce_champ" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du champ.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18479" ColName="cmd_valeur" PrevColName="" Pos="3" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Valeur.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="18470" />
<RELATION_END ID="22091" />
</RELATIONS_END>
<INDICES>
<INDEX ID="18455" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="18454" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="18456" Tablename="coel_meta_colonne" PrevTableName="Table_07" XPos="572" YPos="93" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Contient l\aensemble des champs des tables de la base de donn\195\169es.\nINFO : cmc_nom" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="26" >
<COLUMNS>
<COLUMN ID="18458" ColName="cmc_id_champ" PrevColName="cmc_id_caracteristique" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Identifiant du nom du champ dans la table.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21832" ColName="cmc_ce_projet" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21824" ColName="cmc_ce_liste" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la liste de valeur poss\195\169d\195\169e par cette colonne.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21800" ColName="cmc_ce_table" PrevColName="" Pos="5" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la table \195\160 laquelle ce champ appartient.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="18503" ColName="cmc_nom" PrevColName="cmc_intitule" Pos="2" idDatatype="20" DatatypeParams="(50)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Intitul\195\169 du champ.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21732" ColName="cmc_abreviation" PrevColName="" Pos="3" idDatatype="20" DatatypeParams="(20)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Abr\195\169viation du champ.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21733" ColName="cmc_description" PrevColName="" Pos="4" idDatatype="20" DatatypeParams="(510)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Description du champ.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21809" ColName="cmc_ce_format_sql" PrevColName="" Pos="5" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du format SQL utilis\195\169 pour ce champ.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21810" ColName="cmc_taille" PrevColName="" Pos="6" idDatatype="20" DatatypeParams="(20)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Taille du format SQL du champ.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21835" ColName="cmc_ce_meta" PrevColName="cmc_ce_modifier_par" Pos="10" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="18470" />
</RELATIONS_START>
<RELATIONS_END>
<RELATION_END ID="21822" />
<RELATION_END ID="21830" />
<RELATION_END ID="21863" />
<RELATION_END ID="22087" />
<RELATION_END ID="22089" />
</RELATIONS_END>
<INDICES>
<INDEX ID="18459" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="18458" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="18466" Tablename="coel_meta_liste_valeur" PrevTableName="Table_09" XPos="108" YPos="57" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Liste l\aensemble des valeurs des tables de type liste.\nUn champ contient des valeurs dans cette table quand il est de type \ALISTE\A.\nINFO : cmlv_nom" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="25" >
<COLUMNS>
<COLUMN ID="18468" ColName="cmlv_id_valeur" PrevColName="cmv_id_valeur" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Identifiant d\aune valeur de liste. Notez que les listes sont des valeurs de la liste des listes.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21821" ColName="cmlv_ce_parent" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la cat\195\169gorie ou des informations sur la liste. Les listes ont pour parent la valeur 0 qui correspond \195\160 la liste des listes.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21818" ColName="cmlv_ce_projet" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du projet de la valeur.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21723" ColName="cmlv_nom" PrevColName="cmv_nom" Pos="2" idDatatype="20" DatatypeParams="(100)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom de la valeur.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21724" ColName="cmlv_abreviation" PrevColName="cmv_abreviation" Pos="3" idDatatype="20" DatatypeParams="(50)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Abr\195\169viation, code ou identifiant de la valeur.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21725" ColName="cmlv_description" PrevColName="cmv_description" Pos="4" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Description de cette valeur.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21814" ColName="cmlv_ce_meta" PrevColName="cmlv_ce_modifier_par" Pos="6" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="21819" />
<RELATION_START ID="21822" />
<RELATION_START ID="21959" />
<RELATION_START ID="21961" />
<RELATION_START ID="21964" />
<RELATION_START ID="22071" />
<RELATION_START ID="22087" />
<RELATION_START ID="22089" />
<RELATION_START ID="22091" />
<RELATION_START ID="22093" />
<RELATION_START ID="22096" />
<RELATION_START ID="22099" />
<RELATION_START ID="22101" />
<RELATION_START ID="22133" />
<RELATION_START ID="22135" />
<RELATION_START ID="22137" />
<RELATION_START ID="22142" />
<RELATION_START ID="22144" />
<RELATION_START ID="22146" />
<RELATION_START ID="22148" />
<RELATION_START ID="22150" />
<RELATION_START ID="22154" />
<RELATION_START ID="22158" />
<RELATION_START ID="22160" />
<RELATION_START ID="22162" />
<RELATION_START ID="22164" />
<RELATION_START ID="22170" />
<RELATION_START ID="22172" />
<RELATION_START ID="22174" />
<RELATION_START ID="22178" />
<RELATION_START ID="22301" />
<RELATION_START ID="22306" />
<RELATION_START ID="22308" />
<RELATION_START ID="22309" />
<RELATION_START ID="22311" />
<RELATION_START ID="22313" />
<RELATION_START ID="22315" />
<RELATION_START ID="22318" />
<RELATION_START ID="22320" />
<RELATION_START ID="22322" />
<RELATION_START ID="22324" />
<RELATION_START ID="22326" />
<RELATION_START ID="27872" />
<RELATION_START ID="27908" />
<RELATION_START ID="27910" />
<RELATION_START ID="27912" />
<RELATION_START ID="27941" />
<RELATION_START ID="27948" />
<RELATION_START ID="27950" />
<RELATION_START ID="27952" />
<RELATION_START ID="27959" />
</RELATIONS_START>
<RELATIONS_END>
<RELATION_END ID="21816" />
<RELATION_END ID="21819" />
<RELATION_END ID="21861" />
</RELATIONS_END>
<INDICES>
<INDEX ID="18469" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="18468" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="20850" Tablename="coel_structure_conservation" PrevTableName="Table_11" XPos="1170" YPos="1795" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Toutes les donn\195\169es sp\195\169cifiques \195\160 la conservation au sein d\aune structure." Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="54" >
<COLUMNS>
<COLUMN ID="20978" ColName="csc_id_structure" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la structure.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20869" ColName="csc_mark_formation" PrevColName="" Pos="1" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Le personnel s\aoccupant des collections botaniques a-t-il suivi des formations en conservation\194\160?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20871" ColName="csc_formation" PrevColName="" Pos="2" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Les formations en conservation suvi par le personnel.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20872" ColName="csc_mark_formation_interet" PrevColName="" Pos="3" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Le personnel s\aoccupant des collections botaniques a-t-il suivi des formations en conservation\194\160?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20874" ColName="csc_truk_stockage_local" PrevColName="csc_ce_stockage_local" Pos="4" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Avez-vous des locaux sp\195\169cifiques de stockage des collections botaniques\194\160?">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20912" ColName="csc_truk_stockage_meuble" PrevColName="csc_stockage_meuble" Pos="6" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Avez-vous des meubles sp\195\169cifiques au stockage des collections botaniques\194\160? ">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20914" ColName="csc_truk_stockage_parametre" PrevColName="csc" Pos="8" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Quels param\195\168tres ma\195\174trisez-vous ?">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20952" ColName="csc_mark_collection_commune" PrevColName="" Pos="7" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Les collections botaniques sont-elles conserv\195\169es avec d\aautres collections dans les m\195\170mes locaux\194\160(probl\195\168me de conservation en commun) ? ">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20954" ColName="csc_truk_collection_autre" PrevColName="csc_truk_collection_ature" Pos="8" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Actuellement, vos collections botaniques s\aaccroissent-elles de nouvelles acquisitions\194\160?">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20960" ColName="csc_mark_acces_controle" PrevColName="" Pos="9" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="L\aacc\195\168s \195\160 vos collections botaniques est-il contr\195\180l\195\169 (ex.\194\160: manipulation r\195\169serv\195\169e \195\160 des personnes comp\195\169tentes)\194\160?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20961" ColName="csc_mark_restauration" PrevColName="" Pos="10" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Effectuez-vous actuellement des op\195\169rations de restauration ou de remise en \195\169tat de vos collections botaniques\194\160?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20963" ColName="csc_truk_restauration_operation" PrevColName="" Pos="11" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Les diff\195\169rentes op\195\169rations de restauration actuellement men\195\169es.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20964" ColName="csc_ce_materiel_conservation" PrevColName="" Pos="12" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Utilisez-vous du mat\195\169riel de conservation ?">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20967" ColName="csc_truk_materiel_autre" PrevColName="" Pos="13" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Le mat\195\169riel, dit de \Anon conservation\A utilis\195\169.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20969" ColName="csc_mark_traitement" PrevColName="" Pos="14" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="R\195\169alisez-vous actuellement des traitements globaux contre les insectes\194\160?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20970" ColName="csc_truk_traitement" PrevColName="" Pos="15" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Traitements globaux contre les insectes.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20971" ColName="csc_mark_acquisition_collection" PrevColName="csc_mark_acquisition" Pos="16" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Actuellement, vos collections botaniques s\aaccroissent-elles de nouvelles acquisitions\194\160?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20973" ColName="csc_mark_acquisition_echantillon" PrevColName="" Pos="17" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Actuellement mettez-vous en herbier de nouveaux \195\169chantillons\194\160? ">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20974" ColName="csc_mark_acquisition_traitement" PrevColName="" Pos="18" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Si oui, faites-vous un traitement contre les insectes avant l\aint\195\169gration dans vos collections\194\160?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20975" ColName="csc_truk_acquisition_traitement_poison" PrevColName="" Pos="19" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Traitement de type empoisonnement effectu\195\169 lors des des acquisitions.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20976" ColName="csc_truk_acquisition_traitement_insecte" PrevColName="" Pos="20" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Traitement de type d\195\169sinctisation effectu\195\169 lors des des acquisitions.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27914" ColName="csc_ce_meta" PrevColName="" Pos="21" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="20859" />
<RELATION_END ID="22146" />
<RELATION_END ID="27921" />
</RELATIONS_END>
<INDICES>
<INDEX ID="20979" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="20978" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="20854" Tablename="coel_structure_valorisation" PrevTableName="Table_12" XPos="827" YPos="2027" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Toutes les donn\195\169es sp\195\169cifiques \195\160 la valorisation au sein d\aune structure." Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="42" >
<COLUMNS>
<COLUMN ID="20866" ColName="csv_id_structure" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la structure.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20981" ColName="csv_mark_action" PrevColName="" Pos="1" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Avez-vous r\195\169alis\195\169 des actions de valorisation de vos collections botaniques\194\160ou avez-vous \195\169t\195\169 sollicit\195\169s pour la valorisation de ces collections ?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20982" ColName="csv_truk_action" PrevColName="" Pos="2" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Les actions de valorisation r\195\169alis\195\169es.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20983" ColName="csv_publication" PrevColName="" Pos="3" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Quelques titres des ouvrages, articles scientifiques, ... ?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20984" ColName="csv_collection_autre" PrevColName="" Pos="4" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="L\aorganisme dispose-t-il d\aautres collections (permettant une valorisation pluridisciplinaire)\194\160?">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20985" ColName="csv_mark_action_future" PrevColName="" Pos="5" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Envisagez-vous des actions de valorisation dans le cadre de votre politique culturelle\194\160?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20986" ColName="csv_action_future" PrevColName="" Pos="6" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Les actions de valorisation futures envisag\195\169es.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20987" ColName="csv_mark_recherche" PrevColName="" Pos="7" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Vos collections botaniques sont-elles utilis\195\169es pour des recherches scientifiques\194\160?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20988" ColName="csv_truk_recherche_provenance" PrevColName="" Pos="8" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Si oui, par des chercheurs (professionnels ou amateurs ) de quelle provenance\194\160?">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20990" ColName="csv_truk_recherche_type" PrevColName="" Pos="9" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Et pour quelles types de recherches\194\160? ">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20992" ColName="csv_mark_acces_ss_motif" PrevColName="" Pos="10" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Peut-on consulter vos collections botaniques sans motif de recherches scientifiques ?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20993" ColName="csv_acces_ss_motif" PrevColName="" Pos="11" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Si oui, quelles d\195\169marches doit-on faire pour les consulter\194\160?">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20994" ColName="csv_mark_visite_avec_motif" PrevColName="csv_mark_visite_ss_motif" Pos="12" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Peut-on visiter vos collections botaniques en avec des objectifs de recherches scientifiques\194\160?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="20995" ColName="csv_visite_avec_motif" PrevColName="csv_visite_ss_motif" Pos="13" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Si oui, quelles d\195\169marches doit-on faire pour les visiter\194\160?">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27918" ColName="csv_ce_meta" PrevColName="" Pos="14" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="20861" />
<RELATION_END ID="27924" />
</RELATIONS_END>
<INDICES>
<INDEX ID="20867" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="20866" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="21104" Tablename="coel_collection_a_personne" PrevTableName="Table_14" XPos="473" YPos="1068" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Permet de lister les personnes en rapport avec une collection." Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="22" >
<COLUMNS>
<COLUMN ID="21106" ColName="ccap_id_collection" PrevColName="" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la collection associ\195\169e \195\160 une personne.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21112" ColName="ccap_id_personne" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la personne associ\195\169e \195\160 une collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21139" ColName="ccap_id_role" PrevColName="ccap_ce_truk_role" Pos="6" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="R\195\180le(s) de la personne : auteur, collecteur... permet aussi de conna\195\174tre qui a les droits de modification sur la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21115" ColName="ccap_ce_meta" PrevColName="ccap_date_derniere_modif" Pos="3" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="21108" />
<RELATION_END ID="21110" />
<RELATION_END ID="22077" />
<RELATION_END ID="22154" />
</RELATIONS_END>
<INDICES>
<INDEX ID="21107" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21106" LengthParam="0" />
<INDEXCOLUMN idColumn="21112" LengthParam="0" />
<INDEXCOLUMN idColumn="21139" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="21148" Tablename="coel_collection_botanique" PrevTableName="Table_14" XPos="443" YPos="1329" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Toutes les informations sp\195\169cialis\195\169es sur une collection de type : botanique" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="8" >
<COLUMNS>
<COLUMN ID="21150" ColName="ccb_id_collection" PrevColName="" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="1" DefaultValue="" Comments="Type(s) unit\195\169 de rangement de la collection botanique. \\\nPour chaque type : indication du nombre d\aunit\195\169, de la pr\195\169cision du nom (exact, approximatif), des formats.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27946" ColName="ccb_nbre_echantillon" PrevColName="" Pos="43" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nombre de cartons ou liasses \195\169chantillonn\195\169es.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="26508" ColName="ccb_ce_truk_type" PrevColName="" Pos="41" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Type(s) de collection botanique.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21343" ColName="ccb_truk_unite_rangement" PrevColName="ccb_truk" Pos="2" idDatatype="20" DatatypeParams="(510)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Type(s) unit\195\169 de rangement de la collection botanique. \\\nPour chaque type : indication du nombre d\aunit\195\169, de la pr\195\169cision du nom (exact, approximatif), des formats.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21348" ColName="ccb_ce_unite_rangement_etat" PrevColName="" Pos="3" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="\195\137tat de la majorit\195\169 des unit\195\169s de rangements (\195\169tat des rubans, des poign\195\169es, des sangles, des cartons...).">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21350" ColName="ccb_truk_unite_base" PrevColName="" Pos="4" idDatatype="20" DatatypeParams="(510)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Type(s) d\aunit\195\169 de base de la collection,\194\160 si diff\195\169rent de l\aunit\195\169 de rangement. \\ Ex. : si l\aunit\195\169 de rangement est un carton, l\aunit\195\169 de base peut \195\170tre une enveloppe. \\ Pour chaque type : indication du nombre d\aunit\195\169, de la pr\195\169cision du nom (exact = 1, approximatif = 0), des formats (Lxl cm), du nombre de parts, de la pr\195\169cision sur le nombre de parts (exact = 1, approximatif = 0), du nombre d\aesp\195\168ces, de la pr\195\169cision sur le nombre d\aesp\195\168ces (exact, approximatif).">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21355" ColName="ccb_truk_conservation_papier_type" PrevColName="" Pos="5" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Type(s) du papier de conservation.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21356" ColName="ccb_truk_conservation_methode" PrevColName="" Pos="6" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Type(s) de m\195\169thode de conservation.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21357" ColName="ccb_specimen_fixation_pourcent" PrevColName="" Pos="7" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Pourcentage de sp\195\169cimens fix\195\169s.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21358" ColName="ccb_etiquette_fixation_pourcent" PrevColName="" Pos="8" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Pourcentage d\a\195\169tiquettes fix\195\169es.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21359" ColName="ccb_truk_specimen_fixation_methode" PrevColName="" Pos="9" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Type(s) de fixation des sp\195\169cimens.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21361" ColName="ccb_truk_etiquette_fixation_support" PrevColName="" Pos="10" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Type(s) de fixation des \195\169tiquettes fix\195\169es au support.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21362" ColName="ccb_truk_etiquette_fixation_specimen" PrevColName="" Pos="11" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Type(s) de fixation des \195\169tiquettes fix\195\169es au sp\195\169cimen.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21364" ColName="ccb_truk_etiquette_ecriture" PrevColName="" Pos="12" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Type(s) d\a\195\169criture sur les \195\169tiquettes.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21365" ColName="ccb_ce_traitement" PrevColName="" Pos="13" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="La collection botanique semble-t-elle avoir \195\169t\195\169 empoisonn\195\169e ou d\195\169sinsectis\195\169e lors de sa r\195\169alisation ?">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21366" ColName="ccb_truk_traitement_poison" PrevColName="" Pos="14" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Type(s) d\aempoisonement de la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21367" ColName="ccb_truk_traitement_insecte" PrevColName="ccb_truk_traitement_isecte" Pos="15" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Type(s) de d\195\169sinctisation de la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21368" ColName="ccb_ce_etat_general" PrevColName="" Pos="16" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="\195\137tat g\195\169n\195\169ral de la collection\194\160(grosses attaques d\ainsectes, pourriture, papier tr\195\168s fragile, etc... de 1 tr\195\168s mauvais \195\160 5 tr\195\168s bon \195\169tat).">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21369" ColName="ccb_truk_degradation_specimen" PrevColName="" Pos="17" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Type(s) de causes des d\195\169gradations des sp\195\169cimens not\195\169es de 1 tr\195\168s mauvais \195\160 5 tr\195\168s bon \195\169tat.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21370" ColName="ccb_truk_degradation_presentation" PrevColName="" Pos="18" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Type(s) de causes des d\195\169gradations de la pr\195\169sentation not\195\169es de 1 tr\195\168s mauvais \195\160 5 tr\195\168s bon \195\169tat.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21371" ColName="ccb_ce_determination" PrevColName="" Pos="19" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Les \195\169chantillons sont-ils d\195\169terminables ? (de 1\194\160: quelques fragment de plantes \195\160 5 plantes enti\195\168res).">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21944" ColName="ccb_truk_nature" PrevColName="" Pos="40" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nature de l\aherbier.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21945" ColName="ccb_specialite" PrevColName="" Pos="41" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Collection botanique sp\195\169cialis\195\169e (ex. herbier de c\195\169r\195\169ales...)">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21471" ColName="ccb_recolte_date_debut" PrevColName="" Pos="20" idDatatype="14" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Date extr\195\170me de d\195\169but de r\195\169colte.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="22303" ColName="ccb_ce_recolte_date_debut_type" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Type de date extr\195\170me de d\195\169but de r\195\169colte.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21474" ColName="ccb_recolte_date_fin" PrevColName="" Pos="22" idDatatype="14" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Date extr\195\170me de fin de r\195\169colte.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21475" ColName="ccb_ce_recolte_date_fin_type" PrevColName="" Pos="23" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Type de date extr\195\170me de fin de r\195\169colte.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21477" ColName="ccb_annotation_classement" PrevColName="ccb_classement" Pos="24" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Indiquer le type de classement ou des informations concernant un \195\169ventuel classement.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21478" ColName="ccb_ce_classement_etat" PrevColName="" Pos="25" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="\195\137tat du classement (de 1 tr\195\168s mauvais \195\160 5 tr\195\168s bon).">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21479" ColName="ccb_truk_etiquette_renseignement" PrevColName="" Pos="26" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Pourcentage pour chaque type de renseignements port\195\169s sur l\a\195\169tiquette\194\160ou sur la part.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21480" ColName="ccb_ce_precision_localite" PrevColName="" Pos="27" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Les localit\195\169s sont elles pr\195\169cises?">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21481" ColName="ccb_ce_precision_date" PrevColName="" Pos="28" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Les dates sont elles pr\195\169cises?">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21483" ColName="ccb_annotation_diverse" PrevColName="ccb_truk_annotation" Pos="29" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Autres annotations (dons, annotations personnelles, recettes, utilisations m\195\169dicales...).">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21501" ColName="ccb_ce_collection_integre" PrevColName="" Pos="30" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="La collection observ\195\169e int\195\168gre-t-elle des collections botaniques ant\195\169rieures ?">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21502" ColName="ccb_ce_collection_integre_info" PrevColName="ccb_collection_integre_info" Pos="31" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Les noms de ces collections sont-ils not\195\169s sur les \195\169tiquettes de chaque \195\169chantillon\194\160?">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21514" ColName="ccb_ce_inventaire" PrevColName="" Pos="32" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Existe-t-il un inventaire de cette collection?">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21515" ColName="ccb_ce_inventaire_auteur" PrevColName="" Pos="33" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="L\aauteur de la collection a-t-il particip\195\169 \195\160 cet inventaire?">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21517" ColName="ccb_ce_inventaire_forme" PrevColName="" Pos="35" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Forme de l\ainventaire (manuscrit, informatique...).">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21516" ColName="ccb_inventaire_info" PrevColName="" Pos="34" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Quelles informations retrouve-t-on?">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21518" ColName="ccb_ce_truk_inventaire_digital" PrevColName="" Pos="36" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Si inventaire digital, quel logiciel utilisez vous?">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21519" ColName="ccb_inventaire_digital_pourcent" PrevColName="" Pos="37" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Pourcentage de la documentation en base de donn\195\169es.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21520" ColName="ccb_ce_inventaire_etat" PrevColName="ccb_inventaire_etat" Pos="38" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="L\ainventaire est il complet ou partiel?">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27920" ColName="ccb_ce_meta" PrevColName="" Pos="42" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="21152" />
<RELATION_END ID="22170" />
<RELATION_END ID="22172" />
<RELATION_END ID="22174" />
<RELATION_END ID="22178" />
<RELATION_END ID="22301" />
<RELATION_END ID="22306" />
<RELATION_END ID="22308" />
<RELATION_END ID="22309" />
<RELATION_END ID="22311" />
<RELATION_END ID="22313" />
<RELATION_END ID="22315" />
<RELATION_END ID="22318" />
<RELATION_END ID="22320" />
<RELATION_END ID="22322" />
<RELATION_END ID="22324" />
<RELATION_END ID="22326" />
<RELATION_END ID="27927" />
</RELATIONS_END>
<INDICES>
<INDEX ID="21151" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21150" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="21188" Tablename="coel_publication" PrevTableName="Table_15" XPos="98" YPos="2368" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Publication de type articles scientifiques, ouvrages ou sites web.\nINFO : cpu_fmt_nom_complet" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="76" >
<COLUMNS>
<COLUMN ID="21190" ColName="cpu_id_publication" PrevColName="cp_id_publication" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Identifiant de la publication.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21633" ColName="cpu_ce_projet" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du projet dans lequel les donn\195\169es de cet enregistrement ont \195\169t\195\169 saisies.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21955" ColName="cpu_fmt_nom_complet" PrevColName="cpu_fmt_nom" Pos="13" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Intitul\195\169 de la publication complet : fmt_auteur, date_parution(ann\195\169e). titre. Editeur (nom), collection, fascicule, indication_nvt. pages.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21305" ColName="cpu_uri" PrevColName="" Pos="15" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="URI de la publication qui peut \195\170tre un site web...">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21205" ColName="cpu_fmt_auteur" PrevColName="cpu_truk_auteur" Pos="6" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Contient le nom format\195\169 de l\aintitul\195\169 auteur(s). Si plusieurs personnes sont auteurs, l\aintitul\195\169 est format\195\169 ici.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21193" ColName="cpu_titre" PrevColName="cp_titre" Pos="1" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Titre de l\aarticle ou de l\aouvrage.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="26510" ColName="cpu_ce_truk_editeur" PrevColName="" Pos="1" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la structure \195\169ditrice de la publication. S\ail n\aest pas renseignn\195\169 dans la table Structure, contient AUTRE# suivit du nom complet de la structure \195\169ditrice.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21198" ColName="cpu_collection" PrevColName="cpu_intitule_collection" Pos="3" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Intitul\195\169 de la collection, c\aest \195\160 dire de la revue.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21206" ColName="cpu_date_parution" PrevColName="" Pos="7" idDatatype="20" DatatypeParams="(10)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Ann\195\169e(s) de parution de la publication. Format accept\195\169 : AAAA-MM-JJ ou AAAA ou AAAA-AAAA.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21211" ColName="cpu_indication_nvt" PrevColName="" Pos="8" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Indication du num\195\169ro, volume ou tome de la publication. Plut\195\180t utilis\195\169 pour les ouvrages et non les articles de revue.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21212" ColName="cpu_fascicule" PrevColName="cpu_titre_fascicule" Pos="9" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Indication du titre du fascicule. Surtout utilis\195\169 pour les revues.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21213" ColName="cpu_truk_pages" PrevColName="" Pos="10" idDatatype="20" DatatypeParams="(25)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Indication du nombre de pages (pour les ouvrages) ou des pages de d\195\169but et de fin pour un article. Dans le cas des ouvrages un nombre doit \195\170tre pr\195\169sent. Pour les articles deux nombres ou point d\aint\195\169rogation s\195\169par\195\169s par un tiret.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21215" ColName="cpu_ce_meta" PrevColName="cpu_date_derniere_modif" Pos="12" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="21226" />
<RELATION_START ID="21241" />
</RELATIONS_START>
<RELATIONS_END>
<RELATION_END ID="21616" />
<RELATION_END ID="21631" />
<RELATION_END ID="22083" />
</RELATIONS_END>
<INDICES>
<INDEX ID="21191" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21190" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="21219" Tablename="coel_collection_a_publication" PrevTableName="Table_16" XPos="45" YPos="2181" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Permet de lister les publication li\195\169es \195\160 une collection." Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="21" >
<COLUMNS>
<COLUMN ID="21225" ColName="ccapu_id_collection" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21244" ColName="ccapu_id_publication" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la publication.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21316" ColName="ccapu_mark_licence" PrevColName="" Pos="6" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Bool\195\169en indiquant si la publication indiqu\195\169 correspond aux droits de propri\195\169t\195\169s intellectuelles de la collection.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21232" ColName="ccapu_ce_meta" PrevColName="ccapu_date_derniere_modif" Pos="3" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="21223" />
<RELATION_END ID="21226" />
<RELATION_END ID="22081" />
</RELATIONS_END>
<INDICES>
<INDEX ID="21222" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21225" LengthParam="0" />
<INDEXCOLUMN idColumn="21244" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="21235" Tablename="coel_publication_a_personne" PrevTableName="Table_17" XPos="508" YPos="2404" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Permet de lister les publications d\aune personne." Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="77" >
<COLUMNS>
<COLUMN ID="21571" ColName="cpuap_id_publication" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant d\aune publication.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21572" ColName="cpuap_id_personne" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant d\aune personne.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21611" ColName="cpuap_id_role" PrevColName="cpupa_id_role" Pos="7" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="R\195\180le de la personne vis \195\160 vis de la publication : contributeur, auteur...">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21247" ColName="cpuap_ce_truk_type" PrevColName="cpap_ce_truk_type" Pos="2" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Contient le type de r\195\169f\195\169rence bibliographique : n\195\169crologie, biographie, publication personnelle...">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27976" ColName="cpuap_ordre" PrevColName="" Pos="5" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Num\195\169ro d\aordre de la personne pour le r\195\180le indiqu\195\169.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21249" ColName="cpuap_ce_meta" PrevColName="cpap_date_derniere_modif" Pos="4" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="21239" />
<RELATION_END ID="21241" />
<RELATION_END ID="22085" />
<RELATION_END ID="22148" />
<RELATION_END ID="22150" />
</RELATIONS_END>
<INDICES>
<INDEX ID="21238" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21571" LengthParam="0" />
<INDEXCOLUMN idColumn="21572" LengthParam="0" />
<INDEXCOLUMN idColumn="21611" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="21522" Tablename="coel_projet" PrevTableName="EFLORE_PROJET" XPos="57" YPos="541" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Contient les informations sur un projet de donn\195\169es.\nINFO : cpr_nom" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="3" >
<COLUMNS>
<COLUMN ID="21523" ColName="cpr_id_projet" PrevColName="EPR_ID_PROJET" Pos="1" idDatatype="5" DatatypeParams="" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Identifiant d\aun projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21526" ColName="cpr_nom" PrevColName="EPR_INTITULE_PROJET" Pos="4" idDatatype="20" DatatypeParams="(255)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom du projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21527" ColName="cpr_abreviation" PrevColName="EPR_ABREVIATION_PROJET" Pos="5" idDatatype="20" DatatypeParams="(40)" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Abr\195\169viation du projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21528" ColName="cpr_resume" PrevColName="EPR_DESCRIPTION_PROJET" Pos="6" idDatatype="20" DatatypeParams="(255)" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="R\195\169sum\195\169 du projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21538" ColName="cpr_description" PrevColName="" Pos="6" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Description d\195\169taill\195\169e du projet.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21529" ColName="cpr_url" PrevColName="EPR_LIEN_WEB" Pos="7" idDatatype="20" DatatypeParams="(255)" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="URL principal o\195\185 trouver des compl\195\169ments d\ainformation sur le projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27885" ColName="cpr_mot_cles" PrevColName="" Pos="9" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Mots cl\195\169s correspondant au projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27886" ColName="cpr_citation" PrevColName="" Pos="10" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Indication sur la fa\195\167on de citer le projet pour r\195\169aliser une bibliographie.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27887" ColName="cpr_licence" PrevColName="" Pos="11" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Url ou texte pr\195\169sentant la licence des donn\195\169es du projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27888" ColName="cpr_ce_langue" PrevColName="" Pos="12" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Langue principale des donn\195\169es du projet (selon l\aISO-639-1).">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27889" ColName="cpr_indexation_heure" PrevColName="" Pos="13" idDatatype="17" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Pr\195\169f\195\169rence de l\aheure de d\195\169part pour les proc\195\169dures d\aindexation externe.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27890" ColName="cpr_ce_indexation_duree" PrevColName="" Pos="14" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Dur\195\169e maximum acceptable pour une proc\195\169dure d\aindexation externe.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27891" ColName="cpr_ce_indexation_freq" PrevColName="" Pos="15" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Fr\195\169quence maximum acceptable pour une proc\195\169dure d\aindexation externe.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="26513" ColName="cpr_mark_public" PrevColName="cpr_autorisation" Pos="7" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Indique si oui (=1) ou non (=0) ce projet est public. Si oui, il peut \195\170tre publi\195\169 dans eFlore.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27968" ColName="cpr_mark_editable" PrevColName="" Pos="15" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Indique si oui (=1) ou non (=0) ce projet est \195\169ditable. Si nom, l\aapplication doit seulement permettre de consulter les donn\195\169es.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21539" ColName="cpr_ce_meta" PrevColName="cpr_date_derniere_modif" Pos="7" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="21560" />
<RELATION_START ID="21622" />
<RELATION_START ID="21625" />
<RELATION_START ID="21628" />
<RELATION_START ID="21631" />
<RELATION_START ID="21650" />
<RELATION_START ID="21816" />
<RELATION_START ID="21830" />
<RELATION_START ID="22018" />
<RELATION_START ID="27902" />
</RELATIONS_START>
<RELATIONS_END>
<RELATION_END ID="22066" />
<RELATION_END ID="27908" />
<RELATION_END ID="27910" />
<RELATION_END ID="27912" />
</RELATIONS_END>
<INDICES>
<INDEX ID="21532" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21523" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="21544" Tablename="coel_personne_a_relation" PrevTableName="Table_20" XPos="817" YPos="568" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Relation entre deux personnes vis \195\160 vis d\aun projet." Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="69" >
<COLUMNS>
<COLUMN ID="21664" ColName="cpar_id_personne_01" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la personne n\194\1761.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21668" ColName="cpar_id_personne_02" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la personne n\194\1762.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21665" ColName="cpar_id_projet" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du projet dans lequel la relation entre les deux personnes s\a\195\169tablie.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21549" ColName="cpar_id_role" PrevColName="cpap_ce_role" Pos="2" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du r\195\180le ou de la valeur \195\169tablie entre les deux personnes.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21557" ColName="cpar_ce_meta" PrevColName="cpap_date_derniere_modif" Pos="4" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="21560" />
<RELATION_END ID="21563" />
<RELATION_END ID="21666" />
<RELATION_END ID="22064" />
<RELATION_END ID="22096" />
</RELATIONS_END>
<INDICES>
<INDEX ID="21547" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21664" LengthParam="0" />
<INDEXCOLUMN idColumn="21668" LengthParam="0" />
<INDEXCOLUMN idColumn="21665" LengthParam="0" />
<INDEXCOLUMN idColumn="21549" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="21634" Tablename="coel_projet_version" PrevTableName="eflore_projet_version" XPos="500" YPos="526" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Table contenant les informations sur la version d\aun projet.\nINFO : cprv_nom" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="11447" OrderPos="4" >
<COLUMNS>
<COLUMN ID="21635" ColName="cprv_id_version" PrevColName="eprv_id_version" Pos="1" idDatatype="5" DatatypeParams="" Width="0" Prec="0" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Identifiant d\aune version de projet.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21652" ColName="cprv_ce_projet" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du projet de la version.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21637" ColName="cprv_nom" PrevColName="eprv_nom" Pos="11" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Nom \195\169ventuel de la version.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21638" ColName="cprv_code" PrevColName="eprv_code" Pos="5" idDatatype="20" DatatypeParams="(25)" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Num\195\169ro ou code de la version.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21640" ColName="cprv_date_debut" PrevColName="eprv_date_debut" Pos="6" idDatatype="15" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="0000-00-00 00:00:00" Comments="Date de d\195\169but de la version.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21641" ColName="cprv_date_fin" PrevColName="eprv_date_fin" Pos="7" idDatatype="15" DatatypeParams="" Width="0" Prec="0" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Date de fin de la version.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21644" ColName="cprv_ce_meta" PrevColName="eprv_date_derniere_modif" Pos="8" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="21650" />
<RELATION_END ID="22068" />
</RELATIONS_END>
<INDICES>
<INDEX ID="21648" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21635" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="21757" Tablename="coel_meta_historique_ligne" PrevTableName="Table_22" XPos="1168" YPos="98" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Contient les m\195\169tadonn\195\169es sur l\ahistorique des enregistrements des tables de la base de donn\195\169es.\nINFO : cmhl_date_modification" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="38" >
<COLUMNS>
<COLUMN ID="21759" ColName="cmhl_id_historique_ligne" PrevColName="cmhl_id_historisque_ligne" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Identifiant de l\ahistorique des lignes.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21804" ColName="cmhl_ce_table" PrevColName="" Pos="7" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la table.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21765" ColName="cmhl_cle_ligne" PrevColName="cmhl_ce_ligne" Pos="3" idDatatype="20" DatatypeParams="(64)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Identifiant de la ligne. Pour les tables \195\160 cl\195\169 primaire multi colonnes, bien respecter l\aordre des champs de la cl\195\169 et inscrire chaque valeur de cl\195\169 s\195\169par\195\169e par un tiret \A-\A.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21844" ColName="cmhl_enregistrement" PrevColName="" Pos="8" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Contient les donn\195\169es au format XML pour les enregistrements supprim\195\169s uniquement, sinon poss\195\168de la valeur NULL. Format XML : \kxml encoding=\AUTF-8\g\kligne\g\knom_du_champ_01\gvaleur_du_champ_01\k/nom_du_champ_01\g\knom_du_champ_02\gvaleur_du_champ_02\k/nom_du_champ_02\g...\k/ligne\g\k/xml\g.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21766" ColName="cmhl_date_modification" PrevColName="cmhl_date" Pos="4" idDatatype="15" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Date de modification de la ligne.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21767" ColName="cmhl_notes" PrevColName="" Pos="4" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Notes sur la modification effectu\195\169e sur la ligne.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27956" ColName="cmhl_source" PrevColName="" Pos="10" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Source des donn\195\169es de l\aenregistrement, si le cr\195\169ateur/modificateur de l\aenregistrement n\aen est pas l\aauteur.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21769" ColName="cmhl_ce_modifier_par" PrevColName="" Pos="6" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la personne ayant effectu\195\169 cette modification sur la ligne.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21768" ColName="cmhl_ce_etat" PrevColName="" Pos="5" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de l\a\195\169tat de la ligne.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21770" ColName="cmhl_ip" PrevColName="cmhl_ip_mac" Pos="7" idDatatype="20" DatatypeParams="(50)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Adresse IP depuis laquelle la modification a eu lieu.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27929" ColName="cmhl_session_id" PrevColName="" Pos="9" idDatatype="20" DatatypeParams="(40)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Identifiant de session del \autilisateur.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="21861" />
<RELATION_START ID="21863" />
<RELATION_START ID="21957" />
<RELATION_START ID="22016" />
<RELATION_START ID="22043" />
<RELATION_START ID="22062" />
<RELATION_START ID="22064" />
<RELATION_START ID="22066" />
<RELATION_START ID="22068" />
<RELATION_START ID="22073" />
<RELATION_START ID="22077" />
<RELATION_START ID="22079" />
<RELATION_START ID="22081" />
<RELATION_START ID="22083" />
<RELATION_START ID="22085" />
<RELATION_START ID="27906" />
<RELATION_START ID="27921" />
<RELATION_START ID="27924" />
<RELATION_START ID="27927" />
</RELATIONS_START>
<RELATIONS_END>
<RELATION_END ID="21789" />
<RELATION_END ID="22071" />
<RELATION_END ID="22093" />
</RELATIONS_END>
<INDICES>
<INDEX ID="21760" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21759" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
<INDEX ID="27970" IndexName="cmhl_cle_ligne" IndexKind="1" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21765" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
<INDEX ID="27972" IndexName="cmhl_ce_table" IndexKind="1" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21804" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
<INDEX ID="27973" IndexName="cmhl_date_modification" IndexKind="1" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21766" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="21986" Tablename="coel_commentaire" PrevTableName="Table_21" XPos="826" YPos="2390" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Contient les commentaires.\nINFO : ccm_titre" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="83" >
<COLUMNS>
<COLUMN ID="21989" ColName="ccm_id_commentaire" PrevColName="" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments="Identifiant d\aun commentaire.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="22031" ColName="ccm_ce_pere" PrevColName="" Pos="7" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="0" Comments="Identifiant du commentaire p\195\168re.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21991" ColName="ccm_ce_projet" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du projet dans lequel le commentaire est fait.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21993" ColName="ccm_titre" PrevColName="" Pos="2" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Titre du commentaire.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21994" ColName="ccm_texte" PrevColName="" Pos="3" idDatatype="28" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Texte du commentaire.">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21996" ColName="ccm_ponderation" PrevColName="" Pos="4" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Pond\195\169ration du commentaire (importance). Valeur de 1 \195\160 10.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27940" ColName="ccm_mark_public" PrevColName="" Pos="7" idDatatype="22" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="0" Comments="Indique si oui (=1) ou non (=0) ce commentaire est public .">
<OPTIONSELECTED>
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="21997" ColName="ccm_ce_meta" PrevColName="" Pos="5" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_START>
<RELATION_START ID="22035" />
<RELATION_START ID="22039" />
</RELATIONS_START>
<RELATIONS_END>
<RELATION_END ID="22016" />
<RELATION_END ID="22018" />
<RELATION_END ID="22035" />
</RELATIONS_END>
<INDICES>
<INDEX ID="21990" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="21989" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="22023" Tablename="coel_collection_a_commentaire" PrevTableName="Table_23" XPos="427" YPos="2183" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="Permet de lister les commentaires / notes faits sur une collection." Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="24" >
<COLUMNS>
<COLUMN ID="22025" ColName="ccac_id_collection" PrevColName="" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant de la collection.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="22027" ColName="ccac_id_commentaire" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant du commentaire.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="22385" ColName="ccac_truk_type" PrevColName="" Pos="3" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="Liste des types du commentaire s\195\169par\195\169s par des points virgules.">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="22029" ColName="ccac_ce_meta" PrevColName="" Pos="3" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="22037" />
<RELATION_END ID="22039" />
<RELATION_END ID="22043" />
</RELATIONS_END>
<INDICES>
<INDEX ID="22026" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="22025" LengthParam="0" />
<INDEXCOLUMN idColumn="22027" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
<TABLE ID="27893" Tablename="coel_projet_a_structure" PrevTableName="Table_23" XPos="451" YPos="762" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="126" >
<COLUMNS>
<COLUMN ID="27895" ColName="cpras_id_projet" PrevColName="" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27897" ColName="cpras_id_structure" PrevColName="" Pos="1" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27900" ColName="cpras_truk_role" PrevColName="" Pos="2" idDatatype="20" DatatypeParams="(255)" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
<COLUMN ID="27901" ColName="cpras_ce_meta" PrevColName="" Pos="3" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="0" AutoInc="0" IsForeignKey="1" DefaultValue="" Comments="">
<OPTIONSELECTED>
<OPTIONSELECT Value="1" />
<OPTIONSELECT Value="0" />
</OPTIONSELECTED>
</COLUMN>
</COLUMNS>
<RELATIONS_END>
<RELATION_END ID="27902" />
<RELATION_END ID="27904" />
<RELATION_END ID="27906" />
</RELATIONS_END>
<INDICES>
<INDEX ID="27896" IndexName="PRIMARY" IndexKind="0" FKRefDef_Obj_id="-1">
<INDEXCOLUMNS>
<INDEXCOLUMN idColumn="27895" LengthParam="0" />
<INDEXCOLUMN idColumn="27897" LengthParam="0" />
</INDEXCOLUMNS>
</INDEX>
</INDICES>
</TABLE>
</TABLES>
<RELATIONS>
<RELATION ID="18419" RelationName="fk_cs_csap" Kind="1" SrcTable="1445" DestTable="1447" FKFields="cs_id_structure=csap_id_structure\n" FKFieldsComments="Identifiant de la structure.\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-9" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="17" />
<RELATION ID="18425" RelationName="fk_cp_csap" Kind="1" SrcTable="1446" DestTable="1447" FKFields="cp_id_personne=csap_id_personne\n" FKFieldsComments="Identifiant de la personne constituant l\a\195\169quipe d\aun service d\aune structure.\n" relDirection="3" MidOffset="6" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="18" />
<RELATION ID="18470" RelationName="fk_cmc_cmd" Kind="2" SrcTable="18456" DestTable="18452" FKFields="cmc_id_champ=cmd_ce_champ\n" FKFieldsComments="\n" relDirection="4" MidOffset="-6" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="57" CaptionOffsetY="-25" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="1" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="34" />
<RELATION ID="20817" RelationName="fk_cs_cc" Kind="2" SrcTable="1445" DestTable="1444" FKFields="cs_id_structure=cc_ce_structure\n" FKFieldsComments="\n" relDirection="4" MidOffset="201" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="5" CaptionOffsetY="1" StartIntervalOffsetX="-6" StartIntervalOffsetY="2" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="45" />
<RELATION ID="20819" RelationName="fk_cc_cc_parente" Kind="2" SrcTable="1444" DestTable="1444" FKFields="cc_id_collection=cc_ce_mere\n" FKFieldsComments="Identifiant de la collection parente.\n" relDirection="2" MidOffset="13" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-17" CaptionOffsetY="2" StartIntervalOffsetX="9" StartIntervalOffsetY="-28" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="46" />
<RELATION ID="20859" RelationName="fk_cs_csc" Kind="4" SrcTable="1445" DestTable="20850" FKFields="cs_id_structure=csc_id_structure\n" FKFieldsComments="Identifiant de la structure.\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="58" />
<RELATION ID="20861" RelationName="fk_cs_csv" Kind="4" SrcTable="1445" DestTable="20854" FKFields="cs_id_structure=csv_id_structure\n" FKFieldsComments="Identifiant de la structure.\n" relDirection="3" MidOffset="1" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="59" />
<RELATION ID="21108" RelationName="fk_cc_ccap" Kind="1" SrcTable="1444" DestTable="21104" FKFields="cc_id_collection=ccap_id_collection\n" FKFieldsComments="Identifiant de la collection associ\195\169 \195\160 une personne.\n" relDirection="2" MidOffset="21" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="-1" StartIntervalOffsetY="3" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="57" />
<RELATION ID="21110" RelationName="fk_cp_ccap" Kind="1" SrcTable="1446" DestTable="21104" FKFields="cp_id_personne=ccap_id_personne\n" FKFieldsComments="Identifiant de la personne associ\195\169 \195\160 une collection.\n" relDirection="4" MidOffset="-170" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="58" />
<RELATION ID="21152" RelationName="fk_cc_ccb" Kind="4" SrcTable="1444" DestTable="21148" FKFields="cc_id_collection=ccb_id_collection\n" FKFieldsComments="Identifiant de la collection botanique.\n" relDirection="2" MidOffset="7" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="60" />
<RELATION ID="21163" RelationName="fk_cs_cs_parente" Kind="2" SrcTable="1445" DestTable="1445" FKFields="cs_id_structure=cs_ce_mere\n" FKFieldsComments="Identifiant de la structure parente.\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-35" CaptionOffsetY="-3" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="62" />
<RELATION ID="21223" RelationName="fk_cc_ccapu" Kind="1" SrcTable="1444" DestTable="21219" FKFields="cc_id_collection=ccapu_id_collection\n" FKFieldsComments="Identifiant de la collection ayant des publications.\n" relDirection="3" MidOffset="-3" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-49" CaptionOffsetY="-7" StartIntervalOffsetX="0" StartIntervalOffsetY="3" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="66" />
<RELATION ID="21226" RelationName="fk_cpu_ccapu" Kind="1" SrcTable="21188" DestTable="21219" FKFields="cpu_id_publication=ccapu_id_publication\n" FKFieldsComments="Identifiant de la publication traitant d\aune collection.\n" relDirection="1" MidOffset="31" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="25" CaptionOffsetY="-3" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="67" />
<RELATION ID="21239" RelationName="fk_cp_cpuap" Kind="1" SrcTable="1446" DestTable="21235" FKFields="cp_id_personne=cpuap_id_personne\n" FKFieldsComments="Identifiant de la personne ayant un rapport avec une publication.\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="53" CaptionOffsetY="-20" StartIntervalOffsetX="99" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="1" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="71" />
<RELATION ID="21241" RelationName="fk_cpu_cpuap" Kind="1" SrcTable="21188" DestTable="21235" FKFields="cpu_id_publication=cpuap_id_publication\n" FKFieldsComments="Identifiant de la publication li\195\169e \195\160 une personne.\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="-2" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="72" />
<RELATION ID="21560" RelationName="fk_cpr_cpar" Kind="1" SrcTable="21522" DestTable="21544" FKFields="cpr_id_projet=cpar_id_projet\n" FKFieldsComments="Identifiant du projet dans lequel la relation entre les deux personnes s\a\195\169tablie.\n" relDirection="2" MidOffset="215" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="1" CaptionOffsetY="-44" StartIntervalOffsetX="5" StartIntervalOffsetY="-27" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="70" />
<RELATION ID="21563" RelationName="fk_cp_cpar_01" Kind="1" SrcTable="1446" DestTable="21544" FKFields="cp_id_personne=cpar_id_personne_01\n" FKFieldsComments="Identifiant de la personne n\194\1761.\n" relDirection="4" MidOffset="13" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="71" />
<RELATION ID="21616" RelationName="fk_cs_cpu_editeur" Kind="2" SrcTable="1445" DestTable="21188" FKFields="cs_id_structure=cpu_ce_truk_editeur\n" FKFieldsComments="Identifiant de la structure \195\169ditrice de la publication. S\ail n\aest pas renseignn\195\169 dans la table Structure, contient AUTRE# suivit du nom complet de la structure \195\169ditrice.\n" relDirection="4" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="-6" StartIntervalOffsetY="-29" EndIntervalOffsetX="8" EndIntervalOffsetY="11" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="1" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="72" />
<RELATION ID="21622" RelationName="fk_cpr_cp" Kind="2" SrcTable="21522" DestTable="1446" FKFields="cpr_id_projet=cp_ce_projet\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="73" />
<RELATION ID="21625" RelationName="fk_cpr_cs" Kind="2" SrcTable="21522" DestTable="1445" FKFields="cpr_id_projet=cs_ce_projet\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="74" />
<RELATION ID="21628" RelationName="fk_cpr_cc" Kind="2" SrcTable="21522" DestTable="1444" FKFields="cpr_id_projet=cc_ce_projet\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="75" />
<RELATION ID="21631" RelationName="fk_cpr_cpu" Kind="2" SrcTable="21522" DestTable="21188" FKFields="cpr_id_projet=cpu_ce_projet\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="76" />
<RELATION ID="21650" RelationName="fk_cpr_cprv" Kind="2" SrcTable="21522" DestTable="21634" FKFields="cpr_id_projet=cprv_ce_projet\n" FKFieldsComments="Identifiant du projet de la version.\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="43" CaptionOffsetY="-2" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="78" />
<RELATION ID="21666" RelationName="fk_cp_cpar_02" Kind="1" SrcTable="1446" DestTable="21544" FKFields="cp_id_personne=cpar_id_personne_02\n" FKFieldsComments="Identifiant de la personne n\194\1762.\n" relDirection="4" MidOffset="-46" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-2" CaptionOffsetY="-50" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="72" />
<RELATION ID="21789" RelationName="fk_cp_cmhl_modifier_par" Kind="2" SrcTable="1446" DestTable="21757" FKFields="cp_id_personne=cmhl_ce_modifier_par\n" FKFieldsComments="\n" relDirection="1" MidOffset="63" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-7" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="79" />
<RELATION ID="21816" RelationName="fk_cpr_cmlv" Kind="2" SrcTable="21522" DestTable="18466" FKFields="cpr_id_projet=cmlv_ce_projet\n" FKFieldsComments="\n" relDirection="1" MidOffset="146" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="58" />
<RELATION ID="21819" RelationName="fk_cmlv_cmlv_parent" Kind="2" SrcTable="18466" DestTable="18466" FKFields="cmlv_id_valeur=cmlv_ce_parent\n" FKFieldsComments="\n" relDirection="2" MidOffset="4" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-75" CaptionOffsetY="-14" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="-24" EndIntervalOffsetY="-22" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="59" />
<RELATION ID="21822" RelationName="fk_cmlv_cmc_liste" Kind="2" SrcTable="18466" DestTable="18456" FKFields="cmlv_id_valeur=cmc_ce_liste\n" FKFieldsComments="\n" relDirection="2" MidOffset="-3" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="7" StartIntervalOffsetY="-32" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="60" />
<RELATION ID="21830" RelationName="fk_cpr_cmc" Kind="2" SrcTable="21522" DestTable="18456" FKFields="cpr_id_projet=cmc_ce_projet\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="42" CaptionOffsetY="30" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="61" />
<RELATION ID="21861" RelationName="fk_cmhl_cmlv_meta" Kind="2" SrcTable="21757" DestTable="18466" FKFields="cmhl_id_historique_ligne=cmlv_ce_meta\n" FKFieldsComments="\n" relDirection="4" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="63" />
<RELATION ID="21863" RelationName="fk_cmhl_cmc_meta" Kind="2" SrcTable="21757" DestTable="18456" FKFields="cmhl_id_historique_ligne=cmc_ce_meta\n" FKFieldsComments="\n" relDirection="4" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="64" />
<RELATION ID="21957" RelationName="fk_cmhl_cs" Kind="2" SrcTable="21757" DestTable="1445" FKFields="cmhl_id_historique_ligne=cs_ce_meta\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="64" />
<RELATION ID="21959" RelationName="fk_cmlv_cs_type" Kind="2" SrcTable="18466" DestTable="1445" FKFields="cmlv_id_valeur=cs_ce_type\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-30" CaptionOffsetY="-2" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="65" />
<RELATION ID="21961" RelationName="fk_cmlv_cs_type_prive" Kind="2" SrcTable="18466" DestTable="1445" FKFields="cmlv_id_valeur=cs_ce_truk_type_prive\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-112" CaptionOffsetY="13" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="66" />
<RELATION ID="21964" RelationName="fk_cmlv_cs_type_public" Kind="2" SrcTable="18466" DestTable="1445" FKFields="cmlv_id_valeur=cs_ce_truk_type_public\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="67" />
<RELATION ID="22016" RelationName="fk_cmhl_ccm_meta" Kind="2" SrcTable="21757" DestTable="21986" FKFields="cmhl_id_historique_ligne=ccm_ce_meta\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="75" />
<RELATION ID="22018" RelationName="fk_cpr_ccm" Kind="2" SrcTable="21522" DestTable="21986" FKFields="cpr_id_projet=ccm_ce_projet\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="76" />
<RELATION ID="22035" RelationName="fk_ccm_ccm_pere" Kind="2" SrcTable="21986" DestTable="21986" FKFields="ccm_id_commentaire=ccm_ce_pere\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="-71" CaptionOffsetY="-20" StartIntervalOffsetX="9" StartIntervalOffsetY="0" EndIntervalOffsetX="-20" EndIntervalOffsetY="-28" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="73" />
<RELATION ID="22037" RelationName="fk_cc_ccac" Kind="1" SrcTable="1444" DestTable="22023" FKFields="cc_id_collection=ccac_id_collection\n" FKFieldsComments="\n" relDirection="3" MidOffset="117" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="74" />
<RELATION ID="22039" RelationName="fk_ccm_ccac" Kind="1" SrcTable="21986" DestTable="22023" FKFields="ccm_id_commentaire=ccac_id_commentaire\n" FKFieldsComments="\n" relDirection="4" MidOffset="36" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="75" />
<RELATION ID="22043" RelationName="fk_cmhl_ccac_meta" Kind="2" SrcTable="21757" DestTable="22023" FKFields="cmhl_id_historique_ligne=ccac_ce_meta\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="77" />
<RELATION ID="22062" RelationName="fk_cmhl_cp_meta" Kind="2" SrcTable="21757" DestTable="1446" FKFields="cmhl_id_historique_ligne=cp_ce_meta\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="78" />
<RELATION ID="22064" RelationName="fk_cmhl_cpar_meta" Kind="2" SrcTable="21757" DestTable="21544" FKFields="cmhl_id_historique_ligne=cpar_ce_meta\n" FKFieldsComments="\n" relDirection="4" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="79" />
<RELATION ID="22066" RelationName="fk_cmhl_cpr_meta" Kind="2" SrcTable="21757" DestTable="21522" FKFields="cmhl_id_historique_ligne=cpr_ce_meta\n" FKFieldsComments="\n" relDirection="4" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="80" />
<RELATION ID="22068" RelationName="fk_cmhl_cprv_meta" Kind="2" SrcTable="21757" DestTable="21634" FKFields="cmhl_id_historique_ligne=cprv_ce_meta\n" FKFieldsComments="\n" relDirection="4" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="81" />
<RELATION ID="22071" RelationName="fk_cmlv_cmhl_val" Kind="2" SrcTable="18466" DestTable="21757" FKFields="cmlv_id_valeur=cmhl_ce_etat\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="82" />
<RELATION ID="22073" RelationName="fk_cmhl_csap_meta" Kind="2" SrcTable="21757" DestTable="1447" FKFields="cmhl_id_historique_ligne=csap_ce_meta\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="82" />
<RELATION ID="22077" RelationName="fk_cmhl_ccap_meta" Kind="2" SrcTable="21757" DestTable="21104" FKFields="cmhl_id_historique_ligne=ccap_ce_meta\n" FKFieldsComments="\n" relDirection="4" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="84" />
<RELATION ID="22079" RelationName="fk_cmhl_cc_meta" Kind="2" SrcTable="21757" DestTable="1444" FKFields="cmhl_id_historique_ligne=cc_ce_meta\n" FKFieldsComments="\n" relDirection="4" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="5" CaptionOffsetY="-5" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="85" />
<RELATION ID="22081" RelationName="fk_cmhl_ccapu_meta" Kind="2" SrcTable="21757" DestTable="21219" FKFields="cmhl_id_historique_ligne=ccapu_ce_meta\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="86" />
<RELATION ID="22083" RelationName="fk_cmhl_cpu_meta" Kind="2" SrcTable="21757" DestTable="21188" FKFields="cmhl_id_historique_ligne=cpu_ce_meta\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="87" />
<RELATION ID="22085" RelationName="fk_cmhl_cpuap_meta" Kind="2" SrcTable="21757" DestTable="21235" FKFields="cmhl_id_historique_ligne=cpuap_ce_meta\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="88" />
<RELATION ID="22087" RelationName="fk_cmlv_cmc_table" Kind="2" SrcTable="18466" DestTable="18456" FKFields="cmlv_id_valeur=cmc_ce_table\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="89" />
<RELATION ID="22089" RelationName="fk_cmlv_cmc_format_sql" Kind="2" SrcTable="18466" DestTable="18456" FKFields="cmlv_id_valeur=cmc_ce_format_sql\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="90" />
<RELATION ID="22091" RelationName="fk_cmlv_cmd_table" Kind="2" SrcTable="18466" DestTable="18452" FKFields="cmlv_id_valeur=cmd_ce_table\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="91" />
<RELATION ID="22093" RelationName="fk_cmlv_cmhl_table" Kind="2" SrcTable="18466" DestTable="21757" FKFields="cmlv_id_valeur=cmhl_ce_table\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="92" />
<RELATION ID="22096" RelationName="fk_cmlv_cpar_role" Kind="1" SrcTable="18466" DestTable="21544" FKFields="cmlv_id_valeur=cpar_id_role\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="93" />
<RELATION ID="22099" RelationName="fk_cmlv_cp_prefix" Kind="2" SrcTable="18466" DestTable="1446" FKFields="cmlv_id_valeur=cp_ce_truk_prefix\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="94" />
<RELATION ID="22101" RelationName="fk_cmlv_cp_suffix" Kind="2" SrcTable="18466" DestTable="1446" FKFields="cmlv_id_valeur=cp_ce_truk_suffix\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="95" />
<RELATION ID="22133" RelationName="fk_cmlv_cp_sexe" Kind="2" SrcTable="18466" DestTable="1446" FKFields="cmlv_id_valeur=cp_ce_sexe\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="96" />
<RELATION ID="22135" RelationName="fk_cmlv_cp_specialite" Kind="2" SrcTable="18466" DestTable="1446" FKFields="cmlv_id_valeur=cp_ce_truk_specialite\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="97" />
<RELATION ID="22137" RelationName="fk_cmlv_cp_role" Kind="2" SrcTable="18466" DestTable="1446" FKFields="cmlv_id_valeur=cp_ce_truk_role\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="98" />
<RELATION ID="22142" RelationName="fk_cmlv_csap_fonction" Kind="2" SrcTable="18466" DestTable="1447" FKFields="cmlv_id_valeur=csap_ce_truk_fonction\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="99" />
<RELATION ID="22144" RelationName="fk_cmlv_csap_statut" Kind="2" SrcTable="18466" DestTable="1447" FKFields="cmlv_id_valeur=csap_ce_truk_statut\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="32" CaptionOffsetY="5" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="100" />
<RELATION ID="22146" RelationName="fk_cmlv_csc_materiel_conservation" Kind="2" SrcTable="18466" DestTable="20850" FKFields="cmlv_id_valeur=csc_ce_materiel_conservation\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="101" />
<RELATION ID="22148" RelationName="fk_cmlv_cpuap_type" Kind="2" SrcTable="18466" DestTable="21235" FKFields="cmlv_id_valeur=cpuap_ce_truk_type\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="102" />
<RELATION ID="22150" RelationName="fk_cmlv_cpuap_role" Kind="1" SrcTable="18466" DestTable="21235" FKFields="cmlv_id_valeur=cpuap_id_role\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="103" />
<RELATION ID="22154" RelationName="fk_cmlv_ccap_role" Kind="1" SrcTable="18466" DestTable="21104" FKFields="cmlv_id_valeur=ccap_id_role\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="105" />
<RELATION ID="22158" RelationName="fk_cmlv_cc_type" Kind="2" SrcTable="18466" DestTable="1444" FKFields="cmlv_id_valeur=cc_ce_type\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="106" />
<RELATION ID="22160" RelationName="fk_cmlv_cc_developpement" Kind="2" SrcTable="18466" DestTable="1444" FKFields="cmlv_id_valeur=cc_ce_developpement\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="107" />
<RELATION ID="22162" RelationName="fk_cmlv_cc_specimen_type" Kind="2" SrcTable="18466" DestTable="1444" FKFields="cmlv_id_valeur=cc_ce_specimen_type\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="108" />
<RELATION ID="22164" RelationName="fk_cmlv_cc_specimen_type_classement" Kind="2" SrcTable="18466" DestTable="1444" FKFields="cmlv_id_valeur=cc_ce_specimen_type_classement\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="109" />
<RELATION ID="22170" RelationName="fk_cmlv_ccb_unitte_rangement_etat" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_unite_rangement_etat\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="111" />
<RELATION ID="22172" RelationName="fk_cmlv_ccb_traitement" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_traitement\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="112" />
<RELATION ID="22174" RelationName="fk_cmlv_ccb_etat_general" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_etat_general\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="113" />
<RELATION ID="22178" RelationName="fk_cmlv_ccb_determination" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_determination\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="114" />
<RELATION ID="22301" RelationName="fk_cmlv_ccb_recolte_date_debut_type" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_recolte_date_debut_type\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="116" />
<RELATION ID="22306" RelationName="fk_cmlv_ccb_recolte_date_fin_type" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_recolte_date_fin_type\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="117" />
<RELATION ID="22308" RelationName="fk_cmlv_ccb_classement_etat" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_classement_etat\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="118" />
<RELATION ID="22309" RelationName="fk_cmlv_ccb_precision_localite" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_precision_localite\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="118" />
<RELATION ID="22311" RelationName="fk_cmlv_ccb_precision_date" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_precision_date\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="119" />
<RELATION ID="22313" RelationName="fk_cmlv_ccb_collection_integre" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_collection_integre\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="120" />
<RELATION ID="22315" RelationName="fk_cmlv_ccb_collection_integre_info" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_collection_integre_info\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="121" />
<RELATION ID="22318" RelationName="fk_cmlv_ccb_inventaire" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_inventaire\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="122" />
<RELATION ID="22320" RelationName="fk_cmlv_ccb_inventaire_auteur" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_inventaire_auteur\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="123" />
<RELATION ID="22322" RelationName="fk_cmlv_ccb_inventaire_forme" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_inventaire_forme\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="124" />
<RELATION ID="22324" RelationName="fk_cmlv_ccb_inventaire_digital" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_truk_inventaire_digital\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="125" />
<RELATION ID="22326" RelationName="fk_cmlv_ccb_inventaire_etat" Kind="2" SrcTable="18466" DestTable="21148" FKFields="cmlv_id_valeur=ccb_ce_inventaire_etat\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="126" />
<RELATION ID="27872" RelationName="fk_cmlv_cc_type_depot" Kind="2" SrcTable="18466" DestTable="1444" FKFields="cmlv_id_valeur=cc_ce_type_depot\n" FKFieldsComments="Type de d\195\169p\195\180t de la collection (pr\195\170t, d\195\169p\195\180t permanent...).\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="125" />
<RELATION ID="27902" RelationName="fk_cpr_cpras" Kind="1" SrcTable="21522" DestTable="27893" FKFields="cpr_id_projet=cpras_id_projet\n" FKFieldsComments="\n" relDirection="2" MidOffset="18" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="127" />
<RELATION ID="27904" RelationName="fk_cs_cpras" Kind="1" SrcTable="1445" DestTable="27893" FKFields="cs_id_structure=cpras_id_structure\n" FKFieldsComments="\n" relDirection="1" MidOffset="-150" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="0" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="1" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="128" />
<RELATION ID="27906" RelationName="fk_cmhl_cpras_meta" Kind="2" SrcTable="21757" DestTable="27893" FKFields="cmhl_id_historique_ligne=cpras_ce_meta\n" FKFieldsComments="\n" relDirection="4" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="129" />
<RELATION ID="27908" RelationName="fk_cmlv_cpr_langue" Kind="2" SrcTable="18466" DestTable="21522" FKFields="cmlv_id_valeur=cpr_ce_langue\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="130" />
<RELATION ID="27910" RelationName="fk_cmlv_cpr_idx_duree" Kind="2" SrcTable="18466" DestTable="21522" FKFields="cmlv_id_valeur=cpr_ce_indexation_duree\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="131" />
<RELATION ID="27912" RelationName="fk_cmlv_cpr_idx_freq" Kind="2" SrcTable="18466" DestTable="21522" FKFields="cmlv_id_valeur=cpr_ce_indexation_freq\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="132" />
<RELATION ID="27921" RelationName="fk_cmhl_csc_meta" Kind="2" SrcTable="21757" DestTable="20850" FKFields="cmhl_id_historique_ligne=csc_ce_meta\n" FKFieldsComments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="133" />
<RELATION ID="27924" RelationName="fk_cmhl_csv_meta" Kind="2" SrcTable="21757" DestTable="20854" FKFields="cmhl_id_historique_ligne=csv_ce_meta\n" FKFieldsComments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="134" />
<RELATION ID="27927" RelationName="fk_cmhl_ccb_meta" Kind="2" SrcTable="21757" DestTable="21148" FKFields="cmhl_id_historique_ligne=ccb_ce_meta\n" FKFieldsComments="Identifiant des m\195\169tadonn\195\169es de cet enregistrement.\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="135" />
<RELATION ID="27941" RelationName="fk_cmlv_csap_role" Kind="1" SrcTable="18466" DestTable="1447" FKFields="cmlv_id_valeur=csap_id_role\n" FKFieldsComments="Identifiant du r\195\180le de la personne vis \195\160 vis de la structure.\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="136" />
<RELATION ID="27948" RelationName="fk_cmlv_cp_deces" Kind="2" SrcTable="18466" DestTable="1446" FKFields="cmlv_id_valeur=cp_ce_deces\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="134" />
<RELATION ID="27950" RelationName="fk_cmlv_cp_pays" Kind="2" SrcTable="18466" DestTable="1446" FKFields="cmlv_id_valeur=cp_ce_truk_pays\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="135" />
<RELATION ID="27952" RelationName="fk_cmlv_cp_region" Kind="2" SrcTable="18466" DestTable="1446" FKFields="cmlv_id_valeur=cp_ce_truk_region\n" FKFieldsComments="\n" relDirection="2" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="136" />
<RELATION ID="27959" RelationName="fk_cmlv_cc_type_nbre_precision" Kind="2" SrcTable="18466" DestTable="1444" FKFields="cmlv_id_valeur=cc_ce_specimen_type_nbre_precision\n" FKFieldsComments="\n" relDirection="3" MidOffset="0" OptionalStart="0" OptionalEnd="0" CaptionOffsetX="0" CaptionOffsetY="0" StartIntervalOffsetX="0" StartIntervalOffsetY="0" EndIntervalOffsetX="0" EndIntervalOffsetY="0" CreateRefDef="0" Invisible="1" RefDef="Matching=0\nOnDelete=3\nOnUpdate=3\n" Comments="" FKRefDefIndex_Obj_id="-1" Splitted="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="137" />
</RELATIONS>
<NOTES>
</NOTES>
<IMAGES>
</IMAGES>
</METADATA>
<PLUGINDATA>
<PLUGINDATARECORDS>
</PLUGINDATARECORDS>
</PLUGINDATA>
<QUERYDATA>
<QUERYRECORDS>
</QUERYRECORDS>
</QUERYDATA>
<LINKEDMODELS>
</LINKEDMODELS>
</DBMODEL>
Property changes:
Added: svn:keywords
+LastChangedRevision
\ No newline at end of property
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_projet.html
New file
0,0 → 1,409
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Projet - coel_projet</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Projet.html">Projet</a> > coel_projet</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_projet</h1>
<h2> Description générale </h2>
<p>
Contient les informations sur un projet de données.<br />INFO : cpr_nom
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cpr_id_projet" class="pair" >
<td> 1 </td>
<td> cpr_id_projet </td>
<td> cpr_id_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� primaire </td>
<td> oui </td>
<td> Identifiant d'un projet. </td>
</tr>
<tr id="cpr_nom" class="pair" >
<td> 2 </td>
<td> cpr_nom </td>
<td> cpr_n </td>
<td> VARCHAR(255) </td>
<td> oui </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nom du projet. </td>
</tr>
<tr id="cpr_abreviation" class="pair" >
<td> 3 </td>
<td> cpr_abreviation </td>
<td> cpr_a </td>
<td> VARCHAR(40) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Abréviation du projet. </td>
</tr>
<tr id="cpr_resume" class="pair" >
<td> 4 </td>
<td> cpr_resume </td>
<td> cpr_r </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Résumé du projet. </td>
</tr>
<tr id="cpr_description" class="pair" >
<td> 5 </td>
<td> cpr_description </td>
<td> cpr_d </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Description détaillée du projet. </td>
</tr>
<tr id="cpr_url" class="pair" >
<td> 6 </td>
<td> cpr_url </td>
<td> cpr_u </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> URL principal où trouver des compléments d'information sur le projet. </td>
</tr>
<tr id="cpr_mot_cles" class="pair" >
<td> 7 </td>
<td> cpr_mot_cles </td>
<td> cpr_mc </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Mots clés correspondant au projet. </td>
</tr>
<tr id="cpr_citation" class="pair" >
<td> 8 </td>
<td> cpr_citation </td>
<td> cpr_c </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Indication sur la fa\195\167on de citer le projet pour réaliser une bibliographie. </td>
</tr>
<tr id="cpr_licence" class="pair" >
<td> 9 </td>
<td> cpr_licence </td>
<td> cpr_l </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Url ou texte présentant la licence des données du projet. </td>
</tr>
<tr id="cpr_ce_langue" class="pair" >
<td> 10 </td>
<td> cpr_ce_langue </td>
<td> cpr_ce_l </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Langue principale des données du projet (selon l'ISO-639-1). </td>
</tr>
<tr id="cpr_indexation_heure" class="pair" >
<td> 11 </td>
<td> cpr_indexation_heure </td>
<td> cpr_ih </td>
<td> TIME </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Préférence de l'heure de départ pour les procédures d'indexation externe. </td>
</tr>
<tr id="cpr_ce_indexation_duree" class="pair" >
<td> 12 </td>
<td> cpr_ce_indexation_duree </td>
<td> cpr_ce_id </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Durée maximum acceptable pour une procédure d'indexation externe. </td>
</tr>
<tr id="cpr_ce_indexation_freq" class="pair" >
<td> 13 </td>
<td> cpr_ce_indexation_freq </td>
<td> cpr_ce_if </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Fréquence maximum acceptable pour une procédure d'indexation externe. </td>
</tr>
<tr id="cpr_mark_public" class="pair" >
<td> 14 </td>
<td> cpr_mark_public </td>
<td> cpr_mp </td>
<td> BOOL </td>
<td> non </td>
<td> 0 </td>
<td> standard </td>
<td> non </td>
<td> Indique si oui (=1) ou non (=0) ce projet est public. Si oui, il peut être publié dans eFlore. </td>
</tr>
<tr id="cpr_mark_editable" class="pair" >
<td> 15 </td>
<td> cpr_mark_editable </td>
<td> cpr_me </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Indique si oui (=1) ou non (=0) ce projet est éditable. Si nom, l'application doit seulement permettre de consulter les données. </td>
</tr>
<tr id="cpr_ce_meta" class="pair" >
<td> 16 </td>
<td> cpr_ce_meta </td>
<td> cpr_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cpr_cpar </td>
<td> cpr_id_projet </td>
<td> cpar_id_projet </td>
<td> <a href="coel_table_coel_personne_a_relation.html">coel_personne_a_relation</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cpr_cp </td>
<td> cpr_id_projet </td>
<td> cp_ce_projet </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cpr_cs </td>
<td> cpr_id_projet </td>
<td> cs_ce_projet </td>
<td> <a href="coel_table_coel_structure.html">coel_structure</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cpr_cc </td>
<td> cpr_id_projet </td>
<td> cc_ce_projet </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 5 </td>
<td> fk_cpr_cpu </td>
<td> cpr_id_projet </td>
<td> cpu_ce_projet </td>
<td> <a href="coel_table_coel_publication.html">coel_publication</a> </td>
</tr>
<tr class="pair" >
<td> 6 </td>
<td> fk_cpr_cprv </td>
<td> cpr_id_projet </td>
<td> cprv_ce_projet </td>
<td> <a href="coel_table_coel_projet_version.html">coel_projet_version</a> </td>
</tr>
<tr class="pair" >
<td> 7 </td>
<td> fk_cpr_cmlv </td>
<td> cpr_id_projet </td>
<td> cmlv_ce_projet </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 8 </td>
<td> fk_cpr_cmc </td>
<td> cpr_id_projet </td>
<td> cmc_ce_projet </td>
<td> <a href="coel_table_coel_meta_colonne.html">coel_meta_colonne</a> </td>
</tr>
<tr class="pair" >
<td> 9 </td>
<td> fk_cpr_ccm </td>
<td> cpr_id_projet </td>
<td> ccm_ce_projet </td>
<td> <a href="coel_table_coel_commentaire.html">coel_commentaire</a> </td>
</tr>
<tr class="pair" >
<td> 10 </td>
<td> fk_cmhl_cpr_meta </td>
<td> cpr_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 11 </td>
<td> fk_cpr_cpras </td>
<td> cpr_id_projet </td>
<td> cpras_id_projet </td>
<td> <a href="coel_table_coel_projet_a_structure.html">coel_projet_a_structure</a> </td>
</tr>
<tr class="pair" >
<td> 12 </td>
<td> fk_cmlv_cpr_langue </td>
<td> cpr_ce_langue </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 13 </td>
<td> fk_cmlv_cpr_idx_duree </td>
<td> cpr_ce_indexation_duree </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 14 </td>
<td> fk_cmlv_cpr_idx_freq </td>
<td> cpr_ce_indexation_freq </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_projet">
discussion sur la table coel_projet
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_meta_liste_valeur.html
New file
0,0 → 1,613
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Métadonnée - coel_meta_liste_valeur</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Metadonnee.html">Métadonnée</a> > coel_meta_liste_valeur</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_meta_liste_valeur</h1>
<h2> Description générale </h2>
<p>
Liste l'ensemble des valeurs des tables de type liste.<br />Un champ contient des valeurs dans cette table quand il est de type "LISTE".<br />INFO : cmlv_nom
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cmlv_id_valeur" class="pair" >
<td> 1 </td>
<td> cmlv_id_valeur </td>
<td> cmlv_id_v </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� primaire </td>
<td> oui </td>
<td> Identifiant d'une valeur de liste. Notez que les listes sont des valeurs de la liste des listes. </td>
</tr>
<tr id="cmlv_ce_parent" class="pair" >
<td> 2 </td>
<td> cmlv_ce_parent </td>
<td> cmlv_ce_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant de la catégorie ou des informations sur la liste. Les listes ont pour parent la valeur 0 qui correspond à la liste des listes. </td>
</tr>
<tr id="cmlv_ce_projet" class="pair" >
<td> 3 </td>
<td> cmlv_ce_projet </td>
<td> cmlv_ce_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du projet de la valeur. </td>
</tr>
<tr id="cmlv_nom" class="pair" >
<td> 4 </td>
<td> cmlv_nom </td>
<td> cmlv_n </td>
<td> VARCHAR(100) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nom de la valeur. </td>
</tr>
<tr id="cmlv_abreviation" class="pair" >
<td> 5 </td>
<td> cmlv_abreviation </td>
<td> cmlv_a </td>
<td> VARCHAR(50) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Abréviation, code ou identifiant de la valeur. </td>
</tr>
<tr id="cmlv_description" class="pair" >
<td> 6 </td>
<td> cmlv_description </td>
<td> cmlv_d </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Description de cette valeur. </td>
</tr>
<tr id="cmlv_ce_meta" class="pair" >
<td> 7 </td>
<td> cmlv_ce_meta </td>
<td> cmlv_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cpr_cmlv </td>
<td> cmlv_ce_projet </td>
<td> cpr_id_projet </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cmlv_cmlv_parent </td>
<td> cmlv_id_valeur </td>
<td> cmlv_ce_parent </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cmlv_cmc_liste </td>
<td> cmlv_id_valeur </td>
<td> cmc_ce_liste </td>
<td> <a href="coel_table_coel_meta_colonne.html">coel_meta_colonne</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cmhl_cmlv_meta </td>
<td> cmlv_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 5 </td>
<td> fk_cmlv_cs_type </td>
<td> cmlv_id_valeur </td>
<td> cs_ce_type </td>
<td> <a href="coel_table_coel_structure.html">coel_structure</a> </td>
</tr>
<tr class="pair" >
<td> 6 </td>
<td> fk_cmlv_cs_type_prive </td>
<td> cmlv_id_valeur </td>
<td> cs_ce_truk_type_prive </td>
<td> <a href="coel_table_coel_structure.html">coel_structure</a> </td>
</tr>
<tr class="pair" >
<td> 7 </td>
<td> fk_cmlv_cs_type_public </td>
<td> cmlv_id_valeur </td>
<td> cs_ce_truk_type_public </td>
<td> <a href="coel_table_coel_structure.html">coel_structure</a> </td>
</tr>
<tr class="pair" >
<td> 8 </td>
<td> fk_cmlv_cmhl_val </td>
<td> cmlv_id_valeur </td>
<td> cmhl_ce_etat </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 9 </td>
<td> fk_cmlv_cmc_table </td>
<td> cmlv_id_valeur </td>
<td> cmc_ce_table </td>
<td> <a href="coel_table_coel_meta_colonne.html">coel_meta_colonne</a> </td>
</tr>
<tr class="pair" >
<td> 10 </td>
<td> fk_cmlv_cmc_format_sql </td>
<td> cmlv_id_valeur </td>
<td> cmc_ce_format_sql </td>
<td> <a href="coel_table_coel_meta_colonne.html">coel_meta_colonne</a> </td>
</tr>
<tr class="pair" >
<td> 11 </td>
<td> fk_cmlv_cmd_table </td>
<td> cmlv_id_valeur </td>
<td> cmd_ce_table </td>
<td> <a href="coel_table_coel_meta_donnee.html">coel_meta_donnee</a> </td>
</tr>
<tr class="pair" >
<td> 12 </td>
<td> fk_cmlv_cmhl_table </td>
<td> cmlv_id_valeur </td>
<td> cmhl_ce_table </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 13 </td>
<td> fk_cmlv_cpar_role </td>
<td> cmlv_id_valeur </td>
<td> cpar_id_role </td>
<td> <a href="coel_table_coel_personne_a_relation.html">coel_personne_a_relation</a> </td>
</tr>
<tr class="pair" >
<td> 14 </td>
<td> fk_cmlv_cp_prefix </td>
<td> cmlv_id_valeur </td>
<td> cp_ce_truk_prefix </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 15 </td>
<td> fk_cmlv_cp_suffix </td>
<td> cmlv_id_valeur </td>
<td> cp_ce_truk_suffix </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 16 </td>
<td> fk_cmlv_cp_sexe </td>
<td> cmlv_id_valeur </td>
<td> cp_ce_sexe </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 17 </td>
<td> fk_cmlv_cp_specialite </td>
<td> cmlv_id_valeur </td>
<td> cp_ce_truk_specialite </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 18 </td>
<td> fk_cmlv_cp_role </td>
<td> cmlv_id_valeur </td>
<td> cp_ce_truk_role </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 19 </td>
<td> fk_cmlv_csap_fonction </td>
<td> cmlv_id_valeur </td>
<td> csap_ce_truk_fonction </td>
<td> <a href="coel_table_coel_structure_a_personne.html">coel_structure_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 20 </td>
<td> fk_cmlv_csap_statut </td>
<td> cmlv_id_valeur </td>
<td> csap_ce_truk_statut </td>
<td> <a href="coel_table_coel_structure_a_personne.html">coel_structure_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 21 </td>
<td> fk_cmlv_csc_materiel_conservation </td>
<td> cmlv_id_valeur </td>
<td> csc_ce_materiel_conservation </td>
<td> <a href="coel_table_coel_structure_conservation.html">coel_structure_conservation</a> </td>
</tr>
<tr class="pair" >
<td> 22 </td>
<td> fk_cmlv_cpuap_type </td>
<td> cmlv_id_valeur </td>
<td> cpuap_ce_truk_type </td>
<td> <a href="coel_table_coel_publication_a_personne.html">coel_publication_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 23 </td>
<td> fk_cmlv_cpuap_role </td>
<td> cmlv_id_valeur </td>
<td> cpuap_id_role </td>
<td> <a href="coel_table_coel_publication_a_personne.html">coel_publication_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 24 </td>
<td> fk_cmlv_ccap_role </td>
<td> cmlv_id_valeur </td>
<td> ccap_id_role </td>
<td> <a href="coel_table_coel_collection_a_personne.html">coel_collection_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 25 </td>
<td> fk_cmlv_cc_type </td>
<td> cmlv_id_valeur </td>
<td> cc_ce_type </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 26 </td>
<td> fk_cmlv_cc_developpement </td>
<td> cmlv_id_valeur </td>
<td> cc_ce_developpement </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 27 </td>
<td> fk_cmlv_cc_specimen_type </td>
<td> cmlv_id_valeur </td>
<td> cc_ce_specimen_type </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 28 </td>
<td> fk_cmlv_cc_specimen_type_classement </td>
<td> cmlv_id_valeur </td>
<td> cc_ce_specimen_type_classement </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 29 </td>
<td> fk_cmlv_ccb_unitte_rangement_etat </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_unite_rangement_etat </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 30 </td>
<td> fk_cmlv_ccb_traitement </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_traitement </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 31 </td>
<td> fk_cmlv_ccb_etat_general </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_etat_general </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 32 </td>
<td> fk_cmlv_ccb_determination </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_determination </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 33 </td>
<td> fk_cmlv_ccb_recolte_date_debut_type </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_recolte_date_debut_type </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 34 </td>
<td> fk_cmlv_ccb_recolte_date_fin_type </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_recolte_date_fin_type </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 35 </td>
<td> fk_cmlv_ccb_classement_etat </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_classement_etat </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 36 </td>
<td> fk_cmlv_ccb_precision_localite </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_precision_localite </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 37 </td>
<td> fk_cmlv_ccb_precision_date </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_precision_date </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 38 </td>
<td> fk_cmlv_ccb_collection_integre </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_collection_integre </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 39 </td>
<td> fk_cmlv_ccb_collection_integre_info </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_collection_integre_info </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 40 </td>
<td> fk_cmlv_ccb_inventaire </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_inventaire </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 41 </td>
<td> fk_cmlv_ccb_inventaire_auteur </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_inventaire_auteur </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 42 </td>
<td> fk_cmlv_ccb_inventaire_forme </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_inventaire_forme </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 43 </td>
<td> fk_cmlv_ccb_inventaire_digital </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_truk_inventaire_digital </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 44 </td>
<td> fk_cmlv_ccb_inventaire_etat </td>
<td> cmlv_id_valeur </td>
<td> ccb_ce_inventaire_etat </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
<tr class="pair" >
<td> 45 </td>
<td> fk_cmlv_cc_type_depot </td>
<td> cmlv_id_valeur </td>
<td> cc_ce_type_depot </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 46 </td>
<td> fk_cmlv_cpr_langue </td>
<td> cmlv_id_valeur </td>
<td> cpr_ce_langue </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 47 </td>
<td> fk_cmlv_cpr_idx_duree </td>
<td> cmlv_id_valeur </td>
<td> cpr_ce_indexation_duree </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 48 </td>
<td> fk_cmlv_cpr_idx_freq </td>
<td> cmlv_id_valeur </td>
<td> cpr_ce_indexation_freq </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 49 </td>
<td> fk_cmlv_csap_role </td>
<td> cmlv_id_valeur </td>
<td> csap_id_role </td>
<td> <a href="coel_table_coel_structure_a_personne.html">coel_structure_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 50 </td>
<td> fk_cmlv_cp_deces </td>
<td> cmlv_id_valeur </td>
<td> cp_ce_deces </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 51 </td>
<td> fk_cmlv_cp_pays </td>
<td> cmlv_id_valeur </td>
<td> cp_ce_truk_pays </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 52 </td>
<td> fk_cmlv_cp_region </td>
<td> cmlv_id_valeur </td>
<td> cp_ce_truk_region </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 53 </td>
<td> fk_cmlv_cc_type_nbre_precision </td>
<td> cmlv_id_valeur </td>
<td> cc_ce_specimen_type_nbre_precision </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_meta_liste_valeur">
discussion sur la table coel_meta_liste_valeur
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_module_Publication.html
New file
0,0 → 1,91
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Publication</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > Publication</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<h1> Module Publication</h1>
<p id="miniature" >
<a href="images/modules/Publication.png" title="Voir cette image avec un zoom de 100%.">
<img src="images/miniatures/miniature_Publication.png" alt="Miniature du modèle du module Publication" />
</a>
</p>
<h2> Description générale </h2>
<p>
Module de gestion des Publications.<br />
<br />
<b>Révision : </b>1159
</p>
<h2> Liste des tables </h2>
<ol class="type_01">
<li><a href="coel_table_coel_publication.html">coel_publication</a> : Publication de type articles scientifiques, ouvrages ou sites web.<br />INFO : cpu_fmt_nom_complet</li>
<li><a href="coel_table_coel_publication_a_personne.html">coel_publication_a_personne</a> : Permet de lister les publications d'une personne.</li>
</ol>
<h2> Dépot SVN </h2>
<p>
Voir la page concernant ce module sur le dépot SVN :
<a href="http://svn.tela-botanica.net/websvn/filedetails.php?repname=Applications.coel&path=%2Ftrunk%2Fdoc%2Fbdd%2Fcoel.xml">
coel.xml
</a>
</p>
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant ce module :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_Publication">
discussion sur le module Publication
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
/tags/v1.11-okuzgozu/doc/bdd/archives/migration_bdd_herbiers_vers_coel.sql
New file
0,0 → 1,397
#------------------------------------------------------------------------------------------------------------------------
# SCRIPT de MIGRATION de HERBIERS vers COEL v1.0
#------------------------------------------------------------------------------------------------------------------------
# TODO : remplacer les valeurs vides par NULL -> utiliser le script remplacer_vide_par_null.php
 
#---------------------------------------------------------------------------------------------------------------------#
# Variables
SET @idm = 29170;# Identifiant pour les métadonnées
SET @idm_tmp = @idm;# Identifiant pour les métadonnées temporaire
SET @idm_max = 99999;# Identifiant pour les métadonnées maximum si déjà des données dans la base
#---------------------------------------------------------------------------------------------------------------------#
# Nettoyage des tables
# coel_projet
DELETE FROM tb_coel.coel_projet WHERE cpr_id_projet IN (2,3);
# coel_projet_version
DELETE FROM tb_coel.coel_projet_version WHERE cprv_id_version IN (1,2);
# coel_meta_historique_ligne
DELETE FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_id_historique_ligne >= @idm AND cmhl_id_historique_ligne < @idm_max;
# coel_structure
DELETE FROM tb_coel.coel_structure WHERE cs_id_structure IN (SELECT ID_ORG FROM tb_herbiers.HERBIERS_ORGANISATION ORDER BY ID_ORG ASC);
# coel_structure_a_personne
DELETE FROM tb_coel.coel_structure_a_personne WHERE csap_id_role IN ('2026', '2027');
# coel_personne
DELETE FROM tb_coel.coel_personne WHERE cp_ce_projet IN ('2', '3');
# coel_personne_a_relation
DELETE FROM tb_coel.coel_personne_a_relation WHERE cpar_id_projet = '2';
# coel_collection_botanique
DELETE FROM tb_coel.coel_collection_botanique WHERE ccb_id_collection IN (SELECT cc_id_collection FROM tb_coel.coel_collection WHERE cc_ce_projet IN ('2'));
# coel_collection_a_commentaire
DELETE FROM tb_coel.coel_collection_a_commentaire ;
# coel_collection
DELETE FROM tb_coel.coel_collection WHERE cc_ce_projet IN ('2');
# coel_commentaire
DELETE FROM tb_coel.coel_commentaire WHERE ccm_ce_projet IN ('2');
 
#---------------------------------------------------------------------------------------------------------------------#
# EFLORE_PROJET vers coel_projet
# Insertion du projet Inventaire des Herbiers de France - Version 1
INSERT INTO tb_coel.coel_projet (cpr_id_projet, cpr_nom, cpr_abreviation, cpr_description, cpr_url, cpr_mark_public, cpr_ce_meta)
SELECT 2, CONVERT(EPR_INTITULE_PROJET USING utf8), CONVERT(EPR_ABREVIATION_PROJET USING utf8), CONVERT(EPR_DESCRIPTION_PROJET USING utf8), EPR_LIEN_WEB, 1, @idm := @idm+1
FROM tb_herbiers.EFLORE_PROJET;
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@idm_tmp := @idm_tmp+1, '115', '2', NULL , NOW( ) , 'Ajout du projet IHF', '1', '1', '162.38.234.1');
# Insertion du projet Utilisateur de l''application COEL - Version 1
INSERT INTO tb_coel.coel_projet (cpr_id_projet, cpr_nom, cpr_abreviation, cpr_description, cpr_url, cpr_mark_public, cpr_ce_meta)
VALUES (3, 'Utilisateurs', 'COEL-U', 'Les utilisateurs de l''application COEL.', NULL, 0, @idm := @idm+1);
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@idm_tmp := @idm_tmp+1, '115', '2', NULL , NOW( ) , 'Ajout du projet U', '1', '1', '162.38.234.1');
 
#---------------------------------------------------------------------------------------------------------------------#
# coel_projet_version
# Insertion de la version 1 en cours du projet Inventaire des Herbiers de France
INSERT INTO tb_coel.coel_projet_version (cprv_id_version, cprv_ce_projet, cprv_nom, cprv_code, cprv_date_debut, cprv_date_fin, cprv_ce_meta)
VALUES (1, 2, 'IHF - version 1.00', 'IHF-v1.00', '2002-03-07 00:00:00', NULL, @idm := @idm+1);
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@idm_tmp := @idm_tmp+1, '117', '1', NULL , NOW( ) , 'Ajout de la version 1 du projet IHF', '1', '1', '162.38.234.1');
# Insertion de la version 1 du projet Utilisateur de l''application COEL
INSERT INTO tb_coel.coel_projet_version (cprv_id_version, cprv_ce_projet, cprv_nom, cprv_code, cprv_date_debut, cprv_date_fin, cprv_ce_meta)
VALUES (2, 3, 'COEL-U - version 1.00', 'COEL-U-v1.00', '2002-03-07 00:00:00', NULL, @idm := @idm+1);
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@idm_tmp := @idm_tmp+1, '117', '2', NULL , NOW( ) , 'Ajout de la version 1 du projet COEL-U', '1', '1', '162.38.234.1');
 
#------------------------------------------------------------------------------------------------------------------------
# HERBIERS_ORGANISATION vers coel_structure
ALTER TABLE tb_herbiers.HERBIERS_ORGANISATION ORDER BY ID_ORG;# Classement des organisations par ID croissant
#ALTER TABLE tb_herbiers.HERBIERS_ORGANISATION DROP NUM_COLLECTION, DROP ADRESS_TEXT, DROP TIME_ZONE ;# Suppression des champs inutiles
 
INSERT INTO tb_coel.coel_structure
(cs_id_structure, cs_ce_projet, cs_ce_mere, cs_guid, cs_truk_identifiant_alternatif,
cs_nom, cs_adresse_01, cs_code_postal, cs_ville,
cs_ce_truk_region,
cs_ce_truk_pays,
cs_truk_telephone,
cs_courriel,
cs_description,
cs_truk_url,
cs_condition_acces,
cs_ce_meta)
SELECT ID_ORG, '2', '0', CONCAT("urn:lsid:tela-botanica.org:ihf:str",ID_ORG) AS GUID, IF(INDEX_HERB != '', CONCAT('IH##',INDEX_HERB), NULL) AS IDENTIFIANT_ALTERNATIF,
REPLACE(CONVERT(INSTITUTION_NAME USING utf8), '\r\n', ''), CONVERT(ADRESS_LINE USING utf8), ZIP, CONVERT(TOWN USING utf8),
IF(REGION != '', CONCAT('AUTRE##',CONVERT(REGION USING utf8)), NULL),
IF(COUNTRY_CODE = 'fr', '2654', CONCAT('AUTRE##', CONVERT(COUNTRY_CODE USING utf8))) AS PAYS,
CONCAT(IF(TEL != '', CONCAT('(+33)', REPLACE(TEL,'[33]','')), NULL), IF(FAX != '', CONCAT(IF(TEL != '', ';;', ''), 'FAX##(+33)', REPLACE(FAX,'[33]','')), NULL)),
EMAIL,
IF(SOURCE_DES_DONNEES != '', CONVERT(CONCAT("Source des données : ",SOURCE_DES_DONNEES) USING utf8), NULL) AS DESCRIPTION,
CONCAT(IF(HO_URL != 'http://' AND HO_URL != '', CONCAT('WEB##',HO_URL), ''), IF(HO_URL != 'http://' AND HO_URL != '' AND LOGO != '', ';;', ''), IF(LOGO != '', CONCAT('LOGO##',LOGO),'')) AS URLS,
CONVERT(ACCESS_RESTRICTION USING utf8),
@idm := @idm+1
FROM tb_herbiers.HERBIERS_ORGANISATION
ORDER BY ID_ORG ASC;
INSERT INTO tb_coel.coel_meta_historique_ligne
(cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification,
cmhl_notes,
cmhl_ce_modifier_par, cmhl_ce_etat, cmhl_ip)
SELECT @idm_tmp := @idm_tmp+1, '120', ID_ORG, NULL, IF(DATE_DERNIERE_MODIF = '0000-00-00 00:00:00', NOW(), DATE_DERNIERE_MODIF),
CONCAT('Importation de l''enregistrement #',ID_ORG,' de la table HERBIERS_ORGANISATION.'),
IF(CE_MODIFIER_PAR = '0', '1', CE_MODIFIER_PAR), '1', '162.38.234.1'
FROM tb_herbiers.HERBIERS_ORGANISATION
ORDER BY ID_ORG ASC;
 
UPDATE tb_coel.coel_structure SET cs_truk_telephone = REPLACE(cs_truk_telephone, '-', '') WHERE cs_truk_telephone LIKE '%-%';
UPDATE tb_coel.coel_structure SET cs_truk_telephone = REPLACE(cs_truk_telephone, '.', '') WHERE cs_truk_telephone LIKE '%.%';
UPDATE tb_coel.coel_structure SET cs_truk_telephone = REPLACE(cs_truk_telephone, ' ', '') WHERE cs_truk_telephone LIKE '% %';
UPDATE tb_coel.coel_structure SET cs_truk_telephone = REPLACE(cs_truk_telephone, '2;04', '2;;FIX##(+33)04') WHERE cs_truk_telephone LIKE '%2;04%';
UPDATE tb_coel.coel_structure SET cs_truk_telephone = REPLACE(cs_truk_telephone, '1;04', '1;;FIX##(+33)04') WHERE cs_truk_telephone LIKE '%1;04%';
UPDATE tb_coel.coel_structure SET cs_truk_telephone = REPLACE(cs_truk_telephone, ',', ';; (+33)') WHERE cs_truk_telephone LIKE '%,%';
UPDATE tb_coel.coel_structure SET cs_truk_telephone = REPLACE(cs_truk_telephone, '(+33)689', '(+689)') WHERE cs_truk_telephone LIKE '%(+33)689%';# Polynésie
UPDATE tb_coel.coel_structure SET cs_truk_telephone = REPLACE(cs_truk_telephone, '(+33)(687)', '(+687)') WHERE cs_truk_telephone LIKE '%(+33)(687)%';# Nouvelle-Calédonie
UPDATE tb_coel.coel_structure SET cs_truk_telephone = REPLACE(cs_truk_telephone, '(+33)594', '(+594)0594') WHERE cs_truk_telephone LIKE '%(+33)594%';# Guyanne
UPDATE tb_coel.coel_structure SET cs_truk_telephone = REPLACE(cs_truk_telephone, '(+33)(590)(0)590', '(+590)0590') WHERE cs_truk_telephone LIKE '%(+33)(590)(0)590%';# Guadeloupe
UPDATE tb_coel.coel_structure SET cs_truk_telephone = REPLACE(cs_truk_telephone, '(+33)(0)', '(+33)0') WHERE cs_truk_telephone LIKE '%(+33)(0)%';
UPDATE tb_coel.coel_structure SET cs_truk_telephone = REPLACE(cs_truk_telephone, ';;0', ';; (+33)0') WHERE cs_truk_telephone LIKE '%;;0%';
UPDATE tb_coel.coel_structure SET cs_truk_telephone = IF( cs_truk_telephone LIKE '(+33)06%', CONCAT('GSM##', cs_truk_telephone), CONCAT('FIX##', cs_truk_telephone)) WHERE cs_truk_telephone LIKE '(+33)__%';
UPDATE tb_coel.coel_structure SET cs_truk_telephone = IF(cs_truk_telephone LIKE '%;; (+33)06%', REPLACE(cs_truk_telephone, ';; (+33)', ';;GSM##(+33)'), REPLACE(cs_truk_telephone, ';; (+33)', ';;FIX##(+33)')) WHERE cs_truk_telephone LIKE '%;;%';
 
#------------------------------------------------------------------------------------------------------------------------
#EFLORE_DROIT_POSSEDER vers coel_personne_a_relation
INSERT INTO tb_coel.coel_personne_a_relation
(cpar_id_personne_01, cpar_id_personne_02, cpar_id_projet, cpar_id_role, cpar_ce_meta)
SELECT EDP_ID_UTILISATEUR, EDP_ID_UTILISATEUR, '2', IF(EDP_ID_DROIT = '1', '2022', IF(EDP_ID_DROIT = '2', 2023, IF(EDP_ID_DROIT = '3', '2024', '0'))), @idm := @idm+1
FROM tb_herbiers.EFLORE_DROIT_POSSEDER
ORDER BY EDP_ID_UTILISATEUR ASC;
INSERT INTO tb_coel.coel_meta_historique_ligne
(cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement,
cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
SELECT @idm_tmp := @idm_tmp+1, '114', CONCAT(EDP_ID_UTILISATEUR, '-', EDP_ID_UTILISATEUR, '-2-', IF(EDP_ID_DROIT = '1', '2022', IF(EDP_ID_DROIT = '2', '2023', IF(EDP_ID_DROIT = '3', '2024', 0)))), NULL, NOW(),
CONCAT('Importation des droits l''utilisateur #',EDP_ID_UTILISATEUR,' de la table EFLORE_DROIT_POSSEDER.'), '1', '1', '162.38.234.1'
FROM tb_herbiers.EFLORE_DROIT_POSSEDER
ORDER BY EDP_ID_UTILISATEUR ASC;
 
#------------------------------------------------------------------------------------------------------------------------
# HERBIERS_COORDONNE vers coel_personne_a_relation
INSERT INTO tb_coel.coel_personne_a_relation
(cpar_id_personne_01, cpar_id_personne_02, cpar_id_projet, cpar_id_role, cpar_ce_meta)
SELECT HC_ID_COORDINATEUR, HC_ID_REDACTEUR, '2', '2025', @idm := @idm+1
FROM tb_herbiers.HERBIERS_COORDONNE
ORDER BY HC_ID_COORDINATEUR, HC_ID_REDACTEUR ASC;
INSERT INTO tb_coel.coel_meta_historique_ligne
(cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement,
cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
SELECT @idm_tmp := @idm_tmp+1, '114', CONCAT(HC_ID_COORDINATEUR, '-', HC_ID_REDACTEUR, '-2-2025'), NULL,
NOW(), CONCAT('Importation des relations de coordination de l''utilisateur #',HC_ID_COORDINATEUR,' de la table HERBIER_COORDONNE.'), '1', '1', '162.38.234.1'
FROM tb_herbiers.HERBIERS_COORDONNE
ORDER BY HC_ID_COORDINATEUR, HC_ID_REDACTEUR ASC;
 
#------------------------------------------------------------------------------------------------------------------------
# EFLORE_DROIT_POSSEDER et annuaire_tela vers coel_personne
# Pour l''identifiant on garde celui de l''annuaire Tela. Les autres projets commenceront à partir de 100 000
INSERT INTO tb_coel.coel_personne
(cp_id_personne, cp_ce_projet, cp_fmt_nom_complet, cp_prenom, cp_nom,
cp_adresse_01, cp_adresse_02, cp_ce_truk_region, cp_code_postal, cp_ville, cp_ce_truk_pays,
cp_truk_courriel, cp_truk_url,
cp_description,
cp_ce_truk_role,
cp_mot_de_passe, cp_login, cp_ce_annuaire_tela, cp_parametre,
cp_ce_meta)
SELECT U_ID, '3', CONCAT(CONVERT(U_SURNAME USING utf8),' ',UPPER(CONVERT(U_NAME USING utf8))) AS NOM_COMPLET, CONVERT(U_SURNAME USING utf8), UPPER(CONVERT(U_NAME USING utf8)),
CONVERT(U_ADDR1 USING utf8), CONVERT(U_ADDR2 USING utf8), CONCAT('AUTRE##', CONVERT(U_STATE USING utf8)), U_ZIP_CODE, CONVERT(U_CITY USING utf8), CONCAT('AUTRE##', CONVERT(CP.CP_Intitule_pays USING utf8)),
LOWER(U_MAIL), U_WEB,
CONCAT('Spécialités systématiques : ', CONVERT(U_SPE USING utf8), '\nSpécialités géographiques : ', CONVERT(U_GEO USING utf8), '\nFonction : ', CONVERT(U_FONCTION USING utf8), '\nStructure : ', CONVERT(U_TITLE USING utf8)),
IF(EDP_ID_DROIT = '1', '2022', IF(EDP_ID_DROIT = '2', '2023', IF(EDP_ID_DROIT = '3', '2024', 0))),
U_PASSWD, U_MAIL, U_ID, CONCAT('<?xml version="1.0" encoding="UTF-8"?><parametres><niveau_bota>', U_NIV,'</niveau_bota></parametres>'),
@idm := @idm+1
FROM tb_herbiers.EFLORE_DROIT_POSSEDER AS EDP
LEFT JOIN tb_v4.annuaire_tela AS AT ON (EDP.EDP_ID_UTILISATEUR = AT.U_ID)
LEFT JOIN tb_v4.carto_PAYS AS CP ON (AT.U_COUNTRY = CP.CP_ID_Pays)
ORDER BY U_ID ASC;
INSERT INTO tb_coel.coel_meta_historique_ligne
(cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification,
cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
SELECT @idm_tmp := @idm_tmp+1, '113', U_ID, NULL, U_DATE,
CONCAT('Importation de l''utilisateur #', U_ID,' de la table annuaire_tela liée à EFLORE_DROIT_POSSEDER.'), '1', '1', '162.38.234.1'
FROM tb_herbiers.EFLORE_DROIT_POSSEDER AS EDP
LEFT JOIN tb_v4.annuaire_tela AS AT ON (EDP.EDP_ID_UTILISATEUR = AT.U_ID)
ORDER BY U_ID ASC;
 
#------------------------------------------------------------------------------------------------------------------------
# HERBIERS_ADMINISTRER et annuaire_tela vers coel_personne
# Pour l''identifiant on garde celui de l''annuaire Tela. Les autres projets commenceront à partir de 100 000
INSERT INTO tb_coel.coel_personne
(cp_id_personne, cp_ce_projet, cp_fmt_nom_complet, cp_prenom, cp_nom,
cp_adresse_01, cp_adresse_02, cp_ce_truk_region, cp_code_postal, cp_ville, cp_ce_truk_pays,
cp_truk_courriel, cp_truk_url,
cp_description,
cp_mot_de_passe, cp_login, cp_ce_annuaire_tela, cp_parametre,
cp_ce_meta)
SELECT DISTINCT U_ID, '3', CONCAT(CONVERT(U_SURNAME USING utf8),' ',UPPER(CONVERT(U_NAME USING utf8))) AS NOM_COMPLET, CONVERT(U_SURNAME USING utf8), UPPER(CONVERT(U_NAME USING utf8)),
CONVERT(U_ADDR1 USING utf8), CONVERT(U_ADDR2 USING utf8), CONCAT('AUTRE##', CONVERT(U_STATE USING utf8)), U_ZIP_CODE, CONVERT(U_CITY USING utf8), CONCAT('AUTRE##', CONVERT(CP.CP_Intitule_pays USING utf8)),
LOWER(U_MAIL), U_WEB,
CONCAT('Spécialités systématiques : ', CONVERT(U_SPE USING utf8), '\nSpécialités géographiques : ', CONVERT(U_GEO USING utf8), '\nFonction : ', CONVERT(U_FONCTION USING utf8), '\nStructure : ', CONVERT(U_TITLE USING utf8)),
U_PASSWD, U_MAIL, U_ID, CONCAT('<?xml version="1.0" encoding="UTF-8"><parametres><niveau_bota>', U_NIV,'</niveau_bota></parametres>'),
@idm := @idm+1
FROM tb_herbiers.HERBIERS_ADMINISTRER AS HA
LEFT JOIN tb_v4.annuaire_tela AS AT ON (HA.HA_ID_ANNUAIRE = AT.U_ID)
LEFT JOIN tb_v4.carto_PAYS AS CP ON (AT.U_COUNTRY = CP.CP_ID_Pays)
WHERE U_ID NOT IN (SELECT DISTINCT EDP_ID_UTILISATEUR FROM tb_herbiers.EFLORE_DROIT_POSSEDER)
ORDER BY U_ID ASC;
INSERT INTO tb_coel.coel_meta_historique_ligne
(cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification,
cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
SELECT DISTINCT @idm_tmp := @idm_tmp+1, '113', U_ID, NULL, U_DATE,
CONCAT('Importation de l''utilisateur #', U_ID,' de la table annuaire_tela liée à HERBIERS_ADMINISTRER.'), '1', '1', '162.38.234.1'
FROM tb_herbiers.HERBIERS_ADMINISTRER AS HA
LEFT JOIN tb_v4.annuaire_tela AS AT ON (HA.HA_ID_ANNUAIRE = AT.U_ID)
WHERE U_ID NOT IN (SELECT DISTINCT EDP_ID_UTILISATEUR FROM tb_herbiers.EFLORE_DROIT_POSSEDER)
ORDER BY U_ID ASC;
 
#------------------------------------------------------------------------------------------------------------------------
# HERBIERS_ADMINISTRER vers coel_structure_a_personne
INSERT INTO tb_coel.coel_structure_a_personne
(csap_id_structure, csap_id_personne, csap_id_role, csap_ce_meta)
SELECT HA_ID_ORG, HA_ID_ANNUAIRE, '2026', @idm := @idm+1
FROM tb_herbiers.HERBIERS_ADMINISTRER
ORDER BY HA_ID_ANNUAIRE, HA_ID_ORG ASC;
INSERT INTO tb_coel.coel_meta_historique_ligne
(cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement,
cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
SELECT @idm_tmp := @idm_tmp+1, '121', CONCAT(HA_ID_ORG, '-', HA_ID_ANNUAIRE, '-2026'), NULL,
NOW(), CONCAT('Importation de l''administrateur #',HA_ID_ANNUAIRE,' de la structure #', HA_ID_ORG,' de la table HERBIER_ADMINISTRER.'), '1', '1', '162.38.234.1'
FROM tb_herbiers.HERBIERS_ADMINISTRER
ORDER BY HA_ID_ANNUAIRE, HA_ID_ORG ASC;
#------------------------------------------------------------------------------------------------------------------------
#HERBIERS_STAFF vers coel_personne
INSERT INTO tb_coel.coel_personne
(cp_id_personne, cp_ce_projet, cp_fmt_nom_complet, cp_nom, cp_prenom, cp_adresse_01, cp_adresse_02, cp_code_postal, cp_ville, cp_truk_courriel,
cp_truk_telephone,
cp_ce_meta)
SELECT 100000+ID_STAFF, '2', CONCAT(CONVERT(PRENOM USING utf8),' ', UPPER(CONVERT(NOM USING utf8))) AS NOM_COMPLET, UPPER(CONVERT(NOM USING utf8)), CONVERT(PRENOM USING utf8), CONVERT(ADRESSE1 USING utf8), CONVERT(ADRESSE2 USING utf8), CP, CONVERT(VILLE USING utf8), LOWER(MAIL),
CONCAT(IF(TEL != '', CONCAT('(+33)', REPLACE(TEL,'[33]','')), NULL), IF(FAX != '', CONCAT(IF(TEL != '', ';;', ''), 'FAX##(+33)', REPLACE(FAX,'[33]','')), NULL)),
@idm := @idm+1
FROM tb_herbiers.HERBIERS_STAFF
ORDER BY ID_STAFF ASC;
INSERT INTO tb_coel.coel_meta_historique_ligne
(cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement,
cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
SELECT @idm_tmp := @idm_tmp+1, '113', 100000+ID_STAFF, NULL, IF(DATE_DERNIERE_MODIF != '0000-00-00 00:00:00', DATE_DERNIERE_MODIF, NOW()),
CONCAT('Importation de l''utilisateur #', 100000+ID_STAFF,' de la table HERBIERS_STAFF'), '1', '1', '162.38.234.1'
FROM tb_herbiers.HERBIERS_STAFF
ORDER BY ID_STAFF ASC;
 
UPDATE tb_coel.coel_personne SET cp_truk_telephone = REPLACE(cp_truk_telephone, ' ', '') WHERE cp_truk_telephone LIKE '% %';
UPDATE tb_coel.coel_personne SET cp_truk_telephone = REPLACE(cp_truk_telephone, '-', '') WHERE cp_truk_telephone LIKE '%-%';
UPDATE tb_coel.coel_personne SET cp_truk_telephone = REPLACE(cp_truk_telephone, '.', '') WHERE cp_truk_telephone LIKE '%.%';
# Gérer les séparateurs ; au cas par cas
UPDATE tb_coel.coel_personne SET cp_truk_telephone = REPLACE(cp_truk_telephone, '1;04', '1;;FIX##(+33)04') WHERE cp_truk_telephone LIKE '%1;04%';
UPDATE tb_coel.coel_personne SET cp_truk_telephone = REPLACE(cp_truk_telephone, ',', ';; (+33)') WHERE cp_truk_telephone LIKE '%,%';
UPDATE tb_coel.coel_personne SET cp_truk_telephone = REPLACE(cp_truk_telephone, '(+33)+33', '(+33)') WHERE cp_truk_telephone LIKE '%(+33)+33%';
UPDATE tb_coel.coel_personne SET cp_truk_telephone = REPLACE(cp_truk_telephone, '(+33)689', '(+689)') WHERE cp_truk_telephone LIKE '%(+33)689%';# Polynésie
UPDATE tb_coel.coel_personne SET cp_truk_telephone = REPLACE(cp_truk_telephone, '(+33)(687)', '(+687)') WHERE cp_truk_telephone LIKE '%(+33)(687)%';# Nouvelle-Calédonie
UPDATE tb_coel.coel_personne SET cp_truk_telephone = REPLACE(cp_truk_telephone, '(+33)594', '(+594)0594') WHERE cp_truk_telephone LIKE '%(+33)594%';# Guyanne
UPDATE tb_coel.coel_personne SET cp_truk_telephone = REPLACE(cp_truk_telephone, '(+33)(590)(0)590', '(+590)0590') WHERE cp_truk_telephone LIKE '%(+33)(590)(0)590%';# Guadeloupe
UPDATE tb_coel.coel_personne SET cp_truk_telephone = REPLACE(cp_truk_telephone, '(+33)(0)', '(+33)0') WHERE cp_truk_telephone LIKE '%(+33)(0)%';
UPDATE tb_coel.coel_personne SET cp_truk_telephone = REPLACE(cp_truk_telephone, ';;0', ';; (+33)0') WHERE cp_truk_telephone LIKE '%;;0%';
UPDATE tb_coel.coel_personne SET cp_truk_telephone = IF( cp_truk_telephone LIKE '(+33)06%', CONCAT('GSM##', cp_truk_telephone), CONCAT('FIX##', cp_truk_telephone)) WHERE cp_truk_telephone LIKE '(+33)__%';
UPDATE tb_coel.coel_personne SET cp_truk_telephone = IF(cp_truk_telephone LIKE '%;; (+33)06%', REPLACE(cp_truk_telephone, ';; (+33)', ';;GSM##(+33)'), REPLACE(cp_truk_telephone, ';; (+33)', ';;FIX##(+33)')) WHERE cp_truk_telephone LIKE '%;;%';
 
ALTER TABLE tb_coel.coel_personne ORDER BY cp_id_personne;
 
#------------------------------------------------------------------------------------------------------------------------
# HERBIERS_ont_un_staff vers coel_structure_a_personne
# ATTENTION : Nous ignorons les liaisons qui n ont pas de correspondance dans la table HERBIER_STAFF
INSERT INTO tb_coel.coel_structure_a_personne
(csap_id_structure, csap_id_personne, csap_id_role, csap_mark_contact, csap_ce_truk_fonction, csap_ce_meta)
SELECT ID_ORG, 100000+hous.ID_STAFF, '2027', IF(LOWER(CONTACT) = 'oui', 1, 0) AS CONTACT, IF(FONCTION != '', CONCAT('AUTRE##', CONVERT(FONCTION USING utf8)), NULL) AS FONCTION, @idm := @idm+1
FROM tb_herbiers.HERBIERS_STAFF AS hs LEFT JOIN tb_herbiers.HERBIERS_ont_un_staff AS hous ON (hous.ID_STAFF = hs.ID_STAFF)
WHERE hous.ID_ORG != 0
ORDER BY hous.ID_ORG, hous.ID_STAFF ASC;
INSERT INTO tb_coel.coel_meta_historique_ligne
(cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement,
cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
SELECT @idm_tmp := @idm_tmp+1, '121', CONCAT(ID_ORG, '-', 100000+hous.ID_STAFF, '-2027'), NULL,
NOW(), CONCAT('Importation de la personne #',100000+hous.ID_STAFF,' de la structure #', ID_ORG,' de la table HERBIERS_ont_un_staff.'), '1', '1', '162.38.234.1'
FROM tb_herbiers.HERBIERS_STAFF AS hs LEFT JOIN tb_herbiers.HERBIERS_ont_un_staff AS hous ON (hous.ID_STAFF = hs.ID_STAFF)
WHERE hous.ID_ORG != 0
ORDER BY hous.ID_ORG, hous.ID_STAFF ASC;
UPDATE tb_coel.coel_structure_a_personne
SET csap_ce_truk_fonction = IF(csap_ce_truk_fonction IS NOT NULL, IF(csap_ce_truk_fonction LIKE '%irecteur%', '2028',
IF(csap_ce_truk_fonction LIKE '%onservateur%', '2029', IF(csap_ce_truk_fonction LIKE '%echnicien%', '2030', csap_ce_truk_fonction))), NULL)
WHERE csap_id_role = '2027' ;
#------------------------------------------------------------------------------------------------------------------------
#HERBIER_COLLECTION vers coel_collection
INSERT INTO tb_coel.coel_collection
(cc_id_collection, cc_ce_projet, cc_ce_structure, cc_guid, cc_truk_code, cc_nom, cc_description,
cc_ce_type_depot,
cc_description_specialiste, cc_truk_url,
cc_ce_type,
cc_ce_specimen_type,
cc_truk_preservation,
cc_ce_meta)
SELECT hc.ID, '2', PARENT_ID, CONCAT("urn:lsid:tela-botanica.org:ihf:col",hc.ID) AS GUID, COLLECTION_CODE, CONVERT(NOM_COLLECTION USING utf8), CONVERT(DESCRIPTION USING utf8),
IF(STATUT = 1, '2159', IF(STATUT = 2, '2160', IF(STATUT = 3, '2161', IF(STATUT = 4, '2162', NULL)))),
CONCAT(IF(DOC_STATE = '', '', IF(DOC_STATE IS NULL, '', CONCAT('Etat documentation : \n', CONVERT(DOC_STATE USING utf8)))),IF(COLLECTEURS = '', '', IF(COLLECTEURS IS NULL, '', CONCAT('\nCollecteurs : \n', CONVERT(COLLECTEURS USING utf8))))) AS DESCRIPTION_SPECIALISTE, IF(URL = '', NULL, URL) AS URL,
'2157',
IF(INCLUDED_TYPE = '0', '2239', IF (INCLUDED_TYPE = '1', '2242', IF (INCLUDED_TYPE = '2', '2241', NULL))) AS INCLUDED_TYPE,
CAST(GROUP_CONCAT(DISTINCT CASE ID_PRES WHEN '1' THEN '2204' WHEN '2' THEN '2222' WHEN '3' THEN '2215' WHEN '4' THEN '2203' WHEN '5' THEN '2211' WHEN '6' THEN '2223' WHEN '7' THEN '2207' WHEN '8' THEN '2209' WHEN '9' THEN '2224' WHEN '10' THEN '2218' WHEN '12' THEN '2212' WHEN '13' THEN 'AUTRE##non précisé' ELSE ID_PRES END SEPARATOR ";;") AS CHAR) AS PRESENTATION,
@idm := @idm+1
FROM tb_herbiers.HERBIERS_COLLECTION AS hc LEFT JOIN tb_herbiers.HERBIERS_ont_pres AS hop ON (hc.ID = hop.ID)
WHERE hc.ID != 4
GROUP BY hc.ID
ORDER BY hc.ID ASC;
INSERT INTO tb_coel.coel_meta_historique_ligne
(cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement,
cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat, cmhl_ip)
SELECT @idm_tmp := @idm_tmp+1, '101', ID, NULL,
IF(DATE_DERNIERE_MODIF != '0000-00-00 00:00:00', DATE_DERNIERE_MODIF, NOW()) , CONCAT('Ajout de la collection #',ID,' de la table HERBIER_COLLECTION.'), IF(CE_MODIFIER_PAR != '0', CE_MODIFIER_PAR, '1'), '1', IF(CE_MODIFIER_PAR != '0', NULL, '162.38.234.1')
FROM tb_herbiers.HERBIERS_COLLECTION
WHERE ID != 4
ORDER BY ID ASC;
#------------------------------------------------------------------------------------------------------------------------
#HERBIER_COLLECTION vers coel_collection_botanique
INSERT INTO tb_coel.coel_collection_botanique
(ccb_id_collection, ccb_truk_unite_base,
ccb_recolte_date_debut, ccb_ce_recolte_date_debut_type, ccb_recolte_date_fin, ccb_ce_recolte_date_fin_type,
ccb_inventaire_info,
ccb_ce_classement_etat,
ccb_truk_degradation_specimen,
ccb_truk_degradation_presentation,
ccb_annotation_classement,
ccb_ce_meta)
SELECT ID, CONCAT('2270##0||||||',NUM_SPECIMENS,'||', IF(PREC_SPECIMENS = '1', 'E', IF(PREC_SPECIMENS = '2', 'A', IF(PREC_SPECIMENS = '3', 'A', 'NULL'))), '||', NUM_SPECIES, '||', IF(PREC_SPECIES = '1', 'E', IF(PREC_SPECIES = '2', 'A', IF(PREC_SPECIES = '3', 'A', 'NULL')))),
DATE_DEBUT, IF(DATE_DEBUT_CARAC = '1', '2316', IF (DATE_DEBUT_CARAC = '2', '2317', IF (DATE_DEBUT_CARAC = '3', '2318', IF(DATE_DEBUT_CARAC = '4', '2319', IF (DATE_DEBUT_CARAC = '5', '2320', NULL))))),
DATE_FIN, IF( DATE_FIN_CARAC = '1', '2321', IF (DATE_FIN_CARAC = '2', '2322', IF(DATE_FIN_CARAC = '3', '2323', IF (DATE_FIN_CARAC = '4', '2325', IF(DATE_FIN_CARAC = '5', '2324', IF (DATE_FIN_CARAC = '6', '2326', NULL)))))),
CONCAT('Pourcentage de la documentation en base de données : ',PERCENT_DATABASED,'%'),
IF(ETAT_CLASSEMENT = 1, '2328', IF(ETAT_CLASSEMENT = 2, '2329', IF(ETAT_CLASSEMENT = 3, '2330', IF(ETAT_CLASSEMENT = 4, '2331', NULL)))),
CONCAT('Diverses##',IF(ETAT_SPECIMENS = 1, '30748', IF(ETAT_SPECIMENS = 2, '30749', IF(ETAT_SPECIMENS = 3, '30751', IF(ETAT_SPECIMENS = 4, '30752', NULL))))),
CONCAT('Diverses##',IF(ETAT_PRESENTATION = 1, '30748', IF(ETAT_PRESENTATION = 2, '30749', IF(ETAT_PRESENTATION = 3, '30751', IF(ETAT_PRESENTATION = 4, '30752', NULL))))),
IF(MODE_CLASSEMENT IS NOT NULL, IF(MODE_CLASSEMENT != '', CONVERT(MODE_CLASSEMENT USING utf8), NULL), NULL),
@idm := @idm+1
FROM tb_herbiers.HERBIERS_COLLECTION
WHERE ID != 4
ORDER BY ID ASC;
INSERT INTO tb_coel.coel_meta_historique_ligne
(cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement,
cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat, cmhl_ip)
SELECT @idm_tmp := @idm_tmp+1, '106', ID, NULL,
IF(DATE_DERNIERE_MODIF != '0000-00-00 00:00:00', DATE_DERNIERE_MODIF, NOW()) , CONCAT('Ajout de la collection #',ID,' de la table HERBIER_COLLECTION.'), IF(CE_MODIFIER_PAR != '0', CE_MODIFIER_PAR, '1'), '1', IF(CE_MODIFIER_PAR != '0', NULL, '162.38.234.1')
FROM tb_herbiers.HERBIERS_COLLECTION
WHERE ID != 4
ORDER BY ID ASC;
#------------------------------------------------------------------------------------------------------------------------
#HERBIERS_INDIC vers coel_commentaires
INSERT INTO tb_coel.coel_commentaire
(ccm_id_commentaire, ccm_ce_projet, ccm_titre,
ccm_texte, ccm_ponderation, ccm_ce_meta)
SELECT ID_INDIC, '2', IF(REM_INDIC IS NOT NULL, IF(REM_INDIC != '', CONVERT(REM_INDIC USING utf8), CONCAT(SUBSTRING(REPLACE(REPLACE(CONVERT(TXT_INDIC USING utf8),'<i>',''),'</i>',''), 1, 50),'...')), CONCAT(SUBSTRING(REPLACE(REPLACE(CONVERT(TXT_INDIC USING utf8),'<i>',''),'</i>',''), 1, 50),'...')) AS TITRE,
CONVERT(TXT_INDIC USING utf8), 0, @idm := @idm+1
FROM tb_herbiers.HERBIERS_INDIC
ORDER BY ID_INDIC ASC;
INSERT INTO tb_coel.coel_meta_historique_ligne
(cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement,
cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat, cmhl_ip)
SELECT @idm_tmp := @idm_tmp+1, '107', hi.ID_INDIC, NULL,
FROM_UNIXTIME(MAX(MAJ_INDIC)) , CONCAT('Ajout du commentaire #',hi.ID_INDIC,' de la table HERBIER_INDIC.'), IF(ID_INDICATEUR != '0', ID_INDICATEUR, '1'), '1', IF(ID_INDICATEUR != '0', NULL, '162.38.234.1')
FROM tb_herbiers.HERBIERS_INDIC AS hi LEFT JOIN tb_herbiers.HERBIERS_INDIC_HISTORIQUE AS hih ON (hi.ID_INDIC = hih.ID_INDIC)
GROUP BY hi.ID_INDIC
ORDER BY hi.ID_INDIC ASC;
#------------------------------------------------------------------------------------------------------------------------
# HERBIERS_A_UN_TYPE vers coel_collection_a_commentaire
INSERT INTO tb_coel.coel_collection_a_commentaire
(ccac_id_collection, ccac_id_commentaire,
ccac_truk_type,
ccac_ce_meta)
SELECT hi.ID_INDIC, ID,
CAST(GROUP_CONCAT(DISTINCT CASE ID_TYPE WHEN '1' THEN '2368' WHEN '2' THEN '2369' WHEN '3' THEN '2370' WHEN '4' THEN '2371' WHEN '5' THEN '2372' WHEN '6' THEN '2373' ELSE NULL END SEPARATOR ";;") AS CHAR) AS TYPE,
@idm := @idm+1
FROM tb_herbiers.HERBIERS_INDIC AS hi LEFT JOIN tb_herbiers.HERBIERS_A_UN_TYPE AS haut ON (hi.ID_INDIC = haut.ID_INDIC)
WHERE ID IN (SELECT ccm_id_commentaire FROM tb_coel.coel_commentaire)
GROUP BY hi.ID_INDIC
ORDER BY hi.ID_INDIC ASC;
# ATTENTION : ajoute moins de valeurs à @
INSERT INTO tb_coel.coel_meta_historique_ligne
(cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement,
cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat, cmhl_ip)
SELECT @idm_tmp := @idm_tmp+1, '102', CONCAT(hi.ID_INDIC,'-',ID), NULL,
FROM_UNIXTIME(MAX(MAJ_INDIC)) , CONCAT('Ajout des types du commentaire #',hi.ID_INDIC,' de la table HERBIERS_A_UN_TYPE.'), IF(ID_INDICATEUR != '0', ID_INDICATEUR, '1'), '1', IF(ID_INDICATEUR != '0', NULL, '162.38.234.1')
FROM tb_herbiers.HERBIERS_INDIC AS hi LEFT JOIN tb_herbiers.HERBIERS_A_UN_TYPE AS haut ON (hi.ID_INDIC = haut.ID_INDIC) LEFT JOIN tb_herbiers.HERBIERS_INDIC_HISTORIQUE AS hih ON (hi.ID_INDIC = hih.ID_INDIC)
WHERE ID IN (SELECT ccm_id_commentaire FROM tb_coel.coel_commentaire)
GROUP BY hi.ID_INDIC
ORDER BY hi.ID_INDIC ASC;
 
# Mise à jour des id de personne inexistant dans l''annuaire Tela dans la table : coel_meta_historique_ligne
# Récupération manuelle...
INSERT INTO tb_coel.coel_personne
(cp_id_personne, cp_ce_projet, cp_fmt_nom_complet, cp_prenom, cp_nom, cp_description, cp_ce_annuaire_tela, cp_ce_meta)
VALUES (19, 3, 'Inconnu #19', 'Inconnu', 'INCONNU', 'Individu non présent dans l''annuaire Tela Botanica.', 19, @idm := @idm+1),
(920, 3, 'Inconnu #920', 'Inconnu', 'INCONNU', 'Individu non présent dans l''annuaire Tela Botanica.', 920, @idm := @idm+1);
INSERT INTO tb_coel.coel_meta_historique_ligne
(cmhl_id_historique_ligne, cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification,
cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@idm_tmp := @idm_tmp+1, '113', 19, NULL, NOW(), 'Création de l''utilisateur inconnu #19 non présent la table annuaire_tela.', '1', '1', '162.38.234.1'),
(@idm_tmp := @idm_tmp+1, '113', 920, NULL, NOW(), 'Création de l''utilisateur inconnu #920 non présent la table annuaire_tela.', '1', '1', '162.38.234.1');
/tags/v1.11-okuzgozu/doc/bdd/archives/maj_v1.0.9_a_v1.1.sql
New file
0,0 → 1,4
#+--------------------------------------------------------------------------------------------------------------------+#
# Modification d''une table pour gérer l''ordre des auteurs des publications
ALTER TABLE `coel_publication_a_personne` ADD `cpuap_ordre` INT NULL
COMMENT 'Numéro d''ordre de la personne pour le rôle indiqué.' AFTER `cpuap_ce_truk_type` ;
/tags/v1.11-okuzgozu/doc/bdd/archives/maj_v1.0.6_a_v1.0.7.sql
New file
0,0 → 1,249
SET @id_table_cmlv = '112';
SET @id_admin = '1';
SET @ip_admin = '162.38.234.1';
SET @id_meta = '';
SET @enrg = '';
#+--------------------------------------------------------------------------------------------------------------------+#
# AJOUT
SET @id_etat_modif = '1';
 
# Ajout d''une valeur à la liste 58
SET @notes = 'Initialisation de la valeur «4» pour la liste «58».';
 
SET @id_valeur = '30762';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
INSERT INTO tb_coel.coel_meta_liste_valeur (cmlv_id_valeur, cmlv_ce_parent, cmlv_ce_projet, cmlv_nom, cmlv_abreviation, cmlv_description, cmlv_ce_meta)
VALUES ( @id_valeur, '1061', '1', 'Dactylographié', '4', NULL, @id_meta );
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', IF(cmlv_description IS NOT NULL, cmlv_description, ''), '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
#+--------------------------------------------------------------------------------------------------------------------+#
# MODIFICATION
SET @id_etat_modif = '2';
 
# Mise à jour des abréviations de la liste 27 id 1030
SET @notes = 'Remplacement de l''abréviation numérique par un code.';
 
SET @id_valeur = '2134';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'CT',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2135';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'AU',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2136';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'CO',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2137';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'DE',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2138';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_abreviation = 'HE',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
 
#Correction bogue FS#535 - [Collection] - Fautes de frappes
SET @notes = 'Correction syntaxe du nom.';
 
SET @id_valeur = '2295';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_nom = 'Papier adhésif type scotch',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2247';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_nom = 'Gymnospermes (Conifère)',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
SET @id_valeur = '2248';
INSERT INTO tb_coel.coel_meta_historique_ligne (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_notes, cmhl_ce_modifier_par, cmhl_ce_etat ,cmhl_ip)
VALUES (@id_table_cmlv, @id_valeur, NULL , NOW( ) , @notes, @id_admin, @id_etat_modif, @ip_admin);
SELECT @id_meta := cmhl_id_historique_ligne, cmhl_date_modification FROM tb_coel.coel_meta_historique_ligne WHERE cmhl_ce_table = CONVERT(@id_table_cmlv USING utf8) AND cmhl_cle_ligne = CONVERT(@id_valeur USING utf8) ORDER BY cmhl_date_modification DESC LIMIT 1;
UPDATE tb_coel.coel_meta_liste_valeur SET
cmlv_nom = 'Angiospermes (plantes à fleur)',
cmlv_ce_meta = @id_meta
WHERE cmlv_id_valeur = @id_valeur;
SELECT @enrg := CONCAT('<?xml version="1.0" encoding="UTF-8" ?>\n<resultset>\n',
'<row>\n',
'<cmlv_id_valeur>', cmlv_id_valeur, '</cmlv_id_valeur>\n',
'<cmlv_ce_parent>', cmlv_ce_parent, '</cmlv_ce_parent>\n',
'<cmlv_ce_projet>', cmlv_ce_projet, '</cmlv_ce_projet>\n',
'<cmlv_nom>', cmlv_nom, '</cmlv_nom>\n',
'<cmlv_abreviation>', cmlv_abreviation, '</cmlv_abreviation>\n',
'<cmlv_description>', cmlv_description, '</cmlv_description>\n',
'<cmlv_ce_meta>', cmlv_ce_meta, '</cmlv_ce_meta>\n',
'</row>\n',
'</resultset>') AS xmldoc
FROM tb_coel.coel_meta_liste_valeur
WHERE cmlv_id_valeur = @id_valeur;
UPDATE tb_coel.coel_meta_historique_ligne SET
cmhl_enregistrement = @enrg
WHERE cmhl_id_historique_ligne = @id_meta;
 
# Correction bogue FS#645 - [BD] Nettoyage de CollectionACommentaire
DELETE FROM tb_coel.coel_collection_a_commentaire
WHERE ccac_id_collection NOT IN (SELECT cc_id_collection FROM tb_coel.coel_collection);
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_projet_version.html
New file
0,0 → 1,205
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Projet - coel_projet_version</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Projet.html">Projet</a> > coel_projet_version</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_projet_version</h1>
<h2> Description générale </h2>
<p>
Table contenant les informations sur la version d'un projet.<br />INFO : cprv_nom
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cprv_id_version" class="pair" >
<td> 1 </td>
<td> cprv_id_version </td>
<td> cprv_id_v </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� primaire </td>
<td> oui </td>
<td> Identifiant d'une version de projet. </td>
</tr>
<tr id="cprv_ce_projet" class="pair" >
<td> 2 </td>
<td> cprv_ce_projet </td>
<td> cprv_ce_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du projet de la version. </td>
</tr>
<tr id="cprv_nom" class="pair" >
<td> 3 </td>
<td> cprv_nom </td>
<td> cprv_n </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nom éventuel de la version. </td>
</tr>
<tr id="cprv_code" class="pair" >
<td> 4 </td>
<td> cprv_code </td>
<td> cprv_c </td>
<td> VARCHAR(25) </td>
<td> oui </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Numéro ou code de la version. </td>
</tr>
<tr id="cprv_date_debut" class="pair" >
<td> 5 </td>
<td> cprv_date_debut </td>
<td> cprv_dd </td>
<td> DATETIME </td>
<td> oui </td>
<td> 0000-00-00 00:00:00 </td>
<td> standard </td>
<td> non </td>
<td> Date de début de la version. </td>
</tr>
<tr id="cprv_date_fin" class="pair" >
<td> 6 </td>
<td> cprv_date_fin </td>
<td> cprv_df </td>
<td> DATETIME </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Date de fin de la version. </td>
</tr>
<tr id="cprv_ce_meta" class="pair" >
<td> 7 </td>
<td> cprv_ce_meta </td>
<td> cprv_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cpr_cprv </td>
<td> cprv_ce_projet </td>
<td> cpr_id_projet </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cmhl_cprv_meta </td>
<td> cprv_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_projet_version">
discussion sur la table coel_projet_version
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/maj_supression_projet_22_01_2014.sql
New file
0,0 → 1,25
# Mise à jour des guids
 
#table collection
UPDATE coel_collection SET cc_guid = REPLACE(cc_guid, ":Herbiers LR", "");
UPDATE coel_collection SET cc_guid = REPLACE(cc_guid, ":ihf", "");
UPDATE coel_collection SET cc_guid = REPLACE(cc_guid, "::", ":");
 
#table structure
UPDATE coel_structure SET cs_guid = REPLACE(cs_guid, ":Herbiers LR", "");
UPDATE coel_structure SET cs_guid = REPLACE(cs_guid, ":ihf", "");
UPDATE coel_structure SET cs_guid = REPLACE(cs_guid, "::", ":");
 
#suppression des tables et colonnes projets
DROP TABLE `coel_projet`;
DROP TABLE `coel_projet_a_structure`;
DROP TABLE `coel_projet_version`;
 
ALTER TABLE `coel_collection` DROP `cc_ce_projet`;
ALTER TABLE `coel_commentaire` DROP `ccm_ce_projet`;
ALTER TABLE `coel_meta_colonne` DROP `cmc_ce_projet`;
ALTER TABLE `coel_meta_liste_valeur` DROP `cmlv_ce_projet`;
ALTER TABLE `coel_personne` DROP `cp_ce_projet`;
ALTER TABLE `coel_personne_a_relation` DROP `cpar_id_projet`;
ALTER TABLE `coel_publication` DROP `cpu_ce_projet`;
ALTER TABLE `coel_structure` DROP `cs_ce_projet`;
/tags/v1.11-okuzgozu/doc/bdd/archives/coel.sh
New file
0,0 → 1,54
#!/bin/bash
###############################################################################
# But : Met à jour la base de données Coel.
# Auteur : Jean-Pascal Milcent <jpm@tela-botanica.org> (translate bat file to shell script)
# License : GPL v3
# Création : 01 octobre 2009
# Version: 0.1
# $Id$
###############################################################################
# Constante
NBREPARAM=$#
 
# Aide
E_OPTERR=65
if [ "$1" = '--help' ]
then # Le script a besoin d'au moins un argument sur la ligne de commande
echo "Usage $0 -[parameters -u, -p]"
echo "Paramétres obligatoires : "
echo " -u: indiquer le nom de l'utilisateur mysql"
echo " -p: indiquer le mot de passe de l'utilisateur mysql (utiliser les guillemets \"\" pour un mot de passe vide)"
exit $E_OPTERR
fi
 
# Récupération des paramètres et des options de la ligne de commande
TEMP=`getopt -o u:p:h: -l help: -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$TEMP"
while [ ! -z "$1" ] ; do
#echo $1" # "$2
case "$1" in
-h) HOST=$2;;
-u) MYSQL_USER=$2;;
-p) MYSQL_PASSWD=$2;;
--) shift ; break ;;
*) echo "Internal error!" ; exit 1 ;;
esac
shift 2
done
# Vérifions que nous avions bien le mot de passe et l'utilisateur mysql
if [ $NBREPARAM -ne 4 ]; then
echo "Paramètres requis, utiliser la commande pour voir lesquels : coel.sh --help."
else
# Nous devons être dans le dossier de ce script pour que tout fonctionne
echo "Vérifions que le fichier sql de l'application Coel existe : ";
if [ -f $PWD/coel.sql.bz2 ]; then
echo "OK";
echo "Mise à jour de la bdd COEL dans Mysql :";
bunzip2 $PWD/coel.sql.bz2
/opt/lampp/bin/mysql -u $MYSQL_USER -p$MYSQL_PASSWD --default-character-set=utf8 --database=tb_coel < $PWD/coel.sql
bzip2 -q $PWD/coel.sql
else
echo "Le fichier coel.sql.bz2 n'existe pas. Veuillez mettre à jour votre dépôt SVN et relancer ce script."
fi
fi
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
Added: svn:executable
+*
\ No newline at end of property
/tags/v1.11-okuzgozu/doc/bdd/archives/maj_role_publication_03_06_2014.sql
New file
0,0 → 1,6
# Ajout du role d'expert dans les relations entre personne et publication
INSERT INTO `coel_meta_liste_valeur` (`cmlv_ce_parent`, `cmlv_nom`, `cmlv_abreviation`, `cmlv_description`, `cmlv_ce_meta`) VALUES
(1030, 'Expert (Celui qui a expertisé la collection)', 'EX', NULL, 0);
 
# Ajout du role de la publication dans les relations entre collection et publication
ALTER TABLE `coel_collection_a_publication` ADD `ccapu_source` TINYINT(11) NOT NULL ;
/tags/v1.11-okuzgozu/doc/bdd/archives/maj_suppression_colonnes_25_04_2014.sql
New file
0,0 → 1,20
# Modification de la valeur du terme "voucher" afin de le rendre plus compréhensible
UPDATE coel_meta_liste_valeur SET cmlv_nom = "Voucher (échantillon témoin)" WHERE cmlv_id_valeur = 2184;
 
# Fusion des champs complément adresse et région dans les tables personnes et institutions
UPDATE coel_personne SET cp_adresse_01 = CONCAT(cp_adresse_01, ' ', cp_adresse_02);
UPDATE coel_structure SET cs_adresse_01 = CONCAT(cs_adresse_01, ' ', cs_adresse_02);
 
# Supression des colonnes complément adresse et région dans les tables personnes et institutions
ALTER TABLE coel_personne DROP COLUMN cp_adresse_02;
ALTER TABLE coel_personne DROP COLUMN cp_ce_truk_region;
ALTER TABLE coel_structure DROP COLUMN cs_adresse_02;
ALTER TABLE coel_structure DROP COLUMN cs_ce_truk_region;
 
# Supression de diverses colonnes dans la table collection
ALTER TABLE coel_collection DROP COLUMN cc_truk_identifiant_alternatif;
ALTER TABLE coel_collection DROP COLUMN cc_description_specialiste;
ALTER TABLE coel_collection DROP COLUMN cc_truk_groupement_principe;
ALTER TABLE coel_collection DROP COLUMN cc_truk_groupement_but;
 
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_meta_historique_ligne.html
New file
0,0 → 1,413
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Métadonnée - coel_meta_historique_ligne</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Metadonnee.html">Métadonnée</a> > coel_meta_historique_ligne</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_meta_historique_ligne</h1>
<h2> Description générale </h2>
<p>
Contient les métadonnées sur l'historique des enregistrements des tables de la base de données.<br />INFO : cmhl_date_modification
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cmhl_id_historique_ligne" class="pair" >
<td> 1 </td>
<td> cmhl_id_historique_ligne </td>
<td> cmhl_id_hl </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� primaire </td>
<td> oui </td>
<td> Identifiant de l'historique des lignes. </td>
</tr>
<tr id="cmhl_ce_table" class="pair" >
<td> 2 </td>
<td> cmhl_ce_table </td>
<td> cmhl_ce_t </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant de la table. </td>
</tr>
<tr id="cmhl_cle_ligne" class="pair" >
<td> 3 </td>
<td> cmhl_cle_ligne </td>
<td> cmhl_cl </td>
<td> VARCHAR(64) </td>
<td> oui </td>
<td> </td>
<td> standard </td>
<td> oui </td>
<td> Identifiant de la ligne. Pour les tables à clé primaire multi colonnes, bien respecter l'ordre des champs de la clé et inscrire chaque valeur de clé séparée par un tiret "-". </td>
</tr>
<tr id="cmhl_enregistrement" class="pair" >
<td> 4 </td>
<td> cmhl_enregistrement </td>
<td> cmhl_e </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Contient les données au format XML pour les enregistrements supprimés uniquement, sinon possède la valeur NULL. Format XML : \kxml encoding="UTF-8\g\kligne\g\knom_du_champ_01\gvaleur_du_champ_01\k/nom_du_champ_01\g\knom_du_champ_02\gvaleur_du_champ_02\k/nom_du_champ_02\g...\k/ligne\g\k/xml\g. </td>
</tr>
<tr id="cmhl_date_modification" class="pair" >
<td> 5 </td>
<td> cmhl_date_modification </td>
<td> cmhl_dm </td>
<td> DATETIME </td>
<td> oui </td>
<td> </td>
<td> standard </td>
<td> oui </td>
<td> Date de modification de la ligne. </td>
</tr>
<tr id="cmhl_notes" class="pair" >
<td> 6 </td>
<td> cmhl_notes </td>
<td> cmhl_n </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Notes sur la modification effectuée sur la ligne. </td>
</tr>
<tr id="cmhl_source" class="pair" >
<td> 7 </td>
<td> cmhl_source </td>
<td> cmhl_s </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Source des données de l'enregistrement, si le créateur/modificateur de l'enregistrement n'en est pas l'auteur. </td>
</tr>
<tr id="cmhl_ce_modifier_par" class="pair" >
<td> 8 </td>
<td> cmhl_ce_modifier_par </td>
<td> cmhl_ce_mp </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant de la personne ayant effectué cette modification sur la ligne. </td>
</tr>
<tr id="cmhl_ce_etat" class="pair" >
<td> 9 </td>
<td> cmhl_ce_etat </td>
<td> cmhl_ce_e </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant de l'état de la ligne. </td>
</tr>
<tr id="cmhl_ip" class="pair" >
<td> 10 </td>
<td> cmhl_ip </td>
<td> cmhl_i </td>
<td> VARCHAR(50) </td>
<td> oui </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Adresse IP depuis laquelle la modification a eu lieu. </td>
</tr>
<tr id="cmhl_session_id" class="pair" >
<td> 11 </td>
<td> cmhl_session_id </td>
<td> cmhl_si </td>
<td> VARCHAR(40) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Identifiant de session del 'utilisateur. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cp_cmhl_modifier_par </td>
<td> cmhl_ce_modifier_par </td>
<td> cp_id_personne </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cmhl_cmlv_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> cmlv_ce_meta </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cmhl_cmc_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> cmc_ce_meta </td>
<td> <a href="coel_table_coel_meta_colonne.html">coel_meta_colonne</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cmhl_cs </td>
<td> cmhl_id_historique_ligne </td>
<td> cs_ce_meta </td>
<td> <a href="coel_table_coel_structure.html">coel_structure</a> </td>
</tr>
<tr class="pair" >
<td> 5 </td>
<td> fk_cmhl_ccm_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> ccm_ce_meta </td>
<td> <a href="coel_table_coel_commentaire.html">coel_commentaire</a> </td>
</tr>
<tr class="pair" >
<td> 6 </td>
<td> fk_cmhl_ccac_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> ccac_ce_meta </td>
<td> <a href="coel_table_coel_collection_a_commentaire.html">coel_collection_a_commentaire</a> </td>
</tr>
<tr class="pair" >
<td> 7 </td>
<td> fk_cmhl_cp_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> cp_ce_meta </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 8 </td>
<td> fk_cmhl_cpar_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> cpar_ce_meta </td>
<td> <a href="coel_table_coel_personne_a_relation.html">coel_personne_a_relation</a> </td>
</tr>
<tr class="pair" >
<td> 9 </td>
<td> fk_cmhl_cpr_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> cpr_ce_meta </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 10 </td>
<td> fk_cmhl_cprv_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> cprv_ce_meta </td>
<td> <a href="coel_table_coel_projet_version.html">coel_projet_version</a> </td>
</tr>
<tr class="pair" >
<td> 11 </td>
<td> fk_cmlv_cmhl_val </td>
<td> cmhl_ce_etat </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 12 </td>
<td> fk_cmhl_csap_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> csap_ce_meta </td>
<td> <a href="coel_table_coel_structure_a_personne.html">coel_structure_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 13 </td>
<td> fk_cmhl_ccap_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> ccap_ce_meta </td>
<td> <a href="coel_table_coel_collection_a_personne.html">coel_collection_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 14 </td>
<td> fk_cmhl_cc_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> cc_ce_meta </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 15 </td>
<td> fk_cmhl_ccapu_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> ccapu_ce_meta </td>
<td> <a href="coel_table_coel_collection_a_publication.html">coel_collection_a_publication</a> </td>
</tr>
<tr class="pair" >
<td> 16 </td>
<td> fk_cmhl_cpu_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> cpu_ce_meta </td>
<td> <a href="coel_table_coel_publication.html">coel_publication</a> </td>
</tr>
<tr class="pair" >
<td> 17 </td>
<td> fk_cmhl_cpuap_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> cpuap_ce_meta </td>
<td> <a href="coel_table_coel_publication_a_personne.html">coel_publication_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 18 </td>
<td> fk_cmlv_cmhl_table </td>
<td> cmhl_ce_table </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 19 </td>
<td> fk_cmhl_cpras_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> cpras_ce_meta </td>
<td> <a href="coel_table_coel_projet_a_structure.html">coel_projet_a_structure</a> </td>
</tr>
<tr class="pair" >
<td> 20 </td>
<td> fk_cmhl_csc_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> csc_ce_meta </td>
<td> <a href="coel_table_coel_structure_conservation.html">coel_structure_conservation</a> </td>
</tr>
<tr class="pair" >
<td> 21 </td>
<td> fk_cmhl_csv_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> csv_ce_meta </td>
<td> <a href="coel_table_coel_structure_valorisation.html">coel_structure_valorisation</a> </td>
</tr>
<tr class="pair" >
<td> 22 </td>
<td> fk_cmhl_ccb_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> ccb_ce_meta </td>
<td> <a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_meta_historique_ligne">
discussion sur la table coel_meta_historique_ligne
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_publication_a_personne.html
New file
0,0 → 1,205
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Publication - coel_publication_a_personne</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Publication.html">Publication</a> > coel_publication_a_personne</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_publication_a_personne</h1>
<h2> Description générale </h2>
<p>
Permet de lister les publications d'une personne.
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cpuap_id_publication" class="pair" >
<td> 1 </td>
<td> cpuap_id_publication </td>
<td> cpuap_id_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant d'une publication. </td>
</tr>
<tr id="cpuap_id_personne" class="pair" >
<td> 2 </td>
<td> cpuap_id_personne </td>
<td> cpuap_id_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant d'une personne. </td>
</tr>
<tr id="cpuap_id_role" class="pair" >
<td> 3 </td>
<td> cpuap_id_role </td>
<td> cpuap_id_r </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Rôle de la personne vis à vis de la publication : contributeur, auteur... </td>
</tr>
<tr id="cpuap_ce_truk_type" class="pair" >
<td> 4 </td>
<td> cpuap_ce_truk_type </td>
<td> cpuap_ce_tt </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Contient le type de référence bibliographique : nécrologie, biographie, publication personnelle... </td>
</tr>
<tr id="cpuap_ce_meta" class="pair" >
<td> 5 </td>
<td> cpuap_ce_meta </td>
<td> cpuap_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cp_cpuap </td>
<td> cpuap_id_personne </td>
<td> cp_id_personne </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cpu_cpuap </td>
<td> cpuap_id_publication </td>
<td> cpu_id_publication </td>
<td> <a href="coel_table_coel_publication.html">coel_publication</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cmhl_cpuap_meta </td>
<td> cpuap_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cmlv_cpuap_type </td>
<td> cpuap_ce_truk_type </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 5 </td>
<td> fk_cmlv_cpuap_role </td>
<td> cpuap_id_role </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_publication_a_personne">
discussion sur la table coel_publication_a_personne
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_module_Personne.html
New file
0,0 → 1,91
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Personne</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > Personne</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<h1> Module Personne</h1>
<p id="miniature" >
<a href="images/modules/Personne.png" title="Voir cette image avec un zoom de 100%.">
<img src="images/miniatures/miniature_Personne.png" alt="Miniature du modèle du module Personne" />
</a>
</p>
<h2> Description générale </h2>
<p>
Module de gestion des Personnes.<br />
<br />
<b>Révision : </b>1159
</p>
<h2> Liste des tables </h2>
<ol class="type_01">
<li><a href="coel_table_coel_personne.html">coel_personne</a> : Contient les informations sur les personnes.<br />Par personne nous entendons à la fois les utilisateurs de l'application mais aussi les personnes contacts, les botanistes collecteurs, auteurs...<br />INFO : cp_fmt_nom_complet</li>
<li><a href="coel_table_coel_personne_a_relation.html">coel_personne_a_relation</a> : Relation entre deux personnes vis à vis d'un projet.</li>
</ol>
<h2> Dépot SVN </h2>
<p>
Voir la page concernant ce module sur le dépot SVN :
<a href="http://svn.tela-botanica.net/websvn/filedetails.php?repname=Applications.coel&path=%2Ftrunk%2Fdoc%2Fbdd%2Fcoel.xml">
coel.xml
</a>
</p>
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant ce module :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_Personne">
discussion sur le module Personne
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_personne_a_relation.html
New file
0,0 → 1,205
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Personne - coel_personne_a_relation</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Personne.html">Personne</a> > coel_personne_a_relation</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_personne_a_relation</h1>
<h2> Description générale </h2>
<p>
Relation entre deux personnes vis à vis d'un projet.
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cpar_id_personne_01" class="pair" >
<td> 1 </td>
<td> cpar_id_personne_01 </td>
<td> cpar_id_p0 </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant de la personne n\194\1761. </td>
</tr>
<tr id="cpar_id_personne_02" class="pair" >
<td> 2 </td>
<td> cpar_id_personne_02 </td>
<td> cpar_id_p0 </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant de la personne n\194\1762. </td>
</tr>
<tr id="cpar_id_projet" class="pair" >
<td> 3 </td>
<td> cpar_id_projet </td>
<td> cpar_id_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant du projet dans lequel la relation entre les deux personnes s'établie. </td>
</tr>
<tr id="cpar_id_role" class="pair" >
<td> 4 </td>
<td> cpar_id_role </td>
<td> cpar_id_r </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant du rôle ou de la valeur établie entre les deux personnes. </td>
</tr>
<tr id="cpar_ce_meta" class="pair" >
<td> 5 </td>
<td> cpar_ce_meta </td>
<td> cpar_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cpr_cpar </td>
<td> cpar_id_projet </td>
<td> cpr_id_projet </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cp_cpar_01 </td>
<td> cpar_id_personne_01 </td>
<td> cp_id_personne </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cp_cpar_02 </td>
<td> cpar_id_personne_02 </td>
<td> cp_id_personne </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cmhl_cpar_meta </td>
<td> cpar_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 5 </td>
<td> fk_cmlv_cpar_role </td>
<td> cpar_id_role </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_personne_a_relation">
discussion sur la table coel_personne_a_relation
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_module_Collection.html
New file
0,0 → 1,97
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Collection</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > Collection</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<h1> Module Collection</h1>
<p id="miniature" >
<a href="images/modules/Collection.png" title="Voir cette image avec un zoom de 100%.">
<img src="images/miniatures/miniature_Collection.png" alt="Miniature du modèle du module Collection" />
</a>
</p>
<h2> Description générale </h2>
<p>
Module de gestion des Collections.<br />
<br />
<b>Révision : </b>1159
</p>
<h2> Liste des tables </h2>
<ol class="type_01">
<li><a href="coel_table_coel_collection.html">coel_collection</a> : Contient les informations sur les collections.INFO : cc_nom<br /></li>
<li><a href="coel_table_coel_collection_a_commentaire.html">coel_collection_a_commentaire</a> : Permet de lister les commentaires / notes faits sur une collection.</li>
<li><a href="coel_table_coel_collection_a_personne.html">coel_collection_a_personne</a> : Permet de lister les personnes en rapport avec une collection.</li>
<li><a href="coel_table_coel_collection_a_publication.html">coel_collection_a_publication</a> : Permet de lister les publication liées à une collection.</li>
<li><a href="coel_table_coel_collection_botanique.html">coel_collection_botanique</a> : Toutes les informations spécialisées sur une collection de type : botanique</li>
</ol>
<h2> Dépot SVN </h2>
<p>
Voir la page concernant ce module sur le dépot SVN :
<a href="http://svn.tela-botanica.net/websvn/filedetails.php?repname=Applications.coel&path=%2Ftrunk%2Fdoc%2Fbdd%2Fcoel.xml">
coel.xml
</a>
</p>
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant ce module :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_Collection">
discussion sur le module Collection
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_collection_a_relation.html
New file
0,0 → 1,185
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Collection - coel_collection_a_relation</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Collection.html">Collection</a> > coel_collection_a_relation</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_collection_a_relation</h1>
<h2> Description générale </h2>
<p>
Permet de lister les relations entre collection autre que hiérarchique.
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="ccar_id_collection_01" class="pair" >
<td> 1 </td>
<td> ccar_id_collection_01 </td>
<td> ccar_id_c0 </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant de la collection n\194\1761. </td>
</tr>
<tr id="ccar_id_collection_02" class="pair" >
<td> 2 </td>
<td> ccar_id_collection_02 </td>
<td> ccar_id_c0 </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant de la collection n\194\1762. </td>
</tr>
<tr id="ccar_id_relation" class="pair" >
<td> 3 </td>
<td> ccar_id_relation </td>
<td> ccar_id_r </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Indentifiant du type de la relation. </td>
</tr>
<tr id="ccar_ce_meta" class="pair" >
<td> 4 </td>
<td> ccar_ce_meta </td>
<td> ccar_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cc_ccar_01 </td>
<td> ccar_id_collection_01 </td>
<td> cc_id_collection </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cc_ccar_02 </td>
<td> ccar_id_collection_02 </td>
<td> cc_id_collection </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cmhl_ccar_meta </td>
<td> ccar_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cmlv_ccar_relation </td>
<td> ccar_id_relation </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_collection_a_relation">
discussion sur la table coel_collection_a_relation
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 26 janvier 2010 11:43:27</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_structure_conservation.html
New file
0,0 → 1,393
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Structure - coel_structure_conservation</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Structure.html">Structure</a> > coel_structure_conservation</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_structure_conservation</h1>
<h2> Description générale </h2>
<p>
Toutes les données spécifiques à la conservation au sein d'une structure.
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="csc_id_structure" class="pair" >
<td> 1 </td>
<td> csc_id_structure </td>
<td> csc_id_s </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant de la structure. </td>
</tr>
<tr id="csc_mark_formation" class="pair" >
<td> 2 </td>
<td> csc_mark_formation </td>
<td> csc_mf </td>
<td> BOOL </td>
<td> non </td>
<td> 0 </td>
<td> standard </td>
<td> non </td>
<td> Le personnel s'occupant des collections botaniques a-t-il suivi des formations en conservation ? </td>
</tr>
<tr id="csc_formation" class="pair" >
<td> 3 </td>
<td> csc_formation </td>
<td> csc_f </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Les formations en conservation suvi par le personnel. </td>
</tr>
<tr id="csc_mark_formation_interet" class="pair" >
<td> 4 </td>
<td> csc_mark_formation_interet </td>
<td> csc_mfi </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Le personnel s'occupant des collections botaniques a-t-il suivi des formations en conservation ? </td>
</tr>
<tr id="csc_truk_stockage_local" class="pair" >
<td> 5 </td>
<td> csc_truk_stockage_local </td>
<td> csc_tsl </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Avez-vous des locaux spécifiques de stockage des collections botaniques ? </td>
</tr>
<tr id="csc_truk_stockage_meuble" class="pair" >
<td> 6 </td>
<td> csc_truk_stockage_meuble </td>
<td> csc_tsm </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Avez-vous des meubles spécifiques au stockage des collections botaniques ? </td>
</tr>
<tr id="csc_truk_stockage_parametre" class="pair" >
<td> 7 </td>
<td> csc_truk_stockage_parametre </td>
<td> csc_tsp </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Quels paramètres maîtrisez-vous ? </td>
</tr>
<tr id="csc_mark_collection_commune" class="pair" >
<td> 8 </td>
<td> csc_mark_collection_commune </td>
<td> csc_mcc </td>
<td> BOOL </td>
<td> oui </td>
<td> 0 </td>
<td> standard </td>
<td> non </td>
<td> Les collections botaniques sont-elles conservées avec d'autres collections dans les mêmes locaux (problème de conservation en commun) ? </td>
</tr>
<tr id="csc_truk_collection_autre" class="pair" >
<td> 9 </td>
<td> csc_truk_collection_autre </td>
<td> csc_tca </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Actuellement, vos collections botaniques s'accroissent-elles de nouvelles acquisitions ? </td>
</tr>
<tr id="csc_mark_acces_controle" class="pair" >
<td> 10 </td>
<td> csc_mark_acces_controle </td>
<td> csc_mac </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> L'accès à vos collections botaniques est-il contrôlé (ex. : manipulation réservée à des personnes compétentes) ? </td>
</tr>
<tr id="csc_mark_restauration" class="pair" >
<td> 11 </td>
<td> csc_mark_restauration </td>
<td> csc_mr </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Effectuez-vous actuellement des opérations de restauration ou de remise en état de vos collections botaniques ? </td>
</tr>
<tr id="csc_truk_restauration_operation" class="pair" >
<td> 12 </td>
<td> csc_truk_restauration_operation </td>
<td> csc_tro </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Les différentes opérations de restauration actuellement menées. </td>
</tr>
<tr id="csc_ce_materiel_conservation" class="pair" >
<td> 13 </td>
<td> csc_ce_materiel_conservation </td>
<td> csc_ce_mc </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Utilisez-vous du matériel de conservation ? </td>
</tr>
<tr id="csc_truk_materiel_autre" class="pair" >
<td> 14 </td>
<td> csc_truk_materiel_autre </td>
<td> csc_tma </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Le matériel, dit de "non conservation" utilisé. </td>
</tr>
<tr id="csc_mark_traitement" class="pair" >
<td> 15 </td>
<td> csc_mark_traitement </td>
<td> csc_mt </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Réalisez-vous actuellement des traitements globaux contre les insectes ? </td>
</tr>
<tr id="csc_truk_traitement" class="pair" >
<td> 16 </td>
<td> csc_truk_traitement </td>
<td> csc_tt </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Traitements globaux contre les insectes. </td>
</tr>
<tr id="csc_mark_acquisition_collection" class="pair" >
<td> 17 </td>
<td> csc_mark_acquisition_collection </td>
<td> csc_mac </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Actuellement, vos collections botaniques s'accroissent-elles de nouvelles acquisitions ? </td>
</tr>
<tr id="csc_mark_acquisition_echantillon" class="pair" >
<td> 18 </td>
<td> csc_mark_acquisition_echantillon </td>
<td> csc_mae </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Actuellement mettez-vous en herbier de nouveaux échantillons ? </td>
</tr>
<tr id="csc_mark_acquisition_traitement" class="pair" >
<td> 19 </td>
<td> csc_mark_acquisition_traitement </td>
<td> csc_mat </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Si oui, faites-vous un traitement contre les insectes avant l'intégration dans vos collections ? </td>
</tr>
<tr id="csc_truk_acquisition_traitement_poison" class="pair" >
<td> 20 </td>
<td> csc_truk_acquisition_traitement_poison </td>
<td> csc_tatp </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Traitement de type empoisonnement effectué lors des des acquisitions. </td>
</tr>
<tr id="csc_truk_acquisition_traitement_insecte" class="pair" >
<td> 21 </td>
<td> csc_truk_acquisition_traitement_insecte </td>
<td> csc_tati </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Traitement de type désinctisation effectué lors des des acquisitions. </td>
</tr>
<tr id="csc_ce_meta" class="pair" >
<td> 22 </td>
<td> csc_ce_meta </td>
<td> csc_ce_m </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cs_csc </td>
<td> csc_id_structure </td>
<td> cs_id_structure </td>
<td> <a href="coel_table_coel_structure.html">coel_structure</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cmlv_csc_materiel_conservation </td>
<td> csc_ce_materiel_conservation </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cmhl_csc_meta </td>
<td> csc_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_structure_conservation">
discussion sur la table coel_structure_conservation
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_vocabulaire.ini
New file
0,0 → 1,137
; Encoding UTF-8
; ------------------------------------------------------#
; Référentiel nomenclatural
[referentiel]
source = /home/jpm/web/eflore/doc/bdd/v1.1/eflore_vocabulaire.csv
 
; ------------------------------------------------------#
; TABLES
; Id des tables doivent démarer à 101 (max = 899)
[tables]
coel_collection = 101
coel_collection_a_commentaire = 102
coel_collection_a_personne = 103
coel_collection_a_publication = 104
coel_collection_a_relation = 105
coel_collection_botanique = 106
coel_commentaire = 107
coel_meta_colonne = 108
coel_meta_donnee = 109
coel_meta_historique_ligne = 111
coel_meta_liste_valeur = 112
coel_personne = 113
coel_personne_a_relation = 114
coel_projet = 115
coel_projet_a_structure = 116
coel_projet_version = 117
coel_publication = 118
coel_publication_a_personne = 119
coel_structure = 120
coel_structure_a_personne = 121
coel_structure_conservation = 122
coel_structure_valorisation = 123
 
; ------------------------------------------------------#
; RÉFÉRENTIELS
[referentiels]
pays = 1074
zones_administratives_niveau_01 = 1078
zones_administratives_niveau_02 = 1079
niveau_importance = 1081
 
; ------------------------------------------------------#
; CORRESPONDANCES CHAMP/LISTE
 
[champs]
; Module METADONNÉES
; L'insertion de ces données se fera manuellement.
cmhl_ce_etat = 1001
cmc_ce_format_sql = 1002
cmc_ce_table = 1003
; Module PROJET
cpr_ce_langue = 1071
cpr_ce_indexation_duree = 1072
cpr_ce_indexation_freq = 1073
; Module PERSONNE
cp_ce_truk_prefix = 1004
cp_ce_truk_suffix = 1005
cp_truk_nom_autre = 1006
cp_ce_deces = 1080
cp_ce_sexe = 1067
cp_truk_telephone = 1007
cp_ce_truk_specialite = 1008
cp_ce_truk_role = 1009
cpar_id_role = 1010
; Module STRUCTURE
csap_id_role = 1011
csap_ce_truk_fonction = 1012
csap_ce_truk_statut = 1013
cs_ce_type = 1014
cs_ce_truk_type_prive = 1015
cs_ce_truk_type_public = 1016
cs_truk_identifiant_alternatif = 1017
cs_truk_url = 1066
csc_truk_local_stockage = 1018
csc_truk_local_meuble = 1019
csc_truk_stockage_parametre = 1020
csc_truk_collection_autre = 1021
csc_truk_restauration_operation = 1022
csc_ce_materiel_conservation = 1023
csc_truk_materiel_autre = 1024
csc_truk_traitement_insecte = 1025
csc_ce_truk_acquisition_traitement_poison = 1026
csc_truk_acquisition_traitement_insecte = 1025
csv_truk_action = 1027
csv_collection_autre = 1021
csv_truk_recherche_provenance = 1028
csv_truk_recherche_type = 1029
; Module COLLECTION
ccap_id_role = 1030
ccar_id_relation = 1031
cc_ce_type = 1032
cc_ce_type_depot = 1033
cc_truk_groupement_principe = 1034
cc_truk_groupement_but = 1035
cc_truk_conservation_statut = 1036
cc_truk_couverture_regne = 1037
cc_truk_preservation = 1038
cc_ce_developpement = 1039
cc_truk_periode_constitution = 1040
cc_ce_specimen_type = 1041
cc_ce_specimen_type_nbre_precision = 1082
cc_ce_specimen_type_classement = 1042
ccb_ce_truk_type = 1083
ccb_truk_nature = 1043
ccb_truk_unite_rangement = 1044
ccb_ce_unite_rangement_etat = 1045
ccb_truk_unite_base = 1046
ccb_truk_conservation_papier_type = 1047
ccb_truk_conservation_methode = 1048
ccb_truk_specimen_fixation_methode = 1049
ccb_truk_etiquette_fixation_support = 1049
ccb_truk_etiquette_fixation_specimen = 1050
ccb_truk_etiquette_ecriture = 1051
ccb_ce_traitement = 1041
ccb_truk_traitement_poison = 1026
ccb_truk_traitement_insecte = 1025
ccb_ce_etat_general = 1045
ccb_truk_degradation_specimen = 1052
ccb_truk_degradation_presentation = 1053
ccb_ce_determination = 1054
ccb_ce_recolte_date_debut_type = 1055
ccb_ce_recolte_date_fin_type = 1056
ccb_ce_classement_etat = 1057
ccb_truk_etiquette_renseignement = 1058
ccb_ce_precision_localité = 1059
ccb_ce_precision_date = 1059
ccb_ce_collection_integre = 1041
ccb_ce_collection_integre_info = 1060
ccb_ce_inventaire = 1041
ccb_ce_inventaire_auteur = 1041
ccb_ce_inventaire_forme = 1061
ccb_ce_truk_inventaire_digital = 1062
ccb_ce_inventaire_etat = 1063
ccac_truk_type = 1068
; Module PUBLICATION
cpuap_id_role = 1064
cpuap_ce_truk_type = 1065
Property changes:
Added: svn:mergeinfo
Merged /trunk/doc/bdd/coel_vocabulaire.ini:r1209-1382
Merged /branches/v1.1-aramon/doc/bdd/coel_vocabulaire.ini:r1383-1416
Added: svn:eol-style
+native
\ No newline at end of property
/tags/v1.11-okuzgozu/doc/bdd/archives/maj_v1.0.1_a_v1.0.2.sql
New file
0,0 → 1,4
# Suppression du champ ccb_inventaire_donnee_type qui fait doublon avec le champ ccb_inventaire_info.
ALTER TABLE `coel_collection_botanique` DROP `ccb_inventaire_donnee_type`;
# Changement de nom d''un champ
ALTER TABLE `coel_personne` CHANGE `cp_ce_annuaire_tela` `cp_ce_annuaire` INT( 11 ) NULL DEFAULT NULL COMMENT 'Identifiant de la personne dans un annuaire (par défaut celui de Tela Botanica).';
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_module_Projet.html
New file
0,0 → 1,93
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Projet</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > Projet</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<h1> Module Projet</h1>
<p id="miniature" >
<a href="images/modules/Projet.png" title="Voir cette image avec un zoom de 100%.">
<img src="images/miniatures/miniature_Projet.png" alt="Miniature du modèle du module Projet" />
</a>
</p>
<h2> Description générale </h2>
<p>
Module de gestion des Projets.<br />
<br />
<b>Révision : </b>1159
</p>
<h2> Liste des tables </h2>
<ol class="type_01">
<li><a href="coel_table_coel_projet.html">coel_projet</a> : Contient les informations sur un projet de données.<br />INFO : cpr_nom</li>
<li><a href="coel_table_coel_projet_a_structure.html">coel_projet_a_structure</a> : </li>
<li><a href="coel_table_coel_projet_version.html">coel_projet_version</a> : Table contenant les informations sur la version d'un projet.<br />INFO : cprv_nom</li>
</ol>
<h2> Dépot SVN </h2>
<p>
Voir la page concernant ce module sur le dépot SVN :
<a href="http://svn.tela-botanica.net/websvn/filedetails.php?repname=Applications.coel&path=%2Ftrunk%2Fdoc%2Fbdd%2Fcoel.xml">
coel.xml
</a>
</p>
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant ce module :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_Projet">
discussion sur le module Projet
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_structure.html
New file
0,0 → 1,525
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Structure - coel_structure</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Structure.html">Structure</a> > coel_structure</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_structure</h1>
<h2> Description générale </h2>
<p>
Contient les informations sur les structures.<br />INFO : cs_nom
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cs_id_structure" class="pair" >
<td> 1 </td>
<td> cs_id_structure </td>
<td> cs_id_s </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� primaire </td>
<td> oui </td>
<td> Identifiant de la structure. </td>
</tr>
<tr id="cs_ce_projet" class="pair" >
<td> 2 </td>
<td> cs_ce_projet </td>
<td> cs_ce_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> 0 </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du projet dans lequel les informations de la structure sont saisies. </td>
</tr>
<tr id="cs_ce_mere" class="pair" >
<td> 3 </td>
<td> cs_ce_mere </td>
<td> cs_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> 0 </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant de la structure mère. </td>
</tr>
<tr id="cs_guid" class="pair" >
<td> 4 </td>
<td> cs_guid </td>
<td> cs_g </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> URI (LSID ou URL) de la structure. Dans le format RDF, cela sera utilisé comme URI des données de l'institutions. </td>
</tr>
<tr id="cs_truk_identifiant_alternatif" class="pair" >
<td> 5 </td>
<td> cs_truk_identifiant_alternatif </td>
<td> cs_tia </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Identifiant alternatif. Par exemple, l'acronyme de l'Index Herbariorum ou du MNHN. Séparer les différentes valeurs par un point virgule ";" et le type d'identifiant de sa valeur par un dièze "#". Exemple : IH#MPU;MNHN#163 </td>
</tr>
<tr id="cs_nom" class="pair" >
<td> 6 </td>
<td> cs_nom </td>
<td> cs_n </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nom officiel de la structure dans sa langue d'origine. </td>
</tr>
<tr id="cs_truk_nom_alternatif" class="pair" >
<td> 7 </td>
<td> cs_truk_nom_alternatif </td>
<td> cs_tna </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Autres noms de la structures. Séparer les différentes valeurs par un point virgule ";". </td>
</tr>
<tr id="cs_description" class="pair" >
<td> 8 </td>
<td> cs_description </td>
<td> cs_d </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Description de la structure pour le public. </td>
</tr>
<tr id="cs_ce_type" class="pair" >
<td> 9 </td>
<td> cs_ce_type </td>
<td> cs_ce_t </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du type de la structure vis à vis du standard NCD. </td>
</tr>
<tr id="cs_ce_truk_type_prive" class="pair" >
<td> 10 </td>
<td> cs_ce_truk_type_prive </td>
<td> cs_ce_ttp </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Type privé de structure. </td>
</tr>
<tr id="cs_ce_truk_type_public" class="pair" >
<td> 11 </td>
<td> cs_ce_truk_type_public </td>
<td> cs_ce_ttp </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Type public de structure. </td>
</tr>
<tr id="cs_adresse_01" class="pair" >
<td> 12 </td>
<td> cs_adresse_01 </td>
<td> cs_a0 </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Adresse principale. </td>
</tr>
<tr id="cs_adresse_02" class="pair" >
<td> 13 </td>
<td> cs_adresse_02 </td>
<td> cs_a0 </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Complément d'adresse. </td>
</tr>
<tr id="cs_date_fondation" class="pair" >
<td> 14 </td>
<td> cs_date_fondation </td>
<td> cs_df </td>
<td> DATE </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Date de fondation de la structure. </td>
</tr>
<tr id="cs_code_postal" class="pair" >
<td> 15 </td>
<td> cs_code_postal </td>
<td> cs_cp </td>
<td> VARCHAR(16) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Code postal. </td>
</tr>
<tr id="cs_ville" class="pair" >
<td> 16 </td>
<td> cs_ville </td>
<td> cs_v </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Ville. </td>
</tr>
<tr id="cs_ce_truk_region" class="pair" >
<td> 17 </td>
<td> cs_ce_truk_region </td>
<td> cs_ce_tr </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du nom de la région (état, province) où est situé la structure. Utiliser les noms du standard ISO-3166-2. Sinon utiliser "AUTRE" pour stocker d'éventuel valeur non présente dans ISO-3166-2. </td>
</tr>
<tr id="cs_ce_truk_pays" class="pair" >
<td> 18 </td>
<td> cs_ce_truk_pays </td>
<td> cs_ce_tp </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du nom du pays de la structure. Utiliser les noms du standard ISO-3166-1. Sinon utiliser "AUTRE" pour stocker d'éventuel valeur non présente dans ISO-3166-1. </td>
</tr>
<tr id="cs_latitude" class="pair" >
<td> 19 </td>
<td> cs_latitude </td>
<td> cs_l </td>
<td> VARCHAR(15) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Latitude du local de la structure. </td>
</tr>
<tr id="cs_longitude" class="pair" >
<td> 20 </td>
<td> cs_longitude </td>
<td> cs_l </td>
<td> VARCHAR(15) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Longitude du local de la structure. </td>
</tr>
<tr id="cs_truk_telephone" class="pair" >
<td> 21 </td>
<td> cs_truk_telephone </td>
<td> cs_tt </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Téléphone(s) principaux de la structure (fixe, fax, portable...). </td>
</tr>
<tr id="cs_courriel" class="pair" >
<td> 22 </td>
<td> cs_courriel </td>
<td> cs_c </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Courriel principal de contact de l'organisation ex : accueil@organisation.org, pas de mail individuel. </td>
</tr>
<tr id="cs_truk_url" class="pair" >
<td> 23 </td>
<td> cs_truk_url </td>
<td> cs_tu </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> URL(s) du site web principal de la structure, du logo de la structure ou d'une page web particulière. </td>
</tr>
<tr id="cs_nbre_personne" class="pair" >
<td> 24 </td>
<td> cs_nbre_personne </td>
<td> cs_np </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nombre de personne présentent dans la structure. </td>
</tr>
<tr id="cs_condition_acces" class="pair" >
<td> 25 </td>
<td> cs_condition_acces </td>
<td> cs_ca </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Conditions d'accès à la structure. </td>
</tr>
<tr id="cs_condition_usage" class="pair" >
<td> 26 </td>
<td> cs_condition_usage </td>
<td> cs_cu </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Conditions d'usage générales des collections de la structure. </td>
</tr>
<tr id="cs_ce_meta" class="pair" >
<td> 27 </td>
<td> cs_ce_meta </td>
<td> cs_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cs_csap </td>
<td> cs_id_structure </td>
<td> csap_id_structure </td>
<td> <a href="coel_table_coel_structure_a_personne.html">coel_structure_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cs_cc </td>
<td> cs_id_structure </td>
<td> cc_ce_structure </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cs_csc </td>
<td> cs_id_structure </td>
<td> csc_id_structure </td>
<td> <a href="coel_table_coel_structure_conservation.html">coel_structure_conservation</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cs_csv </td>
<td> cs_id_structure </td>
<td> csv_id_structure </td>
<td> <a href="coel_table_coel_structure_valorisation.html">coel_structure_valorisation</a> </td>
</tr>
<tr class="pair" >
<td> 5 </td>
<td> fk_cs_cs_parente </td>
<td> cs_id_structure </td>
<td> cs_ce_mere </td>
<td> <a href="coel_table_coel_structure.html">coel_structure</a> </td>
</tr>
<tr class="pair" >
<td> 6 </td>
<td> fk_cs_cpu_editeur </td>
<td> cs_id_structure </td>
<td> cpu_ce_truk_editeur </td>
<td> <a href="coel_table_coel_publication.html">coel_publication</a> </td>
</tr>
<tr class="pair" >
<td> 7 </td>
<td> fk_cpr_cs </td>
<td> cs_ce_projet </td>
<td> cpr_id_projet </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 8 </td>
<td> fk_cmhl_cs </td>
<td> cs_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 9 </td>
<td> fk_cmlv_cs_type </td>
<td> cs_ce_type </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 10 </td>
<td> fk_cmlv_cs_type_prive </td>
<td> cs_ce_truk_type_prive </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 11 </td>
<td> fk_cmlv_cs_type_public </td>
<td> cs_ce_truk_type_public </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 12 </td>
<td> fk_cs_cpras </td>
<td> cs_id_structure </td>
<td> cpras_id_structure </td>
<td> <a href="coel_table_coel_projet_a_structure.html">coel_projet_a_structure</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_structure">
discussion sur la table coel_structure
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_collection_botanique.html
New file
0,0 → 1,765
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Collection - coel_collection_botanique</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Collection.html">Collection</a> > coel_collection_botanique</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_collection_botanique</h1>
<h2> Description générale </h2>
<p>
Toutes les informations spécialisées sur une collection de type : botanique
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="ccb_id_collection" class="pair" >
<td> 1 </td>
<td> ccb_id_collection </td>
<td> ccb_id_c </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Type(s) unité de rangement de la collection botanique. \<br />Pour chaque type : indication du nombre d'unité, de la précision du nom (exact, approximatif), des formats. </td>
</tr>
<tr id="ccb_nbre_echantillon" class="pair" >
<td> 2 </td>
<td> ccb_nbre_echantillon </td>
<td> ccb_ne </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nombre de cartons ou liasses échantillonnées. </td>
</tr>
<tr id="ccb_ce_truk_type" class="pair" >
<td> 3 </td>
<td> ccb_ce_truk_type </td>
<td> ccb_ce_tt </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Type(s) de collection botanique. </td>
</tr>
<tr id="ccb_truk_unite_rangement" class="pair" >
<td> 4 </td>
<td> ccb_truk_unite_rangement </td>
<td> ccb_tur </td>
<td> VARCHAR(510) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Type(s) unité de rangement de la collection botanique. \<br />Pour chaque type : indication du nombre d'unité, de la précision du nom (exact, approximatif), des formats. </td>
</tr>
<tr id="ccb_ce_unite_rangement_etat" class="pair" >
<td> 5 </td>
<td> ccb_ce_unite_rangement_etat </td>
<td> ccb_ce_ure </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> État de la majorité des unités de rangements (état des rubans, des poignées, des sangles, des cartons...). </td>
</tr>
<tr id="ccb_truk_unite_base" class="pair" >
<td> 6 </td>
<td> ccb_truk_unite_base </td>
<td> ccb_tub </td>
<td> VARCHAR(510) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Type(s) d'unité de base de la collection, si différent de l'unité de rangement. \\ Ex. : si l'unité de rangement est un carton, l'unité de base peut être une enveloppe. \\ Pour chaque type : indication du nombre d'unité, de la précision du nom (exact = 1, approximatif = 0), des formats (Lxl cm), du nombre de parts, de la précision sur le nombre de parts (exact = 1, approximatif = 0), du nombre d'espèces, de la précision sur le nombre d'espèces (exact, approximatif). </td>
</tr>
<tr id="ccb_truk_conservation_papier_type" class="pair" >
<td> 7 </td>
<td> ccb_truk_conservation_papier_type </td>
<td> ccb_tcpt </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Type(s) du papier de conservation. </td>
</tr>
<tr id="ccb_truk_conservation_methode" class="pair" >
<td> 8 </td>
<td> ccb_truk_conservation_methode </td>
<td> ccb_tcm </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Type(s) de méthode de conservation. </td>
</tr>
<tr id="ccb_specimen_fixation_pourcent" class="pair" >
<td> 9 </td>
<td> ccb_specimen_fixation_pourcent </td>
<td> ccb_sfp </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Pourcentage de spécimens fixés. </td>
</tr>
<tr id="ccb_etiquette_fixation_pourcent" class="pair" >
<td> 10 </td>
<td> ccb_etiquette_fixation_pourcent </td>
<td> ccb_efp </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Pourcentage d'étiquettes fixées. </td>
</tr>
<tr id="ccb_truk_specimen_fixation_methode" class="pair" >
<td> 11 </td>
<td> ccb_truk_specimen_fixation_methode </td>
<td> ccb_tsfm </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Type(s) de fixation des spécimens. </td>
</tr>
<tr id="ccb_truk_etiquette_fixation_support" class="pair" >
<td> 12 </td>
<td> ccb_truk_etiquette_fixation_support </td>
<td> ccb_tefs </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Type(s) de fixation des étiquettes fixées au support. </td>
</tr>
<tr id="ccb_truk_etiquette_fixation_specimen" class="pair" >
<td> 13 </td>
<td> ccb_truk_etiquette_fixation_specimen </td>
<td> ccb_tefs </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Type(s) de fixation des étiquettes fixées au spécimen. </td>
</tr>
<tr id="ccb_truk_etiquette_ecriture" class="pair" >
<td> 14 </td>
<td> ccb_truk_etiquette_ecriture </td>
<td> ccb_tee </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Type(s) d'écriture sur les étiquettes. </td>
</tr>
<tr id="ccb_ce_traitement" class="pair" >
<td> 15 </td>
<td> ccb_ce_traitement </td>
<td> ccb_ce_t </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> La collection botanique semble-t-elle avoir été empoisonnée ou désinsectisée lors de sa réalisation ? </td>
</tr>
<tr id="ccb_truk_traitement_poison" class="pair" >
<td> 16 </td>
<td> ccb_truk_traitement_poison </td>
<td> ccb_ttp </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Type(s) d'empoisonement de la collection. </td>
</tr>
<tr id="ccb_truk_traitement_insecte" class="pair" >
<td> 17 </td>
<td> ccb_truk_traitement_insecte </td>
<td> ccb_tti </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Type(s) de désinctisation de la collection. </td>
</tr>
<tr id="ccb_ce_etat_general" class="pair" >
<td> 18 </td>
<td> ccb_ce_etat_general </td>
<td> ccb_ce_eg </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> État général de la collection (grosses attaques d'insectes, pourriture, papier très fragile, etc... de 1 très mauvais à 5 très bon état). </td>
</tr>
<tr id="ccb_truk_degradation_specimen" class="pair" >
<td> 19 </td>
<td> ccb_truk_degradation_specimen </td>
<td> ccb_tds </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Type(s) de causes des dégradations des spécimens notées de 1 très mauvais à 5 très bon état. </td>
</tr>
<tr id="ccb_truk_degradation_presentation" class="pair" >
<td> 20 </td>
<td> ccb_truk_degradation_presentation </td>
<td> ccb_tdp </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Type(s) de causes des dégradations de la présentation notées de 1 très mauvais à 5 très bon état. </td>
</tr>
<tr id="ccb_ce_determination" class="pair" >
<td> 21 </td>
<td> ccb_ce_determination </td>
<td> ccb_ce_d </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Les échantillons sont-ils déterminables ? (de 1 : quelques fragment de plantes à 5 plantes entières). </td>
</tr>
<tr id="ccb_truk_nature" class="pair" >
<td> 22 </td>
<td> ccb_truk_nature </td>
<td> ccb_tn </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nature de l'herbier. </td>
</tr>
<tr id="ccb_specialite" class="pair" >
<td> 23 </td>
<td> ccb_specialite </td>
<td> ccb_s </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Collection botanique spécialisée (ex. herbier de céréales...) </td>
</tr>
<tr id="ccb_recolte_date_debut" class="pair" >
<td> 24 </td>
<td> ccb_recolte_date_debut </td>
<td> ccb_rdd </td>
<td> DATE </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Date extrême de début de récolte. </td>
</tr>
<tr id="ccb_ce_recolte_date_debut_type" class="pair" >
<td> 25 </td>
<td> ccb_ce_recolte_date_debut_type </td>
<td> ccb_ce_rddt </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Type de date extrême de début de récolte. </td>
</tr>
<tr id="ccb_recolte_date_fin" class="pair" >
<td> 26 </td>
<td> ccb_recolte_date_fin </td>
<td> ccb_rdf </td>
<td> DATE </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Date extrême de fin de récolte. </td>
</tr>
<tr id="ccb_ce_recolte_date_fin_type" class="pair" >
<td> 27 </td>
<td> ccb_ce_recolte_date_fin_type </td>
<td> ccb_ce_rdft </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Type de date extrême de fin de récolte. </td>
</tr>
<tr id="ccb_annotation_classement" class="pair" >
<td> 28 </td>
<td> ccb_annotation_classement </td>
<td> ccb_ac </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Indiquer le type de classement ou des informations concernant un éventuel classement. </td>
</tr>
<tr id="ccb_ce_classement_etat" class="pair" >
<td> 29 </td>
<td> ccb_ce_classement_etat </td>
<td> ccb_ce_ce </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> État du classement (de 1 très mauvais à 5 très bon). </td>
</tr>
<tr id="ccb_truk_etiquette_renseignement" class="pair" >
<td> 30 </td>
<td> ccb_truk_etiquette_renseignement </td>
<td> ccb_ter </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Pourcentage pour chaque type de renseignements portés sur l'étiquette ou sur la part. </td>
</tr>
<tr id="ccb_ce_precision_localite" class="pair" >
<td> 31 </td>
<td> ccb_ce_precision_localite </td>
<td> ccb_ce_pl </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Les localités sont elles précises? </td>
</tr>
<tr id="ccb_ce_precision_date" class="pair" >
<td> 32 </td>
<td> ccb_ce_precision_date </td>
<td> ccb_ce_pd </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Les dates sont elles précises? </td>
</tr>
<tr id="ccb_annotation_diverse" class="pair" >
<td> 33 </td>
<td> ccb_annotation_diverse </td>
<td> ccb_ad </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Autres annotations (dons, annotations personnelles, recettes, utilisations médicales...). </td>
</tr>
<tr id="ccb_ce_collection_integre" class="pair" >
<td> 34 </td>
<td> ccb_ce_collection_integre </td>
<td> ccb_ce_ci </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> La collection observée intègre-t-elle des collections botaniques antérieures ? </td>
</tr>
<tr id="ccb_ce_collection_integre_info" class="pair" >
<td> 35 </td>
<td> ccb_ce_collection_integre_info </td>
<td> ccb_ce_cii </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Les noms de ces collections sont-ils notés sur les étiquettes de chaque échantillon ? </td>
</tr>
<tr id="ccb_ce_inventaire" class="pair" >
<td> 36 </td>
<td> ccb_ce_inventaire </td>
<td> ccb_ce_i </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Existe-t-il un inventaire de cette collection? </td>
</tr>
<tr id="ccb_ce_inventaire_auteur" class="pair" >
<td> 37 </td>
<td> ccb_ce_inventaire_auteur </td>
<td> ccb_ce_ia </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> L'auteur de la collection a-t-il participé à cet inventaire? </td>
</tr>
<tr id="ccb_ce_inventaire_forme" class="pair" >
<td> 38 </td>
<td> ccb_ce_inventaire_forme </td>
<td> ccb_ce_if </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Forme de l'inventaire (manuscrit, informatique...). </td>
</tr>
<tr id="ccb_inventaire_info" class="pair" >
<td> 39 </td>
<td> ccb_inventaire_info </td>
<td> ccb_ii </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Quelles informations retrouve-t-on? </td>
</tr>
<tr id="ccb_ce_truk_inventaire_digital" class="pair" >
<td> 40 </td>
<td> ccb_ce_truk_inventaire_digital </td>
<td> ccb_ce_tid </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Si inventaire digital, quel logiciel utilisez vous? </td>
</tr>
<tr id="ccb_inventaire_digital_pourcent" class="pair" >
<td> 41 </td>
<td> ccb_inventaire_digital_pourcent </td>
<td> ccb_idp </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Pourcentage de la documentation en base de données. </td>
</tr>
<tr id="ccb_ce_inventaire_etat" class="pair" >
<td> 42 </td>
<td> ccb_ce_inventaire_etat </td>
<td> ccb_ce_ie </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> L'inventaire est il complet ou partiel? </td>
</tr>
<tr id="ccb_ce_meta" class="pair" >
<td> 43 </td>
<td> ccb_ce_meta </td>
<td> ccb_ce_m </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cc_ccb </td>
<td> ccb_id_collection </td>
<td> cc_id_collection </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cmlv_ccb_unitte_rangement_etat </td>
<td> ccb_ce_unite_rangement_etat </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cmlv_ccb_traitement </td>
<td> ccb_ce_traitement </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cmlv_ccb_etat_general </td>
<td> ccb_ce_etat_general </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 5 </td>
<td> fk_cmlv_ccb_determination </td>
<td> ccb_ce_determination </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 6 </td>
<td> fk_cmlv_ccb_recolte_date_debut_type </td>
<td> ccb_ce_recolte_date_debut_type </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 7 </td>
<td> fk_cmlv_ccb_recolte_date_fin_type </td>
<td> ccb_ce_recolte_date_fin_type </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 8 </td>
<td> fk_cmlv_ccb_classement_etat </td>
<td> ccb_ce_classement_etat </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 9 </td>
<td> fk_cmlv_ccb_precision_localite </td>
<td> ccb_ce_precision_localite </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 10 </td>
<td> fk_cmlv_ccb_precision_date </td>
<td> ccb_ce_precision_date </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 11 </td>
<td> fk_cmlv_ccb_collection_integre </td>
<td> ccb_ce_collection_integre </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 12 </td>
<td> fk_cmlv_ccb_collection_integre_info </td>
<td> ccb_ce_collection_integre_info </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 13 </td>
<td> fk_cmlv_ccb_inventaire </td>
<td> ccb_ce_inventaire </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 14 </td>
<td> fk_cmlv_ccb_inventaire_auteur </td>
<td> ccb_ce_inventaire_auteur </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 15 </td>
<td> fk_cmlv_ccb_inventaire_forme </td>
<td> ccb_ce_inventaire_forme </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 16 </td>
<td> fk_cmlv_ccb_inventaire_digital </td>
<td> ccb_ce_truk_inventaire_digital </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 17 </td>
<td> fk_cmlv_ccb_inventaire_etat </td>
<td> ccb_ce_inventaire_etat </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 18 </td>
<td> fk_cmhl_ccb_meta </td>
<td> ccb_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_collection_botanique">
discussion sur la table coel_collection_botanique
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_meta_colonne.html
New file
0,0 → 1,273
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Métadonnée - coel_meta_colonne</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Metadonnee.html">Métadonnée</a> > coel_meta_colonne</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_meta_colonne</h1>
<h2> Description générale </h2>
<p>
Contient l'ensemble des champs des tables de la base de données.<br />INFO : cmc_nom
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cmc_id_champ" class="pair" >
<td> 1 </td>
<td> cmc_id_champ </td>
<td> cmc_id_c </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� primaire </td>
<td> oui </td>
<td> Identifiant du nom du champ dans la table. </td>
</tr>
<tr id="cmc_ce_projet" class="pair" >
<td> 2 </td>
<td> cmc_ce_projet </td>
<td> cmc_ce_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du projet. </td>
</tr>
<tr id="cmc_ce_liste" class="pair" >
<td> 3 </td>
<td> cmc_ce_liste </td>
<td> cmc_ce_l </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant de la liste de valeur possédée par cette colonne. </td>
</tr>
<tr id="cmc_ce_table" class="pair" >
<td> 4 </td>
<td> cmc_ce_table </td>
<td> cmc_ce_t </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant de la table à laquelle ce champ appartient. </td>
</tr>
<tr id="cmc_nom" class="pair" >
<td> 5 </td>
<td> cmc_nom </td>
<td> cmc_n </td>
<td> VARCHAR(50) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Intitulé du champ. </td>
</tr>
<tr id="cmc_abreviation" class="pair" >
<td> 6 </td>
<td> cmc_abreviation </td>
<td> cmc_a </td>
<td> VARCHAR(20) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Abréviation du champ. </td>
</tr>
<tr id="cmc_description" class="pair" >
<td> 7 </td>
<td> cmc_description </td>
<td> cmc_d </td>
<td> VARCHAR(510) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Description du champ. </td>
</tr>
<tr id="cmc_ce_format_sql" class="pair" >
<td> 8 </td>
<td> cmc_ce_format_sql </td>
<td> cmc_ce_fs </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du format SQL utilisé pour ce champ. </td>
</tr>
<tr id="cmc_taille" class="pair" >
<td> 9 </td>
<td> cmc_taille </td>
<td> cmc_t </td>
<td> VARCHAR(20) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Taille du format SQL du champ. </td>
</tr>
<tr id="cmc_ce_meta" class="pair" >
<td> 10 </td>
<td> cmc_ce_meta </td>
<td> cmc_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cmc_cmd </td>
<td> cmc_id_champ </td>
<td> cmd_ce_champ </td>
<td> <a href="coel_table_coel_meta_donnee.html">coel_meta_donnee</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cmlv_cmc_liste </td>
<td> cmc_ce_liste </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cpr_cmc </td>
<td> cmc_ce_projet </td>
<td> cpr_id_projet </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cmhl_cmc_meta </td>
<td> cmc_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 5 </td>
<td> fk_cmlv_cmc_table </td>
<td> cmc_ce_table </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 6 </td>
<td> fk_cmlv_cmc_format_sql </td>
<td> cmc_ce_format_sql </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_meta_colonne">
discussion sur la table coel_meta_colonne
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_commentaire.html
New file
0,0 → 1,233
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Commentaire - coel_commentaire</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Commentaire.html">Commentaire</a> > coel_commentaire</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_commentaire</h1>
<h2> Description générale </h2>
<p>
Contient les commentaires.<br />INFO : ccm_titre
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="ccm_id_commentaire" class="pair" >
<td> 1 </td>
<td> ccm_id_commentaire </td>
<td> ccm_id_c </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� primaire </td>
<td> oui </td>
<td> Identifiant d'un commentaire. </td>
</tr>
<tr id="ccm_ce_pere" class="pair" >
<td> 2 </td>
<td> ccm_ce_pere </td>
<td> ccm_ce_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> 0 </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du commentaire père. </td>
</tr>
<tr id="ccm_ce_projet" class="pair" >
<td> 3 </td>
<td> ccm_ce_projet </td>
<td> ccm_ce_p </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du projet dans lequel le commentaire est fait. </td>
</tr>
<tr id="ccm_titre" class="pair" >
<td> 4 </td>
<td> ccm_titre </td>
<td> ccm_t </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Titre du commentaire. </td>
</tr>
<tr id="ccm_texte" class="pair" >
<td> 5 </td>
<td> ccm_texte </td>
<td> ccm_t </td>
<td> TEXT </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Texte du commentaire. </td>
</tr>
<tr id="ccm_ponderation" class="pair" >
<td> 6 </td>
<td> ccm_ponderation </td>
<td> ccm_p </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Pondération du commentaire (importance). Valeur de 1 à 10. </td>
</tr>
<tr id="ccm_mark_public" class="pair" >
<td> 7 </td>
<td> ccm_mark_public </td>
<td> ccm_mp </td>
<td> BOOL </td>
<td> non </td>
<td> 0 </td>
<td> standard </td>
<td> non </td>
<td> Indique si oui (=1) ou non (=0) ce commentaire est public . </td>
</tr>
<tr id="ccm_ce_meta" class="pair" >
<td> 8 </td>
<td> ccm_ce_meta </td>
<td> ccm_ce_m </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cmhl_ccm_meta </td>
<td> ccm_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cpr_ccm </td>
<td> ccm_ce_projet </td>
<td> cpr_id_projet </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_ccm_ccm_pere </td>
<td> ccm_id_commentaire </td>
<td> ccm_ce_pere </td>
<td> <a href="coel_table_coel_commentaire.html">coel_commentaire</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_ccm_ccac </td>
<td> ccm_id_commentaire </td>
<td> ccac_id_commentaire </td>
<td> <a href="coel_table_coel_collection_a_commentaire.html">coel_collection_a_commentaire</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_commentaire">
discussion sur la table coel_commentaire
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_collection_a_personne.html
New file
0,0 → 1,185
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Collection - coel_collection_a_personne</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Collection.html">Collection</a> > coel_collection_a_personne</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_collection_a_personne</h1>
<h2> Description générale </h2>
<p>
Permet de lister les personnes en rapport avec une collection.
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="ccap_id_collection" class="pair" >
<td> 1 </td>
<td> ccap_id_collection </td>
<td> ccap_id_c </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant de la collection associée à une personne. </td>
</tr>
<tr id="ccap_id_personne" class="pair" >
<td> 2 </td>
<td> ccap_id_personne </td>
<td> ccap_id_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant de la personne associée à une collection. </td>
</tr>
<tr id="ccap_id_role" class="pair" >
<td> 3 </td>
<td> ccap_id_role </td>
<td> ccap_id_r </td>
<td> VARCHAR(255) </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Rôle(s) de la personne : auteur, collecteur... permet aussi de connaître qui a les droits de modification sur la collection. </td>
</tr>
<tr id="ccap_ce_meta" class="pair" >
<td> 4 </td>
<td> ccap_ce_meta </td>
<td> ccap_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cc_ccap </td>
<td> ccap_id_collection </td>
<td> cc_id_collection </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cp_ccap </td>
<td> ccap_id_personne </td>
<td> cp_id_personne </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cmhl_ccap_meta </td>
<td> ccap_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cmlv_ccap_role </td>
<td> ccap_id_role </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_collection_a_personne">
discussion sur la table coel_collection_a_personne
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_publication.html
New file
0,0 → 1,301
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Publication - coel_publication</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Publication.html">Publication</a> > coel_publication</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_publication</h1>
<h2> Description générale </h2>
<p>
Publication de type articles scientifiques, ouvrages ou sites web.<br />INFO : cpu_fmt_nom_complet
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cpu_id_publication" class="pair" >
<td> 1 </td>
<td> cpu_id_publication </td>
<td> cpu_id_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� primaire </td>
<td> oui </td>
<td> Identifiant de la publication. </td>
</tr>
<tr id="cpu_ce_projet" class="pair" >
<td> 2 </td>
<td> cpu_ce_projet </td>
<td> cpu_ce_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du projet dans lequel les données de cet enregistrement ont été saisies. </td>
</tr>
<tr id="cpu_fmt_nom_complet" class="pair" >
<td> 3 </td>
<td> cpu_fmt_nom_complet </td>
<td> cpu_fnc </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Intitulé de la publication complet : fmt_auteur, date_parution(année). titre. Editeur (nom), collection, fascicule, indication_nvt. pages. </td>
</tr>
<tr id="cpu_uri" class="pair" >
<td> 4 </td>
<td> cpu_uri </td>
<td> cpu_u </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> URI de la publication qui peut être un site web... </td>
</tr>
<tr id="cpu_fmt_auteur" class="pair" >
<td> 5 </td>
<td> cpu_fmt_auteur </td>
<td> cpu_fa </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Contient le nom formaté de l'intitulé auteur(s). Si plusieurs personnes sont auteurs, l'intitulé est formaté ici. </td>
</tr>
<tr id="cpu_titre" class="pair" >
<td> 6 </td>
<td> cpu_titre </td>
<td> cpu_t </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Titre de l'article ou de l'ouvrage. </td>
</tr>
<tr id="cpu_ce_truk_editeur" class="pair" >
<td> 7 </td>
<td> cpu_ce_truk_editeur </td>
<td> cpu_ce_te </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant de la structure éditrice de la publication. S'il n'est pas renseignné dans la table Structure, contient AUTRE# suivit du nom complet de la structure éditrice. </td>
</tr>
<tr id="cpu_collection" class="pair" >
<td> 8 </td>
<td> cpu_collection </td>
<td> cpu_c </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Intitulé de la collection, c'est à dire de la revue. </td>
</tr>
<tr id="cpu_date_parution" class="pair" >
<td> 9 </td>
<td> cpu_date_parution </td>
<td> cpu_dp </td>
<td> DATE </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Date de parution de la publication. </td>
</tr>
<tr id="cpu_indication_nvt" class="pair" >
<td> 10 </td>
<td> cpu_indication_nvt </td>
<td> cpu_in </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Indication du numéro, volume ou tome de la publication. Plutôt utilisé pour les ouvrages et non les articles de revue. </td>
</tr>
<tr id="cpu_fascicule" class="pair" >
<td> 11 </td>
<td> cpu_fascicule </td>
<td> cpu_f </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Indication du titre du fascicule. Surtout utilisé pour les revues. </td>
</tr>
<tr id="cpu_truk_pages" class="pair" >
<td> 12 </td>
<td> cpu_truk_pages </td>
<td> cpu_tp </td>
<td> VARCHAR(25) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Indication du nombre de pages (pour les ouvrages) ou des pages de début et de fin pour un article. Dans le cas des ouvrages un nombre doit être présent. Pour les articles deux nombres ou point d'intérogation séparés par un tiret. </td>
</tr>
<tr id="cpu_ce_meta" class="pair" >
<td> 13 </td>
<td> cpu_ce_meta </td>
<td> cpu_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cpu_ccapu </td>
<td> cpu_id_publication </td>
<td> ccapu_id_publication </td>
<td> <a href="coel_table_coel_collection_a_publication.html">coel_collection_a_publication</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cpu_cpuap </td>
<td> cpu_id_publication </td>
<td> cpuap_id_publication </td>
<td> <a href="coel_table_coel_publication_a_personne.html">coel_publication_a_personne</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cs_cpu_editeur </td>
<td> cpu_ce_truk_editeur </td>
<td> cs_id_structure </td>
<td> <a href="coel_table_coel_structure.html">coel_structure</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cpr_cpu </td>
<td> cpu_ce_projet </td>
<td> cpr_id_projet </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 5 </td>
<td> fk_cmhl_cpu_meta </td>
<td> cpu_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_publication">
discussion sur la table coel_publication
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_structure_a_personne.html
New file
0,0 → 1,261
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Structure - coel_structure_a_personne</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Structure.html">Structure</a> > coel_structure_a_personne</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_structure_a_personne</h1>
<h2> Description générale </h2>
<p>
Table de liaison permettant d'indiquer la composition de la structure en personnel.<br />Elle permet d'indiquer pour une personne vis à vis d'une structure :<br /> - si elle est contact<br /> - les informations de la personne spécifique à cette structure (ex. : téléphone du travail, fonction, service, statut...).
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="csap_id_structure" class="pair" >
<td> 1 </td>
<td> csap_id_structure </td>
<td> csap_id_s </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant de la structure. </td>
</tr>
<tr id="csap_id_personne" class="pair" >
<td> 2 </td>
<td> csap_id_personne </td>
<td> csap_id_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant d'une personne. </td>
</tr>
<tr id="csap_id_role" class="pair" >
<td> 3 </td>
<td> csap_id_role </td>
<td> csap_id_r </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Rôle de la personne vis à vis de la structure. </td>
</tr>
<tr id="csap_ce_truk_fonction" class="pair" >
<td> 4 </td>
<td> csap_ce_truk_fonction </td>
<td> csap_ce_tf </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Intitulé de la fonction de la personne dans son travail. </td>
</tr>
<tr id="csap_service" class="pair" >
<td> 5 </td>
<td> csap_service </td>
<td> csap_s </td>
<td> VARCHAR(100) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Nom du service ou département dans lequel la personne travaille. </td>
</tr>
<tr id="csap_ce_truk_statut" class="pair" >
<td> 6 </td>
<td> csap_ce_truk_statut </td>
<td> csap_ce_ts </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Statut(s) de la personne : salarié, bénévole... </td>
</tr>
<tr id="csap_mark_contact" class="pair" >
<td> 7 </td>
<td> csap_mark_contact </td>
<td> csap_mc </td>
<td> BOOL </td>
<td> non </td>
<td> 0 </td>
<td> standard </td>
<td> non </td>
<td> Si la personne est un contact la valeur vaut 1 sinon c'est 0. </td>
</tr>
<tr id="csap_bota_travail_hebdo_tps" class="pair" >
<td> 8 </td>
<td> csap_bota_travail_hebdo_tps </td>
<td> csap_btht </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Date de la dernière modification sur cet enregistrement. </td>
</tr>
<tr id="csap_ce_meta" class="pair" >
<td> 9 </td>
<td> csap_ce_meta </td>
<td> csap_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cs_csap </td>
<td> csap_id_structure </td>
<td> cs_id_structure </td>
<td> <a href="coel_table_coel_structure.html">coel_structure</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cp_csap </td>
<td> csap_id_personne </td>
<td> cp_id_personne </td>
<td> <a href="coel_table_coel_personne.html">coel_personne</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cmhl_csap_meta </td>
<td> csap_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
<tr class="pair" >
<td> 4 </td>
<td> fk_cmlv_csap_fonction </td>
<td> csap_ce_truk_fonction </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 5 </td>
<td> fk_cmlv_csap_statut </td>
<td> csap_ce_truk_statut </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
<tr class="pair" >
<td> 6 </td>
<td> fk_cmlv_csap_role </td>
<td> csap_id_role </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_structure_a_personne">
discussion sur la table coel_structure_a_personne
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/Fiche inventaire Herbiers LR.doc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/v1.11-okuzgozu/doc/bdd/archives/Fiche inventaire Herbiers LR.doc
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_module_Metadonnee.html
New file
0,0 → 1,95
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Métadonnée</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > Métadonnée</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<h1> Module Métadonnée</h1>
<p id="miniature" >
<a href="images/modules/Metadonnee.png" title="Voir cette image avec un zoom de 100%.">
<img src="images/miniatures/miniature_Metadonnee.png" alt="Miniature du modèle du module Métadonnée" />
</a>
</p>
<h2> Description générale </h2>
<p>
Module de gestion des Métadonnées.<br />
<br />
<b>Révision : </b>1159
</p>
<h2> Liste des tables </h2>
<ol class="type_01">
<li><a href="coel_table_coel_meta_colonne.html">coel_meta_colonne</a> : Contient l'ensemble des champs des tables de la base de données.<br />INFO : cmc_nom</li>
<li><a href="coel_table_coel_meta_donnee.html">coel_meta_donnee</a> : Contient les champs supplémentaires (non standard ou de spécialisation) de la base de données.</li>
<li><a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> : Contient les métadonnées sur l'historique des enregistrements des tables de la base de données.<br />INFO : cmhl_date_modification</li>
<li><a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> : Liste l'ensemble des valeurs des tables de type liste.<br />Un champ contient des valeurs dans cette table quand il est de type "LISTE".<br />INFO : cmlv_nom</li>
</ol>
<h2> Dépot SVN </h2>
<p>
Voir la page concernant ce module sur le dépot SVN :
<a href="http://svn.tela-botanica.net/websvn/filedetails.php?repname=Applications.coel&path=%2Ftrunk%2Fdoc%2Fbdd%2Fcoel.xml">
coel.xml
</a>
</p>
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant ce module :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_Métadonnée">
discussion sur le module Métadonnée
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
/tags/v1.11-okuzgozu/doc/bdd/archives/maj_personne_id.sql
New file
0,0 → 1,6
# Script de mise à jour de l''id d''une personne
SET @id_ancien = '100213';
SET @id_nouveau = '8589';
UPDATE `coel_collection_a_personne` SET `ccap_id_personne` = @id_nouveau WHERE `ccap_id_personne` = @id_ancien;
UPDATE `coel_publication_a_personne` SET `cpuap_id_personne` = @id_nouveau WHERE `cpuap_id_personne` = @id_ancien;
UPDATE `coel_structure_a_personne` SET `csap_id_personne` = @id_nouveau WHERE `csap_id_personne` = @id_ancien;
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_meta_donnee.html
New file
0,0 → 1,181
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Métadonnée - coel_meta_donnee</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Metadonnee.html">Métadonnée</a> > coel_meta_donnee</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_meta_donnee</h1>
<h2> Description générale </h2>
<p>
Contient les champs supplémentaires (non standard ou de spécialisation) de la base de données.
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cmd_id_donnee" class="pair" >
<td> 1 </td>
<td> cmd_id_donnee </td>
<td> cmd_id_d </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� primaire </td>
<td> oui </td>
<td> Identifiant de la donnée. </td>
</tr>
<tr id="cmd_ce_table" class="pair" >
<td> 2 </td>
<td> cmd_ce_table </td>
<td> cmd_ce_t </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant de la table. </td>
</tr>
<tr id="cmd_ce_ligne" class="pair" >
<td> 3 </td>
<td> cmd_ce_ligne </td>
<td> cmd_ce_l </td>
<td> VARCHAR(64) </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant de la ligne à laquelle le champ dans la table d'origine appartient. Pour les tables à clé primaire multi colonnes, bien respecter l'ordre des champs de la clé et inscrire chaque valeur de clé séparée par un tiret "-". </td>
</tr>
<tr id="cmd_ce_champ" class="pair" >
<td> 4 </td>
<td> cmd_ce_champ </td>
<td> cmd_ce_c </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant du champ. </td>
</tr>
<tr id="cmd_valeur" class="pair" >
<td> 5 </td>
<td> cmd_valeur </td>
<td> cmd_v </td>
<td> VARCHAR(255) </td>
<td> oui </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Valeur. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cmc_cmd </td>
<td> cmd_ce_champ </td>
<td> cmc_id_champ </td>
<td> <a href="coel_table_coel_meta_colonne.html">coel_meta_colonne</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cmlv_cmd_table </td>
<td> cmd_ce_table </td>
<td> cmlv_id_valeur </td>
<td> <a href="coel_table_coel_meta_liste_valeur.html">coel_meta_liste_valeur</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_meta_donnee">
discussion sur la table coel_meta_donnee
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_collection_a_commentaire.html
New file
0,0 → 1,177
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Collection - coel_collection_a_commentaire</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Collection.html">Collection</a> > coel_collection_a_commentaire</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_collection_a_commentaire</h1>
<h2> Description générale </h2>
<p>
Permet de lister les commentaires / notes faits sur une collection.
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="ccac_id_collection" class="pair" >
<td> 1 </td>
<td> ccac_id_collection </td>
<td> ccac_id_c </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant de la collection. </td>
</tr>
<tr id="ccac_id_commentaire" class="pair" >
<td> 2 </td>
<td> ccac_id_commentaire </td>
<td> ccac_id_c </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant du commentaire. </td>
</tr>
<tr id="ccac_truk_type" class="pair" >
<td> 3 </td>
<td> ccac_truk_type </td>
<td> ccac_tt </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Liste des types du commentaire séparés par des points virgules. </td>
</tr>
<tr id="ccac_ce_meta" class="pair" >
<td> 4 </td>
<td> ccac_ce_meta </td>
<td> ccac_ce_m </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cc_ccac </td>
<td> ccac_id_collection </td>
<td> cc_id_collection </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_ccm_ccac </td>
<td> ccac_id_commentaire </td>
<td> ccm_id_commentaire </td>
<td> <a href="coel_table_coel_commentaire.html">coel_commentaire</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cmhl_ccac_meta </td>
<td> ccac_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_collection_a_commentaire">
discussion sur la table coel_collection_a_commentaire
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_meta_historique_colonne.html
New file
0,0 → 1,169
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Métadonnée - coel_meta_historique_colonne</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Metadonnee.html">Métadonnée</a> > coel_meta_historique_colonne</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_meta_historique_colonne</h1>
<h2> Description générale </h2>
<p>
Contient l'historique des valeurs des champs pour les enregistrements des tables de la base de données.<br />
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cmhc_id_historique_colonne" class="pair" >
<td> 1 </td>
<td> cmhc_id_historique_colonne </td>
<td> cmhc_id_hc </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> clé primaire </td>
<td> oui </td>
<td> Identifiant de cet enregistrement historisé. </td>
</tr>
<tr id="cmhc_ce_historique_ligne" class="pair" >
<td> 2 </td>
<td> cmhc_ce_historique_ligne </td>
<td> cmhc_ce_hl </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> clé étrangère </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
<tr id="cmhc_ce_champ" class="pair" >
<td> 3 </td>
<td> cmhc_ce_champ </td>
<td> cmhc_ce_c </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> clé étrangère </td>
<td> non </td>
<td> Identifiant du champ. </td>
</tr>
<tr id="cmhc_valeur" class="pair" >
<td> 4 </td>
<td> cmhc_valeur </td>
<td> cmhc_v </td>
<td> VARCHAR(255) </td>
<td> oui </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Valeur du champ pour cette ligne. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cmc_cmh </td>
<td> cmhc_ce_champ </td>
<td> cmc_id_champ </td>
<td> <a href="coel_table_coel_meta_colonne.html">coel_meta_colonne</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cmhl_cmhc </td>
<td> cmhc_ce_historique_ligne </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_meta_historique_colonne">
discussion sur la table coel_meta_historique_colonne
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 2 septembre 2009 19:56:13</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_projet_a_structure.html
New file
0,0 → 1,177
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Projet - coel_projet_a_structure</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Projet.html">Projet</a> > coel_projet_a_structure</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_projet_a_structure</h1>
<h2> Description générale </h2>
<p>
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="cpras_id_projet" class="pair" >
<td> 1 </td>
<td> cpras_id_projet </td>
<td> cpras_id_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> </td>
</tr>
<tr id="cpras_id_structure" class="pair" >
<td> 2 </td>
<td> cpras_id_structure </td>
<td> cpras_id_s </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> </td>
</tr>
<tr id="cpras_truk_role" class="pair" >
<td> 3 </td>
<td> cpras_truk_role </td>
<td> cpras_tr </td>
<td> VARCHAR(255) </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> </td>
</tr>
<tr id="cpras_ce_meta" class="pair" >
<td> 4 </td>
<td> cpras_ce_meta </td>
<td> cpras_ce_m </td>
<td> INTEGER </td>
<td> non </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cpr_cpras </td>
<td> cpras_id_projet </td>
<td> cpr_id_projet </td>
<td> <a href="coel_table_coel_projet.html">coel_projet</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cs_cpras </td>
<td> cpras_id_structure </td>
<td> cs_id_structure </td>
<td> <a href="coel_table_coel_structure.html">coel_structure</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cmhl_cpras_meta </td>
<td> cpras_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_projet_a_structure">
discussion sur la table coel_projet_a_structure
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/archives/coel_table_coel_collection_a_publication.html
New file
0,0 → 1,177
<?xml version="1.0" encoding="iso-8859-15" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head lang="fr" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Coel v1.0 - Collection - coel_collection_a_publication</title>
<link rel="stylesheet" type="text/css" media="screen" title="Classique" href="coel.css">
</head>
<body xml:lang="fr" lang="fr" >
<div id="zone_bandeau" >
<div id="logo">
<h1>
<a href="/wikini/eflore/wakka.php?wiki=AppliGwtCoel" title="Retourner à la page d'accueil du wiki">
<img src="/wikini/eflore/bibliotheque/images/eflore.jpg" width="110" height="31" alt="Logo" /><br />
Retourner à la page d'accueil du wiki
</a>
</h1>
</div>
<div id="rapport_nom">
<h1>Coel v1.0</h1>
</div>
<ul id="accessibilite">
<li><a href="#zone_contenu_tete">Aller au texte</a></li>
<li class="dernier"><a href="#zone_menu">Aller au menu</a></li>
</ul>
</div>
<div id="zone_contenu">
<p>Vous êtes ici : <a href="index.html">Accueil</a> > <a href="coel_module_Collection.html">Collection</a> > coel_collection_a_publication</p>
<div id="zone_contenu_tete">
<!-- CONTENU_TETE -->
</div>
<div id="zone_contenu_corps">
<!-- CONTENU_CORPS -->
<h1> Table coel_collection_a_publication</h1>
<h2> Description générale </h2>
<p>
Permet de lister les publication liées à une collection.
</p>
<h2> Liste des colonnes </h2>
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Nom </th>
<th> Code </th>
<th> Type données </th>
<th> Obligatoire </th>
<th> Valeur défaut </th>
<th> Type champ </th>
<th> Index </th>
<th> Description </th>
</thead>
<tbody>
<tr id="ccapu_id_collection" class="pair" >
<td> 1 </td>
<td> ccapu_id_collection </td>
<td> ccapu_id_c </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant de collection. </td>
</tr>
<tr id="ccapu_id_publication" class="pair" >
<td> 2 </td>
<td> ccapu_id_publication </td>
<td> ccapu_id_p </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> oui </td>
<td> Identifiant de la publication. </td>
</tr>
<tr id="ccapu_mark_licence" class="pair" >
<td> 3 </td>
<td> ccapu_mark_licence </td>
<td> ccapu_ml </td>
<td> BOOL </td>
<td> non </td>
<td> </td>
<td> standard </td>
<td> non </td>
<td> Booléen indiquant si la publication indiqué correspond aux droits de propriétés intellectuelles de la collection. </td>
</tr>
<tr id="ccapu_ce_meta" class="pair" >
<td> 4 </td>
<td> ccapu_ce_meta </td>
<td> ccapu_ce_m </td>
<td> INTEGER </td>
<td> oui </td>
<td> </td>
<td> cl� �trang�re </td>
<td> non </td>
<td> Identifiant des métadonnées de cet enregistrement. </td>
</tr>
</tbody>
</table>
<h2> Liste des relations </h2>
<!-- RELATION_ZONE_DEBUT -->
<table border="1" cellpadding="2" cellspacing="0" >
<thead>
<th> N° </th>
<th> Code </th>
<th> Colonne dans cette table </th>
<th> Colonne dans la table liée </th>
<th> Nom table liée </th>
</thead>
<tbody>
<tr class="pair" >
<td> 1 </td>
<td> fk_cc_ccapu </td>
<td> ccapu_id_collection </td>
<td> cc_id_collection </td>
<td> <a href="coel_table_coel_collection.html">coel_collection</a> </td>
</tr>
<tr class="pair" >
<td> 2 </td>
<td> fk_cpu_ccapu </td>
<td> ccapu_id_publication </td>
<td> cpu_id_publication </td>
<td> <a href="coel_table_coel_publication.html">coel_publication</a> </td>
</tr>
<tr class="pair" >
<td> 3 </td>
<td> fk_cmhl_ccapu_meta </td>
<td> ccapu_ce_meta </td>
<td> cmhl_id_historique_ligne </td>
<td> <a href="coel_table_coel_meta_historique_ligne.html">coel_meta_historique_ligne</a> </td>
</tr>
</tbody>
</table>
<!-- RELATION_ZONE_FIN -->
<!--
<h2> Régles </h2>
<h2> Domaine </h2>
-->
<h2> Commentaires </h2>
<p>N'hésitez pas à  laisser sur le wiki vos suggestions, réactions... concernant cette table :
<a href="http://wiki.tela-botanica.org/eflore/wakka.php?wiki=EfloreV4AppliCoelDiscussion_coel_collection_a_publication">
discussion sur la table coel_collection_a_publication
</a>.
</p>
</div>
<div id="zone_contenu_pied">
<p>Documentation générée le 29 janvier 2010 12:20:19</p>
<!-- CONTENU_PIED -->
</div>
<div id="zone_pied">
<p> &copy;<a href="http://www.tela-botanica.org/">Tela Botanica</a> / 2000-2008 - Le réseau des Botanistes Francophones</p>
</div>
</div>
<div id="zone_menu">
<!-- MENU -->
</div>
</body>
</html>
 
/tags/v1.11-okuzgozu/doc/bdd/coel_meta_liste_valeur.sql
New file
0,0 → 1,56
-- phpMyAdmin SQL Dump
-- version 4.1.6
-- http://www.phpmyadmin.net
--
-- Client : localhost
-- Généré le : Mar 28 Juillet 2015 à 16:42
-- Version du serveur : 5.6.16
-- Version de PHP : 5.5.9
 
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
 
 
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
 
--
-- Base de données : `tb_coel`
--
 
--
-- Contenu de la table `coel_meta_liste_valeur`
--
 
INSERT INTO `coel_meta_liste_valeur` (`cmlv_id_valeur`, `cmlv_ce_parent`, `cmlv_nom`, `cmlv_abreviation`, `cmlv_description`, `cmlv_ce_meta`) VALUES
(1, 1001, 'Ajouté', 'A', 'NULL', 25),
(2, 1001, 'Modifié', 'M', 'NULL', 26),
(3, 1001, 'Supprimé', 'S', 'NULL', 27),
(11, 1002, 'TINYINT', '1', 'NULL', 28),
(12, 1002, 'SMALLINT', '2', 'NULL', 29),
(13, 1002, 'MEDIUMINT', '3', 'NULL', 30),
(14, 1002, 'INT', '4', 'NULL', 31),
(15, 1002, 'INTEGER', '5', 'NULL', 32),
(16, 1002, 'BIGINT', '6', 'NULL', 33),
(17, 1002, 'FLOAT', '7', 'NULL', 34),
(18, 1002, 'DOUBLE', '8', 'NULL', 35),
(19, 1002, 'DOUBLE PRECISION', '9', 'NULL', 36),
(20, 1002, 'REAL', '10', 'NULL', 37),
(21, 1002, 'DECIMAL', '11', 'NULL', 38),
(22, 1002, 'NUMERIC', '12', 'NULL', 39),
(23, 1002, 'DATE', '13', 'NULL', 40),
(24, 1002, 'DATETIME', '14', 'NULL', 41),
(25, 1002, 'TIMESTAMP', '15', 'NULL', 42),
(26, 1002, 'TIME', '16', 'NULL', 43),
(27, 1002, 'YEAR', '17', 'NULL', 44),
(28, 1002, 'CHAR', '18', 'NULL', 45),
(29, 1002, 'VARCHAR', '19', 'NULL', 46),
(30, 1002, 'BIT', '20', 'NULL', 47),
(31, 1002, 'BOOL', '21', 'NULL', 48),
(32, 1002, 'TINYBLOB', '22', 'NULL', 49);
 
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/tags/v1.11-okuzgozu/doc/bdd/tb_coel.sql
New file
0,0 → 1,512
-- phpMyAdmin SQL Dump
-- version 4.1.6
-- http://www.phpmyadmin.net
--
-- Client : localhost
-- Généré le : Mar 28 Juillet 2015 à 16:41
-- Version du serveur : 5.6.16
-- Version de PHP : 5.5.9
 
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
 
 
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
 
--
-- Base de données : `tb_coel`
--
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_collection`
--
 
CREATE TABLE IF NOT EXISTS `coel_collection` (
`cc_id_collection` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identifiant de la collection.',
`cc_ce_mere` int(11) NOT NULL DEFAULT '0' COMMENT 'Identifiant de la collection parente. Si la collection courrante n''a pas de parente laisser la valeur 0 par défaut.',
`cc_ce_structure` int(11) NOT NULL DEFAULT '0' COMMENT 'Identifiant de la structure habritant physiquement la collection. Si c''est un particulier, laisser la valeur 0 par défaut et utiliser la table liant les collections aux personnes.',
`cc_guid` varchar(255) DEFAULT NULL COMMENT 'Identifiant global unique de type LSID ou URI.',
`cc_truk_code` varchar(100) DEFAULT NULL COMMENT 'Code(s) de la collection.',
`cc_nom` varchar(255) DEFAULT NULL COMMENT 'Nom de la collection dans la langue d''origine. Afficher vis à vis du public.',
`cc_truk_nom_alternatif` text COMMENT 'Nom alternatif de la collection.',
`cc_description` text COMMENT 'Description principale de la collection pour un large public.',
`cc_historique` text COMMENT 'Historique de la collection (acquisition, différentes interventions de restauration, de traitement ...).',
`cc_truk_url` text COMMENT 'URL(s) du site web ou de la page concernant la collection (WEB), d''un web service (WS) ou d''une page permettant d''accèder à des informations sur les objets de la collection (OBJ).',
`cc_ce_type` int(11) DEFAULT NULL COMMENT 'Type de la collection vis à vis du standard NCD.',
`cc_ce_type_depot` int(11) DEFAULT NULL COMMENT 'Type de dépôt de la collection.',
`cc_cote` varchar(255) DEFAULT NULL COMMENT 'Côte de la collection.',
`cc_dimenssion` varchar(255) DEFAULT NULL COMMENT 'Dimenssion, taille de la collection sous forme de texte libre.',
`cc_condition_acces` text COMMENT 'Condition d''accès à la collection. Peut être définit par défaut par la structure.',
`cc_condition_usage` text COMMENT 'Condition d''usages de la collection. Peut être définit par défaut par la structure.',
`cc_truk_couverture_vernaculaire` varchar(255) DEFAULT NULL COMMENT 'Nature de la collection sous forme de nom(s) vernaculaire(s).',
`cc_truk_couverture_taxonomique` varchar(255) DEFAULT NULL COMMENT 'Nom de famille ou de taxons supérieurs présent dans la collection.',
`cc_truk_couverture_regne` varchar(255) DEFAULT NULL COMMENT 'Liste des règnes couverts par la collection.',
`cc_truk_couverture_temporelle` varchar(255) DEFAULT NULL COMMENT 'Période de temps couverte par la collection.',
`cc_truk_couverture_vie` varchar(255) DEFAULT NULL COMMENT 'Période de temps durant laquelle le matériel biologique était en vie. Inclu les périodes de temps paléontologiques.',
`cc_truk_conservation_statut` varchar(255) DEFAULT NULL COMMENT 'Indiquer la date d''une estimation séparée par un dièse du statut estimé utilisant l''échelle de McGinley. Plusieurs estimations seront séparés par un point virgule.',
`cc_truk_preservation` varchar(255) DEFAULT NULL COMMENT 'Liste indiquant les procédures ou techniques de conservation utilisées pour les collections non vivantes.',
`cc_ce_developpement` varchar(255) DEFAULT NULL COMMENT 'Indique le changement potentiel dans la portée de la collection.',
`cc_truk_periode_constitution` varchar(255) DEFAULT NULL COMMENT 'Liste de périodes de temps durant laquelle la collection a été assemblée.',
`cc_truk_couverture_lieu` varchar(255) DEFAULT NULL COMMENT 'Liste de lieux (continent, pays, region, département, commune, autres lieux historique ou texte libre) desquels le matériel de la collection est originaire.',
`cc_truk_coordonnee` varchar(255) DEFAULT NULL COMMENT 'Liste de coordonnées décimales des lieux d''origine du matériel de la collection.',
`cc_ce_specimen_type` int(11) DEFAULT NULL COMMENT 'Y-a-t''il des échantillons-types?',
`cc_specimen_type_nbre` int(11) DEFAULT NULL COMMENT 'Nombre de spécimen type présent dans la collection.',
`cc_ce_specimen_type_nbre_precision` int(11) DEFAULT NULL COMMENT 'Identifiant du type de précision du nombre de spécimen type.',
`cc_ce_specimen_type_classement` int(11) DEFAULT NULL COMMENT 'Type de classement des specimens types.',
`cc_expedition_nom` varchar(255) DEFAULT NULL COMMENT 'Nom de l''expédition durant laquelle le matériel a été collecté.',
`cc_truk_digital_medium` varchar(255) DEFAULT NULL COMMENT 'Pour les collections digitales, listes des types de support d''enregistrement. Ex. : DVD-R.',
`cc_truk_digital_format` varchar(255) DEFAULT NULL COMMENT 'Pour les collections digitales, listes des types MIME.',
`cc_mark_public` tinyint(1) DEFAULT '0' COMMENT 'Indique si oui (=1) ou non (=0) les données de cette collection sont publiques.',
`cc_ce_meta` int(11) NOT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`cc_id_collection`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Contient les informations sur les collections.\n' AUTO_INCREMENT=1947 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_collection_a_commentaire`
--
 
CREATE TABLE IF NOT EXISTS `coel_collection_a_commentaire` (
`ccac_id_collection` int(11) NOT NULL COMMENT 'Identifiant de la collection.',
`ccac_id_commentaire` int(11) NOT NULL COMMENT 'Identifiant du commentaire.',
`ccac_truk_type` varchar(255) DEFAULT NULL COMMENT 'Liste des types du commentaire séparés par des points virgules.',
`ccac_ce_meta` int(11) DEFAULT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`ccac_id_collection`,`ccac_id_commentaire`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Permet de lister les commentaires / notes faits sur une coll';
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_collection_a_personne`
--
 
CREATE TABLE IF NOT EXISTS `coel_collection_a_personne` (
`ccap_id_collection` int(11) NOT NULL COMMENT 'Identifiant de la collection associée à une personne.',
`ccap_id_personne` int(11) NOT NULL COMMENT 'Identifiant de la personne associée à une collection.',
`ccap_id_role` varchar(255) NOT NULL COMMENT 'Rôle(s) de la personne : auteur, collecteur... permet aussi de connaître qui a les droits de modification sur la collection.',
`ccap_ce_meta` int(11) NOT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`ccap_id_collection`,`ccap_id_personne`,`ccap_id_role`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Permet de lister les personnes en rapport avec une collectio';
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_collection_a_publication`
--
 
CREATE TABLE IF NOT EXISTS `coel_collection_a_publication` (
`ccapu_id_collection` int(11) NOT NULL COMMENT 'Identifiant de collection.',
`ccapu_id_publication` int(11) NOT NULL COMMENT 'Identifiant de la publication.',
`ccapu_mark_licence` tinyint(1) DEFAULT NULL COMMENT 'Booléen indiquant si la publication indiqué correspond aux droits de propriétés intellectuelles de la collection.',
`ccapu_ce_meta` int(11) NOT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
`ccapu_source` tinyint(1) NOT NULL,
PRIMARY KEY (`ccapu_id_collection`,`ccapu_id_publication`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Permet de lister les publication liées à une collection.';
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_collection_botanique`
--
 
CREATE TABLE IF NOT EXISTS `coel_collection_botanique` (
`ccb_id_collection` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Type(s) unité de rangement de la collection botanique. \nPour chaque type : indication du nombre d''unité, de la précision du nom (exact, approximatif), des formats.',
`ccb_nbre_echantillon` int(11) DEFAULT NULL COMMENT 'Nombre de cartons ou liasses échantillonnées.',
`ccb_ce_truk_type` varchar(255) DEFAULT NULL COMMENT 'Type(s) de collection botanique.',
`ccb_truk_unite_rangement` varchar(510) DEFAULT NULL COMMENT 'Type(s) unité de rangement de la collection botanique. \nPour chaque type : indication du nombre d''unité, de la précision du nom (exact, approximatif), des formats.',
`ccb_ce_unite_rangement_etat` int(11) DEFAULT NULL COMMENT 'État de la majorité des unités de rangements (état des rubans, des poignées, des sangles, des cartons...).',
`ccb_truk_unite_base` varchar(510) DEFAULT NULL COMMENT 'Type(s) d''unité de base de la collection, si différent de l''unité de rangement. \\ Ex. : si l''unité de rangement est un carton, l''unité de base peut être une enveloppe. \\ Pour chaque type : indication du nombre d''unité, de la précision du nom (exact = ',
`ccb_nb_planches_herbiers` int(11) DEFAULT NULL,
`ccb_nb_especes` int(11) DEFAULT NULL,
`ccb_truk_conservation_papier_type` varchar(255) DEFAULT NULL COMMENT 'Type(s) du papier de conservation.',
`ccb_truk_conservation_methode` varchar(255) DEFAULT NULL COMMENT 'Type(s) de méthode de conservation.',
`ccb_specimen_fixation_pourcent` int(11) DEFAULT NULL COMMENT 'Pourcentage de spécimens fixés.',
`ccb_etiquette_fixation_pourcent` int(11) DEFAULT NULL COMMENT 'Pourcentage d''étiquettes fixées.',
`ccb_truk_specimen_fixation_methode` varchar(255) DEFAULT NULL COMMENT 'Type(s) de fixation des spécimens.',
`ccb_truk_etiquette_fixation_support` varchar(255) DEFAULT NULL COMMENT 'Type(s) de fixation des étiquettes fixées au support.',
`ccb_truk_etiquette_fixation_specimen` varchar(255) DEFAULT NULL COMMENT 'Type(s) de fixation des étiquettes fixées au spécimen.',
`ccb_truk_etiquette_ecriture` varchar(255) DEFAULT NULL COMMENT 'Type(s) d''écriture sur les étiquettes.',
`ccb_ce_traitement` int(11) DEFAULT NULL COMMENT 'La collection botanique semble-t-elle avoir été empoisonnée ou désinsectisée lors de sa réalisation ?',
`ccb_truk_traitement_poison` varchar(255) DEFAULT NULL COMMENT 'Type(s) d''empoisonement de la collection.',
`ccb_truk_traitement_insecte` varchar(255) DEFAULT NULL COMMENT 'Type(s) de désinctisation de la collection.',
`ccb_ce_etat_general` int(11) DEFAULT NULL COMMENT 'État général de la collection (grosses attaques d''insectes, pourriture, papier très fragile, etc... de 1 très mauvais à 5 très bon état).',
`ccb_truk_degradation_specimen` varchar(255) DEFAULT NULL COMMENT 'Type(s) de causes des dégradations des spécimens notées de 1 très mauvais à 5 très bon état.',
`ccb_truk_degradation_presentation` varchar(255) DEFAULT NULL COMMENT 'Type(s) de causes des dégradations de la présentation notées de 1 très mauvais à 5 très bon état.',
`ccb_ce_determination` int(11) DEFAULT NULL COMMENT 'Les échantillons sont-ils déterminables ? (de 1 : quelques fragment de plantes à 5 plantes entières).',
`ccb_truk_nature` varchar(255) DEFAULT NULL COMMENT 'Nature de l''herbier.',
`ccb_specialite` varchar(255) DEFAULT NULL COMMENT 'Collection botanique spécialisée (ex. herbier de céréales...)',
`ccb_recolte_date_debut` date DEFAULT NULL COMMENT 'Date extrême de début de récolte.',
`ccb_ce_recolte_date_debut_type` int(11) DEFAULT NULL COMMENT 'Type de date extrême de début de récolte.',
`ccb_recolte_date_fin` date DEFAULT NULL COMMENT 'Date extrême de fin de récolte.',
`ccb_ce_recolte_date_fin_type` int(11) DEFAULT NULL COMMENT 'Type de date extrême de fin de récolte.',
`ccb_annotation_classement` text COMMENT 'Indiquer le type de classement ou des informations concernant un éventuel classement.',
`ccb_ce_classement_etat` int(11) DEFAULT NULL COMMENT 'État du classement (de 1 très mauvais à 5 très bon).',
`ccb_truk_etiquette_renseignement` varchar(255) DEFAULT NULL COMMENT 'Pourcentage pour chaque type de renseignements portés sur l''étiquette ou sur la part.',
`ccb_ce_precision_localite` int(11) DEFAULT NULL COMMENT 'Les localités sont elles précises?',
`ccb_ce_precision_date` int(11) DEFAULT NULL COMMENT 'Les dates sont elles précises?',
`ccb_annotation_diverse` text COMMENT 'Autres annotations (dons, annotations personnelles, recettes, utilisations médicales...).',
`ccb_ce_collection_integre` int(11) DEFAULT NULL COMMENT 'La collection observée intègre-t-elle des collections botaniques antérieures ?',
`ccb_ce_collection_integre_info` int(11) DEFAULT NULL COMMENT 'Les noms de ces collections sont-ils notés sur les étiquettes de chaque échantillon ?',
`ccb_ce_inventaire` varchar(128) DEFAULT NULL COMMENT 'Existe-t-il un inventaire de cette collection?',
`ccb_ce_inventaire_auteur` varchar(128) DEFAULT NULL COMMENT 'L''auteur de la collection à t''il participé à cet inventaire?',
`ccb_ce_inventaire_forme` int(11) DEFAULT NULL COMMENT 'Forme de l''inventaire (manuscrit, informatique...).',
`ccb_inventaire_info` text COMMENT 'Quelles informations retrouve-t-on?',
`ccb_ce_truk_inventaire_digital` varchar(255) DEFAULT NULL COMMENT 'Si inventaire digital, quel logiciel utilisez vous?',
`ccb_inventaire_digital_pourcent` int(11) DEFAULT NULL COMMENT 'Pourcentage de la documentation en base de données.',
`ccb_ce_inventaire_etat` int(11) DEFAULT NULL COMMENT 'L''inventaire est il complet ou partiel?',
`ccb_ce_meta` int(11) DEFAULT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`ccb_id_collection`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Toutes les informations spécialisées sur une collection de t' AUTO_INCREMENT=1947 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_commentaire`
--
 
CREATE TABLE IF NOT EXISTS `coel_commentaire` (
`ccm_id_commentaire` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identifiant d''un commentaire.',
`ccm_ce_pere` int(11) NOT NULL DEFAULT '0' COMMENT 'Identifiant du commentaire père.',
`ccm_titre` varchar(255) DEFAULT NULL COMMENT 'Titre du commentaire.',
`ccm_texte` text COMMENT 'Texte du commentaire.',
`ccm_ponderation` int(11) DEFAULT NULL COMMENT 'Pondération du commentaire (importance). Valeur de 1 à 10.',
`ccm_mark_public` tinyint(1) DEFAULT '0' COMMENT 'Indique si oui (=1) ou non (=0) ce commentaire est public .',
`ccm_ce_meta` int(11) DEFAULT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`ccm_id_commentaire`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Contient les commentaires.\n' AUTO_INCREMENT=209 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_meta_colonne`
--
 
CREATE TABLE IF NOT EXISTS `coel_meta_colonne` (
`cmc_id_champ` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identifiant du nom du champ dans la table.',
`cmc_ce_liste` int(11) NOT NULL COMMENT 'Identifiant de la liste de valeur possédée par cette colonne.',
`cmc_ce_table` int(11) NOT NULL COMMENT 'Identifiant de la table à laquelle ce champ appartient.',
`cmc_nom` varchar(50) DEFAULT NULL COMMENT 'Intitulé du champ.',
`cmc_abreviation` varchar(20) DEFAULT NULL COMMENT 'Abréviation du champ.',
`cmc_description` varchar(510) DEFAULT NULL COMMENT 'Description du champ.',
`cmc_ce_format_sql` int(11) DEFAULT NULL COMMENT 'Identifiant du format SQL utilisé pour ce champ.',
`cmc_taille` varchar(20) DEFAULT NULL COMMENT 'Taille du format SQL du champ.',
`cmc_ce_meta` int(11) NOT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`cmc_id_champ`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Contient l''ensemble des champs des tables de la base de donn' AUTO_INCREMENT=307 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_meta_donnee`
--
 
CREATE TABLE IF NOT EXISTS `coel_meta_donnee` (
`cmd_id_donnee` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identifiant de la donnée.',
`cmd_ce_table` int(11) NOT NULL COMMENT 'Identifiant de la table.',
`cmd_ce_ligne` varchar(64) NOT NULL COMMENT 'Identifiant de la ligne à laquelle le champ dans la table d''origine appartient. Pour les tables à clé primaire multi colonnes, bien respecter l''ordre des champs de la clé et inscrire chaque valeur de clé séparée par un tiret "-".',
`cmd_ce_champ` int(11) NOT NULL COMMENT 'Identifiant du champ.',
`cmd_valeur` varchar(255) NOT NULL COMMENT 'Valeur.',
PRIMARY KEY (`cmd_id_donnee`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Contient les champs supplémentaires (non standard ou de spéc' AUTO_INCREMENT=1 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_meta_historique_ligne`
--
 
CREATE TABLE IF NOT EXISTS `coel_meta_historique_ligne` (
`cmhl_id_historique_ligne` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identifiant de l''historique des lignes.',
`cmhl_ce_table` int(11) DEFAULT NULL COMMENT 'Identifiant de la table.',
`cmhl_cle_ligne` varchar(64) NOT NULL COMMENT 'Identifiant de la ligne. Pour les tables à clé primaire multi colonnes, bien respecter l''ordre des champs de la clé et inscrire chaque valeur de clé séparée par un tiret "-".',
`cmhl_enregistrement` text COMMENT 'Contient les données au format XML pour les enregistrements supprimés uniquement, sinon possède la valeur NULL. Format XML : <xml encoding="UTF-8><ligne><nom_du_champ_01>valeur_du_champ_01</nom_du_champ_01><nom_du_champ_02>valeur_du_champ_02</nom_du_champ',
`cmhl_date_modification` datetime NOT NULL COMMENT 'Date de modification de la ligne.',
`cmhl_notes` varchar(255) DEFAULT NULL COMMENT 'Notes sur la modification effectuée sur la ligne.',
`cmhl_source` text COMMENT 'Source des données de l''enregistrement, si le créateur/modificateur de l''enregistrement n''en est pas l''auteur.',
`cmhl_ce_modifier_par` int(11) NOT NULL COMMENT 'Identifiant de la personne ayant effectué cette modification sur la ligne.',
`cmhl_ce_etat` int(11) NOT NULL COMMENT 'Identifiant de l''état de la ligne.',
`cmhl_ip` varchar(50) NOT NULL COMMENT 'Adresse IP depuis laquelle la modification a eu lieu.',
`cmhl_session_id` varchar(40) DEFAULT NULL COMMENT 'Identifiant de session del ''utilisateur.',
PRIMARY KEY (`cmhl_id_historique_ligne`),
KEY `cmhl_cle_ligne` (`cmhl_cle_ligne`),
KEY `cmhl_ce_table` (`cmhl_ce_table`),
KEY `cmhl_date_modification` (`cmhl_date_modification`),
KEY `cmhl_ce_modifier_par` (`cmhl_ce_modifier_par`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Contient les métadonnées sur l''historique des enregistrement' AUTO_INCREMENT=221766 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_meta_liste_valeur`
--
 
CREATE TABLE IF NOT EXISTS `coel_meta_liste_valeur` (
`cmlv_id_valeur` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identifiant d''une valeur de liste. Notez que les listes sont des valeurs de la liste des listes.',
`cmlv_ce_parent` int(11) NOT NULL COMMENT 'Identifiant de la catégorie ou des informations sur la liste. Les listes ont pour parent la valeur 0 qui correspond à la liste des listes.',
`cmlv_nom` varchar(100) DEFAULT NULL COMMENT 'Nom de la valeur.',
`cmlv_abreviation` varchar(50) DEFAULT NULL COMMENT 'Abréviation, code ou identifiant de la valeur.',
`cmlv_description` varchar(255) DEFAULT NULL COMMENT 'Description de cette valeur.',
`cmlv_ce_meta` int(11) NOT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`cmlv_id_valeur`),
KEY `cmlv_ce_parent` (`cmlv_ce_parent`),
KEY `cmlv_nom` (`cmlv_nom`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Liste l''ensemble des valeurs des tables de type liste.\nUn ch' AUTO_INCREMENT=30764 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_personne`
--
 
CREATE TABLE IF NOT EXISTS `coel_personne` (
`cp_id_personne` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identifiant d''un contact.',
`cp_fmt_nom_complet` varchar(100) DEFAULT NULL COMMENT 'Nom complet du contact formaté pour l''affichage (le format peut être différent en fonction du projet).',
`cp_ce_truk_prefix` varchar(20) DEFAULT NULL COMMENT 'Préfixe du nom principal. Exemple : Dr., Prof., Mr., Lord, von...',
`cp_prenom` varchar(100) DEFAULT NULL COMMENT 'Prénom principal (le plus connu, répandu) de la personne. Un point virgule peut séparer le prénom principal de prénoms secondaires à ne pas afficher dans le nom complet.',
`cp_nom` varchar(100) DEFAULT NULL COMMENT 'Indiquer les lieux de récolte (code ISO des pays) séparés par des points virgules. Après chaque code ISO indiqué les années de récolte séparées par des vigules ou des tirets pour les périodes continues). Si le pays de récolte est inconnu utilisé un point ',
`cp_ce_truk_suffix` varchar(20) DEFAULT NULL COMMENT 'Suffixe du nom principal. Exemple : Jr, III.',
`cp_truk_nom_autre` varchar(255) DEFAULT NULL COMMENT 'Nom(s) complet alternatif et surnoms. Pour les valeurs, séparez l''identifiant de l''abreviation par un symbole pipe "|". Exemple: HUH#105714|Sharp, Aaron John;APN#9544-1|Sharp, Aaron John (''Jack'')',
`cp_abreviation` varchar(50) DEFAULT NULL COMMENT 'Abreviation retenu du nom.',
`cp_truk_abreviation_autre` varchar(255) DEFAULT NULL COMMENT 'Autres abréviations du nom.',
`cp_naissance_date` date DEFAULT '0000-00-00' COMMENT 'Date de naissance de la personne.',
`cp_naissance_lieu` varchar(100) DEFAULT NULL COMMENT 'Lieu de naissance de la personne.',
`cp_ce_deces` int(11) DEFAULT NULL COMMENT 'Permet de savoir si la personne est décédée ou pas, ou que l''information est indéterminée.',
`cp_deces_date` date DEFAULT NULL COMMENT 'Date de décés de la personne. Par défaut, si la personne n''est pas décédé le champ reste null. Si la personne est décédée mais que l''on ne connait pas la date mettre : 0000-00-00',
`cp_deces_lieu` varchar(100) DEFAULT NULL COMMENT 'Lieu de décés de la personne.',
`cp_ce_sexe` int(11) DEFAULT NULL COMMENT 'Indique si la personne est un homme ou une femme...',
`cp_description` text COMMENT 'Informations diverses sur la personne.',
`cp_biographie` text COMMENT 'Vie et renommée (locale, régionale, ...) de la personne.',
`cp_adresse_01` varchar(255) DEFAULT NULL COMMENT 'Adresse de la personne.',
`cp_bp` varchar(20) DEFAULT NULL COMMENT 'Boite postale de l''adresse de la personne.',
`cp_code_postal` varchar(10) DEFAULT NULL COMMENT 'Code postal (zip) personnel.',
`cp_ville` varchar(100) DEFAULT NULL COMMENT 'Nom de la localité (ville) où vit la personne.',
`cp_ce_truk_pays` varchar(100) DEFAULT NULL COMMENT 'Identifiant du pays où vit la personne. Utiliser les noms du standard ISO-3166-1. Sinon utiliser "AUTRE" pour stocker d''éventuel valeur non présente dans ISO-3166-1.',
`cp_truk_telephone` varchar(255) DEFAULT NULL COMMENT 'Numéro(s) de téléphone fixe (FIX), portable (GSM), Fax (FAX), pager (PAG)... personnels.',
`cp_truk_courriel` varchar(255) DEFAULT NULL COMMENT 'Adresse(s) de courriel personnel. Ajouter les adresses dans leur ordre d''importance.',
`cp_truk_url` varchar(255) DEFAULT NULL COMMENT 'URL(s) de site web personnel. Ajouter les adresses dans leur ordre d''importance.',
`cp_truk_logo` varchar(255) DEFAULT NULL COMMENT 'URL(s) des logo, avatar, portrait ou photo de la personne. Ajouter les URL(s) dans leur ordre d''importance.',
`cp_ce_truk_specialite` varchar(255) DEFAULT NULL COMMENT 'Indiquer séparer par des points virgules ";" les spécialités naturalistes de la personne.',
`cp_truk_recolte` varchar(255) DEFAULT NULL COMMENT 'Indiquer les lieux de récolte séparés par des points virgules. Indiquer le référentiel géographique utilisé puis après un # mettre le code ou identitifiant de la zone géographique. Après chaque code ISO un peut signe pipe | peut être suivi des années de r',
`cp_ce_truk_role` varchar(255) DEFAULT NULL COMMENT 'Rôle générale de la personne vis à vis de l''ensemble des projets : superadmin, admin...',
`cp_mark_licence` tinyint(1) DEFAULT '0' COMMENT 'Indique quand la valeur vaut 1 que l''utilisateur a accepté la licence d''utilisation de l''application. ',
`cp_parametre` text COMMENT 'Parametres de l''utilisateur vis à vis de l''application.',
`cp_session_id` varchar(100) DEFAULT NULL COMMENT 'Identifiant de session de la personne utilisatrice de l''application.',
`cp_login` varchar(50) DEFAULT NULL COMMENT 'Login de la personne pour accéder à l''application.',
`cp_mot_de_passe` varchar(100) DEFAULT NULL COMMENT 'Mot de passe de la personne pour accéder à l''application. Encodé par SHA1.',
`cp_ce_annuaire` int(11) DEFAULT NULL COMMENT 'Identifiant de la personne dans un annuaire (par défaut celui de Tela Botanica).',
`cp_mark_public` tinyint(1) DEFAULT '0' COMMENT 'Indique si oui (=1) ou non (=0) les données de cette personne sont publiques.',
`cp_ce_meta` int(11) NOT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`cp_id_personne`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Contient les informations sur les personnes.\nPar personne no' AUTO_INCREMENT=103337 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_personne_a_relation`
--
 
CREATE TABLE IF NOT EXISTS `coel_personne_a_relation` (
`cpar_id_personne_01` int(11) NOT NULL COMMENT 'Identifiant de la personne n°1.',
`cpar_id_personne_02` int(11) NOT NULL COMMENT 'Identifiant de la personne n°2.',
`cpar_id_role` int(11) NOT NULL COMMENT 'Identifiant du rôle ou de la valeur établie entre les deux personnes.',
`cpar_ce_meta` int(11) NOT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`cpar_id_personne_01`,`cpar_id_personne_02`,`cpar_id_role`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Relation entre deux personnes vis à vis d''un projet.';
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_publication`
--
 
CREATE TABLE IF NOT EXISTS `coel_publication` (
`cpu_id_publication` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identifiant de la publication.',
`cpu_fmt_nom_complet` varchar(255) DEFAULT NULL COMMENT 'Intitulé de la publication complet : fmt_auteur, date_parution(année). titre. Editeur (nom), collection, fascicule, indication_nvt. pages.',
`cpu_uri` varchar(255) DEFAULT NULL COMMENT 'URI de la publication qui peut être un site web...',
`cpu_fmt_auteur` varchar(255) DEFAULT NULL COMMENT 'Contient le nom formaté de l''intitulé auteur(s). Si plusieurs personnes sont auteurs, l''intitulé est formaté ici.',
`cpu_titre` varchar(255) DEFAULT NULL COMMENT 'Titre de l''article ou de l''ouvrage.',
`cpu_ce_truk_editeur` varchar(255) DEFAULT NULL COMMENT 'Identifiant de la structure éditrice de la publication. S''il n''est pas renseignné dans la table Structure, contient AUTRE# suivit du nom complet de la structure éditrice.',
`cpu_collection` varchar(255) DEFAULT NULL COMMENT 'Intitulé de la collection, c''est à dire de la revue.',
`cpu_date_parution` varchar(25) DEFAULT NULL COMMENT 'Date de parution de la publication.',
`cpu_indication_nvt` varchar(255) DEFAULT NULL COMMENT 'Indication du numéro, volume ou tome de la publication. Plutôt utilisé pour les ouvrages et non les articles de revue.',
`cpu_fascicule` varchar(255) DEFAULT NULL COMMENT 'Indication du titre du fascicule. Surtout utilisé pour les revues.',
`cpu_truk_pages` varchar(25) DEFAULT NULL COMMENT 'Indication du nombre de pages (pour les ouvrages) ou des pages de début et de fin pour un article. Dans le cas des ouvrages un nombre doit être présent. Pour les articles deux nombres ou point d''intérogation séparés par un tiret.',
`cpu_ce_meta` int(11) NOT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
`cpu_resume_motcle` text NOT NULL,
PRIMARY KEY (`cpu_id_publication`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Publication de type articles scientifiques, ouvrages ou site' AUTO_INCREMENT=30552 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_publication_a_personne`
--
 
CREATE TABLE IF NOT EXISTS `coel_publication_a_personne` (
`cpuap_id_publication` int(11) NOT NULL COMMENT 'Identifiant d''une publication.',
`cpuap_id_personne` int(11) NOT NULL COMMENT 'Identifiant d''une personne.',
`cpuap_id_role` int(11) NOT NULL COMMENT 'Rôle de la personne vis à vis de la publication : contributeur, auteur...',
`cpuap_ce_truk_type` varchar(255) DEFAULT NULL COMMENT 'Contient le type de référence bibliographique : nécrologie, biographie, publication personnelle...',
`cpuap_ordre` int(11) DEFAULT NULL COMMENT 'Numéro d''ordre de la personne pour le rôle indiqué.',
`cpuap_ce_meta` int(11) NOT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`cpuap_id_publication`,`cpuap_id_personne`,`cpuap_id_role`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Permet de lister les publications d''une personne.';
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_publication_a_personne_sav`
--
 
CREATE TABLE IF NOT EXISTS `coel_publication_a_personne_sav` (
`cpuap_id_publication` int(11) NOT NULL COMMENT 'Identifiant d''une publication.',
`cpuap_id_personne` int(11) NOT NULL COMMENT 'Identifiant d''une personne.',
`cpuap_id_role` int(11) NOT NULL COMMENT 'Rôle de la personne vis à vis de la publication : contributeur, auteur...',
`cpuap_ce_truk_type` varchar(255) DEFAULT NULL COMMENT 'Contient le type de référence bibliographique : nécrologie, biographie, publication personnelle...',
`cpuap_ordre` int(11) DEFAULT NULL COMMENT 'Numéro d''ordre de la personne pour le rôle indiqué.',
`cpuap_ce_meta` int(11) NOT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`cpuap_id_publication`,`cpuap_id_personne`,`cpuap_id_role`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Permet de lister les publications d''une personne.';
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_publication_sav`
--
 
CREATE TABLE IF NOT EXISTS `coel_publication_sav` (
`cpu_id_publication` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identifiant de la publication.',
`cpu_fmt_nom_complet` varchar(255) DEFAULT NULL COMMENT 'Intitulé de la publication complet : fmt_auteur, date_parution(année). titre. Editeur (nom), collection, fascicule, indication_nvt. pages.',
`cpu_uri` varchar(255) DEFAULT NULL COMMENT 'URI de la publication qui peut être un site web...',
`cpu_fmt_auteur` varchar(255) DEFAULT NULL COMMENT 'Contient le nom formaté de l''intitulé auteur(s). Si plusieurs personnes sont auteurs, l''intitulé est formaté ici.',
`cpu_titre` varchar(255) DEFAULT NULL COMMENT 'Titre de l''article ou de l''ouvrage.',
`cpu_ce_truk_editeur` varchar(255) DEFAULT NULL COMMENT 'Identifiant de la structure éditrice de la publication. S''il n''est pas renseignné dans la table Structure, contient AUTRE# suivit du nom complet de la structure éditrice.',
`cpu_collection` varchar(255) DEFAULT NULL COMMENT 'Intitulé de la collection, c''est à dire de la revue.',
`cpu_date_parution` varchar(25) DEFAULT NULL COMMENT 'Date de parution de la publication.',
`cpu_indication_nvt` varchar(255) DEFAULT NULL COMMENT 'Indication du numéro, volume ou tome de la publication. Plutôt utilisé pour les ouvrages et non les articles de revue.',
`cpu_fascicule` varchar(255) DEFAULT NULL COMMENT 'Indication du titre du fascicule. Surtout utilisé pour les revues.',
`cpu_truk_pages` varchar(25) DEFAULT NULL COMMENT 'Indication du nombre de pages (pour les ouvrages) ou des pages de début et de fin pour un article. Dans le cas des ouvrages un nombre doit être présent. Pour les articles deux nombres ou point d''intérogation séparés par un tiret.',
`cpu_ce_meta` int(11) NOT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
`cpu_resume_motcle` text NOT NULL,
PRIMARY KEY (`cpu_id_publication`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Publication de type articles scientifiques, ouvrages ou site' AUTO_INCREMENT=136 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_structure`
--
 
CREATE TABLE IF NOT EXISTS `coel_structure` (
`cs_id_structure` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identifiant de la structure.',
`cs_ce_mere` int(11) NOT NULL DEFAULT '0' COMMENT 'Identifiant de la structure mère.',
`cs_guid` varchar(255) DEFAULT NULL COMMENT 'URI (LSID ou URL) de la structure. Dans le format RDF, cela sera utilisé comme URI des données de l''institutions.',
`cs_truk_identifiant_alternatif` varchar(255) DEFAULT NULL COMMENT 'Identifiant alternatif. Par exemple, l''acronyme de l''Index Herbariorum ou du MNHN. Séparer les différentes valeurs par un point virgule ";" et le type d''identifiant de sa valeur par un dièze "#". Exemple : IH#MPU;MNHN#163',
`cs_nom` varchar(255) DEFAULT NULL COMMENT 'Nom officiel de la structure dans sa langue d''origine.',
`cs_truk_nom_alternatif` varchar(255) DEFAULT NULL COMMENT 'Autres noms de la structures. Séparer les différentes valeurs par un point virgule ";".',
`cs_description` text COMMENT 'Description de la structure pour le public.',
`cs_ce_type` int(11) DEFAULT NULL COMMENT 'Identifiant du type de la structure vis à vis du standard NCD.',
`cs_ce_truk_type_prive` varchar(255) DEFAULT NULL COMMENT 'Type privé de structure.',
`cs_ce_truk_type_public` varchar(255) DEFAULT NULL COMMENT 'Type public de structure.',
`cs_adresse_01` varchar(255) DEFAULT NULL COMMENT 'Adresse principale.',
`cs_date_fondation` date DEFAULT NULL COMMENT 'Date de fondation de la structure.',
`cs_code_postal` varchar(16) DEFAULT NULL COMMENT 'Code postal.',
`cs_ville` varchar(255) DEFAULT NULL COMMENT 'Ville.',
`cs_ce_truk_pays` varchar(255) DEFAULT NULL COMMENT 'Identifiant du nom du pays de la structure. Utiliser les noms du standard ISO-3166-1. Sinon utiliser "AUTRE" pour stocker d''éventuel valeur non présente dans ISO-3166-1.',
`cs_latitude` double(12,9) DEFAULT NULL,
`cs_longitude` double(12,9) DEFAULT NULL,
`cs_truk_telephone` varchar(255) DEFAULT NULL COMMENT 'Téléphone(s) principaux de la structure (fixe, fax, portable...).',
`cs_courriel` varchar(255) DEFAULT NULL COMMENT 'Courriel principal de contact de l''organisation ex : accueil@organisation.org, pas de mail individuel.',
`cs_truk_url` varchar(255) DEFAULT NULL COMMENT 'URL(s) du site web principal de la structure, du logo de la structure ou d''une page web particulière.',
`cs_nbre_personne` int(11) DEFAULT NULL COMMENT 'Nombre de personne présentent dans la structure.',
`cs_condition_acces` text COMMENT 'Conditions d''accès à la structure.',
`cs_condition_usage` text COMMENT 'Conditions d''usage générales des collections de la structure.',
`cs_ce_meta` int(11) NOT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`cs_id_structure`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Contient les informations sur les structures.\n' AUTO_INCREMENT=250 ;
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_structure_a_personne`
--
 
CREATE TABLE IF NOT EXISTS `coel_structure_a_personne` (
`csap_id_structure` int(11) NOT NULL COMMENT 'Identifiant de la structure.',
`csap_id_personne` int(11) NOT NULL COMMENT 'Identifiant d''une personne.',
`csap_id_role` int(11) NOT NULL COMMENT 'Rôle de la personne vis à vis de la structure.',
`csap_ce_truk_fonction` varchar(255) DEFAULT NULL COMMENT 'Intitulé de la fonction de la personne dans son travail.',
`csap_service` varchar(100) DEFAULT NULL COMMENT 'Nom du service ou département dans lequel la personne travaille.',
`csap_ce_truk_statut` varchar(255) DEFAULT NULL COMMENT 'Statut(s) de la personne : salarié, bénévole...',
`csap_mark_contact` tinyint(1) DEFAULT '0' COMMENT 'Si la personne est un contact la valeur vaut 1 sinon c''est 0.',
`csap_bota_travail_hebdo_tps` int(11) DEFAULT NULL COMMENT 'Date de la dernière modification sur cet enregistrement.',
`csap_ce_meta` int(11) NOT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`csap_id_structure`,`csap_id_personne`,`csap_id_role`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Table de liaison permettant d''indiquer la composition de la ';
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_structure_conservation`
--
 
CREATE TABLE IF NOT EXISTS `coel_structure_conservation` (
`csc_id_structure` int(11) NOT NULL COMMENT 'Identifiant de la structure.',
`csc_mark_formation` tinyint(1) DEFAULT '0' COMMENT 'Le personnel s''occupant des collections botaniques a-t-il suivi des formations en conservation ?',
`csc_formation` varchar(255) DEFAULT NULL COMMENT 'Les formations en conservation suvi par le personnel.',
`csc_mark_formation_interet` tinyint(1) DEFAULT NULL COMMENT 'Le personnel s''occupant des collections botaniques a-t-il suivi des formations en conservation ?',
`csc_truk_stockage_local` varchar(255) DEFAULT NULL COMMENT 'Avez-vous des locaux spécifiques de stockage des collections botaniques ?',
`csc_truk_stockage_meuble` varchar(255) DEFAULT NULL COMMENT 'Avez-vous des meubles spécifiques au stockage des collections botaniques ? ',
`csc_truk_stockage_parametre` varchar(255) DEFAULT NULL COMMENT 'Quels paramètres maîtrisez-vous ?',
`csc_mark_collection_commune` tinyint(1) DEFAULT NULL COMMENT 'Les collections botaniques sont-elles conservées avec d''autres collections dans les mêmes locaux (problèe de conservation en commun) ?',
`csc_truk_collection_autre` varchar(255) DEFAULT NULL COMMENT 'Actuellement, vos collections botaniques s''accroissent-elles de nouvelles acquisitions ?',
`csc_mark_acces_controle` tinyint(1) DEFAULT NULL COMMENT 'L''accès à vos collections botaniques est-il contrôlé (ex. : manipulation réservée à des personnes compétentes) ?',
`csc_mark_restauration` tinyint(1) DEFAULT NULL COMMENT 'Effectuez-vous actuellement des opérations de restauration ou de remise en état de vos collections botaniques ?',
`csc_truk_restauration_operation` varchar(255) DEFAULT NULL COMMENT 'Les différentes opérations de restauration actuellement menées.',
`csc_ce_materiel_conservation` int(11) DEFAULT NULL COMMENT 'Utilisez-vous du matériel de conservation ?',
`csc_truk_materiel_autre` varchar(255) DEFAULT NULL COMMENT 'Le matériel, dit de "non conservation" utilisé.',
`csc_mark_traitement` tinyint(1) DEFAULT NULL COMMENT 'Réalisez-vous actuellement des traitements globaux contre les insectes ?',
`csc_truk_traitement` varchar(255) DEFAULT NULL COMMENT 'Traitements globaux contre les insectes.',
`csc_mark_acquisition_collection` tinyint(1) DEFAULT NULL COMMENT 'Actuellement, vos collections botaniques s''accroissent-elles de nouvelles acquisitions ?',
`csc_mark_acquisition_echantillon` tinyint(1) DEFAULT NULL COMMENT 'Actuellement mettez-vous en herbier de nouveaux échantillons ? ',
`csc_mark_acquisition_traitement` tinyint(1) DEFAULT NULL COMMENT 'Si oui, faites-vous un traitement contre les insectes avant l''intégration dans vos collections ?',
`csc_truk_acquisition_traitement_poison` varchar(255) DEFAULT NULL COMMENT 'Traitement de type empoisonnement effectué lors des des acquisitions.',
`csc_truk_acquisition_traitement_insecte` varchar(255) DEFAULT NULL COMMENT 'Traitement de type désinctisation effectué lors des des acquisitions.',
`csc_ce_meta` int(11) DEFAULT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`csc_id_structure`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Toutes les données spécifiques à la conservation au sein d''u';
 
-- --------------------------------------------------------
 
--
-- Structure de la table `coel_structure_valorisation`
--
 
CREATE TABLE IF NOT EXISTS `coel_structure_valorisation` (
`csv_id_structure` int(11) NOT NULL COMMENT 'Identifiant de la structure.',
`csv_mark_action` tinyint(1) DEFAULT NULL COMMENT 'Avez-vous réalisé des actions de valorisation de vos collections botaniques ou avez-vous été sollicités pour la valorisation de ces collections ?',
`csv_truk_action` varchar(255) DEFAULT NULL COMMENT 'Les actions de valorisation réalisées.',
`csv_publication` text COMMENT 'Quelques titres des ouvrages, articles scientifiques, ... ?',
`csv_collection_autre` varchar(255) DEFAULT NULL COMMENT 'L''organisme dispose-t-il d''autres collections (permettant une valorisation pluridisciplinaire) ?',
`csv_mark_action_future` tinyint(1) DEFAULT NULL COMMENT 'Envisagez-vous des actions de valorisation dans le cadre de votre politique culturelle ?',
`csv_action_future` varchar(255) DEFAULT NULL COMMENT 'Les actions de valorisation futures envisagées.',
`csv_mark_recherche` tinyint(1) DEFAULT NULL COMMENT 'Vos collections botaniques sont-elles utilisées pour des recherches scientifiques ?',
`csv_truk_recherche_provenance` varchar(255) DEFAULT NULL COMMENT 'Si oui, par des chercheurs (professionnels ou amateurs ) de quelle provenance ?',
`csv_truk_recherche_type` varchar(255) DEFAULT NULL COMMENT 'Et pour quelles types de recherches ? ',
`csv_mark_acces_ss_motif` tinyint(1) DEFAULT NULL COMMENT 'Peut-on consulter vos collections botaniques sans motif de recherches scientifiques ?',
`csv_acces_ss_motif` varchar(255) DEFAULT NULL COMMENT 'Si oui, quelles démarches doit-on faire pour les consulter ?',
`csv_mark_visite_avec_motif` tinyint(1) DEFAULT NULL COMMENT 'Peut-on visiter vos collections botaniques en avec des objectifs de recherches scientifiques ?',
`csv_visite_avec_motif` varchar(255) DEFAULT NULL COMMENT 'Si oui, quelles démarches doit-on faire pour les visiter ?',
`csv_ce_meta` int(11) DEFAULT NULL COMMENT 'Identifiant des métadonnées de cet enregistrement.',
PRIMARY KEY (`csv_id_structure`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Toutes les données spécifiques à la valorisation au sein d''u';
 
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/tags/v1.11-okuzgozu/doc/bdd
New file
Property changes:
Added: svn:mergeinfo
Merged /trunk/doc/bdd:r1209-1382
Merged /branches/v1.1-aramon/doc/bdd:r1383-1416
Merged /branches/v1.0-syrah/doc/bdd:r1136-1313
Added: svn:ignore
+coel.sql
/tags/v1.11-okuzgozu/doc/code/UPGRADE-gxt2.2-gxt2.3.sh
New file
0,0 → 1,58
## commande pour les changements d'API de GXT 2.2.x -> GXT 2.3.0
# pushd src; bash UPGRADE-gxt2.2-gxt2.3.sh
 
# pattern:
# egrep -rl '(X|Y) \w+ =' # récupère les fichiers utilisant des variables du type X ou Y
# egrep -ro '(X|Y) \w+ ='|awk '{print $(NF-1)}'|sort -u|tr "\n" "|" # récupère les noms des variables de type X ou Y
 
## Button|MenuItem.getText
# variables de ce type
# $ egrep -ro '(Button|MenuItem) \w+ ='|awk '{print $(NF-1)}'|sort -u|tr "\n" "|"
# ici substituées:
sed -ri 's/(aideBouton|ajouter|ajouterBouton|ajouterPersonneBouton|ajouterPersonneExistanteBtn|ajouterPersonnelBtn|ajouterPubli|annuler|annulerBouton|annulerFiltre|appliquer|applisBouton|bouton|boutonAuteurDown|boutonAuteurUp|boutonAvecMenus|boutonPlierDeplierTout|btn|commentairesBoutonModifier|commentairesBoutonSupprimer|configurationBouton|enregistrer|epingleBouton|feedbackBouton|fenetreJournal|fermetureBouton|identificationBouton|imprimerBtn|menuApropos|menuBogue|menuCel|menuCommentaire|menuDoc|messageErreur|mi|modifier|personnesBoutonModifier|personnesBoutonSupprimer|plierDeplierToutBtn|publicationsBoutonModifier|publicationsBoutonSupprimer|rafraichirBouton|rafraichirPersonneBouton|rafraichirPersonnelBtn|supprimer|supprimerBouton|supprimerPersonnelBtn|supprimerPubli|valider|validerBouton)\.getText\(\)/\1.getHtml()/' $(egrep -rl '(Button|MenuItem) \w+ =')
 
 
 
## ContentPanel,FieldSet.setHeading
# extending:
# $ egrep -roh '\w+ extends (ContentPanel|FieldSet|Window|Dialog|Portlet|FormPanel)'|awk '{print $1}'|sort -u|tr "\n" "|"
## AproposFenetre|CollectionListeVue|CommentaireListeVue|FenetreForm|FiltreVue|MenuVue|NavigationVue|PersonneListeVue|ProjetListeVue|PublicationListeVue|StructureListeVue
 
# appels
# $ egrep -ro '(ContentPanel|FieldSet|Window|Dialog|Portlet|FormPanel|AproposFenetre|CollectionListeVue|CommentaireListeVue|FenetreForm|FiltreVue|MenuVue|NavigationVue|PersonneListeVue|ProjetListeVue|PublicationListeVue|StructureListeVue) \w+ ='|awk '{print $(NF-1)}'|sort -u|tr "\n" "|"
 
sed -ri 's/(administratifFieldSet|applette|auteursFieldset|classementFieldSet|complementFieldset|configurationFenetre|conservationFieldSet|contenuPanneau|couvertureFieldSet|cp|descriptionFieldSet|dialog|editionFieldset|etatFieldSet|etiquetteFieldSet|fenetre|fenetreFormulaire|fieldSetAdresse|fieldSetDescription|fieldSetIdentite|fieldSetTelMail|filtre|fp|fsAdresse|fsAutresInfos|fsContact|fsInfosNat|fsNaissanceEtDeces|fsNoms|fsProjet|generalitesFieldset|indexationFieldset|integrationFieldSet|liaisonFieldSet|listeCollectionPanneau|menu|natureFieldSet|panneau|panneauFormulaire|panneauGeneral|panneauGrille|panneauInstitutionListe|panneauOuest|panneauPrincipal|parametresFenetre|periodeFieldSet|precisionFieldSet|principalFieldSet|sommairePanneau|traitementFieldSet|typeFieldSet|typesUniteFieldSet)\.setHeading\(/\1.setHeadingHtml(/' \
$(egrep -rl '(ContentPanel|FieldSet|Window|Dialog|Portlet|FormPanel|AproposFenetre|CollectionListeVue|CommentaireListeVue|FenetreForm|FiltreVue|MenuVue|NavigationVue|PersonneListeVue|ProjetListeVue|PublicationListeVue|StructureListeVue) \w+ =') org/tela_botanica/client/vues/structure/StructureForm.java org/tela_botanica/client/vues/commentaire/CommentaireForm.java
 
 
# implementations (Window,FormPanel,FenetreForm: subclasse)
# $ egrep -roh '\w+ extends (ContentPanel|FieldSet|Window|Dialog|Portlet|FormPanel)'|awk '{print $1}'|sort -u|tr "\n" "|"
sed -ri -e 's/^(\s+)setHeading\(/\1setHeadingHtml(/' -e 's/^(\s+)this.setHeading\(/\1this.setHeadingHtml(/' $(egrep -rl '\w+ extends (ContentPanel|FieldSet|Window|Dialog|Portlet|FormPanel)')
 
 
 
## ContentPanel.getHeading
# appels
# $ egrep -ro '(ContentPanel|FieldSet|Window|Dialog|Portlet|FormPanel) \w+ ='|awk '{print $(NF-1)}'|sort -u|tr "\n" "|"
sed -ri 's/(administratifFieldSet|auteursFieldset|classementFieldSet|complementFieldset|conservationFieldSet|contenuPanneau|couvertureFieldSet|cp|descriptionFieldSet|editionFieldset|etatFieldSet|etiquetteFieldSet|fieldSetAdresse|fieldSetDescription|fieldSetIdentite|fieldSetTelMail|fp|fsAdresse|fsAutresInfos|fsContact|fsInfosNat|fsNaissanceEtDeces|fsNoms|fsProjet|generalitesFieldset|indexationFieldset|integrationFieldSet|liaisonFieldSet|natureFieldSet|panneau|panneauFormulaire|panneauGeneral|panneauGrille|panneauPrincipal|periodeFieldSet|precisionFieldSet|principalFieldSet|sommairePanneau|traitementFieldSet|typeFieldSet|typesUniteFieldSet)\.getHeading\(\)/\1.getHeadingHtml()/' \
$(egrep -rl '(ContentPanel|FieldSet|Window|Dialog|Portlet|FormPanel) \w+ =')
 
 
 
 
 
 
## ColumnConfig.getHeader
# appels
# $ egrep -ro '(ColumnConfig) \w+ ='|awk '{print $(NF-1)}'|sort -u|tr "\n" "|"
sed -ri 's/(accesColonne|checkColumn|column|columnOrdre|datePublicationColonne|decesColonne|editeurColonne|formatColonne|nombreColonne|partNombreColonne|partPrecisionColonne|precisionColonne|spNombreColonne|spPrecisionColonne|typeColonne|typeRelationColonne)\.getHeader\(\)/\1.getHeaderHtml()/' $(egrep -rl 'ColumnConfig \w+ =')
# +
# sed -i '/157/s/getHeader(/getHeaderHtml(/' org/tela_botanica/client/vues/commentaire/CommentaireListeVue.java
sed -i 's/getHeader(/getHeaderHtml(/' org/tela_botanica/client/vues/commentaire/CommentaireListeVue.java
sed -i 's/setHeader(/setHeaderHtml(/' org/tela_botanica/client/vues/FenetreJournal.java org/tela_botanica/client/vues/personne/PersonneFormPublication.java org/tela_botanica/client/vues/collection/CollectionFormPublication.java
 
 
## InfoConfig.(text|title)
# appels
# $ egrep -ro '(InfoConfig) \w+ ='|awk '{print $(NF-1)}'|sort -u|tr "\n" "|"
sed -ri -e 's/(info)\.text/\1.html/' -e 's/(info)\.title([^H])/\1.titleHtml\2/' $(egrep -rl 'InfoConfig \w+ =') org/tela_botanica/client/vues/StatutVue.java
/tags/v1.11-okuzgozu/mise_en_ligne.sh
New file
0,0 → 1,76
#!/bin/bash
########################################################################################################################
# But : mise en ligne automatique sur le serveur par ftp, de la dernière version de COEL
# Auteur : Jean-Pascal Milcent <jpm@tela-botanica.org> (translate bat file to shell script)
# License : GPL v3
# Création : 11 janvier 2010
# Version: 0.2
# 2010-09-13 - Ajout de la création du nom de l'appli automatique.
# $Id$
########################################################################################################################
# Constante
NBREPARAM=$#
APPDIR=`dirname $0`;
APPDIR_ABSOLU=`pwd`;
APPLI_NOM=`basename $APPDIR_ABSOLU | sed 's/^./\u&/'`
FICHIER_COMPILATION="$APPLI_NOM-compile-prod"
DOSSIER_COMPILATION="$APPDIR/war"
DOSSIER_DESTINATION="/www/eflore/coel"
DOSSIER_JREST="$APPDIR/jrest"
DOSSIER_JREST_DESTINATION="/www/eflore/coel/jrest"
APPLI_SERVICE_BASE_URL="http://www.tela-botanica.org/eflore/coel/jrest/"
 
# Aide
E_OPTERR=65
if [ "$1" = '--help' ]
then # Le script a besoin d'au moins un argument sur la ligne de commande
echo "Usage $0 -[parameters -u, -p ]"
echo "Paramétres : "
echo " -h: indiquer l'hote ftp"
echo " -u: indiquer le nom de l'utilisateur ftp"
echo " -p: indiquer le mot de passe de l'utilisateur ftp"
exit $E_OPTERR
fi
 
# Récupération des paramètres et des options de la ligne de commande
TEMP=`getopt -o u:p:h: -l help: -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$TEMP"
while [ ! -z "$1" ] ; do
#echo $1" # "$2
case "$1" in
-h) HOST=$2;;
-u) FTP_USER=$2;;
-p) FTP_PASSWD=$2;;
--) shift ; break ;;
*) echo "Internal error!" ; exit 1 ;;
esac
shift 2
done
 
# Nous devons être dans le dossier de ce script pour que tout fonctionne
echo "Vérification que tout est en place pour la mise en ligne : ";
if [ -d $DOSSIER_COMPILATION ]; then
echo "OK : dossier de compilation '$DOSSIER_COMPILATION' existe";
else
echo "KO : dossier de compilation '$DOSSIER_COMPILATION' inexistant!";
fi;
if [ -f ./$FICHIER_COMPILATION ]; then
echo "OK : fichier de compilation $FICHIER_COMPILATION existe";
else
echo "KO : fichier de compilation $FICHIER_COMPILATION inexistant!";
fi;
 
# Transfert sur le serveur par FTP
if [ $NBREPARAM -eq 0 ]; then
echo "Pas de transfert sur le serveur. Utiliser --help pour voir les options de transfert."
else
echo "Compilation de l'application : ";
./$FICHIER_COMPILATION
echo "Transfert sur le serveur de l'application :";
lftp ftp://$FTP_USER:$FTP_PASSWD@$HOST -e "set ftp:passive off; mirror -e -R -L -x .svn -x WEB-INF -x .htaccess -x config.js -x jrest $DOSSIER_COMPILATION $DOSSIER_DESTINATION ; quit"
echo "Transfert sur le serveur de Jrest :";
lftp ftp://$FTP_USER:$FTP_PASSWD@$HOST -e "set ftp:passive off; mirror -e -R -x .svn -x jrest.ini.php -x .htaccess -x .project -x .buildpath -x .settings $DOSSIER_JREST $DOSSIER_JREST_DESTINATION ; quit"
fi;
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
Added: svn:executable
+*
\ No newline at end of property
/tags/v1.11-okuzgozu/Coel-debug
New file
0,0 → 1,14
#!/bin/sh
# Lancement de l'application en mode debug
APPDIR=`dirname $0`;
APPDIR_ABSOLU=`pwd`;
APPLI_NOM=`basename $APPDIR_ABSOLU | sed 's/^./\u&/'`
APPLI_DOMAINE="org.clapas.$APPLI_NOM"
APPLI_LIEN = http://localhost/$APPLI_NOM/war/$APPLI_NOM.html
CLASSPATH=$(cat "$APPDIR/$APPLI_NOM-classpath" | sed -e :a -e '$!N;s/\n//;ta')
 
# Mise à jour de la config de l'application
sh $APPLI_NOM-config
 
# Lancement du mode débug
java -Xmx1024M -Xdebug -Xnoagent -cp $CLASSPATH -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,address=3408,suspend=y com.google.gwt.dev.DevMode -noserver -port 80 -startupUrl $APPLI_LIEN $APPLI_DOMAINE;
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v1.11-okuzgozu/A_LIRE.txt
New file
0,0 → 1,8
Dans Eclipse, créer deux projets :
- "coel" avec le projet "jrest_coel" où vous mettrez le trunk du svn
- "coel_li" avec le projet "jrest_coel_li" où vous mettrez la branche courante de déboguage du svn
 
Bien entendu, pour faire fonctionner COEL dans Eclipse après avoir mise à jour depuis le dépôt SVN, vous devez :
- télécharger le plugin eclipse GWT, qui installera automatiquement GWT-2.5.1 (ou supérieur)
- télécharger GXT 2.2.5
- configurer le "build path" dans Eclipse en ajoutant le JAR externe gxt-2.2.5-gwt22.jar
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/tags/v1.11-okuzgozu/Coel-compile-prod
New file
0,0 → 1,13
#!/bin/sh
# Compilation de l'application définitive
APPDIR=`dirname $0`;
APPDIR_ABSOLU=`pwd`;
APPLI_NOM=`basename $APPDIR_ABSOLU | sed 's/^./\u&/'`
APPLI_DOMAINE="org.tela_botanica.$APPLI_NOM"
CLASSPATH=$(cat "$APPDIR/$APPLI_NOM-classpath" | sed -e :a -e '$!N;s/\n//;ta')
 
# Mise à jour de la config de l'application
sh $APPLI_NOM-config
 
# Lancement de la compilation
java -Xmx1024M -Xss256k -Xverify:none -cp $CLASSPATH com.google.gwt.dev.Compiler -localWorkers 2 $APPLI_DOMAINE;
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v1.11-okuzgozu/.htaccess
New file
0,0 → 1,21
#AddHandler x-httpd-php5 .php
AddDefaultCharset UTF-8
 
# Gestion du cache pour les fichiers GWT - nécessite mod_expires et mod_headers
<Files *.nocache.*>
ExpiresDefault "access"
</Files>
<Files *.cache.*>
ExpiresDefault "now plus 1 year"
</Files>
 
<filesMatch ".(html|css|js|gif|png)$">
Header set Cache-Control: no-cache
</FilesMatch>
 
 
RewriteEngine On
 
RewriteRule ^appli:coel$ /Coel.html [QSA,L,R=302]
RewriteRule ^service:coel:(.+)$ /jrest/$1 [B,QSA,L]
RewriteRule ^widget:coel:(.+)$ /widget/$1 [QSA,L]
/tags/v1.11-okuzgozu/widget/modules/carto/Carto.php
New file
0,0 → 1,134
<?php
 
class Carto extends WidgetCommun {
const SERVICE_CARTO_NOM = 'carto';
const SERVICE_CARTO_ACTION_DEFAUT = 'carto';
private $carte = '';
private $departement = '';
private $clustering = true;
/**
* Methode appelee par defaut pour executer ce widget
*/
public function executer() {
$retour = null;
// recuperer les parametres de l'URL
$this->extraireParametres();
// verifier la disponibilite des services et ressources demandees
$methode = $this->traiterNomMethodeExecuter($this->carte);
if (method_exists($this, $methode)) {
$retour = $this->$methode();
} else {
$this->messages[] = "Ce type de service '$methode' n'est pas disponible.";
}
if (is_null($retour)) {
$info = 'Un problème est survenu : '.print_r($this->messages, true);
$this->envoyer($info);
} else {
$squelette = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'squelettes' . DIRECTORY_SEPARATOR
. $retour['squelette'] . '.tpl.html';
$html = $this->traiterSquelettePhp($squelette, $retour['donnees']);
$this->envoyer($html);
}
}
public function extraireParametres() {
extract($this->parametres);
$this->carte = (isset($carte) ? $carte : self::SERVICE_CARTO_ACTION_DEFAUT);
$this->departement = (isset($dept) ? $dept : '*');
$this->pays = (isset($pays) ? $pays : '*');
$this->clustering = (isset($clustering) ? (bool)$clustering : $this->clustering);
}
/**
* Carte par défaut
*/
public function executerCarto() {
$widget = null;
// Création des infos du widget
$widget['donnees']['url_base'] = sprintf($this->config['chemins']['baseURLAbsoluDyn'], '');
$widget['donnees']['url_web_service'] = sprintf($this->config['chemins']['baseURLServicesTpl'], '');
$widget['donnees']['url_page_fiche'] = $this->config['carto']["urlPageFiche"];
$widget['donnees']['departement'] = $this->departement;
$widget['donnees']['pays'] = $this->pays;
$widget['donnees']['clustering'] = $this->clustering;
$widget['squelette'] = 'carto';
return $widget;
}
 
// utilisée ?
private function contruireUrlService() {
// Création url données json
$url = sprintf($this->config['chemins']['baseURLServicesTpl'], '');
if ($action) {
$url .= "/$action";
$parametres_retenus = array();
$parametres_a_tester = array('dept');
foreach ($parametres_a_tester as $param) {
if (isset($this->$param) && $this->$param != '*') {
$parametres_retenus[$param] = $this->$param;
}
}
if (count($parametres_retenus) > 0) {
$parametres_url = array();
foreach ($parametres_retenus as $cle => $valeur) {
$parametres_url[] = $cle.'='.$valeur;
}
$url .= '?'.implode('&', $parametres_url);
}
}
return $url;
}
private function obtenirUrlsLimitesCommunales() {
$urls = null;
if (isset($this->departement)) {
// si on veut afficher les limites départementales on va compter et chercher les noms de fichiers
$fichiersKml = $this->chercherFichierKml();
if (count($fichiersKml) > 0) {
foreach ($fichiersKml as $kml => $dossier){
$url_limites_communales = sprintf($this->config['carto']['limitesCommunaleUrlTpl'], $dossier, $kml);
$urls[] = $url_limites_communales;
}
}
}
$urls = json_encode($urls);
return $urls;
}
private function chercherFichierKml(){
$fichiers = array();
$chemins = explode(',', $this->config['carto']['communesKmzChemin']);
$departements = explode(',', $this->departement);// plrs code de départements peuvent être demandés séparés par des virgules
$departements_trouves = array();
foreach ($chemins as $dossier_chemin) {
if ($dossier_ressource = opendir($dossier_chemin)) {
while ($element = readdir($dossier_ressource)) {
if ($element != '.' && $element != '..') {
foreach ($departements as $departement) {
$nom_dossier = basename($dossier_chemin);
if (!isset($departements_trouves[$departement]) || $departements_trouves[$departement] == $nom_dossier) {
$dept_protege = preg_quote($departement);
if (!is_dir($dossier_chemin.'/'.$element) && preg_match("/^$dept_protege(?:_[0-9]+|)\.kml$/", $element)) {
$fichiers[$element] = $nom_dossier;
$departements_trouves[$departement] = $nom_dossier;
}
}
}
}
}
closedir($dossier_ressource);
}
}
return $fichiers;
}
}
 
?>
/tags/v1.11-okuzgozu/widget/modules/carto/squelettes/images/petitCarreContour.jpg
Cannot display: file marked as a binary type.
svn:mime-type = image/jpeg
/tags/v1.11-okuzgozu/widget/modules/carto/squelettes/images/petitCarreContour.jpg
New file
Property changes:
Added: svn:mime-type
+image/jpeg
\ No newline at end of property
/tags/v1.11-okuzgozu/widget/modules/carto/squelettes/scripts/leaflet.markercluster-src.js
New file
0,0 → 1,2163
/*
Leaflet.markercluster, Provides Beautiful Animated Marker Clustering functionality for Leaflet, a JS library for interactive maps.
https://github.com/Leaflet/Leaflet.markercluster
(c) 2012-2013, Dave Leaver, smartrak
*/
(function (window, document, undefined) {/*
* L.MarkerClusterGroup extends L.FeatureGroup by clustering the markers contained within
*/
 
L.MarkerClusterGroup = L.FeatureGroup.extend({
 
options: {
maxClusterRadius: 80, //A cluster will cover at most this many pixels from its center
iconCreateFunction: null,
 
spiderfyOnMaxZoom: true,
showCoverageOnHover: true,
zoomToBoundsOnClick: true,
singleMarkerMode: false,
 
disableClusteringAtZoom: null,
 
// Setting this to false prevents the removal of any clusters outside of the viewpoint, which
// is the default behaviour for performance reasons.
removeOutsideVisibleBounds: true,
 
//Whether to animate adding markers after adding the MarkerClusterGroup to the map
// If you are adding individual markers set to true, if adding bulk markers leave false for massive performance gains.
animateAddingMarkers: false,
 
//Increase to increase the distance away that spiderfied markers appear from the center
spiderfyDistanceMultiplier: 1,
 
// When bulk adding layers, adds markers in chunks. Means addLayers may not add all the layers in the call, others will be loaded during setTimeouts
chunkedLoading: false,
chunkInterval: 200, // process markers for a maximum of ~ n milliseconds (then trigger the chunkProgress callback)
chunkDelay: 50, // at the end of each interval, give n milliseconds back to system/browser
chunkProgress: null, // progress callback: function(processed, total, elapsed) (e.g. for a progress indicator)
 
//Options to pass to the L.Polygon constructor
polygonOptions: {}
},
 
initialize: function (options) {
L.Util.setOptions(this, options);
if (!this.options.iconCreateFunction) {
this.options.iconCreateFunction = this._defaultIconCreateFunction;
}
 
this._featureGroup = L.featureGroup();
this._featureGroup.on(L.FeatureGroup.EVENTS, this._propagateEvent, this);
 
this._nonPointGroup = L.featureGroup();
this._nonPointGroup.on(L.FeatureGroup.EVENTS, this._propagateEvent, this);
 
this._inZoomAnimation = 0;
this._needsClustering = [];
this._needsRemoving = []; //Markers removed while we aren't on the map need to be kept track of
//The bounds of the currently shown area (from _getExpandedVisibleBounds) Updated on zoom/move
this._currentShownBounds = null;
 
this._queue = [];
},
 
addLayer: function (layer) {
 
if (layer instanceof L.LayerGroup) {
var array = [];
for (var i in layer._layers) {
array.push(layer._layers[i]);
}
return this.addLayers(array);
}
 
//Don't cluster non point data
if (!layer.getLatLng) {
this._nonPointGroup.addLayer(layer);
return this;
}
 
if (!this._map) {
this._needsClustering.push(layer);
return this;
}
 
if (this.hasLayer(layer)) {
return this;
}
 
 
//If we have already clustered we'll need to add this one to a cluster
 
if (this._unspiderfy) {
this._unspiderfy();
}
 
this._addLayer(layer, this._maxZoom);
 
//Work out what is visible
var visibleLayer = layer,
currentZoom = this._map.getZoom();
if (layer.__parent) {
while (visibleLayer.__parent._zoom >= currentZoom) {
visibleLayer = visibleLayer.__parent;
}
}
 
if (this._currentShownBounds.contains(visibleLayer.getLatLng())) {
if (this.options.animateAddingMarkers) {
this._animationAddLayer(layer, visibleLayer);
} else {
this._animationAddLayerNonAnimated(layer, visibleLayer);
}
}
return this;
},
 
removeLayer: function (layer) {
 
if (layer instanceof L.LayerGroup)
{
var array = [];
for (var i in layer._layers) {
array.push(layer._layers[i]);
}
return this.removeLayers(array);
}
 
//Non point layers
if (!layer.getLatLng) {
this._nonPointGroup.removeLayer(layer);
return this;
}
 
if (!this._map) {
if (!this._arraySplice(this._needsClustering, layer) && this.hasLayer(layer)) {
this._needsRemoving.push(layer);
}
return this;
}
 
if (!layer.__parent) {
return this;
}
 
if (this._unspiderfy) {
this._unspiderfy();
this._unspiderfyLayer(layer);
}
 
//Remove the marker from clusters
this._removeLayer(layer, true);
 
if (this._featureGroup.hasLayer(layer)) {
this._featureGroup.removeLayer(layer);
if (layer.setOpacity) {
layer.setOpacity(1);
}
}
 
return this;
},
 
//Takes an array of markers and adds them in bulk
addLayers: function (layersArray) {
var fg = this._featureGroup,
npg = this._nonPointGroup,
chunked = this.options.chunkedLoading,
chunkInterval = this.options.chunkInterval,
chunkProgress = this.options.chunkProgress,
newMarkers, i, l, m;
 
if (this._map) {
var offset = 0,
started = (new Date()).getTime();
var process = L.bind(function () {
var start = (new Date()).getTime();
for (; offset < layersArray.length; offset++) {
if (chunked && offset % 200 === 0) {
// every couple hundred markers, instrument the time elapsed since processing started:
var elapsed = (new Date()).getTime() - start;
if (elapsed > chunkInterval) {
break; // been working too hard, time to take a break :-)
}
}
 
m = layersArray[offset];
 
//Not point data, can't be clustered
if (!m.getLatLng) {
npg.addLayer(m);
continue;
}
 
if (this.hasLayer(m)) {
continue;
}
 
this._addLayer(m, this._maxZoom);
 
//If we just made a cluster of size 2 then we need to remove the other marker from the map (if it is) or we never will
if (m.__parent) {
if (m.__parent.getChildCount() === 2) {
var markers = m.__parent.getAllChildMarkers(),
otherMarker = markers[0] === m ? markers[1] : markers[0];
fg.removeLayer(otherMarker);
}
}
}
 
if (chunkProgress) {
// report progress and time elapsed:
chunkProgress(offset, layersArray.length, (new Date()).getTime() - started);
}
 
if (offset === layersArray.length) {
//Update the icons of all those visible clusters that were affected
this._featureGroup.eachLayer(function (c) {
if (c instanceof L.MarkerCluster && c._iconNeedsUpdate) {
c._updateIcon();
}
});
 
this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);
} else {
setTimeout(process, this.options.chunkDelay);
}
}, this);
 
process();
} else {
newMarkers = [];
for (i = 0, l = layersArray.length; i < l; i++) {
m = layersArray[i];
 
//Not point data, can't be clustered
if (!m.getLatLng) {
npg.addLayer(m);
continue;
}
 
if (this.hasLayer(m)) {
continue;
}
 
newMarkers.push(m);
}
this._needsClustering = this._needsClustering.concat(newMarkers);
}
return this;
},
 
//Takes an array of markers and removes them in bulk
removeLayers: function (layersArray) {
var i, l, m,
fg = this._featureGroup,
npg = this._nonPointGroup;
 
if (!this._map) {
for (i = 0, l = layersArray.length; i < l; i++) {
m = layersArray[i];
this._arraySplice(this._needsClustering, m);
npg.removeLayer(m);
}
return this;
}
 
for (i = 0, l = layersArray.length; i < l; i++) {
m = layersArray[i];
 
if (!m.__parent) {
npg.removeLayer(m);
continue;
}
 
this._removeLayer(m, true, true);
 
if (fg.hasLayer(m)) {
fg.removeLayer(m);
if (m.setOpacity) {
m.setOpacity(1);
}
}
}
 
//Fix up the clusters and markers on the map
this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);
 
fg.eachLayer(function (c) {
if (c instanceof L.MarkerCluster) {
c._updateIcon();
}
});
 
return this;
},
 
//Removes all layers from the MarkerClusterGroup
clearLayers: function () {
//Need our own special implementation as the LayerGroup one doesn't work for us
 
//If we aren't on the map (yet), blow away the markers we know of
if (!this._map) {
this._needsClustering = [];
delete this._gridClusters;
delete this._gridUnclustered;
}
 
if (this._noanimationUnspiderfy) {
this._noanimationUnspiderfy();
}
 
//Remove all the visible layers
this._featureGroup.clearLayers();
this._nonPointGroup.clearLayers();
 
this.eachLayer(function (marker) {
delete marker.__parent;
});
 
if (this._map) {
//Reset _topClusterLevel and the DistanceGrids
this._generateInitialClusters();
}
 
return this;
},
 
//Override FeatureGroup.getBounds as it doesn't work
getBounds: function () {
var bounds = new L.LatLngBounds();
 
if (this._topClusterLevel) {
bounds.extend(this._topClusterLevel._bounds);
}
 
for (var i = this._needsClustering.length - 1; i >= 0; i--) {
bounds.extend(this._needsClustering[i].getLatLng());
}
 
bounds.extend(this._nonPointGroup.getBounds());
 
return bounds;
},
 
//Overrides LayerGroup.eachLayer
eachLayer: function (method, context) {
var markers = this._needsClustering.slice(),
i;
 
if (this._topClusterLevel) {
this._topClusterLevel.getAllChildMarkers(markers);
}
 
for (i = markers.length - 1; i >= 0; i--) {
method.call(context, markers[i]);
}
 
this._nonPointGroup.eachLayer(method, context);
},
 
//Overrides LayerGroup.getLayers
getLayers: function () {
var layers = [];
this.eachLayer(function (l) {
layers.push(l);
});
return layers;
},
 
//Overrides LayerGroup.getLayer, WARNING: Really bad performance
getLayer: function (id) {
var result = null;
 
this.eachLayer(function (l) {
if (L.stamp(l) === id) {
result = l;
}
});
 
return result;
},
 
//Returns true if the given layer is in this MarkerClusterGroup
hasLayer: function (layer) {
if (!layer) {
return false;
}
 
var i, anArray = this._needsClustering;
 
for (i = anArray.length - 1; i >= 0; i--) {
if (anArray[i] === layer) {
return true;
}
}
 
anArray = this._needsRemoving;
for (i = anArray.length - 1; i >= 0; i--) {
if (anArray[i] === layer) {
return false;
}
}
 
return !!(layer.__parent && layer.__parent._group === this) || this._nonPointGroup.hasLayer(layer);
},
 
//Zoom down to show the given layer (spiderfying if necessary) then calls the callback
zoomToShowLayer: function (layer, callback) {
 
var showMarker = function () {
if ((layer._icon || layer.__parent._icon) && !this._inZoomAnimation) {
this._map.off('moveend', showMarker, this);
this.off('animationend', showMarker, this);
 
if (layer._icon) {
callback();
} else if (layer.__parent._icon) {
var afterSpiderfy = function () {
this.off('spiderfied', afterSpiderfy, this);
callback();
};
 
this.on('spiderfied', afterSpiderfy, this);
layer.__parent.spiderfy();
}
}
};
 
if (layer._icon && this._map.getBounds().contains(layer.getLatLng())) {
//Layer is visible ond on screen, immediate return
callback();
} else if (layer.__parent._zoom < this._map.getZoom()) {
//Layer should be visible at this zoom level. It must not be on screen so just pan over to it
this._map.on('moveend', showMarker, this);
this._map.panTo(layer.getLatLng());
} else {
var moveStart = function () {
this._map.off('movestart', moveStart, this);
moveStart = null;
};
 
this._map.on('movestart', moveStart, this);
this._map.on('moveend', showMarker, this);
this.on('animationend', showMarker, this);
layer.__parent.zoomToBounds();
 
if (moveStart) {
//Never started moving, must already be there, probably need clustering however
showMarker.call(this);
}
}
},
 
//Overrides FeatureGroup.onAdd
onAdd: function (map) {
this._map = map;
var i, l, layer;
 
if (!isFinite(this._map.getMaxZoom())) {
throw "Map has no maxZoom specified";
}
 
this._featureGroup.onAdd(map);
this._nonPointGroup.onAdd(map);
 
if (!this._gridClusters) {
this._generateInitialClusters();
}
 
for (i = 0, l = this._needsRemoving.length; i < l; i++) {
layer = this._needsRemoving[i];
this._removeLayer(layer, true);
}
this._needsRemoving = [];
 
//Remember the current zoom level and bounds
this._zoom = this._map.getZoom();
this._currentShownBounds = this._getExpandedVisibleBounds();
 
this._map.on('zoomend', this._zoomEnd, this);
this._map.on('moveend', this._moveEnd, this);
 
if (this._spiderfierOnAdd) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely
this._spiderfierOnAdd();
}
 
this._bindEvents();
 
//Actually add our markers to the map:
l = this._needsClustering;
this._needsClustering = [];
this.addLayers(l);
},
 
//Overrides FeatureGroup.onRemove
onRemove: function (map) {
map.off('zoomend', this._zoomEnd, this);
map.off('moveend', this._moveEnd, this);
 
this._unbindEvents();
 
//In case we are in a cluster animation
this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');
 
if (this._spiderfierOnRemove) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely
this._spiderfierOnRemove();
}
 
 
 
//Clean up all the layers we added to the map
this._hideCoverage();
this._featureGroup.onRemove(map);
this._nonPointGroup.onRemove(map);
 
this._featureGroup.clearLayers();
 
this._map = null;
},
 
getVisibleParent: function (marker) {
var vMarker = marker;
while (vMarker && !vMarker._icon) {
vMarker = vMarker.__parent;
}
return vMarker || null;
},
 
//Remove the given object from the given array
_arraySplice: function (anArray, obj) {
for (var i = anArray.length - 1; i >= 0; i--) {
if (anArray[i] === obj) {
anArray.splice(i, 1);
return true;
}
}
},
 
//Internal function for removing a marker from everything.
//dontUpdateMap: set to true if you will handle updating the map manually (for bulk functions)
_removeLayer: function (marker, removeFromDistanceGrid, dontUpdateMap) {
var gridClusters = this._gridClusters,
gridUnclustered = this._gridUnclustered,
fg = this._featureGroup,
map = this._map;
 
//Remove the marker from distance clusters it might be in
if (removeFromDistanceGrid) {
for (var z = this._maxZoom; z >= 0; z--) {
if (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) {
break;
}
}
}
 
//Work our way up the clusters removing them as we go if required
var cluster = marker.__parent,
markers = cluster._markers,
otherMarker;
 
//Remove the marker from the immediate parents marker list
this._arraySplice(markers, marker);
 
while (cluster) {
cluster._childCount--;
 
if (cluster._zoom < 0) {
//Top level, do nothing
break;
} else if (removeFromDistanceGrid && cluster._childCount <= 1) { //Cluster no longer required
//We need to push the other marker up to the parent
otherMarker = cluster._markers[0] === marker ? cluster._markers[1] : cluster._markers[0];
 
//Update distance grid
gridClusters[cluster._zoom].removeObject(cluster, map.project(cluster._cLatLng, cluster._zoom));
gridUnclustered[cluster._zoom].addObject(otherMarker, map.project(otherMarker.getLatLng(), cluster._zoom));
 
//Move otherMarker up to parent
this._arraySplice(cluster.__parent._childClusters, cluster);
cluster.__parent._markers.push(otherMarker);
otherMarker.__parent = cluster.__parent;
 
if (cluster._icon) {
//Cluster is currently on the map, need to put the marker on the map instead
fg.removeLayer(cluster);
if (!dontUpdateMap) {
fg.addLayer(otherMarker);
}
}
} else {
cluster._recalculateBounds();
if (!dontUpdateMap || !cluster._icon) {
cluster._updateIcon();
}
}
 
cluster = cluster.__parent;
}
 
delete marker.__parent;
},
 
_isOrIsParent: function (el, oel) {
while (oel) {
if (el === oel) {
return true;
}
oel = oel.parentNode;
}
return false;
},
 
_propagateEvent: function (e) {
if (e.layer instanceof L.MarkerCluster) {
//Prevent multiple clustermouseover/off events if the icon is made up of stacked divs (Doesn't work in ie <= 8, no relatedTarget)
if (e.originalEvent && this._isOrIsParent(e.layer._icon, e.originalEvent.relatedTarget)) {
return;
}
e.type = 'cluster' + e.type;
}
 
this.fire(e.type, e);
},
 
//Default functionality
_defaultIconCreateFunction: function (cluster) {
var childCount = cluster.getChildCount();
 
var c = ' marker-cluster-';
if (childCount < 10) {
c += 'small';
} else if (childCount < 100) {
c += 'medium';
} else {
c += 'large';
}
 
return new L.DivIcon({ html: '<div><span>' + childCount + '</span></div>', className: 'marker-cluster' + c, iconSize: new L.Point(40, 40) });
},
 
_bindEvents: function () {
var map = this._map,
spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,
showCoverageOnHover = this.options.showCoverageOnHover,
zoomToBoundsOnClick = this.options.zoomToBoundsOnClick;
 
//Zoom on cluster click or spiderfy if we are at the lowest level
if (spiderfyOnMaxZoom || zoomToBoundsOnClick) {
this.on('clusterclick', this._zoomOrSpiderfy, this);
}
 
//Show convex hull (boundary) polygon on mouse over
if (showCoverageOnHover) {
this.on('clustermouseover', this._showCoverage, this);
this.on('clustermouseout', this._hideCoverage, this);
map.on('zoomend', this._hideCoverage, this);
}
},
 
_zoomOrSpiderfy: function (e) {
var map = this._map;
if (map.getMaxZoom() === map.getZoom()) {
if (this.options.spiderfyOnMaxZoom) {
e.layer.spiderfy();
}
} else if (this.options.zoomToBoundsOnClick) {
e.layer.zoomToBounds();
}
 
// Focus the map again for keyboard users.
if (e.originalEvent && e.originalEvent.keyCode === 13) {
map._container.focus();
}
},
 
_showCoverage: function (e) {
var map = this._map;
if (this._inZoomAnimation) {
return;
}
if (this._shownPolygon) {
map.removeLayer(this._shownPolygon);
}
if (e.layer.getChildCount() > 2 && e.layer !== this._spiderfied) {
this._shownPolygon = new L.Polygon(e.layer.getConvexHull(), this.options.polygonOptions);
map.addLayer(this._shownPolygon);
}
},
 
_hideCoverage: function () {
if (this._shownPolygon) {
this._map.removeLayer(this._shownPolygon);
this._shownPolygon = null;
}
},
 
_unbindEvents: function () {
var spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,
showCoverageOnHover = this.options.showCoverageOnHover,
zoomToBoundsOnClick = this.options.zoomToBoundsOnClick,
map = this._map;
 
if (spiderfyOnMaxZoom || zoomToBoundsOnClick) {
this.off('clusterclick', this._zoomOrSpiderfy, this);
}
if (showCoverageOnHover) {
this.off('clustermouseover', this._showCoverage, this);
this.off('clustermouseout', this._hideCoverage, this);
map.off('zoomend', this._hideCoverage, this);
}
},
 
_zoomEnd: function () {
if (!this._map) { //May have been removed from the map by a zoomEnd handler
return;
}
this._mergeSplitClusters();
 
this._zoom = this._map._zoom;
this._currentShownBounds = this._getExpandedVisibleBounds();
},
 
_moveEnd: function () {
if (this._inZoomAnimation) {
return;
}
 
var newBounds = this._getExpandedVisibleBounds();
 
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, this._zoom, newBounds);
this._topClusterLevel._recursivelyAddChildrenToMap(null, this._map._zoom, newBounds);
 
this._currentShownBounds = newBounds;
return;
},
 
_generateInitialClusters: function () {
var maxZoom = this._map.getMaxZoom(),
radius = this.options.maxClusterRadius,
radiusFn = radius;
//If we just set maxClusterRadius to a single number, we need to create
//a simple function to return that number. Otherwise, we just have to
//use the function we've passed in.
if (typeof radius !== "function") {
radiusFn = function () { return radius; };
}
 
if (this.options.disableClusteringAtZoom) {
maxZoom = this.options.disableClusteringAtZoom - 1;
}
this._maxZoom = maxZoom;
this._gridClusters = {};
this._gridUnclustered = {};
//Set up DistanceGrids for each zoom
for (var zoom = maxZoom; zoom >= 0; zoom--) {
this._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom));
this._gridUnclustered[zoom] = new L.DistanceGrid(radiusFn(zoom));
}
 
this._topClusterLevel = new L.MarkerCluster(this, -1);
},
 
//Zoom: Zoom to start adding at (Pass this._maxZoom to start at the bottom)
_addLayer: function (layer, zoom) {
var gridClusters = this._gridClusters,
gridUnclustered = this._gridUnclustered,
markerPoint, z;
 
if (this.options.singleMarkerMode) {
layer.options.icon = this.options.iconCreateFunction({
getChildCount: function () {
return 1;
},
getAllChildMarkers: function () {
return [layer];
}
});
}
 
//Find the lowest zoom level to slot this one in
for (; zoom >= 0; zoom--) {
markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position
 
//Try find a cluster close by
var closest = gridClusters[zoom].getNearObject(markerPoint);
if (closest) {
closest._addChild(layer);
layer.__parent = closest;
return;
}
 
//Try find a marker close by to form a new cluster with
closest = gridUnclustered[zoom].getNearObject(markerPoint);
if (closest) {
var parent = closest.__parent;
if (parent) {
this._removeLayer(closest, false);
}
 
//Create new cluster with these 2 in it
 
var newCluster = new L.MarkerCluster(this, zoom, closest, layer);
gridClusters[zoom].addObject(newCluster, this._map.project(newCluster._cLatLng, zoom));
closest.__parent = newCluster;
layer.__parent = newCluster;
 
//First create any new intermediate parent clusters that don't exist
var lastParent = newCluster;
for (z = zoom - 1; z > parent._zoom; z--) {
lastParent = new L.MarkerCluster(this, z, lastParent);
gridClusters[z].addObject(lastParent, this._map.project(closest.getLatLng(), z));
}
parent._addChild(lastParent);
 
//Remove closest from this zoom level and any above that it is in, replace with newCluster
for (z = zoom; z >= 0; z--) {
if (!gridUnclustered[z].removeObject(closest, this._map.project(closest.getLatLng(), z))) {
break;
}
}
 
return;
}
 
//Didn't manage to cluster in at this zoom, record us as a marker here and continue upwards
gridUnclustered[zoom].addObject(layer, markerPoint);
}
 
//Didn't get in anything, add us to the top
this._topClusterLevel._addChild(layer);
layer.__parent = this._topClusterLevel;
return;
},
 
//Enqueue code to fire after the marker expand/contract has happened
_enqueue: function (fn) {
this._queue.push(fn);
if (!this._queueTimeout) {
this._queueTimeout = setTimeout(L.bind(this._processQueue, this), 300);
}
},
_processQueue: function () {
for (var i = 0; i < this._queue.length; i++) {
this._queue[i].call(this);
}
this._queue.length = 0;
clearTimeout(this._queueTimeout);
this._queueTimeout = null;
},
 
//Merge and split any existing clusters that are too big or small
_mergeSplitClusters: function () {
 
//Incase we are starting to split before the animation finished
this._processQueue();
 
if (this._zoom < this._map._zoom && this._currentShownBounds.intersects(this._getExpandedVisibleBounds())) { //Zoom in, split
this._animationStart();
//Remove clusters now off screen
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, this._zoom, this._getExpandedVisibleBounds());
 
this._animationZoomIn(this._zoom, this._map._zoom);
 
} else if (this._zoom > this._map._zoom) { //Zoom out, merge
this._animationStart();
 
this._animationZoomOut(this._zoom, this._map._zoom);
} else {
this._moveEnd();
}
},
 
//Gets the maps visible bounds expanded in each direction by the size of the screen (so the user cannot see an area we do not cover in one pan)
_getExpandedVisibleBounds: function () {
if (!this.options.removeOutsideVisibleBounds) {
return this.getBounds();
}
 
var map = this._map,
bounds = map.getBounds(),
sw = bounds._southWest,
ne = bounds._northEast,
latDiff = L.Browser.mobile ? 0 : Math.abs(sw.lat - ne.lat),
lngDiff = L.Browser.mobile ? 0 : Math.abs(sw.lng - ne.lng);
 
return new L.LatLngBounds(
new L.LatLng(sw.lat - latDiff, sw.lng - lngDiff, true),
new L.LatLng(ne.lat + latDiff, ne.lng + lngDiff, true));
},
 
//Shared animation code
_animationAddLayerNonAnimated: function (layer, newCluster) {
if (newCluster === layer) {
this._featureGroup.addLayer(layer);
} else if (newCluster._childCount === 2) {
newCluster._addToMap();
 
var markers = newCluster.getAllChildMarkers();
this._featureGroup.removeLayer(markers[0]);
this._featureGroup.removeLayer(markers[1]);
} else {
newCluster._updateIcon();
}
}
});
 
L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 
//Non Animated versions of everything
_animationStart: function () {
//Do nothing...
},
_animationZoomIn: function (previousZoomLevel, newZoomLevel) {
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel);
this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
 
//We didn't actually animate, but we use this event to mean "clustering animations have finished"
this.fire('animationend');
},
_animationZoomOut: function (previousZoomLevel, newZoomLevel) {
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel);
this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
 
//We didn't actually animate, but we use this event to mean "clustering animations have finished"
this.fire('animationend');
},
_animationAddLayer: function (layer, newCluster) {
this._animationAddLayerNonAnimated(layer, newCluster);
}
} : {
 
//Animated versions here
_animationStart: function () {
this._map._mapPane.className += ' leaflet-cluster-anim';
this._inZoomAnimation++;
},
_animationEnd: function () {
if (this._map) {
this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');
}
this._inZoomAnimation--;
this.fire('animationend');
},
_animationZoomIn: function (previousZoomLevel, newZoomLevel) {
var bounds = this._getExpandedVisibleBounds(),
fg = this._featureGroup,
i;
 
//Add all children of current clusters to map and remove those clusters from map
this._topClusterLevel._recursively(bounds, previousZoomLevel, 0, function (c) {
var startPos = c._latlng,
markers = c._markers,
m;
 
if (!bounds.contains(startPos)) {
startPos = null;
}
 
if (c._isSingleParent() && previousZoomLevel + 1 === newZoomLevel) { //Immediately add the new child and remove us
fg.removeLayer(c);
c._recursivelyAddChildrenToMap(null, newZoomLevel, bounds);
} else {
//Fade out old cluster
c.setOpacity(0);
c._recursivelyAddChildrenToMap(startPos, newZoomLevel, bounds);
}
 
//Remove all markers that aren't visible any more
//TODO: Do we actually need to do this on the higher levels too?
for (i = markers.length - 1; i >= 0; i--) {
m = markers[i];
if (!bounds.contains(m._latlng)) {
fg.removeLayer(m);
}
}
 
});
 
this._forceLayout();
 
//Update opacities
this._topClusterLevel._recursivelyBecomeVisible(bounds, newZoomLevel);
//TODO Maybe? Update markers in _recursivelyBecomeVisible
fg.eachLayer(function (n) {
if (!(n instanceof L.MarkerCluster) && n._icon) {
n.setOpacity(1);
}
});
 
//update the positions of the just added clusters/markers
this._topClusterLevel._recursively(bounds, previousZoomLevel, newZoomLevel, function (c) {
c._recursivelyRestoreChildPositions(newZoomLevel);
});
 
//Remove the old clusters and close the zoom animation
this._enqueue(function () {
//update the positions of the just added clusters/markers
this._topClusterLevel._recursively(bounds, previousZoomLevel, 0, function (c) {
fg.removeLayer(c);
c.setOpacity(1);
});
 
this._animationEnd();
});
},
 
_animationZoomOut: function (previousZoomLevel, newZoomLevel) {
this._animationZoomOutSingle(this._topClusterLevel, previousZoomLevel - 1, newZoomLevel);
 
//Need to add markers for those that weren't on the map before but are now
this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
//Remove markers that were on the map before but won't be now
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel, this._getExpandedVisibleBounds());
},
_animationZoomOutSingle: function (cluster, previousZoomLevel, newZoomLevel) {
var bounds = this._getExpandedVisibleBounds();
 
//Animate all of the markers in the clusters to move to their cluster center point
cluster._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, previousZoomLevel + 1, newZoomLevel);
 
var me = this;
 
//Update the opacity (If we immediately set it they won't animate)
this._forceLayout();
cluster._recursivelyBecomeVisible(bounds, newZoomLevel);
 
//TODO: Maybe use the transition timing stuff to make this more reliable
//When the animations are done, tidy up
this._enqueue(function () {
 
//This cluster stopped being a cluster before the timeout fired
if (cluster._childCount === 1) {
var m = cluster._markers[0];
//If we were in a cluster animation at the time then the opacity and position of our child could be wrong now, so fix it
m.setLatLng(m.getLatLng());
if (m.setOpacity) {
m.setOpacity(1);
}
} else {
cluster._recursively(bounds, newZoomLevel, 0, function (c) {
c._recursivelyRemoveChildrenFromMap(bounds, previousZoomLevel + 1);
});
}
me._animationEnd();
});
},
_animationAddLayer: function (layer, newCluster) {
var me = this,
fg = this._featureGroup;
 
fg.addLayer(layer);
if (newCluster !== layer) {
if (newCluster._childCount > 2) { //Was already a cluster
 
newCluster._updateIcon();
this._forceLayout();
this._animationStart();
 
layer._setPos(this._map.latLngToLayerPoint(newCluster.getLatLng()));
layer.setOpacity(0);
 
this._enqueue(function () {
fg.removeLayer(layer);
layer.setOpacity(1);
 
me._animationEnd();
});
 
} else { //Just became a cluster
this._forceLayout();
 
me._animationStart();
me._animationZoomOutSingle(newCluster, this._map.getMaxZoom(), this._map.getZoom());
}
}
},
 
//Force a browser layout of stuff in the map
// Should apply the current opacity and location to all elements so we can update them again for an animation
_forceLayout: function () {
//In my testing this works, infact offsetWidth of any element seems to work.
//Could loop all this._layers and do this for each _icon if it stops working
 
L.Util.falseFn(document.body.offsetWidth);
}
});
 
L.markerClusterGroup = function (options) {
return new L.MarkerClusterGroup(options);
};
 
 
L.MarkerCluster = L.Marker.extend({
initialize: function (group, zoom, a, b) {
 
L.Marker.prototype.initialize.call(this, a ? (a._cLatLng || a.getLatLng()) : new L.LatLng(0, 0), { icon: this });
 
 
this._group = group;
this._zoom = zoom;
 
this._markers = [];
this._childClusters = [];
this._childCount = 0;
this._iconNeedsUpdate = true;
 
this._bounds = new L.LatLngBounds();
 
if (a) {
this._addChild(a);
}
if (b) {
this._addChild(b);
}
},
 
//Recursively retrieve all child markers of this cluster
getAllChildMarkers: function (storageArray) {
storageArray = storageArray || [];
 
for (var i = this._childClusters.length - 1; i >= 0; i--) {
this._childClusters[i].getAllChildMarkers(storageArray);
}
 
for (var j = this._markers.length - 1; j >= 0; j--) {
storageArray.push(this._markers[j]);
}
 
return storageArray;
},
 
//Returns the count of how many child markers we have
getChildCount: function () {
return this._childCount;
},
 
//Zoom to the minimum of showing all of the child markers, or the extents of this cluster
zoomToBounds: function () {
var childClusters = this._childClusters.slice(),
map = this._group._map,
boundsZoom = map.getBoundsZoom(this._bounds),
zoom = this._zoom + 1,
mapZoom = map.getZoom(),
i;
 
//calculate how far we need to zoom down to see all of the markers
while (childClusters.length > 0 && boundsZoom > zoom) {
zoom++;
var newClusters = [];
for (i = 0; i < childClusters.length; i++) {
newClusters = newClusters.concat(childClusters[i]._childClusters);
}
childClusters = newClusters;
}
 
if (boundsZoom > zoom) {
this._group._map.setView(this._latlng, zoom);
} else if (boundsZoom <= mapZoom) { //If fitBounds wouldn't zoom us down, zoom us down instead
this._group._map.setView(this._latlng, mapZoom + 1);
} else {
this._group._map.fitBounds(this._bounds);
}
},
 
getBounds: function () {
var bounds = new L.LatLngBounds();
bounds.extend(this._bounds);
return bounds;
},
 
_updateIcon: function () {
this._iconNeedsUpdate = true;
if (this._icon) {
this.setIcon(this);
}
},
 
//Cludge for Icon, we pretend to be an icon for performance
createIcon: function () {
if (this._iconNeedsUpdate) {
this._iconObj = this._group.options.iconCreateFunction(this);
this._iconNeedsUpdate = false;
}
return this._iconObj.createIcon();
},
createShadow: function () {
return this._iconObj.createShadow();
},
 
 
_addChild: function (new1, isNotificationFromChild) {
 
this._iconNeedsUpdate = true;
this._expandBounds(new1);
 
if (new1 instanceof L.MarkerCluster) {
if (!isNotificationFromChild) {
this._childClusters.push(new1);
new1.__parent = this;
}
this._childCount += new1._childCount;
} else {
if (!isNotificationFromChild) {
this._markers.push(new1);
}
this._childCount++;
}
 
if (this.__parent) {
this.__parent._addChild(new1, true);
}
},
 
//Expand our bounds and tell our parent to
_expandBounds: function (marker) {
var addedCount,
addedLatLng = marker._wLatLng || marker._latlng;
 
if (marker instanceof L.MarkerCluster) {
this._bounds.extend(marker._bounds);
addedCount = marker._childCount;
} else {
this._bounds.extend(addedLatLng);
addedCount = 1;
}
 
if (!this._cLatLng) {
// when clustering, take position of the first point as the cluster center
this._cLatLng = marker._cLatLng || addedLatLng;
}
 
// when showing clusters, take weighted average of all points as cluster center
var totalCount = this._childCount + addedCount;
 
//Calculate weighted latlng for display
if (!this._wLatLng) {
this._latlng = this._wLatLng = new L.LatLng(addedLatLng.lat, addedLatLng.lng);
} else {
this._wLatLng.lat = (addedLatLng.lat * addedCount + this._wLatLng.lat * this._childCount) / totalCount;
this._wLatLng.lng = (addedLatLng.lng * addedCount + this._wLatLng.lng * this._childCount) / totalCount;
}
},
 
//Set our markers position as given and add it to the map
_addToMap: function (startPos) {
if (startPos) {
this._backupLatlng = this._latlng;
this.setLatLng(startPos);
}
this._group._featureGroup.addLayer(this);
},
 
_recursivelyAnimateChildrenIn: function (bounds, center, maxZoom) {
this._recursively(bounds, 0, maxZoom - 1,
function (c) {
var markers = c._markers,
i, m;
for (i = markers.length - 1; i >= 0; i--) {
m = markers[i];
 
//Only do it if the icon is still on the map
if (m._icon) {
m._setPos(center);
m.setOpacity(0);
}
}
},
function (c) {
var childClusters = c._childClusters,
j, cm;
for (j = childClusters.length - 1; j >= 0; j--) {
cm = childClusters[j];
if (cm._icon) {
cm._setPos(center);
cm.setOpacity(0);
}
}
}
);
},
 
_recursivelyAnimateChildrenInAndAddSelfToMap: function (bounds, previousZoomLevel, newZoomLevel) {
this._recursively(bounds, newZoomLevel, 0,
function (c) {
c._recursivelyAnimateChildrenIn(bounds, c._group._map.latLngToLayerPoint(c.getLatLng()).round(), previousZoomLevel);
 
//TODO: depthToAnimateIn affects _isSingleParent, if there is a multizoom we may/may not be.
//As a hack we only do a animation free zoom on a single level zoom, if someone does multiple levels then we always animate
if (c._isSingleParent() && previousZoomLevel - 1 === newZoomLevel) {
c.setOpacity(1);
c._recursivelyRemoveChildrenFromMap(bounds, previousZoomLevel); //Immediately remove our children as we are replacing them. TODO previousBounds not bounds
} else {
c.setOpacity(0);
}
 
c._addToMap();
}
);
},
 
_recursivelyBecomeVisible: function (bounds, zoomLevel) {
this._recursively(bounds, 0, zoomLevel, null, function (c) {
c.setOpacity(1);
});
},
 
_recursivelyAddChildrenToMap: function (startPos, zoomLevel, bounds) {
this._recursively(bounds, -1, zoomLevel,
function (c) {
if (zoomLevel === c._zoom) {
return;
}
 
//Add our child markers at startPos (so they can be animated out)
for (var i = c._markers.length - 1; i >= 0; i--) {
var nm = c._markers[i];
 
if (!bounds.contains(nm._latlng)) {
continue;
}
 
if (startPos) {
nm._backupLatlng = nm.getLatLng();
 
nm.setLatLng(startPos);
if (nm.setOpacity) {
nm.setOpacity(0);
}
}
 
c._group._featureGroup.addLayer(nm);
}
},
function (c) {
c._addToMap(startPos);
}
);
},
 
_recursivelyRestoreChildPositions: function (zoomLevel) {
//Fix positions of child markers
for (var i = this._markers.length - 1; i >= 0; i--) {
var nm = this._markers[i];
if (nm._backupLatlng) {
nm.setLatLng(nm._backupLatlng);
delete nm._backupLatlng;
}
}
 
if (zoomLevel - 1 === this._zoom) {
//Reposition child clusters
for (var j = this._childClusters.length - 1; j >= 0; j--) {
this._childClusters[j]._restorePosition();
}
} else {
for (var k = this._childClusters.length - 1; k >= 0; k--) {
this._childClusters[k]._recursivelyRestoreChildPositions(zoomLevel);
}
}
},
 
_restorePosition: function () {
if (this._backupLatlng) {
this.setLatLng(this._backupLatlng);
delete this._backupLatlng;
}
},
 
//exceptBounds: If set, don't remove any markers/clusters in it
_recursivelyRemoveChildrenFromMap: function (previousBounds, zoomLevel, exceptBounds) {
var m, i;
this._recursively(previousBounds, -1, zoomLevel - 1,
function (c) {
//Remove markers at every level
for (i = c._markers.length - 1; i >= 0; i--) {
m = c._markers[i];
if (!exceptBounds || !exceptBounds.contains(m._latlng)) {
c._group._featureGroup.removeLayer(m);
if (m.setOpacity) {
m.setOpacity(1);
}
}
}
},
function (c) {
//Remove child clusters at just the bottom level
for (i = c._childClusters.length - 1; i >= 0; i--) {
m = c._childClusters[i];
if (!exceptBounds || !exceptBounds.contains(m._latlng)) {
c._group._featureGroup.removeLayer(m);
if (m.setOpacity) {
m.setOpacity(1);
}
}
}
}
);
},
 
//Run the given functions recursively to this and child clusters
// boundsToApplyTo: a L.LatLngBounds representing the bounds of what clusters to recurse in to
// zoomLevelToStart: zoom level to start running functions (inclusive)
// zoomLevelToStop: zoom level to stop running functions (inclusive)
// runAtEveryLevel: function that takes an L.MarkerCluster as an argument that should be applied on every level
// runAtBottomLevel: function that takes an L.MarkerCluster as an argument that should be applied at only the bottom level
_recursively: function (boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel) {
var childClusters = this._childClusters,
zoom = this._zoom,
i, c;
 
if (zoomLevelToStart > zoom) { //Still going down to required depth, just recurse to child clusters
for (i = childClusters.length - 1; i >= 0; i--) {
c = childClusters[i];
if (boundsToApplyTo.intersects(c._bounds)) {
c._recursively(boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel);
}
}
} else { //In required depth
 
if (runAtEveryLevel) {
runAtEveryLevel(this);
}
if (runAtBottomLevel && this._zoom === zoomLevelToStop) {
runAtBottomLevel(this);
}
 
//TODO: This loop is almost the same as above
if (zoomLevelToStop > zoom) {
for (i = childClusters.length - 1; i >= 0; i--) {
c = childClusters[i];
if (boundsToApplyTo.intersects(c._bounds)) {
c._recursively(boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel);
}
}
}
}
},
 
_recalculateBounds: function () {
var markers = this._markers,
childClusters = this._childClusters,
i;
 
this._bounds = new L.LatLngBounds();
delete this._wLatLng;
 
for (i = markers.length - 1; i >= 0; i--) {
this._expandBounds(markers[i]);
}
for (i = childClusters.length - 1; i >= 0; i--) {
this._expandBounds(childClusters[i]);
}
},
 
 
//Returns true if we are the parent of only one cluster and that cluster is the same as us
_isSingleParent: function () {
//Don't need to check this._markers as the rest won't work if there are any
return this._childClusters.length > 0 && this._childClusters[0]._childCount === this._childCount;
}
});
 
 
 
L.DistanceGrid = function (cellSize) {
this._cellSize = cellSize;
this._sqCellSize = cellSize * cellSize;
this._grid = {};
this._objectPoint = { };
};
 
L.DistanceGrid.prototype = {
 
addObject: function (obj, point) {
var x = this._getCoord(point.x),
y = this._getCoord(point.y),
grid = this._grid,
row = grid[y] = grid[y] || {},
cell = row[x] = row[x] || [],
stamp = L.Util.stamp(obj);
 
this._objectPoint[stamp] = point;
 
cell.push(obj);
},
 
updateObject: function (obj, point) {
this.removeObject(obj);
this.addObject(obj, point);
},
 
//Returns true if the object was found
removeObject: function (obj, point) {
var x = this._getCoord(point.x),
y = this._getCoord(point.y),
grid = this._grid,
row = grid[y] = grid[y] || {},
cell = row[x] = row[x] || [],
i, len;
 
delete this._objectPoint[L.Util.stamp(obj)];
 
for (i = 0, len = cell.length; i < len; i++) {
if (cell[i] === obj) {
 
cell.splice(i, 1);
 
if (len === 1) {
delete row[x];
}
 
return true;
}
}
 
},
 
eachObject: function (fn, context) {
var i, j, k, len, row, cell, removed,
grid = this._grid;
 
for (i in grid) {
row = grid[i];
 
for (j in row) {
cell = row[j];
 
for (k = 0, len = cell.length; k < len; k++) {
removed = fn.call(context, cell[k]);
if (removed) {
k--;
len--;
}
}
}
}
},
 
getNearObject: function (point) {
var x = this._getCoord(point.x),
y = this._getCoord(point.y),
i, j, k, row, cell, len, obj, dist,
objectPoint = this._objectPoint,
closestDistSq = this._sqCellSize,
closest = null;
 
for (i = y - 1; i <= y + 1; i++) {
row = this._grid[i];
if (row) {
 
for (j = x - 1; j <= x + 1; j++) {
cell = row[j];
if (cell) {
 
for (k = 0, len = cell.length; k < len; k++) {
obj = cell[k];
dist = this._sqDist(objectPoint[L.Util.stamp(obj)], point);
if (dist < closestDistSq) {
closestDistSq = dist;
closest = obj;
}
}
}
}
}
}
return closest;
},
 
_getCoord: function (x) {
return Math.floor(x / this._cellSize);
},
 
_sqDist: function (p, p2) {
var dx = p2.x - p.x,
dy = p2.y - p.y;
return dx * dx + dy * dy;
}
};
 
 
/* Copyright (c) 2012 the authors listed at the following URL, and/or
the authors of referenced articles or incorporated external code:
http://en.literateprograms.org/Quickhull_(Javascript)?action=history&offset=20120410175256
 
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
 
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
Retrieved from: http://en.literateprograms.org/Quickhull_(Javascript)?oldid=18434
*/
 
(function () {
L.QuickHull = {
 
/*
* @param {Object} cpt a point to be measured from the baseline
* @param {Array} bl the baseline, as represented by a two-element
* array of latlng objects.
* @returns {Number} an approximate distance measure
*/
getDistant: function (cpt, bl) {
var vY = bl[1].lat - bl[0].lat,
vX = bl[0].lng - bl[1].lng;
return (vX * (cpt.lat - bl[0].lat) + vY * (cpt.lng - bl[0].lng));
},
 
/*
* @param {Array} baseLine a two-element array of latlng objects
* representing the baseline to project from
* @param {Array} latLngs an array of latlng objects
* @returns {Object} the maximum point and all new points to stay
* in consideration for the hull.
*/
findMostDistantPointFromBaseLine: function (baseLine, latLngs) {
var maxD = 0,
maxPt = null,
newPoints = [],
i, pt, d;
 
for (i = latLngs.length - 1; i >= 0; i--) {
pt = latLngs[i];
d = this.getDistant(pt, baseLine);
 
if (d > 0) {
newPoints.push(pt);
} else {
continue;
}
 
if (d > maxD) {
maxD = d;
maxPt = pt;
}
}
 
return { maxPoint: maxPt, newPoints: newPoints };
},
 
 
/*
* Given a baseline, compute the convex hull of latLngs as an array
* of latLngs.
*
* @param {Array} latLngs
* @returns {Array}
*/
buildConvexHull: function (baseLine, latLngs) {
var convexHullBaseLines = [],
t = this.findMostDistantPointFromBaseLine(baseLine, latLngs);
 
if (t.maxPoint) { // if there is still a point "outside" the base line
convexHullBaseLines =
convexHullBaseLines.concat(
this.buildConvexHull([baseLine[0], t.maxPoint], t.newPoints)
);
convexHullBaseLines =
convexHullBaseLines.concat(
this.buildConvexHull([t.maxPoint, baseLine[1]], t.newPoints)
);
return convexHullBaseLines;
} else { // if there is no more point "outside" the base line, the current base line is part of the convex hull
return [baseLine[0]];
}
},
 
/*
* Given an array of latlngs, compute a convex hull as an array
* of latlngs
*
* @param {Array} latLngs
* @returns {Array}
*/
getConvexHull: function (latLngs) {
// find first baseline
var maxLat = false, minLat = false,
maxPt = null, minPt = null,
i;
 
for (i = latLngs.length - 1; i >= 0; i--) {
var pt = latLngs[i];
if (maxLat === false || pt.lat > maxLat) {
maxPt = pt;
maxLat = pt.lat;
}
if (minLat === false || pt.lat < minLat) {
minPt = pt;
minLat = pt.lat;
}
}
var ch = [].concat(this.buildConvexHull([minPt, maxPt], latLngs),
this.buildConvexHull([maxPt, minPt], latLngs));
return ch;
}
};
}());
 
L.MarkerCluster.include({
getConvexHull: function () {
var childMarkers = this.getAllChildMarkers(),
points = [],
p, i;
 
for (i = childMarkers.length - 1; i >= 0; i--) {
p = childMarkers[i].getLatLng();
points.push(p);
}
 
return L.QuickHull.getConvexHull(points);
}
});
 
 
//This code is 100% based on https://github.com/jawj/OverlappingMarkerSpiderfier-Leaflet
//Huge thanks to jawj for implementing it first to make my job easy :-)
 
L.MarkerCluster.include({
 
_2PI: Math.PI * 2,
_circleFootSeparation: 25, //related to circumference of circle
_circleStartAngle: Math.PI / 6,
 
_spiralFootSeparation: 28, //related to size of spiral (experiment!)
_spiralLengthStart: 11,
_spiralLengthFactor: 5,
 
_circleSpiralSwitchover: 9, //show spiral instead of circle from this marker count upwards.
// 0 -> always spiral; Infinity -> always circle
 
spiderfy: function () {
if (this._group._spiderfied === this || this._group._inZoomAnimation) {
return;
}
 
var childMarkers = this.getAllChildMarkers(),
group = this._group,
map = group._map,
center = map.latLngToLayerPoint(this._latlng),
positions;
 
this._group._unspiderfy();
this._group._spiderfied = this;
 
//TODO Maybe: childMarkers order by distance to center
 
if (childMarkers.length >= this._circleSpiralSwitchover) {
positions = this._generatePointsSpiral(childMarkers.length, center);
} else {
center.y += 10; //Otherwise circles look wrong
positions = this._generatePointsCircle(childMarkers.length, center);
}
 
this._animationSpiderfy(childMarkers, positions);
},
 
unspiderfy: function (zoomDetails) {
/// <param Name="zoomDetails">Argument from zoomanim if being called in a zoom animation or null otherwise</param>
if (this._group._inZoomAnimation) {
return;
}
this._animationUnspiderfy(zoomDetails);
 
this._group._spiderfied = null;
},
 
_generatePointsCircle: function (count, centerPt) {
var circumference = this._group.options.spiderfyDistanceMultiplier * this._circleFootSeparation * (2 + count),
legLength = circumference / this._2PI, //radius from circumference
angleStep = this._2PI / count,
res = [],
i, angle;
 
res.length = count;
 
for (i = count - 1; i >= 0; i--) {
angle = this._circleStartAngle + i * angleStep;
res[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();
}
 
return res;
},
 
_generatePointsSpiral: function (count, centerPt) {
var legLength = this._group.options.spiderfyDistanceMultiplier * this._spiralLengthStart,
separation = this._group.options.spiderfyDistanceMultiplier * this._spiralFootSeparation,
lengthFactor = this._group.options.spiderfyDistanceMultiplier * this._spiralLengthFactor,
angle = 0,
res = [],
i;
 
res.length = count;
 
for (i = count - 1; i >= 0; i--) {
angle += separation / legLength + i * 0.0005;
res[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();
legLength += this._2PI * lengthFactor / angle;
}
return res;
},
 
_noanimationUnspiderfy: function () {
var group = this._group,
map = group._map,
fg = group._featureGroup,
childMarkers = this.getAllChildMarkers(),
m, i;
 
this.setOpacity(1);
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
 
fg.removeLayer(m);
 
if (m._preSpiderfyLatlng) {
m.setLatLng(m._preSpiderfyLatlng);
delete m._preSpiderfyLatlng;
}
if (m.setZIndexOffset) {
m.setZIndexOffset(0);
}
 
if (m._spiderLeg) {
map.removeLayer(m._spiderLeg);
delete m._spiderLeg;
}
}
 
group._spiderfied = null;
}
});
 
L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
//Non Animated versions of everything
_animationSpiderfy: function (childMarkers, positions) {
var group = this._group,
map = group._map,
fg = group._featureGroup,
i, m, leg, newPos;
 
for (i = childMarkers.length - 1; i >= 0; i--) {
newPos = map.layerPointToLatLng(positions[i]);
m = childMarkers[i];
 
m._preSpiderfyLatlng = m._latlng;
m.setLatLng(newPos);
if (m.setZIndexOffset) {
m.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING
}
 
fg.addLayer(m);
 
 
leg = new L.Polyline([this._latlng, newPos], { weight: 1.5, color: '#222' });
map.addLayer(leg);
m._spiderLeg = leg;
}
this.setOpacity(0.3);
group.fire('spiderfied');
},
 
_animationUnspiderfy: function () {
this._noanimationUnspiderfy();
}
} : {
//Animated versions here
SVG_ANIMATION: (function () {
return document.createElementNS('http://www.w3.org/2000/svg', 'animate').toString().indexOf('SVGAnimate') > -1;
}()),
 
_animationSpiderfy: function (childMarkers, positions) {
var me = this,
group = this._group,
map = group._map,
fg = group._featureGroup,
thisLayerPos = map.latLngToLayerPoint(this._latlng),
i, m, leg, newPos;
 
//Add markers to map hidden at our center point
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
 
//If it is a marker, add it now and we'll animate it out
if (m.setOpacity) {
m.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING
m.setOpacity(0);
fg.addLayer(m);
 
m._setPos(thisLayerPos);
} else {
//Vectors just get immediately added
fg.addLayer(m);
}
}
 
group._forceLayout();
group._animationStart();
 
var initialLegOpacity = L.Path.SVG ? 0 : 0.3,
xmlns = L.Path.SVG_NS;
 
 
for (i = childMarkers.length - 1; i >= 0; i--) {
newPos = map.layerPointToLatLng(positions[i]);
m = childMarkers[i];
 
//Move marker to new position
m._preSpiderfyLatlng = m._latlng;
m.setLatLng(newPos);
if (m.setOpacity) {
m.setOpacity(1);
}
 
 
//Add Legs.
leg = new L.Polyline([me._latlng, newPos], { weight: 1.5, color: '#222', opacity: initialLegOpacity });
map.addLayer(leg);
m._spiderLeg = leg;
 
//Following animations don't work for canvas
if (!L.Path.SVG || !this.SVG_ANIMATION) {
continue;
}
 
//How this works:
//http://stackoverflow.com/questions/5924238/how-do-you-animate-an-svg-path-in-ios
//http://dev.opera.com/articles/view/advanced-svg-animation-techniques/
 
//Animate length
var length = leg._path.getTotalLength();
leg._path.setAttribute("stroke-dasharray", length + "," + length);
 
var anim = document.createElementNS(xmlns, "animate");
anim.setAttribute("attributeName", "stroke-dashoffset");
anim.setAttribute("begin", "indefinite");
anim.setAttribute("from", length);
anim.setAttribute("to", 0);
anim.setAttribute("dur", 0.25);
leg._path.appendChild(anim);
anim.beginElement();
 
//Animate opacity
anim = document.createElementNS(xmlns, "animate");
anim.setAttribute("attributeName", "stroke-opacity");
anim.setAttribute("attributeName", "stroke-opacity");
anim.setAttribute("begin", "indefinite");
anim.setAttribute("from", 0);
anim.setAttribute("to", 0.5);
anim.setAttribute("dur", 0.25);
leg._path.appendChild(anim);
anim.beginElement();
}
me.setOpacity(0.3);
 
//Set the opacity of the spiderLegs back to their correct value
// The animations above override this until they complete.
// If the initial opacity of the spiderlegs isn't 0 then they appear before the animation starts.
if (L.Path.SVG) {
this._group._forceLayout();
 
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i]._spiderLeg;
 
m.options.opacity = 0.5;
m._path.setAttribute('stroke-opacity', 0.5);
}
}
 
setTimeout(function () {
group._animationEnd();
group.fire('spiderfied');
}, 200);
},
 
_animationUnspiderfy: function (zoomDetails) {
var group = this._group,
map = group._map,
fg = group._featureGroup,
thisLayerPos = zoomDetails ? map._latLngToNewLayerPoint(this._latlng, zoomDetails.zoom, zoomDetails.center) : map.latLngToLayerPoint(this._latlng),
childMarkers = this.getAllChildMarkers(),
svg = L.Path.SVG && this.SVG_ANIMATION,
m, i, a;
 
group._animationStart();
 
//Make us visible and bring the child markers back in
this.setOpacity(1);
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
 
//Marker was added to us after we were spidified
if (!m._preSpiderfyLatlng) {
continue;
}
 
//Fix up the location to the real one
m.setLatLng(m._preSpiderfyLatlng);
delete m._preSpiderfyLatlng;
//Hack override the location to be our center
if (m.setOpacity) {
m._setPos(thisLayerPos);
m.setOpacity(0);
} else {
fg.removeLayer(m);
}
 
//Animate the spider legs back in
if (svg) {
a = m._spiderLeg._path.childNodes[0];
a.setAttribute('to', a.getAttribute('from'));
a.setAttribute('from', 0);
a.beginElement();
 
a = m._spiderLeg._path.childNodes[1];
a.setAttribute('from', 0.5);
a.setAttribute('to', 0);
a.setAttribute('stroke-opacity', 0);
a.beginElement();
 
m._spiderLeg._path.setAttribute('stroke-opacity', 0);
}
}
 
setTimeout(function () {
//If we have only <= one child left then that marker will be shown on the map so don't remove it!
var stillThereChildCount = 0;
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
if (m._spiderLeg) {
stillThereChildCount++;
}
}
 
 
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
 
if (!m._spiderLeg) { //Has already been unspiderfied
continue;
}
 
 
if (m.setOpacity) {
m.setOpacity(1);
m.setZIndexOffset(0);
}
 
if (stillThereChildCount > 1) {
fg.removeLayer(m);
}
 
map.removeLayer(m._spiderLeg);
delete m._spiderLeg;
}
group._animationEnd();
}, 200);
}
});
 
 
L.MarkerClusterGroup.include({
//The MarkerCluster currently spiderfied (if any)
_spiderfied: null,
 
_spiderfierOnAdd: function () {
this._map.on('click', this._unspiderfyWrapper, this);
 
if (this._map.options.zoomAnimation) {
this._map.on('zoomstart', this._unspiderfyZoomStart, this);
}
//Browsers without zoomAnimation or a big zoom don't fire zoomstart
this._map.on('zoomend', this._noanimationUnspiderfy, this);
 
if (L.Path.SVG && !L.Browser.touch) {
this._map._initPathRoot();
//Needs to happen in the pageload, not after, or animations don't work in webkit
// http://stackoverflow.com/questions/8455200/svg-animate-with-dynamically-added-elements
//Disable on touch browsers as the animation messes up on a touch zoom and isn't very noticable
}
},
 
_spiderfierOnRemove: function () {
this._map.off('click', this._unspiderfyWrapper, this);
this._map.off('zoomstart', this._unspiderfyZoomStart, this);
this._map.off('zoomanim', this._unspiderfyZoomAnim, this);
 
this._unspiderfy(); //Ensure that markers are back where they should be
},
 
 
//On zoom start we add a zoomanim handler so that we are guaranteed to be last (after markers are animated)
//This means we can define the animation they do rather than Markers doing an animation to their actual location
_unspiderfyZoomStart: function () {
if (!this._map) { //May have been removed from the map by a zoomEnd handler
return;
}
 
this._map.on('zoomanim', this._unspiderfyZoomAnim, this);
},
_unspiderfyZoomAnim: function (zoomDetails) {
//Wait until the first zoomanim after the user has finished touch-zooming before running the animation
if (L.DomUtil.hasClass(this._map._mapPane, 'leaflet-touching')) {
return;
}
 
this._map.off('zoomanim', this._unspiderfyZoomAnim, this);
this._unspiderfy(zoomDetails);
},
 
 
_unspiderfyWrapper: function () {
/// <summary>_unspiderfy but passes no arguments</summary>
this._unspiderfy();
},
 
_unspiderfy: function (zoomDetails) {
if (this._spiderfied) {
this._spiderfied.unspiderfy(zoomDetails);
}
},
 
_noanimationUnspiderfy: function () {
if (this._spiderfied) {
this._spiderfied._noanimationUnspiderfy();
}
},
 
//If the given layer is currently being spiderfied then we unspiderfy it so it isn't on the map anymore etc
_unspiderfyLayer: function (layer) {
if (layer._spiderLeg) {
this._featureGroup.removeLayer(layer);
 
layer.setOpacity(1);
//Position will be fixed up immediately in _animationUnspiderfy
layer.setZIndexOffset(0);
 
this._map.removeLayer(layer._spiderLeg);
delete layer._spiderLeg;
}
}
});
 
 
}(window, document));
/tags/v1.11-okuzgozu/widget/modules/carto/squelettes/scripts/carto.js
New file
0,0 → 1,252
var map = null,
optionsCoucheOSM = {
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors,'
+ ' <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
maxZoom: 18
},
optionsCoucheGoogle = {
attribution: 'Map data &copy;'+new Date().getFullYear()+' <a href="http://maps.google.com">Google</a>',
maxZoom: 18
},
coucheOSM = new L.TileLayer("http://osm.tela-botanica.org/tuiles/osmfr/{z}/{x}/{y}.png",
optionsCoucheOSM),
coucheSatellite = new L.TileLayer("http://mt1.google.com/vt/lyrs=y@218131653&hl=fr&src=app&x={x}&y={y}&z={z}",
optionsCoucheGoogle),
optionsCarte = {
center : new L.LatLng(46, 2),
zoom : 6,
layers : [coucheOSM]
};
 
var xmlHttpRequest = null;
nombreCollections = 0;
collections = new Array();
structures = new Array();
if(clustering) {
coucheStructures = new L.MarkerClusterGroup({
disableClusteringAtZoom : 10
});
} else {
coucheStructures = new L.FeatureGroup();
}
infoBulle = null;
chargementEnCours = false;
 
 
$(document).ready(function() {
dimensionnerCarte();
initialiserCarte();
initialiserPanneauControle();
 
$.ajax({
dataType: "json",
url: urlWebService + "CoelRecherche/Nombre/*/*/*/*/*/*/*/" + departement + "/*/",
data: { formatRetour: "text/plain", pays: pays},
async: false
}).complete(function(msg) {
if (! estStatutRequeteOK(msg.status)) {
alert(msg.responseText);
return;
}
nombreCollections = parseInt(msg.responseText);
});
chargerStructures();
});
 
$(window).resize(function() {
dimensionnerCarte();
});
 
function dimensionnerCarte() {
$("#map").width($(window).width());
$("#map").height($(window).height());
}
 
function initialiserCarte() {
map = L.map('map', optionsCarte);
coucheOSM.addTo(map);
coucheStructures.addTo(map);
map.on('zoomend', function() {
// controle sur le niveau de zoom uniquement a la fin du placement des structures sur la carte
if (chargementEnCours) {
chargementEnCours = false;
verifierZoom();
}
});
}
 
function initialiserPanneauControle() {
var baseMaps = {
"Plan" : coucheOSM,
"Satellite" : coucheSatellite
};
var overlayMaps = {
"Structures" : coucheStructures
};
L.control.layers(baseMaps, overlayMaps).addTo(map);
}
 
 
function recupererValeurNombreCollections() {
}
 
function chargerStructures() {
if (requeteEnCours()) {
window.setTimeout('chargerStructures()', 400);
return;
}
 
chargementEnCours = true;
$.ajax({
dataType: "json",
url: urlWebService + "CoelRecherche/ParDefaut/*/*/*/*/*/*/*/" + departement + "/*/",
data: { limit: nombreCollections, pays: pays},
async: true
}).complete(function(msg) {
if (!estStatutRequeteOK(msg.status)) {
alert(msg.responseText);
return;
}
collections = eval("(function(){return " + msg.responseText + ";})()");
ordonnerCollectionsParStructures();
chargerLocalisations();
});
}
 
function requeteEnCours() {
return (xmlHttpRequest != null && xmlHttpRequest.readyState != 4);
}
 
function estStatutRequeteOK(x_status) {
return (x_status == 200 || x_status == 304 || x_status == 0);
}
 
function ordonnerCollectionsParStructures() {
for (var index = 0; index < collections.length; index ++) {
var indexStructure = 0;
while (indexStructure < structures.length && structures[indexStructure].id != collections[index].cs_id_structure) {
indexStructure ++;
}
if (indexStructure == structures.length) {
var structure = {
"id" : collections[index].cs_id_structure,
"nom" : collections[index].cs_nom,
"ville" : collections[index].cs_ville,
"code_postal" : collections[index].cs_code_postal,
"longitude" : collections[index].cs_longitude,
"latitude" : collections[index].cs_latitude,
"collections" : new Array()
};
structures.push(structure);
}
var collection = {
"id" : collections[index].cc_id_collection,
"nom" : collections[index].cc_nom
};
structures[indexStructure].collections.push(collection);
}
}
 
function chargerLocalisations() {
var nombreStructuresAffichees = 0;
for (var index = 0; index < structures.length; index ++) {
if ((structures[index].longitude != null && structures[index].longitude != "")
&& (structures[index].latitude != null && structures[index].latitude != "")) {
var existeMarqueur = rechercherExistenceMarqueur(structures[index].longitude, structures[index].latitude);
if (existeMarqueur == null) {
creerMarqueur(structures[index]);
nombreStructuresAffichees ++;
} else {
ajouterStructureAMarqueur(existeMarqueur, structures[index]);
}
}
}
if (nombreStructuresAffichees > 0) {
map.fitBounds(coucheStructures.getBounds());
}
}
 
function rechercherExistenceMarqueur(longitude, latitude) {
var existeMarqueur = null;
coucheStructures.eachLayer(function(layer) {
if (layer.getLatLng().lat == latitude && layer.getLatLng().lng == longitude) {
existeMarqueur = layer;
}
});
return existeMarqueur;
}
 
function creerMarqueur(structure) {
var latlng = new L.LatLng(structure.latitude, structure.longitude);
var marqueur = new L.Marker(latlng, {
structures : [structure],
structuresNom : structure.nom
});
marqueur.on('click', surClickMarqueur);
marqueur.on('mouseover', construireToolTipMarqueur);
coucheStructures.addLayer(marqueur);
}
 
function construireToolTipMarqueur(event) {
// changer la propriété title du marqueur ne fonctionne pas
// en dehors du constructeur (mais cette méthode est-elle pérenne ?)
// le clustering n'affichant pas tous les marqueurs, on doit remplir le tooltip
event.target._icon.title = event.target.options.structuresNom;
}
 
function ajouterStructureAMarqueur(marqueur, structure) {
marqueur.options.structures.push(structure);
marqueur.options.structuresNom += "\n"+structure.nom;
}
 
function surClickMarqueur(event) {
var latlng = event.target.getLatLng();
var structures = event.target.options.structures;
afficherCollections(structures, latlng);
}
 
function afficherCollections(structures, latlng) {
masquerInfoBulle();
infoBulle = new L.Popup({maxWidth : 0.25*$(window).width(), maxHeight : 0.35*$(window).height()});
infoBulle.setLatLng(latlng);
infoBulle.openOn(map);
remplirContenuPopup(structures);
$("a").css("color", "#598000");
map.setView(latlng, map.getZoom());
}
 
function masquerInfoBulle() {
if (infoBulle != null && map.hasLayer(infoBulle)) {
map.removeLayer(infoBulle);
}
infoBulle = null;
}
 
function remplirContenuPopup(structures) {
$("#structure").empty();
var entetePopup = {
"ville" : structures[0].ville,
"code_postal" : structures[0].code_postal
}
$("#tpl-structure-entete").tmpl(entetePopup).appendTo($("#structure"));
$.each(structures, function(index, structure) {
var structureAjout = {
"id" : structure.id,
"nom" : structure.nom,
"ville" : structure.ville,
"code_postal" : structure.code_postal,
"collections" : structure.collections
};
$("#tpl-structure").tmpl(structureAjout).appendTo($("#structure"));
});
infoBulle.setContent($("#structure").html());
}
 
function verifierZoom() {
if(map.getZoom() > 13) {
map.setZoom(13);
}
}
Property changes:
Added: svn:mime-type
+text/plain
\ No newline at end of property
/tags/v1.11-okuzgozu/widget/modules/carto/squelettes/scripts/leaflet.markercluster.js
New file
0,0 → 1,6
/*
Leaflet.markercluster, Provides Beautiful Animated Marker Clustering functionality for Leaflet, a JS library for interactive maps.
https://github.com/Leaflet/Leaflet.markercluster
(c) 2012-2013, Dave Leaver, smartrak
*/
!function(t,e){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(t){L.Util.setOptions(this,t),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.on(L.FeatureGroup.EVENTS,this._propagateEvent,this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.on(L.FeatureGroup.EVENTS,this._propagateEvent,this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[]},addLayer:function(t){if(t instanceof L.LayerGroup){var e=[];for(var i in t._layers)e.push(t._layers[i]);return this.addLayers(e)}if(!t.getLatLng)return this._nonPointGroup.addLayer(t),this;if(!this._map)return this._needsClustering.push(t),this;if(this.hasLayer(t))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(t,this._maxZoom);var n=t,s=this._map.getZoom();if(t.__parent)for(;n.__parent._zoom>=s;)n=n.__parent;return this._currentShownBounds.contains(n.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(t,n):this._animationAddLayerNonAnimated(t,n)),this},removeLayer:function(t){if(t instanceof L.LayerGroup){var e=[];for(var i in t._layers)e.push(t._layers[i]);return this.removeLayers(e)}return t.getLatLng?this._map?t.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(t)),this._removeLayer(t,!0),this._featureGroup.hasLayer(t)&&(this._featureGroup.removeLayer(t),t.setOpacity&&t.setOpacity(1)),this):this:(!this._arraySplice(this._needsClustering,t)&&this.hasLayer(t)&&this._needsRemoving.push(t),this):(this._nonPointGroup.removeLayer(t),this)},addLayers:function(t){var e,i,n,s,r=this._featureGroup,o=this._nonPointGroup,a=this.options.chunkedLoading,h=this.options.chunkInterval,_=this.options.chunkProgress;if(this._map){var u=0,l=(new Date).getTime(),d=L.bind(function(){for(var e=(new Date).getTime();u<t.length;u++){if(a&&0===u%200){var i=(new Date).getTime()-e;if(i>h)break}if(s=t[u],s.getLatLng){if(!this.hasLayer(s)&&(this._addLayer(s,this._maxZoom),s.__parent&&2===s.__parent.getChildCount())){var n=s.__parent.getAllChildMarkers(),p=n[0]===s?n[1]:n[0];r.removeLayer(p)}}else o.addLayer(s)}_&&_(u,t.length,(new Date).getTime()-l),u===t.length?(this._featureGroup.eachLayer(function(t){t instanceof L.MarkerCluster&&t._iconNeedsUpdate&&t._updateIcon()}),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else{for(e=[],i=0,n=t.length;n>i;i++)s=t[i],s.getLatLng?this.hasLayer(s)||e.push(s):o.addLayer(s);this._needsClustering=this._needsClustering.concat(e)}return this},removeLayers:function(t){var e,i,n,s=this._featureGroup,r=this._nonPointGroup;if(!this._map){for(e=0,i=t.length;i>e;e++)n=t[e],this._arraySplice(this._needsClustering,n),r.removeLayer(n);return this}for(e=0,i=t.length;i>e;e++)n=t[e],n.__parent?(this._removeLayer(n,!0,!0),s.hasLayer(n)&&(s.removeLayer(n),n.setOpacity&&n.setOpacity(1))):r.removeLayer(n);return this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),s.eachLayer(function(t){t instanceof L.MarkerCluster&&t._updateIcon()}),this},clearLayers:function(){return this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(t){delete t.__parent}),this._map&&this._generateInitialClusters(),this},getBounds:function(){var t=new L.LatLngBounds;this._topClusterLevel&&t.extend(this._topClusterLevel._bounds);for(var e=this._needsClustering.length-1;e>=0;e--)t.extend(this._needsClustering[e].getLatLng());return t.extend(this._nonPointGroup.getBounds()),t},eachLayer:function(t,e){var i,n=this._needsClustering.slice();for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(n),i=n.length-1;i>=0;i--)t.call(e,n[i]);this._nonPointGroup.eachLayer(t,e)},getLayers:function(){var t=[];return this.eachLayer(function(e){t.push(e)}),t},getLayer:function(t){var e=null;return this.eachLayer(function(i){L.stamp(i)===t&&(e=i)}),e},hasLayer:function(t){if(!t)return!1;var e,i=this._needsClustering;for(e=i.length-1;e>=0;e--)if(i[e]===t)return!0;for(i=this._needsRemoving,e=i.length-1;e>=0;e--)if(i[e]===t)return!1;return!(!t.__parent||t.__parent._group!==this)||this._nonPointGroup.hasLayer(t)},zoomToShowLayer:function(t,e){var i=function(){if((t._icon||t.__parent._icon)&&!this._inZoomAnimation)if(this._map.off("moveend",i,this),this.off("animationend",i,this),t._icon)e();else if(t.__parent._icon){var n=function(){this.off("spiderfied",n,this),e()};this.on("spiderfied",n,this),t.__parent.spiderfy()}};if(t._icon&&this._map.getBounds().contains(t.getLatLng()))e();else if(t.__parent._zoom<this._map.getZoom())this._map.on("moveend",i,this),this._map.panTo(t.getLatLng());else{var n=function(){this._map.off("movestart",n,this),n=null};this._map.on("movestart",n,this),this._map.on("moveend",i,this),this.on("animationend",i,this),t.__parent.zoomToBounds(),n&&i.call(this)}},onAdd:function(t){this._map=t;var e,i,n;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.onAdd(t),this._nonPointGroup.onAdd(t),this._gridClusters||this._generateInitialClusters(),e=0,i=this._needsRemoving.length;i>e;e++)n=this._needsRemoving[e],this._removeLayer(n,!0);this._needsRemoving=[],this._zoom=this._map.getZoom(),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i)},onRemove:function(t){t.off("zoomend",this._zoomEnd,this),t.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),this._hideCoverage(),this._featureGroup.onRemove(t),this._nonPointGroup.onRemove(t),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(t){for(var e=t;e&&!e._icon;)e=e.__parent;return e||null},_arraySplice:function(t,e){for(var i=t.length-1;i>=0;i--)if(t[i]===e)return t.splice(i,1),!0},_removeLayer:function(t,e,i){var n=this._gridClusters,s=this._gridUnclustered,r=this._featureGroup,o=this._map;if(e)for(var a=this._maxZoom;a>=0&&s[a].removeObject(t,o.project(t.getLatLng(),a));a--);var h,_=t.__parent,u=_._markers;for(this._arraySplice(u,t);_&&(_._childCount--,!(_._zoom<0));)e&&_._childCount<=1?(h=_._markers[0]===t?_._markers[1]:_._markers[0],n[_._zoom].removeObject(_,o.project(_._cLatLng,_._zoom)),s[_._zoom].addObject(h,o.project(h.getLatLng(),_._zoom)),this._arraySplice(_.__parent._childClusters,_),_.__parent._markers.push(h),h.__parent=_.__parent,_._icon&&(r.removeLayer(_),i||r.addLayer(h))):(_._recalculateBounds(),i&&_._icon||_._updateIcon()),_=_.__parent;delete t.__parent},_isOrIsParent:function(t,e){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},_propagateEvent:function(t){if(t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;t.type="cluster"+t.type}this.fire(t.type,t)},_defaultIconCreateFunction:function(t){var e=t.getChildCount(),i=" marker-cluster-";return i+=10>e?"small":100>e?"medium":"large",new L.DivIcon({html:"<div><span>"+e+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var t=this._map,e=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick;(e||n)&&this.on("clusterclick",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),t.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(t){var e=this._map;e.getMaxZoom()===e.getZoom()?this.options.spiderfyOnMaxZoom&&t.layer.spiderfy():this.options.zoomToBoundsOnClick&&t.layer.zoomToBounds(),t.originalEvent&&13===t.originalEvent.keyCode&&e._container.focus()},_showCoverage:function(t){var e=this._map;this._inZoomAnimation||(this._shownPolygon&&e.removeLayer(this._shownPolygon),t.layer.getChildCount()>2&&t.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(t.layer.getConvexHull(),this.options.polygonOptions),e.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this._map;(t||i)&&this.off("clusterclick",this._zoomOrSpiderfy,this),e&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),n.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=this._map._zoom,this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var t=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._zoom,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._map._zoom,t),this._currentShownBounds=t}},_generateInitialClusters:function(){var t=this._map.getMaxZoom(),e=this.options.maxClusterRadius,i=e;"function"!=typeof e&&(i=function(){return e}),this.options.disableClusteringAtZoom&&(t=this.options.disableClusteringAtZoom-1),this._maxZoom=t,this._gridClusters={},this._gridUnclustered={};for(var n=t;n>=0;n--)this._gridClusters[n]=new L.DistanceGrid(i(n)),this._gridUnclustered[n]=new L.DistanceGrid(i(n));this._topClusterLevel=new L.MarkerCluster(this,-1)},_addLayer:function(t,e){var i,n,s=this._gridClusters,r=this._gridUnclustered;for(this.options.singleMarkerMode&&(t.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[t]}}));e>=0;e--){i=this._map.project(t.getLatLng(),e);var o=s[e].getNearObject(i);if(o)return o._addChild(t),t.__parent=o,void 0;if(o=r[e].getNearObject(i)){var a=o.__parent;a&&this._removeLayer(o,!1);var h=new L.MarkerCluster(this,e,o,t);s[e].addObject(h,this._map.project(h._cLatLng,e)),o.__parent=h,t.__parent=h;var _=h;for(n=e-1;n>a._zoom;n--)_=new L.MarkerCluster(this,n,_),s[n].addObject(_,this._map.project(o.getLatLng(),n));for(a._addChild(_),n=e;n>=0&&r[n].removeObject(o,this._map.project(o.getLatLng(),n));n--);return}r[e].addObject(t,i)}this._topClusterLevel._addChild(t),t.__parent=this._topClusterLevel},_enqueue:function(t){this._queue.push(t),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var t=0;t<this._queue.length;t++)this._queue[t].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){this._processQueue(),this._zoom<this._map._zoom&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,this._map._zoom)):this._zoom>this._map._zoom?(this._animationStart(),this._animationZoomOut(this._zoom,this._map._zoom)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(!this.options.removeOutsideVisibleBounds)return this.getBounds();var t=this._map,e=t.getBounds(),i=e._southWest,n=e._northEast,s=L.Browser.mobile?0:Math.abs(i.lat-n.lat),r=L.Browser.mobile?0:Math.abs(i.lng-n.lng);return new L.LatLngBounds(new L.LatLng(i.lat-s,i.lng-r,!0),new L.LatLng(n.lat+s,n.lng+r,!0))},_animationAddLayerNonAnimated:function(t,e){if(e===t)this._featureGroup.addLayer(t);else if(2===e._childCount){e._addToMap();var i=e.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else e._updateIcon()}}),L.MarkerClusterGroup.include(L.DomUtil.TRANSITION?{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_animationZoomIn:function(t,e){var i,n=this._getExpandedVisibleBounds(),s=this._featureGroup;this._topClusterLevel._recursively(n,t,0,function(r){var o,a=r._latlng,h=r._markers;for(n.contains(a)||(a=null),r._isSingleParent()&&t+1===e?(s.removeLayer(r),r._recursivelyAddChildrenToMap(null,e,n)):(r.setOpacity(0),r._recursivelyAddChildrenToMap(a,e,n)),i=h.length-1;i>=0;i--)o=h[i],n.contains(o._latlng)||s.removeLayer(o)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(n,e),s.eachLayer(function(t){t instanceof L.MarkerCluster||!t._icon||t.setOpacity(1)}),this._topClusterLevel._recursively(n,t,e,function(t){t._recursivelyRestoreChildPositions(e)}),this._enqueue(function(){this._topClusterLevel._recursively(n,t,0,function(t){s.removeLayer(t),t.setOpacity(1)}),this._animationEnd()})},_animationZoomOut:function(t,e){this._animationZoomOutSingle(this._topClusterLevel,t-1,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,t,this._getExpandedVisibleBounds())},_animationZoomOutSingle:function(t,e,i){var n=this._getExpandedVisibleBounds();t._recursivelyAnimateChildrenInAndAddSelfToMap(n,e+1,i);var s=this;this._forceLayout(),t._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(1===t._childCount){var r=t._markers[0];r.setLatLng(r.getLatLng()),r.setOpacity&&r.setOpacity(1)}else t._recursively(n,i,0,function(t){t._recursivelyRemoveChildrenFromMap(n,e+1)});s._animationEnd()})},_animationAddLayer:function(t,e){var i=this,n=this._featureGroup;n.addLayer(t),e!==t&&(e._childCount>2?(e._updateIcon(),this._forceLayout(),this._animationStart(),t._setPos(this._map.latLngToLayerPoint(e.getLatLng())),t.setOpacity(0),this._enqueue(function(){n.removeLayer(t),t.setOpacity(1),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(e,this._map.getMaxZoom(),this._map.getZoom())))},_forceLayout:function(){L.Util.falseFn(e.body.offsetWidth)}}:{_animationStart:function(){},_animationZoomIn:function(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(t,e){this._animationAddLayerNonAnimated(t,e)}}),L.markerClusterGroup=function(t){return new L.MarkerClusterGroup(t)},L.MarkerCluster=L.Marker.extend({initialize:function(t,e,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this}),this._group=t,this._zoom=e,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(t){t=t||[];for(var e=this._childClusters.length-1;e>=0;e--)this._childClusters[e].getAllChildMarkers(t);for(var i=this._markers.length-1;i>=0;i--)t.push(this._markers[i]);return t},getChildCount:function(){return this._childCount},zoomToBounds:function(){for(var t,e=this._childClusters.slice(),i=this._group._map,n=i.getBoundsZoom(this._bounds),s=this._zoom+1,r=i.getZoom();e.length>0&&n>s;){s++;var o=[];for(t=0;t<e.length;t++)o=o.concat(e[t]._childClusters);e=o}n>s?this._group._map.setView(this._latlng,s):r>=n?this._group._map.setView(this._latlng,r+1):this._group._map.fitBounds(this._bounds)},getBounds:function(){var t=new L.LatLngBounds;return t.extend(this._bounds),t},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(t,e){this._iconNeedsUpdate=!0,this._expandBounds(t),t instanceof L.MarkerCluster?(e||(this._childClusters.push(t),t.__parent=this),this._childCount+=t._childCount):(e||this._markers.push(t),this._childCount++),this.__parent&&this.__parent._addChild(t,!0)},_expandBounds:function(t){var e,i=t._wLatLng||t._latlng;t instanceof L.MarkerCluster?(this._bounds.extend(t._bounds),e=t._childCount):(this._bounds.extend(i),e=1),this._cLatLng||(this._cLatLng=t._cLatLng||i);var n=this._childCount+e;this._wLatLng?(this._wLatLng.lat=(i.lat*e+this._wLatLng.lat*this._childCount)/n,this._wLatLng.lng=(i.lng*e+this._wLatLng.lng*this._childCount)/n):this._latlng=this._wLatLng=new L.LatLng(i.lat,i.lng)},_addToMap:function(t){t&&(this._backupLatlng=this._latlng,this.setLatLng(t)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(t,e,i){this._recursively(t,0,i-1,function(t){var i,n,s=t._markers;for(i=s.length-1;i>=0;i--)n=s[i],n._icon&&(n._setPos(e),n.setOpacity(0))},function(t){var i,n,s=t._childClusters;for(i=s.length-1;i>=0;i--)n=s[i],n._icon&&(n._setPos(e),n.setOpacity(0))})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(t,e,i){this._recursively(t,i,0,function(n){n._recursivelyAnimateChildrenIn(t,n._group._map.latLngToLayerPoint(n.getLatLng()).round(),e),n._isSingleParent()&&e-1===i?(n.setOpacity(1),n._recursivelyRemoveChildrenFromMap(t,e)):n.setOpacity(0),n._addToMap()})},_recursivelyBecomeVisible:function(t,e){this._recursively(t,0,e,null,function(t){t.setOpacity(1)})},_recursivelyAddChildrenToMap:function(t,e,i){this._recursively(i,-1,e,function(n){if(e!==n._zoom)for(var s=n._markers.length-1;s>=0;s--){var r=n._markers[s];i.contains(r._latlng)&&(t&&(r._backupLatlng=r.getLatLng(),r.setLatLng(t),r.setOpacity&&r.setOpacity(0)),n._group._featureGroup.addLayer(r))}},function(e){e._addToMap(t)})},_recursivelyRestoreChildPositions:function(t){for(var e=this._markers.length-1;e>=0;e--){var i=this._markers[e];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(t-1===this._zoom)for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._restorePosition();else for(var s=this._childClusters.length-1;s>=0;s--)this._childClusters[s]._recursivelyRestoreChildPositions(t)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(t,e,i){var n,s;this._recursively(t,-1,e-1,function(t){for(s=t._markers.length-1;s>=0;s--)n=t._markers[s],i&&i.contains(n._latlng)||(t._group._featureGroup.removeLayer(n),n.setOpacity&&n.setOpacity(1))},function(t){for(s=t._childClusters.length-1;s>=0;s--)n=t._childClusters[s],i&&i.contains(n._latlng)||(t._group._featureGroup.removeLayer(n),n.setOpacity&&n.setOpacity(1))})},_recursively:function(t,e,i,n,s){var r,o,a=this._childClusters,h=this._zoom;if(e>h)for(r=a.length-1;r>=0;r--)o=a[r],t.intersects(o._bounds)&&o._recursively(t,e,i,n,s);else if(n&&n(this),s&&this._zoom===i&&s(this),i>h)for(r=a.length-1;r>=0;r--)o=a[r],t.intersects(o._bounds)&&o._recursively(t,e,i,n,s)},_recalculateBounds:function(){var t,e=this._markers,i=this._childClusters;for(this._bounds=new L.LatLngBounds,delete this._wLatLng,t=e.length-1;t>=0;t--)this._expandBounds(e[t]);for(t=i.length-1;t>=0;t--)this._expandBounds(i[t])},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}}),L.DistanceGrid=function(t){this._cellSize=t,this._sqCellSize=t*t,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(t,e){var i=this._getCoord(e.x),n=this._getCoord(e.y),s=this._grid,r=s[n]=s[n]||{},o=r[i]=r[i]||[],a=L.Util.stamp(t);this._objectPoint[a]=e,o.push(t)},updateObject:function(t,e){this.removeObject(t),this.addObject(t,e)},removeObject:function(t,e){var i,n,s=this._getCoord(e.x),r=this._getCoord(e.y),o=this._grid,a=o[r]=o[r]||{},h=a[s]=a[s]||[];for(delete this._objectPoint[L.Util.stamp(t)],i=0,n=h.length;n>i;i++)if(h[i]===t)return h.splice(i,1),1===n&&delete a[s],!0},eachObject:function(t,e){var i,n,s,r,o,a,h,_=this._grid;for(i in _){o=_[i];for(n in o)for(a=o[n],s=0,r=a.length;r>s;s++)h=t.call(e,a[s]),h&&(s--,r--)}},getNearObject:function(t){var e,i,n,s,r,o,a,h,_=this._getCoord(t.x),u=this._getCoord(t.y),l=this._objectPoint,d=this._sqCellSize,p=null;for(e=u-1;u+1>=e;e++)if(s=this._grid[e])for(i=_-1;_+1>=i;i++)if(r=s[i])for(n=0,o=r.length;o>n;n++)a=r[n],h=this._sqDist(l[L.Util.stamp(a)],t),d>h&&(d=h,p=a);return p},_getCoord:function(t){return Math.floor(t/this._cellSize)},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}},function(){L.QuickHull={getDistant:function(t,e){var i=e[1].lat-e[0].lat,n=e[0].lng-e[1].lng;return n*(t.lat-e[0].lat)+i*(t.lng-e[0].lng)},findMostDistantPointFromBaseLine:function(t,e){var i,n,s,r=0,o=null,a=[];for(i=e.length-1;i>=0;i--)n=e[i],s=this.getDistant(n,t),s>0&&(a.push(n),s>r&&(r=s,o=n));return{maxPoint:o,newPoints:a}},buildConvexHull:function(t,e){var i=[],n=this.findMostDistantPointFromBaseLine(t,e);return n.maxPoint?(i=i.concat(this.buildConvexHull([t[0],n.maxPoint],n.newPoints)),i=i.concat(this.buildConvexHull([n.maxPoint,t[1]],n.newPoints))):[t[0]]},getConvexHull:function(t){var e,i=!1,n=!1,s=null,r=null;for(e=t.length-1;e>=0;e--){var o=t[e];(i===!1||o.lat>i)&&(s=o,i=o.lat),(n===!1||o.lat<n)&&(r=o,n=o.lat)}var a=[].concat(this.buildConvexHull([r,s],t),this.buildConvexHull([s,r],t));return a}}}(),L.MarkerCluster.include({getConvexHull:function(){var t,e,i=this.getAllChildMarkers(),n=[];for(e=i.length-1;e>=0;e--)t=i[e].getLatLng(),n.push(t);return L.QuickHull.getConvexHull(n)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var t,e=this.getAllChildMarkers(),i=this._group,n=i._map,s=n.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,e.length>=this._circleSpiralSwitchover?t=this._generatePointsSpiral(e.length,s):(s.y+=10,t=this._generatePointsCircle(e.length,s)),this._animationSpiderfy(e,t)}},unspiderfy:function(t){this._group._inZoomAnimation||(this._animationUnspiderfy(t),this._group._spiderfied=null)},_generatePointsCircle:function(t,e){var i,n,s=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+t),r=s/this._2PI,o=this._2PI/t,a=[];for(a.length=t,i=t-1;i>=0;i--)n=this._circleStartAngle+i*o,a[i]=new L.Point(e.x+r*Math.cos(n),e.y+r*Math.sin(n))._round();return a},_generatePointsSpiral:function(t,e){var i,n=this._group.options.spiderfyDistanceMultiplier*this._spiralLengthStart,s=this._group.options.spiderfyDistanceMultiplier*this._spiralFootSeparation,r=this._group.options.spiderfyDistanceMultiplier*this._spiralLengthFactor,o=0,a=[];for(a.length=t,i=t-1;i>=0;i--)o+=s/n+5e-4*i,a[i]=new L.Point(e.x+n*Math.cos(o),e.y+n*Math.sin(o))._round(),n+=this._2PI*r/o;return a},_noanimationUnspiderfy:function(){var t,e,i=this._group,n=i._map,s=i._featureGroup,r=this.getAllChildMarkers();for(this.setOpacity(1),e=r.length-1;e>=0;e--)t=r[e],s.removeLayer(t),t._preSpiderfyLatlng&&(t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng),t.setZIndexOffset&&t.setZIndexOffset(0),t._spiderLeg&&(n.removeLayer(t._spiderLeg),delete t._spiderLeg);i._spiderfied=null}}),L.MarkerCluster.include(L.DomUtil.TRANSITION?{SVG_ANIMATION:function(){return e.createElementNS("http://www.w3.org/2000/svg","animate").toString().indexOf("SVGAnimate")>-1}(),_animationSpiderfy:function(t,i){var n,s,r,o,a=this,h=this._group,_=h._map,u=h._featureGroup,l=_.latLngToLayerPoint(this._latlng);for(n=t.length-1;n>=0;n--)s=t[n],s.setOpacity?(s.setZIndexOffset(1e6),s.setOpacity(0),u.addLayer(s),s._setPos(l)):u.addLayer(s);h._forceLayout(),h._animationStart();var d=L.Path.SVG?0:.3,p=L.Path.SVG_NS;for(n=t.length-1;n>=0;n--)if(o=_.layerPointToLatLng(i[n]),s=t[n],s._preSpiderfyLatlng=s._latlng,s.setLatLng(o),s.setOpacity&&s.setOpacity(1),r=new L.Polyline([a._latlng,o],{weight:1.5,color:"#222",opacity:d}),_.addLayer(r),s._spiderLeg=r,L.Path.SVG&&this.SVG_ANIMATION){var c=r._path.getTotalLength();r._path.setAttribute("stroke-dasharray",c+","+c);var f=e.createElementNS(p,"animate");f.setAttribute("attributeName","stroke-dashoffset"),f.setAttribute("begin","indefinite"),f.setAttribute("from",c),f.setAttribute("to",0),f.setAttribute("dur",.25),r._path.appendChild(f),f.beginElement(),f=e.createElementNS(p,"animate"),f.setAttribute("attributeName","stroke-opacity"),f.setAttribute("attributeName","stroke-opacity"),f.setAttribute("begin","indefinite"),f.setAttribute("from",0),f.setAttribute("to",.5),f.setAttribute("dur",.25),r._path.appendChild(f),f.beginElement()}if(a.setOpacity(.3),L.Path.SVG)for(this._group._forceLayout(),n=t.length-1;n>=0;n--)s=t[n]._spiderLeg,s.options.opacity=.5,s._path.setAttribute("stroke-opacity",.5);setTimeout(function(){h._animationEnd(),h.fire("spiderfied")},200)},_animationUnspiderfy:function(t){var e,i,n,s=this._group,r=s._map,o=s._featureGroup,a=t?r._latLngToNewLayerPoint(this._latlng,t.zoom,t.center):r.latLngToLayerPoint(this._latlng),h=this.getAllChildMarkers(),_=L.Path.SVG&&this.SVG_ANIMATION;for(s._animationStart(),this.setOpacity(1),i=h.length-1;i>=0;i--)e=h[i],e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng,e.setOpacity?(e._setPos(a),e.setOpacity(0)):o.removeLayer(e),_&&(n=e._spiderLeg._path.childNodes[0],n.setAttribute("to",n.getAttribute("from")),n.setAttribute("from",0),n.beginElement(),n=e._spiderLeg._path.childNodes[1],n.setAttribute("from",.5),n.setAttribute("to",0),n.setAttribute("stroke-opacity",0),n.beginElement(),e._spiderLeg._path.setAttribute("stroke-opacity",0)));setTimeout(function(){var t=0;for(i=h.length-1;i>=0;i--)e=h[i],e._spiderLeg&&t++;for(i=h.length-1;i>=0;i--)e=h[i],e._spiderLeg&&(e.setOpacity&&(e.setOpacity(1),e.setZIndexOffset(0)),t>1&&o.removeLayer(e),r.removeLayer(e._spiderLeg),delete e._spiderLeg);s._animationEnd()},200)}}:{_animationSpiderfy:function(t,e){var i,n,s,r,o=this._group,a=o._map,h=o._featureGroup;for(i=t.length-1;i>=0;i--)r=a.layerPointToLatLng(e[i]),n=t[i],n._preSpiderfyLatlng=n._latlng,n.setLatLng(r),n.setZIndexOffset&&n.setZIndexOffset(1e6),h.addLayer(n),s=new L.Polyline([this._latlng,r],{weight:1.5,color:"#222"}),a.addLayer(s),n._spiderLeg=s;this.setOpacity(.3),o.fire("spiderfied")},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerClusterGroup.include({_spiderfied:null,_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Path.SVG&&!L.Browser.touch&&this._map._initPathRoot()},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(t){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(t))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(t){this._spiderfied&&this._spiderfied.unspiderfy(t)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(t){t._spiderLeg&&(this._featureGroup.removeLayer(t),t.setOpacity(1),t.setZIndexOffset(0),this._map.removeLayer(t._spiderLeg),delete t._spiderLeg)}})}(window,document);
/tags/v1.11-okuzgozu/widget/modules/carto/squelettes/css/MarkerCluster.css
New file
0,0 → 1,6
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
-webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;
-moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;
-o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;
transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}
/tags/v1.11-okuzgozu/widget/modules/carto/squelettes/css/MarkerCluster.Default.css
New file
0,0 → 1,60
.marker-cluster-small {
background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
background-color: rgba(110, 204, 57, 0.6);
}
 
.marker-cluster-medium {
background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
background-color: rgba(240, 194, 12, 0.6);
}
 
.marker-cluster-large {
background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
background-color: rgba(241, 128, 23, 0.6);
}
 
/* IE 6-8 fallback colors */
.leaflet-oldie .marker-cluster-small {
background-color: rgb(181, 226, 140);
}
.leaflet-oldie .marker-cluster-small div {
background-color: rgb(110, 204, 57);
}
 
.leaflet-oldie .marker-cluster-medium {
background-color: rgb(241, 211, 87);
}
.leaflet-oldie .marker-cluster-medium div {
background-color: rgb(240, 194, 12);
}
 
.leaflet-oldie .marker-cluster-large {
background-color: rgb(253, 156, 115);
}
.leaflet-oldie .marker-cluster-large div {
background-color: rgb(241, 128, 23);
}
 
.marker-cluster {
background-clip: padding-box;
border-radius: 20px;
}
.marker-cluster div {
width: 30px;
height: 30px;
margin-left: 5px;
margin-top: 5px;
 
text-align: center;
border-radius: 15px;
font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}
.marker-cluster span {
line-height: 30px;
}
/tags/v1.11-okuzgozu/widget/modules/carto/squelettes/css/carto.css
New file
0,0 → 1,61
@CHARSET "UTF-8";
 
body {
margin: 0px;
padding: 0px;
}
 
#map {
position: relative;
}
 
#logo-tb {
position: fixed;
top: 10px;
left: 9px;
z-index: 2000; /* ça ou autre chose... */
border: solid #bebebe 1px;
padding: 5px;
border-radius: 4px;
background-color: rgba(255,255,255,0.9);
}
 
.leaflet-left .leaflet-control {
margin-top: 95px;
}
 
#logo-tb img {
height: 60px;
}
 
ul {
padding-left: 10px;
margin-top: 5px;
margin-bottom: 5px;
}
 
ul li {
background: url("../images/petitCarreContour.jpg") no-repeat scroll 10px 6px transparent;
line-height: 18px;
list-style: none outside none;
padding-left: 25px;
}
 
a {
text-decoration : none;
border-bottom: 1px dotted #95AE5D;
color: #598000;
margin: 0;
}
 
.popup-simple-text {
font-size: 1.15em;
}
 
#map .marker-cluster-small {
background-color: rgba(0, 102, 0, 0.5);
}
 
#map .marker-cluster-medium {
background-color: rgba(241, 211, 87, 0.8);
}
Property changes:
Added: svn:mime-type
+text/plain
\ No newline at end of property
/tags/v1.11-okuzgozu/widget/modules/carto/squelettes/carto.tpl.html
New file
0,0 → 1,91
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Content-style-type" content="text/css" />
<meta http-equiv="Content-script-type" content="text/javascript" />
<meta http-equiv="Content-language" content="fr" />
 
<!-- OpenGraph pour Facebook, Pinterest, Google+ -->
<meta property="og:type" content="website" />
<meta property="og:title" content="CoEL - Cartographie des herbiers" />
<meta property="og:site_name" content="Tela Botanica" />
<meta property="og:description" content="Représentation cartographique des herbiers recensés dans Collections en Ligne" />
<meta property="og:image" content="http://resources.tela-botanica.org/tb/img/256x256/carre_englobant.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="256" />
<meta property="og:image:height" content="256" />
<meta property="og:locale" content="fr_FR" />
 
<title>Localisation des collections d'herbiers</title>
<link rel="icon" type="image/png" href="http://resources.tela-botanica.org/tb/img/16x16/favicon.png" />
<link rel="shortcut icon" type="image/x-icon" href="http://resources.tela-botanica.org/tb/img/16x16/favicon.ico" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.ie.css" />
<![endif]-->
<link rel="stylesheet" href="<?=$url_base?>modules/carto/squelettes/css/carto.css" />
<link rel="stylesheet" href="<?=$url_base?>modules/carto/squelettes/css/MarkerCluster.css" />
<link rel="stylesheet" href="<?=$url_base?>modules/carto/squelettes/css/MarkerCluster.Default.css" />
<script type="text/javascript" src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<script type="text/javascript" src="http://resources.tela-botanica.org/jquery/1.6.4/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="http://resources.tela-botanica.org/jquery/jquery-ui/1.8.18/js/jquery-ui-1.8.18.custom.min.js"></script>
<script type="text/javascript" src="http://resources.tela-botanica.org/jquery/jquery-tmpl/jquery.tmpl.min.js"></script>
<script src="<?=$url_base?>modules/carto/squelettes/scripts/leaflet.markercluster.js"></script>
<script type="text/javascript">
//<![CDATA[
var departement = '<?= $departement ?>';
var pays = '<?= $pays ?>';
var urlWebService = '<?= $url_web_service ?>';
var clustering = '<?= $clustering ?>';
//]]>
</script>
<script type="text/javascript" src="<?=$url_base?>modules/carto/squelettes/scripts/carto.js"></script>
 
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-57885-3', 'auto');
ga('send', 'pageview');
</script>
</head>
 
<body>
<div id="logo-tb"><img src="http://resources.tela-botanica.org/tb/img/128x128/logo_carre_officiel.png" /></div>
<div id="map"></div>
<!-- Squelette du contenu de la popup -->
<script id="tpl-structure-entete" type="text/x-jquery-tmpl">
<div class="popup-simple-text">Situé dans ${ville} (${code_postal})</div>
</script>
<script id="tpl-structure" type="text/x-jquery-tmpl">
<div class="description-structure">
<h3 align="center">
<a target="_blank" href="<?=$url_page_fiche?>?module=FicheStructure&id=${id}">${nom}</a>
</h3>
<div class="collections">
{{if collections.length > 0}}
<div class="popup-simple-text">Collections présentes :</div>
<ul>
{{each(index, collection) collections}}
<li>
<a target="_blank" href="<?=$url_page_fiche?>?module=FicheCollection&id=${collection.id}">${collection.nom}</a>
</li>
{{/each}}
</ul>
{{else}}
<div class="popup-simple-text">Aucune Collection d'herbiers recensée à ce jour</div>
{{/if}}
</div>
<hr />
</div>
</script>
<div id="structure" style="display:none"></div>
</body>
</html>
Property changes:
Added: svn:mime-type
+text/plain
\ No newline at end of property
/tags/v1.11-okuzgozu/widget/modules/carto/config.ini
New file
0,0 → 1,3
[carto]
 
urlPageFiche = "http://www.tela-botanica.org/page:herbiers_carto"
Property changes:
Added: svn:mime-type
+text/plain
\ No newline at end of property
/tags/v1.11-okuzgozu/widget/modules/carto/config.defaut.ini
New file
0,0 → 1,3
[carto]
 
urlPageFiche = "http://www.tela-botanica.org/page:herbiers_carto"
Property changes:
Added: svn:mime-type
+text/plain
\ No newline at end of property
/tags/v1.11-okuzgozu/widget/Widget.php
New file
0,0 → 1,160
<?php
// In : utf8 url_encoded (get et post)
// Out : utf8
/**
* La classe Widget analyser l'url et chage le widget correspondant.
* Format d'url :
* /widget/nom_du_widget?parametres1=ma_valeur1&parametre2=ma_valeur2
* Les widget sont dans des dossiers en minuscule correspondant au nom de la classe du widget.
* Exemple : /widget/carto avec la classe Carto.php dans le dossier carto.
*
*
* @author jpm
*
*/
class Widget {
 
/** Les paramètres de configuration extrait du fichier .ini */
private static $config;
 
/** Le nom du widget demandé. */
private $widget = null;
/** Les chemins où l'autoload doit chercher des classes. */
private static $autoload_chemins = array();
/** Les paramètres de l'url $_GET nettoyés. */
private $parametres = null;
 
/**
* Constructeur.
* Parse le fichier de configuraion "widget.ini" et parse l'url à la recherche du widget demandé.
* @param str iniFile Configuration file to use
*/
public function __construct($fichier_ini = 'widget.ini.php') {
// Chargement de la configuration
self::$config = parse_ini_file($fichier_ini, TRUE);
// Paramêtres de config dynamiques
self::$config['chemins']['baseURLAbsoluDyn'] = 'http://'.$_SERVER['SERVER_NAME'].self::$config['chemins']['baseURL'].'%s';
// Gestion de la mémoire maximum allouée aux services
ini_set('memory_limit', self::$config['parametres']['limiteMemoire']);
// Réglages de PHP
setlocale(LC_ALL, self::$config['parametres']['locale']);
date_default_timezone_set(self::$config['parametres']['fuseauHoraire']);
// Gestion des erreurs
error_reporting(self::$config['parametres']['erreurNiveau']);
if (isset($_SERVER['REQUEST_URI']) && isset($_SERVER['QUERY_STRING'])) {
$url_morceaux = $this->parserUrl();
if (isset($url_morceaux[0])) {
$this->widget = $url_morceaux[0];
self::$config['chemins']['widgetCourantDossier'] = self::$config['chemins']['widgetsDossier'].strtolower($this->widget).DIRECTORY_SEPARATOR;
$this->chargerWidgetConfig();
}
// Chargement des chemins pour l'autoload
$this->chargerCheminAutoload();
// Enregistrement de la méthode gérant l'autoload des classes
spl_autoload_register(array('Widget', 'chargerClasse'));
// Nettoyage du $_GET (sécurité)
$this->collecterParametres();
} else {
$e = 'Les widget nécessite les variables serveurs suivantes pour fonctionner : REQUEST_URI et QUERY_STRING.';
trigger_error($e, E_USER_ERROR);
}
}
private function parserUrl() {
if (strlen($_SERVER['QUERY_STRING']) == 0) {
$len = strlen($_SERVER['REQUEST_URI']);
} else {
$len = -(strlen($_SERVER['QUERY_STRING']) + 1);
}
$url = substr($_SERVER['REQUEST_URI'], strlen(self::$config['chemins']['baseURL']), $len);
$url_morceaux = explode('/', $url);
return $url_morceaux;
}
private function collecterParametres() {
if (isset($_GET) && $_GET != '') {
$this->nettoyerGet();
$this->parametres = $_GET;
}
}
private function nettoyerGet() {
foreach ($_GET as $cle => $valeur) {
$verifier = array('NULL', "\n", "\r", "\\", '"', "\x00", "\x1a", ';');
$_GET[$cle] = strip_tags(str_replace($verifier, '', $valeur));
}
}
private function chargerCheminAutoload() {
$chemins_communs = explode(';', self::$config['chemins']['autoload']);
$chemins_communs = array_map('trim', $chemins_communs);
array_unshift($chemins_communs, '');
$chemins_widget = array();
if (isset(self::$config[$this->widget]['autoload'])) {
$chemins_widget = explode(';', self::$config[$this->widget]['autoload']);
foreach ($chemins_widget as $cle => $chemin) {
$chemins_widget[$cle] = self::$config['chemins']['widgetCourantDossier'].trim($chemin);
}
}
self::$autoload_chemins = array_merge($chemins_communs, $chemins_widget);
}
/**
* La méthode chargerClasse() charge dynamiquement les classes trouvées dans le code.
* Cette fonction est appelée par php5 quand il trouve une instanciation de classe dans le code.
*
*@param string le nom de la classe appelée.
*@return void le fichier contenant la classe doit être inclu par la fonction.
*/
public static function chargerClasse($classe) {
if (class_exists($classe)) {
return null;
}
foreach (self::$autoload_chemins as $chemin) {
$chemin = $chemin.$classe.'.php';
if (file_exists($chemin)) {
require_once $chemin;
}
}
}
/**
* Execute le widget.
*/
function executer() {
if (!is_null($this->widget)) {
$classe_widget = ucfirst($this->widget);
$fichier_widget = self::$config['chemins']['widgetCourantDossier'].$classe_widget.'.php';
if (file_exists($fichier_widget)) {
include_once $fichier_widget;
if (class_exists($classe_widget)) {
$widget = new $classe_widget(self::$config, $this->parametres);
$widget->executer();
}
}
}
}
/**
* Charge le fichier de config spécifique du wiget et fusionne la config avec celle partagés par l'ensemble des widgets.
*/
private function chargerWidgetConfig() {
$widget_config_ini_fichier = self::$config['chemins']['widgetCourantDossier'].'config.ini';
if (file_exists($widget_config_ini_fichier)) {
$widget_config = parse_ini_file($widget_config_ini_fichier, TRUE);
self::$config = array_merge(self::$config, $widget_config);
}
}
}
?>
/tags/v1.11-okuzgozu/widget/.htaccess
New file
0,0 → 1,13
<files *.ini>
order deny,allow
deny from all
</files>
 
#AddHandler x-httpd-php5 .php
AddDefaultCharset UTF-8
 
RewriteEngine On
# Redirections générale vers le fichier principal de Widget.
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ index.php/
/tags/v1.11-okuzgozu/widget/bibliotheque/WidgetCommun.php
New file
0,0 → 1,431
<?php
abstract class WidgetCommun {
protected $config = null;
protected $parametres = null;
protected $messages = array();
protected $debug = array();
public function __construct($config, $parametres) {
$this->config = $config;
$this->parserFichierIni($config['chemins']['widgetCourantDossier'].'config.ini');
$this->parametres = $parametres;
}
/**
* Parse le fichier ini donné en paramètre
* @param string $fichier_ini nom du fichier ini à parser
* @return boolean true si le fichier ini a été trouvé.
*/
private function parserFichierIni($fichier_ini) {
$retour = false;
if (file_exists($fichier_ini)) {
$ini = parse_ini_file($fichier_ini, true);
$this->fusionner($ini);
$retour = true;
}
return $retour;
}
 
/**
* fusionne un tableau de paramètres avec le tableau de config global
* @param array $ini le tableau à fusionner
*/
private function fusionner(array $ini) {
$this->config = array_merge($this->config, $ini);
}
protected function traiterNomMethodeExecuter($nom) {
$methode = 'executer';
$methode .= str_replace(' ', '', ucwords(str_replace('-', ' ', strtolower($nom))));
return $methode;
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION des CLASSES CHARGÉES à la DEMANDE
protected function getDao() {
if (! isset($this->dao)) {
$this->dao = new Dao();
}
return $this->dao;
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DE MÉTHODES COMMUNES ENTRE LES SERVICES
protected function getUrlImage($id, $format = 'L') {
$url_tpl = $this->config['chemins']['celImgUrlTpl'];
$id = sprintf('%09s', $id).$format;
$url = sprintf($url_tpl, $id);
return $url;
}
protected function encoderMotCle($mot_cle) {
return md5(mb_strtolower($mot_cle));
}
private function protegerMotsCles($mots_cles, $type) {
$separateur = ($type == self::TYPE_IMG) ? ',' : ';' ;
$mots_cles_a_proteger = explode($separateur,rtrim(trim($mots_cles), $separateur));
foreach ($mots_cles_a_proteger as $mot) {
$mots_cles_proteges[] = $this->bdd->quote($mot);
}
$mots_cles = implode(',', $mots_cles_proteges);
return $mots_cles;
}
protected function tronquerCourriel($courriel) {
$courriel = preg_replace('/[^@]+$/i', '...', $courriel);
return $courriel;
}
protected function nettoyerTableau($tableau) {
foreach ($tableau as $cle => $valeur) {
if (is_array($valeur)) {
$valeur = $this->nettoyerTableau($valeur);
} else {
$valeur = $this->nettoyerTexte($valeur);
}
$tableau[$cle] = $valeur;
}
return $tableau;
}
protected function nettoyerTexte($txt) {
$txt = preg_replace('/&(?!([a-z]+|#[0-9]+|#x[0-9][a-f]+);)/i', '&amp;', $txt);
$txt = preg_replace('/^(?:000null|null)$/i', '', $txt);
return $txt;
}
protected function etreVide($valeur) {
$vide = false;
if ($valeur == '' || $valeur == 'null'|| $valeur == '000null' || $valeur == '0') {
$vide = true;
}
return $vide;
}
protected function formaterDate($date_heure_mysql, $format = '%A %d %B %Y à %H:%M') {
$date_formatee = '';
if (!$this->etreVide($date_heure_mysql)) {
$timestamp = $this->convertirDateHeureMysqlEnTimestamp($date_heure_mysql);
$date_formatee = strftime($format, $timestamp);
}
return $date_formatee;
}
 
protected function convertirDateHeureMysqlEnTimestamp($date_heure_mysql){
$val = explode(' ', $date_heure_mysql);
$date = explode('-', $val[0]);
$heure = explode(':', $val[1]);
return mktime((int) $heure[0], (int) $heure[1], (int) $heure[2], (int) $date[1], (int) $date[2], (int) $date[0]);
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DE L'IDENTIFICATION et des UTILISATEURS
protected function getAuthIdentifiant() {
$id = (isset($_SERVER['PHP_AUTH_USER'])) ? $_SERVER['PHP_AUTH_USER'] : null;
return $id;
}
protected function getAuthMotDePasse() {
$mdp = (isset($_SERVER['PHP_AUTH_PW'])) ? $_SERVER['PHP_AUTH_PW'] : null;
return $mdp;
}
protected function authentifierAdmin() {
$message_accueil = "Veuillez vous identifier avec votre compte Tela Botanica.";
$message_echec = "Accès limité aux administrateurs du CEL.\n".
"Votre tentative d'identification a échoué.\n".
"Actualiser la page pour essayer à nouveau si vous êtes bien inscrit comme administrateur.";
return $this->authentifier($message_accueil, $message_echec, 'Admin');
}
protected function authentifierUtilisateur() {
$message_accueil = "Veuillez vous identifier avec votre compte Tela Botanica.";
$message_echec = "Accès limité aux utilisateur du CEL.\n".
"Inscrivez vous http://www.tela-botanica.org/page:inscription pour le devenir.\n".
"Votre tentative d'identification a échoué.\n".
"Actualiser la page pour essayer à nouveau si vous êtes déjà inscrit ou contacter 'accueil@tela-botanica.org'.";
return $this->authentifier($message_accueil, $message_echec, 'Utilisateur');
}
private function authentifier($message_accueil, $message_echec, $type) {
$id = $this->getAuthIdentifiant();
if (!isset($id)) {
$this->envoyerAuth($message_accueil, $message_echec);
} else {
if ($type == 'Utilisateur' && $this->getAuthMotDePasse() == 'debug') {
$autorisation = true;
} else {
$methodeAutorisation = "etre{$type}Autorise";
$autorisation = $this->$methodeAutorisation();
}
if ($autorisation == false) {
$this->envoyerAuth($message_accueil, $message_echec);
}
}
return true;
}
protected function etreUtilisateurAutorise() {
$identifiant = $this->getAuthIdentifiant();
$mdp = md5($this->getAuthMotDePasse());
$url = sprintf($this->config['authentification']['serviceUrlTpl'], $identifiant, $mdp);
$json = $this->getDao()->consulter($url);
$existe = json_decode($json);
$autorisation = (isset($existe) && $existe) ? true :false;
return $autorisation;
}
protected function etreAdminAutorise($identifiant) {
$identifiant = $this->getAuthIdentifiant();
$autorisation = ($this->etreUtilisateurAutorise() && $this->etreAdminCel($identifiant)) ? true : false;
return $autorisation;
}
protected function etreAdminCel($courriel) {
$admins = $this->config['authentification']['administrateurs'];
$courriels_autorises = explode(',', $admins);
 
$autorisation = (in_array($courriel, $courriels_autorises)) ? true : false ;
return $autorisation;
}
/**
* Prend en paramêtre un tableau de courriels et retourne après avoir intérogé un service we de l'annuaire
* une tableau avec en clé le courriel et en valeur, un tableau associatif :
* - nom : le nom de l'utilisateur
* - prenom : le prénom de l'utilisateur.
* @param array $courriels un tableau de courriels pour lesquels il faut recherche le prénom et nom.
*/
protected function recupererUtilisateursNomPrenom(Array $courriels) {
// Récupération des données au format Json
$service = "utilisateur/prenom-nom-par-courriel/".implode(',', $courriels);
$url = sprintf($this->config['chemins']['baseURLServicesAnnuaireTpl'], $service);
$json = $this->getDao()->consulter($url);
return (array) json_decode($json);
}
protected function recupererUtilisateursIdentite(Array $courriels) {
// Récupération des données au format Json
$service = "utilisateur/identite-par-courriel/".implode(',', $courriels);
$url = sprintf($this->config['chemins']['baseURLServicesAnnuaireTpl'], $service);
$json = $this->getDao()->consulter($url);
$utilisateurs = json_decode($json);
foreach ($courriels as $courriel) {
$info = array('id' => null, 'intitule' => '');
if (isset($utilisateurs->$courriel)) {
$info['intitule'] = $utilisateurs->$courriel->intitule;
$info['id'] = $utilisateurs->$courriel->id;
} else {
$info['intitule'] = $this->tronquerCourriel($courriel);
}
$noms[$courriel] = $info;
}
return $noms;
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de l'ENVOIE au NAVIGATEUR
 
protected function envoyerJsonp($donnees = null, $encodage = 'utf-8') {
$contenu = $_GET['callback'].'('.json_encode($donnees).');';
$this->envoyer($contenu, 'text/html', $encodage);
}
protected function envoyer($donnees = null, $mime = 'text/html', $encodage = 'utf-8') {
// Traitements des messages d'erreurs et données
if (count($this->messages) != 0) {
header('HTTP/1.1 500 Internal Server Error');
$mime = 'text/html';
$encodage = 'utf-8';
$sortie = '<html>'.
'<head><title>Messages</title></head>'.
'<body><pre>'.implode("\n", $this->messages).'</pre><body>'.
'</html>';
} else {
$sortie = $donnees;
if (is_null($donnees)) {
$sortie = 'OK';
}
}
 
// Gestion de l'envoie du déboguage
$this->envoyerDebogage();
 
// Envoie sur la sortie standard
$this->envoyerContenu($encodage, $mime, $sortie);
}
 
private function envoyerDebogage() {
if (!is_array($this->debug)) {
$this->debug[] = $this->debug;
}
if (count($this->debug) != 0) {
foreach ($this->debug as $cle => $val) {
if (is_array($val)) {
$this->debug[$cle] = print_r($val, true);
}
}
header('X-DebugJrest-Data:'.json_encode($this->debug));
}
}
 
private function envoyerContenu($encodage, $mime, $contenu) {
if (!is_null($mime) && !is_null($encodage)) {
header("Content-Type: $mime; charset=$encodage");
} else if (!is_null($mime) && is_null($encodage)) {
header("Content-Type: $mime");
}
print_r($contenu);
}
private function envoyerAuth($message_accueil, $message_echec) {
header('HTTP/1.0 401 Unauthorized');
header('WWW-Authenticate: Basic realm="'.mb_convert_encoding($message_accueil, 'ISO-8859-1', 'UTF-8').'"');
header('Content-type: text/plain; charset=UTF-8');
print $message_echec;
exit(0);
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES SQUELETTES (PHP, TXT...)
/**
* Méthode prenant en paramètre un tableau associatif, les clés seront recherchées dans le texte pour être
* remplacer par la valeur. Dans le texte, les clés devront être entre accolades : {}
*
* @param String $txt le texte où chercher les motifs.
* @param Array $donnees un tableau associatif contenant les motifs à remplacer.
*
* @return String le texte avec les motifs remplacer par les valeurs du tableau.
*/
protected static function traiterSqueletteTxt($txt, Array $donnees = array()) {
$motifs = array();
$valeurs = array();
foreach ($donnees as $cle => $valeur) {
if (strpos($cle, '{') === false && strpos($cle, '}') === false) {
$motifs = '{'.$cle.'}';
$valeurs = $valeur;
}
}
$txt = str_replace($motifs, $valeurs, $txt);
return $txt;
}
 
/**
* Méthode prenant en paramètre un chemin de fichier squelette et un tableau associatif de données,
* en extrait les variables, charge le squelette et retourne le résultat des deux combinés.
*
* @param String $fichier le chemin du fichier du squelette
* @param Array $donnees un tableau associatif contenant les variables a injecter dans le squelette.
*
* @return boolean false si le squelette n'existe pas, sinon la chaine résultat.
*/
protected static function traiterSquelettePhp($fichier, Array $donnees = array()) {
$sortie = false;
if (file_exists($fichier)) {
// Extraction des variables du tableau de données
extract($donnees);
// Démarage de la bufferisation de sortie
ob_start();
// Si les tags courts sont activés
if ((bool) @ini_get('short_open_tag') === true) {
// Simple inclusion du squelette
include $fichier;
} else {
// Sinon, remplacement des tags courts par la syntaxe classique avec echo
$html_et_code_php = self::traiterTagsCourts($fichier);
// Pour évaluer du php mélangé dans du html il est nécessaire de fermer la balise php ouverte par eval
$html_et_code_php = '?>'.$html_et_code_php;
// Interprétation du html et du php dans le buffer
echo eval($html_et_code_php);
}
// Récupèration du contenu du buffer
$sortie = ob_get_contents();
// Suppression du buffer
@ob_end_clean();
} else {
$msg = "Le fichier du squelette '$fichier' n'existe pas.";
trigger_error($msg, E_USER_WARNING);
}
// Retourne le contenu
return $sortie;
}
 
/**
* Fonction chargeant le contenu du squelette et remplaçant les tags court php (<?= ...) par un tag long avec echo.
*
* @param String $chemin_squelette le chemin du fichier du squelette
*
* @return string le contenu du fichier du squelette php avec les tags courts remplacés.
*/
private static function traiterTagsCourts($chemin_squelette) {
$contenu = file_get_contents($chemin_squelette);
// Remplacement de tags courts par un tag long avec echo
$contenu = str_replace('<?=', '<?php echo ', $contenu);
// Ajout systématique d'un point virgule avant la fermeture php
$contenu = preg_replace("/;*\s*\?>/", "; ?>", $contenu);
return $contenu;
}
//+----------------------------------------------------------------------------------------------------------------+
// UTILITAIRES
/**
* Permet de trier un tableau multi-dimenssionnel en gardant l'ordre des clés.
*
* @param Array $array le tableau à trier
* @param Array $cols tableau indiquant en clé la colonne à trier et en valeur l'ordre avec SORT_ASC ou SORT_DESC
* @author cagret at gmail dot com
* @see http://fr.php.net/manual/fr/function.array-multisort.php Post du 21-Jun-2009 12:38
*/
public static function trierTableauMd($array, $cols) {
$colarr = array();
foreach ($cols as $col => $order) {
$colarr[$col] = array();
foreach ($array as $k => $row) {
$colarr[$col]['_'.$k] = strtolower(self::supprimerAccents($row[$col]));
}
}
$params = array();
foreach ($cols as $col => $order) {
$params[] =& $colarr[$col];
$params = array_merge($params, (array)$order);
}
call_user_func_array('array_multisort', $params);
$ret = array();
$keys = array();
$first = true;
foreach ($colarr as $col => $arr) {
foreach ($arr as $k => $v) {
if ($first) {
$keys[$k] = substr($k,1);
}
$k = $keys[$k];
if (!isset($ret[$k])) {
$ret[$k] = $array[$k];
}
$ret[$k][$col] = $array[$k][$col];
}
$first = false;
}
return $ret;
}
private static function supprimerAccents($str, $charset='utf-8')
{
$str = htmlentities($str, ENT_NOQUOTES, $charset);
$str = preg_replace('#&([A-za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml);#', '\1', $str);
$str = preg_replace('#&([A-za-z]{2})(?:lig);#', '\1', $str); // pour les ligatures e.g. '&oelig;'
$str = preg_replace('#&[^;]+;#', '', $str); // supprime les autres caractères
return $str;
}
}
?>
/tags/v1.11-okuzgozu/widget/bibliotheque/Dao.php
New file
0,0 → 1,155
<?php
// declare(encoding='UTF-8');
/**
* Classe modèle spécifique à l'application, donc d'accés au données, elle ne devrait pas être appelée de l'extérieur.
*
* @category php5
* @package Widget
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version SVN: $Id$
*/
class Dao {
const HTTP_URL_REQUETE_SEPARATEUR = '&';
const HTTP_URL_REQUETE_CLE_VALEUR_SEPARATEUR = '=';
private $http_methodes = array('GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', 'TRACE');
protected $parametres = null;
private $url = null;
private $reponse_entetes = null;
//+----------------------------------------------------------------------------------------------------------------+
// ACCESSEURS
public function getReponseEntetes($cle) {
return $this->reponse_entetes;
}
public function getParametre($cle) {
$valeur = (isset($this->parametres[$cle])) ? $this->parametres[$cle] : null;
return $valeur;
}
public function ajouterParametre($cle, $valeur) {
$this->parametres[$cle] = $valeur;
}
public function supprimerParametre($cle) {
unset($this->parametres[$cle]);
}
public function nettoyerParametres() {
$this->parametres = null;
}
//+----------------------------------------------------------------------------------------------------------------+
// MÉTHODES
public function consulter($url) {
$retour = $this->envoyerRequete($url, 'GET');
return $retour;
}
public function ajouter($url, Array $donnees) {
$retour = $this->envoyerRequete($url, 'PUT', $donnees);
return $retour;
}
public function modifier($url, Array $donnees) {
$retour = $this->envoyerRequete($url, 'POST', $donnees);
return $retour;
}
public function supprimer($url) {
$retour = $this->envoyerRequete($url, 'DELETE');
return $retour;
}
public function envoyerRequete($url, $mode, Array $donnees = array()) {
$this->url = $url;
$contenu = false;
if (! in_array($mode, $this->http_methodes)) {
$e = "Le mode de requête '$mode' n'est pas accepté!";
trigger_error($e, E_USER_WARNING);
} else {
if ($mode == 'GET') {
$this->traiterUrlParametres();
}
$contexte = stream_context_create(array(
'http' => array(
'method' => $mode,
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'content' => http_build_query($donnees, null, self::HTTP_URL_REQUETE_SEPARATEUR))));
$flux = @fopen($this->url, 'r', false, $contexte);
if (!$flux) {
$this->reponse_entetes = $http_response_header;
$e = "L'ouverture de l'url '{$this->url}' par la méthode HTTP '$mode' a échoué!";
trigger_error($e, E_USER_WARNING);
} else {
// Informations sur les en-têtes et métadonnées du flux
$this->reponse_entetes = stream_get_meta_data($flux);
// Contenu actuel de $url
$contenu = stream_get_contents($flux);
fclose($flux);
}
$this->traiterEntete();
}
$this->reinitialiser();
return $contenu;
}
private function traiterUrlParametres() {
$parametres = array();
if (count($this->parametres) > 0) {
foreach ($this->parametres as $cle => $valeur) {
$cle = rawurlencode($cle);
$valeur = rawurlencode($valeur);
$parametres[] = $cle.self::HTTP_URL_REQUETE_CLE_VALEUR_SEPARATEUR.$valeur;
}
$url_parametres = implode(self::HTTP_URL_REQUETE_SEPARATEUR, $parametres);
$this->url = $this->url.'?'.$url_parametres;
}
}
private function traiterEntete() {
$infos = $this->analyserEntete();
$this->traiterEnteteDebogage($infos);
}
private function analyserEntete() {
$entetes = $this->reponse_entetes;
$infos = array('date' => null, 'uri' => $this->url, 'debogages' => null);
if (isset($entetes['wrapper_data'])) {
$entetes = $entetes['wrapper_data'];
}
foreach ($entetes as $entete) {
if (preg_match('/^X_REST_DEBOGAGE_MESSAGES: (.+)$/', $entete, $match)) {
$infos['debogages'] = json_decode($match[1]);
}
if (preg_match('/^Date: .+ ([012][0-9]:[012345][0-9]:[012345][0-9]) .*$/', $entete, $match)) {
$infos['date'] = $match[1];
}
}
return $infos;
}
private function traiterEnteteDebogage($entetes_analyses) {
if (isset($entetes['debogages'])) {
$date = $entetes['date'];
$uri = $entetes['uri'];
$debogages = $entetes['debogages'];
foreach ($debogages as $debogage) {
$e = "DEBOGAGE : $date - $uri :\n$debogage";
trigger_error($e, E_USER_NOTICE);
}
}
}
private function reinitialiser() {
$this->nettoyerParametres();
}
}
/tags/v1.11-okuzgozu/widget/index.php
New file
0,0 → 1,5
<?php
require 'Widget.php';
$widget = new Widget();
$widget->executer();
?>
/tags/v1.11-okuzgozu/widget/widget.ini.defaut.php
New file
0,0 → 1,29
;<?/*
[parametres]
;Memoire maxi pour les services : 128Mo = 134217728 ; 256Mo = 268435456 ; 512Mo = 536870912 ; 1Go = 1073741824
limiteMemoire = "512M"
; Niveau d'erreur PHP
erreurNiveau = 30719 ; E_ALL = 30719
; Séparateur d'url en entrée
argSeparatorInput = "&"
; Indication de la locale (setLocale(LC_ALL, ?)) pour les classes appelées par Widget.php
locale = "fr_FR.UTF-8"
; Indication du fuseau horraire par défaut date_default_timezone_set(?)pour les classes appelées par Widget.php
fuseauHoraire = "Europe/Paris"
 
[chemins]
; Chemins | utiliser dans la méthode autoload des widgets
autoload = "bibliotheque/"
; Dossier contenant les widgets
widgetsDossier = "modules/"
; Dossier contenant le widget demandé construit dynamiquement dans le fichier Widget.php
widgetCourantDossier = ""
; Dossier contenant les fichiers des bibliothèques tierces
bibliothequeDossier = "bibliotheque/"
; Base de l'url servant | appeler les widgets
baseURL = "/widget:coel:"
; URL de base absolue des Widgets du CEL construit dynamiquement dans le fichier WidgetCommun.php
baseURLAbsoluDyn = ""
; URL des services web sous forme de template | utiliser avec sprintf
baseURLServicesTpl = "http://api.tela-botanica.org/services/coel/"
;*/?>
/tags/v1.11-okuzgozu/widget
New file
Property changes:
Added: svn:ignore
+widget.ini.php
/tags/v1.11-okuzgozu/Coel-compile-dev
New file
0,0 → 1,13
#!/bin/sh
# Compilation de l'application pour le développement
APPDIR=`dirname $0`;
APPDIR_ABSOLU=`pwd`;
APPLI_NOM=`basename $APPDIR_ABSOLU | sed 's/^./\u&/'`
APPLI_DOMAINE="org.tela_botanica.$APPLI_NOM"
CLASSPATH=$(cat "$APPDIR/$APPLI_NOM-classpath" | sed -e :a -e '$!N;s/\n//;ta')
 
# Mise à jour de la config de l'application
sh $APPLI_NOM-config
 
# Lancement de la compilation
java -Xmx1024M -Xss256k -Xverify:none -cp $CLASSPATH com.google.gwt.dev.Compiler -localWorkers 2 -draftCompile -style PRETTY $APPLI_DOMAINE;
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v1.11-okuzgozu/CHANGELOG
New file
0,0 → 1,29
Changements 2015-07-27 [création de la branche "v1.10-negrette"]
* remplacement du CookieProvider qui générait des monceaux de cookies cracras par un faux provider qui ne fait rien
* SSO !
 
Changements 2015-04-20 [création de la branche "v1.9-nebbiolo"]
* Correction de bugs qui faisent disparaitres les personne et publication
* Modification d'affichage du formulaire de collection pour le rendre plus compact
 
Changements 2015-03-02 [création de la branche "v1.8-narince"]
* Import de publication dans l'interface de coel
 
Changements 2014-11-24 [création de la branche "v1.7-muscat"]
 
Changements 2014-06-23 [création de la branche "v1.6-muscardin"]
 
Changements 2014-04-02 [création de la branche "v1.5-muscadet"]
 
Changements 2014-02-10 [création de la branche "v1.4-muscadelle"]
* Supression de la notion de projet qui était un héritage dans l'ancienne application
* dans l'interface
* dans les services web
 
Changements 2014-01-06 [création de la branche "v1.3-muller-thurgau"]:
* Utilisation du geocoding pour les structures dont l'adresse est précisée de manière suffisante
* Bretagne; DOM-TOM
* Correction de bugs
* Prise en compte de CORS
* Modif service CoelRecherche pour coel-consultation
* Recherche des personnes : "adresse" cherche aussi dans le lieu de naissance et de décès
/tags/v1.11-okuzgozu/Coel-shell
New file
0,0 → 1,15
#!/bin/sh
# Lancement du mode développement de l'application
APPDIR=`dirname $0`;
APPDIR_ABSOLU=`pwd`;
APPLI_NOM_DOSSIER=`basename $APPDIR_ABSOLU`
APPLI_NOM=`basename $APPDIR_ABSOLU | sed 's/^./\u&/'`
APPLI_DOMAINE="org.tela_botanica.$APPLI_NOM"
APPLI_LIEN="http://localhost/$APPLI_NOM_DOSSIER/war/$APPLI_NOM.html"
CLASSPATH=$(cat "$APPDIR_ABSOLU/$APPLI_NOM-classpath" | sed -e :a -e '$!N;s/\n//;ta')
 
# Mise à jour de la config de l'application
sh $APPLI_NOM-config
 
# Lancement du mode hosted
java -Xmx1024M -cp $CLASSPATH com.google.gwt.dev.DevMode -whitelist http://www.tela-botanica.org -noserver -port 80 -startupUrl $APPLI_LIEN $APPLI_DOMAINE;
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v1.11-okuzgozu/jrest/.htaccess
New file
0,0 → 1,7
#AddHandler x-httpd-php5 .php
AddDefaultCharset UTF-8
 
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ index.php/
/tags/v1.11-okuzgozu/jrest/test-conf.sed
New file
0,0 → 1,2
/^database/s|= .*|= tb_coel_test|
/^(baseURL|urlBaseCoel|urlBaseJrest)/s|/eflore/|/eflore-test/|
/tags/v1.11-okuzgozu/jrest/JRest.php
New file
0,0 → 1,302
<?php
// In : utf8 url_encoded (get et post)
// Out : utf8
 
// TODO : gerer les retours : dans ce controleur : code retour et envoi ...
class JRest {
 
/** Parsed configuration file */
private $config;
 
/** The HTTP request method used. */
private $method = 'GET';
 
/** The HTTP request data sent (if any). */
private $requestData = NULL;
 
/** Array of strings to convert into the HTTP response. */
private $output = array();
 
/** Nom resource. */
private $resource = NULL;
 
/** Identifiant unique resource. */
private $uid = NULL;
 
/**
* Constructor. Parses the configuration file "JRest.ini", grabs any request data sent, records the HTTP
* request method used and parses the request URL to find out the requested resource
* @param str iniFile Configuration file to use
*/
public function JRest($iniFile = 'jrest.ini.php') {
$this->config = parse_ini_file($iniFile, TRUE);
if (isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD']) && isset($_SERVER['QUERY_STRING'])) {
if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] > 0) {
$this->requestData = '';
$httpContent = fopen('php://input', 'r');
while ($data = fread($httpContent, 1024)) {
$this->requestData .= $data;
}
fclose($httpContent);
}
if (strlen($_SERVER['QUERY_STRING']) == 0) {
$len = strlen($_SERVER['REQUEST_URI']);
} else {
$len = -(strlen($_SERVER['QUERY_STRING']) + 1);
}
$urlString = substr($_SERVER['REQUEST_URI'], strlen($this->config['settings']['baseURL']), $len);
 
$urlParts = explode('/', $urlString);
 
if (isset($urlParts[0])) $this->resource = $urlParts[0];
if (count($urlParts) > 1 && $urlParts[1] != '') {
array_shift($urlParts);
foreach ($urlParts as $uid) {
if ($uid != '') {
$this->uid[] = urldecode($uid);
}
}
}
 
$this->method = $_SERVER['REQUEST_METHOD'];
} else {
trigger_error('I require the server variables REQUEST_URI, REQUEST_METHOD and QUERY_STRING to work.', E_USER_ERROR);
}
}
 
/**
* Execute the request.
*/
function exec() {
switch ($this->method) {
case 'GET':
$this->get();
break;
case 'POST':
$this->post();
break;
case 'DELETE':
$this->delete();
break;
case 'PUT':
$this->add();
break;
}
}
 
/**
* Execute a GET request. A GET request fetches a list of resource when no resource name is given, a list of element
* when a resource name is given, or a resource element when a resource and resource unique identifier are given. It does not change the
* database contents.
*/
private function get() {
if ($this->resource) {
$resource_file = 'services/'.ucfirst($this->resource).'.php';
$resource_class = ucfirst($this->resource);
if (file_exists($resource_file)) {
include_once $resource_file;
if (class_exists($resource_class)) {
$service = new $resource_class($this->config);
if ($this->uid) { // get a resource element
if (method_exists($service, 'getElement')) {
$service->getElement($this->uid);
}
} elseif (method_exists($service, 'getRessource')) { // get all elements of a ressource
$service->getRessource();
}
}
}
} else { // get resources
// include set.jrest.php, instanticiation et appel
}
}
 
private function post() {
$pairs = array();
// Récupération des paramètres passés dans le contenu de la requête HTTP (= POST)
if ($this->requestData) {
$pairs = $this->parseRequestData();
}
 
// Ajout des informations concernant l'upload de fichier passées dans la variable $_FILE
if(isset($_FILES)) {
foreach ($_FILES as $v) {
$pairs[$v['name']] = $v;
}
 
// Ne pas effacer cette ligne ! Elle est indispensable pour les services du Carnet en ligne
// qui n'utilisent que le tableau pairs dans les posts
$pairs = array_merge($pairs, $_POST);
}
 
// gestion du contenu du post
if(isset($_POST))
{
// Safari ne sait pas envoyer des DELETE avec gwt...
// Nous utilisons le parametre "action" passé dans le POST qui doit contenir DELETE pour lancer la supression
if (isset($pairs['action']) && $pairs['action'] == 'DELETE') {
$this->delete();
return;
}
 
if (count($pairs) != 0) {
if ($this->uid) { // get a resource element
$resource_file = 'services/'.ucfirst($this->resource).'.php';
$resource_class = ucfirst($this->resource);
if (file_exists($resource_file)) {
include_once $resource_file;
if (class_exists($resource_class)) {
$service = new $resource_class($this->config);
if (method_exists($service,'updateElement')) { // Update element
// TODO : a voir le retour ...
if ($service->updateElement($this->uid, $pairs)) {
$this->created();
}
}
}
}
} else { // get all elements of a ressource
$this->add($pairs);
}
} else {
$this->lengthRequired();
}
}
}
 
private function delete() {
$resource_file = 'services/'.ucfirst($this->resource).'.php';
$resource_class = ucfirst($this->resource);
if (file_exists($resource_file)) {
include_once $resource_file;
if (class_exists($resource_class)) {
$service = new $resource_class($this->config);
if ($this->uid) { // get a resource element
if (method_exists($service, 'deleteElement')) { // Delete element
if ($service->deleteElement($this->uid)) {
$this->noContent();
}
}
}
}
}
}
 
private function add($pairs = null) {
if (is_null($pairs)) {
$pairs = array();
// Récupération des paramètres passés dans le contenu de la requête HTTP (= POST)
// FIXME : vérifier que l'on récupère bien les données passées par PUT
if ($this->requestData) {
$pairs = $this->parseRequestData();
}
}
 
if (count($pairs) != 0) {
$resource_file = 'services/'.ucfirst($this->resource).'.php';
$resource_class = ucfirst($this->resource);
if (file_exists($resource_file)) {
include_once $resource_file;
if (class_exists($resource_class)) {
$service = new $resource_class($this->config);
if (method_exists($service,'createElement')) { // Create a new element
if ($service->createElement($pairs)) {
$this->created();
}
}
}
}
} else {
$this->lengthRequired();
}
}
 
/**
* Parse the HTTP request data.
* @return str[] Array of name value pairs
*/
private function parseRequestData() {
$values = array();
$pairs = explode('&', $this->requestData);
foreach ($pairs as $pair) {
$parts = explode('=', $pair);
if (isset($parts[0]) && isset($parts[1])) {
$parts[1] = rtrim(urldecode($parts[1]));
$values[$parts[0]] = $parts[1];
}
}
return $values;
}
 
/**
* Send a HTTP 201 response header.
*/
private function created($url = FALSE) {
header('HTTP/1.0 201 Created');
if ($url) {
header('Location: '.$url);
}
}
 
/**
* Send a HTTP 204 response header.
*/
private function noContent() {
header('HTTP/1.0 204 No Content');
}
 
/**
* Send a HTTP 400 response header.
*/
private function badRequest() {
header('HTTP/1.0 400 Bad Request');
}
 
/**
* Send a HTTP 401 response header.
*/
private function unauthorized($realm = 'JRest') {
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) {
header('WWW-Authenticate: Basic realm="'.$realm.'"');
}
header('HTTP/1.0 401 Unauthorized');
}
 
/**
* Send a HTTP 404 response header.
*/
private function notFound() {
header('HTTP/1.0 404 Not Found');
}
 
/**
* Send a HTTP 405 response header.
*/
private function methodNotAllowed($allowed = 'GET, HEAD') {
header('HTTP/1.0 405 Method Not Allowed');
header('Allow: '.$allowed);
}
 
/**
* Send a HTTP 406 response header.
*/
private function notAcceptable() {
header('HTTP/1.0 406 Not Acceptable');
echo join(', ', array_keys($this->config['renderers']));
}
 
/**
* Send a HTTP 411 response header.
*/
private function lengthRequired() {
header('HTTP/1.0 411 Length Required');
}
 
/**
* Send a HTTP 500 response header.
*/
private function internalServerError() {
header('HTTP/1.0 500 Internal Server Error');
}
}
?>
/tags/v1.11-okuzgozu/jrest/Makefile
New file
0,0 → 1,14
# installation de l'espace de test
# syntax:
# make <cible> [annu_u=<bdd_utilisateur> [annu_p=<bdd_mot_de_passe>]]
all: test
 
test:
@test '!' -e jrest.ini.php || { echo "jrest.ini.php exists"; exit 1; }
@cp jrest.ini.php.defaut jrest.ini.php
@sed -r -i -f test-conf.sed jrest.ini.php
@test -n "$(annu_u)" -o -n "$(annu_p)" && make bddconf || true
 
bddconf:
@test -n "$(annu_u)" && sed -r -i "/^loginAnnuaire/s/= .*/= \"$(annu_u)\"/" jrest.ini.php || true
@test -n "$(annu_p)" && sed -r -i "/^mdpAnnuaire/s/= .*/= \"$(annu_p)\"/" jrest.ini.php || true
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/tags/v1.11-okuzgozu/jrest/index.php
New file
0,0 → 1,28
<?php
require 'JRest.php';
 
/**
* La fonction __autoload() charge dynamiquement les classes trouvées dans le code.
*
* Cette fonction est appelée par php5 quand il trouve une instanciation de classe dans le code.
*
*@param string le nom de la classe appelée.
*@return void le fichier contenant la classe doit être inclu par la fonction.
*/
function __autoload($classe) {
if (class_exists($classe)) {
return null;
}
$chemins = array('', 'services/', 'services/bibliotheque/');
foreach ($chemins as $chemin) {
$chemin = $chemin.$classe.'.php';
if (file_exists($chemin)) {
require_once $chemin;
}
}
}
 
$jRest =& new JRest();
$jRest->exec();
?>
/tags/v1.11-okuzgozu/jrest/jrest.ini.php.defaut
New file
0,0 → 1,28
;<?/*
[settings]
baseURL = "/eflore/coel/jrest/"
 
; COEL
[coel]
phptype = mysql
username = root
password =
hostspec = localhost
database = tb_coel
guid = "urn:lsid:tela-botanica.org:%s"
editeur = "Tela Botanica"
urlBaseFicheConsultation = "http://www.tela-botanica.org/"
urlBaseCoel = "http://www.tela-botanica.org/eflore/coel/Coel.html"
urlBaseJrest = "http://www.tela-botanica.org/eflore/coel/jrest/"
aideBaseUrlTpl = "http://www.tela-botanica.org/wikini/eflore/wakka.php?wiki="
urlAnnuaire = "http://www.tela-botanica.org/service:annuaire-test:utilisateur/identite-complete-par-courriel"
urlServiceBaseAuth = "https://www.tela-botanica.org/service-test:annuaire:auth/"
loginAnnuaire =
mdpAnnuaire =
correctionLogin =
correctionMdp =
 
dossier_import_tmp = "/home/utilisateur/web/tmp/coel/"
chemin_script_import = "/opt/lampp/bin/php-5.5.9 /home/utilisateur/web/coel/scripts/cli.php import -a import -n %s -u %s"
 
;*/?>
/tags/v1.11-okuzgozu/jrest/services/CoelImport.php
New file
0,0 → 1,120
<?php
 
/**
* Service important des informations concernant COEL au format CSV.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @author Aurélien PERONNET <aurelien@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2014
*/
class CoelImport extends Coel {
 
private $chemin_script = null;
private $dossier_import_tmp = null;
 
/**
* Méthode appelée avec une requête de type GET.
*/
public function getElement($params = array()) {
if(!empty($_SESSION['coel']['import_stat'])) {
header('Content-type : application/json');
echo json_encode($_SESSION['coel']['import_stat']);
exit;
}
}
/**
* Méthode appelée pour ajouter un élément.
*/
public function createElement($params) {
$this->chemin_script = $this->config['coel']['chemin_script_import'];
$this->dossier_import_tmp = $this->config['coel']['dossier_import_tmp'];
$erreurs = $this->verifierConditionsImport();
if(!empty($erreurs)) {
header('Content-type : application/json');
echo json_encode($erreurs);
exit;
}
// Normalement si on arrive ici, c'est que le fichier contient quelque chose
$fichier = array_pop($_FILES);
$nom_fichier = $fichier['name'];
$type = $params['type'];
// on peut imaginer d'autres types d'import que les publications
switch($type) {
case 'publication':
$retour = $this->importerPublications($nom_fichier);
break;
default:
$retour = false;
}
// Suppression du fichier importé
unlink($this->dossier_import_tmp.$fichier['name']);
$retour_import = array("succes_import" => "1", "erreurs" => array(), "nb_elements_importes" => "0") ;
 
// Les fonctions d'imports produisent le nombre de lignes importées
// ou bien une ou des erreurs
if(is_numeric($retour)) {
$retour_import['nb_elements_importes'] = $retour;
} else {
$retour_import['succes_import'] = "0";
$retour_import['erreurs'] = $retour;
}
// Mise en session des résultats d'import
// afin de pouvoir appeler le service en lecture pour obtenir les stats
$_SESSION['coel']['import_stat'] = $retour_import;
header('Content-type : application/json');
echo json_encode($retour_import);
exit;
}
private function verifierConditionsImport() {
$erreurs = false;
if(empty($_FILES)) {
$erreurs[] = "Ce service requiert un fichier à uploader";
}
$fichier = reset($_FILES);
if($fichier['error'] != UPLOAD_ERR_OK) {
$erreurs[] = "Des erreurs sont survenues durant l'upload du fichier";
}
if($fichier['size'] == 0) {
$erreurs[] = "Le fichier envoyé est vide";
}
$deplacement = move_uploaded_file($fichier['tmp_name'], $this->dossier_import_tmp.$fichier['name']);
if(!$deplacement) {
$erreurs[] = "Erreur du déplacement du fichier sur le serveur";
}
return $erreurs;
}
private function importerPublications($nom_fichier) {
$utilisateur = array('id' => '', 'session' => session_id(), 'ip' => $_SERVER['REMOTE_ADDR']);
if(!empty($utilisateur_connecte = $this->getUtilisateur())) {
$utilisateur['id'] = $utilisateur_connecte['id'];
}
$retour = false;
$script = sprintf($this->chemin_script, $nom_fichier, "'".json_encode($utilisateur)."'");
exec($script, $retour);
return array_pop($retour);
}
}
/tags/v1.11-okuzgozu/jrest/services/CoelUtilisateur.php
New file
0,0 → 1,507
<?php
/**
* Service d'itentification d'un utilisateur.
* Modifié pour fonctionner avec le SSO.
*
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* Cas d'utilisation :
* Le service reçoit un jeton SSO (ou pas) dans le header "Authorization", le fait
* vérifier par l'annuaire; s'il est valide, le décode puis retourne le profil utilisateur
* associé; sinon retourne un profil anonyme.
*
* 1: Aucun jeton ou jeton invalide transmis
* 1: L'application retourne l'identifiant de session en cours (mode anonyme)
*
* 2: Jeton valide transmis
* 1 : Passe ou reste dans l'état "connecté"; le profil actif est retourné
*
* En résumé, utilisation des URLs :
* /CoelUtilisateur/identite : retour identifiant de session si jamais connecté, sinon retour de l'id (+ login et mot de passe)
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @author David DELON <david.delon@clapas.net>
* @author Mathias CHOUET <mathias@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
class CoelUtilisateur extends Coel {
 
protected $licence_acceptee = false;
 
/**
* Point d'entrée GET sans paramètres
*/
public function getRessource() {
// par défaut, mode anonyme
$infos = $this->getUtilisateurAnonyme();
// recherche d'un utilisateur identifié en fonction du jeton SSO
$infosIdentifie = $this->getUtilisateurSSO();
if ($infosIdentifie != null) {
$infos = $infosIdentifie;
}
// et vlan, passe-moi l'éponge
$this->envoyer($infos);
}
 
/**
* Point d'entrée GET avec paramètres
*/
public function getElement($ressources) {
switch($ressources[0]) {
case "setLicence" :
$this->setLicence($ressources[1]);
break;
default:
echo "action [" . $ressources[0] . "] inconnue";
}
}
 
/**
* Renvoie un profil utilisateur CoeL anonyme
* (licence vide, id de session, non connecté)
*/
protected function getUtilisateurAnonyme() {
$info = array("", session_id(), false);
return $info;
}
 
/**
* Recherche un jeton SSO dans l'entête HTTP "Authorization", vérifie ce
* jeton auprès de l'annuaire et en cas de succès charge les informations
* de l'utilisateur associé; si besoin, copie l'utilisateur dans la table
* Personnes de CoeL
*
* @return Array un profil utilisateur ou null
*/
protected function getUtilisateurSSO() {
$utilisateur = null;
// lecture du jeton
$jeton = $this->lireJetonEntete();
//echo "Jeton : "; var_dump($jeton);
if ($jeton != null) {
// validation par l'annuaire
$valide = $this->verifierJeton($jeton);
if ($valide === true) {
// décodage du courriel utilisateur depuis le jeton
$donneesJeton = $this->decoderJeton($jeton);
if ($donneesJeton != null && $donneesJeton["sub"] != "") {
// récupération de l'utilisateur
$courriel = $donneesJeton["sub"];
 
// lecture des infos dans l'annuaire (relou mais nécessaire pour la copie dans la table Personnes de CoeL)
$infosAnnuaire = $this->obtenirInfosAnnuaire($courriel);
$this->setInfosAnnuaire($infosAnnuaire);
//echo "Infos Annu: "; var_dump($infosAnnuaire);
 
// lecture de l'utilisateur connu (ou pas) par CoeL (table Personnes)
$utilisateur_existant = $this->chargerUtilisateur($courriel);
//echo "UTIL EXIST: "; var_dump($utilisateur_existant);
// Vérification de la nécessité de mettre à jour l'utilisateur COEL vis à vis de l'annuaire de Tela Botanica
if (!is_null($infosAnnuaire) && $this->avoirBesoinMiseAJour($utilisateur_existant)) {
$this->debug[] = "Besoin d'une mise à jour";
 
$presence_dans_coel = ($utilisateur_existant != false); // si on l'a trouvé juste au dessus
$this->debug[] = "Presence: $presence_dans_coel";
$mot_de_passe_sha1 = $infosAnnuaire['pass'];
//echo "MDP: " .$mot_de_passe_sha1;
 
if ($presence_dans_coel) {
// Nécessite de faire une mise à jour
$this->debug[] = "Mise à jour de l'utilisateur {$infosAnnuaire['id']}";
$this->mettreAJourUtilisateur($courriel, $mot_de_passe_sha1, $infosAnnuaire);
// ci-dessous : ne pas caster en int car GWT attend une String (le con !)
$utilisateur_existant['licence'] = $this->recupererLicenceUtilisateur($infosAnnuaire['id']);
} else {
// Nécessite d'ajouter le nouvel utilisateur
$this->debug[] = "Ajout d'une nouvel utilisateur";
$this->ajouterUtilisateurACoel($infosAnnuaire, $mot_de_passe_sha1);
// rechargement après l'avoir ajouté (un peu nul)
$utilisateur_existant = $this->chargerUtilisateur($courriel);
}
}
 
// stockage de l'utilisateur en session
$this->setUtilisateur($utilisateur_existant);
 
// renvoi des infos
$utilisateur = array($utilisateur_existant['licence'], $infosAnnuaire['id'], true, $this->getUtilisateurNomComplet(), $this->getUtilisateurPrenom(), $this->getUtilisateurNom(), $this->getParametre());
}
}
}
 
return $utilisateur;
}
 
protected function deconnecterUtilisateur() {
$_SESSION['coel_utilisateur'] = '';
$_SESSION['coel_infosAnnuaire'] = '';
}
 
/**
* Retourne true si le compte utilisateur a été modifié dans l'annuaire, et que les
* modifications ont besoin d'être répercutées dans la table Personnes de Coel
*/
protected function avoirBesoinMiseAJour($info_annuaire_coel) {
$necessite_maj = false;
if ($info_annuaire_coel == false) {
// Le login et/ou le mot de passe a pu changer
$necessite_maj = true;
} else {
$info_annuaire_distant = $this->getInfosAnnuaire();
if ($this->comparerInfosAnnuairesDistantEtCoel($info_annuaire_distant, $info_annuaire_coel) == false) {
$necessite_maj = true;
}
}
return $necessite_maj;
}
protected function comparerInfosAnnuairesDistantEtCoel($annuaire_distant, $annuaire_coel) {
$identique = true;
$tableau_annuaire_distant = array('nom' => $annuaire_distant['nom'],
'prenom' => $annuaire_distant['prenom'],
'ville' => $annuaire_distant['ville'],
'code_postal' => $annuaire_distant['code_postal']);
$tableau_annuaire_coel = array('nom' => $annuaire_coel['nom'],
'prenom' => $annuaire_coel['prenom'],
'ville' => $annuaire_coel['ville'],
'code_postal' => $annuaire_coel['code_postal']);
foreach ($tableau_annuaire_distant as $cle => $valeur) {
if ($tableau_annuaire_coel[$cle] != $valeur) {
$identique = false;
break;
}
}
return $identique;
}
 
/**
* Vérifie si un utilisateur est présent dans la table Personnes de CoeL
*/
protected function verifierPresenceUtilisateur($id) {
$present = false;
$requete = 'SELECT COUNT(cp_id_personne) AS nbre '.
'FROM coel_personne '.
"WHERE cp_ce_annuaire = {$this->bdd->quote($id)} ".
" AND cp_ce_annuaire = cp_id_personne ";
try {
$nbre = $this->bdd->query($requete)->fetchColumn();
if (0 == $nbre) {
$this->debug[] = "Utilisateur NON présent dans l'annuaire de COEL.";
} else if (1 == $nbre) {
$this->debug[] = "Utilisateur présent dans l'annuaire de COEL.";
$present = true;
} else if (false === $nbre) {
$this->debug[] = "Erreur dans la requête de vérification de présence dans l'annuaire de COEL.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
return $present;
}
 
/**
* Renvoie l'état d'acceptation de la licence pour un utilisateur donné :
* 0 (non acceptée) ou 1 (acceptée)
*/
protected function recupererLicenceUtilisateur($id) {
$requete = 'SELECT cp_mark_licence '.
'FROM coel_personne '.
"WHERE cp_ce_annuaire = {$this->bdd->quote($id)} ".
" AND cp_ce_annuaire = cp_id_personne ";
try {
$licence = $this->bdd->query($requete)->fetchColumn();
if ($licence === false) {
$this->debug[] = "La licence n'a pas pu être récupérée.";
return 0;
} else {
return $licence;
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
}
 
/**
* Met à jour les données de l'utilisateur dans la table CoeL Personnes
*/
protected function mettreAJourUtilisateur($login, $mot_de_passe_sha1, $infos) {
try {
$cp_fmt_nom_complet = $infos['prenom'].' '.$infos['nom'];
$requete = ''
. 'UPDATE coel_personne'
. " SET cp_id_personne = '{$infos['id']}', "
. " cp_fmt_nom_complet = '$cp_fmt_nom_complet', cp_prenom = '{$infos['prenom']}', cp_nom = '{$infos['nom']}', "
. " cp_code_postal = '{$infos['code_postal']}', cp_ville = '{$infos['ville']}', cp_truk_courriel = '{$infos['courriel']}', "
. " cp_login = '{$infos['courriel']}', cp_mot_de_passe = '$mot_de_passe_sha1', cp_ce_annuaire = '{$infos['id']}' "
. " WHERE cp_login = '$login' "
//. " AND cp_mot_de_passe = '{$infos['mot_de_passe']}' " // WTF ?
;
 
// Ajout des données
$resultat = $this->bdd->exec($requete);
if ($resultat === false) {
$this->messages[] = "L'utilisateur n'a pas été mis à jour car la requête a échouée.";
}
} catch (PDOException $e) {
$messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
 
/**
* Met à jour l'utilisateur d'id $idUtilisateur, et passe son acceptation de
* la licence à "1"
*/
protected function setLicence($idUtilisateur = null) {
if ($idUtilisateur == null) {
$messages[] = "Id utilisateur null";
$this->envoyer();
exit;
}
// Mise à jour de l'utilisateur
try {
$requete = 'UPDATE coel_personne '.
"SET cp_mark_licence = 1 ".
"WHERE cp_ce_annuaire = '$idUtilisateur' ";
// Ajout des données
$resultat = $this->bdd->exec($requete);
if ($resultat === false) {
$this->messages[] = "L'utilisateur n'a pas été mis à jour car la requête a échouée.";
} else {
// Confirmation attendue par l'interface
$this->envoyer(array("1"));
exit;
}
} catch (PDOException $e) {
$messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
$this->envoyer();
}
}
 
/**
* Ajoute une copie de l'utilisateur dans la table CoeL Personnes
*/
protected function ajouterUtilisateurACoel($infos, $mot_de_passe_sha1) {
try {
// Construction de la requête d'ajout
// Notes : pour rester compatibles avec l'annuaire de Tela, les utilisateurs sont ajoutés directement avec l'id
// de l'annuaire Tela. Dans CoelPersonne, les personnes qui ne sont pas utilisateur sont ajoutés avec un id supérieur à 100 000
$cp_fmt_nom_complet = $infos['prenom'].' '.$infos['nom'];
$cp_mark_licence = '0';
// si un utilisateur a changé son email dans un compte TB existant, une ligne avec son ID existera déjà et /i
// => on fait un REPLACE (attention à la compatibilité !)
$requete = 'REPLACE INTO coel_personne '.
' (cp_id_personne, cp_fmt_nom_complet, cp_prenom, cp_nom, cp_code_postal, '.
' cp_ville, cp_truk_courriel, cp_login, cp_mot_de_passe, cp_ce_annuaire, cp_mark_licence) '.
"VALUES ('{$infos['id']}', '$cp_fmt_nom_complet', '{$infos['prenom']}', '{$infos['nom']}', ".
"'{$infos['code_postal']}', '{$infos['ville']}', '{$infos['courriel']}', '{$infos['courriel']}', '".$mot_de_passe_sha1."', ".
"'{$infos['id']}', $cp_mark_licence) ";
//$this->debug[] = $requete;
// Ajout des données
$resultat = $this->bdd->exec($requete);
if ($resultat === false) {
$this->debug[] = "Utilisateur NON ajouté dans coel_personne car la requête a échouée.";
} else {
$this->debug[] = "Utilisateur ajouté à coel_personne.";
}
} catch (PDOException $e) {
//$this->debug[] = "EREEUR SQL: " . sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
$messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
 
/**
* Appelle l'annuaire pour connaître tous les détails de l'utilisateur de courriel $login
*/
protected function obtenirInfosAnnuaire($login) {
$url_annuaire = $this->config['coel']['urlAnnuaire'];
$login_annuaire = $this->config['coel']['loginAnnuaire'];
$mdp_annuaire = $this->config['coel']['mdpAnnuaire'];
 
$posds = strpos($url_annuaire, "//");
$protocole = substr($url_annuaire, 0, $posds+2);
$reste_adresse = substr($url_annuaire, $posds+2);
// auth HTTP basic cracra
$url_annuaire = $protocole . $login_annuaire . ':' . $mdp_annuaire . "@" . $reste_adresse;
$url_annuaire .= '/' . $login;
$url_annuaire .= '/xml'; // @TODO un jour, faire en sorte que ça lise du JSON
 
$resultat_annuaire = file_get_contents($url_annuaire);
$tableau_annuaire = null;
if ($xml_utilisateur = simplexml_load_string($resultat_annuaire)) {
// La fonction a retourné un objet
foreach ($xml_utilisateur->children() as $key => $val) {
if ((string) $val != '') {
$tableau_annuaire[$key] = (String) $val;
}
}
}
return $tableau_annuaire;
}
 
/**
* Enregistre le fait que la personne de login $login a accepté la licence de CoeL
*/
protected function accepterLicence($login) {
$sortie = false;
try {
$requete = 'UPDATE coel_personne '.
'SET cp_mark_licence = 1 '.
"WHERE cp_login = {$this->bdd->quote($login)} ";
$resultat = $this->bdd->exec($requete);
if ($resultat === false) {
$this->debug[] = "La table Personne n'a pas été mise à jour car la requête a échoué";
} else {
$this->debug[] = "Création du cookie licence.";
$_SESSION['coel_utilisateur']['licence'] = '1';
// @TODO CHANGER
//$this->setCookiePersistant('coel_licence', '1');
$sortie = true;
}
} catch (PDOException $e) {
$messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
return $sortie;
}
/**
* Essaye de trouver un jeton JWT non vide dans l'entête HTTP "Authorization"
*
* @return String un jeton JWT ou null
*/
protected function lireJetonEntete() {
$jwt = null;
$headers = apache_request_headers();
if (isset($headers["Authorization"]) && ($headers["Authorization"] != "")) {
$jwt = $headers["Authorization"];
}
return $jwt;
}
/**
* Vérifie un jeton auprès de l'annuaire
*
* @param String $jeton un jeton JWT
* @return true si le jeton est vérifié, false sinon
*/
protected function verifierJeton($jeton) {
$urlServiceVerification =$this->config['coel']['urlServiceBaseAuth'] . "verifierjeton";
$urlServiceVerification .= "?token=" . $jeton;
// file_get_contents râle si le certificat HTTPS est auto-signé
//$retour = file_get_contents($urlServiceVerification);
// curl avec les options suivantes ignore le pb de certificat (pour tester en local)
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $urlServiceVerification);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
// équivalent de "-k"
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$data = curl_exec($ch);
curl_close($ch);
$retour = $data;
$retour = json_decode($retour, true);
return ($retour === true);
}
/**
* Décode un jeton JWT (SSO) précédemment validé et retourne les infos
* qu'il contient (payload / claims)
* @param String $jeton un jeton JWT précédemment validé
*/
protected function decoderJeton($jeton) {
$parts = explode('.', $jeton);
$payload = $parts[1];
$payload = base64_decode($payload);
$payload = json_decode($payload, true);
return $payload;
}
 
// accesseurs à deux ronds
protected function getUtilisateurId() {
if ($utilisateur = $this->getUtilisateur()) {
return $utilisateur['id'];
} else {
return '';
}
}
protected function getUtilisateurLogin() {
if ($utilisateur = $this->getUtilisateur()) {
return $utilisateur['login'];
} else {
return '';
}
}
protected function getUtilisateurNomComplet() {
if ($utilisateur = $this->getUtilisateur()) {
return $utilisateur['nom_complet'];
} else {
return '';
}
}
protected function getUtilisateurPrenom() {
if ($utilisateur = $this->getUtilisateur()) {
return $utilisateur['prenom'];
} else {
return '';
}
}
protected function getUtilisateurNom() {
if ($utilisateur = $this->getUtilisateur()) {
return $utilisateur['nom'];
} else {
return '';
}
}
protected function getParametre() {
if ($utilisateur = $this->getUtilisateur()) {
return $utilisateur['parametre'];
} else {
return '';
}
}
protected function getLicence() {
if (!empty($_SESSION['coel_utilisateur'])) {
return (string) $_SESSION['coel_utilisateur']['licence'];
} else {
return '';
}
}
protected function getInfosAnnuaire() {
if (!empty($_SESSION['coel_infosAnnuaire'])) {
return $_SESSION['coel_infosAnnuaire'];
} else {
return '';
}
}
protected function setInfosAnnuaire($infosAnnuaire) {
$_SESSION['coel_infosAnnuaire'] = $infosAnnuaire;
}
}
 
/**
* Compatibilité avec nginx - merci http://php.net/manual/fr/function.getallheaders.php
*/
if (! function_exists('apache_request_headers')) {
function apache_request_headers() {
$headers = '';
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) == 'HTTP_') {
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}
return $headers;
}
}
?>
/tags/v1.11-okuzgozu/jrest/services/CoelStructureAPersonne.php
New file
0,0 → 1,212
<?php
/**
* Service fournissant la liste des relations "structure à personne".
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
class CoelStructureAPersonne extends Coel {
 
/** Contient les infos sur les tables gérées par ce service.
* Bien respecter l'ordre avec en premier les tables liées et en dernier la table établissant la relation. */
protected $tables = array( 113 => array( 'nom' => 'coel_personne',
'prefixe' => 'cp',
'id' => array('cp_id_personne')),
121 => array( 'nom' => 'coel_structure_a_personne',
'prefixe' => 'csap',
'id' => array('csap_id_personne', 'csap_id_role', 'csap_id_structure')));
 
/**
* Méthode appelée avec une requête de type GET.
*/
public function getElement($param = array()) {
// Initialisation des variables
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_structure', 'id_role', 'id_personne'), $param);
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT ' : 'SELECT ').
' csap.*, '.
(isset($p['id_personne']) ? ' cs_nom, ' : '').
' cp_fmt_nom_complet, cp_prenom, cp_nom, cp_truk_telephone, cp_truk_courriel, cp_ce_truk_specialite '.
'FROM coel_structure_a_personne AS csap '.
' LEFT JOIN coel_meta_historique_ligne ON (csap_ce_meta = cmhl_id_historique_ligne) '.
' LEFT JOIN coel_personne ON (csap_id_personne = cp_id_personne) '.
(isset($p['id_personne']) ? ' LEFT JOIN coel_structure ON (csap_id_structure = cs_id_structure) ' : '').
((count($p) != 0) ? 'WHERE ' : '').
(isset($p['id_structure']) ? "AND csap_id_structure = {$p['id_structure']} " : '').
(isset($p['id_role']) ? "AND csap_id_role = {$p['id_role']} " : '').
(isset($p['id_personne']) ? "AND csap_id_personne = {$p['id_personne']} " : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'csap_ce_meta DESC').' ';
$requete = str_replace('WHERE AND', 'WHERE', $requete);
$requeteCount = $requete;
$requete .= "LIMIT $this->start, $this->limit ";
$this->debug[] = $requete;
// Récupération des résultats
try {
$nbElements = 0;
$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
} else {
$nbElements = $this->bdd->query($requeteCount)->rowCount();
}
$info['nbElements'] = $nbElements;
$info['structuresAPersonne'] = $donnees;
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
// Envoie sur la sortie standard
$this->envoyer($info);
}
/**
* Méthode appelée pour ajouter un élément.
*/
public function createElement($params) {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
try {
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
// Nous ne pouvons pas utiliser foreach car il travaille sur une copie du tableau or nous le modifions dynamiquement dans la boucle
reset($tables_a_modifier);
while (list($table_id, $table) = each($tables_a_modifier)) {
if (!is_null($table['champs'])) {
if (!$this->avoirCleComplete($table)) {
// Ajout des données à la table des données
$id = $this->ajouter($table);
if ($id !== false) {
$table['champs_valeurs_id']['cp_id_personne'] = $id;
$table['champs_valeurs_brut']['cp_id_personne'] = $id;
$tables_a_modifier[121]['champs_valeurs_id']['csap_id_personne'] = $id;
$tables_a_modifier[121]['champs_valeurs_brut']['csap_id_personne'] = $id;
$tables_a_modifier[121]['champs_valeurs_protege']['csap_id_personne'] = $this->bdd->quote($id);
// Historisation (Ajout des méta-données)
$etat = 1; // Ajout
$cle = $this->recupererCle($table);
$info = $this->creerXmlHisto($table['champs_valeurs_brut']);
$id_meta = $this->historiser($table_id, $cle, $info, $id_utilisateur, $etat, $id_session);
// Liaison de la table des données à ses méta-données
$champ_meta = "{$table['prefixe']}_ce_meta";
$table['champs_valeurs_protege'] = array($champ_meta => $id_meta);
$this->modifier($table);
}
} else {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
}
// Envoie sur la sortie standard
$this->envoyer();
}
/**
* Méthode appelée pour mettre à jour un élément
*/
public function updateElement($uid, $params) {
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) && !isset($uid[1]) && !isset($uid[2])) {
$this->messages[] = 'Aucun identifiant de structure, personne et role a été passé. Vous ne devriez pas avoir accès à ce service.';
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
try {
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
foreach ($tables_a_modifier as $table_id => $table) {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
// Envoie sur la sortie standard
$this->envoyer();
}
/**
* Méthode appelée pour supprimer un élément
*/
public function deleteElement($uid) {
// NOTES : la suppression ne supprime pas les personnes mais seulements les relations
 
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) || !isset($uid[1])) {
$this->messages[] = "Identifiant de relations ou d'utilisateur manquant. Vous ne devriez pas avoir accès à ce service.";
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($uid[0]);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Récupération des identifiant à supprimer
$identifiants = array();
$identifiants_agreges = explode(',', rtrim($uid[1], ','));
foreach ($identifiants_agreges as $identifiant) {
$identifiants[] = explode('-', $identifiant);
}
if (count($identifiants) == 0) {
$this->messages[] = "Aucun enregistrement n'a été supprimé.";
} else {
try {
foreach ($identifiants as $id) {
if (count($id) == 1) { // Seulement des id de structure
$params = array('csap_id_structure' => $id[0]);
} else if (count($id) == 3) { // Tous les id...
$params = array('csap_id_personne' => $id[1], 'csap_id_role' => $id[2], 'csap_id_structure' => $id[0]);
}
$tables_a_modifier = $this->recupererTablesAModifier($params);
$table = $tables_a_modifier[121];
if ($this->avoirEnregistrement($table)) {
$resultat = $this->supprimer($table);
if ($resultat === true) {
// Historisation (Ajout des méta-données)
$cle = $this->recupererCle($table);
$this->historiser(121, $cle, 'NULL', $id_utilisateur, 3, $id_session);
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
}
// Envoie sur la sortie standard
$this->envoyer();
}
}
?>
/tags/v1.11-okuzgozu/jrest/services/CoelStatistique.php
New file
0,0 → 1,791
<?php
/**
* Service fournissant des urls vers des images de graphiques sur les statistiques de l'application COEL.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* Cas d'utilisation :
* /CoelStatistique/MonTypeDeStat : retourne la balise html image du graphique pour le type de statistique demandé
* ?html=non : ce paramètre ajouté en fin d'url, force le retour de l'url du graphique sans la balise html img
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
class CoelStatistique extends Coel {
const META_CODE_FRANCE = 2654;
const META_LISTE_SIECLE = 1040;// Liste des siècles pour les collections naturalistes
const META_LISTE_TYPE_HERBIER = 1083;// Liste des types de collection botanique
private $parametres = array();
private $url_serveur_graph_tpl = 'http://%schart.apis.google.com/chart';
/**
* Méthode appelée avec une requête de type GET.
*/
public function getElement($param) {
$graph = null;
if (isset($param[0])) {
$service_demande = array_shift($param);
$this->parametres = $param;
$methode = 'get'.$service_demande;
if (method_exists($this, $methode)) {
$graph = $this->$methode();
}
} else {
$this->messages[] = "Le service COEL Statistique nécessite un paramètre.";
}
if (!is_null($graph)) {
if ((!isset($_GET['html']) || $_GET['html'] == 'oui')) {
// Nous retournons une balise HTML img
$url = $this->construireUrlGraph($graph);
$html = '<img src="'.$url.'"/>';
$this->envoyerHTML($html);
} else {
// Nous retournons une image
$contexte = stream_context_create(
array('http' => array(
'method' => 'POST',
'content' => http_build_query($graph))));
$image = file_get_contents($this->getUrlServeurGraph(), false, $contexte);
$this->envoyer($image, 'image/png', null, false);
}
} else {
$info = 'Un problème est survenu : '.print_r($this->messages, true);
$this->envoyerHTML($info);
}
}
private function getUrlServeurGraphPrincipal() {
$url = sprintf($this->url_serveur_graph_tpl, '');
return $url;
}
private function getUrlServeurGraph() {
$url = sprintf($this->url_serveur_graph_tpl, rand(0, 9).'.');
return $url;
}
private function construireUrlGraph($graph) {
$graph = $this->protegerGraphPourUrl($graph);
$url_parametres = array();
foreach ($graph as $cle => $valeur) {
$url_parametres[] = "$cle=$valeur";
}
$url = $this->getUrlServeurGraphPrincipal().'?'.implode('&', $url_parametres);
return $url;
}
private function protegerGraphPourUrl($graph) {
if (isset($graph['chtt'])) {
$graph['chtt'] = str_replace(' ', '+', $graph['chtt']);
}
return $graph;
}
private function existerParametre($numero) {
$exister = (isset($this->parametres[$numero]) && $this->parametres[$numero] != '*') ? true : false;
return $exister;
}
private function getNombreDonnees() {
// Récupération des données
$types = array( array('Commentaires', 'commentaire', 'ccm'),
array('Publications', 'publication', 'cpu'),
array('Personnes', 'personne', 'cp'),
array('Collections', 'collection', 'cc'),
array('Structures', 'structure', 'cs'));
$donnees = array();
foreach ($types as $info) {
list($type, $table, $champ) = $info;
$donnees[$type] = $this->executerRequeteNombre($table, $champ);
}
// Post traitement des données de la base de données
asort($donnees);
$valeurs = implode(',', $donnees);
arsort($donnees);
$etiquettes = implode('|', array_keys($donnees));
// Paramètres du graphique
$graph = array(
'cht' => 'bhs',
'chs' => '290x210',
'chco' => '264327|5D7E2D|84A435|B5CD75|DFF1B3',// Source : Broccoli par DandL : http://www.colourlovers.com/palette/1371426/Broccoli
'chd' => "t:$valeurs",
'chds' => '0,'.max($donnees),
'chxt' => 'y',
'chxl' => "0:|$etiquettes|",
'chm' => 'N ** ,000000,0,-1,10',
'chtt' => 'Nombre de données');
return $graph;
}
private function executerRequeteNombre($entite, $abr) {
$table = 'coel_'.$entite;
$champ_id = $abr.'_id_'.$entite;
$requete = "SELECT COUNT($champ_id) AS nbre ".
"FROM $table ";
try {
$nbre = $this->bdd->query($requete)->fetchColumn();
if ($nbre === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
return $nbre;
}
 
private function getMesDonnees() {
// Récupération des données
$types = array( 'Commentaires' => array('107', 'ccm'),
'Publications' => array('118, 119', 'cpu,cpuap'),
'Personnes' => array('113, 114', 'cp,cpar'),
'Collections' => array('101, 102, 103, 104, 106', 'cc,ccac,ccap,ccapu,ccb'),
'Structures' => array('120, 121, 122, 123', 'cs,csap,csc,csv'));
$etats = array(1 => 'Ajouts',
2 => 'Modifications',
3 => 'Suppressions');
$donnees = array();
foreach ($types as $type => $tables_parametres) {
$tables_infos['identifiants'] = $tables_parametres[0];
$tables_infos['abreviations'] = $tables_parametres[1];
foreach ($etats as $etat_id => $etat_type) {
$donnees[$etat_type][$type] = $this->executerRequeteNombreDansHistorique($tables_infos, $etat_id);
}
}
// Post traitement des données de la base de données
$max_global = array();
$ensembles_donnees = array();
foreach ($donnees as $ensemble_donnees) {
$ensembles_donnees[] = implode(',', array_reverse($ensemble_donnees));
// Gestion de l'échelle
foreach ($ensemble_donnees as $type => $val) {
if (!isset($max_global[$type])) {
$max_global[$type] = 0;
}
$max_global[$type] += $val;
}
}
$maximum = max($max_global);
$moitier = round(($maximum / 2), 1);
$valeurs = implode('|', $ensembles_donnees);
$etiquettes = implode('|', array_keys($types));
$legende = implode('|', $etats);
$etiquettes_x = "0|$moitier|$maximum";
$titre = $this->existerParametre(0) ? 'Ma participation' : 'Participation';
// Paramètres du graphique
$graph = array(
'cht' => 'bhg',
'chs' => '290x210',
'chbh' => 'a,2,4',
'chco' => '66B032,FABC02,FE2712',
'chdl' => $legende,
'chdlp' => 'r',
'chd' => "t:$valeurs",
'chds' => "0,$maximum",
'chxt' => 'y,x',
'chxl' => "0:|$etiquettes|1:|$etiquettes_x",
'chm' => 'N,000000,0,-1,10,1|N,000000,1,-1,10,1|N,000000,2,-1,10,1',
'chtt' => $titre);
return $graph;
}
private function executerRequeteNombreDansHistorique($tables_infos, $etat) {
// Récupération des paramêtres
$personne_id = (isset($this->parametres[0]) && $this->parametres[0] != '*') ? $this->bdd->quote($this->parametres[0]) : null;
// Récupération des données
$requete = "SELECT COUNT(cmhl_date_modification) AS nbre ".
"FROM coel_meta_historique_ligne ".
"WHERE cmhl_ce_table IN ({$tables_infos['identifiants']}) ".
" AND cmhl_ce_etat = $etat ".
(isset($personne_id) ? " AND cmhl_ce_modifier_par = $personne_id " : '');
try {
$nbre = $this->bdd->query($requete)->fetchColumn();
if ($nbre === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur_requete'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
return $nbre;
}
private function getTypeDepot() {
// Récupération des données
$requete = 'SELECT cmlv_nom AS type, COUNT(cc_ce_type_depot) AS nbre '.
'FROM coel_collection '.
' LEFT JOIN coel_meta_liste_valeur ON (cc_ce_type_depot = cmlv_id_valeur) '.
'GROUP BY cc_ce_type_depot';
try {
$infos = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($infos === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
// Post traitement des données de la base de données
$donnees = array();
foreach ($infos as $info) {
if ($info['type'] != '') {
$cle = $info['type'];
} else {
$cle = 'Non renseigné';
}
$donnees[$cle] = $info['nbre'];
}
asort($donnees);
$valeurs = implode(',', $donnees);
arsort($donnees);
$etiquettes = implode('|', array_keys($donnees));
// Paramètres du graphique
$graph = array(
'cht' => 'bhs',
'chs' => '290x210',
'chco' => '264327|5D7E2D|84A435|B5CD75|DFF1B3',
'chd' => "t:$valeurs",
'chds' => '0,'.(max($donnees)+5),
'chxt' => 'y',
'chxl' => "0:|$etiquettes|",
'chm' => 'N *,000000,0,-1,10',
'chtt' => 'Type de dépôt|des collections',
'chts' => '000000,12');
return $graph;
}
private function getNombreCollectionParStructure() {
// Récupération des données
$requete = 'SELECT COUNT(cc_id_collection) AS nbre '.
'FROM coel_collection '.
'GROUP BY cc_ce_structure ';
try {
$infos = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($infos === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
} else if (count($infos) == 0) {
$this->messages[] = "Aucune collection n'est référencée.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
// Post traitement des données de la base de données
$donnees = array( '1 collection' => 0,
'2 collections' => 0,
'Entre 3 et 10' => 0,
'Entre 11 et 50' => 0,
'Plus de 50' => 0);
foreach ($infos as $info) {
$nbre = $info['nbre'];
if ($nbre == 1) {
$donnees['1 collection']++;
} else if ($nbre == 2) {
$donnees['2 collections']++;
} else if ($nbre >= 3 && $nbre <= 10) {
$donnees['Entre 3 et 10']++;
} else if ($nbre >= 11 && $nbre <= 50) {
$donnees['Entre 11 et 50']++;
} else if ($nbre > 50) {
$donnees['Plus de 50']++;
}
}
$donnees_tmp = $donnees;
$donnees = array();
foreach ($donnees_tmp as $cle => $valeur) {
$donnees[$cle.' ('.$valeur.')'] = $valeur;
}
asort($donnees);
$valeurs = implode(',', $donnees);
//arsort($donnees);
$etiquettes = implode('|', array_keys($donnees));
//$legende = implode('|', array_keys($donnees));
// Paramètres du graphique
$graph = array(
'cht' => 'p3',
'chs' => '400x225',
'chco' => 'EDC951|DEB0DB|DEC9B0|B0DEB3|B0C4DE|B0B0DE|927CBA',
'chd' => "t:$valeurs",
'chds' => '0,'.max($donnees),
'chdl' => $etiquettes,
'chtt' => 'Nombre de collections|par institution',
'chts' => '000000,12');
return $graph;
}
private function getNombrePartParStructure() {
// Récupération des données
$requete = 'SELECT cc_ce_structure, ccb_truk_unite_base '.
'FROM coel_collection_botanique '.
' LEFT JOIN coel_collection ON (ccb_id_collection = cc_id_collection) ';
try {
$infos = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($infos === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
} else if (count($infos) == 0) {
$this->messages[] = "Aucune collection n'est référencée.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
// Post traitement des données de la base de données
// Extraction du nombre de part
$structures = array();
foreach ($infos as $info) {
if (!isset($structures[$info['cc_ce_structure']])) {
$structures[$info['cc_ce_structure']] = 0;
}
$structures[$info['cc_ce_structure']] += UtilTruck::extraireNbrePart($info['ccb_truk_unite_base']);
}
 
// Triage par classe
$donnees = array( '0 part' => 0,
'Entre 1 et 100' => 0,
'Entre 101 et 1000' => 0,
'Entre 1001 et 10.000' => 0,
'Entre 10.001 et 100.000' => 0,
'Entre 100.001 et 300.000' => 0,
'Supérieur à 300.000' => 0);
foreach ($structures as $nbre) {
if ($nbre == 0) {
$donnees['0 part']++;
} else if ($nbre >= 1 && $nbre <= 100) {
$donnees['Entre 1 et 100']++;
} else if ($nbre >= 101 && $nbre <= 1000) {
$donnees['Entre 101 et 1000']++;
} else if ($nbre >= 1001 && $nbre <= 10000) {
$donnees['Entre 1001 et 10.000']++;
} else if ($nbre >= 10001 && $nbre <= 100000) {
$donnees['Entre 10.001 et 100.000']++;
} else if ($nbre >= 100001 && $nbre <= 300000) {
$donnees['Entre 100.001 et 300.000']++;
} else if ($nbre >= 300001) {
$donnees['Supérieur à 300.000']++;
}
}
$donnees_tmp = $donnees;
$donnees = array();
foreach ($donnees_tmp as $cle => $valeur) {
$donnees[$cle.' ('.$valeur.')'] = $valeur;
}
$donnees = array_reverse($donnees, true);
$legende = implode('|', array_keys($donnees));
$valeurs = implode(',', $donnees);
// Paramètres du graphique
$graph = array(
'cht' => 'p3',
'chs' => '400x225',
'chco' => 'EDC951|DEB0DB|DEC9B0|B0DEB3|B0C4DE|B0B0DE|927CBA',//4D89F9 ou EDC951|DEB0DB|DEC9B0|B0DEB3|B0C4DE|B0B0DE|DEBAB0 ou B02B2C|D15600|C79810|73880A|6BBA70|3F4C6B|356AA0
'chd' => "t:$valeurs",
'chds' => '0,'.max($donnees),
'chdl' => $legende,
'chdlp' => 'r,0,1,2,3,4,5',
'chtt' => 'Nombre de parts conservées |par institution',
'chts' => '000000,11.5',
'chts' => '000000,12');
return $graph;
}
private function getNombrePartParCollection() {
// Récupération des données
$requete = 'SELECT ccb_truk_unite_base '.
'FROM coel_collection_botanique ';
try {
$infos = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($infos === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
} else if (count($infos) == 0) {
$this->messages[] = "Aucune collection n'est référencée.";
$infos == false;
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
$graph = null;
if ($infos !== false) {
// Post traitement des données de la base de données
// Extraction du nombre de part
$collections = array();
foreach ($infos as $info) {
$collections[] = UtilTruck::extraireNbrePart($info['ccb_truk_unite_base']);
}
// Triage par classe
$donnees = array( '0 part' => 0,
'Entre 1 et 100' => 0,
'Entre 101 et 1000' => 0,
'Entre 1001 et 10.000' => 0,
'Entre 10.001 et 100.000' => 0,
'Entre 100.001 et 300.000' => 0,
'Supérieur à 300.000' => 0);
foreach ($collections as $nbre) {
if ($nbre == 0) {
$donnees['0 part']++;
} else if ($nbre >= 1 && $nbre <= 100) {
$donnees['Entre 1 et 100']++;
} else if ($nbre >= 101 && $nbre <= 1000) {
$donnees['Entre 101 et 1000']++;
} else if ($nbre >= 1001 && $nbre <= 10000) {
$donnees['Entre 1001 et 10.000']++;
} else if ($nbre >= 10001 && $nbre <= 100000) {
$donnees['Entre 10.001 et 100.000']++;
} else if ($nbre >= 100001 && $nbre <= 300000) {
$donnees['Entre 100.001 et 300.000']++;
} else if ($nbre >= 300001) {
$donnees['Supérieur à 300.000']++;
}
}
$donnees_tmp = $donnees;
$donnees = array();
foreach ($donnees_tmp as $cle => $valeur) {
$donnees[$cle.' ('.$valeur.')'] = $valeur;
}
$donnees = array_reverse($donnees, true);
$legende = implode('|', array_keys($donnees));
$valeurs = implode(',', $donnees);
// Paramètres du graphique
$graph = array(
'cht' => 'p3',
'chs' => '400x225',
'chco' => 'EDC951|DEB0DB|DEC9B0|B0DEB3|B0C4DE|B0B0DE|927CBA',
'chd' => "t:$valeurs",
'chds' => '0,'.max($donnees),
'chdl' => $legende,
'chdlp' => 'r,0,1,2,3,4,5',
'chtt' => 'Nombre de parts conservées |par collection',
'chts' => '000000,11.5',
'chts' => '000000,12');
}
return $graph;
}
private function getNombreCollectionParDepartement() {
// Récupération des données
$requete = 'SELECT cs_code_postal '.
'FROM coel_collection '.
' LEFT JOIN coel_structure ON (cc_ce_structure = cs_id_structure) '.
'WHERE cs_ce_truk_pays = '.self::META_CODE_FRANCE.' ';
try {
$infos = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($infos === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
} else if (count($infos) == 0) {
$this->messages[] = "Aucune collection n'est référencée.";
$infos == false;
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
$graph = null;
if ($infos !== false) {
// Post traitement des données de la base de données
// Extraction du nombre de part
$donnees = array();
foreach ($infos as $info) {
if (preg_match('/^([0-8][0-9]|9[0-5]|97[1-4]|976)/', $info['cs_code_postal'], $match)) {
if (! isset($donnees[$match[1]])) {
$donnees[$match[1]] = 1;
} else {
$donnees[$match[1]]++;
}
}
}
$donnees_tmp = $donnees;
$donnees = array();
foreach ($donnees_tmp as $cle => $valeur) {
$donnees[$cle.' ('.$valeur.' collections)'] = $valeur;
}
asort($donnees);
$valeurs = implode(',', $donnees);
$legende = implode('|', array_keys($donnees));
// Paramètres du graphique
$graph = array(
'cht' => 'p3',
'chs' => '400x225',
'chco' => 'EDC951|DEB0DB|DEC9B0|B0DEB3|B0C4DE|B0B0DE|927CBA',
'chd' => "t:$valeurs",
'chds' => '0,'.max($donnees),
'chdl' => $legende,
'chtt' => 'Nombre de collections conservées |par département',
'chts' => '000000,11.5',
'chts' => '000000,12');
}
return $graph;
}
private function getNombreCollectionParTypeStructure() {
 
// Récupération des données
$requete = 'SELECT cmlv_prive.cmlv_nom AS type_prive, cmlv_public.cmlv_nom AS type_public '.
'FROM coel_collection '.
' LEFT JOIN coel_structure ON (cc_ce_structure = cs_id_structure) '.
' LEFT JOIN coel_meta_liste_valeur AS cmlv_prive ON (cs_ce_truk_type_prive = cmlv_prive.cmlv_id_valeur) '.
' LEFT JOIN coel_meta_liste_valeur AS cmlv_public ON (cs_ce_truk_type_public = cmlv_public.cmlv_id_valeur) ';
try {
$infos = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($infos === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
} else if (count($infos) == 0) {
$this->messages[] = "Aucune collection n'est référencée.";
$infos == false;
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
//Coel::debug($infos);
$graph = null;
if ($infos !== false) {
// Post traitement des données de la base de données
// Extraction du nombre de part
$donnees = array();
foreach ($infos as $info) {
if ($info['type_prive'] != '') {
$cle = $info['type_prive'].' [privé]';
} else if ($info['type_public'] != '') {
$cle = $info['type_public'].' [public]';
} else {
$cle = 'Non renseignées';
}
if (! isset($donnees[$cle])) {
$donnees[$cle] = 1;
} else {
$donnees[$cle]++;
}
}
$donnees_tmp = $donnees;
$donnees = array();
foreach ($donnees_tmp as $cle => $valeur) {
$donnees[$cle.' ('.$valeur.')'] = $valeur;
}
asort($donnees);
$valeurs = implode(',', $donnees);
$legende = implode('|', array_keys($donnees));
// Paramètres du graphique
$graph = array(
'cht' => 'p3',
'chs' => '400x225',
'chco' => 'EDC951|DEB0DB|DEC9B0|B0DEB3|B0C4DE|B0B0DE|927CBA',
'chd' => "t:$valeurs",
'chds' => '0,'.max($donnees),
'chdl' => $legende,
'chtt' => "Collections conservées |par type d'institution",
'chts' => '000000,11.5',
'chts' => '000000,12');
}
return $graph;
}
private function getNombreCollectionParPeriode() {
 
// Récupération des données
$requete = 'SELECT cc_truk_periode_constitution '.
'FROM coel_collection ';
try {
$infos = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($infos === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
} else if (count($infos) == 0) {
$this->messages[] = "Aucune collection n'est référencée.";
$infos == false;
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
//Coel::debug($infos);
// Récupération des métadonnées nécessaires
$requete = 'SELECT cmlv_id_valeur, cmlv_nom, cmlv_abreviation '.
'FROM coel_meta_liste_valeur '.
'WHERE cmlv_ce_parent = '.self::META_LISTE_SIECLE.' ';
try {
$metadonnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($metadonnees === false) {
$this->messages[] = "La requête de recherche des métadonnées a retourné aucun résultat.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
$graph = null;
if ($infos !== false) {
// Traitement des métadonées
$periodes = array(0 => array('nom' => 'Non renseigné', 'abr' => 0));
foreach ($metadonnees as $meta) {
$periodes[$meta['cmlv_id_valeur']] = array('nom' => $meta['cmlv_nom'], 'abr' => $meta['cmlv_abreviation']);
}
// Post traitement des données de la base de données
$donnees = array();
foreach ($infos as $info) {
// Récupération de la période de début de constitution
$truk_periodes = explode(';;', $info['cc_truk_periode_constitution']);
$periode_abr_mini = 10;
$periode_id_mini = 0;
foreach ($truk_periodes as $periode_id) {
if (! empty($periode_id)) {
if ($periode_abr_mini > $periodes[$periode_id]['abr']) {
$periode_abr_mini = $periodes[$periode_id]['abr'];
$periode_id_mini = $periode_id;
}
}
}
// Augmentation du nombre de collection par période
if (! isset($donnees[$periodes[$periode_id_mini]['nom']])) {
$donnees[$periodes[$periode_id_mini]['nom']] = 1;
} else {
$donnees[$periodes[$periode_id_mini]['nom']]++;
}
}
$donnees_tmp = $donnees;
$donnees = array();
foreach ($donnees_tmp as $cle => $valeur) {
$donnees[$cle.' ('.$valeur.')'] = $valeur;
}
asort($donnees);
$valeurs = implode(',', $donnees);
$legende = implode('|', array_keys($donnees));
// Paramètres du graphique
$graph = array(
'cht' => 'p3',
'chs' => '400x225',
'chco' => 'EDC951|DEB0DB|DEC9B0|B0DEB3|B0C4DE|B0B0DE|927CBA',
'chd' => "t:$valeurs",
'chds' => '0,'.max($donnees),
'chdl' => $legende,
'chtt' => "Collections recensées par|siècle de constitution",
'chts' => '000000,11.5',
'chts' => '000000,12');
}
return $graph;
}
private function getNombreHerbierParType() {
 
// Récupération des données
$requete = 'SELECT ccb_ce_truk_type '.
'FROM coel_collection_botanique ';
try {
$infos = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($infos === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
} else if (count($infos) == 0) {
$this->messages[] = "Aucune collection n'est référencée.";
$infos == false;
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
//Coel::debug($infos);
// Récupération des métadonnées nécessaires
$requete = 'SELECT cmlv_id_valeur, cmlv_nom, cmlv_abreviation '.
'FROM coel_meta_liste_valeur '.
'WHERE cmlv_ce_parent = '.self::META_LISTE_TYPE_HERBIER.' ';
try {
$metadonnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($metadonnees === false) {
$this->messages[] = "La requête de recherche des métadonnées n'a retourné aucun résultat.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
$graph = null;
if ($infos !== false) {
// Traitement des métadonées
$types = array(0 => array('nom' => 'Non renseigné', 'abr' => 'NR'));
foreach ($metadonnees as $meta) {
$types[$meta['cmlv_id_valeur']] = array('nom' => $meta['cmlv_nom'], 'abr' => $meta['cmlv_abreviation']);
}
// Post traitement des données de la base de données
$donnees = array();
foreach ($infos as $info) {
// Récupération du type d'herbier
$type_id = ($info['ccb_ce_truk_type'] != '') ? $info['ccb_ce_truk_type'] : 0;
$type_nom = $types[$type_id]['nom'];
// Augmentation du nombre de collection par période
if (! isset($donnees[$type_nom])) {
$donnees[$type_nom] = 1;
} else {
$donnees[$type_nom]++;
}
}
$donnees_tmp = $donnees;
$donnees = array();
foreach ($donnees_tmp as $cle => $valeur) {
if ($remplacement = preg_replace('/^([^(]+) \([^\)]+\)/', '$1', $cle)) {
$cle = $remplacement;
}
$legende = $cle.' ('.$valeur.')';
$donnees[$legende] = $valeur;
}
asort($donnees);
$valeurs = implode(',', $donnees);
$legende = implode('|', array_keys($donnees));
// Paramètres du graphique
$graph = array(
'cht' => 'p3',
'chs' => '400x225',
'chco' => 'EDC951|DEB0DB|DEC9B0|B0DEB3|B0C4DE|B0B0DE|927CBA',
'chd' => "t:$valeurs",
'chds' => '0,'.max($donnees),
'chdl' => $legende,
'chdlp' => 'r',
'chtt' => "Nombre d'herbier par type",
'chts' => '000000,11.5',
'chts' => '000000,12');
}
return $graph;
}
}
/tags/v1.11-okuzgozu/jrest/services/Coel.php
New file
0,0 → 1,771
<?php
/** Paramêtres indiquant que l'on est en français pour permettre l'affichage des dates en français. */
setlocale(LC_TIME, 'fr_FR.UTF-8');
/** Définition de l'encodage interne des fichiers. */
mb_internal_encoding('UTF-8');
 
/**
* Classe mère abstraite contenant les méthodes génériques des services.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
abstract class Coel {
const ETAT_AJOUTER = 1;
const ETAT_MODIFIER = 2;
const ETAT_SUPPRIMER = 3;
protected $sessionName = 'CoelSession';
protected $sessionExpireTime = 8640000;// 60*60*24*100 = 100 jours
protected static $cookieChemin = '';
public $config;
protected $bdd;
protected $log = array();
protected $messages = array();
protected $debug = array();
protected $distinct = false;
protected $orderby = null;
protected $formatRetour = 'objet';
protected $start = 0;
protected $limit = 150;
public function __construct($config, $demarrer_session = true) {
// Tableau contenant la config de Jrest
$this->config = $config;
// Connection à la base de données
$this->bdd = $this->connecterPDO($this->config, 'coel');
$this->gererSession($demarrer_session);
$this->gererIdentificationPermanente();
 
if(isset($_GET['start'])) $this->start = intval($_GET['start']);
if(isset($_GET['limit'])) $this->limit = intval($_GET['limit']);
// Nettoyage du $_GET (non-sécurisé)
if (isset($_GET)) {
$get_params = array('orderby', 'distinct', 'formatRetour', 'searchCity');
foreach ($get_params as $get) {
$verifier = array('NULL', "\n", "\r", "\\", "'", '"', "\x00", "\x1a", ';');
if (isset($_GET[$get]) && $_GET[$get] != '') {
$_GET[$get] = str_replace($verifier, '', $_GET[$get]);
$this->$get = $_GET[$get];
} else {
$_GET[$get] = null;
}
}
}
}
 
/**
* Méthode appelée quand aucun paramètre n'est passé dans l'url et avec une requête de type GET.
*/
public function getRessource() {
$this->getElement(array());
}
protected function creerXmlHisto($donnees) {
// Création du xml de l'enregistrement à historiser
$info = null;
$xml_tpl = '<?xml version="1.0" encoding="UTF-8" ?>'."\n<resultset>\n<row>\n%s</row>\n</resultset>";
$xml = null;
foreach ($donnees as $cle => $valeur) {
if (!is_null($valeur) && $valeur != '') {
$xml .= "<$cle>$valeur</$cle>\n";
}
}
if ($xml !== null) {
$info = sprintf($xml_tpl, $xml);
$info = $this->bdd->quote($info);
}
return $info;
}
protected function getTableauDepuisXmlHisto($xml) {
// Création du xml de l'enregistrement à historiser
$info = array();
if (!empty($xml) && preg_match_all('|<([^>]+)>(.*)</[^>]+>|U', $xml, $matches, PREG_SET_ORDER)) {
foreach ($matches as $val) {
$info[$val[1]] = $val[2];
}
}
return $info;
}
protected function historiser($table_id, $ligne_cle, $info, $id_utilisateur, $etat, $id_session) {
date_default_timezone_set('Europe/Paris');
// Pré-traitement des variables
$info = (is_null($info)) ? 'NULL' : $info;
// Historisation (Ajout des méta-données)
$requete = 'INSERT INTO coel_meta_historique_ligne '.
' (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_ce_modifier_par, cmhl_ce_etat, cmhl_ip, cmhl_session_id) '.
'VALUES ('.
" $table_id, ".
' "'.$ligne_cle.'", '.
" $info, ".
' "'.date('Y-m-d H:i:s', time()).'", '.
" $id_utilisateur, ".
" $etat, ".
' "'.$_SERVER['REMOTE_ADDR'].'", '.
' "'.$id_session.'") ';
// Exécution de la requêtre SQL et test d'éventuelles erreurs
$resultat = $this->bdd->exec($requete);
if ($resultat === false ) {
$this->log[] = "Des données de la table '$table_id' (enrg. $ligne_cle) n'ont pas été historisées car la requête a échouée.";
}
return $this->bdd->lastInsertId();
}
protected function envoyer($donnees = null, $mime = 'application/json', $encodage = 'utf-8', $json = true) {
// Traitements des messages d'erreurs et données
if (count($this->messages) != 0) {
header('HTTP/1.1 500 Internal Server Error');
$mime = 'text/html';
$encodage = 'utf-8';
$json = true;
$sortie = $this->messages;
} else {
$sortie = $donnees;
if (is_null($donnees)) {
$sortie = 'OK';
}
}
 
// Gestion de l'envoie du déboguage
$this->envoyerDebogage();
// Encodage au format et JSON et envoie sur la sortie standard
$contenu = $json ? json_encode($sortie) : $sortie;
$this->envoyerContenu($encodage, $mime, $contenu);
}
protected function envoyerHTML($donnees = null) {
// Traitements des messages d'erreurs et données
$contenu = '';
if (count($this->messages) > 0) {
$contenu = '<p>'.implode('<br />', $this->messages).'</p>';
} else {
$contenu = $donnees;
if (is_null($donnees)) {
$contenu = 'OK';
}
}
 
// Gestion de l'envoie du déboguage
$this->envoyerDebogage();
// Envoie sur la sortie standard
$this->envoyerContenu(null, null, $contenu);
}
protected function envoyerEnteteMessage() {
if (!is_array($this->messages)) {
$this->messages[] = $this->messages;
}
if (count($this->messages) != 0) {
foreach ($this->messages as $cle => $val) {
if (is_array($val)) {
$this->messages[$cle] = print_r($val, true);
}
}
header('X-MessageJrest-Data: '.json_encode($this->messages));
}
}
 
protected function envoyerDebogage() {
$this->envoyerEnteteDebogage();
}
protected function envoyerEnteteDebogage() {
if (!is_array($this->debug)) {
$this->debug[] = $this->debug;
}
if (count($this->debug) != 0) {
foreach ($this->debug as $cle => $val) {
if (is_array($val)) {
$this->debug[$cle] = print_r($val, true);
}
}
header('X-DebugJrest-Data: '.json_encode($this->debug));
}
}
protected function envoyerContenu($encodage, $mime, $contenu) {
if (!is_null($mime) && !is_null($encodage)) {
header("Content-Type: $mime; charset=$encodage");
} else if (!is_null($mime) && is_null($encodage)) {
header("Content-Type: $mime");
}
print $contenu;
}
private function connecterPDO($config, $base = 'database') {
$cfg = $config[$base];
$dsn = $cfg['phptype'].':dbname='.$cfg['database'].';host='.$cfg['hostspec'];
try {
$PDO = new PDO($dsn, $cfg['username'], $cfg['password']);
} catch (PDOException $e) {
echo 'La connexion à la base de donnée via PDO a échouée : ' . $e->getMessage();
}
// Passe en UTF-8 la connexion à la BDD
$PDO->exec("SET NAMES 'utf8'");
// Affiche les erreurs détectées par PDO (sinon mode silencieux => aucune erreur affiché)
$PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $PDO;
}
protected function getTxt($id) {
$sortie = '';
switch ($id) {
case 'sql_erreur' : $sortie = 'Requête echec. Fichier : "%s". Ligne : "%s". Message : %s'; break;
case 'sql_erreur_requete' : $sortie = "Requête echec.\nFichier : %s.\nLigne : %s.\nMessage : %s.\nRequête : %s"; break;
default : $sortie = $id;
}
return $sortie;
}
protected function concatenerChamps($champs, $prefixe = null) {
$chaine = '';
foreach ($champs as $cle => $valeur) {
if (is_null($prefixe) || (!is_null($prefixe) && stristr($cle, $prefixe.'_'))) {
$chaine .= ", $cle = $valeur";
}
}
return ltrim($chaine, ', ');
}
 
protected function separerChampsValeurs($donnees, $prefixe = null) {
$sortie = array('', '');
// Concaténation des champs et des valeurs dans des chaines séparées
foreach ($donnees as $cle => $valeur) {
if (is_null($prefixe) || (!is_null($prefixe) && stristr($cle, $prefixe.'_'))) {
$sortie[0] .= "$cle, ";
$sortie[1] .= "$valeur, ";
}
}
// Suppression de la virgule finale
$sortie[0] = rtrim($sortie[0], ', ');
$sortie[1] = rtrim($sortie[1], ', ');
return $sortie;
}
protected function traiterParametresUrl($params_attendu, $params, $pourBDD = true) {
$sortie = array();
foreach ($params_attendu as $num => $nom) {
if (isset($params[$num]) && $params[$num] != '*') {
if ($pourBDD) {
$params[$num] = $this->bdd->quote($params[$num]);
}
$sortie[$nom] = $params[$num];
}
}
return $sortie;
}
protected function traiterBddClauseIn($chaine) {
$sortie = '';
$chaine = trim($chaine, " '");
if ($chaine != '') {
$valeurs = explode(',', $chaine);
foreach ($valeurs as $id => $valeur) {
$valeurs[$id] = $this->bdd->quote($valeur);
}
$sortie = implode(',', $valeurs);
}
return $sortie;
}
protected function traiterParametresPost($params) {
$sortie = array();
foreach ($params as $cle => $valeur) {
$sortie[$cle] = $this->bdd->quote($valeur);
}
return $sortie;
}
protected function getIdentification(&$params) {
// Initialisation des variables
$utilisateur = array(0, session_id());
// L'id utilisateur est soit passé par le POST soit dans l'url
if (is_array($params) && isset($params['cmhl_ce_modifier_par'])) {
$utilisateur[0] = $params['cmhl_ce_modifier_par'];
unset($params['cmhl_ce_modifier_par']);
} else if (is_string($params)) {
$utilisateur[0] = $params;
}
return $utilisateur;
}
protected function etreAutorise($id_utilisateur) {
$autorisation = false;
if (!array_key_exists('coel_utilisateur', $_SESSION) || (($_SESSION['coel_utilisateur'] != '') && $_SESSION['coel_utilisateur']['id'] != $id_utilisateur)) {
$this->messages[] = 'Accès interdit.';
} else if ($_SESSION['coel_utilisateur'] == '') {
$this->messages[] = 'Veuillez vous identifiez pour accéder à cette fonction.';
} else {
$autorisation = true;
}
return $autorisation;
}
protected function recupererCle($table) {
$cle = null;
if (isset($table['champs_valeurs_id'])) {
$identifiants = array();
// Trie des clés primaire pour avoir toujours le même ordre dans la table historique pour les clés multiples
ksort($table['champs_valeurs_id']);
foreach ($table['champs_valeurs_id'] as $id) {
$identifiants[] = $id;
}
$cle = implode('-', $identifiants);
}
return $cle;
}
protected function avoirCleComplete($table) {
$cle_complete = false;
if (isset($table['champs_valeurs_id'])) {
$ok = true;
foreach ($table['id'] as $id) {
if (!isset($table['champs_valeurs_id'][$id]) || $table['champs_valeurs_id'][$id] == '') {
$ok = false;
break;
}
}
$cle_complete = $ok;
}
return $cle_complete;
}
protected function recupererEtat($table) {
$etat = 1;// Ajout
if ($this->avoirEnregistrement($table) === true) {
$etat = 2;// Modification
}
return $etat;
}
protected function avoirEnregistrement($table) {
$avoir_enregistrement = false;
$requete = 'SELECT * '.
"FROM {$table['nom']} ".
"WHERE %s ";
$where = $this->construireWhere($table['champs_valeurs_id']);
$requete = sprintf($requete, $where);
// Exécution de la requêtre SQL et test d'éventuelles erreurs
$resultat = $this->bdd->query($requete, PDO::FETCH_ASSOC)->fetch();
if ($resultat !== false) {
$avoir_enregistrement = true;
}
return $avoir_enregistrement;
}
protected function contenirDonnees($requete) {
$nbre = $this->bdd->query($requete)->fetchColumn();
$presence = false;
if ($nbre != 0) {
$presence = true;
}
return $presence;
}
protected function construireWhere($table) {
$where = '1';
if (is_array($table) && count($table) > 0) {
$table_where = array();
foreach ($table as $chp => $id) {
$table_where[] = "$chp = '$id'";
}
$where = implode(' AND ', $table_where);
}
return $where;
}
protected function recupererTablesAModifier($parametres) {
$tables_a_modifier = $this->tables;
foreach ($this->tables as $table_id => $table) {
$tables_a_modifier[$table_id]['champs'] = null;
foreach ($parametres as $cle => $valeur) {
if (preg_match('/^'.$table['prefixe'].'_/', $cle)) {
// Contient les noms des champs seulements
$tables_a_modifier[$table_id]['champs'][] = $cle;
// Contient un tableau de résultats protégé pour l'inclusion en bdd
$tables_a_modifier[$table_id]['champs_valeurs_protege'][$cle] = is_null($valeur) ? 'NULL' : $this->bdd->quote($valeur);
// Contient un tableau de résultats non protégé
$tables_a_modifier[$table_id]['champs_valeurs_brut'][$cle] = $valeur;
if (preg_match('/_id_/', $cle)) {
$tables_a_modifier[$table_id]['champs_valeurs_id'][$cle] = $valeur;
}
}
}
}
return $tables_a_modifier;
}
 
protected function mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table) {
if (!is_null($table['champs'])) {
// Historisation (Ajout des méta-données)
$cle = $this->recupererCle($table);
$etat = $this->recupererEtat($table);
$info = $this->creerXmlHisto($table['champs_valeurs_brut']);
$id_meta = $this->historiser($table_id, $cle, $info, $id_utilisateur, $etat, $id_session);
$champ_meta = "{$table['prefixe']}_ce_meta";
$table['champs_valeurs_protege'][$champ_meta] = $this->bdd->quote($id_meta);
// Mise à jour des données ou ajout en fonction de l'état
if ($etat == 1) { // Ajout
$this->ajouter($table);
} else if ($etat == 2) { // Modif
$this->modifier($table);
}
}
}
protected function ajouter($table) {
$requete = "INSERT INTO {$table['nom']} ".
' (%s) '.
' VALUES (%s) ';
$champs = $valeurs = '';
foreach ($table['champs_valeurs_protege'] as $chp => $val) {
$champs .= "$chp, ";
$valeurs .= "$val, ";
}
$requete = sprintf($requete, rtrim($champs, ', '), rtrim($valeurs, ', '));
$resultat = $this->bdd->exec($requete);
$dernier_id = false;
if ($resultat === false) {
$cle = $this->recupererCle($table);
$this->log[] = "L'enregistrement '$cle' de la table {$table['nom']} n'a pas été ajouté car la requête a échouée.";
} else {
$dernier_id = $this->bdd->lastInsertId();
}
return $dernier_id;
}
protected function modifier($table) {
// nous ne voulons pas qu'une requête malheureuse affecte toute la base de données. Par exemple:
// POST "/jrest/CoelStructure/1"<<<"var=val&" // écraserait tous les enregistrements
// car on ne peut garantir que tout le code existant wrap'era ses appels dans un if(avoirCleComplete())
if(!array_key_exists('champs_valeurs_id', $table)) die('erreur: ' . __FILE__ . ':' . __LINE__);
$requete = "UPDATE {$table['nom']} ".
'SET %s '.
'WHERE %s ';
$champs_requete = '';
foreach ($table['champs_valeurs_protege'] as $chp => $val) {
$champs_requete .= "$chp = $val, ";
}
$where = $this->construireWhere($table['champs_valeurs_id']);
$requete = sprintf($requete, rtrim($champs_requete, ', '), $where);
$resultat = $this->bdd->exec($requete);
if ($resultat === false) {
$cle = $this->recupererCle($table);
$this->log[] = "L'enregistrement '$cle' de la table {$table['nom']} n'a pas été mis à jour car la requête a échouée.";
} else {
$resultat = true;
}
return $resultat;
}
protected function supprimer($table) {
$requete = "DELETE FROM {$table['nom']} ".
'WHERE %s ';
$where = $this->construireWhere($table['champs_valeurs_id']);
$requete = sprintf($requete, $where);
$resultat = $this->bdd->exec($requete);
if ($resultat === false) {
$cle = $this->recupererCle($table);
$this->messages[] = "L'enregistrement '$cle' de la table {$table['nom']} n'a pas été supprimé car la requête a échouée.";
} else {
$resultat = true;
}
return $resultat;
}
private function gererSession($demarrage) {
session_name($this->sessionName);
 
// Configuration du cookie de session
// Détermination du chemin pour les cookies nécessaire à Jrest
/// ATTENTION : comme les cookies sont passés à Jrest, il faut utiliser l'url de Jrest pour établir le chemin
$url_morceaux = parse_url($this->config['coel']['urlBaseJrest']);
self::$cookieChemin = $this->reparerCheminCookie($url_morceaux['path']);
unset($url_morceaux);
session_set_cookie_params($this->sessionExpireTime, self::$cookieChemin);
// Démarrage de la session
if ($demarrage) {
session_start();
}
}
private function reparerCheminCookie($chemin) {
// dirname renvoit / si le chemin vaut seulement /dossier/, cela renvoit /dossier si le chemin vaut /dossier//.
$chemin = dirname($chemin.'/.');
// Fixe la gestion des chemins pour les cookies sous les OS utilisant le \ comme séparteur de chemin
$chemin = str_replace('\\', '/', $chemin);
// Ajoute un '/' terminal sauf si on est à la racine web
$chemin = ($chemin != '/' ? $chemin.'/' : '');
return $chemin;
}
private function gererIdentificationPermanente() {
// Pour maintenir l'utilisateur tjrs réellement identifié nous sommes obligé de recréer une SESSION et de le recharger depuis la bdd
if ($this->getUtilisateur() == ''
&& isset($_COOKIE['coel_login'])
&& ($utilisateur = $this->chargerUtilisateur($_COOKIE['coel_login'], $_COOKIE['coel_mot_de_passe']))) {
$this->setUtilisateur($utilisateur, $_COOKIE['coel_permanence']);
}
}
/*protected function rechargerCookieUtilisateur() {
$utilisateur = $this->chargerUtilisateur($_COOKIE['coel_login']);
$this->setUtilisateur($utilisateur, $_COOKIE['coel_permanence']);
}*/
protected function getUtilisateur() {
return (isset($_SESSION['coel_utilisateur']) ? $_SESSION['coel_utilisateur'] : '');
}
 
/**
* Tente de trouver un utilisateur dans la table Personnes de CoeL, en fonction de son
* courriel ($login); si le mot de passe est fournie, le vérifie, sinon l'ignore
*/
protected function chargerUtilisateur($login, $mot_de_passe = null) {
$sortie = false;
$requete = 'SELECT cp_id_personne AS id, cp_fmt_nom_complet AS nom_complet, cp_prenom AS prenom, '.
' cp_nom AS nom, cp_login AS login, cp_mot_de_passe AS mot_de_passe, cp_parametre AS parametre, '.
' cp_ville AS ville, cp_code_postal AS code_postal, '.
' cp_mark_licence AS licence '.
'FROM coel_personne '.
"WHERE cp_login = {$this->bdd->quote($login)} ".
((!is_null($mot_de_passe)) ? "AND cp_mot_de_passe = {$this->bdd->quote($mot_de_passe)} " : '');
try {
$resultat = $this->bdd->query($requete)->fetch();
if ($resultat === false) {
$this->debug[] = "L'utilisateur n'est pas enregistré comme utilisateur de COEL.";
} else {
$sortie = array('id' => $resultat['id'],
'login' => $login,
'mot_de_passe' => $resultat['mot_de_passe'],
'nom_complet' => $resultat['nom_complet'],
'nom' => $resultat['nom'],
'prenom' => $resultat['prenom'],
'parametre' => $resultat['parametre'],
'ville' => $resultat['ville'],
'code_postal' => $resultat['code_postal'],
'licence' => $resultat['licence']);
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
return $sortie;
}
 
/**
* Définit un utilisateur comme "actif" en plaçant un objet Utilisateur dans la session;
* Ne pose plus de cookies depuis l'adaptation au SSO, sauf pour la licence (acceptée ou non)
* @param unknown $utilisateur
* @param number $permanence
*/
protected function setUtilisateur($utilisateur, $permanence = 1) {
$_SESSION['coel_utilisateur'] = $utilisateur;
//$this->setCookiePersistant('coel_licence', $utilisateur['licence'], $permanence);
}
protected function setCookiePersistant($cookie_nom, $valeur, $permanence = 1) {
setCookie($cookie_nom, $valeur, time() + ($permanence ? 100*24*60*60 : 60*60), self::$cookieChemin);
$_COOKIE[$cookie_nom] = $valeur;
}
protected function supprimerCookie($cookie_nom) {
setCookie($cookie_nom, '', 1, self::$cookieChemin);
$_COOKIE[$cookie_nom] = '';
}
/**
* Méthode prenant en paramètre un chemin de fichier squelette et un tableau associatif de données,
* en extrait les variables, charge le squelette et retourne le résultat des deux combinés.
*
* @param String $fichier le chemin du fichier du squelette
* @param Array $donnees un tableau associatif contenant les variables a injecter dans le squelette.
*
* @return boolean false si le squelette n'existe pas, sinon la chaine résultat.
*/
public static function traiterSquelettePhp($fichier, Array $donnees = array()) {
$sortie = false;
if (file_exists($fichier)) {
// Extraction des variables du tableau de données
extract($donnees);
// Démarage de la bufferisation de sortie
ob_start();
// Si les tags courts sont activés
if ((bool) @ini_get('short_open_tag') === true) {
// Simple inclusion du squelette
include $fichier;
} else {
// Sinon, remplacement des tags courts par la syntaxe classique avec echo
$html_et_code_php = self::traiterTagsCourts($fichier);
// Pour évaluer du php mélangé dans du html il est nécessaire de fermer la balise php ouverte par eval
$html_et_code_php = '?>'.$html_et_code_php;
// Interprétation du html et du php dans le buffer
echo eval($html_et_code_php);
}
// Récupèration du contenu du buffer
$sortie = ob_get_contents();
// Suppression du buffer
@ob_end_clean();
} else {
$msg = "Le fichier du squelette '$fichier' n'existe pas.";
trigger_error($msg, E_USER_WARNING);
}
// Retourne le contenu
return $sortie;
}
/**
* Fonction chargeant le contenu du squelette et remplaçant les tags court php (<?= ...) par un tag long avec echo.
*
* @param String $chemin_squelette le chemin du fichier du squelette
*
* @return string le contenu du fichier du squelette php avec les tags courts remplacés.
*/
private static function traiterTagsCourts($chemin_squelette) {
$contenu = file_get_contents($chemin_squelette);
// Remplacement de tags courts par un tag long avec echo
$contenu = str_replace('<?=', '<?php echo ', $contenu);
// Ajout systématique d'un point virgule avant la fermeture php
$contenu = preg_replace("/;*\s*\?>/", "; ?>", $contenu);
return $contenu;
}
public static function debug($var) {
echo '<pre>'.print_r($var, true).'</pre>';
}
 
/*
* Retourne une paire de coordonnée depuis un tableau représentant une adresse
* ou une adresse partielle à l'aide du service Nominatim.
* (http://wiki.openstreetmap.org/wiki/Nominatim)
*
* @param in data: un tableau associatif doté de *toutes* les clefs suivantes:
* 'adresse', 'cp', 'ville', 'pays'
* @param out lonlat: un tableau associatif contenant 'lon' et 'lat' si elles ont été déterminées
* Celles-ci sont sous la forme de deux chaînes de caractères numériques représentant
* un FLOAT() dont le séparateur des décimales est le "." (point).
* @param in opts: un tableau associatif optionnel écrasant ou ajoutant des valeurs d'API
* @return boolean: selon que la fonction à réussi ou non
*
* opts['force-q']: force l'utilisation d'une requête en texte libre
* quelque soit le remplissage des composants individuels
*
* Note: le code postal est contre-productif pour Nominatim:
* https://lists.openstreetmap.org/pipermail/talk-fr/2013-April/057084.html
*/
static function coordGuess(Array $data, Array &$lonlat, Array $opts = NULL) {
if(!$data) return FALSE;
$common_query = array('accept_language' => 'fr', 'format' => 'json', 'limit' => 1);
if(! $data['adresse'] || (! $data['cp'] && ! $data['ville']) || @$opts['force-q']) {
unset($opts['force-q']);
$query = array_merge($common_query,
array('q' => implode(', ', array_filter($data))),
$opts ? $opts : array());
}
else {
$query = array_merge($common_query,
array_filter(array('street' => $data['adresse'],
'city' => $data['ville'],
'postalcode' => $data['cp'],
'country' => $data['pays'])),
$opts ? $opts : array());
}
$fullquery = 'http://nominatim.openstreetmap.org/search.php?' . http_build_query($query);
 
$ctx = stream_context_create(array('http' => array( 'timeout' => '4' )));
$r = json_decode(file_get_contents($fullquery, FALSE, $ctx));
error_log(sprintf("COEL: Nominatim request returned %d result(s) [%s]", count($r), $fullquery));
if($r && isset($r[0])) {
$lonlat['lon'] = $r[0]->lon;
$lonlat['lat'] = $r[0]->lat;
return TRUE;
}
return FALSE;
}
 
/*
* Retourne un tableau prêt à être utilisé par coordGuess(), c'est à dire initialisant toutes
* les clefs nécessaires (même si NULL) et disposant systématiquement d'un pays.
* Cela à partir d'un tableau au format de clefs prédéterminé.
* S'occupe du filtrage basique des éléments pour maximiser les chances de détection.
*
* @param in: un tableau associatif contenant les clefs telles que nommées à l'issue du
* du formulaire de saisie: 'cs_adresse_01', 'cs_code_postal', 'cs_ville'
* @param db: une db optionnelle, utilisée si nécessaire pour converir les code pays
* du formulaire de saisie: 'cs_adresse_01', 'cs_code_postal', 'cs_ville'
* @return un tableau associatif contenant une ou plusieurs des clefs suivantes:
* 'adresse', 'cp', 'ville', 'pays'
*/
static function addrReStruct(Array $in, $db = NULL) {
$pays = FALSE;
if(is_numeric(@$in['cs_ce_truk_pays'])) {
if($db) {
$pays= $db->query(sprintf(
"SELECT cmlv_nom FROM coel_meta_liste_valeur ".
"WHERE cmlv_ce_parent = 1074 AND cmlv_id_valeur = %d",
intval($in['cs_ce_truk_pays'])))->fetchColumn();
}
}
else $pays = @trim($in['cs_ce_truk_pays']);
 
// pas de précision au n°, mais Nominatim peine avec des préfixes trop élaborés
// coupons jusqu'à un élément reconnaissable s'il existe
$adresse = @trim($in['cs_adresse_01']);
$adresse = substr($adresse, stripos($adresse, "ville de "));
$adresse = substr($adresse, stripos($adresse, "impasse"));
$adresse = substr($adresse, stripos($adresse, "chemin"));
$adresse = substr($adresse, stripos($adresse, "route"));
$adresse = substr($adresse, stripos($adresse, "rue"));
$adresse = substr($adresse, stripos($adresse, "avenue"));
$adresse = substr($adresse, stripos($adresse, "boulevard"));
$adresse = substr($adresse, stripos($adresse, "place"));
$adresse = substr($adresse, stripos($adresse, "promenade"));
$adresse = substr($adresse, stripos($adresse, "allée"));
$adresse = substr($adresse, stripos($adresse, "cours"));
$adresse = preg_replace("/[\r\n].*/", "", $adresse);
 
$ville = preg_replace('/cedex.*/i', '', @trim($in['cs_ville']));
return array(
'adresse' => $adresse,
'cp' => @trim($in['cs_code_postal']) ? $in['cs_code_postal'] : '',
'ville' => $ville,
'pays' => $pays !== FALSE ? $pays : 'France'
);
}
}
?>
/tags/v1.11-okuzgozu/jrest/services/CoelCollectionACommentaire.php
New file
0,0 → 1,201
<?php
/**
* Service fournissant la liste des relations "structure à personne".
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
class CoelCollectionACommentaire extends Coel {
const MODE_SUPPRESSION_PAR_COLLECTION = 'SuppressionParCollection';
const MODE_SUPPRESSION_PAR_COMMENTAIRE = 'SuppressionParCommentaire';
/** Contient les infos sur les tables gérées par ce service.
* Bien respecter l'ordre avec en premier les tables liées et en dernier la table établissant la relation. */
protected $tables = array( 102 => array( 'nom' => 'coel_collection_a_commentaire',
'prefixe' => 'ccac',
'id' => array('ccac_id_collection', 'ccac_id_commentaire')));
 
/**
* Méthode appelée avec une requête de type GET.
*/
public function getElement($param = array()) {
// Initialisation des variables
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_collection', 'mark_public'), $param);
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT ' : 'SELECT ').
' ccac.*, ccm.* '.
'FROM coel_collection_a_commentaire AS ccac '.
' LEFT JOIN coel_meta_historique_ligne ON (ccac_ce_meta = cmhl_id_historique_ligne) '.
' LEFT JOIN coel_commentaire AS ccm ON (ccac_id_commentaire = ccm_id_commentaire) '.
((count($p) != 0) ? 'WHERE ' : '').
(isset($p['id_collection']) ? "AND ccac_id_collection = {$p['id_collection']} " : '').
(isset($p['mark_public']) ? "AND ccm_mark_public = {$p['mark_public']} " : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'ccac_ce_meta DESC').' ';
$requete = str_replace('WHERE AND', 'WHERE', $requete);
$requeteCount = $requete;
$requete .= "LIMIT $this->start, $this->limit ";
 
// Récupération des résultats
try {
$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
$nbElements = $this->bdd->query($requeteCount)->rowCount();
$info['nbElements'] = $nbElements;
$info['collectionsACommentaire'] = $donnees;
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
// Envoie sur la sortie standard
$this->envoyer($info);
}
/**
* Méthode appelée pour ajouter un élément.
*/
public function createElement($params) {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
try {
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
// Nous ne pouvons pas utiliser foreach car il travaille sur une copie du tableau or nous le modifions dynamiquement dans la boucle
reset($tables_a_modifier);
while (list($table_id, $table) = each($tables_a_modifier)) {
if (!is_null($table['champs'])) {
if (!$this->avoirCleComplete($table)) {
$this->messages[] = 'Il est nécessaire de fournir toutes les clés à ce service.';
} else {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
} else {
$this->messages[] = "Il faut être identifié pour accéder à ce service";
}
// Envoie sur la sortie standard
$this->envoyer();
}
/**
* Méthode appelée pour mettre à jour un élément
*/
public function updateElement($uid, $params) {
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) && !isset($uid[1])) {
$this->messages[] = 'Aucun identifiant de collection a été passé. Vous ne devriez pas avoir accès à ce service.';
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
try {
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
foreach ($tables_a_modifier as $table_id => $table) {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
// Envoie sur la sortie standard
$this->envoyer();
}
/**
* Méthode appelée pour supprimer un ou plusieurs éléments
*/
public function deleteElement($uid) {
// NOTES : la suppression ne supprime pas les personnes mais seulements les relations
 
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) || !isset($uid[1])) {
$this->messages[] = "Identifiant de relations ou d'utilisateur manquant. Vous ne devriez pas avoir accès à ce service.";
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($uid[0]);
// Mode de suppression
$mode_de_suppression = '';
if (isset($uid[2])) {
$mode_de_suppression = $uid[2];
}
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Récupération des identifiant à supprimer
$identifiants = array();
$identifiants_agreges = explode(',', rtrim($uid[1], ','));
foreach ($identifiants_agreges as $identifiant) {
$identifiants[] = explode('-', $identifiant);
}
if (count($identifiants) == 0) {
$this->messages[] = "Aucun enregistrement n'a été supprimé.";
} else {
try {
foreach ($identifiants as $id) {
if (count($id) == 1) { // Seulement des id de collection
if ($mode_de_suppression == MODE_SUPPRESSION_PAR_COLLECTION) {
$params = array('ccac_id_collection' => $id[0]);
} else if ($mode_de_suppression == MODE_SUPPRESSION_PAR_COMMENTAIRE) {
$params = array('ccac_id_commentaire' => $id[0]);
} else {
$params = array('ccac_id_collection' => $id[0]);
}
} else if (count($id) == 2) { // Tous les id...
$params = array('ccac_id_collection' => $id[0], 'ccac_id_commentaire' => $id[1]);
}
$tables_a_modifier = $this->recupererTablesAModifier($params);
$table = $tables_a_modifier[102];
if ($this->avoirEnregistrement($table)) {
$resultat = $this->supprimer($table);
if ($resultat === true) {
// Historisation (Ajout des méta-données)
$cle = $this->recupererCle($table);
$this->historiser(102, $cle, 'NULL', $id_utilisateur, Coel::ETAT_SUPPRIMER, $id_session);
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
}
// Envoie sur la sortie standard
$this->envoyer();
}
}
?>
/tags/v1.11-okuzgozu/jrest/services/CoelExport.php
New file
0,0 → 1,334
<?php
 
/**
* Service exportant des informations concernant COEL au format CSV.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2010
*/
class CoelExport extends Coel {
 
const META_LISTE_STOCK_PARAMS = 1020;// Liste des paramètres de contrôle environnemental d'un local
const META_LISTES_EXPERTISE_COLLECTION = '1040,1041,1043,1045,1046,1049,1050,1053,1057,1081';// Liste des métadonnées pour les informations des des collections
 
private $format = null;
private $service = null;
private $squelette = null;
private $squelette_dossier = null;
 
/**
* Méthode appelée avec une requête de type GET.
*/
public function getElement($params = array()) {
// Initialisation des variables
$info = array();
$contenu = '';
 
// Pré traitement des paramêtres
$pour_bdd = false;
$this->parametres = $this->traiterParametresUrl(array('service', 'format'), $params, $pour_bdd);
 
// Chargement du bon type de service demandé
if (isset($this->parametres['service'])) {
$this->service = strtolower($this->parametres['service']);
 
$methode = $this->getNomMethodeService();
if (method_exists($this, $methode)) {
if (isset($this->parametres['format']) && preg_match('/^(?:csv|txt)$/i', $this->parametres['format'])) {
// Mise en minuscule de l'indication du format
$this->format = strtolower($this->parametres['format']);
// Définition du fichier squelette demandé
$this->definirSquelette();
} else {
$this->format = '';
$this->messages[] = "Le service COEL Export nécessite d'indiquer en second paramètre le format : csv, txt.";
}
// Récupération du contenu à renvoyer
$contenu = $this->$methode();
} else {
$this->messages[] = "Le type d'information demandé '$this->service' n'est pas disponible.";
}
} else {
$this->messages[] = "Le service COEL Syndication nécessite d'indiquer en premier paramètre le type d'information demandé.";
}
 
// Envoie sur la sortie standard
$encodage = 'utf-8';
$mime = $this->getTypeMime();
$formatage_json = $this->getFormatageJson();
$this->envoyer($contenu, $mime, $encodage, $formatage_json);
}
 
private function definirSquelette() {
$this->squelette_dossier = dirname(__FILE__).DIRECTORY_SEPARATOR.'squelettes'.DIRECTORY_SEPARATOR;
$ext = $this->getExtensionFichierSquelette();
$this->squelette = $this->squelette_dossier.'export_'.$this->service.'.tpl.'.$ext;
}
 
private function getExtensionFichierSquelette() {
$ext = '';
switch ($this->format) {
case 'csv' :
case 'txt' :
$ext = 'csv';
break;
default:
$ext = 'csv';
}
return $ext;
}
 
private function getNomMethodeService() {
$methode = '';
$service_formate = str_replace(' ', '', ucwords(implode(' ', explode('_', $this->service))));
$methode = 'getService'.$service_formate;
return $methode;
}
 
private function getTypeMime() {
$mime = '';
switch ($this->format) {
case 'csv' :
$mime = 'text/csv';
break;
case 'txt' :
$mime = 'text/plain';
break;
default:
$mime = 'text/html';
}
return $mime;
}
 
private function getFormatageJson() {
$json = false;
switch ($this->service) {
default:
$json = false;
}
return $json;
}
 
 
private function getServiceStructureExpertise() {
$donnees = array();
 
// Construction de la requête
$requete = 'SELECT '.(($this->distinct) ? 'DISTINCT' : '').' '.
' cs_id_structure, cs_nom, cs_description, cs_adresse_01, cs_code_postal, cs_ville, cs_courriel, '.
' cs_truk_telephone, cs_truk_url,'.
' SUM(csap_bota_travail_hebdo_tps) AS personnel_heure_nbre, '.
' csc_truk_stockage_parametre, cmlv_nom, csv_mark_visite_avec_motif '.
'FROM coel_structure '.
' LEFT JOIN coel_structure_a_personne ON (cs_id_structure = csap_id_structure) '.
' LEFT JOIN coel_structure_conservation ON (cs_id_structure = csc_id_structure) '.
' LEFT JOIN coel_structure_valorisation ON (cs_id_structure = csv_id_structure) '.
' LEFT JOIN coel_meta_liste_valeur on `cmlv_id_valeur` =`cs_ce_truk_type_public`'.
'GROUP BY cs_id_structure '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cs_nom ASC').' ';
$message_echec = "La requête n'a retourné aucun résultat.";
$structures = $this->executerRequete($requete, $message_echec);
 
// Construction de la requête
$requete = 'SELECT '.(($this->distinct) ? 'DISTINCT' : '').' '.
' cs_id_structure, '.
' COUNT(cc_id_collection) AS collection_nbre '.
'FROM coel_structure '.
' LEFT JOIN coel_collection ON (cs_id_structure = cc_ce_structure) '.
'GROUP BY cs_id_structure ';
$message_echec = "La requête comptant le nombre de collections n'a retourné aucun résultat.";
$collections_nbre = $this->executerRequete($requete, $message_echec);
 
// Récupération des métadonnées nécessaires
$requete = 'SELECT cmlv_id_valeur, cmlv_nom, cmlv_abreviation '.
'FROM coel_meta_liste_valeur '.
'WHERE cmlv_ce_parent = '.self::META_LISTE_STOCK_PARAMS.' ';
$message_echec = "La requête de recherche des métadonnées a retourné aucun résultat.";
$metadonnees = $this->executerRequete($requete, $message_echec);
 
// Traitement des données
if ($structures !== false) {
// Traitement du nombre de collection par structure
$collections_par_structure = array();
foreach ($collections_nbre as $collection) {
$nbre = (empty($collection['collection_nbre'])) ? 0 : $collection['collection_nbre'];
$collections_par_structure[$collection['cs_id_structure']] = $nbre;
}
 
// Instanciation des objets nécessaires aux traitements
$ontologie = new Ontologie($metadonnees);
$utilTruck = new UtilTruck($ontologie);
 
// Traitement final des données concernant les structures
foreach ($structures as $structure) {
$id_structure = $structure['cs_id_structure'];
$nom = $structure['cs_nom'];
$description = $structure['cs_description'];
$adresse_01 = $structure['cs_adresse_01'];
$code_postal = $structure['cs_code_postal'];
$ville = $structure['cs_ville'];
$telephone = $utilTruck->construireTxtListeOntologie($structure['cs_truk_telephone']);
$courriel = $structure['cs_courriel'];
$type = $structure['cmlv_nom'];
$url = $utilTruck->construireTxtListeOntologie($structure['cs_truk_url']);
$stockage_params = $utilTruck->construireTxtListeOntologie($structure['csc_truk_stockage_parametre']);
$stockage_params_nbre = $utilTruck->getNbreValeur($structure['csc_truk_stockage_parametre']);
$stockage_params_nbre = empty($stockage_params_nbre) ? 0 : $stockage_params_nbre;
$collection_nbre = $collections_par_structure[$structure['cs_id_structure']];
$collection_nbre = empty($collection_nbre) ? 0 : $collection_nbre;
// désactivé à la demande de Louise - 01/09/2014
//$personnel_heure_nbre = empty($structure['personnel_heure_nbre']) ? 0 : $structure['personnel_heure_nbre'];
//$visite_avec_motif_science = $structure['csv_mark_visite_avec_motif'];
 
$structure_affichage = array(
'nom' => $nom,
'description' => $description,
'adresse' => $adresse_01,
'code_postal' => $code_postal,
'ville' => $ville,
'telephone' => $telephone,
'courriel' => $courriel,
'url' => $url,
'type' => $type,
'stockage_params' => $stockage_params,
'stockage_params_nbre' => $stockage_params_nbre,
'collection_nbre' => $collection_nbre,
//'personnel_heure_nbre' => $personnel_heure_nbre,
//'visite_avec_motif_science' => $visite_avec_motif_science
);
$structure_affichage = $this->nettoyerTableau($structure_affichage);
 
$donnees['structures'][$id_structure] = $structure_affichage;
}
}
 
// Création du contenu
$contenu = $this->executerService($donnees);
return $contenu;
}
 
private function getServiceCollectionExpertise() {
 
// Construction de la requête
$requete = 'SELECT '.(($this->distinct) ? 'DISTINCT' : '').' '.
' cc_id_collection, '.
' cc_ce_structure, '.
' cc_nom, cc_cote, cs_nom, cc_ce_specimen_type, cc_description, cc_periode_constitution_debut, cc_periode_constitution_fin, '.
' cc_truk_couverture_lieu, ccb_truk_etiquette_renseignement, ccb_truk_nature, '.
' ccb_nb_planches_herbiers, ccb_nb_especes, ccb_ce_etat_general, ccb_specimen_fixation_pourcent, '.
' ccb_truk_specimen_fixation_methode, ccb_truk_etiquette_fixation_support, '.
' ccb_truk_etiquette_fixation_specimen, ccb_truk_degradation_presentation, '.
' ccb_ce_classement_etat, ccb_ce_inventaire '.
'FROM coel_collection '.
' LEFT JOIN coel_collection_botanique ON (cc_id_collection = ccb_id_collection) '.
' LEFT JOIN coel_structure ON (cs_id_structure = cc_ce_structure) '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cc_nom ASC').' ';
$message_echec = "La requête a retourné aucun résultat.";
$collections = $this->executerRequete($requete, $message_echec);
 
// Récupération des métadonnées nécessaires
$requete = 'SELECT cmlv_id_valeur, cmlv_ce_parent, cmlv_nom, cmlv_abreviation '.
'FROM coel_meta_liste_valeur '.
'WHERE cmlv_ce_parent IN ('.self::META_LISTES_EXPERTISE_COLLECTION.') ';
$message_echec = "La requête de recherche des métadonnées a retourné aucun résultat.";
$metadonnees = $this->executerRequete($requete, $message_echec);
 
// Traitement des données
$donnees = array();
if ($collections !== false) {
// Instanciation des objets nécessaires aux traitements
$ontologie = new Ontologie($metadonnees);
$utilTruck = new UtilTruck($ontologie);
$etat_ontologie = array("" =>"", "0" => "", "1" => "Très mauvais état", "2" => "Mauvais état", "3" => "État moyen",
"4" => "Bon état", "5" => "Très bon état");
 
// Traitement final des données concernant les structures
foreach ($collections as $collection) {
$id_collection = $collection['cc_id_collection'];
$nom = $collection['cc_nom'];
$cote = $collection['cc_cote'];
$id_structure = $collection['cc_ce_structure'];
$nom_structure = $collection['cs_nom'];
$specimen_type = $utilTruck->construireTxtListeOntologie($collection['cc_ce_specimen_type']);
$description = $collection['cc_description'];
$couverture_lieu = $utilTruck->construireTxtListeOntologie($collection['cc_truk_couverture_lieu']);
$specimen_fixation_pourcent = $collection['ccb_specimen_fixation_pourcent'];
$specimen_fixation_methode = $utilTruck->construireTxtListeOntologie($collection['ccb_truk_specimen_fixation_methode']);
$etiquette_renseignement = $utilTruck->construireTxtListeOntologie($collection['ccb_truk_etiquette_renseignement']);
$nature = $utilTruck->construireTxtListeOntologie($collection['ccb_truk_nature']);
$etat_general = $etat_ontologie[$collection['ccb_ce_etat_general']];
$etiquette_fixation_support = $utilTruck->construireTxtListeOntologie($collection['ccb_truk_etiquette_fixation_support']);
$etiquette_fixation_specimen = $utilTruck->construireTxtListeOntologie($collection['ccb_truk_etiquette_fixation_specimen']);
$degradation_presentation = $utilTruck->construireTxtListeOntologie($collection['ccb_truk_degradation_presentation'], false, true, true);
$classement_etat = $utilTruck->construireTxtListeOntologie($collection['ccb_ce_classement_etat']);
$inventaire = $utilTruck->construireTxtListeOntologie($collection['ccb_ce_inventaire']);
 
$collection_affichage = array(
'id' => $id_collection,
'cote' => $cote,
'nom' => $nom,
'nom_structure' => $nom_structure,
'id_structure' => $id_structure,
'specimen_type' => $specimen_type,
'description' => $description,
'periode_constitution_debut' => $collection['cc_periode_constitution_debut'],
'periode_constitution_fin' => $collection['cc_periode_constitution_fin'],
'couverture_lieu' => $couverture_lieu,
'etiquette_renseignement' => $etiquette_renseignement,
'nature' => $nature,
'nombre_planches_herbier' => $collection['ccb_nb_planches_herbiers'],
'etat_general' => $etat_general,
'etiquette_fixation_support' => $etiquette_fixation_support,
'etiquette_fixation_specimen' => $etiquette_fixation_specimen,
'specimen_fixation_pourcent' => $specimen_fixation_pourcent,
'specimen_fixation_methode' => $specimen_fixation_methode,
'degradation_presentation' => $degradation_presentation,
'classement_etat' => $classement_etat,
'inventaire' => $inventaire);
$collection_affichage = $this->nettoyerTableau($collection_affichage);
 
$donnees['collections'][] = $collection_affichage;
}
$donnees['champs'] = array_keys(current($donnees['collections']));
}
 
// Création du contenu
$contenu = $this->executerService($donnees);
return $contenu;
}
 
private function executerRequete($requete, $message_echec) {
try {
$infos = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($infos === false) {
$this->messages[] = $message_echec;
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur_requete'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
return $infos;
}
 
private function executerService($donnees) {
// Création du contenu à partir d'un template PHP
$contenu = Coel::traiterSquelettePhp($this->squelette, $donnees);
return $contenu;
}
 
private function nettoyerTableau(Array $tableau) {
foreach ($tableau as $cle => $valeur) {
$tableau[$cle] = self::nettoyerGuillemets($valeur);
}
return $tableau;
}
 
private static function nettoyerGuillemets($txt) {
$txt = preg_replace('/"/', '""', $txt);
return $txt;
}
}
/tags/v1.11-okuzgozu/jrest/services/bibliotheque/Ontologie.php
New file
0,0 → 1,71
<?php
class Ontologie {
private $ontologie = null;
/**
* Le contructeur transforme la sortie d'une requête sur la table coel_meta_liste_valeur en tableau Ontologie au format :
* $ontologie[id_valeur] = array(
* 'nom' => 'nom de la valeur',
* 'abr' => 'abréviation de la valeur,
* 'dsc' => 'description de la vaeur');
* @param $ontologie tableau listant les valeurs de l'ontologie.
*/
public function __construct(Array $metadonnees) {
$ontologie = array(0 => array('nom' => 'Non renseigné', 'abr' => 'NR'));
foreach ($metadonnees as $meta) {
$id = $meta['cmlv_id_valeur'];
$nom = isset($meta['cmlv_nom']) ? $meta['cmlv_nom'] : null;
$abr = isset($meta['cmlv_abreviation']) ? $meta['cmlv_abreviation'] : null;
$dsc = isset($meta['cmlv_description']) ? $meta['cmlv_description'] : null;
$ontologie[$id] = array('nom' => $nom, 'abr' => $abr, 'dsc' => $dsc);
}
$this->ontologie = $ontologie;
}
 
/**
* Retourne le nom de la valeur de l'ontologie correspondant à l'id.
*
* @param int $id l'identifiant de la valeur de l'ontologie.
* @return string le nom de la valeur.
*/
public function getNom($id) {
$nom = null;
if (isset($this->ontologie[$id])) {
$nom = $this->ontologie[$id]['nom'];
}
return $nom;
}
/**
* Retourne l'abréviation de la valeur de l'ontologie correspondant à l'id.
*
* @param int $id l'identifiant de la valeur de l'ontologie.
* @return string l'abreviation de la valeur.
*/
public function getAbreviation($id) {
$abr = null;
if (isset($this->ontologie[$id])) {
$abr = $this->ontologie[$id]['abr'];
}
return $abr;
}
 
/**
* Le tableau de retour Ontologie est au format :
* $ontologie[id_valeur] = array(
* 'nom' => 'nom de la valeur',
* 'abr' => 'abréviation de la valeur);
*
* @param int $id l'identifiant de la valeur de l'ontologie.
* @return $ontologie tableau listant les valeurs de l'ontologie.
*/
public function getTableauValeur($id) {
$valeur = null;
if (isset($this->ontologie[$id])) {
$valeur = $this->ontologie[$id];
}
return $valeur;
}
}
/tags/v1.11-okuzgozu/jrest/services/bibliotheque/UtilTruck.php
New file
0,0 → 1,284
<?php
/**
* Classe permettant de traiter plus facilement les champs dégueulasses de la base de données COEL.
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2010
*/
class UtilTruck {
const TYPE_AUTRE = 'AUTRE';
const TYPE_TOTAL = 'TOTAL';
const SEPARATEUR_TYPE_VALEUR = '##';
const SEPARATEUR_VALEURS = ';;';
const SEPARATEUR_DONNEES = '||';
const VALEUR_NULL = 'NC';
private $ontologie = null;
public function __construct(Ontologie $ontologie = null) {
$this->setOntologie($ontologie);
}
public function setOntologie(Ontologie $ontologie) {
$this->ontologie = $ontologie;
}
public function construireTxtTruckSimple($chaine_a_analyser) {
return $this->construireTxtTruck($chaine_a_analyser, false, false);
}
public static function construireTxtTruckSansMajuscule($chaine_a_analyser) {
return $this->construireTxtTruck($chaine_a_analyser, false, true);
}
public function construireTxtTruckSansPointFinal($chaine_a_analyser) {
return $this->construireTxtTruck($chaine_a_analyser, true, false);
}
private function construireTxtTruck($chaine_a_analyser, $majuscule = true, $point_final = true) {
$termes = $this->traiterTxtTruck($chaine_a_analyser);
$chaine_a_retourner = self::formaterTableauDeTxt($termes, $majuscule, $point_final);
return $chaine_a_retourner;
}
public function traiterTxtTruck($chaine_a_analyser) {
$termes = array();
if ((!is_null($chaine_a_analyser)) && (trim($chaine_a_analyser) != '')) {
$valeurs = explode(self::SEPARATEUR_VALEURS, $chaine_a_analyser);
$nbre_valeurs = count($valeurs);
if ($nbre_valeurs > 0) {
for ($i = 0; $i < $nbre_valeurs; $i++) {
$valeur = trim($valeurs[$i]);
if ($valeur != '') {
$valeur_formatee = $this->formaterValeurTruck($valeur);
$termes[] = $valeur_formatee;
}
}
}
}
return $termes;
}
public function getTxtTruckParPosition($chaine_a_analyser, $position = 1) {
$retour = '';
if ((!is_null($chaine_a_analyser)) && (trim($chaine_a_analyser) != '')) {
$valeurs = explode(self::SEPARATEUR_VALEURS, $chaine_a_analyser);
$nbre_valeurs = count($valeurs);
if ($nbre_valeurs > 0) {
$position = $position - 1;
$valeur = trim($valeurs[$position]);
if ($valeur != '') {
$retour = $this->formaterValeurTruck($valeur);
}
}
}
return $retour;
}
public function getTableauTruck($chaine_a_analyser) {
$tableau_retour = array();
if ((!is_null($chaine_a_analyser)) && (trim($chaine_a_analyser) != '')) {
$valeurs = explode(self::SEPARATEUR_VALEURS, $chaine_a_analyser);
$nbre_valeurs = count($valeurs);
if ($nbre_valeurs > 0) {
for ($i = 0; $i < $nbre_valeurs; $i++) {
$valeur = trim($valeurs[$i]);
if ($valeur != '') {
$tableau_retour[] = $valeur;
}
}
}
}
return $tableau_retour;
}
public function getNbreValeur($chaine_a_analyser) {
$nbre_valeurs = null;
if ((!is_null($chaine_a_analyser)) && (trim($chaine_a_analyser) != '')) {
$valeurs = explode(self::SEPARATEUR_VALEURS, $chaine_a_analyser);
$nbre_valeurs = count($valeurs);
}
return $nbre_valeurs;
}
private function formaterValeurTruck($valeur) {
$chaine_a_retourner = '';
if (preg_match('/^[^#]+##[^$]+$/', $valeur)) {
$cle_valeur = explode(self::SEPARATEUR_TYPE_VALEUR, $valeur);
$chaine_a_retourner = (($cle_valeur[1] == '' || $cle_valeur[1] == 'null') ? self::VALEUR_NULL : $cle_valeur[1]);
$chaine_a_retourner .= ' '.$this->formaterParenthese($cle_valeur[0]);
} else if ($valeur != '') {
$chaine_a_retourner = $valeur;
} else {
trigger_error("Valeur truck posant problème :$valeur", E_USER_NOTICE);
}
return $chaine_a_retourner;
}
public function formaterParenthese($chaine_a_afficher) {
if ($chaine_a_afficher != '') {
$chaine_a_afficher = '('.$chaine_a_afficher.')';
}
return $chaine_a_afficher;
}
public static function formaterTableauDeTxt(Array $tableau_de_txt, $majuscule = true, $point_final = true) {
$chaine_a_afficher = '';
$taille_du_tableau = count($tableau_de_txt);
if ($taille_du_tableau > 0) {
$index_avt_dernier = $taille_du_tableau - 1;
for ($i = 0; $i < $taille_du_tableau; $i++) {
$mot = $tableau_de_txt[$i];
if ($i != $index_avt_dernier) {
$chaine_a_afficher .= $mot.', ';
} else {
$chaine_a_afficher .= self::nettoyerPointFinal($mot);
if ($point_final) {
$chaine_a_afficher .= '.';
}
}
}
}
if ($majuscule) {
$chaine_a_afficher = ucfirst($chaine_a_afficher);
}
return $chaine_a_afficher;
}
private static function formaterAutre($chaine_a_afficher) {
if ($chaine_a_afficher != '') {
$chaine_a_afficher = ' [Autre : '.$chaine_a_afficher.']';
}
return $chaine_a_afficher;
}
private static function formaterOuiNon($chaine_a_formater) {
$txt_a_retourner = '';
if ($chaine_a_formater == '0') {
$txt_a_retourner = 'non';
} else if ($chaine_a_formater == '1') {
$txt_a_retourner = 'oui';
}
return $txt_a_retourner;
}
private static function nettoyerPointFinal($mot) {
$mot = preg_replace('/[.]$/', '', $mot);
return $mot;
}
public function construireTxtListeOntologie($chaineAAnalyser, $valeurEstOntologie = true, $typeEstOntologie = true, $donneeEstOntologie = false) {
$termes = array();
$autres = array();
$chaineAAnalyser = trim($chaineAAnalyser);
if ($chaineAAnalyser != '') {
$valeurs = explode(self::SEPARATEUR_VALEURS, $chaineAAnalyser);
$nbreValeurs = count($valeurs);
if ($nbreValeurs > 0) {
for ($i = 0; $i < $nbreValeurs; $i++) {
$valeur = $valeurs[$i];
// VALEUR SANS TYPE
// La valeur sans type est une entrée de l'ontologie
if ($valeurEstOntologie && preg_match('/^[0-9]+$/u', $valeur)) {
if ($valeur == '0') {
$valeur = '';
} else {
if (isset($this->ontologie)) {
$valeurOntologie = $this->ontologie->getTableauValeur($valeur);
if (isset($valeurOntologie)) {
$valeur = $valeurOntologie['nom'];
}
} else {
$e = "Veuillez définir l'ontologie à utiliser en employant la méthode setOntologie().";
trigger_error($e, E_USER_WARNING);
}
}
}
// VALEUR AVEC TYPE
// Type : AUTRE
$valeurTypeAutre = self::TYPE_AUTRE.self::SEPARATEUR_TYPE_VALEUR;
if (preg_match('/^'.$valeurTypeAutre.'.+$/u', $valeur)) {
$txtAutre = preg_replace('/^'.$valeurTypeAutre.'/u', '', $valeur);
if ($txtAutre != '') {
$autres[] = $txtAutre;
}
$valeur = '';
}
// Type correspondant à une entrée de l'ontologie
if ($typeEstOntologie) {
$valeurTypeOntologie = '([0-9]+)'.self::SEPARATEUR_TYPE_VALEUR;
$valeurTypeAutre = '([[:alnum:]]+)'.self::SEPARATEUR_TYPE_VALEUR;
if (preg_match('/^'.$valeurTypeOntologie.'.*$/u', $valeur, $match)) {// Cas type : réf. numérique
$type = $match[1];
if (isset($this->ontologie)) {
$valeurOntologieNom = $this->ontologie->getNom($type);
if (isset($valeurOntologieNom)) {
$valeurOntologieNom .= ' : ';
$valeur = preg_replace('/^'.$type.'/u', $valeurOntologieNom, $valeur);
}
} else {
$e = "Veuillez définir l'ontologie à utiliser en employant la méthode setOntologie().";
trigger_error($e, E_USER_WARNING);
}
} else if (preg_match('/^'.$valeurTypeAutre.'.*$/u', $valeur, $match)) {// Cas type : AUTRE
$type = $match[1];
$valeur = preg_replace('/^'.$type.'/u', $type.' : ', $valeur);
}
}
// Donnée correspondant à une entrée de l'ontologie
if ($donneeEstOntologie) {
$donneeOntologie = self::SEPARATEUR_TYPE_VALEUR.'([0-9]+)';
if (preg_match('/^.+'.$donneeOntologie.'$/u', $valeur, $match)) {
$donnee = $match[1];
$donnee = str_replace(self::SEPARATEUR_TYPE_VALEUR, '', $donnee);
if (isset($this->ontologie)) {
$valeurOntologieNom = $this->ontologie->getNom($donnee);
if (isset($valeurOntologieNom)) {
$valeur = preg_replace('/'.$donnee.'$/u', $valeurOntologieNom, $valeur);
}
} else {
$e = "Veuillez définir l'ontologie à utiliser en employant la méthode setOntologie().";
trigger_error($e, E_USER_WARNING);
}
}
}
// Nettoyage final
$valeur = preg_replace('/'.self::SEPARATEUR_TYPE_VALEUR.'/', '', $valeur);
if ($valeur != '') {
$termes[] = $valeur;
}
}
}
}
$chaineTermes = self::formaterTableauDeTxt($termes);
$chaineAutres = self::formaterTableauDeTxt($autres);
$chaineARetourner = $chaineTermes.self::formaterAutre($chaineAutres);
return $chaineARetourner;
}
public static function extraireNbrePart($truk_unite_base) {
$types = explode(self::SEPARATEUR_VALEURS, $truk_unite_base);
$nbre = 0;
foreach ($types as $type) {
$unite_base = explode(self::SEPARATEUR_TYPE_VALEUR, $type);
$nbre_part = 0;
if (isset($unite_base[1])) {
$unite_base_info = explode('||', $unite_base[1]);
$nbre_part = $unite_base_info[3];
}
$nbre += $nbre_part;
}
return $nbre;
}
}
/tags/v1.11-okuzgozu/jrest/services/bibliotheque/WdHTMLParser.php
New file
0,0 → 1,144
<?php
/**
*
* @author Olivier Laviale
* @see http://www.weirdog.com/blog/php/un-parser-html-des-plus-leger.html
*
*/
class WdHTMLParser {
private $encoding;
private $matches;
private $escaped;
private $opened = array();
public $malformed;
 
public function parse($html, $namespace=NULL, $encoding='utf-8') {
$this->malformed = false;
$this->encoding = $encoding;
// we take care of escaping comments and processing options. they will not be parsed
// and will end as text nodes
$html = $this->escapeSpecials($html);
// in order to create a tree, we first need to split the HTML using the markups,
// creating a nice flat array of texts and opening and closing markups.
//
// the array can be read as follows :
//
// i+0 => some text
// i+1 => '/' for closing markups, nothing otherwise
// i+2 => the markup it self, without the '<' '>'
//
// note that i+2 might end with a '/' indicating an auto-closing markup
$this->matches = preg_split('#<(/?)' . $namespace . '([^>]*)>#', $html, -1, PREG_SPLIT_DELIM_CAPTURE);
// the flat representation is now ready, we can create our tree
$tree = $this->buildTree();
 
// if comments or processing options where escaped, we can
// safely unescape them now
if ($this->escaped) {
$tree = $this->unescapeSpecials($tree);
}
return $tree;
}
private function escapeSpecials($html) {
// here we escape comments
$html = preg_replace_callback('#<\!--.+-->#sU', array($this, 'escapeSpecials_callback'), $html);
 
// and processing options
$html = preg_replace_callback('#<\?.+\?>#sU', array($this, 'escapeSpecials_callback'), $html);
return $html;
}
private function escapeSpecials_callback($m) {
$this->escaped = true;
$text = $m[0];
$text = str_replace(array('<', '>'), array("\x01", "\x02"), $text);
return $text;
}
 
private function unescapeSpecials($tree) {
return is_array($tree) ? array_map(array($this, 'unescapeSpecials'), $tree) : str_replace(array("\x01", "\x02"), array('<', '>'), $tree);
}
 
private function buildTree() {
$nodes = array();
$i = 0;
$text = NULL;
while (($value = array_shift($this->matches)) !== NULL) {
switch ($i++ % 3) {
case 0:
// if the trimed value is not empty we preserve the value,
// otherwise we discard it.
if (trim($value)){
$nodes[] = $value;
}
break;
case 1:
$closing = ($value == '/');
break;
case 2:
if (substr($value, -1, 1) == '/') {
// auto closing
$nodes[] = $this->parseMarkup(substr($value, 0, -1));
} else if ($closing) {
// closing markup
$open = array_pop($this->opened);
if ($value != $open) {
$this->error($value, $open);
}
 
return $nodes;
} else {
// this is an open markup with possible children
$node = $this->parseMarkup($value);
// push the markup name into the opened markups
$this->opened[] = $node['name'];
// create the node and parse its children
$node['children'] = $this->buildTree($this->matches);
$nodes[] = $node;
}
break;
}
}
return $nodes;
}
public function parseMarkup($markup) {
// get markup's name
preg_match('#^[^\s]+#', $markup, $matches);
$name = $matches[0];
 
// get markup's arguments
preg_match_all('#\s+([^=]+)\s*=\s*"([^"]+)"#', $markup, $matches, PREG_SET_ORDER);
// transform the matches into a nice key/value array
$args = array();
foreach ($matches as $m) {
// we unescape the html entities of the argument's value
$args[$m[1]] = html_entity_decode($m[2], ENT_QUOTES, $this->encoding);
}
 
return array('name' => $name, 'args' => $args);
}
public function error($markup, $expected) {
$this->malformed = true;
printf('unexpected closing markup "%s", should be "%s"', $markup, $expected);
}
}
 
?>
/tags/v1.11-okuzgozu/jrest/services/CoelSyndication.php
New file
0,0 → 1,717
<?php
/**
* Service fournissant des informations concernant COEL au format RSS1, RSS2 ou ATOM.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* Notes : pour les requêtes sur la table d'historique cela peut être assez compliqué!
* Voir : http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id: CoelSyndication.php 381 2010-05-17 17:10:37Z jpm $
* @copyright 2009
*/
class CoelSyndication extends Coel {
private $format = null;
private $service = null;
private $squelette = null;
private $squelette_dossier = null;
private $squelette_diff = null;
private $flux = array();
/**
* Méthode appelée avec une requête de type GET.
*/
public function getElement($param = array()) {
// Initialisation des variables
$info = array();
$contenu = '';
// Pré traitement des paramêtres
$pour_bdd = false;
$p = $this->traiterParametresUrl(array('service', 'format'), $param, $pour_bdd);
// Récupération de la liste des flux
$this->chargerListeDesFlux();
// Chargement du bon type de service demandé
if (isset($p['service'])) {
$this->service = strtolower($p['service']);
$methode = $this->getNomMethodeService();
if (method_exists($this, $methode)) {
if ($this->service != 'liste_des_flux') {
if (isset($p['format']) && preg_match('/^(?:rss1|rss2|atom)$/i', $p['format'])) {
// Multiplication par deux de la limite car nous récupérons deux lignes par item
$this->limit = $this->limit*2;
// Mise en minuscule de l'indication du format
$this->format = strtolower($p['format']);
// Définition du fichier squelette demandé
$this->squelette_dossier = dirname(__FILE__).DIRECTORY_SEPARATOR.'squelettes'.DIRECTORY_SEPARATOR;
$this->squelette = $this->squelette_dossier.$this->format.'.tpl.xml';
$this->squelette_diff = $this->squelette_dossier.'diff.tpl.html';
} else {
$this->format = '';
$this->messages[] = "Le service COEL Syndication nécessite d'indiquer en second paramètre le format : rss1, rss2 ou atom.";
}
}
// Récupération du contenu à renvoyer
$contenu = $this->$methode();
} else {
$this->messages[] = "Le type d'information demandé '$this->service' n'est pas disponible.";
}
} else {
$this->messages[] = "Le service COEL Syndication nécessite d'indiquer en premier paramètre le type d'information demandé.";
}
// Envoie sur la sortie standard
$encodage = 'utf-8';
$mime = $this->getTypeMime();
$formatage_json = $this->getFormatageJson();
$this->envoyer($contenu, $mime, $encodage, $formatage_json);
}
private function getUrlServiceBase() {
$url_service = $this->config['coel']['urlBaseJrest'].'CoelSyndication/'.$this->service.'/'.$this->format;
return $url_service;
}
private function getNomMethodeService() {
$methode = '';
$service_formate = str_replace(' ', '', ucwords(implode(' ', explode('_', $this->service))));
$methode = 'getService'.$service_formate;
return $methode;
}
private function getTypeMime() {
$mime = '';
switch ($this->format) {
case 'atom' :
$mime = 'application/atom+xml';
break;
case 'rss1' :
case 'rss2' :
$mime = 'application/rss+xml';
break;
default:
$mime = 'text/html';
}
return $mime;
}
private function getFormatageJson() {
$json = false;
switch ($this->service) {
case 'liste_des_flux' :
$json = true;
break;
default:
$json = false;
}
return $json;
}
private function getFlux($nom) {
$nom = strtolower($nom);
return isset($this->flux[$nom]) ? $this->flux[$nom] : array();
}
 
private function setFlux($nom, $titre, $description) {
$url_base = $this->config['coel']['urlBaseJrest'].'CoelSyndication/';
$formats = array('atom', 'rss2', 'rss1');
$flux = array();
foreach ($formats as $format) {
$url = $url_base.$nom.'/'.$format;
$flux[$format] = $url;
}
$this->flux[$nom] = array('titre' => $titre, 'description' => $description, 'urls' => $flux);
}
private function chargerListeDesFlux() {
$this->setFlux('structure','Flux de syndication des institutions',
'Ce flux fournit des informations sur les mises à jour des institutions saisies dans COEL.');
$this->setFlux('collection', 'Flux de syndication des Collections',
'Ce flux fournit des informations sur les mises à jour des collections saisies dans COEL.');
$this->setFlux('personne', 'Flux de syndication des personnes',
'Ce flux fournit des informations sur les mises à jour des personnes saisies dans COEL.');
$this->setFlux('publication', 'Flux de syndication des publications',
'Ce flux fournit des informations sur les mises à jour des publications saisies dans COEL.');
$this->setFlux('commentaire', 'Flux de syndication des notes',
'Ce flux fournit des informations sur les mises à jour des notes saisies dans COEL.');
}
private function getServiceListeDesFlux() {
return $this->flux;
}
private function getServiceStructure() {
$elements = array();
$elements = array_merge($elements, $this->getHistoriqueTableStructure(120));
$elements = array_merge($elements, $this->getHistoriqueTableStructure(122));
$elements = array_merge($elements, $this->getHistoriqueTableStructure(123));
$elements = array_merge($elements, $this->getHistoriqueStructureAPersonne());
krsort($elements);
$elements = array_slice($elements, 0, ($this->limit/2));
 
// Création du contenu
$contenu = $this->executerService('cs_nom', $elements);
return $contenu;
}
private function getHistoriqueTableStructure($table_id) {
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' '.
' h1.cmhl_id_historique_ligne, h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_enregistrement, '.
' h1.cmhl_date_modification, h1.cmhl_ce_etat, h1.cmhl_ip, '.
' h1.cmhl_cle_ligne AS guid, '.
" 'str' AS guid_type, ".
(($table_id != 120) ? ' CONCAT(IF (h1.cmhl_ce_table = 122, "Conservation", "Valorisation"), " - ", cs_nom) AS titre, ' : '').
' cp_fmt_nom_complet AS modifier_par '.
'FROM coel_meta_historique_ligne AS h1 '.
' LEFT JOIN coel_meta_historique_ligne AS h2 '.
' ON (h1.cmhl_ce_table = h2.cmhl_ce_table '.
' AND h1.cmhl_cle_ligne = h2.cmhl_cle_ligne '.
' AND h1.cmhl_date_modification <= h2.cmhl_date_modification ) '.
' LEFT JOIN coel_personne ON (h1.cmhl_ce_modifier_par = cp_id_personne) '.
(($table_id != 120) ? ' LEFT JOIN coel_structure ON (cs_id_structure = h1.cmhl_cle_ligne) ' : '').
"WHERE h1.cmhl_ce_table = $table_id %s ".
(($table_id != 120) ? ' AND h1.cmhl_ce_etat != 3 ' : '').
'GROUP BY h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_date_modification '.
'HAVING COUNT(*) = %s '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'h1.cmhl_date_modification DESC').' '.
"LIMIT $this->start,$this->limit ";
$elements = $this->executerRequeteHistorique($requete);
return $elements;
}
private function getHistoriqueStructureAPersonne() {
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' '.
' h1.cmhl_id_historique_ligne, h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_enregistrement, '.
' h1.cmhl_date_modification, h1.cmhl_ce_etat, h1.cmhl_ip, '.
' h1.cmhl_cle_ligne AS guid, '.
" 'csap' AS guid_type, ".
' p1.cp_fmt_nom_complet AS modifier_par, '.
' CONCAT(IF(h1.cmhl_ce_etat = 1, "Ajout", IF (h1.cmhl_ce_etat = 3, "Suppression", "Modification")), " d\'une personne liée à «", s1.cs_nom, "»") AS titre, '.
' CONCAT("Personne «", p2.cp_fmt_nom_complet, "» liée à «", s1.cs_nom, "» avec rôle «", lv1.cmlv_nom, "»") AS description '.
'FROM coel_meta_historique_ligne AS h1 '.
' LEFT JOIN coel_meta_historique_ligne AS h2 '.
' ON (h1.cmhl_ce_table = h2.cmhl_ce_table '.
' AND h1.cmhl_cle_ligne = h2.cmhl_cle_ligne '.
' AND h1.cmhl_date_modification <= h2.cmhl_date_modification ) '.
' LEFT JOIN coel_personne AS p1 ON (h1.cmhl_ce_modifier_par = p1.cp_id_personne) '.
' LEFT JOIN coel_personne AS p2 '.
" ON (SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', 1) = p2.cp_id_personne) ".
' LEFT JOIN coel_structure AS s1 '.
" ON (SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', -1) = s1.cs_id_structure) ".
' LEFT JOIN coel_meta_liste_valeur AS lv1 '.
" ON (SUBSTRING_INDEX(SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', 2), '-', -1) = lv1.cmlv_id_valeur) ".
'WHERE h1.cmhl_ce_table = 121 %s '.
'GROUP BY h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_date_modification '.
'HAVING COUNT(*) = %s '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'h1.cmhl_date_modification DESC').' '.
"LIMIT $this->start,$this->limit ";
 
$elements = $this->executerRequeteHistorique($requete);
return $elements;
}
private function getServiceCollection() {
$elements = array();
$elements = array_merge($elements, $this->getHistoriqueTableCollection(101));
$elements = array_merge($elements, $this->getHistoriqueTableCollection(106));
$elements = array_merge($elements, $this->getHistoriqueCollectionAPersonne());
$elements = array_merge($elements, $this->getHistoriqueCollectionAPublication());
$elements = array_merge($elements, $this->getHistoriqueCollectionACommentaire());
krsort($elements);
$elements = array_slice($elements, 0, ($this->limit/2));
//echo '<pre>'.print_r($elements, true).'</pre>';
// Création du contenu
$contenu = $this->executerService('cc_nom', $elements);
return $contenu;
}
private function getHistoriqueTableCollection($table_id) {
// Reque générale avec paramêtres
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' '.
' h1.cmhl_id_historique_ligne, h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_enregistrement, '.
' h1.cmhl_date_modification, h1.cmhl_ce_etat, h1.cmhl_ip, '.
' h1.cmhl_cle_ligne AS guid, '.
" 'col' AS guid_type, ".
(($table_id == 106) ? ' CONCAT("Botanique", " - ", cc_nom) AS titre, ' : '').
' cp_fmt_nom_complet AS modifier_par '.
'FROM coel_meta_historique_ligne AS h1 '.
' LEFT JOIN coel_meta_historique_ligne AS h2 '.
' ON (h1.cmhl_ce_table = h2.cmhl_ce_table '.
' AND h1.cmhl_cle_ligne = h2.cmhl_cle_ligne '.
' AND h1.cmhl_date_modification <= h2.cmhl_date_modification ) '.
' LEFT JOIN coel_personne ON (h1.cmhl_ce_modifier_par = cp_id_personne) '.
(($table_id == 106) ? ' LEFT JOIN coel_collection ON (cc_id_collection = h1.cmhl_cle_ligne) ' : '').
"WHERE h1.cmhl_ce_table = $table_id %s ".
(($table_id == 106) ? ' AND h1.cmhl_ce_etat != 3 ' : '').
'GROUP BY h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_date_modification '.
'HAVING COUNT(*) = %s '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'h1.cmhl_date_modification DESC').' '.
"LIMIT $this->start,$this->limit ";
$elements = $this->executerRequeteHistorique($requete);
return $elements;
}
private function getHistoriqueCollectionAPersonne() {
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' '.
' h1.cmhl_id_historique_ligne, h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_enregistrement, '.
' h1.cmhl_date_modification, h1.cmhl_ce_etat, h1.cmhl_ip, '.
' p1.cp_fmt_nom_complet AS modifier_par, '.
' h1.cmhl_cle_ligne AS guid, '.
" 'ccap' AS guid_type, ".
' CONCAT(IF(h1.cmhl_ce_etat = 1, "Ajout", IF (h1.cmhl_ce_etat = 3, "Suppression", "Modification")), " d\'une personne liée à «", c1.cc_nom, "»") AS titre, '.
' CONCAT("Personne «", p2.cp_fmt_nom_complet, "» liée à «", c1.cc_nom, "» avec rôle «", lv1.cmlv_nom, "»") AS description '.
'FROM coel_meta_historique_ligne AS h1 '.
' LEFT JOIN coel_meta_historique_ligne AS h2 '.
' ON (h1.cmhl_ce_table = h2.cmhl_ce_table '.
' AND h1.cmhl_cle_ligne = h2.cmhl_cle_ligne '.
' AND h1.cmhl_date_modification <= h2.cmhl_date_modification ) '.
' LEFT JOIN coel_personne AS p1 ON (h1.cmhl_ce_modifier_par = p1.cp_id_personne) '.
' LEFT JOIN coel_personne AS p2 '.
" ON (SUBSTRING_INDEX(SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', 2), '-', -1) = p2.cp_id_personne) ".
' LEFT JOIN coel_collection AS c1 '.
" ON (SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', 1) = c1.cc_id_collection) ".
' LEFT JOIN coel_meta_liste_valeur AS lv1 '.
" ON (SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', -1) = lv1.cmlv_id_valeur) ".
'WHERE h1.cmhl_ce_table = 103 %s '.
'GROUP BY h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_date_modification '.
'HAVING COUNT(*) = %s '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'h1.cmhl_date_modification DESC').' '.
"LIMIT $this->start,$this->limit ";
$elements = $this->executerRequeteHistorique($requete);
return $elements;
}
private function getHistoriqueCollectionAPublication() {
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' '.
' h1.cmhl_id_historique_ligne, h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_enregistrement, '.
' h1.cmhl_date_modification, h1.cmhl_ce_etat, h1.cmhl_ip, '.
' p1.cp_fmt_nom_complet AS modifier_par, '.
' h1.cmhl_cle_ligne AS guid, '.
" 'ccapu' AS guid_type, ".
' CONCAT(IF(h1.cmhl_ce_etat = 1, "Ajout", IF (h1.cmhl_ce_etat = 3, "Suppression", "Modification")), " d\'une publication liée à «", c1.cc_nom, "»") AS titre, '.
' CONCAT("Publication «", p2.cpu_fmt_nom_complet, "» liée à «", c1.cc_nom, "»") AS description '.
'FROM coel_meta_historique_ligne AS h1 '.
' LEFT JOIN coel_meta_historique_ligne AS h2 '.
' ON (h1.cmhl_ce_table = h2.cmhl_ce_table '.
' AND h1.cmhl_cle_ligne = h2.cmhl_cle_ligne '.
' AND h1.cmhl_date_modification <= h2.cmhl_date_modification ) '.
' LEFT JOIN coel_personne AS p1 ON (h1.cmhl_ce_modifier_par = p1.cp_id_personne) '.
' LEFT JOIN coel_publication AS p2 '.
" ON (SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', -1) = p2.cpu_id_publication) ".
' LEFT JOIN coel_collection AS c1 '.
" ON (SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', 1) = c1.cc_id_collection) ".
'WHERE h1.cmhl_ce_table = 104 %s '.
'GROUP BY h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_date_modification '.
'HAVING COUNT(*) = %s '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'h1.cmhl_date_modification DESC').' '.
"LIMIT $this->start,$this->limit ";
$elements = $this->executerRequeteHistorique($requete);
return $elements;
}
private function getHistoriqueCollectionACommentaire() {
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' '.
' h1.cmhl_id_historique_ligne, h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_enregistrement, '.
' h1.cmhl_date_modification, h1.cmhl_ce_etat, h1.cmhl_ip, '.
' p1.cp_fmt_nom_complet AS modifier_par, '.
' h1.cmhl_cle_ligne AS guid, '.
" 'ccacm' AS guid_type, ".
' CONCAT(IF(h1.cmhl_ce_etat = 1, "Ajout", IF (h1.cmhl_ce_etat = 3, "Suppression", "Modification")), " d\'un commentaire lié à «", c1.cc_nom, "»") AS titre, '.
' CONCAT("Commentaire «", c.ccm_titre, "» liée à «", c1.cc_nom, "»") AS description '.
'FROM coel_meta_historique_ligne AS h1 '.
' LEFT JOIN coel_meta_historique_ligne AS h2 '.
' ON (h1.cmhl_ce_table = h2.cmhl_ce_table '.
' AND h1.cmhl_cle_ligne = h2.cmhl_cle_ligne '.
' AND h1.cmhl_date_modification <= h2.cmhl_date_modification ) '.
' LEFT JOIN coel_personne AS p1 ON (h1.cmhl_ce_modifier_par = p1.cp_id_personne) '.
' LEFT JOIN coel_commentaire AS c '.
" ON (SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', -1) = c.ccm_id_commentaire) ".
' LEFT JOIN coel_collection AS c1 '.
" ON (SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', 1) = c1.cc_id_collection) ".
'WHERE h1.cmhl_ce_table = 102 %s '.
'GROUP BY h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_date_modification '.
'HAVING COUNT(*) = %s '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'h1.cmhl_date_modification DESC').' '.
"LIMIT $this->start,$this->limit ";
$elements = $this->executerRequeteHistorique($requete);
return $elements;
}
private function getServicePersonne() {
$elements = array();
$elements = array_merge($elements, $this->getHistoriqueTable(113, 'per'));
$elements = array_merge($elements, $this->getHistoriquePublicationAPersonne());
krsort($elements);
$elements = array_slice($elements, 0, ($this->limit/2));
//echo '<pre>'.print_r($elements, true).'</pre>';
// Création du contenu
$contenu = $this->executerService('cp_fmt_nom_complet', $elements);
return $contenu;
}
private function getHistoriquePublicationAPersonne() {
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' '.
' h1.cmhl_id_historique_ligne, h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_enregistrement, '.
' h1.cmhl_date_modification, h1.cmhl_ce_etat, h1.cmhl_ip, '.
' p1.cp_fmt_nom_complet AS modifier_par, '.
' h1.cmhl_cle_ligne AS guid, '.
" 'cpap' AS guid_type, ".
' CONCAT(IF(h1.cmhl_ce_etat = 1, "Ajout", IF (h1.cmhl_ce_etat = 3, "Suppression", "Modification")), " d\'une publication liée à «", p2.cp_fmt_nom_complet, "»") AS titre, '.
' CONCAT("Publication «", pu.cpu_fmt_nom_complet, "» liée à «", p2.cp_fmt_nom_complet, "» avec rôle «", lv1.cmlv_nom, "»") AS description '.
'FROM coel_meta_historique_ligne AS h1 '.
' LEFT JOIN coel_meta_historique_ligne AS h2 '.
' ON (h1.cmhl_ce_table = h2.cmhl_ce_table '.
' AND h1.cmhl_cle_ligne = h2.cmhl_cle_ligne '.
' AND h1.cmhl_date_modification <= h2.cmhl_date_modification ) '.
' LEFT JOIN coel_personne AS p1 ON (h1.cmhl_ce_modifier_par = p1.cp_id_personne) '.
' LEFT JOIN coel_publication AS pu '.
" ON (SUBSTRING_INDEX(SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', 2), '-', -1) = pu.cpu_id_publication) ".
' LEFT JOIN coel_personne AS p2 '.
" ON (SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', 1) = p2.cp_id_personne) ".
' LEFT JOIN coel_meta_liste_valeur AS lv1 '.
" ON (SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', -1) = lv1.cmlv_id_valeur) ".
'WHERE h1.cmhl_ce_table = 119 '.
' %s '.
" AND SUBSTRING_INDEX(h1.cmhl_cle_ligne, '-', -1) IN (2361,2362,2363) ".
'GROUP BY h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_date_modification '.
'HAVING COUNT(*) = %s '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'h1.cmhl_date_modification DESC').' '.
"LIMIT $this->start,$this->limit ";
$elements = $this->executerRequeteHistorique($requete);
return $elements;
}
private function getServicePublication() {
$elements = array();
$elements = $this->getHistoriqueTable(118, 'pub');
krsort($elements);
$elements = array_slice($elements, 0, ($this->limit/2));
//echo '<pre>'.print_r($elements, true).'</pre>';
// Création du contenu
$contenu = $this->executerService('cpu_fmt_nom_complet', $elements);
return $contenu;
}
private function getServiceCommentaire() {
$elements = array();
$elements = $this->getHistoriqueTable(107, 'com');
krsort($elements);
$elements = array_slice($elements, 0, ($this->limit/2));
//echo '<pre>'.print_r($elements, true).'</pre>';
// Création du contenu
$contenu = $this->executerService('ccm_titre', $elements);
return $contenu;
}
private function getHistoriqueTable($table_id, $guid_type) {
// Reque générale avec paramêtres
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' '.
' h1.cmhl_id_historique_ligne, h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_enregistrement, '.
' h1.cmhl_date_modification, h1.cmhl_ce_etat, h1.cmhl_ip, '.
' h1.cmhl_cle_ligne AS guid, '.
" '$guid_type' AS guid_type, ".
' cp_fmt_nom_complet AS modifier_par '.
'FROM coel_meta_historique_ligne AS h1 '.
' LEFT JOIN coel_meta_historique_ligne AS h2 '.
' ON (h1.cmhl_ce_table = h2.cmhl_ce_table '.
' AND h1.cmhl_cle_ligne = h2.cmhl_cle_ligne '.
' AND h1.cmhl_date_modification <= h2.cmhl_date_modification ) '.
' LEFT JOIN coel_personne ON (h1.cmhl_ce_modifier_par = cp_id_personne) '.
"WHERE h1.cmhl_ce_table = $table_id %s ".
'GROUP BY h1.cmhl_ce_table, h1.cmhl_cle_ligne, h1.cmhl_date_modification '.
'HAVING COUNT(*) = %s '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'h1.cmhl_date_modification DESC').' '.
"LIMIT $this->start,$this->limit ";
$elements = $this->executerRequeteHistorique($requete);
return $elements;
}
private function executerRequete($requete) {
$infos = null;
try {
$infos = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($infos === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
return $infos;
}
private function fusionnerEnregistrements($infos) {
// Fusion des lignes
$elements = array();
foreach ($infos as $info) {
$id = $info['cmhl_ce_table'].'|'.$info['cmhl_cle_ligne'];
if (!isset($elements[$id])) {
$elements[$id] = $info;
} else {
if ($elements[$id]['cmhl_date_modification'] < $info['cmhl_date_modification']) {
$elements[$id] = $this->traiterInfosPrecedentes($info, $elements[$id]);
} else {
$elements[$id] = $this->traiterInfosPrecedentes($elements[$id], $info);
}
}
}
// Nettoyage et utilisation de la date pour pouvoir trier le tableau
$sortie = array();
foreach ($elements as $id => $element) {
$element = $this->nettoyerNomChamps($element);
$id_avec_date = $element['cmhl_date_modification'].'|'.$id;
$sortie[$id_avec_date] = $element;
}
return $sortie;
}
private function executerRequeteHistorique($requete) {
$elements = array();
// Récupération des 1er éléments
$requete_elements_1er = sprintf($requete, '', '1');
$infos_elements_1er = $this->executerRequete($requete_elements_1er);
// Construction de la requête pour récupérer les second éléments
$elements_1er_cle_ligne = array();
foreach ($infos_elements_1er as $info) {
$elements_1er_cle_ligne[] = '"'.$info['cmhl_cle_ligne'].'"';
}
$chaine_1er_elements = 'AND h1.cmhl_cle_ligne IN ('.str_replace(',,',',',implode(',', $elements_1er_cle_ligne)).') ';
$requete_elements_2nd = sprintf($requete, $chaine_1er_elements, '2');
// Récupération des 2nd éléments
$infos_elements_2nd = $this->executerRequete($requete_elements_2nd);
// Fusion des 1er et 2nd éléments
$infos = array_merge($infos_elements_1er, $infos_elements_2nd);
$elements = $this->fusionnerEnregistrements($infos);
return $elements;
}
private function executerService($champ_titre, $elements) {
// Prétraitement des données
$donnees = $this->construireDonneesCommunesAuFlux($elements);
foreach ($elements as $element) {
$xml = $this->getXmlHisto($element);
$enrg = $this->getTableauDepuisXmlHisto($xml);
$diff = $this->getDiffInfos($element);
$diff['differences'] = $this->getDiff($element);
$diff_html = (!is_null($diff['differences'])) ? Coel::traiterSquelettePhp($this->squelette_diff, $diff) : '';
$item = $this->construireDonneesCommunesAuxItems($element);
$item['titre'] = $this->creerTitre($champ_titre, $element, $enrg);
$item['guid'] = sprintf($this->config['coel']['guid'], 'coel:'.$element['guid_type'].$element['guid']);
$item['lien'] = $this->config['coel']['urlBaseFicheConsultation'].urlencode($item['guid']);
$item['description'] = '<p>'.$this->getMessageModif($item).'</p>';
$item['description'] .= $this->creerDescription($element, $enrg);
$item['description'] .= $diff_html;
$item['description'] = $this->nettoyerTexte($item['description']);
$item['description_encodee'] = htmlspecialchars($item['description']);
$donnees['items'][] = $item;
}
// Création du contenu à partir d'un template PHP
$contenu = Coel::traiterSquelettePhp($this->squelette, $donnees);
return $contenu;
}
private function creerTitre($champ, $element, $enrg) {
$titre = '';
if (isset($element['titre'])) {
$titre = $element['titre'];
} else if (isset($element[$champ])) {
$titre = $element[$champ];
} else if (isset($enrg[$champ])) {
$titre = $enrg[$champ];
}
$titre = $this->nettoyerTexte($titre);
return $titre;
}
private function creerDescription($element, $enrg) {
$description = '';
if (isset($element['description'])) {
$description = $element['description'];
}
return $description;
}
private function nettoyerNomChamps($infos) {
$sortie = array();
foreach ($infos as $champ => $valeur) {
if (preg_match('/^__(.+)$/', $champ, $match)) {
$sortie[$match[1]] = $valeur;
} else {
$sortie[$champ] = $valeur;
}
}
return $sortie;
}
private function traiterInfosPrecedentes($infos_courantes, $infos_precedentes) {
$infos_precedentes_traitees = array();
foreach ($infos_precedentes as $champ => $valeur) {
$infos_precedentes_traitees['enrg_prec'] = null;
$infos_precedentes_traitees['date_prec'] = null;
if ($champ == 'cmhl_date_modification') {
$infos_precedentes_traitees['date_prec'] = $valeur;
} else if ($champ == 'cmhl_enregistrement') {
$infos_precedentes_traitees['enrg_prec'] = $valeur;
} else if (preg_match('/^__(.+)$/', $champ, $match)) {
$infos_precedentes_traitees[$match[1].'_prec'] = $valeur;
}
}
$sortie = array_merge($infos_courantes, $infos_precedentes_traitees);
return $sortie;
}
private function nettoyerTexte($txt) {
$txt = preg_replace('/&(?!amp;)/i', '&amp;', $txt, -1);
return $txt;
}
private function getMessageModif($item) {
$message = $item['etat'].' le '.$item['date_maj_simple'].' par '.$item['modifier_par'].' depuis l\'IP '.$item['ip'];
return $message;
}
private function construireDonneesCommunesAuxItems($info) {
$item = array();
$date_modification_timestamp = strtotime($info['cmhl_date_modification']);
$item['date_maj_simple'] = strftime('%A %d %B %Y à %H:%M', $date_modification_timestamp);
$item['date_maj_RSS'] = date(DATE_RSS, $date_modification_timestamp);
$item['date_maj_ATOM'] = date(DATE_ATOM, $date_modification_timestamp);
$item['date_maj_W3C'] = date(DATE_W3C, $date_modification_timestamp);
$item['guid'] = $info['cmhl_id_historique_ligne'];
$item['cle'] = $info['cmhl_cle_ligne'];
$item['ip'] = $info['cmhl_ip'];
$item['modifier_par'] = $info['modifier_par'];
$item['etat'] = isset($info['cmhl_ce_etat']) ? $this->getTexteEtat($info['cmhl_ce_etat']) : '';
return $item;
}
private function getXmlHisto($info) {
$xml = '';
if ($info['cmhl_ce_etat'] == '3') {
$xml = @$info['enrg_prec'];
} else {
$xml = $info['cmhl_enregistrement'];
}
return $xml;
}
private function getDiff($info) {
$diff = null;
if ($info['cmhl_ce_etat'] == '1') {
$nouveau = $this->getTableauDepuisXmlHisto($info['cmhl_enregistrement']);
foreach ($nouveau as $cle => $valeur) {
$diff[$cle] = array('type' => 'A', 'type_txt' => 'Ajout', 'nouveau' => $valeur, 'ancien' => ' ');
}
} else if ($info['cmhl_ce_etat'] == '2') {
$nouveau = $this->getTableauDepuisXmlHisto($info['cmhl_enregistrement']);
$ancien = @$this->getTableauDepuisXmlHisto($info['enrg_prec']);
foreach ($nouveau as $cle => $valeur) {
if (!isset($ancien[$cle])) {
$diff[$cle] = array('type' => 'A', 'type_txt' => 'Ajout', 'nouveau' => $valeur, 'ancien' => ' ');
} else if (isset($ancien[$cle]) && $ancien[$cle] != $valeur) {
$diff[$cle] = array('type' => 'M', 'type_txt' => 'Modification', 'nouveau' => $valeur, 'ancien' => $ancien[$cle]);
}
}
foreach ($ancien as $cle => $valeur) {
if (!isset($nouveau[$cle])) {
$diff[$cle] = array('type' => 'S', 'type_txt' => 'Suppression', 'nouveau' => ' ', 'ancien' => $valeur);
}
}
}
return $diff;
}
private function getDiffInfos($info) {
$diff = null;
$format = '%d/%m/%Y à %H:%M:%S';
if ($info['cmhl_ce_etat'] == '1') {
$diff['date_nouvelle'] = strftime($format, strtotime($info['cmhl_date_modification']));
$diff['date_ancienne'] = '';
$diff['etat'] = 'A';
} else if ($info['cmhl_ce_etat'] == '2') {
$diff['date_nouvelle'] = strftime($format, strtotime($info['cmhl_date_modification']));
$diff['date_ancienne'] = @strftime($format, strtotime($info['date_prec']));
$diff['etat'] = 'M';
} else if ($info['cmhl_ce_etat'] == '3') {
$diff['etat'] = 'S';
}
return $diff;
}
private function getTexteEtat($code) {
$etat = '';
switch ($code) {
case '1' :
$etat = 'Ajouté';
break;
case '2' :
$etat = 'Modifié';
break;
case '3' :
$etat = 'Supprimé';
break;
default :
$etat = '!Problème!';
$e = "Le champ cmhl_ce_etat possède une valeur innatendue : $code";
$this->messages[] = $e;
}
return $etat;
}
private function construireDonneesCommunesAuFlux($infos) {
$donnees = $this->getFlux($this->service);
$donnees['guid'] = $this->getUrlServiceBase();
$donnees['lien_service'] = htmlentities($this->creerUrlService());
$donnees['lien_coel'] = $this->config['coel']['urlBaseCoel'];
$donnees['editeur'] = $this->config['coel']['editeur'];
$derniere_info_en_date = reset($infos);
$date_modification_timestamp = strtotime($derniere_info_en_date['cmhl_date_modification']);
$donnees['date_maj_RSS'] = date(DATE_RSS, $date_modification_timestamp);
$donnees['date_maj_ATOM'] = date(DATE_ATOM, $date_modification_timestamp);
$donnees['date_maj_W3C'] = date(DATE_W3C, $date_modification_timestamp);
$donnees['annee_courante'] = date('Y');
$donnees['generateur'] = 'COEL - Jrest';
preg_match('/([0-9]+)/', '$Revision: 381 $', $match);
$donnees['generateur_version'] = $match[1];
return $donnees;
}
private function creerUrlService() {
$url_service = $this->getUrlServiceBase();
if (isset($this->start) || isset($this->limit)) {
$arguments = array();
if (isset($this->start) && isset($_GET['start'])) {
$arguments[] = 'start='.$this->start;
}
if (isset($this->limit) && isset($_GET['limit'])) {
$arguments[] = 'limit='.($this->limit/2);
}
if (count($arguments) > 0) {
$url_service .= '?'.implode('&', $arguments);
}
}
return $url_service;
}
}
/tags/v1.11-okuzgozu/jrest/services/CoelPublicationAPersonne.php
New file
0,0 → 1,287
<?php
/**
* Service fournissant la liste des relations "publication à personne".
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @category PHP 5.2
* @package jrest
* @author Aurélien PERONNET <aurelien@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright © 2009, Tela Botanica
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @link /doc/jrest/
*/
class CoelPublicationAPersonne extends Coel {
const ROLE_AUTEUR = 2360;
/** Contient les infos sur les tables gérées par ce service.
* Bien respecter l'ordre avec en premier les tables liées et en dernier la table établissant la relation. */
protected $tables = array( 119 => array( 'nom' => 'coel_publication_a_personne',
'prefixe' => 'cpuap',
'id' => array('cpuap_id_personne', 'cpuap_id_publication', 'cpuap_id_role')));
 
/**
* Méthode appelée avec une requête de type GET.
*/
public function getElement($param = array()) {
// Initialisation des variables
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_publication', 'id_personne', 'id_role'), $param, false);
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT ' : 'SELECT ').
' cpu.*, cpuap.*, cp_id_personne, cp_prenom, cp_nom, cp_fmt_nom_complet, cp_code_postal, cp_truk_courriel, cp_ville '.
'FROM coel_publication_a_personne AS cpuap '.
' LEFT JOIN coel_meta_historique_ligne ON (cpuap_ce_meta = cmhl_id_historique_ligne) '.
' LEFT JOIN coel_personne AS cp ON (cpuap_id_personne = cp_id_personne) '.
' LEFT JOIN coel_publication AS cpu ON (cpuap_id_publication = cpu_id_publication) '.
((count($p) != 0) ? 'WHERE ' : '').
(isset($p['id_personne']) ? "AND cpuap_id_personne IN ({$p['id_personne']}) " : '').
(isset($p['id_publication']) ? "AND cpuap_id_publication = '{$p['id_publication']}' " : '').
(isset($p['id_role']) ? "AND cpuap_id_role IN ({$p['id_role']}) " : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cpuap_ce_meta DESC').' ';
$requete = str_replace('WHERE AND', 'WHERE', $requete);
$requeteCount = $requete;
$requete .= "LIMIT $this->start, $this->limit ";
// Récupération des résultats
try {
$donnees = (count($p) == 3) ? $this->bdd->query($requete)->fetch(PDO::FETCH_OBJ) : $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête n'a retourné aucun résultat.";
}
$nbElements = $this->bdd->query($requeteCount)->rowCount();
$info['nbElements'] = $nbElements;
$info['publicationsAPersonne'] = $donnees;
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
 
// Envoie sur la sortie standard
$this->envoyer($info);
}
 
/**
* Méthode appelée pour ajouter un élément.
*/
public function createElement($params) {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
 
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
$auteurs = $role = $ordre_des_auteurs = $publications = array();
// Traitement spécial pour ajouter plusieurs personnes liées à une publication à la fois...
if (isset($params['cpuap_id_auteur'])) {
$auteurs = explode(',', $params['cpuap_id_auteur']);
unset($params['cpuap_id_auteur']);
}
if (isset($params['cpuap_id_role'])) {
$role = explode(',', $params['cpuap_id_role']);
}
if (isset($params['cpuap_ordre'])) {
$ordre_des_auteurs = explode(',', $params['cpuap_ordre']);
unset($params['cpuap_ordre']);
}
// Traitement spécial pour ajouter plusieurs publications liées à une personne à la fois...
if (isset($params['cpuap_id_publication'])) {
$publications = explode(',', $params['cpuap_id_publication']);
if (count($publications) > 1) {
unset($params['cpuap_id_publication']);
}
}
if (count($auteurs) != 0 || count($publications) != 0) {
// Formulaire Publication : nous lions des auteurs à une publication
// Cas où il y a une seule publication et un ou plusieurs auteurs ; c'est donc une liaison d'une publi a plusieurs personne avec le role "auteur"
if (count($auteurs) >= 1 && count($publications) == 1 && (count($role) == 1 && $role[0] == self::ROLE_AUTEUR)) {
$compteur = 0;
foreach ($auteurs as $params['cpuap_id_personne']) {
$params['cpuap_ordre'] = $ordre_des_auteurs[$compteur++];
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
// Nous ne pouvons pas utiliser foreach car il travaille sur une copie du tableau or nous le modifions dynamiquement dans la boucle
reset($tables_a_modifier);
while (list($table_id, $table) = each($tables_a_modifier)) {
if (!is_null($table['champs'])) {
try {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
}
}
}
}
// Formulaire Personne : nous lions des publications à une personne
// Cas où il y a plusieurs publications ; c'est donc une liaison de plusieurs publis a une personne avec n roles
else if (count($auteurs) == 1 && count($publications) >= 1 && (count($role) > 1 || (count($role) == 1 && $role[0] != self::ROLE_AUTEUR)) ) {
$params['cpuap_id_personne'] = $auteurs[0];
for ($i = 0; $i < count($publications); $i++ ) {
$params['cpuap_id_publication'] = $publications[$i];
$params['cpuap_id_role'] = $role[$i];
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
// Nous ne pouvons pas utiliser foreach car il travaille sur une copie du tableau or nous le modifions dynamiquement dans la boucle
reset($tables_a_modifier);
while (list($table_id, $table) = each($tables_a_modifier)) {
if (!is_null($table['champs'])) {
try {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
}
}
}
}
} else {
$this->messages[] = "Aucun identifiant d'auteur ou de publication fournis";
}
} else {
$this->messages[] = "Il faut être identifié pour accéder à ce service";
}
 
// Envoie sur la sortie standard
$this->envoyer();
}
 
/**
* Méthode appelée pour mettre à jour un élément
*/
public function updateElement($uid, $params) {
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) && !isset($uid[1]) && !isset($uid[2])) {
$this->messages[] = 'Aucun identifiant de publication, personne et role a été passé. Vous ne devriez pas avoir accès à ce service.';
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
$id_publication = $params['cpuap_id_publication'];
$auteurs = explode(',', $params['cpuap_id_auteur']);
$id_role = $params['cpuap_id_role'];
$ordre = explode(',', $params['cpuap_ordre']);
if (count($auteurs) != 0 && $params['cpuap_id_publication'] != '') {
$compteur = 0;
foreach ($auteurs as $auteur) {
$params = array('cpuap_id_publication' => $id_publication,
'cpuap_id_personne' => $auteur,
'cpuap_id_role' => $id_role,
'cpuap_ordre' => $ordre[$compteur++]);
$tables_a_modifier = $this->recupererTablesAModifier($params);
$table = $tables_a_modifier[119];
 
if ($this->avoirEnregistrement($table)) {
$resultat = $this->supprimer($table);
if ($resultat === true) {
// Historisation (Ajout des méta-données)
$cle = $this->recupererCle($table);
$this->historiser(119, $cle, 'NULL', $id_utilisateur, 3, $id_session);
}
}
reset($tables_a_modifier);
while (list($table_id, $table) = each($tables_a_modifier)) {
if (!is_null($table['champs'])) {
try {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
}
} else {
$this->messages[] = "Aucun identifiant d'auteur et de publication fournis";
}
} else {
$this->messages[] = "Il faut être identifié pour accéder à ce service";
}
}
 
// Envoie sur la sortie standard
$this->envoyer();
}
 
/**
* Méthode appelée pour supprimer un élément
*/
public function deleteElement($uid) {
// NOTES : la suppression ne supprime pas les personnes mais seulements les relations
 
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) || !isset($uid[1])) {
$this->messages[] = "Identifiant de relations ou d'utilisateur manquant. Vous ne devriez pas avoir accès à ce service.";
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($uid[0]);
 
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Récupération des identifiant à supprimer
$identifiants = array();
$identifiants_agreges = explode(',', rtrim($uid[1], ','));
foreach ($identifiants_agreges as $identifiant) {
$identifiants[] = explode('-', $identifiant);
}
if (count($identifiants) == 0) {
$this->messages[] = "Aucun enregistrement n'a été supprimé.";
} else {
try {
foreach ($identifiants as $id) {
if (count($id) == 1) { // Seulement des id de publication
// Suppression en une seule fois toutes les relations d'une publication
$params = array('cpuap_id_publication' => $id[0]);
} else if (count($id) == 3) { // Tous les id...
// Suppression d'une seule relation particulière
$params = array('cpuap_id_publication' => $id[0], 'cpuap_id_personne' => $id[1], 'cpuap_id_role' => $id[2]);
}
$tables_a_modifier = $this->recupererTablesAModifier($params);
$table = $tables_a_modifier[119];
 
if ($this->avoirEnregistrement($table)) {
$resultat = $this->supprimer($table);
if ($resultat === true) {
// Historisation (Ajout des méta-données)
$cle = $this->recupererCle($table);
$this->historiser(119, $cle, 'NULL', $id_utilisateur, 3, $id_session);
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
}
 
// Envoie sur la sortie standard
$this->envoyer();
}
}
?>
/tags/v1.11-okuzgozu/jrest/services/CoelCollectionAPublication.php
New file
0,0 → 1,187
<?php
/**
* Service fournissant la liste des relations "structure à personne".
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
class CoelCollectionAPublication extends Coel {
 
/** Contient les infos sur les tables gérées par ce service.
* Bien respecter l'ordre avec en premier les tables liées et en dernier la table établissant la relation. */
protected $tables = array( 104 => array( 'nom' => 'coel_collection_a_publication',
'prefixe' => 'ccapu',
'id' => array('ccapu_id_collection', 'ccapu_id_publication')));
 
/**
* Méthode appelée avec une requête de type GET.
*/
public function getElement($param = array()) {
// Initialisation des variables
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_collection','source'), $param);
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT ' : 'SELECT ').
' ccapu.*, cpu.*, cs.* '.
'FROM coel_collection_a_publication AS ccapu '.
' LEFT JOIN coel_meta_historique_ligne ON (ccapu_ce_meta = cmhl_id_historique_ligne) '.
' LEFT JOIN coel_publication AS cpu ON (ccapu_id_publication = cpu_id_publication) '.
' LEFT JOIN coel_structure AS cs ON (cs_id_structure = cpu_ce_truk_editeur) '.
((count($p) != 0) ? 'WHERE ' : '').
(isset($p['id_collection']) ? "AND ccapu_id_collection = {$p['id_collection']} " : '').
(isset($p['source']) ? "AND ccapu_source = {$p['source']} " : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'ccapu_ce_meta DESC').' ';
$requete = str_replace('WHERE AND', 'WHERE', $requete);
$requeteCount = $requete;
$requete .= "LIMIT $this->start, $this->limit ";
//echo $requete;exit;
// Récupération des résultats
try {
$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
$nbElements = $this->bdd->query($requeteCount)->rowCount();
$info['nbElements'] = $nbElements;
$info['collectionsAPublication'] = $donnees;
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
// Envoie sur la sortie standard
$this->envoyer($info);
}
/**
* Méthode appelée pour ajouter un élément.
*/
public function createElement($params) {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
try {
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
// Nous ne pouvons pas utiliser foreach car il travaille sur une copie du tableau or nous le modifions dynamiquement dans la boucle
reset($tables_a_modifier);
while (list($table_id, $table) = each($tables_a_modifier)) {
if (!is_null($table['champs'])) {
if (!$this->avoirCleComplete($table)) {
$this->messages[] = 'Il est nécessaire de fournir toutes les clés à ce service.';
} else {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
}
// Envoie sur la sortie standard
$this->envoyer();
}
/**
* Méthode appelée pour mettre à jour un élément
*/
public function updateElement($uid, $params) {
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) && !isset($uid[1])) {
$this->messages[] = 'Aucun identifiant de collection a été passé. Vous ne devriez pas avoir accès à ce service.';
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
try {
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
foreach ($tables_a_modifier as $table_id => $table) {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
// Envoie sur la sortie standard
$this->envoyer();
}
/**
* Méthode appelée pour supprimer un ou plusieurs éléments
*/
public function deleteElement($uid) {
// NOTES : la suppression ne supprime pas les personnes mais seulements les relations
 
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) || !isset($uid[1])) {
$this->messages[] = "Identifiant de relations ou d'utilisateur manquant. Vous ne devriez pas avoir accès à ce service.";
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($uid[0]);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Récupération des identifiant à supprimer
$identifiants = array();
$identifiants_agreges = explode(',', rtrim($uid[1], ','));
foreach ($identifiants_agreges as $identifiant) {
$identifiants[] = explode('-', $identifiant);
}
if (count($identifiants) == 0) {
$this->messages[] = "Aucun enregistrement n'a été supprimé.";
} else {
try {
foreach ($identifiants as $id) {
if (count($id) == 1) { // Seulement des id de collection
$params = array('ccapu_id_collection' => $id[0]);
} else if (count($id) == 2) { // Tous les id...
$params = array('ccapu_id_collection' => $id[0], 'ccapu_id_publication' => $id[1]);
}
$tables_a_modifier = $this->recupererTablesAModifier($params);
$table = $tables_a_modifier[104];
if ($this->avoirEnregistrement($table)) {
$resultat = $this->supprimer($table);
if ($resultat === true) {
// Historisation (Ajout des méta-données)
$cle = $this->recupererCle($table);
$this->historiser(104, $cle, 'NULL', $id_utilisateur, Coel::ETAT_SUPPRIMER, $id_session);
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
}
// Envoie sur la sortie standard
$this->envoyer();
}
}
?>
/tags/v1.11-okuzgozu/jrest/services/CoelRecherche.php
New file
0,0 → 1,495
<?php
/**
* Service fournissant des informations sur les collections et les structures répondant aux critères de recherche
* fournis en paramètre.
*
* @author Mathias Chouet
* @author Raphaël Droz <raphael@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @copyright 2009, 2013 Tela-Botanica
*/
class CoelRecherche extends Coel {
protected $fromClause = array();
protected $whereClause = array();
protected $joinClause = array();
 
/**
* Méthode principale appelée avec une requête de type GET.
* Elle sert d'aiguilleur pour appeller la méthode correspondant au type de recherche passé en paramêtre.
*/
public function getElement($param = array()) {
// Initialisation des variables
$info = array();
// Nous recherchons le type de requête demandé
$type = $param[0];
$methode = 'getElement'.$type;
 
if (method_exists($this, $methode)) {
array_shift($param);
$info = $this->$methode($param);
} else {
$this->messages[] = "Le type de recherche demandé '$type' n'est pas disponible.";
}
// Envoie sur la sortie standard
if($this->formatRetour == 'text/plain') {
$this->envoyer($info, 'text/plain', 'utf-8', false);
exit;
}
$this->envoyer($info);
}
 
/** @deprecated retro-compatibilité */
public function getElementParDefaut($param) {
return $this->getElementCollections($param);
}
/** @deprecated retro-compatibilité */
public function getElementNombre($param) {
return $this->getElementNombreCollections($param);
}
 
/**
* Retourne les collections correspondant aux critères de recherche
*/
public function getElementCollections($param) {
// Pré traitement des paramêtres
$p = $this->pretraiterParametresUrlCollections($param, $_GET);
 
// Construction des clauses
self::construireFromEtWhereCollections($p);
 
// Construction de la requête
$champs = "cs_id_structure, cs_ville, cs_nom, cs_code_postal, cs_latitude, cs_longitude, cc_id_collection, cc_nom";
$this->orderby = is_null($this->orderby) ? 'cs_ville ASC, cs_nom ASC, cc_nom ASC' : $this->orderby;
$requete = $this->assemblerRequete($champs);
 
$info =$this->lancerRequete($requete);
return $info;
}
 
/**
* Retourne le nombre de collections correspondant aux critères de recherche
*/
public function getElementNombreCollections($param) {
// Pré traitement des paramêtres
$p = $this->pretraiterParametresUrlCollections($param, $_GET);
 
// Construction des clauses
self::construireFromEtWhereCollections($p);
// Construction de la requête
// Il est important de compter le nombre d'association structure-collection différentes pour obtenir le bon nombre
// @WTF si on compte(*) on a le nombre d'associations structure-collection
// si on compte(cs_id_structure) on a le nombre d'associations structure-collection dont la structure n'est pas null
// en aucun cas on n'a le nombre d'association structure-collection DIFFERENTES, à moins de faire un distinct, ce qui n'est pas le cas ici
// @AMHA on devrait compter(*) car la recherche de collections renvoie même celles qui ont une structure null
$champs = 'COUNT(*) AS nbre, cc_id_collection ';
$this->orderby = is_null($this->orderby) ? 'cs_ville ASC, cs_nom ASC, cc_nom ASC' : $this->orderby;
$requete = $this->assemblerRequete($champs);
 
$info = $this->lancerRequeteNombre($requete);
 
return $info;
}
 
/**
* Retourne les personnes correspondant aux critères de recherche
*/
public function getElementPersonnes($param) {
// Pré traitement des paramêtres
$p = $this->pretraiterParametresUrlPersonnes($param, $_GET);
 
// Construction des clauses
self::construireFromEtWherePersonnes($p);
$champs = 'cp_id_personne, cp_fmt_nom_complet, cp_prenom, cp_nom, cp_truk_nom_autre, cp_adresse_01, cp_ville, cp_naissance_date, cp_deces_date';
$this->orderby = is_null($this->orderby) ? 'cp_nom ASC, cp_prenom ASC' : $this->orderby;
$requete = $this->assemblerRequete($champs);
$info = $this->lancerRequete($requete);
return $info;
}
 
/**
* Retourne le nombre de personnes correspondant aux critères de recherche
*/
public function getElementNombrePersonnes($param) {
// Pré traitement des paramêtres
$p = $this->pretraiterParametresUrlPersonnes($param, $_GET);
 
// Construction des clauses
self::construireFromEtWherePersonnes($p);
$this->orderby = is_null($this->orderby) ? 'cp_nom ASC, cp_prenom ASC' : $this->orderby;
$champs = 'count(*) as nbre';
// Construction de la requête
$requete = $this->assemblerRequete($champs);
$info = $this->lancerRequeteNombre($requete);
return $info;
}
/**
* Retourne les publications correspondant aux critères de recherche
*/
public function getElementPublications($param) {
// Pré traitement des paramêtres
$p = $this->pretraiterParametresUrlPublications($param, $_GET);
// Construction des clauses
self::construireFromEtWherePublications($p);
$champs = '*';
$this->orderby = is_null($this->orderby) ? 'cpu_fmt_auteur ASC' : $this->orderby;
$requete = $this->assemblerRequete($champs);
$info = $this->lancerRequete($requete);
return $info;
}
/**
* Retourne le nombre de personnes correspondant aux critères de recherche
*/
public function getElementNombrePublications($param) {
// Pré traitement des paramêtres
$p = $this->pretraiterParametresUrlPublications($param, $_GET);
// Construction des clauses
self::construireFromEtWherePublications($p);
$this->orderby = is_null($this->orderby) ? 'cpu_fmt_auteur ASC' : $this->orderby;
$champs = 'count(*) as nbre';
// Construction de la requête
$requete = $this->assemblerRequete($champs);
$info = $this->lancerRequeteNombre($requete);
return $info;
}
private function assemblerRequete($champs) {
// Construction de la requête
$requete = sprintf(
'SELECT %s %s'
. ' FROM %s %s'
. ' WHERE %s ORDER BY %s %s -- %s:%d',
$this->distinct ? 'DISTINCT' : '',
$champs,
implode(',', $this->fromClause),
implode(' ', $this->joinClause),
$this->whereClause ? implode(" AND ", $this->whereClause) : TRUE,
$this->orderby,
$this->limit != -1 ? "LIMIT {$this->start}, {$this->limit}" : "",
__FILE__,
__LINE__
);
//echo "REQUETE: " . $requete;
//exit;
return $requete;
}
private function lancerRequete($requete) {
$info = array();
// Récupération des résultats
try {
$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête n'a retourné aucun résultat.";
} else {
$info = $donnees;
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
return $info;
}
private function lancerRequeteNombre($requete) {
$info = array();
// Récupération des résultats
try {
$donnees = $this->bdd->query($requete)->fetch(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête n'a retourné aucun résultat.";
} else {
$info = $donnees['nbre'];
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
return $info;
}
 
// Voici les paramètres qu'il faut passer au service Collections, tous et dans l'ordre (soit une valeur soit '*')
private function pretraiterParametresUrlCollections($param, $qs) {
$params_passes = array(
'mots' => 'str',
'sci' => 'bool',
'bot' => 'int',
'lieu-stockage' => 'str',
'zg' => 'str',
'p' => 'str',
'pr' => 'int',
'str-d' => 'frdepliste',
'veg' => 'int'
);
return $this->pretraiterParametresUrl($param, $qs, $params_passes);
}
 
// Voici les paramètres qu'il faut passer au service Personnes, tous et dans l'ordre (soit une valeur soit '*')
private function pretraiterParametresUrlPersonnes($param, $qs) {
$params_passes = array(
'nom-famille' => 'str',
'adresse' => 'str',
'date-vivant' => 'int'
);
return $this->pretraiterParametresUrl($param, $qs, $params_passes);
}
// Voici les paramètres qu'il faut passer au service Personnes, tous et dans l'ordre (soit une valeur soit '*')
private function pretraiterParametresUrlPublications($param, $qs) {
$params_passes = array(
'libre' => 'str',
'titre' => 'str',
'auteur' => 'str',
'mot-cle' => 'str',
'ouvrage' => 'str',
'date' => 'str'
);
return $this->pretraiterParametresUrl($param, $qs, $params_passes);
}
 
private function pretraiterParametresUrl($param, $qs, $params_passes) {
$p = $this->traiterParametresUrl(array_keys($params_passes), $param, false);
$this->debug[] = $param;
foreach ($params_passes as $param_passe => $type) {
if (isset($p[$param_passe])) {
// Suppression des éventuels espaces en début et fin de chaine
$valeur = trim($p[$param_passe]);
// Type de paramêtre chaine
if ($type == 'str') {
// Suppression des slash
$valeur = stripslashes($valeur);
// Utilisation d'une recherche de chaîne exacte
if (preg_match('/^"(.*)"$/', $valeur, $match)) {
$valeur = '%'.$match[1].'%';
} else {
// Recherche de mots non liés
$mots = explode(' ', $valeur);
$valeur = '%'.implode ('%', $mots).'%';
}
// Mise en place des quotes pour l'intérogation dans la bdd
$valeur = $this->bdd->quote($valeur);
}
// Type de paramêtre booléen
if ($type == 'bool') {
if (preg_match('/^[0]$/', $valeur)) {
$valeur = false;
} else if (preg_match('/^[1]$/', $valeur)) {
$valeur = true;
} else {
$this->messages[] = "Le paramêtre '$param_passe' attend une valeur de type 0 ou 1 et non '$valeur'.";
$valeur = null;
}
}
// Type de paramêtre entier
if ($type == 'int') {
if (!preg_match('/^(?:[0-9]+,\s*)*[0-9]+$/', $valeur)) {
$this->messages[] = "Le paramêtre '$param_passe' attend une ou plusieurs valeurs de type entiers ".
"séparés par des virgules et non '$valeur'.";
$valeur = null;
}
}
 
if ($type == 'frdepliste') {
$valeur = array_filter(explode(',', $valeur), create_function('$val', 'return preg_match("/^(\d+|2A|2B)$/i", $val);'));
}
 
$p[$param_passe] = $valeur;
}
}
 
if(isset($qs['pays'])) {
$p['pays'] = array_filter(explode(',', $qs['pays']), create_function('$val', 'return preg_match("/^[A-Z][A-Z]$/", $val);'));
if(!$p['pays']) unset($p['pays']);
}
 
return $p;
}
 
// construit les clauses FROM et WHERE pour la recherche de collections (#CaptainObvious)
private function construireFromEtWhereCollections($p) {
$this->fromClause = array('coel_collection');
$this->joinClause = array('LEFT JOIN coel_structure ON (cc_ce_structure = cs_id_structure)');
$this->whereClause = array();
 
// Gestion du from en fonction des paramêtres
if (isset($p['str-d'])) {// ATTENTION : Remplace $this->fromClause, doit être situé en première position!
$this->fromClause = array('coel_structure');
$this->joinClause = array('LEFT JOIN coel_collection ON (cs_id_structure = cc_ce_structure)');
}
// Construire from et where en fonction des paramêtres
if (isset($p['mots'])) {
$this->whereClause[] = '(' . implode(' OR ', array(
"cc_nom LIKE {$p['mots']}",
"cc_truk_nom_alternatif LIKE {$p['mots']}",
"cc_truk_code LIKE {$p['mots']}",
"cc_description LIKE {$p['mots']}",
"cc_description_specialiste LIKE {$p['mots']}",
"cc_historique LIKE {$p['mots']}",
"cs_nom LIKE {$p['mots']}",
"cs_truk_nom_alternatif LIKE {$p['mots']}",
"cs_description LIKE {$p['mots']}",
"cs_adresse_01 LIKE {$p['mots']}",
"cs_ville LIKE {$p['mots']}",
"cs_truk_identifiant_alternatif LIKE {$p['mots']}",
"cs_condition_acces LIKE {$p['mots']}",
"cs_condition_usage LIKE {$p['mots']}",
"cs_truk_telephone LIKE {$p['mots']}",
"cs_courriel LIKE {$p['mots']}",
"cs_truk_url LIKE {$p['mots']}")) . ')';
}
 
if (isset($p['sci'])) {
if ($p['sci'] === true) {
$this->whereClause[] = 'csv_mark_visite_avec_motif = 1';
} else if ($p['sci'] === false) {
$this->whereClause[] = 'csv_mark_acces_ss_motif = 1';
}
}
if (isset($p['bot'])) {
$this->whereClause[] = "ccb_ce_truk_type IN ({$p['bot']})";
}
if (isset($p['lieu-stockage'])) {
$this->joinClause[] = 'LEFT JOIN coel_meta_liste_valeur cmlv ON cmlv.cmlv_id_valeur = cs_ce_truk_pays';
$this->whereClause[] = '(' . implode(' OR ', array(
"cs_adresse_01 LIKE {$p['lieu-stockage']}",
"cs_code_postal LIKE {$p['lieu-stockage']}",
"cs_ville LIKE {$p['lieu-stockage']}",
"cs_ce_truk_pays LIKE {$p['lieu-stockage']}",
"cmlv.cmlv_nom LIKE {$p['lieu-stockage']}",
)) . ')';
}
if (isset($p['zg'])) {
$this->whereClause[] = "cc_truk_couverture_lieu LIKE {$p['zg']}";
}
if (isset($p['p'])) {
$this->whereClause[] = "cp_fmt_nom_complet LIKE {$p['p']}";
}
if (isset($p['pr'])) {
$this->whereClause[] = "ccap_id_role IN ({$p['pr']})";
}
 
// par défaut, spécifier un département restreint à la France
// TODO: INNER JOIN
if (isset($p['str-d'])) {
$this->joinClause[] = 'LEFT JOIN coel_meta_liste_valeur cv ON cv.cmlv_id_valeur = cs_ce_truk_pays';
$this->whereClause[] = "cv.cmlv_abreviation IN ('FR', 'RE', 'YT', 'GP', 'MQ', 'GF', 'NC')";
$this->whereClause[] = sprintf("cs_code_postal REGEXP '^(%s).*'", implode('|', $p['str-d']));
}
 
if (isset($p['pays'])) {
if(array_search('FR', $p['pays']) !== FALSE) $p['pays'] = array_merge($p['pays'], array('RE','YT','GP','MQ','GF','NC'));
$this->joinClause[] = 'LEFT JOIN coel_meta_liste_valeur cv ON cv.cmlv_id_valeur = cs_ce_truk_pays';
$this->whereClause[] = sprintf('cv.cmlv_abreviation IN ("%s")', implode('","', $p['pays']));
}
 
if (isset($p['veg'])) {
$veg = explode(',', $p['veg']);
$veg_nbre = count($veg);
if ($veg_nbre == 1) {
$this->whereClause[] = "ccb_truk_nature LIKE '%{$p['veg']}%'";
} else {
$recherche = array();
foreach ($veg as $id) {
$recherche[] = "ccb_truk_nature LIKE '%$id%'";
}
$this->whereClause[] = '('.implode(' OR ', $recherche).') ';
}
}
 
if (isset($p['sci'])) {
$this->joinClause[] = 'LEFT JOIN coel_structure_valorisation ON (cs_id_structure = csv_id_structure)';
}
if (isset($p['bot']) || isset($p['veg'])) {
$this->joinClause[] = 'LEFT JOIN coel_collection_botanique ON (cc_id_collection = ccb_id_collection)';
}
if (isset($p['p']) || isset($p['pr'])) {
$this->joinClause[] = 'LEFT JOIN coel_collection_a_personne ON (cc_id_collection = ccap_id_collection)';
}
if (isset($p['p'])) {
$this->joinClause[] = 'LEFT JOIN coel_personne ON (ccap_id_personne = cp_id_personne)';
}
 
$this->joinClause = array_unique($this->joinClause);
}
 
// construit les clauses FROM et WHERE pour la recherche de personnes (#CaptainObvious)
private function construireFromEtWherePersonnes($p) {
$this->fromClause = array('coel_personne');
$this->joinClause = array();
$this->whereClause = array();
 
//"cp_truk_recolte LIKE {$p['adresse']}", // Inclure le lieu de récolte ?
 
if (isset($p['nom-famille'])) {
$this->whereClause[] = "cp_nom LIKE {$p['nom-famille']}";
}
if (isset($p['adresse'])) {
$this->joinClause[] = 'LEFT JOIN coel_meta_liste_valeur cmlv ON cmlv.cmlv_id_valeur = cp_ce_truk_pays';
$this->whereClause[] = '(' . implode(' OR ', array(
"cp_adresse_01 LIKE {$p['adresse']}",
"cp_code_postal LIKE {$p['adresse']}",
"cp_ville LIKE {$p['adresse']}",
"cp_ce_truk_pays LIKE {$p['adresse']}",
"cp_naissance_lieu LIKE {$p['adresse']}",
"cp_deces_lieu LIKE {$p['adresse']}",
"cmlv.cmlv_nom LIKE {$p['adresse']}",
)) . ')';
}
if (isset($p['date-vivant'])) {
$this->whereClause[] = "cp_naissance_date <= {$p['date-vivant']}";
$this->whereClause[] = "cp_deces_date >= {$p['date-vivant']}";
$this->whereClause[] = "cp_naissance_date IS NOT NULL";
$this->whereClause[] = "cp_deces_date IS NOT NULL";
//$this->whereClause[] = "(cp_deces_date IS NULL OR cp_deces_date >= {$p['date-vivant']})";
}
 
// pour inclure éventuellement les adresses de la structure
/*if (isset($p['adresse'])) {
$this->joinClause[] = 'JOIN coel_structure_a_personne ON (cp_id_personne = csap_id_personne)';
$this->joinClause[] = 'JOIN coel_structure ON (cs_id_structure = csap_id_structure)';
}*/
$this->joinClause = array_unique($this->joinClause);
}
// construit les clauses FROM et WHERE pour la recherche de publications (#CaptainObvious)
private function construireFromEtWherePublications($p) {
$this->fromClause = array('coel_publication');
$this->joinClause = array();
$this->whereClause = array();
 
if (isset($p['libre'])) {
$this->whereClause[] = "cpu_fmt_nom_complet LIKE {$p['libre']}";
}
if (isset($p['titre'])) {
$this->whereClause[] = "cpu_titre LIKE {$p['titre']}";
}
if (isset($p['auteur'])) {
$this->whereClause[] = "cpu_fmt_auteur LIKE {$p['auteur']}";
}
if (isset($p['mot-cle'])) {
$this->whereClause[] = "cpu_resume_mot_cle LIKE {$p['mot-cle']}";
}
if (isset($p['ouvrage'])) {
$this->whereClause[] = "cpu_collection LIKE {$p['ouvrage']}";
}
if (isset($p['date'])) {
$this->whereClause[] = "cpu_date_parution LIKE {$p['date']}";
}
}
}
/tags/v1.11-okuzgozu/jrest/services/CoelPersonne.php
New file
0,0 → 1,266
<?php
/**
* Service fournissant la liste des personnes et leurs informations
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @author Grégoire duché <gregoire@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
class CoelPersonne extends Coel {
 
protected $tables = array( 113 => array('nom' => 'coel_personne',
'prefixe' => 'cp',
'id' => array('cp_id_personne')));
/**
* Méthode appelée avec une requête de type GET.
*
* Liste des paramètres :
* /Personne_Id/Nom_Complet/
* Attention : pour avoir toutes les personnes, il faut éxécuter : CoelPersonneListe
* Pour avoir toutes les personnes dont le nom complet comment par NomComplet il faut éxécuter : CoelPersonneListe/* /NomComplet
*/
function getElement($param = array()) {
// Initialisation de variables
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_personne', 'recherche'), $param);
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' cp.*, '.
' cmhl_date_modification, cmhl_notes, cmhl_source, cmhl_ce_modifier_par, cmhl_ce_etat, cmhl_ip '.
'FROM coel_personne AS cp '.
' LEFT JOIN coel_meta_historique_ligne ON (cp_ce_meta = cmhl_id_historique_ligne) '.
((count($p) != 0) ? 'WHERE ' : '').
(isset($p['id_personne']) ? "AND cp_id_personne = {$p['id_personne']} " : '').
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'TRIM(cp_nom) ASC').' ';
$requete = str_replace('WHERE AND', 'WHERE', $requete);
$requeteCount = $requete;
$requete .= "LIMIT $this->start, $this->limit ";
// Exécution de la requêtre SQL et test d'éventuelles erreurs
try {
$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
$nbElements = $this->bdd->query($requeteCount)->rowCount();
$info['nbElements'] = $nbElements;
$info['personnes'] = $donnees;
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
// Envoie sur la sortie standard
$this->envoyer($info);
}
private function construireWhereRecherche($recherche) {
$recherche = "AND ".
"(".
"cp_fmt_nom_complet LIKE {$recherche} OR ".
"cp_code_postal LIKE {$recherche} OR ".
"cp_ville LIKE {$recherche} OR ".
"cp_truk_courriel LIKE {$recherche} ".
")";
return $recherche;
}
/**
* Méthode appelée pour ajouter un élément.
*/
public function createElement($params) {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
$id_personne = null;
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
try {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
reset($tables_a_modifier);
while (list($table_id, $table) = each($tables_a_modifier)) {
if (!is_null($table['champs'])) {
if (!$this->avoirCleComplete($table)) {
// Ajout des données à la table des données
$id_personne = $this->ajouter($table);
if ($id_personne !== false) {
$table['champs_valeurs_id']['cp_id_personne'] = $id_personne;
$table['champs_valeurs_brut']['cp_id_personne'] = $id_personne;
// Historisation (Ajout des méta-données)
$etat = 1; // Ajout
$cle = $this->recupererCle($table);
$info = $this->creerXmlHisto($table['champs_valeurs_brut']);
$id_meta = $this->historiser($table_id, $cle, $info, $id_utilisateur, $etat, $id_session);
// Liaison de la table des données à ses méta-données
$champ_meta = "{$table['prefixe']}_ce_meta";
$table['champs_valeurs_protege'] = array($champ_meta => $id_meta);
$this->modifier($table);
}
} else {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
$this->envoyer((string) $id_personne);
}
/**
* Méthode appelée pour mettre à jour un élément
*/
public function updateElement($uid, $params) {
//Mise à jour de la personne
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
try {
$id_personne = $uid[0];
if (($id_personne == null)||(trim($id_personne) == "")) {
$this->messages[] = 'Aucun identifiant de personne n\'a été fourni';
} else {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
foreach ($tables_a_modifier as $table_id => $table) {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
$infos_utilisateur = $this->getUtilisateur();
// si la mise à jour concerne l'utilisateur actuellement identifié
// @TODO refaire autrement - de toute façon, ne marchait pas (rechargeait à chaque fois !)
/*if($id_utilisateur == $infos_utilisateur['id']) {
$this->rechargerCookieUtilisateur();
}*/
}
} catch (PDOException $e) {
$messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
$this->envoyer();
}
/**
* Méthode appelée pour supprimer un élément
*/
public function deleteElement($uid) {
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) || !isset($uid[1])) {
$this->messages[] = "Identifiant d'utilisateur ou de personne manquant. Vous ne devriez pas avoir accès à ce service.";
} else {
list($id_utilisateur, $id_session) = $this->getIdentification($uid[0]);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Récupération des id passés par l'url
$identifiants = explode(',', rtrim($uid[1], ','));
if (count($identifiants) == 0) {
$this->messages[] = "Aucun enregistrement n'a été supprimé.";
} else {
foreach ($identifiants as $id_personne) {
try {
// Vérification de la liaison avec d'autres données et génération des messages d'erreur
if ($this->verifierPresencePersonne($id_personne) === false) {
$params = array('cp_id_personne' => $id_personne);
$tables_a_modifier = $this->recupererTablesAModifier($params);
foreach ($tables_a_modifier as $table_id => $table) {
if ($this->avoirEnregistrement($table)) {
$resultat = $this->supprimer($table);
if ($resultat === true) {
// Historisation (Ajout des méta-données)
$cle = $this->recupererCle($table);
$this->historiser($table_id, $cle, 'NULL', $id_utilisateur, 3, $id_session);
}
} else {
$this->messages[] = "Aucun enregistrement correspondant dans la base de données.";
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
}
}
// Envoie sur la sortie standard
$this->envoyer();
}
private function verifierPresencePersonne($id_personne) {
$presence = false;
if ($presence = $this->verifierPresenceDansStructure($id_personne)) {
$this->messages[] = 'Cette personne ne peut être supprimée car elle est liée à une structure';
} else if ($presence = $this->verifierPresenceDansCollection($id_personne)) {
$this->messages[] = 'Cette personne ne peut être supprimée car elle est liée à une collection';
} else if ($presence = $this->verifierPresenceDansPublication($id_personne)) {
$this->messages[] = 'Cette personne ne peut être supprimée car elle est liée à une publication';
} else if ($presence = $this->verifierPresenceDansRelation01($id_personne)) {
$this->messages[] = "Cette personne ne peut être supprimée car elle est le sujet d'une relation";
} else if ($presence = $this->verifierPresenceDansRelation02($id_personne)) {
$this->messages[] = "Cette personne ne peut être supprimée car elle est l'objet d'une relation";
}
return $presence;
}
private function verifierPresenceDansStructure($id_personne) {
$requete = 'SELECT COUNT(csap_id_personne) AS nbre '.
'FROM coel_structure_a_personne '.
"WHERE csap_id_personne = '$id_personne' ".
'GROUP BY csap_id_personne ';
return $this->contenirDonnees($requete);
}
private function verifierPresenceDansCollection($id_personne) {
$requete = 'SELECT COUNT(ccap_id_personne) AS nbre '.
'FROM coel_collection_a_personne '.
"WHERE ccap_id_personne = '$id_personne' ".
'GROUP BY ccap_id_personne ';
return $this->contenirDonnees($requete);
}
private function verifierPresenceDansPublication($id_personne) {
$requete = 'SELECT COUNT(cpuap_id_personne) AS nbre '.
'FROM coel_publication_a_personne '.
"WHERE cpuap_id_personne = '$id_personne' ".
'GROUP BY cpuap_id_personne ';
return $this->contenirDonnees($requete);
}
private function verifierPresenceDansRelation01($id_personne) {
$requete = 'SELECT COUNT(cpar_id_personne_01) AS nbre '.
'FROM coel_personne_a_relation '.
"WHERE cpar_id_personne_01 = '$id_personne' ".
'GROUP BY cpar_id_personne_01 ';
return $this->contenirDonnees($requete);
}
private function verifierPresenceDansRelation02($id_personne) {
$requete = 'SELECT COUNT(cpar_id_personne_02) AS nbre '.
'FROM coel_personne_a_relation '.
"WHERE cpar_id_personne_02 = '$id_personne' ".
'GROUP BY cpar_id_personne_02 ';
return $this->contenirDonnees($requete);
}
}
?>
/tags/v1.11-okuzgozu/jrest/services/CoelCollection.php
New file
0,0 → 1,334
<?php
/**
* Service fournissant la liste des collections et leurs informations.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
class CoelCollection extends Coel {
 
protected $tables = array( 101 => array(
'nom' => 'coel_collection',
'prefixe' => 'cc',
'id' => array('cc_id_collection')),
106 => array(
'nom' => 'coel_collection_botanique',
'prefixe' => 'ccb',
'id' => array('ccb_id_collection')));
 
/**
* Méthode principale appelée avec une requête de type GET.
*/
public function getElement($param = array()) {
// Initialisation des variables
$info = array();
// Nour recherchons le type de requête demandé
$type = $param[0];
if ($type == '*' || is_numeric($type)) {
$info = $this->getElementParDefaut($param);
} else {
$methode = 'getElement'.$type;
if (method_exists($this, $methode)) {
array_shift($param);
$info = $this->$methode($param);
} else {
$this->messages[] = "Le type d'information demandé '$type' n'est pas disponible.";
}
}
// Envoie sur la sortie standard
$this->envoyer($info);
}
/**
* Méthode par défaut pour garder la compatibilité avec Coel.
* Appelée avec les paramêtres d'url suivant :
* /CoelCollection/_/_/_
* ou les _ représentent dans l'ordre : id_collection ou nom
* Si un des paramêtres est abscent, il prendre la valeur *
*/
public function getElementParDefaut($param) {
// Initialisation des variables
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_collection', 'recherche'), $param);
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' c.*, cb.*, '.
' cmhl_date_modification, cmhl_notes, cmhl_source, cmhl_ce_modifier_par, cmhl_ce_etat, cmhl_ip, '.
' ccm.cc_nom AS _collection_mere_nom_, '.
' cs_nom AS _structure_nom_, cs_ville AS _structure_ville_ '.
'FROM coel_collection AS c'.
' LEFT JOIN coel_meta_historique_ligne AS cmhl ON (c.cc_ce_meta = cmhl_id_historique_ligne) '.
' LEFT JOIN coel_structure ON (c.cc_ce_structure = cs_id_structure) '.
' LEFT JOIN coel_collection AS ccm ON (c.cc_ce_mere = ccm.cc_id_collection) '.
' LEFT JOIN coel_collection_botanique AS cb ON (c.cc_id_collection = ccb_id_collection) '.
((count($p) != 0) ? 'WHERE ' : '').
((isset($p['id_collection'])) ? "AND c.cc_id_collection = {$p['id_collection']} " : '').
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'c.cc_nom ASC').' ';
$requete = str_replace('WHERE AND', 'WHERE', $requete);
$requeteCount = $requete;
$requete .= "LIMIT $this->start, $this->limit ";
 
// Récupération des résultats
try {
// SPÉCIAL :
// Lorsqu'on cherche une seule structure avec un id passé en paramêtre, nous devons renvoyer un objet
$donnees = (isset($p['id_collection'])) ? $this->bdd->query($requete)->fetch(PDO::FETCH_OBJ) : $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
 
$nbElements = $this->bdd->query($requeteCount)->rowCount();
$info['nbElements'] = $nbElements;
$info['collections'] = $donnees;
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
 
return $info;
}
private function construireWhereRecherche($recherche) {
$recherche = "AND ".
"(".
"c.cc_nom LIKE {$recherche} OR ".
"cs_ville LIKE {$recherche} ".
")";
return $recherche;
}
/* Méthode pour récupérer une liste de collection en fonction d'un id structure.
* Appelée avec les paramêtres d'url suivant :
* /CoelCollection/ParIdStructure/_
* ou les _ représentent dans l'ordre : id_structure
* Si un des paramêtres est abscent, il prendre la valeur *
*/
public function getElementParIdStructure($param) {
// Initialisation des variables
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_structure'), $param);
if (!isset($p['id_structure'])) {
$this->messages[] = "Il est obligatoire d'indiquer un id de structure pour utiliser ce service.";
} else {
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' cc_nom, cc_id_collection '.
'FROM coel_collection AS c '.
'WHERE '.
" c.cc_ce_structure = {$p['id_structure']} ".
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'c.cc_nom ASC').' '.
"LIMIT $this->start, $this->limit ";
 
// Récupération des résultats
try {
// SPÉCIAL :
// Lorsqu'on cherche une seule structure avec un id passé en paramêtre, nous devons renvoyer un objet
$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
} else {
$info = $donnees;
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
}
return $info;
}
/* Méthode pour récupérer le nombre de collection en fonction d'un id structure.
* Appelée avec les paramêtres d'url suivant :
* /CoelCollection/NbreParIdStructure/_
* ou les _ représentent dans l'ordre : id_structure
* Si un des paramêtres est abscent, il prendre la valeur *
*/
public function getElementNbreParIdStructure($param) {
// Initialisation des variables
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_structure'), $param);
if (!isset($p['id_structure'])) {
$this->messages[] = "Il est obligatoire d'indiquer un id de structure pour utiliser ce service.";
} else {
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' COUNT(cc_id_collection) AS nbre '.
'FROM coel_collection AS c '.
'WHERE '.
" c.cc_ce_structure = {$p['id_structure']} ".
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'c.cc_nom ASC');
 
// Récupération des résultats
try {
// SPÉCIAL :
// Lorsqu'on cherche une seule structure avec un id passé en paramêtre, nous devons renvoyer un objet
$donnees = $this->bdd->query($requete)->fetch(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
} else {
$info = $donnees['nbre'];
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
}
return $info;
}
/**
* Méthode appelée pour ajouter un élément.
*/
public function createElement($params) {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
try {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
reset($tables_a_modifier);
$id_collection = null;
while (list($table_id, $table) = each($tables_a_modifier)) {
if (!is_null($table['champs'])) {
if (!$this->avoirCleComplete($table)) {
// Ajout des données à la table des données
$id_collection = $this->ajouter($table);
if ($id_collection !== false) {
$table['champs_valeurs_id']['cc_id_collection'] = $id_collection;
$table['champs_valeurs_brut']['cc_id_collection'] = $id_collection;
$tables_a_modifier[106]['champs_valeurs_id']['ccb_id_collection'] = $id_collection;
$tables_a_modifier[106]['champs_valeurs_brut']['ccb_id_collection'] = $id_collection;
$tables_a_modifier[106]['champs_valeurs_protege']['ccb_id_collection'] = $this->bdd->quote($id_collection);
// Historisation (Ajout des méta-données)
$etat = 1; // Ajout
$cle = $this->recupererCle($table);
$info = $this->creerXmlHisto($table['champs_valeurs_brut']);
$id_meta = $this->historiser($table_id, $cle, $info, $id_utilisateur, $etat, $id_session);
// Liaison de la table des données à ses méta-données
$champ_meta = "{$table['prefixe']}_ce_meta";
$table['champs_valeurs_protege'] = array($champ_meta => $id_meta);
$this->modifier($table);
}
} else {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
}
}
if(!isset($params['cpr_abreviation'])) {
$params['cpr_abreviation'] = '';
}
$this->ajouterGuid($params['cpr_abreviation'], $id_collection);
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
$this->envoyer($id_collection);
}
/**
* Méthode appelée pour mettre à jour un élément
*/
public function updateElement($uid, $params) {
// Vérification de la présence des id passés par l'url
if (!isset($uid[0])) {
$this->messages[] = "Identifiant de collection manquant. Vous ne devriez pas avoir accès à ce service.";
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
try {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
 
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
foreach ($tables_a_modifier as $table_id => $table) {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
// Envoie sur la sortie standard
$this->envoyer();
}
/**
* Méthode appelée pour supprimer un élément
*/
public function deleteElement($uid) {
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) || !isset($uid[1])) {
$this->messages[] = "Identifiant de collection ou d'utilisateur manquant. Vous ne devriez pas avoir accès à ce service.";
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($uid[0]);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Récupération des id passés par l'url
$identifiants = explode(',', rtrim($uid[1], ','));
try {
if (count($identifiants) == 0) {
$this->messages[] = "Aucun enregistrement n'a été supprimé.";
} else {
foreach ($identifiants as $id_collection) {
// Vérification que la structure ne possède pas de collections liées
$params = array('cc_id_collection' => $id_collection, 'ccb_id_collection' => $id_collection);
$tables_a_modifier = $this->recupererTablesAModifier($params);
foreach ($tables_a_modifier as $table_id => $table) {
if ($this->avoirEnregistrement($table)) {
$resultat = $this->supprimer($table);
if ($resultat === true) {
// Historisation (Ajout des méta-données)
$cle = $this->recupererCle($table);
$this->historiser($table_id, $cle, 'NULL', $id_utilisateur, 3, $id_session);
}
}
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
 
// Envoie sur la sortie standard
$this->envoyer();
}
private function ajouterGuid($id_collection) {
if ($id_collection !== false) {
$table_guid = $this->tables[101];
$table_guid['champs_valeurs_id']['cc_id_collection'] = $id_collection;
$table_guid['champs_valeurs_protege']['cc_guid'] = $this->bdd->quote(sprintf($this->config['coel']['guid'], 'coll'.$id_collection));
$this->modifier($table_guid);
}
}
}
?>
/tags/v1.11-okuzgozu/jrest/services/CoelValeurListe.php
New file
0,0 → 1,161
<?php
/**
* Service fournissant une liste de valeurs.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* Cas d'utilisation :
* /CoelValeurListe/id/1001 : retourne les valeurs de la liste d'identifiant 1001
* /CoelValeurListe/ab/12 : retourne les valeurs de la liste dont l'abréviation vaut "12"
* /CoelValeurListe/abv/FR.__ : retourne les valeurs dont l'abréviation équivaut (= LIKE) "FR.__"
* * /CoelValeurListe/abv/FR.__/1078 : retourne les valeurs dont l'abréviation équivaut (= LIKE) "FR.__" pour la liste d'identifiant 1078.
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
Class CoelValeurListe extends Coel {
 
/**
* Méthode appelée avec une requête de type GET.
*/
function getElement($param = array()) {
// Initialisation des variables
$info = array();// Tableau associatif des paramêtres
$requete = null;
$requete_compte = null;
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('type', 'ceParent', 'abreviation', 'idValeur', "nom"), $param);
// Construction de la requête
if (!isset($p['idValeur'])) {
$p['idValeur'] = "'%'";
}
if (!isset($p['abreviation'])) {
$p['abreviation'] = "'%'";
}
$p['type'] = trim($p['type'], "'");
switch ($p['type']) {
case 'identifiant' :
// Nous avons un identifiant de liste, nous récupérons seulement les valeurs de cette liste
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' * '.
'FROM coel_meta_liste_valeur '.
"WHERE cmlv_id_valeur = {$p['idValeur']} ".
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cmlv_id_valeur ASC').' ';
$requete_compte = $requete;
break;
case 'id' :
// Nous avons un identifiant de liste, nous récupérons seulement les valeurs de cette liste
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' * '.
'FROM coel_meta_liste_valeur '.
"WHERE cmlv_ce_parent = {$p['ceParent']} ".
"AND cmlv_id_valeur LIKE {$p['idValeur']} ".
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cmlv_id_valeur ASC').' ';
$requete_compte = $requete;
$requete .= "LIMIT $this->start,$this->limit ";
break;
case 'idv' :
// Nous avons un ou plusieurs identifiants de valeurs, nous les récupérons
$p = $this->traiterParametresUrl(array('type', 'idValeur'), $param);
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' * '.
'FROM coel_meta_liste_valeur '.
'WHERE cmlv_id_valeur IN ('.$this->traiterBddClauseIn($p['idValeur']).') '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cmlv_id_valeur ASC').' '.
"LIMIT $this->start,$this->limit ";
break;
case 'ab' :
// Nous avons une abréviation de liste, nous récupérons seulement les valeurs de cette liste
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' v.* '.
'FROM coel_meta_liste_valeur AS l LEFT JOIN coel_meta_liste_valeur AS v ON (l.cmlv_id_valeur = v.cmlv_ce_parent) '.
'WHERE l.cmlv_ce_parent = 0 '.
"AND l.cmlv_abreviation LIKE {$p['abreviation']} ".
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'v.cmlv_id_valeur ASC').' ';
$requete_compte = $requete;
$requete .= "LIMIT $this->start,$this->limit ";
break;
case 'abv' :
// Nous avons une abréviation de valeur, nous récupérons toutes les valeurs correspondantes
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' * '.
'FROM coel_meta_liste_valeur '.
"WHERE ";
 
// spécial outre-mer française
if($p['abreviation'] == "'FR%'" && $p['ceParent'] == "'1078'") {
$requete .= "cmlv_abreviation REGEXP '^(FR|RE|YT|GP|MQ|GF|NC)...$' ";
} else {
$requete .= "cmlv_abreviation LIKE {$p['abreviation']} ";
}
 
$requete .= isset($p['ceParent']) ? " AND cmlv_ce_parent = {$p['ceParent']} " : ''.
" AND cmlv_id_valeur LIKE {$p['idValeur']}".
' ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cmlv_id_valeur ASC').' ';
$requete_compte = $requete;
$requete .= "LIMIT $this->start,$this->limit ";
break;
case 'nom' :
// Nous avons une abréviation de valeur, nous récupérons toutes les valeurs correspondantes
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' * '.
'FROM coel_meta_liste_valeur '.
'WHERE ';
if (isset($p['nom']) && $p['nom'] != "") $requete .= "cmlv_nom LIKE {$p['nom']} AND ";
if (isset($p['ceParent'])) $requete .= " cmlv_ce_parent = {$p['ceParent']} AND ";
$requete .= " cmlv_id_valeur LIKE {$p['idValeur']} ".
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cmlv_id_valeur ASC').' ';
$requete_compte = $requete;
$requete .= "LIMIT $this->start,$this->limit ";
break;
default :
$this->messages[] = sprintf("Valeur '%s' pour le paramêtre 'type' inconnue (valeurs disponibles : id, ab, abv)!", $p['type']);
}
 
if (!is_null($requete)) {
// Exécution de la requêtre SQL et test d'éventuelles erreurs
try {
$resultat = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($resultat === false || count($resultat) == 0) {
$this->messages[] = "La requête a retourné aucun résultat.";
} else {
// Traitement des données
if ($p['type'] == 'id') {
$info['id'] = trim($p['ceParent'], "'");
} else if ($p['type'] == 'identifiant') {
$info['id'] = trim($p['idValeur'], "'");
} else {
$info['id'] = $resultat[0]['cmlv_ce_parent'];
}
$info['valeurs'] = $resultat;
// gestion des abreviations
if (isset($p['abreviation']) && ($p['abreviation'] != "'%'")) {
$info['abreviation'] = $p['abreviation'];
}
// si on a le nombre maximum de resultats on doit charger la page suivante
if (count($resultat) == $this->limit) {
$info['getNextPage'] = true;
} else {
$info['getNextPage'] = false;
}
//Sélection du nombre total
if (!is_null($requete_compte)) {
$nbElements = $this->bdd->query($requete_compte)->rowCount();
$info['nbElements'] = $nbElements;
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
}
 
// Envoie sur la sortie standard
$this->envoyer($info);
}
}
?>
/tags/v1.11-okuzgozu/jrest/services/CoelStructure.php
New file
0,0 → 1,409
<?php
/**
* Service fournissant la liste des structures et leurs informations.
*
* @author Raphaël Droz <raphael@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @Copyright (c) 2009, 2013 Tela Botanica (accueil@tela-botanica.org)
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
*/
class CoelStructure extends Coel {
 
static $optional_bool_fields = array(
'cs_nbre_personne',
'csc_mark_formation', 'csc_mark_formation_interet',
'csc_mark_collection_commune', 'csc_mark_acces_controle', 'csc_mark_restauration', 'csc_mark_traitement',
'csc_mark_acquisition_collection', 'csc_mark_acquisition_echantillon',
'csv_mark_action', 'csv_mark_action_future', 'csv_mark_recherche', 'csv_mark_acces_ss_motif', 'csv_mark_visite_avec_motif',
'cs_latitude', 'cs_longitude',
);
 
// ATTENTION : tjrs garder la table principale en premier, puis mettre les tables spécialisées.
protected $tables = array( 120 => array(
'nom' => 'coel_structure',
'prefixe' => 'cs',
'id' => array('cs_id_structure')),
122 => array(
'nom' => 'coel_structure_conservation',
'prefixe' => 'csc',
'id' => array('csc_id_structure')),
123 => array(
'nom' => 'coel_structure_valorisation',
'prefixe' => 'csv',
'id' => array('csv_id_structure')));
 
/**
* Méthode principale appelée avec une requête de type GET.
*/
public function getElement($param = array()) {
// Initialisation des variables
$info = array();
// Nour recherchons le type de requête demandé
$type = $param[0];
if ($type == '*' || is_numeric($type)) {
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_structure', 'recherche'), $param);
$info = $this->getElementParDefaut($p);
} else {
$methode = 'getElement'.$type;
if (method_exists($this, $methode)) {
array_shift($param);
$info = $this->$methode($param);
} else {
$this->messages[] = "Le type d'information demandé '$type' n'est pas disponible.";
}
}
// Envoie sur la sortie standard
$this->envoyer($info);
}
/**
* Méthode par défaut pour garder la compatibilité avec Coel.
* Appelée avec les paramêtres d'url suivant :
* /CoelStructure/_/_/_
* ou les _ représentent dans l'ordre : id_structure et nom
* Si un des paramêtres est abscent, il prendre la valeur *
*/
public function getElementParDefaut($p) {
// Initialisation des variables
$info = array();
 
$whereClause = array();
if(isset($p['id_structure'])) $whereClause[] = "cs_id_structure = {$p['id_structure']}";
 
if(isset($p['recherche'])) {
if(@$this->searchCity && trim($this->searchCity) == 'true') {
$whereClause[] = "(" . implode(" OR ", array("cs_nom LIKE {$p['recherche']}", "cs_ville LIKE {$p['recherche']}")) . ")";
} else {
$whereClause[] = "cs_nom LIKE {$p['recherche']}";
}
}
 
// Construction de la requête
$requete = sprintf(
'SELECT SQL_CALC_FOUND_ROWS %s cs.*, csc.*, csv.*, cmhl_date_modification, cmhl_notes, cmhl_source, cmhl_ce_modifier_par, cmhl_ce_etat, cmhl_ip '
. ' FROM coel_structure AS cs '
. ' LEFT JOIN coel_meta_historique_ligne ON (cs_ce_meta = cmhl_id_historique_ligne) '
. ' LEFT JOIN coel_structure_conservation AS csc ON (cs_id_structure = csc_id_structure) '
. ' LEFT JOIN coel_structure_valorisation AS csv ON (cs_id_structure = csv_id_structure) '
. ' WHERE %s ORDER BY %s LIMIT %d, %d -- %s:%d',
 
$this->distinct ? 'DISTINCT' : '',
$whereClause ? implode(" AND ", $whereClause) : TRUE,
is_null($this->orderby) ? 'cs.cs_nom ASC' : $this->orderby,
$this->start, $this->limit,
__FILE__, __LINE__);
 
// Récupération des résultats
try {
// SPÉCIAL :
// Lorsqu'on cherche une seule structure avec un id passé en paramêtre, nous devons renvoyer un objet
$donnees = ($this->formatRetour == 'objet' && isset($p['id_structure'])) ? $this->bdd->query($requete)->fetch(PDO::FETCH_OBJ) : $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
 
// l'UI java n'aime pas les NULL
if(!is_array($donnees)) {
// $donnees est un objet PHP
array_walk($donnees, create_function('&$val', '$val = is_null($val) ? "" : $val;'));
}
else {
// $donnees est un tableau d'objets PHP
foreach($donnees as &$structure) {
array_walk($structure, create_function('&$val', '$val = is_null($val) ? "" : $val;'));
}
}
 
$elements_nbre = $this->bdd->query("SELECT FOUND_ROWS() AS c")->fetch(PDO::FETCH_ASSOC);
$info['nbElements'] = intval($elements_nbre['c']);
$info['structures'] = $donnees;
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
 
return $info;
}
/* Méthode pour récupérer le nombre de structure par zone géographique.
* Appelée avec les paramêtres d'url suivant :
* /CoelStructure/ParZoneGeo/_
* ou les _ représentent dans l'ordre : type.
* ou type peut valoir: FRD (= département français)
* Si un des paramêtres est abscent, il prendre la valeur *
*/
public function getElementParZoneGeo($param) {
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('type'), $param);
if (!isset($p['type'])) {
$this->messages[] = "Il est obligatoire d'indiquer type de recherche pour utiliser ce service.";
return array();
}
 
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' '.
' IF ( SUBSTRING( cs_code_postal FROM 1 FOR 2 ) >= 96, '.
' SUBSTRING( cs_code_postal FROM 1 FOR 3 ), '.
' SUBSTRING( cs_code_postal FROM 1 FOR 2 ) ) AS id, '.
' COUNT( cs_id_structure ) AS nbre '.
'FROM coel_structure '.
'WHERE cs_ce_truk_pays = 2654 '.
'GROUP BY IF ( SUBSTRING( cs_code_postal FROM 1 FOR 2 ) >= 96, '.
' SUBSTRING( cs_code_postal FROM 1 FOR 3 ), '.
' SUBSTRING( cs_code_postal FROM 1 FOR 2 ) ) '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'id ASC').' ';
 
// Récupération des résultats
try {
$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
 
if ($donnees === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
return array();
}
 
$info = array();
foreach ($donnees as $donnee) {
$info[$donnee['id']] = $donnee['nbre'];
}
return $info;
}
 
 
static function NULLifNotNum(&$params, $keys_to_null) {
foreach($keys_to_null as $v) {
if(! array_key_exists($v, $params)) continue;
if(!is_numeric($params[$v]) && ! preg_match('/^-?\d+,\d*$/', $params[$v])) {
$params[$v] = NULL;
}
else {
$params[$v] = str_replace(',', '.', $params[$v]);
}
 
}
}
/**
* Méthode appelée pour ajouter un élément.
*/
public function createElement($params) {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
 
// Contrôle du non détournement de l'utilisateur
if (!$this->etreAutorise($id_utilisateur)) {
$this->envoyer();
return;
}
try {
$form_needs_refresh = self::callNominatim($params, $this->bdd);
 
self::NULLifNotNum($params, self::$optional_bool_fields);
 
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
reset($tables_a_modifier);
 
$id_structure = null;
while (list($table_id, $table) = each($tables_a_modifier)) {
if (is_null($table['champs'])) continue;
if ($this->avoirCleComplete($table)) {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
continue;
}
 
// Ajout des données à la table des données
$id_structure = $this->ajouter($table);
if ($id_structure === false) continue;
 
$table['champs_valeurs_id']['cs_id_structure'] = $id_structure;
$table['champs_valeurs_brut']['cs_id_structure'] = $id_structure;
$tables_a_modifier[122]['champs_valeurs_id']['csc_id_structure'] = $id_structure;
$tables_a_modifier[122]['champs_valeurs_brut']['csc_id_structure'] = $id_structure;
$tables_a_modifier[122]['champs_valeurs_protege']['csc_id_structure'] = $this->bdd->quote($id_structure);
$tables_a_modifier[123]['champs_valeurs_id']['csv_id_structure'] = $id_structure;
$tables_a_modifier[123]['champs_valeurs_brut']['csv_id_structure'] = $id_structure;
$tables_a_modifier[123]['champs_valeurs_protege']['csv_id_structure'] = $this->bdd->quote($id_structure);
 
// Historisation (Ajout des méta-données)
$etat = 1; // Ajout
$cle = $this->recupererCle($table);
$info = $this->creerXmlHisto($table['champs_valeurs_brut']);
$id_meta = $this->historiser($table_id, $cle, $info, $id_utilisateur, $etat, $id_session);
// Liaison de la table des données à ses méta-données
$champ_meta = "{$table['prefixe']}_ce_meta";
$table['champs_valeurs_protege'] = array($champ_meta => $id_meta);
$this->modifier($table);
}
 
if(isset($params['cpr_abreviation']) && !empty($params['cpr_abreviation'])) {
$this->ajouterGuid($params['cpr_abreviation'], $id_structure);
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
 
if($form_needs_refresh) { // coordonnées mises à jour en DB: en informer le formulaire
$this->envoyer($this->getElementParDefaut(array('id_structure' => $id_structure)));
exit;
}
$this->envoyer($id_structure);
}
 
/**
* Méthode appelée pour mettre à jour un élément
*/
public function updateElement($uid, $params) {
// Vérification de la présence des id passés par l'url
if (!isset($uid[0])) {
$this->messages[] = "Identifiant de structure manquant. Vous ne devriez pas avoir accès à ce service.";
$this->envoyer();
return;
}
 
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if (!$this->etreAutorise($id_utilisateur)) {
$this->envoyer();
return;
}
try {
$form_needs_refresh = self::callNominatim($params, $this->bdd);
 
self::NULLifNotNum($params, self::$optional_bool_fields);
 
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
foreach ($tables_a_modifier as $table_id => $table) {
if(@$table['nom'] == 'coel_structure' && !$this->avoirCleComplete($table)) {
error_log("tentative d'UPDATE sans contrainte de WHERE, \$table = " . print_r($table, TRUE));
continue; // ne pas mettre à jour sans contrainte de WHERE
}
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
 
// Envoie sur la sortie standard
 
if($form_needs_refresh) { // coordonnées mises à jour en DB: en informer le formulaire (si resté ouvert)
$this->envoyer($this->getElementParDefaut(array('id_structure' => $uid[0])));
exit;
}
$this->envoyer(); // OK par défaut
}
/**
* Méthode appelée pour supprimer un élément
*/
public function deleteElement($uid) {
// NOTES : une structure ne peut pas être supprimée si elle possède des collections liées.
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) || !isset($uid[1])) {
$this->messages[] = "Identifiant de structure ou d'utilisateur manquant. Vous ne devriez pas avoir accès à ce service.";
$this->envoyer();
return;
}
 
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($uid[0]);
// Contrôle du non détournement de l'utilisateur
if (! $this->etreAutorise($id_utilisateur)) {
$this->envoyer();
return;
}
 
// Récupération des id passés par l'url
$identifiants = explode(',', rtrim($uid[1], ','));
 
if (count($identifiants) == 0) {
$this->messages[] = "Aucun enregistrement n'a été supprimé.";
$this->envoyer();
return;
}
try {
foreach ($identifiants as $id_structure) {
// Vérification que la structure ne possède pas de collections liées
if (self::verifierPresenceCollection($this->bdd, $id_structure)) {
$this->messages[] = "La structure '$id_structure' ne peut pas être supprimée car elle possède des collections liées.";
continue;
}
 
$params = array('cs_id_structure' => $id_structure, 'csc_id_structure' => $id_structure, 'csv_id_structure' => $id_structure);
$tables_a_modifier = $this->recupererTablesAModifier($params);
foreach ($tables_a_modifier as $table_id => $table) {
if (! $this->avoirEnregistrement($table)) continue;
 
if ($this->supprimer($table) === true) {
// Historisation (Ajout des méta-données)
$cle = $this->recupererCle($table);
$this->historiser($table_id, $cle, 'NULL', $id_utilisateur, 3, $id_session);
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
 
// Envoie sur la sortie standard
$this->envoyer();
}
static function verifierPresenceCollection($db, $id_structure) {
// Vérification que la structure ne possède pas de collections liées
return ($db->query(sprintf(
'SELECT COUNT(cc_id_collection) AS nbre_collection FROM coel_collection ' .
' WHERE cc_ce_structure = %d GROUP BY cc_ce_structure ',
$id_structure))->fetchColumn() != 0);
}
 
static function callNominatim(&$params, $db = NULL) {
// lon/lat déjà saisies ?
if (@$params['cs_latitude'] && @$params['cs_longitude']) return FALSE;
 
// ni adresse, ni CP, ni ville ? rien n'est possible
if (!@$params['cs_adresse_01'] && !@$params['cs_code_postal'] && !@$params['cs_ville']) return FALSE;
 
$lonlat = array();
if(Coel::coordGuess(Coel::addrReStruct($params, $db), $lonlat)) {
$params['cs_latitude'] = $lonlat['lat'];
$params['cs_longitude'] = $lonlat['lon'];
return TRUE;
}
 
// second guess, sans code postal
if(@$params['cs_code_postal']) {
$params2 = $params;
unset($params2['cs_code_postal']);
if(Coel::coordGuess(Coel::addrReStruct($params2, $db), $lonlat)) {
$params['cs_latitude'] = $lonlat['lat'];
$params['cs_longitude'] = $lonlat['lon'];
return TRUE;
}
}
return FALSE;
}
private function ajouterGuid($id_structure) {
if ($id_structure !== false) {
$table_guid = $this->tables[120];
$table_guid['champs_valeurs_id']['cs_id_structure'] = $id_structure;
$table_guid['champs_valeurs_protege']['cs_guid'] = $this->bdd->quote(sprintf($this->config['coel']['guid'], 'str'.$id_structure));
$this->modifier($table_guid);
}
}
}
/tags/v1.11-okuzgozu/jrest/services/CoelAide.php
New file
0,0 → 1,135
<?php
/**
* Service fournissant le contenu d'une page d'aide de l'application COEL.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* Cas d'utilisation :
* /CoelAide/MaPageWikini : retourne le contenu HTML de la page nommée MaPagaWikini dans le wikini d'aide
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
class CoelAide {
private $rawAideBaseUrlTpl = null;
private $pageAideBaseUrlTpl = null;
private $pageAideBaseUrl = null;
private $serviceBaseUrl = null;
private $sommaire = array();
public function __construct($config) {
$this->rawAideBaseUrlTpl = $config['coel']['aideBaseUrlTpl'].'%s/raw_html';
$this->pageAideBaseUrlTpl = $config['coel']['aideBaseUrlTpl'].'%s';
$this->pageAideBaseUrl = $config['coel']['aideBaseUrlTpl'];
$this->serviceBaseUrl = $config['coel']['urlBaseJrest'].'CoelAide/';
header('Content-Type: text/html; charset=utf-8');
}
 
/**
* Méthode appelée quand on récupère au moins un élément
*/
public function getElement($param) {
$sortie = "Contenu de la page introuvable";
if (isset($param[0])) {
$aide_url = sprintf($this->rawAideBaseUrlTpl, $param[0]);
$html = file_get_contents($aide_url);
// Encodage en UTF-8
$html = mb_convert_encoding($html, 'UTF-8', 'ISO-8859-1');
// Remplacement des URLs
$sortie = $this->remplacerUrl($html);
}
if (isset($param[1])) {
if ('sommaire' == $param[1]) {
$this->construireSommaireDepuisHtml($html);
$sortie = json_encode($this->sommaire);
}
}
// Envoie sur la sortie standard
print($sortie);
}
private function construireSommaireDepuisHtml($html) {
$parser = new WdHTMLParser();
$tree = $parser->parse($html);
foreach ($tree as $node) {
$info = array();
if (!is_array($node)) {
$this->sommaire['txt'] = $node;
} else {
if (isset($node['name'])) {
if ($this->estListeHtml($node['name'])) {
$this->sommaire[]['liste'] = $this->extraireSommaireDepuisListeHtml($node['children']);
} else {
$info = $this->extraireCodeEtTxt($node);
if (count($info) != 0) {
$this->sommaire[] = $info;
}
}
}
}
}
//echo '<pre>' . print_r($this->sommaire, true) . '</pre>';
//echo '<pre>' . print_r($tree, true) . '</pre>';
}
private function extraireSommaireDepuisListeHtml($liste) {
$sommaire = array();
foreach ($liste as $node) {
if (!is_array($node)) {
$sommaire['txt'] = $node;
} else {
if ($this->estListeHtml($node['name'])) {
$sommaire['liste'] = $this->extraireSommaireDepuisListeHtml($node['children']);
} else if ($node['name'] == 'li') {
$sommaire[] = $this->extraireSommaireDepuisListeHtml($node['children']);
} else {
$sommaire = array_merge($this->extraireCodeEtTxt($node), $sommaire);
}
}
}
return $sommaire;
}
private function estListeHtml($valeur_a_tester) {
$est_liste = false;
if ($valeur_a_tester == 'ul' || $valeur_a_tester == 'ol') {
$est_liste = true;
}
return $est_liste;
}
private function extraireCodeEtTxt($node) {
$info = array();
if ($node['name'] == 'a') {
if (preg_match('/wiki=([a-zA-Z0-9]+)(?:\/|\?|$)/', $node['args']['href'], $match)) {
$info['code'] = $match[1];
if ($node['children'][0] != '?') {
$info['txt'] = $node['children'][0];
}
}
} else if ($node['name'] == 'span' && $node['args']['class'] == 'missingpage') {
$info['txt'] = $node['children'][0];
} else if (preg_match('/^h[1-6]$/i', $node['name'])) {
$info['txt'] = $node['children'][0];
}
return $info;
}
private function remplacerUrl($txt) {
// Remplacement des caractères posant problèmes dans les expressions régulières
$caracteres = array('.' => '\.', '/' => '\/', '?' => '\?');
$regexp_pageAideBaseUrl = strtr($this->pageAideBaseUrl, $caracteres);
// Remplace des urls par celle du service
$txt = preg_replace('/'.$regexp_pageAideBaseUrl.'([^"])/', "{$this->serviceBaseUrl}$1", $txt);
return $txt;
}
}
?>
/tags/v1.11-okuzgozu/jrest/services/CoelCommentaire.php
New file
0,0 → 1,224
<?php
/**
* Service fournissant la liste des commentaires et leurs informations.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
class CoelCommentaire extends Coel {
 
protected $tables = array(107 => array( 'nom' => 'coel_commentaire',
'prefixe' => 'ccm',
'id' => array('ccm_id_commentaire')));
 
/** Méthode appelée avec une requête de type GET.
*/
public function getElement($param = array()) {
// Initialisation des variables
$info = array();
 
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_commentaire', 'recherche'), $param);
 
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' ccm.*, '.
' ccac.*, '.
' cc_id_collection, cc_nom '.
'FROM coel_commentaire AS ccm'.
' LEFT JOIN coel_meta_historique_ligne ON (ccm_ce_meta = cmhl_id_historique_ligne) '.
' LEFT JOIN coel_collection_a_commentaire AS ccac ON (ccm_id_commentaire = ccac_id_commentaire) '.
' LEFT JOIN coel_collection ON (ccac_id_collection = cc_id_collection) '.
((count($p) != 0) ? 'WHERE ' : '').
(isset($p['id_commentaire']) ? "AND ccm_id_commentaire = {$p['id_commentaire']} " : '').
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'ccm_id_commentaire ASC').' ';
$requete = str_replace('WHERE AND', 'WHERE', $requete);
$requeteCount = $requete;
$requete .= "LIMIT $this->start, $this->limit ";
 
// Récupération des résultats
try {
// SPÉCIAL :
// Lorsqu'on cherche une seule structure avec un id passé en paramêtre, nous devons renvoyer un objet
$donnees = (isset($p['id_commentaire'])) ? $this->bdd->query($requete)->fetch(PDO::FETCH_OBJ) : $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
 
$nbElements = $this->bdd->query($requeteCount)->rowCount();
$info['nbElements'] = $nbElements;
$info['commentaires'] = $donnees;
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
 
// Envoie sur la sortie standard
$this->envoyer($info);
}
private function construireWhereRecherche($recherche) {
$recherche_public = null;
if(strstr(strtolower($recherche),'public')) {
$recherche_public = 1;
}
if(strstr(strtolower($recherche),'prive') || strstr(strtolower($recherche),'privé')) {
$recherche_public = 0;
}
$sous_requete_type = 'SELECT cmlv_id_valeur '.
'FROM coel_meta_liste_valeur '.
'WHERE cmlv_nom LIKE '.$recherche.' '.
'AND cmlv_ce_parent = 1068';
$types = $this->bdd->query($sous_requete_type)->fetchAll(PDO::FETCH_ASSOC);
$str_types = "";
foreach($types as $type) {
$str_types .= "ccac_truk_type LIKE ".$this->bdd->quote("%".$type['cmlv_id_valeur'].'%')." OR ";
}
 
$recherche = "AND ".
"(".
$str_types.
"ccm_titre LIKE {$recherche} OR ".
"ccm_ponderation LIKE {$recherche} ".
($recherche_public !== null ? ("OR ccm_mark_public LIKE {$recherche_public} ") : "").
")";
return $recherche;
}
 
/**
* Méthode appelée pour ajouter un élément.
*/
public function createElement($params) {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
try {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
reset($tables_a_modifier);
 
$id_commentaire = null;
while (list($table_id, $table) = each($tables_a_modifier)) {
if (!is_null($table['champs'])) {
if (!$this->avoirCleComplete($table)) {
// Ajout des données à la table des données
$id_commentaire = $this->ajouter($table);
if ($id_commentaire !== false) {
$table['champs_valeurs_id']['ccm_id_commentaire'] = $id_commentaire;
$table['champs_valeurs_brut']['ccm_id_commentaire'] = $id_commentaire;
 
// Historisation (Ajout des méta-données)
$etat = 1; // Ajout
$cle = $this->recupererCle($table);
$id_commentaire = $cle;
$info = $this->creerXmlHisto($table['champs_valeurs_brut']);
$id_meta = $this->historiser($table_id, $cle, $info, $id_utilisateur, $etat, $id_session);
 
// Liaison de la table des données à ses méta-données
$champ_meta = "{$table['prefixe']}_ce_meta";
$table['champs_valeurs_protege'] = array($champ_meta => $id_meta);
$this->modifier($table);
}
} else {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
} else {
$this->messages[] = "Il faut être identifié pour accéder à ce service";
}
 
$this->envoyer((string) $id_commentaire);
}
 
/**
* Méthode appelée pour mettre à jour un élément
*/
public function updateElement($uid, $params) {
// Vérification de la présence des id passés par l'url
$id_commentaire = "0";
if (!isset($uid[0])) {
$this->messages[] = "Identifiant de commentaire manquant. Vous ne devriez pas avoir accès à ce service.";
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
 
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
try {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
 
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
foreach ($tables_a_modifier as $table_id => $table) {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
$id_commentaire = $params['ccm_id_commentaire'] ;
}
}
 
// Envoie sur la sortie standard
$this->envoyer();
}
 
/**
* Méthode appelée pour supprimer un ou plusieurs éléments
*/
public function deleteElement($uid) {
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) || !isset($uid[1])) {
$this->messages[] = "Identifiant de commentaire ou d'utilisateur manquant. Vous ne devriez pas avoir accès à ce service.";
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($uid[0]);
 
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Récupération des id passés par l'url
$identifiants = explode(',', rtrim($uid[1], ','));
 
try {
if (count($identifiants) == 0) {
$this->messages[] = "Aucun enregistrement n'a été supprimé.";
} else {
foreach ($identifiants as $id_commentaire) {
$params = array('ccm_id_commentaire' => $id_commentaire);
$tables_a_modifier = $this->recupererTablesAModifier($params);
 
foreach ($tables_a_modifier as $table_id => $table) {
if ($this->avoirEnregistrement($table)) {
$resultat = $this->supprimer($table);
if ($resultat === true) {
// Historisation (Ajout des méta-données)
$cle = $this->recupererCle($table);
$this->historiser($table_id, $cle, 'NULL', $id_utilisateur, Coel::ETAT_SUPPRIMER, $id_session);
}
}
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
 
// Envoie sur la sortie standard
$this->envoyer();
}
}
?>
/tags/v1.11-okuzgozu/jrest/services/squelettes/rss2.tpl.xml
New file
0,0 → 1,22
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title><?=$titre?></title>
<link><?=$lien_coel?></link>
<atom:link href="<?=$lien_service?>" rel="self" type="application/rss+xml" />
<description><?=$description?></description>
<?php if (isset($items)) : ?>
<?php foreach ($items as $item) : ?>
<item>
<guid><?=$item['guid']?></guid>
<title><?=$item['titre']?></title>
<link><?=$item['lien']?></link>
<description><?=$item['description_encodee']?></description>
<pubDate><?=$item['date_maj_RSS']?></pubDate>
</item>
<?php endforeach; ?>
<?php endif; ?>
</channel>
</rss>
/tags/v1.11-okuzgozu/jrest/services/squelettes/diff.tpl.html
New file
0,0 → 1,36
<table style="border:1px solid black;border-collapse:collapse;" summary="Différences entre les données du <?=$date_ancienne?> et du <?=$date_nouvelle?>.">
<caption style="text-align:left;font-weight:bold;">Différences</caption>
<thead style="border:1px solid black;">
<tr>
<th rowspan="2" style="border:1px dotted;">Champ</th>
<th rowspan="2" style="border:1px dotted;">Type</th>
<th <?=(($etat == 'M') ? 'colspan="2"' : '');?> style="border:1px dotted;">Valeur</th>
</tr>
<tr>
<?php if ($etat == 'M') : ?>
<th style="border:1px dotted;">Ancienne (<?=$date_ancienne?>)</th>
<?php endif; ?>
<th style="border:1px dotted;">Nouvelle (<?=$date_nouvelle?>)</th>
</tr>
</thead>
<tbody>
<?php foreach ($differences as $champ => $diff) : ?>
<?php if ($diff['type'] == 'A') :
$couleur = 'CFC';
elseif ($diff['type'] == 'M') :
$couleur = 'FFC';
elseif ($diff['type'] == 'S') :
$couleur = 'F99';
endif; ?>
<tr style="background-color:#<?=$couleur?>;">
<td style="border:1px dotted;"><?=$champ?></td>
<td style="text-align:center;border:1px dotted;"><?=$diff['type_txt']?></td>
<?php if ($etat == 'M') : ?>
<td style="border:1px dotted;"><?=$diff['ancien']?></td>
<?php endif; ?>
<td style="border:1px dotted;"><?=$diff['nouveau']?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
/tags/v1.11-okuzgozu/jrest/services/squelettes/export_collection_expertise.tpl.csv
New file
0,0 → 1,4
"<?=implode('","', $champs)?>"
<?php foreach ($collections as $collection) : ?>
"<?=implode('","', $collection)?>"
<?php endforeach; ?>
/tags/v1.11-okuzgozu/jrest/services/squelettes/atom.tpl.xml
New file
0,0 → 1,33
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><?=$titre?></title>
<link href="<?=$lien_coel?>" rel="alternate" type="text/html" hreflang="fr" />
<link href="<?=$lien_service?>" rel="self" type="application/atom+xml"/>
<updated><?=$date_maj_ATOM?></updated>
<author>
<name><?=$editeur?></name>
</author>
<id><?=$guid?></id>
<rights>Copyright (c) <?=$annee_courante?>, <?=$editeur?></rights>
<generator uri="<?=$lien_coel?>" version="<?=$generateur_version?>"><?=$generateur?></generator>
 
<?php if (isset($items)) : ?>
<?php foreach ($items as $item) : ?>
<entry>
<id><?=$item['lien']?></id>
<title><?=$item['titre']?></title>
<link href="<?=$item['lien']?>"/>
<updated><?=$item['date_maj_ATOM']?></updated>
<author><name><?=$item['modifier_par']?></name></author>
<content type="xhtml" xml:lang="fr">
<div xmlns="http://www.w3.org/1999/xhtml">
<?=$item['description'];?>
</div>
</content>
</entry>
<?php endforeach; ?>
<?php endif; ?>
 
</feed>
/tags/v1.11-okuzgozu/jrest/services/squelettes/export_structure_expertise.tpl.csv
New file
0,0 → 1,4
"id","nom","description","adresse","code_postal","ville","telephone","courriel","url","type","stockage_parametres","stockage_parametres_nbre","collection_nbre"
<?php foreach ($structures as $id => $structure) : ?>
"<?=$id?>","<?=$structure['nom']?>","<?=$structure['description']?>","<?=$structure['adresse']?>","<?=$structure['code_postal']?>","<?=$structure['ville']?>","<?=$structure['telephone']?>","<?=$structure['courriel']?>","<?=$structure['url']?>","<?=$structure['type']?>","<?=$structure['stockage_params']?>","<?=$structure['stockage_params_nbre']?>","<?=$structure['collection_nbre']?>"
<?php endforeach; ?>
/tags/v1.11-okuzgozu/jrest/services/squelettes/rss1.tpl.xml
New file
0,0 → 1,45
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";?>
 
<!DOCTYPE rdf:RDF [
<!ENTITY % HTMLlat1 PUBLIC
"-//W3C//ENTITIES Latin 1 for XHTML//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
%HTMLlat1;
]>
 
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns="http://purl.org/rss/1.0/">
 
<channel rdf:about="<?=$guid?>">
<title><?=$titre?></title>
<link><?=$lien_coel?></link>
<description><?=$description?></description>
<dc:publisher><?=$editeur?></dc:publisher>
<dc:date><?=$date_maj_W3C?></dc:date>
<?php if (isset($items)) : ?>
<items>
<rdf:Seq>
<?php foreach ($items as $item) : ?>
<rdf:li resource="<?=$item['guid']?>" />
<?php endforeach; ?>
</rdf:Seq>
</items>
<?php endif; ?>
 
</channel>
<?php if (isset($items)) : ?>
<?php foreach ($items as $item) : ?>
<item rdf:about="<?=$item['guid']?>">
<title><?=$item['titre']?></title>
<link><?=$item['lien']?></link>
<description><?=$item['description_encodee']?></description>
<dc:date><?=$item['date_maj_W3C']?></dc:date>
</item>
<?php endforeach; ?>
<?php endif; ?>
</rdf:RDF>
/tags/v1.11-okuzgozu/jrest/services/CoelCollectionAPersonne.php
New file
0,0 → 1,189
<?php
/**
* Service fournissant la liste des relations "structure à personne".
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
class CoelCollectionAPersonne extends Coel {
 
/** Contient les infos sur les tables gérées par ce service.
* Bien respecter l'ordre avec en premier les tables liées et en dernier la table établissant la relation. */
protected $tables = array( 103 => array( 'nom' => 'coel_collection_a_personne',
'prefixe' => 'ccap',
'id' => array('ccap_id_collection', 'ccap_id_personne', 'ccap_id_role')));
 
/**
* Méthode appelée avec une requête de type GET.
*/
public function getElement($param = array()) {
// Initialisation des variables
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_collection', 'id_role', 'id_personne'), $param);
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT ' : 'SELECT ').
' ccap.*, '.
(isset($p['id_personne']) ? ' cc_nom, ' : '').
' cp_fmt_nom_complet, cp_prenom, cp_nom, cp_naissance_date, cp_naissance_lieu, cp_ce_deces, cp_deces_date, cp_deces_lieu '.
'FROM coel_collection_a_personne AS ccap '.
' LEFT JOIN coel_meta_historique_ligne ON (ccap_ce_meta = cmhl_id_historique_ligne) '.
' LEFT JOIN coel_personne ON (ccap_id_personne = cp_id_personne) '.
(isset($p['id_personne']) ? ' LEFT JOIN coel_collection ON (ccap_id_collection = cc_id_collection) ' : '').
((count($p) != 0) ? 'WHERE ' : '').
(isset($p['id_collection']) ? "AND ccap_id_collection = {$p['id_collection']} " : '').
(isset($p['id_role']) ? "AND ccap_id_role = {$p['id_role']} " : '').
(isset($p['id_personne']) ? "AND ccap_id_personne = {$p['id_personne']} " : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'ccap_ce_meta DESC').' ';
$requete = str_replace('WHERE AND', 'WHERE', $requete);
$requeteCount = $requete;
$requete .= "LIMIT $this->start, $this->limit ";
// Récupération des résultats
try {
$nbElements = 0;
$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
} else {
$nbElements = $this->bdd->query($requeteCount)->rowCount();
}
$info['nbElements'] = $nbElements;
$info['collectionsAPersonne'] = $donnees;
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
// Envoie sur la sortie standard
$this->envoyer($info);
}
/**
* Méthode appelée pour ajouter un élément.
*/
public function createElement($params) {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
try {
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
// Nous ne pouvons pas utiliser foreach car il travaille sur une copie du tableau or nous le modifions dynamiquement dans la boucle
reset($tables_a_modifier);
while (list($table_id, $table) = each($tables_a_modifier)) {
if (!is_null($table['champs'])) {
if (!$this->avoirCleComplete($table)) {
$this->messages[] = 'Il est nécessaire de fournir toutes les clés à ce service.';
} else {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
}
// Envoie sur la sortie standard
$this->envoyer();
}
/**
* Méthode appelée pour mettre à jour un élément
*/
public function updateElement($uid, $params) {
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) && !isset($uid[1]) && !isset($uid[2])) {
$this->messages[] = 'Aucun identifiant de collection, personne et role a été passé. Vous ne devriez pas avoir accès à ce service.';
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
try {
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
foreach ($tables_a_modifier as $table_id => $table) {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
// Envoie sur la sortie standard
$this->envoyer();
}
/**
* Méthode appelée pour supprimer un ou plusieurs éléments
*/
public function deleteElement($uid) {
// NOTES : la suppression ne supprime pas les personnes mais seulements les relations
 
// Vérification de la présence des id passés par l'url
if (!isset($uid[0]) || !isset($uid[1])) {
$this->messages[] = "Identifiant de relations ou d'utilisateur manquant. Vous ne devriez pas avoir accès à ce service.";
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($uid[0]);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Récupération des identifiant à supprimer
$identifiants = array();
$identifiants_agreges = explode(',', rtrim($uid[1], ','));
foreach ($identifiants_agreges as $identifiant) {
$identifiants[] = explode('-', $identifiant);
}
if (count($identifiants) == 0) {
$this->messages[] = "Aucun enregistrement n'a été supprimé.";
} else {
try {
foreach ($identifiants as $id) {
if (count($id) == 1) { // Seulement des id de collection
$params = array('ccap_id_collection' => $id[0]);
} else if (count($id) == 3) { // Tous les id...
$params = array('ccap_id_collection' => $id[0], 'ccap_id_personne' => $id[1], 'ccap_id_role' => $id[2]);
}
$tables_a_modifier = $this->recupererTablesAModifier($params);
$table = $tables_a_modifier[103];
if ($this->avoirEnregistrement($table)) {
$resultat = $this->supprimer($table);
if ($resultat === true) {
// Historisation (Ajout des méta-données)
$cle = $this->recupererCle($table);
$this->historiser(103, $cle, 'NULL', $id_utilisateur, Coel::ETAT_SUPPRIMER, $id_session);
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
}
// Envoie sur la sortie standard
$this->envoyer();
}
}
?>
/tags/v1.11-okuzgozu/jrest/services/CoelCorrection.php
New file
0,0 → 1,115
<?php
/**
* Service fournissant la liste des commentaires et leurs informations.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @author Cyprien CLERC <cyprien@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
 
class CoelCorrection extends Coel {
public function getElement($params = array()) {
// Identification de l'utilisateur
$login = $this->config['coel']['correctionLogin'];
$mdp = $this->config['coel']['correctionMdp'];
// Récupération des paramètres d'identification
$loginParam = $params[0];
$mdpParam = $params[1];
// Contrôle du non détournement de l'utilisateur
if ($login == $loginParam && $mdp == $mdpParam) {
$numeroCorrection = $params[2];
switch($numeroCorrection) {
case 1 : $this->correction0001($numeroCorrection);
break;
default : $this->noCorrection();
}
} else {
$this->messages[] = "[ERREUR] Il faut etre identifie pour acceder a ce service";
}
}
public function noCorrection() {
$this->messages[] = "[ERREUR] Aucun numero de correction n'a ete fourni ou le numero fourni est invalide.";
}
/*-------------------------------------------------------------------*/
//-----------//
// Correctif //
//-----------//
/* Le champ 'pays' de la table 'personne' contient le nom de la liste au lieu de son id, il faut remédier à ça ! */
private function correction0001($numeroCorrection) {
$this->messages[] = "APPLICATION DE LA CORRECTION numero ".$numeroCorrection;
// recuperation des pays
$requete = '
SELECT cmlv_id_valeur, cmlv_nom FROM coel_meta_liste_valeur
WHERE cmlv_ce_parent=1074
';
$pays = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
$requete = '
SELECT cp_id_personne, cp_truk_recolte
FROM coel_personne
';
$resultat = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
for($i=0; $i<count($resultat); $i++) {
if ($resultat[$i]['cp_truk_recolte'] != "") {
$tabValeurs = explode(";", $resultat[$i]['cp_truk_recolte']);
$nouvelleValeurChamp = "";
for($j=0; $j<count($tabValeurs); $j++) {
 
$tabType = explode("##", $tabValeurs[$j]);
$type = trim($tabType[0]);
if ($type != "" && !is_numeric($type)) {
// recherche de l'id_valeur
$trouve = false;
$k=0;
while(!$trouve && $k<count($pays)) {
if ($pays[$k]['cmlv_nom'] == $tabType[0]) {
$trouve = true;
}
else $k++;
}
$id_valeur = $pays[$k]['cmlv_id_valeur'];
if ($trouve) $nouvelleValeurChamp .= str_replace($type, $id_valeur, $tabValeurs[$j]).";";
}
}
$requeteUpdate = "
UPDATE coel_personne
SET cp_truk_recolte = '".$nouvelleValeurChamp."'
WHERE cp_id_personne = '".$resultat[$i]['cp_id_personne']."'
";
if ($nouvelleValeurChamp != "") {
echo $requeteUpdate.";<br>";
$resultatRequeteUpdate = $this->bdd->query($requeteUpdate);
if($resultatRequeteUpdate) $this->messages[] = "Correction effectuee.<br>";
else $this->messages[] = "Echec lors de la correction.";
}
 
}
 
}
return true;
}
}
/tags/v1.11-okuzgozu/jrest/services/CoelPublication.php
New file
0,0 → 1,254
<?php
/**
* Service fournissant la liste des structures et leurs informations.
* Encodage en entrée : utf8
* Encodage en sortie : utf8
*
* @author Aurélien Peronnet <aurelien@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright 2009
*/
class CoelPublication extends Coel {
 
protected $tables = array(118 => array('nom' => 'coel_publication',
'prefixe' => 'cpu',
'id' => array('cpu_id_publication')));
 
/** Méthode appelée avec une requête de type GET.
*/
public function getElement($param = array()) {
// Initialisation des variables
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_publication', 'recherche'), $param);
 
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' cp.*, cmhl.*, cs_nom '.
'FROM coel_publication AS cp '.
' LEFT JOIN coel_meta_historique_ligne AS cmhl ON (cpu_ce_meta = cmhl_id_historique_ligne) '.
' LEFT JOIN coel_structure ON (cpu_ce_truk_editeur = cs_id_structure) '.
((count($p) != 0) ? 'WHERE ' : '').
(isset($p['id_publication']) ? "AND cpu_id_publication = {$p['id_publication']} " : '').
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cpu_id_publication ASC').' ';
$requete = str_replace('WHERE AND', 'WHERE', $requete);
$requeteCount = $requete;
$requete .= "LIMIT $this->start, $this->limit ";
 
// Récupération des résultats
try {
// SPÉCIAL :
// Lorsqu'on cherche une seule publication avec un id passé en paramêtre, nous devons renvoyer un objet
$donnees = (isset($p['id_publication'])) ? $this->bdd->query($requete)->fetch(PDO::FETCH_OBJ) : $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
 
$nbElements = $this->bdd->query($requeteCount)->rowCount();
$info['nbElements'] = $nbElements;
$info['publications'] = $donnees;
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
 
// Envoie sur la sortie standard
$this->envoyer($info);
}
private function construireWhereRecherche($recherche) {
$recherche = "AND ".
"(".
"cpu_fmt_nom_complet LIKE {$recherche} OR ".
"cpu_date_parution LIKE {$recherche} OR ".
"cpu_fascicule LIKE {$recherche} OR ".
"cpu_truk_pages LIKE {$recherche} ".
")";
return $recherche;
}
 
/**
* Méthode appelée pour ajouter un élément.
*/
public function createElement($params) {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
try {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
reset($tables_a_modifier);
 
$id_publication = null;
while (list($table_id, $table) = each($tables_a_modifier)) {
if (!is_null($table['champs'])) {
if (!$this->avoirCleComplete($table)) {
// Ajout des données à la table des données
$id_publication = $this->ajouter($table);
if ($id_publication !== false) {
$table['champs_valeurs_id']['cpu_id_publication'] = $id_publication;
$table['champs_valeurs_brut']['cpu_id_publication'] = $id_publication;
 
// Historisation (Ajout des méta-données)
$etat = 1; // Ajout
$cle = $this->recupererCle($table);
$id_publication = $cle;
$info = $this->creerXmlHisto($table['champs_valeurs_brut']);
$id_meta = $this->historiser($table_id, $cle, $info, $id_utilisateur, $etat, $id_session);
 
// Liaison de la table des données à ses méta-données
$champ_meta = "{$table['prefixe']}_ce_meta";
$table['champs_valeurs_protege'] = array($champ_meta => $id_meta);
$this->modifier($table);
}
} else {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
} else {
$this->messages[] = "Il faut être identifié pour accéder à ce service";
}
 
$this->envoyer((string) $id_publication);
}
 
/**
* Méthode appelée pour mettre à jour un élément
*/
public function updateElement($uid, $params) {
// Vérification de la présence des id passés par l'url
$id_publication = "0";
if (!isset($uid[0])) {
$this->messages[] = "Identifiant de publication manquant. Vous ne devriez pas avoir accès à ce service.";
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params);
 
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
try {
// Vérification des tables à vraiment mettre à jour en fonction des données passées.
$tables_a_modifier = $this->recupererTablesAModifier($params);
 
// Pour chaque table du module nous lançons si nécessaire l'historisation puis la mise à jour
foreach ($tables_a_modifier as $table_id => $table) {
$this->mettreAJourAvecCle($id_utilisateur, $id_session, $table_id, $table);
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
$id_publication = $params['cpu_id_publication'] ;
}
}
 
// Envoie sur la sortie standard
$this->envoyer();
}
 
/**
* Méthode appelée pour supprimer un élément
*/
public function deleteElement($params_url) {
// Vérification de la présence des id passés par l'url
if (!isset($params_url[0]) || !isset($params_url[1])) {
$this->messages[] = "Identifiant de publication ou d'utilisateur manquant. Vous ne devriez pas avoir accès à ce service.";
} else {
// Identification de l'utilisateur
list($id_utilisateur, $id_session) = $this->getIdentification($params_url[0]);
 
// Contrôle du non détournement de l'utilisateur
if ($this->etreAutorise($id_utilisateur)) {
// Récupération des id passés par l'url
$identifiants = explode(',', rtrim($params_url[1], ','));
 
try {
if (count($identifiants) == 0) {
$this->messages[] = "Aucun enregistrement n'a été supprimé.";
} else {
foreach ($identifiants as $id_publication) {
// Vérification de la liaison avec d'autres données et génération des messages d'erreur
$params = array('cpu_id_publication' => $id_publication);
$tables_a_modifier = $this->recupererTablesAModifier($params);
 
foreach ($tables_a_modifier as $table_id => $table) {
if ($this->avoirEnregistrement($table)) {
$resultat = $this->supprimer($table);
if ($resultat === true) {
// Historisation (Ajout des méta-données)
$cle = $this->recupererCle($table);
$this->historiser($table_id, $cle, 'NULL', $id_utilisateur, 3, $id_session);
}
}
}
$this->supprimerAssociationsAPersonne($id_publication);
$this->supprimerAssociationsACollection($id_publication);
}
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
}
}
}
 
// Envoie sur la sortie standard
$this->envoyer();
}
private function verifierPresencePublication($id_publication) {
$presence = false;
$id_publication = $this->bdd->quote($id_publication);
if ($presence = $this->verifierPresenceDansPersonne($id_publication)) {
$this->messages[] = 'Cette publication ne peut être supprimée car elle est au moins liée à une personne';
} else if ($presence = $this->verifierPresenceDansCollection($id_publication)) {
$this->messages[] = 'Cette publication ne peut être supprimée car elle est au moins liée à une collection';
}
return $presence;
}
private function verifierPresenceDansPersonne($id_publication) {
$requete = 'SELECT COUNT(cpuap_id_publication) AS nbre '.
'FROM coel_publication_a_personne '.
"WHERE cpuap_id_publication = $id_publication ".
' AND cpuap_id_role != 2360 '.// Auteur
'GROUP BY cpuap_id_publication ';
return $this->contenirDonnees($requete);
}
private function verifierPresenceDansCollection($id_publication) {
$requete = 'SELECT COUNT(ccapu_id_publication) AS nbre '.
'FROM coel_collection_a_publication '.
"WHERE ccapu_id_publication = $id_publication ".
'GROUP BY ccapu_id_publication ';
return $this->contenirDonnees($requete);
}
private function supprimerAssociationsAPersonne($id_publication) {
$requete = 'DELETE FROM coel_publication_a_personne '.
"WHERE cpuap_id_publication = $id_publication ";
$succes = $this->bdd->exec($requete);
if ($succes === false) {
$this->messages[] = 'Erreur lors de la suppression de la liaison aux personnes';
}
}
private function supprimerAssociationsACollection($id_publication) {
$requete = 'DELETE FROM coel_collection_a_publication '.
"WHERE ccapu_id_publication = $id_publication ";
$succes = $this->bdd->exec($requete);
if ($succes === false) {
$this->messages[] = 'Erreur lors de la suppression de la liaison aux collections';
}
}
}
?>
/tags/v1.11-okuzgozu/jrest/services
New file
Property changes:
Added: svn:ignore
+ferrege
/tags/v1.11-okuzgozu/jrest
New file
Property changes:
Added: svn:ignore
+jrest.ini.php
+.settings
+.buildpath
+.project
+jrest.ini
/tags/v1.11-okuzgozu/scripts/framework.php
New file
0,0 → 1,0
link ../../../framework/trunk/framework/Framework.php
Property changes:
Added: svn:special
+*
\ No newline at end of property
/tags/v1.11-okuzgozu/scripts/modules/desontologisation/Desontologisation.php
New file
0,0 → 1,435
<?php
 
/**
* Exemple lancement:
* /opt/lampp/bin/php -d memory_limit=3500M cli.php desontologisation -a unitebase
*/
 
class Desontologisation extends Script {
 
private $bdd = null;
private $structures = array();
private $communes = array();
private $nonTrouvees = array();
 
public function __construct($script_nom, $parametres) {
parent::__construct($script_nom, $parametres);
$this->bdd = new Bdd();
}
 
public function executer() {
try {
$cmd = $this->getParametre('a');
switch ($cmd) {
case "sauvegarder" :
$this->sauvegarder(); break;
case "unitebase" :
$this->desontologiserUniteBase(); break;
case "uniterangement" :
$this->desontologiserUniteRangement(); break;
case "inventaire" :
$this->desontologiserInventaire(); break;
case "etat" :
$this->desontologiserEtat(); break;
case "periode" :
$this->desontologiserPeriode(); break;
default :
$this->traiterErreur('Erreur : la commande "%s" n\'existe pas!', array($cmd));
}
} catch (Exception $erreur) {
$this->traiterErreur($erreur->getMessage());
}
}
private function sauvegarder() {
$requete = "CREATE TABLE coel_collection_sauv SELECT * FROM coel_collection; CREATE TABLE coel_collection_botanique_sauv SELECT * FROM coel_collection_botanique;";
$infos_truk = $this->bdd->requeter($requete);
}
private function desontologiserInventaire() {
$requete_table = "ALTER TABLE coel_collection_botanique ".
"CHANGE `ccb_ce_inventaire` `ccb_ce_inventaire` VARCHAR(20) NULL DEFAULT NULL COMMENT 'Existe-t-il un inventaire de cette collection?', ".
"CHANGE `ccb_ce_inventaire_auteur` `ccb_ce_inventaire_auteur` VARCHAR(20) NULL DEFAULT NULL COMMENT 'L''auteur de la collection a-t-il participé à cet inventaire?', ".
"CHANGE `ccb_ce_traitement` `ccb_ce_traitement` VARCHAR(20) NULL DEFAULT NULL COMMENT 'L''auteur de la collection a-t-il participé à cet inventaire?';";
$infos_truk = $this->bdd->requeter($requete_table);
$requete = "SELECT ccb_id_collection, ccb_ce_inventaire, ccb_ce_inventaire_auteur, ccb_ce_traitement ".
"FROM coel_collection_botanique ".
"WHERE (ccb_ce_inventaire IS NOT NULL AND ccb_ce_inventaire != '') OR (ccb_ce_inventaire_auteur IS NOT NULL AND ccb_ce_inventaire_auteur != '')";
$infos_truk = $this->bdd->recupererTous($requete);
foreach ($infos_truk as $truk) {
$id_collection = $truk['ccb_id_collection'];
$inventaire = $this->transformerouinon($truk["ccb_ce_inventaire"]);
$inventaire_auteur = $this->transformerouinon($truk["ccb_ce_inventaire_auteur"]);
$traitement = $this->transformerouinon($truk["ccb_ce_traitement"]);
$update = 'UPDATE coel_collection_botanique '.
'SET '.
'ccb_ce_inventaire = "'.$inventaire.'", '.
'ccb_ce_inventaire_auteur = "'.$inventaire_auteur.'" '.
'ccb_ce_traitement = "'.$traitement.'" '.
'WHERE ccb_id_collection = "'.$id_collection.'"';
$this->bdd->executer($update);
}
}
private function desontologiserEtat() {
$requete_table = "ALTER TABLE coel_collection_botanique ".
"CHANGE `ccb_ce_unite_rangement_etat` `ccb_ce_unite_rangement_etat` int(1) NULL DEFAULT NULL COMMENT 'liste de 1 à 5 correspondant à une liste déroulante entre très mauvais et très bon', ".
"CHANGE `ccb_ce_etat_general` `ccb_ce_etat_general` int(1) NULL DEFAULT NULL COMMENT 'liste de 1 à 5 correspondant à une liste déroulante entre très mauvais et très bon';";
$infos_truk = $this->bdd->requeter($requete_table);
$requete = "SELECT ccb_id_collection, ccb_ce_unite_rangement_etat, ccb_ce_etat_general ".
"FROM coel_collection_botanique ".
"WHERE (ccb_ce_unite_rangement_etat IS NOT NULL AND ccb_ce_unite_rangement_etat != '') OR (ccb_ce_etat_general IS NOT NULL AND ccb_ce_etat_general != '')";
$infos_truk = $this->bdd->recupererTous($requete);
foreach ($infos_truk as $truk) {
$id_collection = $truk['ccb_id_collection'];
$inventaire = $this->transformerBonMauvaisEtat($truk["ccb_ce_unite_rangement_etat"]);
$inventaire_auteur = $this->transformerBonMauvaisEtat($truk["ccb_ce_etat_general"]);
$update = 'UPDATE coel_collection_botanique '.
'SET '.
'ccb_ce_unite_rangement_etat = "'.$inventaire.'", '.
'ccb_ce_etat_general = "'.$inventaire_auteur.'" '.
'WHERE ccb_id_collection = "'.$id_collection.'"';
$this->bdd->executer($update);
}
}
private function desontologiserPeriode() {
$requete_table = "ALTER TABLE coel_collection ADD ".
" cc_periode_constitution_debut int(4) AFTER cc_truk_periode_constitution, ADD cc_periode_constitution_fin int(4) AFTER cc_periode_constitution_debut;";
$infos_truk = $this->bdd->requeter($requete_table);
$requete = "SELECT cc_id_collection, substr(`ccb_recolte_date_debut`, 1, 4) AS annee_debut, ccb_ce_recolte_date_debut_type as type_debut, ".
"substr(`ccb_recolte_date_fin`, 1, 4) AS annee_fin, ccb_ce_recolte_date_fin_type as type_fin,".
" cc_truk_periode_constitution AS siecle FROM `coel_collection_botanique`, `coel_collection`
WHERE `ccb_id_collection`=`cc_id_collection` ";
$infos_truk = $this->bdd->recupererTous($requete);
foreach ($infos_truk as $truk) {
$id_collection = $truk['ccb_id_collection'];
$periode = $this->transformerPeriode($truk);
$update = 'UPDATE coel_collection '.
'SET '.
'cc_periode_constitution_debut = "'.$periode[0].'", '.
'cc_periode_constitution_fin = "'.$periode[1].'" '.
'WHERE cc_id_collection = "'.$id_collection.'"';
$this->bdd->executer($update);
}
$requete = "SELECT cc_id_collection, '0000' AS annee_debut, '' as type_debut, ".
"'0000' AS annee_fin, '' as type_fin,".
" cc_truk_periode_constitution AS siecle FROM `coel_collection`
WHERE `cc_periode_constitution_debut` is null and `cc_truk_periode_constitution` != ''";
$infos_truk = $this->bdd->recupererTous($requete);
foreach ($infos_truk as $truk) {
$id_collection = $truk['cc_id_collection'];
$periode = $this->transformerPeriode($truk);
$update = 'UPDATE coel_collection '.
'SET '.
'cc_periode_constitution_debut = "'.$periode[0].'", '.
'cc_periode_constitution_fin = "'.$periode[1].'" '.
'WHERE cc_id_collection = "'.$id_collection.'"';
$this->bdd->executer($update);
}
/*supprimer ccb_recolte_date_debut, ccb_ce_recolte_date_debut_type, ccb_recolte_date_fin, ccb_ce_recolte_date_fin_type, cc_truk_periode_constitution
*
* $requete_table = "ALTER TABLE coel_collection_botanique ".
"CHANGE `ccb_ce_unite_rangement_etat` `ccb_ce_unite_rangement_etat` int(1) NULL DEFAULT NULL COMMENT 'liste de 1 à 5 correspondant à une liste déroulante entre très mauvais et très bon', ".
"CHANGE `ccb_ce_etat_general` `ccb_ce_etat_general` int(1) NULL DEFAULT NULL COMMENT 'liste de 1 à 5 correspondant à une liste déroulante entre très mauvais et très bon';";
$infos_truk = $this->bdd->requeter($requete_table);
*/
}
private function desontologiserUniteBase() {
$requete_table = "ALTER TABLE coel_collection_botanique ADD ".
" ccb_nb_planches_herbiers int(20) AFTER `ccb_truk_unite_base`, ADD ccb_nb_especes int(20) AFTER ccb_nb_planches_herbiers;";
$infos_truk = $this->bdd->requeter($requete_table);
$requete = "SELECT ccb_id_collection, ccb_truk_unite_base ".
"FROM coel_collection_botanique ".
"WHERE ccb_truk_unite_base IS NOT NULL AND ccb_truk_unite_base != ''";
 
$infos_truk = $this->bdd->recupererTous($requete);
foreach($infos_truk as $truk) {
$id_collection = $truk['ccb_id_collection'];
// Séparation de chaque catégorie d'unite de truk
$categories_truk = explode(';;', $truk['ccb_truk_unite_base']);
// Iteration sur toutes les catégories de truk trouvées
foreach($categories_truk as $categorie_truk) {
// extraction du numéro d'ontologie de la liste concernée
$categorie_truk_unite_infos = explode('##', $categorie_truk);
// Seules les infos de planche d'herbier nous interessent (donc numéro d'ontologie 2270)
if($categorie_truk_unite_infos[0] == '2270') {
$truk_unite_infos = $categorie_truk_unite_infos[1];
$truk_unite_infos = explode('||', $truk_unite_infos);
$nb_planches_herbiers = $truk_unite_infos[0];
$nb_especes = $truk_unite_infos[5];
$update = 'UPDATE coel_collection_botanique '.
'SET '.
'ccb_nb_planches_herbiers = "'.$nb_planches_herbiers.'", '.
'ccb_nb_especes = "'.$nb_especes.'" '.
'WHERE ccb_id_collection = "'.$id_collection.'"';
$this->bdd->executer($update);
}
}
}
}
private function desontologiserUniteRangement() {
$requete_table = "ALTER TABLE coel_collection_botanique ADD ".
" ccb_nb_liasses int(20) AFTER `ccb_truk_unite_rangement`, ADD ccb_format_liasses varchar(50) AFTER ccb_nb_liasses ,".
" ADD ccb_nb_cartons_herbier int(20) AFTER `ccb_format_liasses`, ADD ccb_format_cartons_herbier varchar(50) AFTER ccb_nb_cartons_herbier , ".
"ADD ccb_autres_unites_rangement text AFTER ccb_format_cartons_herbier;";
//print_r($requete_table);
$infos_truk = $this->bdd->requeter($requete_table);
$requete = "SELECT ccb_id_collection, ccb_truk_unite_rangement ".
"FROM coel_collection_botanique ".
"WHERE ccb_truk_unite_rangement IS NOT NULL AND ccb_truk_unite_rangement != '' ";
 
$infos_truk = $this->bdd->recupererTous($requete);
// Récupération de la liste des termes d'ontologies pour les types de rangement
$requete_onto = "SELECT * FROM coel_meta_liste_valeur ".
"WHERE cmlv_ce_parent = 1044";
$infos_onto = $this->bdd->recupererTous($requete_onto);
// Pour associer facilement chaque id d'ontologie à sa signification
$ontologie_rangement = array();
foreach($infos_onto as $onto) {
$ontologie_rangement[$onto['cmlv_id_valeur']] = $onto;
}
foreach($infos_truk as $truk) {
 
$id_collection = $truk['ccb_id_collection'];
$unite_rangement_des = array('cartons' => array(), 'liasses' => array(), 'autres' => array());
// Séparation de chaque catégorie d'unite de truk
$categories_unite_rangement = explode(';;', $truk['ccb_truk_unite_rangement']);
// Pour éviter de modifier une collection où seul un "squelette" de truk serait présent
$collection_a_modifier = false;
// Iteration sur toutes les catégories de rangement trouvées
foreach($categories_unite_rangement as $unite_rangement) {
// extraction du numéro d'ontologie de la liste concernée
list($id_ontologie_rangement, $infos_unite_rangement) = explode('##', $unite_rangement);
$tableau_unite_rangement = $this->parserUniteRangement($infos_unite_rangement);
if($tableau_unite_rangement['nombre'] > 0) {
$collection_a_modifier = true;
switch($id_ontologie_rangement) {
// Liasses : 2256
case "2256":
$unite_rangement_des['liasses'] = $tableau_unite_rangement;
break;
// Cartons d'herbier : 2255
case "2255":
$unite_rangement_des['cartons'] = $tableau_unite_rangement;
break;
// Autres
default:
$unite_rangement_des['autres'][] = $this->formaterLigneAutreUniteRangement($id_ontologie_rangement, $ontologie_rangement, $tableau_unite_rangement);
}
}
}
// Pas la peine de modifier une collection qui ne content ni liasse, ni carton d'herbier, ni autre
// (on ne le sait qu'à ce moment là après analyse par le script car la colonne ccb_truk_unite_rangement
// est tout de même quelquefois remplie par une syntaxe d'ontologie vide quand il n'y a rien)
if($collection_a_modifier) {
$update = "UPDATE coel_collection_botanique ".
"SET ";
$champs = array();
if(!empty($unite_rangement_des['liasses'])) {
$champs[] = "ccb_nb_liasses = ".$this->bdd->proteger($unite_rangement_des['liasses']['nombre']).", ".
"ccb_format_liasses = ".$this->bdd->proteger($unite_rangement_des['liasses']['format'])." ";
}
if(!empty($unite_rangement_des['cartons'])) {
$champs[] = "ccb_nb_cartons_herbier = ".$this->bdd->proteger($unite_rangement_des['cartons']['nombre']).", ".
"ccb_format_cartons_herbier = ".$this->bdd->proteger($unite_rangement_des['cartons']['format'])." ";
}
if(!empty($unite_rangement_des['autres'])) {
// Pour éviter de casser les sauts de lignes il faut les remplacer après avoir protégé la valeur
$champs[] = "ccb_autres_unites_rangement = ".str_replace('NEWLINE', "\r\n", $this->bdd->proteger(implode('NEWLINE', $unite_rangement_des['autres'])));
}
$update .= implode(', ', $champs)." ".
"WHERE ccb_id_collection = '".$id_collection."'";
 
$this->bdd->executer($update);
}
}
}
private function parserUniteRangement($unite_rangement) {
$tableau_unite_rangement = explode('||', $unite_rangement);
return array(
'nombre' => $tableau_unite_rangement[0],
'precision' => $tableau_unite_rangement[1],
'format' => $tableau_unite_rangement[2]
);
}
private function formaterLigneAutreUniteRangement($id_ontologie, $ontologie_rangement, $tableau_unite_rangement) {
$nom_rangement = $id_ontologie;
// Des fois on a un numéro d'ontologie des fois un nom de type de rangement
if(!is_numeric($id_ontologie)) {
$nom_rangement = $id_ontologie;
} else if(!empty($ontologie_rangement[$id_ontologie])) {
$nom_rangement = $ontologie_rangement[$id_ontologie]['cmlv_nom'];
} else {
$nom_rangement = 'Type de rangement inconnu';
}
// Le nombre d'unités est directement accolé au type
$tab_autre_ligne_rangement = array($nom_rangement);
if(!empty($tableau_unite_rangement['nombre'])) {
$tab_autre_ligne_rangement[0] .= ' : '.$tableau_unite_rangement['nombre'];
}
// La précision est soit exacte soit approximative
if(!empty($tableau_unite_rangement['precision'])) {
$precision = $tableau_unite_rangement['precision'] == 'E' ? 'exacte' : 'appromixative';
$tab_autre_ligne_rangement[] = 'Précision '.$precision;
}
// Le format est une suite de de type YxZ ou Y et Z sont des longueurs et largeurs
// eventuellement séparés par des virgules s'il y a différents formats
if(!empty($tableau_unite_rangement['format'])) {
$tab_autre_ligne_rangement[] = 'Format '.$tableau_unite_rangement['format'];
}
// On retourne une ligne de la forme "type de rangement : nombre - Précision précision - Format format"
return implode(' - ', $tab_autre_ligne_rangement);
}
private function transformerPeriode($donnees) {
// initialisation
$siecle = array("2233"=>"15",
"2234"=>"16",
"2235"=>"17",
"2236"=>"18",
"2237"=>"19",
"2238"=>"20");
$type = array("2316"=>"Date inconnue",
"2317"=>"Date exacte",
"2318"=>"Antérieure à",
"2319"=>"Postérieure à",
"2320"=>"Date estimée",
"2321"=>"Date inconnue",
"2322"=>"Date exacte",
"2323"=>"Antérieure à",
"2324"=>"Postérieure à",
"2325"=>"Date estimée",
"2326"=>"Encore en activité");
$periode_debut = ""; $periode_fin = "";
if ($donnees["annee_debut"] == "") $donnees["annee_debut"] = "0000";
if($donnees["annee_fin"] == "") $donnees["annee_fin"] = "0000";
// si une date de début ET une date de fin sont indiquées
if ($donnees["annee_debut"] !== "0000" && $donnees["annee_fin"] !== "0000") {
$periode_debut = $donnees["annee_debut"];
$periode_fin = $donnees["annee_fin"];
// si un (ou plusieurs) siècles sont indiqué(s)
} else if($donnees["siecle"] != "") {
// initialisation années début et fin de siècle
$siecles = explode(";;", $donnees["siecle"]);
$siecle_debut = $siecle[$siecles[0]]."01";
$siecle_fin = $siecle[array_pop($siecles)]."99";
// si les centaines de l'année de début et du siècle sont égales
if (substr($donnees["annee_debut"],0,2) == substr($siecle_debut,0,2)) {
$periode_debut = $donnees["annee_debut"];
} else if ($donnees["annee_debut"] != "0000" && $donnees["annee_debut"] < $siecle_debut) {
$periode_debut = $donnees["annee_debut"];
} else {
$periode_debut = $siecle_debut;
}
if (substr($donnees["annee_fin"],0,2) == substr($siecle_fin,0,2)) {
$periode_fin = $donnees["annee_fin"];
} else if ($donnees["annee_fin"] != "0000" && $donnees["annee_fin"] > $siecle_fin) {
$periode_fin = $donnees["annee_fin"];
} else {
$periode_fin = $siecle_fin;
}
} else {
if ($donnees["annee_debut"] !== "0000") $periode_debut = $donnees["annee_debut"];
if($donnees["annee_fin"] !== "0000") $periode_fin = $donnees["annee_fin"];
}
//print_r($donnees); echo $periode_debut." - ".$periode_fin;
return array($periode_debut,$periode_fin);
}
private function transformerBonMauvaisEtat($cle) {
if ($cle==0) $cle="NULL";
$valeur = $cle;
$ontologies = array("2265" => "1",
"2266" => "2",
"2267" => "3",
"2268" => "4",
"2269" => "5",
);
if (isset($ontologies[$cle])) $valeur = $ontologies[$cle];
return $valeur;
}
private function transformerouinon($cle) {
$valeur = $cle;
$ontologies = array("2092" => "non",
"2093" => "oui",
"2094" => "enPartie",
"2239" => "neSaitPas",
"2240" => "peutEtre",
"2241" => "oui",
"2242" => "non",
"2339" => "oui",
"2340" => "non",
"2341" => "enGrandePartie",
"2342" => "neSaitPas)",
"2343" => "parfois",
"2344" => "oui",
"2345" => "non",
"30744" => "indetermine",
"30745" => "oui",
"30746" => "non");
if (isset($ontologies[$cle])) $valeur = $ontologies[$cle];
return $valeur;
}
}
?>
/tags/v1.11-okuzgozu/scripts/modules/communes/Communes.php
New file
0,0 → 1,258
<?php
 
/**
* Exemple lancement:
* /opt/lampp/bin/php -d memory_limit=3500M cli.php communes -a majCoordonnees
*/
 
class Communes extends Script {
private $bdd = null;
private $structures = array();
private $communes = array();
private $nonTrouvees = array();
public function __construct($script_nom, $parametres) {
parent::__construct($script_nom, $parametres);
$this->bdd = new Bdd();
}
public function executer() {
try {
$this->initialiserScript();
$cmd = $this->getParametre('a');
switch ($cmd) {
case "majCoordonnees" :
$this->mettreAJourCoordonneesCommunes(); break;
default :
$this->traiterErreur('Erreur : la commande "%s" n\'existe pas!', array($cmd));
}
} catch (Exception $erreur) {
$this->traiterErreur($erreur->getMessage());
}
}
private function initialiserScript() {
$fichierIni = $this->getScriptChemin().'communes.ini';
if (file_exists($fichierIni)) {
Config::charger($fichierIni);
} else {
$erreur = "Veuillez configurer le projet en créant le fichier 'communes.ini' ".
"dans le dossier du module de script du projet à partir du fichier 'config.defaut.ini'.";
throw new Exception($erreur);
}
}
private function mettreAJourCoordonneesCommunes() {
$this->recupererStructures();
$departements = $this->determinerDepartementsStructures();
$this->recupererCommunes($departements);
$this->chercherCoordonneesVillesStructures();
$this->mettreAJourDonneesStructures();
$this->afficherResultatScript();
}
private function recupererStructures() {
$this->bdd->requeter("USE ".Config::get("tables.bdd_nom_coel"));
$requete = sprintf(
"SELECT cs_id_structure, cs_nom, cs_code_postal, cs_ville FROM %s"
. " JOIN coel_meta_liste_valeur ON cs_ce_truk_pays = cmlv_id_valeur"
. " WHERE cmlv_abreviation IN ('FR', 'RE', 'YT', 'GP', 'MQ', 'GF', 'NC')"
. " AND (cs_latitude IS NULL OR cs_latitude='0' OR Length(Trim(cs_latitude)) = 0)"
. " AND (cs_longitude IS NULL OR cs_longitude='0' OR Length(Trim(cs_longitude)) = 0)"
. " ORDER BY cs_ville",
Config::get("tables.table_structures_coel"));
 
$this->structures = $this->bdd->recupererTous($requete);
}
private function determinerDepartementsStructures() {
$departements = array();
foreach ($this->structures as $index => $structure) {
$codeDepartement = '';
if (strlen($structure['cs_code_postal']) == 5) {
if (substr($structure['cs_code_postal'], 0, 2) > "95") {
$codeDepartement = substr($structure['cs_code_postal'], 0, 3);
} else {
$codeDepartement = substr($structure['cs_code_postal'], 0, 2);
}
}
$this->structures[$index]['departement'] = $codeDepartement;
if (strlen($codeDepartement) > 0 && !in_array($codeDepartement, $departements)) {
$departements[] = $codeDepartement;
}
}
return $departements;
}
private function recupererCommunes($departements) {
foreach ($departements as $index => $codeDepartement) {
$departements[$index] = "'$codeDepartement'";
}
$listeDepartements = implode(',', $departements);
$this->bdd->requeter("USE ".Config::get("tables.bdd_nom_floradata"));
$requete = "SELECT code, nom, wgs84_latitude, wgs84_longitude FROM ".Config::get("tables.table_communes")." ".
"ORDER BY code;";
$communes = $this->bdd->recupererTous($requete);
// reorganiser le tableau en series des tableaux contenant les communes par departement
$communes[0]['recherche'] = self::transformerChainePourRecherche($communes[0]['nom']);
$communesDepartement = array($communes[0]);
$numeroDepartement = substr($communes[0]['code'], 0, 2) > '95' ? substr($communes[0]['code'], 0, 3)
: substr($communes[0]['code'], 0, 2);
for ($index = 1; $index < count($communes); $index ++) {
$numeroDept = substr($communes[$index]['code'],0,2) > '95' ? substr($communes[$index]['code'],0,3)
: substr($communes[$index]['code'],0,2);
if ($numeroDept != $numeroDepartement) {
$this->communes[$numeroDepartement] = $communesDepartement;
$communesDepartement = array();
$numeroDepartement = $numeroDept;
}
$communes[$index]['recherche'] = self::transformerChainePourRecherche($communes[$index]['nom']);
$communesDepartement[] = $communes[$index];
}
$this->communes[$numeroDepartement] = $communesDepartement;
}
private static function transformerChainePourRecherche($chaine, $charset='utf-8') {
$str = htmlentities($chaine, ENT_NOQUOTES, $charset);
$str = preg_replace('#&([A-za-z])(?:acute|cedil|circ|grave|orn|ring|slash|th|tilde|uml);#', '\1', $str);
$str = preg_replace('#&([A-za-z]{2})(?:lig);#', '\1', $str);
$str = preg_replace('#&[^;]+;#', '', $str);
for ($position = 0; $position < strlen($str); $position ++) {
if ($str[$position] == "," || $str[$position] == "-" || $str[$position] == "'") {
$str[$position] = " ";
}
}
return strtolower($str);
}
private function chercherCoordonneesVillesStructures() {
foreach ($this->structures as $index => $structure) {
if (strlen(trim($structure['cs_ville'])) > 0) {
if (strlen(trim($structure['departement'])) > 0) {
$this->structures[$index] = $this->retrouverCoordonneesDansDepartement($structure);
} else {
$this->structures[$index] = $this->retrouverCoordonneesDansListeCommunes($structure);
}
} else {
$this->nonTrouvees[] = $structure;
}
}
}
private function retrouverCoordonneesDansDepartement($structure) {
$villeRecherche = self::transformerChainePourRecherche(($structure['cs_ville']));
$communeTrouvee = null;
// comparaison dans un premier temps si les deux chaines de caracteres sont identiques
// dans un second temps on applique la recherche de sous chaines identiques
foreach ($this->communes[$structure['departement']] as $commune) {
if ($commune['recherche'] == $villeRecherche) {
$communeTrouvee = $commune;
break;
}
}
if (is_null($communeTrouvee)) {
foreach ($this->communes[$structure['departement']] as $commune) {
if (strstr($commune['recherche'], $villeRecherche) !== false) {
$communeTrouvee = $commune;
break;
} else if (strstr($villeRecherche, $commune['recherche']) !== false) {
$communeTrouvee = $commune;
break;
}
}
}
if (!is_null($communeTrouvee)) {
$structure['cs_ville'] = $communeTrouvee['nom'];
$structure['latitude'] = $communeTrouvee['wgs84_latitude'];
$structure['longitude'] = $communeTrouvee['wgs84_longitude'];
} else {
$this->nonTrouvees[] = $structure;
}
return $structure;
}
private function retrouverCoordonneesDansListeCommunes($structure) {
$villeRecherche = self::transformerChainePourRecherche(($structure['cs_ville']));
$communeTrouvee = null;
$codeDepartement = "";
// meme comportement que la methode precedente, mais la recherche est etendue a toutes les communes
// si une commune est trouvee, on lui attribuera le code departement au code postal par defaut
foreach ($this->communes as $departement => $communes) {
foreach ($communes as $commune) {
if ($commune['recherche'] == $villeRecherche) {
$communeTrouvee = $commune;
$codeDepartement = $departement;
break;
}
}
if (is_null($communeTrouvee)) {
foreach ($communes as $commune) {
if (strstr($commune['recherche'], $villeRecherche) !== false) {
$communeTrouvee = $commune;
$codeDepartement = $departement;
break;
} else if (strstr($villeRecherche, $commune['recherche']) !== false) {
$communeTrouvee = $commune;
$codeDepartement = $departement;
break;
}
}
}
}
if (!is_null($communeTrouvee)) {
$structure['cs_ville'] = $communeTrouvee['nom'];
$structure['latitude'] = $communeTrouvee['wgs84_latitude'];
$structure['longitude'] = $communeTrouvee['wgs84_longitude'];
$structure['cs_code_postal'] = $codeDepartement;
} else {
$this->nonTrouvees[] = $structure;
}
return $structure;
}
private function mettreAJourDonneesStructures() {
$this->bdd->requeter("USE ".Config::get("tables.bdd_nom_coel"));
$updates = array();
// pour faire une seule requete de mise a jour, on va pas utiliser l'ordre UPDATE qui n'accepte
// qu'une seule condition, mais l'ordre INSERT en rajoutant a la fin ON DUPLICATE KEY UPDATE
// avec les correspondances au niveau des codes postaux et villes
foreach ($this->structures as $structure) {
if (isset($structure['latitude']) && isset($structure['longitude'])) {
$updates[] = "({$structure['cs_id_structure']},'{$structure['cs_code_postal']}',".
$this->bdd->proteger($structure['cs_ville']).",'{$structure['latitude']}',".
"'{$structure['longitude']}')";
}
}
 
if(!$updates) return;
 
$sql = "INSERT INTO ".Config::get("tables.table_structures_coel")." (cs_id_structure, cs_code_postal, ".
"cs_ville, cs_latitude, cs_longitude) VALUES ".implode(",", $updates)." ".
"ON DUPLICATE KEY UPDATE cs_code_postal=VALUES(cs_code_postal), cs_ville=VALUES(cs_ville), ".
"cs_latitude=VALUES(cs_latitude), cs_longitude=VALUES(cs_longitude);";
$this->bdd->requeter($sql);
}
private function afficherResultatScript() {
$nombreUpdates = count($this->structures) - count($this->nonTrouvees);
$message = "Mise à jour des coordonnées des communes terminée. Les structures qui n'avaient pas de ".
"coordonnées se sont vues attribuer les coordonnées de la commune dans laquelle elles sont situées.\n\n".
"Mises à jour effectuées pour $nombreUpdates structures.\n";
if (count($this->nonTrouvees) > 0) {
$message .= "Des problèmes ont été rencontrées pour les structures suivantes : \n";
foreach ($this->nonTrouvees as $structure) {
$message .= " - {$structure['cs_nom']} ({$structure['cs_ville']}, {$structure['cs_code_postal']})\n";
}
$message .= "Veuillez vérifier le nom de la commune saisi ou aller dans la fiche structure ".
"pour y rajouter les coordonnées longitude/latitude\n";
} else {
$message .= "Vous pourrez toujours par la suite aller dans la fiche structure ".
"pour affiner la précision les coordonnées longitude/latitude au niveau des locaux.\n";
}
print($message);
}
}
 
?>
/tags/v1.11-okuzgozu/scripts/modules/communes/communes.ini
New file
0,0 → 1,5
[tables]
bdd_nom_coel = "tb_coel"
table_structures_coel = "coel_structure"
bdd_nom_floradata = "tb_cel"
table_communes = "cel_zones_geo"
Property changes:
Added: svn:mime-type
+text/plain
\ No newline at end of property
/tags/v1.11-okuzgozu/scripts/modules/import/Import.php
New file
0,0 → 1,656
<?php
/**
* Exemple lancement:
* /opt/lampp/bin/php -d memory_limit=3500M cli.php import -n
*/
class Import extends Script {
private $bdd = null;
private $auteurs = array();
protected $parametres_autorises = array(
'-n' => array(true, false, 'Nom du fichier à importer.'),
'-u' => array(false, false, 'Infos utilisateur sous forme de JSON contenant : id, session et ip'));
protected $table_publication = null;
protected $table_auteur = null;
protected $table_publication_a_auteur = null;
protected $table_meta = null;
protected $table_structure = 'coel_structure'; // @TODO configurer
protected $table_collection = 'coel_collection'; // @TODO configurer
protected $table_collection_bota = 'coel_collection_botanique'; // @TODO configurer
protected $id_table_publication = null;
protected $id_table_publication_personne = null;
protected $id_role_auteur = null;
protected $colonnes_obligatoires = array();
protected $colonnes_acceptees = array();
protected $cache_auteur = array();
protected $auteurs_a_publis = array();
protected $publis_a_auteurs = array();
protected $id_utilisateur = 0;
protected $id_session = 0;
protected $ip_utilisateur = "127.0.01";
const ETAT_AJOUTER = 1;
public function __construct($script_nom, $parametres) {
parent::__construct($script_nom, $parametres);
$this->bdd = new Bdd();
}
public function executer() {
try {
$this->initialiserScript();
$cmd = $this->getParametre('a');
$fichier = $this->getParametre('n');
$utilisateur = $this->getParametre('u');
$this->traiterInfosUtilisateur($utilisateur);
switch ($cmd) {
case "collections" :
$resultat = $this->chargerCollections($fichier); break;
case "publi" :
$resultat = $this->chargerPubli($fichier); break;
default :
$this->traiterErreur('Erreur : la commande "%s" n\'existe pas!', array($cmd));
}
} catch (Exception $erreur) {
$this->traiterErreur($erreur->getMessage());
}
// renvoi du résultat vers la sortie php
// car le script est surtout destiné à être appelé par un web service
echo $resultat;
exit;
}
private function traiterInfosUtilisateur($utilisateur) {
$utilisateur_infos = json_decode($utilisateur, true);
if(!empty($utilisateur_infos)) {
$this->id_utilisateur = !empty($utilisateur_infos['id']) ? $utilisateur_infos['id'] : $this->id_utilisateur;
$this->id_session = !empty($utilisateur_infos['session']) ? $utilisateur_infos['session'] : $this->id_session;
$this->ip_utilisateur = !empty($utilisateur_infos['ip']) ? $utilisateur_infos['ip'] : $this->ip_utilisateur;
}
}
private function initialiserScript() {
$fichierIni = $this->getScriptChemin().'import.ini';
if (file_exists($fichierIni)) {
Config::charger($fichierIni);
} else {
$erreur = "Veuillez configurer le projet en créant le fichier 'import.ini' ".
"dans le dossier du module de script du projet à partir du fichier 'import.defaut.ini'.";
throw new Exception($erreur);
}
$this->colonnes_obligatoires= Config::get('champs_obligatoires');
$this->colonnes_acceptees = Config::get('champs');
$tables = Config::get('tables');
$this->table_publication = $tables['publication'];
$this->table_auteur = $tables['auteur'];
$this->table_publication_a_auteur = $tables['publication_a_auteur'];
$this->table_meta = $tables['meta'];
$this->id_table_publication = $tables['id_table_publication'];
$this->id_table_publication_personne = $tables['id_table_publication_personne'];
$this->id_role_auteur = $tables['id_role_auteur'];
}
 
/**
* Importe des collections botaniques à partir de deux fichiers : $fichier-collections.csv et
* $fichier-collections-bota.csv
* Il faut donc fournir en paramètre seulement le début du nom de fichier. Ex :
* fichiers:
* - rhone-alpes-collections.csv
* - rhone-alpes-collections-bota.csv
* commande :
* - php cli.php import -a collections -n rhone-alpes
*/
private function chargerCollections($fichier) {
 
$separateur = "\t"; // @TODO configurer
$fichierCollections = Config::get('dossiertmp').$fichier . '-collections.csv';
$fichierCollectionsBota = Config::get('dossiertmp').$fichier . '-collections-bota.csv';
 
// vérification existence fichiers
if(!file_exists($fichierCollections)) {
throw new Exception("Le fichier ".Config::get('dossiertmp').$fichierCollections." n'existe pas.");
}
if(!file_exists($fichierCollectionsBota)) {
throw new Exception("Le fichier ".Config::get('dossiertmp').$fichierCollectionsBota." n'existe pas.");
}
 
//ouvrir le fichier - collection
$pointeurCollections = fopen($fichierCollections, "r");
// Chargement de la première colonne (qui contient les noms de colonnes à importer)
$colonnes = fgetcsv($pointeurCollections, 0, $separateur);
$colonnesParNom = array_flip($colonnes);
//var_dump($colonnes);
//var_dump($colonnesParNom);
 
// vérifier le nom des colonnes
// @TODO on verra plus tard
/*if(count($colonnes) < 2 || !array_intersect(array_keys($this->colonnes_obligatoires), $colonnes)) {
// Vérification des colonnes obligatoires et en même temps du séparateur
$erreur = "Le fichier ne contient pas les colonnes obligatoires : ".implode(',', array_keys($this->colonnes_obligatoires))."\n";
$erreur .= "ou bien n'est pas séparé par le caractère ';' ";
throw new Exception($erreur);
}*/
 
$idCollectionsParIdTemp = array();
// parcours du fichier "-collections.csv"
while($ligne = fgetcsv($pointeurCollections, 0, $separateur)) {
//var_dump($ligne);
$nomStructure = $ligne[$colonnesParNom['cc_ce_structure']];
if (empty($nomStructure) || is_numeric($nomStructure)) {
echo "- omission de la structure pour cause de nom chelou [$nomStructure]\n";
continue;
}
// tester l'existence de la structure
$idStructure = $this->verifierExistenceStructureParNom($nomStructure);
// si oui récupérer l'id
//sinon créer la structure et récupérer son id
if ($idStructure === false) {
$idStructure = $this->creerStructure($nomStructure);
}
// remplacer le nom de la structure par son id
// créer les collections et récupérer leur id
// @TODO vérifier qu'elles existent pour ne pas insérer de doublons en relançant le script !!
$idCollection = $this->creerCollection($idStructure, $ligne, $colonnesParNom);
$idCollectionsParIdTemp[$ligne[$colonnesParNom['id']]] = $idCollection;
}
 
// mettre à jour le GUID des collections et des structures
$this->mettreAJourGUIDCollections();
$this->mettreAJourGUIDStructures();
 
//ouvrir le fichier collection botanique
$pointeurCollectionsBota = fopen($fichierCollectionsBota, "r");
// Chargement de la première colonne (qui contient les noms de colonnes à importer)
$colonnesBota = fgetcsv($pointeurCollectionsBota, 0, $separateur);
$colonnesBotaParNom = array_flip($colonnesBota);
//var_dump($colonnesBota);
//var_dump($colonnesBotaParNom);
 
// vérifier les colonnes
// @TODO on verra plus tard
 
// parcours du fichier "-collections-bota.csv"
while($ligne = fgetcsv($pointeurCollectionsBota, 0, $separateur)) {
// remplacer les noms des collections par leur id (créé précédemment)
$ligne[$colonnesBotaParNom['ccb_id_collection']] = $idCollectionsParIdTemp[$ligne[$colonnesBotaParNom['ccb_id_collection']]];
// créer/importer
// @TODO vérifier qu'elles existent pour ne pas insérer de doublons en relançant le script !!
$this->creerCollectionBota($ligne, $colonnesBotaParNom);
}
}
 
/**
* Si une structure ayant pour nom $nomStructure existe, retourne son
* identifiant numérique, sinon retourne false
*/
protected function verifierExistenceStructureParNom($nomStructure) {
$idStructure = false;
$nsp = $this->bdd->proteger($nomStructure);
$requete = "SELECT cs_id_structure FROM " . $this->table_structure
. " WHERE cs_nom = $nsp";
 
$resultat = $this->bdd->recupererTous($requete);
// var_dump($resultat);
if (count($resultat) > 0) {
$idStructure = $resultat[0]['cs_id_structure'];
}
return $idStructure;
}
 
/**
* Crée une structure portant le nom $nomStructure, sans rien fournir d'autre, et
* retourne l'identifiant numérique du novueau tuple
*/
protected function creerStructure($nomStructure) {
$nsp = $this->bdd->proteger($nomStructure);
$requete = "INSERT INTO " . $this->table_structure . " (cs_nom)"
. " VALUES ($nsp)";
//echo "REQ INS: $requete\n";
$this->bdd->executer($requete);
$idStructure = $this->bdd->recupererIdDernierAjout();
 
return $idStructure;
}
 
/**
* Crée une collection en la rattachant à la structure d'id $idStrucutre; la remplit
* avec les données issues de $ligne en se servant de $colonnesParNom pour accéder
* aux valeurs par clés textuelles; retourne l'identifiant numérique du novueau tuple
*/
protected function creerCollection($idStructure, $ligne, $colonnesParNom) {
//echo "Insertion ! : "; var_dump($ligne); echo "<br/>";
$nom = $this->bdd->proteger($ligne[$colonnesParNom['cc_nom']]);
$desc = $this->bdd->proteger($ligne[$colonnesParNom['cc_description']]);
$type = $this->bdd->proteger($ligne[$colonnesParNom['cc_ce_type']]);
$pcd = $this->bdd->proteger($ligne[$colonnesParNom['cc_periode_constitution_debut']]);
$pcf = $this->bdd->proteger($ligne[$colonnesParNom['cc_periode_constitution_fin']]);
$tcl = $this->bdd->proteger($ligne[$colonnesParNom['cc_truk_couverture_lieu']]);
$cst = $this->bdd->proteger($ligne[$colonnesParNom['cc_ce_specimen_type']]);
 
$requete = "INSERT INTO " . $this->table_collection
. " (cc_ce_structure, cc_nom, cc_description, cc_ce_type, cc_periode_constitution_debut, cc_periode_constitution_fin, cc_truk_couverture_lieu, cc_ce_specimen_type)"
. " VALUES ($idStructure, $nom, $desc, $type, $pcd, $pcf, $tcl, $cst)";
//echo "REQ INS: $requete\n";
$this->bdd->executer($requete);
$idCollection = $this->bdd->recupererIdDernierAjout();
return $idCollection;
}
 
/**
* Reconstruit les GUID des structures à partir de leurs ID
*/
protected function mettreAJourGUIDStructures() {
$requete = "UPDATE coel_structure SET cs_guid = CONCAT('urn:lsid:tela-botanica.org:str', cs_id_structure)";
$this->bdd->executer($requete);
}
 
/**
* Reconstruit les GUID des collections à partir de leurs ID
*/
protected function mettreAJourGUIDCollections() {
$requete = "UPDATE coel_collection SET cc_guid = CONCAT('urn:lsid:tela-botanica.org:coll', cc_id_collection)";
$this->bdd->executer($requete);
}
 
/**
* Crée une collection botanique; la remplit avec les données issues de $ligne en se
* servant de $colonnesParNom pour accéder aux valeurs par clés textuelles
*/
protected function creerCollectionBota($ligne, $colonnesBotaParNom) {
//echo "Insertion ! : "; var_dump($ligne); echo "<br/>";
$id = $this->bdd->proteger($ligne[$colonnesBotaParNom['ccb_id_collection']]);
$ceg = $this->bdd->proteger($ligne[$colonnesBotaParNom['ccb_ce_etat_general']]);
$ne = $this->bdd->proteger($ligne[$colonnesBotaParNom['ccb_nbre_echantillon']]);
$spec = $this->bdd->proteger($ligne[$colonnesBotaParNom['ccb_specialite']]);
$ac = $this->bdd->proteger($ligne[$colonnesBotaParNom['ccb_annotation_classement']]);
$ct = $this->bdd->proteger($ligne[$colonnesBotaParNom['ccb_ce_traitement']]);
$ci = $this->bdd->proteger($ligne[$colonnesBotaParNom['ccb_ce_inventaire']]);
$ii = $this->bdd->proteger($ligne[$colonnesBotaParNom['ccb_inventaire_info']]);
$aur = $this->bdd->proteger($ligne[$colonnesBotaParNom['ccb_autres_unite_rangement']]);
$nph = $this->bdd->proteger($ligne[$colonnesBotaParNom['ccb_nb_planches_herbiers']]);
$tcpt = $this->bdd->proteger($ligne[$colonnesBotaParNom['ccb_truk_conservation_papier_type']]);
 
// @TODO comment gérer la colonne "Nombre de parts" ? Faut la mettre dans quoi ?
$requete = "INSERT INTO " . $this->table_collection_bota
. " (ccb_id_collection, ccb_ce_etat_general, ccb_nbre_echantillon, ccb_specialite, ccb_annotation_classement, ccb_ce_traitement, ccb_ce_inventaire,"
. " ccb_inventaire_info, ccb_autres_unites_rangement, ccb_nb_planches_herbiers, ccb_truk_conservation_papier_type)"
. " VALUES ($id, $ceg, $ne, $spec, $ac, $ct, $ci, $ii, $aur, $nph, $tcpt)";
//echo "REQ INS: $requete\n";
$this->bdd->executer($requete);
}
 
private function chargerPubli($fichier) {
// vérification existence fichier
if(!file_exists(Config::get('dossiertmp').$fichier)) {
$erreur = "Le fichier ".Config::get('dossiertmp').$fichier." n'existe pas.";
throw new Exception($erreur);
}
$pointeur = fopen(Config::get('dossiertmp').$fichier, "r");
// Chargement de la première colonne (qui contient les noms de colonnes à importer
$colonnes = fgetcsv($pointeur, 0, ";");
 
// Vérification des colonnes obligatoires et en même temps du séparateur
if(count($colonnes) < 2 || !array_intersect(array_keys($this->colonnes_obligatoires), $colonnes)) {
$erreur = "Le fichier ne contient pas les colonnes obligatoires : ".implode(',', array_keys($this->colonnes_obligatoires))."\n";
$erreur .= "ou bien n'est pas séparé par le caractère ';' ";
throw new Exception($erreur);
}
//TODO: vérifier si les deux index ci dessous ne font pas double emploi
// Création d'un index des colonnes qui seront importées dans la fiche en les associant
// au numéro de colonne dans la feuille csv
$index_colonnes_importees = array_intersect(array_keys($this->colonnes_acceptees), $colonnes);
$colonnes_importees = array();
foreach($index_colonnes_importees as $index_colonne_importee) {
$colonnes_importees[] = $this->colonnes_acceptees[$index_colonne_importee];
}
$index_colonnes_refusees = array_keys(array_diff($colonnes, array_keys($this->colonnes_acceptees)));
// Création d'un index associant chaque numéro de colonne importée à son rôle
// pour y apporter des traitement spécifiques
$index_colonnes_importees = $colonnes;
foreach($index_colonnes_refusees as $colonne_refusee) {
unset($index_colonnes_importees[$colonne_refusee]);
}
$roles_a_num_colonnes = array_flip($index_colonnes_importees);
// Ajout de la colonne nom complet aux champs de la requête
$colonnes_importees[] = 'cpu_fmt_nom_complet';
 
$nb_publis_inserees = 0;
$lignes = array();
while($ligne = fgetcsv($pointeur, 0, ";")) {
$ligne_inseree = array();
// Traitement des champs suivant leur role
foreach($ligne as $index => &$valeur) {
if(!in_array($index, $index_colonnes_refusees)) {
$ligne_inseree[] = $this->traiterChamp($valeur, $index_colonnes_importees[$index]);
}
}
// Ajout du nom complet formaté de la publication
$nom_complet = $this->bdd->proteger($this->formaterNomComplet($ligne, $index_colonnes_importees));
$ligne_inseree[] = $nom_complet;
$id_publication = $this->insererPublication($colonnes_importees, $ligne_inseree);
// TODO: quoi faire en cas d'échec pour une publication ?
if(!empty($id_publication)) {
$nb_publis_inserees++;
// Pour aller plus vite on pourrait éventuellement faire une grosse requete d'ajout des publications
// à personne à la fin, mais ça nous priverait de faire une transaction (TODO: faire une transaction)
$nb_auteurs_lies = $this->insererLiensPublicationAuteurs($id_publication, $ligne[$roles_a_num_colonnes['auteur']]);
}
 
}
return $nb_publis_inserees;
}
private function insererPublication(&$colonnes, &$publication) {
$requete = "INSERT INTO ".$this->table_publication." ".
"(".implode(',', $colonnes).") ".
"VALUES (".implode(",", $publication).")";
$insertion = $this->bdd->executer($requete);
$id_publi = $this->bdd->recupererIdDernierAjout();
 
// Historisation de l'ajout
$histo = $this->creerXmlHisto(array_combine($colonnes, $publication));
$id_meta = $this->historiser($this->id_table_publication, $id_publi, $histo);
// Affectation des méta données concernat l'ajout à la publication
$requete_affectation_meta = "UPDATE ".$this->table_publication." ".
"SET cpu_ce_meta = ".$id_meta." ".
"WHERE cpu_id_publication = ".$id_publi;
 
$this->bdd->executer($requete_affectation_meta);
return $id_publi;
}
protected function insererLiensPublicationAuteurs($id_publication, &$auteurs) {
$colonnes = array('cpuap_id_publication', 'cpuap_id_personne', 'cpuap_id_role', 'cpuap_ce_truk_type', 'cpuap_ordre', 'cpuap_ce_meta');
$requete = "INSERT IGNORE INTO ".$this->table_publication_a_auteur." ".
"(".implode(",", $colonnes).") VALUES ";
// L'ordre des auteurs commence à 1
$ordre_auteur = 1;
// Découpage des différents auteurs
$auteurs_tab = explode(',', $auteurs);
$auteurs_tab = array_filter($auteurs_tab);
// Les auteurs sont normalement cités dans l'ordre dans l'import
foreach($auteurs_tab as $auteur) {
// si les infos auteurs sont un tableau dans le cache alors l'id existe bien en base de données
if(is_array($this->cache_auteur[$auteur])) {
$id_auteur = $this->cache_auteur[$auteur]['cp_id_personne'];
$valeurs = array($id_publication, $id_auteur, $this->id_role_auteur, "NULL", $ordre_auteur, "0");
$requete_insertion = $requete." (".implode(',', $valeurs).") ";
$liaison = $this->bdd->executer($requete_insertion);
// Historisation de l'ajout
$histo = $this->creerXmlHisto(array_combine($colonnes, $liaison));
$cle_liaison = $id_publication.'-'.$this->id_role_auteur.'-'.$id_auteur;
$id_meta = $this->historiser($this->id_table_publication_personne, $cle_liaison, $histo);
// Affectation des méta données concernant l'ajout à la publication à auteur
$requete_affectation_meta = "UPDATE ".$this->table_publication_a_auteur." ".
"SET cpuap_ce_meta = ".$id_meta;
$this->bdd->executer($requete_affectation_meta);
}
// L'ordre des auteurs est conservé même pour ceux qui n'existe pas dans la bdd
$ordre_auteur++;
}
}
protected function creerXmlHisto($donnees) {
// Création du xml de l'enregistrement à historiser
$info = null;
$xml_tpl = '<?xml version="1.0" encoding="UTF-8" ?>'."\n<resultset>\n<row>\n%s</row>\n</resultset>";
$xml = null;
foreach ($donnees as $cle => $valeur) {
// Pour éviter un éventuel double échappement des valeurs
$valeur = stripslashes($valeur);
$valeur = trim($valeur, "'");
if (!is_null($valeur) && $valeur != '') {
$xml .= "<$cle>$valeur</$cle>\n";
}
}
if ($xml !== null) {
$info = sprintf($xml_tpl, $xml);
$info = $this->bdd->proteger($info);
}
return $info;
}
protected function historiser($table_id, $ligne_cle, $info) {
date_default_timezone_set('Europe/Paris');
// Pré-traitement des variables
$info = (is_null($info)) ? 'NULL' : $info;
// Historisation (Ajout des méta-données)
$requete = 'INSERT INTO coel_meta_historique_ligne '.
' (cmhl_ce_table, cmhl_cle_ligne, cmhl_enregistrement, cmhl_date_modification, cmhl_ce_modifier_par, cmhl_ce_etat, cmhl_ip, cmhl_session_id) '.
'VALUES ('.
" $table_id, ".
' "'.$ligne_cle.'", '.
" $info, ".
' "'.date('Y-m-d H:i:s', time()).'", '.
" $this->id_utilisateur, ".
" ".self::ETAT_AJOUTER.", ".
' "'.$this->ip_utilisateur.'", '.
' "'.$this->id_session.'") ';
$resultat = $this->bdd->executer($requete);
return $this->bdd->recupererIdDernierAjout();
}
protected function formaterNomComplet($ligne, $roles) {
$roles = array_flip($roles);
// Intitulé de la publication complet : fmt_auteur, date_parution(année). titre. Editeur (nom), collection, fascicule, indication_nvt. pages.
// indication_nvt = serie_tome
$champs_nom_complet = array('auteur', 'annee', 'titre', 'editeur', 'intitule_revue', 'fascicule', 'serie_tome', 'pages');
$champs_fmt = array();
$fmt_nom_complet = "";
foreach($champs_nom_complet as $champ) {
$index = $roles[$champ];
if(!isset($ligne[$index])) {
$champs_fmt[$champ] = "";
} else {
$champs_fmt[$champ] = $ligne[$index];
}
}
$indication_nvt_pages = array($champs_fmt['serie_tome'], $champs_fmt['pages']);
$indication_nvt_pages = array_filter($indication_nvt_pages, 'strlen');
$indication_nvt_pages = trim(implode(". ", $indication_nvt_pages));
$indication_nvt_pages .= !empty($indication_nvt_pages) ? "." : "";
$annee_titre_editeur = array($champs_fmt['annee'], $champs_fmt['titre'], $champs_fmt['editeur']);
$annee_titre_editeur = array_filter($annee_titre_editeur, 'strlen');
$annee_titre_editeur = trim(implode(". ", $annee_titre_editeur));
$fmt_nom_complet = array($champs_fmt['auteur'],
$annee_titre_editeur,
$champs_fmt['intitule_revue'],
$champs_fmt['fascicule'],
$indication_nvt_pages);
$fmt_nom_complet = array_filter($fmt_nom_complet, 'strlen');
$fmt_nom_complet = implode(", ", $fmt_nom_complet);
return $fmt_nom_complet;
}
private function traiterChamp($valeur, $role) {
switch($role) {
case 'auteur':
$valeur = $this->traiterChampAuteur($valeur);
break;
case 'editeur':
$valeur = 'AUTRE##'.$valeur;
break;
}
return $this->bdd->proteger($valeur);
}
private function traiterChampAuteur($auteur_intitule) {
$auteurs_fmt = array();
$auteurs_tab = explode(',', $auteur_intitule);
foreach($auteurs_tab as $auteur) {
if(!empty(trim($auteur))) {
$auteurs_fmt[] = $this->obtenirInfosAuteur($auteur);
}
}
return implode(', ', $auteurs_fmt);
}
private function obtenirInfosAuteur($auteur_intitule) {
$retour = $auteur_intitule;
// Si on déjà recherché et trouvé (ou non l'auteur)
if(isset($this->cache_auteur[$auteur_intitule])) {
// On renvoie son nom complet formaté s'il existe en bdd ou sinon
// le nom qui a été donné dans la feuille csv
$retour = !empty($this->cache_auteur[$auteur_intitule]['cp_fmt_nom_complet']) ?
$this->cache_auteur[$auteur_intitule]['cp_fmt_nom_complet'] :
$auteur_intitule;
} else {
// Recherche de l'auteur sur un maximum du combinaisons possible des variations
// de son nom et prénom
$auteur = $this->fabriquerCombinaisonsAuteur($auteur_intitule);
$auteur_req = "(".implode(', ', $auteur).")";
$requete = "SELECT cp_id_personne, cp_fmt_nom_complet FROM ".$this->table_auteur." WHERE cp_fmt_nom_complet IN ".$auteur_req;
$infos_auteur = $this->bdd->recupererTous($requete);
// Stockage en cache de la ligne de bdd si trouvé,
// de la valeur brute sinon
if(!empty($infos_auteur)) {
$retour = $infos_auteur[0]['cp_fmt_nom_complet'];
$this->cache_auteur[$auteur_intitule] = $infos_auteur[0];
// Stocker le nom d'auteur sous les deux formes (fmt nom complet et tel que saisi), facilite la recherche
// plus tard lors de la liaison des publications aux auteurs
$this->cache_auteur[$infos_auteur[0]['cp_fmt_nom_complet']] = $infos_auteur[0];
} else {
$retour = $auteur_intitule;
$this->cache_auteur[$auteur_intitule] = $auteur_intitule;
}
}
return $retour;
}
private function fabriquerCombinaisonsAuteur($auteur) {
$auteur = trim($auteur);
$auteurs_formates = array($this->bdd->proteger($auteur));
// Séparation des élements de l'auteur des espaces pour obtenir
// les noms et prénoms (Ex. "Carl Von Linné" => "Carl", "Von", "Linné")
$auteur_tab = explode(' ', $auteur);
$auteur_tab = array_filter($auteur_tab);
$combinaisons = array();
foreach($auteur_tab as &$element_auteur) {
$combinaisons[] = array(
// élement tel quel (Ex: "Linné")
$element_auteur,
// possibilité de l'initiale seule (Ex: "L")
substr($element_auteur, 0, 1),
// possibilité de l'initiale avec un point du genre (Ex: "L.")
substr($element_auteur, 0, 1)."."
);
}
// Fabrication de toutes les combinaisons possibles des parties de noms ci-dessus
// pour deux et trois élements en faisant plusieurs produits cartésiens
// car le nom peut être combiné différement de celui en base de données
// (Ex. : "Carl Von Linné" VS "C. Von Linné" ou "C. V. Linné" ou encore "Von Linné C." etc...)
// C'est moche et pas très élégant mais bon ça marche dans 90% des cas
// On ne teste pas plus que 3 combinaisons, car ça serait très très couteux
// TODO: faire mieux et factoriser les appels ci dessous
if(count($auteur_tab) > 2) {
// Cas du nom à trois parties (genre "Carl Von Linné")
$possibilites_auteurs = $this->cartesian(array($combinaisons[0], $combinaisons[1], $combinaisons[2]));
$possibilites_auteurs = array_merge($possibilites_auteurs, $this->cartesian(array($combinaisons[0], $combinaisons[2], $combinaisons[1])));
$possibilites_auteurs = array_merge($possibilites_auteurs, $this->cartesian(array($combinaisons[1], $combinaisons[2], $combinaisons[0])));
$possibilites_auteurs = array_merge($possibilites_auteurs, $this->cartesian(array($combinaisons[1], $combinaisons[0], $combinaisons[2])));
$possibilites_auteurs = array_merge($possibilites_auteurs, $this->cartesian(array($combinaisons[2], $combinaisons[1], $combinaisons[0])));
$possibilites_auteurs = array_merge($possibilites_auteurs, $this->cartesian(array($combinaisons[2], $combinaisons[0], $combinaisons[1])));
} else {
// Cas du nom à trois parties (genre "Carl Linné")
$possibilites_auteurs = $this->cartesian(array($combinaisons[0], $combinaisons[1]));
$possibilites_auteurs = array_merge($possibilites_auteurs, $this->cartesian(array($combinaisons[1], $combinaisons[0])));
}
$auteurs_formates = array();
foreach($possibilites_auteurs as &$possibilite) {
$initiales = true;
// Suppression des possibilités ne contenant que des initiales avec ou sans point
foreach($possibilite as &$chars) {
$initiales = $initiales && mb_strlen($chars) <= 2;
}
 
if(!$initiales) {
$auteurs_formates[] = $this->bdd->proteger(implode(" ", $possibilite));
}
}
 
return $auteurs_formates;
}
 
// http://stackoverflow.com/questions/6311779/finding-cartesian-product-with-php-associative-arrays
function cartesian($input) {
// filter out empty values
$input = array_filter($input);
$result = array(array());
foreach ($input as $key => $values) {
$append = array();
foreach($result as $product) {
foreach($values as $item) {
$product[$key] = $item;
$append[] = $product;
}
}
$result = $append;
}
return $result;
}
}
?>
/tags/v1.11-okuzgozu/scripts/modules/import/import.ini
New file
0,0 → 1,26
dossiertmp = "/home/aurelien/web/tmp/coel/"
 
[tables]
bdd_nom_coel = "tb_coel"
publication = "coel_publication"
auteur = "coel_personne"
publication_a_auteur = "coel_publication_a_personne"
meta = "coel_meta"
id_role_auteur = 2360;
id_table_publication = 118
id_table_publication_personne = 119;
 
[champs]
editeur = cpu_ce_truk_editeur
intitule_revue = cpu_collection
serie_tome = cpu_indication_nvt
fascicule = cpu_fascicule
annee = cpu_date_parution
pages = cpu_truk_pages
titre = cpu_titre
auteur = cpu_fmt_auteur
mots_cles = cpu_resume_motcle
 
[champs_obligatoires]
titre = cpu_titre
auteur = cpu_fmt_auteur
/tags/v1.11-okuzgozu/scripts/modules/201310-bulk-coord-update.php
New file
0,0 → 1,101
<?php
/*
cat >> /etc/php.d/php.ini // /etc/php5/cli/conf.d/ZZ-mycustom.ini <<EOF
pdo.dsn.testcoel = "mysql:dbname=tb_coel_test;host=localhost"
mysql.default_user = telabotap
mysql.default_password =
EOF
*/
if(PHP_SAPI !== 'cli') exit(1);
 
define('DOUBLE_CHECK', FALSE);
 
date_default_timezone_set('Europe/Paris');
$DIR = dirname(__FILE__); // XXX: PHP-5.3
define("_GEO_STORE_CACHE", $DIR . "/nominatim-coords.cache.ser");
 
require_once($DIR . '/../../jrest/services/Coel.php');
$db = new PDO('testcoel',
@$argv[1] ? $argv[1] : ini_get('mysql.default_user'),
@$argv[2] ? $argv[2] : ini_get('mysql.default_password'),
array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'")) or die('no db');
$cache = @unserialize(file_get_contents(_GEO_STORE_CACHE));
 
if(function_exists('pcntl_signal')) {
// SIGUSR1 handler to save the result during a run
function savecache($signal = FALSE) {
global $cache;
if($cache) {
ksort($cache, SORT_NUMERIC);
file_put_contents(_GEO_STORE_CACHE, serialize($cache));
}
echo "saved " . count($cache) . " results\n";
if($signal == SIGINT) exit;
}
declare(ticks = 1);
pcntl_signal(SIGUSR1, 'savecache');
pcntl_signal(SIGINT, 'savecache');
echo '$ kill -USR1 ' . posix_getpid() . ' # to flush results to disk' . "\n";
}
 
printf("cache already contains %d entries, will start in 4 seconds:\n", count($cache));
sleep(4);
 
// smooth:
$q = "SELECT * FROM coel_structure".
" WHERE cs_latitude IS NULL OR cs_latitude = '' OR cs_longitude IS NULL".
" OR cs_longitude = ''";
foreach($db->query($q)->fetchAll(PDO::FETCH_ASSOC) AS $params) {
$params_override = array('countrycodes' => 'fr,de,ae');
$id = $params['cs_id_structure'];
if(array_key_exists($id, $cache)) {
$db->query(sprintf("UPDATE coel_structure SET cs_latitude = %.9f, cs_longitude = %.9f WHERE cs_id_structure = %d",
$cache[$id]['lat'], $cache[$id]['lon'], $id));
continue;
}
if(array_key_exists($id, @$cache['failed'])) {
if(!DOUBLE_CHECK) continue;
 
// mode texte-libre (plus efficace pour les cas tordus)
$params_override['force-q'] = TRUE;
// cf (très) mauvaise gestion des CP par Nominatim
if($params['cs_ville']) {
unset($params['cs_code_postal']);
}
if($params['cs_adresse_01']) {
$params['cs_adresse_01'] = preg_replace(
'/.*(?:impasse|chemin|route|rue|avenue|boulevard|place|ville)(?:\s(?:du|des|de)\s)?(la\s)?/i',
'',
$params['cs_adresse_01']);
}
}
 
$lonlat = array();
if(Coel::coordGuess(Coel::addrReStruct($params), $lonlat, $params_override)) {
unset($cache['failed'][$id]);
$lat = $lonlat['lat'];
$lon = $lonlat['lon'];
$cache[$id] = $lonlat;
}
else {
$cache['failed'][$id] = FALSE;
}
 
echo "sleep\n";
sleep(1.5);
}
if($cache) {
ksort($cache, SORT_NUMERIC);
file_put_contents(_GEO_STORE_CACHE, serialize($cache));
echo "saved " . count($cache) . " results\n";
}
 
 
 
/* raw:
$q = "SELECT cs_id_structure AS id, cs_adresse_01 AS addr, cs_code_postal AS cp, cs_ville AS city".
" FROM coel_structure".
" WHERE cs_latitude IS NULL OR cs_latitude = '' OR cs_longitude IS NULL OR cs_longitude = ''";
$query = http_build_query(array('q' => implode(',',$q),'accept_language' => 'fr', 'format' => 'json', 'limit' => 1));
var_dump( json_decode(file_get_contents('http://nominatim.openstreetmap.org/search.php?' . $query)) );
*/
/tags/v1.11-okuzgozu/scripts/modules/nominatim-coords.cache.ser
New file
0,0 → 1,0
a:122:{s:6:"failed";a:52:{i:8;b:0;i:16;b:0;i:17;b:0;i:37;b:0;i:38;b:0;i:39;b:0;i:40;b:0;i:41;b:0;i:42;b:0;i:45;b:0;i:48;b:0;i:51;b:0;i:57;b:0;i:61;b:0;i:76;b:0;i:83;b:0;i:84;b:0;i:96;b:0;i:99;b:0;i:101;b:0;i:108;b:0;i:112;b:0;i:115;b:0;i:116;b:0;i:117;b:0;i:127;b:0;i:131;b:0;i:132;b:0;i:133;b:0;i:134;b:0;i:143;b:0;i:169;b:0;i:176;b:0;i:178;b:0;i:180;b:0;i:184;b:0;i:186;b:0;i:188;b:0;i:194;b:0;i:195;b:0;i:204;b:0;i:205;b:0;i:207;b:0;i:218;b:0;i:216;b:0;i:225;b:0;i:226;b:0;i:232;b:0;i:233;b:0;i:102;b:0;i:104;b:0;i:105;b:0;}i:11;a:2:{s:3:"lon";s:10:"-0.5438227";s:3:"lat";s:10:"47.4483286";}i:12;a:2:{s:3:"lon";s:10:"-0.5489874";s:3:"lat";s:10:"47.4646516";}i:13;a:2:{s:3:"lon";s:9:"3.1322205";s:3:"lat";s:10:"42.4805097";}i:14;a:2:{s:3:"lon";s:8:"4.301836";s:3:"lat";s:10:"46.9479664";}i:15;a:2:{s:3:"lon";s:9:"4.8038707";s:3:"lat";s:10:"43.9498261";}i:18;a:2:{s:3:"lon";s:10:"-0.5803125";s:3:"lat";s:10:"44.8482632";}i:44;a:2:{s:3:"lon";s:10:"-1.6310642";s:3:"lat";s:10:"49.6425384";}i:46;a:2:{s:3:"lon";s:10:"-0.3631801";s:3:"lat";s:10:"49.1887287";}i:47;a:2:{s:3:"lon";s:10:"-4.5058358";s:3:"lat";s:10:"48.4046136";}i:49;a:2:{s:3:"lon";s:8:"5.066002";s:3:"lat";s:10:"47.3150612";}i:50;a:2:{s:3:"lon";s:10:"-2.0523099";s:3:"lat";s:10:"48.6315989";}i:56;a:2:{s:3:"lon";s:9:"5.4473307";s:3:"lat";s:10:"43.5274332";}i:58;a:2:{s:3:"lon";s:16:"3.87681030013738";s:3:"lat";s:16:"43.6291320297537";}i:59;a:2:{s:3:"lon";s:9:"5.3784584";s:3:"lat";s:10:"43.3043699";}i:62;a:2:{s:3:"lon";s:16:"5.91079827827169";s:3:"lat";s:11:"43.14333215";}i:63;a:2:{s:3:"lon";s:9:"2.8363166";s:3:"lat";s:10:"42.6648052";}i:64;a:2:{s:3:"lon";s:9:"7.7687352";s:3:"lat";s:9:"48.584718";}i:65;a:2:{s:3:"lon";s:9:"7.0877764";s:3:"lat";s:10:"44.0896899";}i:68;a:2:{s:3:"lon";s:8:"4.839656";s:3:"lat";s:10:"45.7477595";}i:69;a:2:{s:3:"lon";s:10:"-1.5838016";s:3:"lat";s:10:"47.2226785";}i:71;a:2:{s:3:"lon";s:9:"5.3945578";s:3:"lat";s:10:"43.3043085";}i:72;a:2:{s:3:"lon";s:9:"7.2824403";s:3:"lat";s:10:"43.7061009";}i:73;a:2:{s:3:"lon";s:9:"7.2126331";s:3:"lat";s:9:"43.683826";}i:74;a:2:{s:3:"lon";s:10:"-2.0419204";s:3:"lat";s:10:"48.4520101";}i:75;a:2:{s:3:"lon";s:10:"-2.7582501";s:3:"lat";s:10:"47.6564217";}i:77;a:2:{s:3:"lon";s:10:"-1.7046581";s:3:"lat";s:10:"48.1189207";}i:78;a:2:{s:3:"lon";s:16:"5.01227018588307";s:3:"lat";s:10:"47.3199806";}i:80;a:2:{s:3:"lon";s:10:"-0.2000154";s:3:"lat";s:9:"48.896381";}i:81;a:2:{s:3:"lon";s:8:"0.099406";s:3:"lat";s:10:"48.4461656";}i:82;a:2:{s:3:"lon";s:16:"6.05523878947505";s:3:"lat";s:11:"44.57972375";}i:85;a:2:{s:3:"lon";s:9:"4.3635055";s:3:"lat";s:10:"43.8392759";}i:86;a:2:{s:3:"lon";s:10:"-0.5239974";s:3:"lat";s:10:"47.4389178";}i:87;a:2:{s:3:"lon";s:9:"0.3457803";s:3:"lat";s:10:"46.5855853";}i:88;a:2:{s:3:"lon";s:9:"4.8658484";s:3:"lat";s:7:"45.7803";}i:89;a:2:{s:3:"lon";s:16:"4.86896434068218";s:3:"lat";s:10:"45.7809203";}i:92;a:2:{s:3:"lon";s:9:"5.4099494";s:3:"lat";s:10:"43.3366849";}i:93;a:2:{s:3:"lon";s:9:"7.2152758";s:3:"lat";s:10:"48.4160442";}i:94;a:2:{s:3:"lon";s:9:"9.1511201";s:3:"lat";s:10:"42.3071787";}i:97;a:2:{s:3:"lon";s:9:"7.7687352";s:3:"lat";s:9:"48.584718";}i:98;a:2:{s:3:"lon";s:9:"7.3610788";s:3:"lat";s:10:"48.1233845";}i:100;a:2:{s:3:"lon";s:9:"0.2093501";s:3:"lat";s:10:"47.9855138";}i:103;a:2:{s:3:"lon";s:8:"3.594191";s:3:"lat";s:10:"44.3234459";}i:107;a:2:{s:3:"lon";s:9:"3.0831471";s:3:"lat";s:10:"43.1067859";}i:109;a:2:{s:3:"lon";s:9:"3.6067383";s:3:"lat";s:10:"43.9888106";}i:110;a:2:{s:3:"lon";s:9:"2.9410316";s:3:"lat";s:10:"43.3554672";}i:111;a:2:{s:3:"lon";s:7:"4.54668";s:3:"lat";s:9:"43.801172";}i:113;a:2:{s:3:"lon";s:8:"3.895398";s:3:"lat";s:10:"43.6103604";}i:114;a:2:{s:3:"lon";s:9:"3.0210286";s:3:"lat";s:10:"42.5489846";}i:118;a:2:{s:3:"lon";s:15:"2.5067124583061";s:3:"lat";s:9:"42.625636";}i:119;a:2:{s:3:"lon";s:9:"3.8891511";s:3:"lat";s:10:"43.5406819";}i:120;a:2:{s:3:"lon";s:9:"3.8848316";s:3:"lat";s:10:"43.6102528";}i:121;a:2:{s:3:"lon";s:9:"4.8323239";s:3:"lat";s:10:"45.7575958";}i:122;a:2:{s:3:"lon";s:9:"3.8595331";s:3:"lat";s:10:"43.6265077";}i:125;a:2:{s:3:"lon";s:9:"6.1554909";s:3:"lat";s:10:"48.6634331";}i:126;a:2:{s:3:"lon";s:9:"3.8647799";s:3:"lat";s:9:"43.627798";}i:128;a:2:{s:3:"lon";s:9:"3.5105802";s:3:"lat";s:10:"44.5207141";}i:129;a:2:{s:3:"lon";s:9:"3.8876603";s:3:"lat";s:10:"44.1018769";}i:130;a:2:{s:3:"lon";s:9:"2.3513194";s:3:"lat";s:10:"43.2126212";}i:135;a:2:{s:3:"lon";s:9:"2.8999246";s:3:"lat";s:10:"42.6973352";}i:136;a:2:{s:3:"lon";s:9:"2.9046911";s:3:"lat";s:9:"42.674454";}i:137;a:2:{s:3:"lon";s:7:"3.98429";s:3:"lat";s:7:"44.0816";}i:138;a:2:{s:3:"lon";s:9:"3.5121149";s:3:"lat";s:10:"43.3086422";}i:139;a:2:{s:3:"lon";s:16:"3.31031353084267";s:3:"lat";s:11:"43.50446805";}i:140;a:2:{s:3:"lon";s:9:"3.4228618";s:3:"lat";s:10:"43.4603091";}i:141;a:2:{s:3:"lon";s:9:"3.8458746";s:3:"lat";s:9:"43.618658";}i:142;a:2:{s:3:"lon";s:9:"2.9039078";s:3:"lat";s:10:"42.5666882";}i:144;a:2:{s:3:"lon";s:9:"2.3513194";s:3:"lat";s:10:"43.2126212";}i:146;a:2:{s:3:"lon";s:16:"3.52111104512723";s:3:"lat";s:10:"44.5425609";}i:147;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:148;a:2:{s:3:"lon";s:16:"4.29771016061405";s:3:"lat";s:10:"43.9600046";}i:149;a:2:{s:3:"lon";s:16:"2.51337449509777";s:3:"lat";s:10:"43.0542963";}i:150;a:2:{s:3:"lon";s:9:"1.4488105";s:3:"lat";s:10:"43.5933934";}i:151;a:2:{s:3:"lon";s:16:"2.51337449509777";s:3:"lat";s:10:"43.0542963";}i:152;a:2:{s:3:"lon";s:16:"2.51337449509777";s:3:"lat";s:10:"43.0542963";}i:153;a:2:{s:3:"lon";s:16:"2.51337449509777";s:3:"lat";s:10:"43.0542963";}i:154;a:2:{s:3:"lon";s:16:"4.29771016061405";s:3:"lat";s:10:"43.9600046";}i:155;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:156;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:157;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:158;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:159;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:160;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:161;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:162;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:163;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:164;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:165;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:166;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:167;a:2:{s:3:"lon";s:16:"3.35534017046128";s:3:"lat";s:11:"43.59147665";}i:168;a:2:{s:3:"lon";s:9:"6.2395057";s:3:"lat";s:10:"44.0941186";}i:170;a:2:{s:3:"lon";s:9:"5.7812731";s:3:"lat";s:10:"43.8367393";}i:172;a:2:{s:3:"lon";s:9:"6.0500596";s:3:"lat";s:10:"44.3018635";}i:173;a:2:{s:3:"lon";s:9:"5.7625176";s:3:"lat";s:10:"43.7863839";}i:174;a:2:{s:3:"lon";s:9:"5.8841886";s:3:"lat";s:10:"43.7581306";}i:175;a:2:{s:3:"lon";s:9:"6.2330996";s:3:"lat";s:10:"44.0946035";}i:179;a:2:{s:3:"lon";s:9:"4.8093814";s:3:"lat";s:10:"43.9232488";}i:182;a:2:{s:3:"lon";s:9:"5.0460103";s:3:"lat";s:10:"44.0528835";}i:183;a:2:{s:3:"lon";s:8:"4.985276";s:3:"lat";s:10:"43.9329336";}i:185;a:2:{s:3:"lon";s:9:"5.7351226";s:3:"lat";s:10:"45.1881033";}i:187;a:2:{s:3:"lon";s:7:"6.64715";s:3:"lat";s:10:"44.8983176";}i:189;a:2:{s:3:"lon";s:9:"7.5121308";s:3:"lat";s:10:"43.7830924";}i:190;a:2:{s:3:"lon";s:9:"7.1245969";s:3:"lat";s:10:"43.5629037";}i:191;a:2:{s:3:"lon";s:9:"7.5034594";s:3:"lat";s:10:"43.7768398";}i:192;a:2:{s:3:"lon";s:9:"7.2655073";s:3:"lat";s:10:"43.7148783";}i:193;a:2:{s:3:"lon";s:9:"6.8528643";s:3:"lat";s:9:"44.090199";}i:196;a:2:{s:3:"lon";s:9:"4.6275055";s:3:"lat";s:10:"43.6791112";}i:197;a:2:{s:3:"lon";s:9:"4.6259658";s:3:"lat";s:10:"43.6759134";}i:198;a:2:{s:3:"lon";s:9:"6.0212224";s:3:"lat";s:10:"43.1777988";}i:199;a:2:{s:3:"lon";s:9:"6.1532728";s:3:"lat";s:10:"43.1196061";}i:200;a:2:{s:3:"lon";s:9:"6.4553387";s:3:"lat";s:10:"43.5413966";}i:201;a:2:{s:3:"lon";s:9:"6.7391037";s:3:"lat";s:10:"43.4327323";}i:202;a:2:{s:3:"lon";s:9:"5.9348456";s:3:"lat";s:10:"43.6379633";}i:203;a:2:{s:3:"lon";s:9:"5.6951846";s:3:"lat";s:10:"43.6619287";}i:206;a:2:{s:3:"lon";s:9:"5.4000076";s:3:"lat";s:10:"43.2903943";}i:208;a:2:{s:3:"lon";s:9:"0.7002227";s:3:"lat";s:10:"47.3590296";}i:209;a:2:{s:3:"lon";s:9:"5.6561604";s:3:"lat";s:10:"43.7041216";}i:210;a:2:{s:3:"lon";s:7:"4.02664";s:3:"lat";s:7:"48.2956";}i:211;a:2:{s:3:"lon";s:9:"2.3521334";s:3:"lat";s:10:"48.8565056";}i:214;a:2:{s:3:"lon";s:16:"3.08843879058929";s:3:"lat";s:11:"45.77412295";}i:217;a:2:{s:3:"lon";s:16:"2.35279340987799";s:3:"lat";s:11:"48.74728255";}i:234;a:2:{s:3:"lon";s:9:"6.7977564";s:3:"lat";s:10:"47.5102368";}}
/tags/v1.11-okuzgozu/scripts/configurations/config.defaut.ini
New file
0,0 → 1,42
; Encodage : UTF-8
; +------------------------------------------------------------------------------------------------------+
; Info sur l'application
info.nom = Scripts de tests
; Abréviation de l'application
info.abr = SCRIPTS
; Version du Framework nécessaire au fonctionnement de cette application
info.framework.version = 0.3
; Encodage de l'application
encodage_appli = "UTF-8"
; Chemin de l'application (pour l'utiliser dans ce fichier)
chemin_scripts = "php:Framework::getCheminAppli()"
; +------------------------------------------------------------------------------------------------------+
; Débogage
; Indique si oui ou non on veut afficher le débogage.
debogage = true
; Indique si oui ou non on veut lancer le chronométrage
chronometrage = false
 
+------------------------------------------------------------------------------------------------------+
; Paramètrage de la base de données.
; bdd_abstraction : abstraction de la base de données.
; bdd_protocole : Protocole de la base de données.
; bdd_serveur : Nom du serveur de bases de données.
; bdd_utilisateur : Nom de l'utilisateur de la base de données.
; bdd_mot_de_passe : Mot de passe de l'utilisateur de la base de données.
; bdd_nom : Nom de la base de données principale.
; bdd_encodage : Encodage de la base de données principale. Normalement le même que l'application mais au format base de
; données : voir ici : http://dev.mysql.com/doc/refman/5.0/en/charset-charsets.html
; et là: http://www.postgresql.org/docs/8.1/static/multibyte.html pour les correspondances
bdd_abstraction = pdo
bdd_protocole = mysql
bdd_serveur = localhost
bdd_utilisateur = "root"
bdd_mot_de_passe = ""
bdd_nom = ""
bdd_encodage = "utf8"
 
 
; Dossier de base contenant les données d'eFlore (Fichiers TSV et SQL)
dossierDonneesEflore = "/home/telabotap/www/eflore/donnees/"
Property changes:
Added: svn:mime-type
+text/plain
\ No newline at end of property
/tags/v1.11-okuzgozu/scripts/configurations
New file
Property changes:
Added: svn:ignore
+config.ini
/tags/v1.11-okuzgozu/scripts/framework.defaut.php
New file
0,0 → 1,6
<?php
// Inclusion du Framework
// Renomer ce fichier en "framework.php"
// Indiquer ci-dessous le chemin absolu vers le fichier autoload.inc.php de la bonne version du Framework
require_once '/home/www/commun/framework/0.3/Framework.php';
?>
/tags/v1.11-okuzgozu/scripts/cli.php
New file
0,0 → 1,37
<?php
// Encodage : UTF-8
// +-------------------------------------------------------------------------------------------------------------------+
/**
* Initialise le chargement et l'exécution des scripts
*
* Lancer ce fichier en ligne de commande avec :
* <code>/opt/lampp/bin/php cli.php mon_script -a test</code>
*
//Auteur original :
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
* @copyright Tela-Botanica 1999-2008
* @licence GPL v3 & CeCILL v2
* @version $Id$
*/
// +-------------------------------------------------------------------------------------------------------------------+
 
// Le fichier Framework.php du Framework de Tela Botanica doit être appelée avant tout autre chose dans l'application.
// Sinon, rien ne sera chargé.
// Chemin du fichier chargeant le framework requis
$framework = dirname(__FILE__).DIRECTORY_SEPARATOR.'framework.php';
if (!file_exists($framework)) {
$e = "Veuillez paramétrer l'emplacement et la version du Framework dans le fichier $framework";
trigger_error($e, E_USER_ERROR);
} else {
// Inclusion du Framework
require_once $framework;
 
// Ajout d'information concernant cette application
Framework::setCheminAppli(__FILE__);// Obligatoire
Framework::setInfoAppli(Config::get('info'));
 
// Initialisation et lancement du script appelé en ligne de commande
Cli::executer();
}
?>
/tags/v1.11-okuzgozu/src/org/tela_botanica/Coel.gwt.xml
New file
0,0 → 1,30
<module rename-to='coel'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name="com.google.gwt.user.User"/>
<inherits name="com.extjs.gxt.ui.GXT"/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name="com.google.gwt.user.theme.standard.Standard"/>
<!-- <inherits name="com.google.gwt.user.theme.chrome.Chrome"/> -->
<!-- <inherits name="com.google.gwt.user.theme.dark.Dark"/> -->
<!-- Permet d'accélérer le temps de compilation en compilant que pour Firefox > à 1.5 -->
<!-- Bien mettre gecko1_8 (et pas gecko) sinon ne marche pas dans Firefox > à 1.5 -->
<!-- <set-property name="user.agent" value="gecko1_8"/> -->
<!-- <set-property name="user.agent" value="safari"/> -->
 
<!-- Other module inherits -->
<inherits name="com.google.gwt.i18n.I18N"/>
<!-- <inherits name="com.google.gwt.junit.JUnit"/> -->
<extend-property name="locale" values="fr, en"/>
<!-- Specify the app entry point class. -->
<entry-point class="org.tela_botanica.client.Coel"/>
<!-- A décommenter pour activer une compilation spéciale pour le super dev mode -->
<!-- <add-linker name="xsiframe"/> -->
<!-- <set-configuration-property name="devModeRedirectEnabled" value="true"/> -->
 
</module>
/tags/v1.11-okuzgozu/src/org/tela_botanica/Coel-prod.gwt.xml
New file
0,0 → 1,20
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
<module>
<!-- I18n -->
<inherits name="com.google.gwt.i18n.I18N"/>
<extend-property name="locale" values="fr, en"/>
<!-- Log -->
<inherits name="com.google.gwt.logging.Logging"/>
<!-- Pour désactiver les logs -->
<set-property name="gwt.logging.enabled" value="TRUE"/>
<!-- Indique le niveau des logs -->
<set-property name="gwt.logging.logLevel" value="SEVERE"/>
<!-- Activer/Désactiver un Handler de Logs -->
<set-property name="gwt.logging.firebugHandler" value="ENABLED" />
<set-property name="gwt.logging.simpleRemoteHandler" value="DISABLED" />
<set-property name="gwt.logging.consoleHandler" value="DISABLED" />
<set-property name="gwt.logging.developmentModeHandler" value="DISABLED" />
<set-property name="gwt.logging.popupHandler" value="DISABLED" />
<set-property name="gwt.logging.systemHandler" value="DISABLED" />
</module>
/tags/v1.11-okuzgozu/src/org/tela_botanica/Coel-super-dev.gwt.xml
New file
0,0 → 1,23
<module rename-to='coel'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name="com.google.gwt.user.User"/>
<inherits name="com.extjs.gxt.ui.GXT"/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name="com.google.gwt.user.theme.standard.Standard"/>
<!-- <inherits name="com.google.gwt.user.theme.chrome.Chrome"/> -->
<!-- <inherits name="com.google.gwt.user.theme.dark.Dark"/> -->
 
<!-- Other module inherits -->
<inherits name="com.google.gwt.i18n.I18N"/>
<!-- <inherits name="com.google.gwt.junit.JUnit"/> -->
<extend-property name="locale" values="fr, en"/>
<!-- Specify the app entry point class. -->
<entry-point class="org.tela_botanica.client.Coel"/>
<add-linker name="xsiframe"/>
<set-configuration-property name="devModeRedirectEnabled" value="true"/>
</module>
/tags/v1.11-okuzgozu/src/org/tela_botanica/Coel-dev.gwt.xml
New file
0,0 → 1,22
<module rename-to="coel">
<inherits name="org.tela_botanica.Coel"/>
<!-- Log -->
<inherits name="com.google.gwt.logging.Logging"/>
<!-- Pour désactiver les logs -->
<set-property name="gwt.logging.enabled" value="TRUE"/>
<!-- Indique le niveau des logs -->
<set-property name="gwt.logging.logLevel" value="FINEST"/>
<!-- Activer/Désactiver un Handler de Logs -->
<set-property name="gwt.logging.firebugHandler" value="ENABLED" />
<set-property name="gwt.logging.simpleRemoteHandler" value="DISABLED" />
<set-property name="gwt.logging.consoleHandler" value="DISABLED" />
<set-property name="gwt.logging.developmentModeHandler" value="ENABLED" />
<set-property name="gwt.logging.popupHandler" value="DISABLED" />
<set-property name="gwt.logging.systemHandler" value="DISABLED" />
 
<!-- Permet d'accélérer le temps de compilation en compilant que pour Firefox > à 1.5 -->
<!-- Bien mettre gecko1_8 (et pas gecko) sinon ne marche pas dans Firefox > à 1.5 -->
<set-property name="user.agent" value="gecko1_8"/>
<set-property name="locale" value="default"/>
</module>
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/commentaire.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/commentaire.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/reinitialiser.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/reinitialiser.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/erreur.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/erreur.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/annuler.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/annuler.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/accueil.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/accueil.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/images.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/images.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/vcard_supprimer.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/vcard_supprimer.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/application_formulaire_modifier.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/application_formulaire_modifier.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/deconnexion.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/deconnexion.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/commentaire_supprimer.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/commentaire_supprimer.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/ajouter.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/ajouter.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/application_panneau_liste.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/application_panneau_liste.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/utilisateur.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/utilisateur.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/groupe_engrenage.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/groupe_engrenage.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/importer_csv.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/importer_csv.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/Icones.java
New file
0,0 → 1,148
package org.tela_botanica.client.images.icones;
 
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.ImageBundle;
 
public interface Icones extends ImageBundle {
@Resource("aide.png")
AbstractImagePrototype aide();
@Resource("ajax-loader.gif")
AbstractImagePrototype ajaxLoader();
@Resource("ajouter.png")
AbstractImagePrototype ajouter();
@Resource("annuler.png")
AbstractImagePrototype annuler();
@Resource("application_formulaire_modifier.png")
AbstractImagePrototype appFormModifier();
@Resource("application_panneau_liste.png")
AbstractImagePrototype appPanneauListe();
@Resource("application.png")
AbstractImagePrototype application();
@Resource("appliquer.png")
AbstractImagePrototype appliquer();
@Resource("arrow_down.png")
AbstractImagePrototype arrowDown();
@Resource("arrow_up.png")
AbstractImagePrototype arrowUp();
@Resource("bogue.png")
AbstractImagePrototype bogue();
@Resource("coel.png")
AbstractImagePrototype logoCoel();
@Resource("commentaire.png")
AbstractImagePrototype commentaire();
@Resource("connexion.png")
AbstractImagePrototype connexion();
@Resource("deconnexion.png")
AbstractImagePrototype deconnexion();
@Resource("deplier_tout.png")
AbstractImagePrototype deplierTout();
 
@Resource("engrenages.png")
AbstractImagePrototype engrenages();
@Resource("enregistrer.png")
AbstractImagePrototype enregistrer();
@Resource("fleche_bascule.png")
AbstractImagePrototype flecheBascule();
@Resource("fleche_dedans_dehors.png")
AbstractImagePrototype flecheDedansDehors();
@Resource("formulaire_ajouter.png")
AbstractImagePrototype formAjouter();
@Resource("formulaire_modifier.png")
AbstractImagePrototype formModifier();
@Resource("groupe_engrenage.png")
AbstractImagePrototype groupeEngrenage();
@Resource("images.png")
AbstractImagePrototype images();
@Resource("imprimer.png")
AbstractImagePrototype imprimer();
@Resource("importer_csv.png")
AbstractImagePrototype importerCsv();
@Resource("information.png")
AbstractImagePrototype information();
@Resource("lien_externe.png")
AbstractImagePrototype lienExterne();
@Resource("livre_ouvert.png")
AbstractImagePrototype livreOuvert();
@Resource("rafraichir.png")
AbstractImagePrototype rafraichir();
@Resource("replier_tout.png")
AbstractImagePrototype replierTout();
@Resource("resultset_first.png")
AbstractImagePrototype resultsetFirst();
@Resource("resultset_last.png")
AbstractImagePrototype resultsetLast();
@Resource("resultset_next.png")
AbstractImagePrototype resultsetNext();
@Resource("resultset_previous.png")
AbstractImagePrototype resultsetPrevious();
@Resource("script_go.png")
AbstractImagePrototype scriptGo();
@Resource("script_save.png")
AbstractImagePrototype scriptSave();
@Resource("supprimer.png")
AbstractImagePrototype supprimer();
@Resource("importer.png")
AbstractImagePrototype importer();
@Resource("table.png")
AbstractImagePrototype table();
@Resource("utilisateur.png")
AbstractImagePrototype utilisateur();
@Resource("valider.png")
AbstractImagePrototype valider();
 
@Resource("vcard_ajouter.png")
AbstractImagePrototype vcardAjouter();
 
@Resource("vcard_modifier.png")
AbstractImagePrototype vcardModifier();
@Resource("vcard_supprimer.png")
AbstractImagePrototype vcardSupprimer();
@Resource("vcard.png")
AbstractImagePrototype vcard();
@Resource("newspaper.png")
AbstractImagePrototype newspaper();
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/replier_tout.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/replier_tout.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/resultset_last.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/resultset_last.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/vcard_modifier.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/vcard_modifier.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/flux.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/flux.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/arrow_down.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/arrow_down.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/lien_externe.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/lien_externe.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/coel.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/coel.png
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/nouveau.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/nouveau.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/script_save.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/script_save.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/fleche_bascule.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/fleche_bascule.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/information.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/information.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/livre_ouvert.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/livre_ouvert.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/resultset_previous.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/resultset_previous.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/supprimer.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/supprimer.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/valider.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/valider.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/enregistrer.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/enregistrer.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/formulaire_ajouter.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/formulaire_ajouter.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/commentaire_editer.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/commentaire_editer.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/connexion.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/connexion.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/importer.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/importer.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/bogue.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/bogue.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/appliquer.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/appliquer.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/aide.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/aide.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/application.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/application.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/newspaper.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/newspaper.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/trouver.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/trouver.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/ajax-loader.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/ajax-loader.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/fleche_dedans_dehors.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/fleche_dedans_dehors.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/rafraichir.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/rafraichir.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/engrenages.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/engrenages.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/photo_ajouter.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/photo_ajouter.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/formulaire_modifier.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/formulaire_modifier.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/imprimer.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/imprimer.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/table.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/table.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/resultset_next.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/resultset_next.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/vcard_ajouter.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/vcard_ajouter.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/avertissement.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/avertissement.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/photo.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/photo.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/script_go.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/script_go.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/commentaire_ajouter.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/commentaire_ajouter.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/LICENCE.txt
New file
0,0 → 1,16
Licence : Creative Commons Attribution 2.5 License < http://creativecommons.org/licenses/by/2.5/ >
Source : http://www.famfamfam.com/lab/icons/silk/
Voir tous les icônes : http://www.famfamfam.com/lab/icons/silk/previews/index_abc.png
Fichier utilisés : ajouter.png, supprimer.png, application_formulaire_modifier.png, printer.png
------------------------------------------------------------------------------------------------------------------------
Licence: www.fsf.org/licenses/lgpl.html
Nom : engrenages.png (originale : gear.png) / Page web : www.everaldo.com
Nom : groupe_engrenage.png
------------------------------------------------------------------------------------------------------------------------
Licence: http://www.eclipse.org/org/documents/epl-v10.html
Nom : deplier_tout.png (originale : expandall_16x16.gif) / Auteur : Eclipse Project (www.eclipse.org) / Source : www.iconlet.com/info/19295_expandall_16x16
Nom : replier_tout.png(originale : collapseall_16x16.gif) / Auteur : Eclipse Project (www.eclipse.org) / Source : www.iconlet.com/info/20364_collapseall_16x16
------------------------------------------------------------------------------------------------------------------------
Licence : http://www.gnu.org/licenses/lgpl.html
Nom : lien_externe.png (original :) / Auteur : Everaldo Coelho / Source : http://www.iconfinder.net/icondetails/4261/48/
------------------------------------------------------------------------------------------------------------------------
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/arrow_up.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/arrow_up.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/deplier_tout.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/deplier_tout.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/photo_supprimer.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/photo_supprimer.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/vcard.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/vcard.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/resultset_first.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/icones/resultset_first.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/images/Images.java
New file
0,0 → 1,11
package org.tela_botanica.client.images;
 
import org.tela_botanica.client.images.icones.Icones;
 
import com.google.gwt.core.client.GWT;
 
public class Images {
 
public static final Icones ICONES = GWT.create(Icones.class);
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/configuration/Configuration.java
New file
0,0 → 1,137
package org.tela_botanica.client.configuration;
 
import java.util.LinkedHashMap;
 
import com.google.gwt.i18n.client.Dictionary;
 
/**
* Classe chargeant certains paramètres de configuration à partir d'un fichier
* javascript (config.js)
*
* @author Aurélien PERONNET
*
*/
public class Configuration {
 
/**
* Tableau associatif contenant les identifiants des listes
*/
private LinkedHashMap<String, Integer> listesId = new LinkedHashMap<String, Integer>();
/**
* Tableau associatif contenant les identifiants des urls externes
*/
private LinkedHashMap<String, String> urls = new LinkedHashMap<String, String>();
 
/**
* Constructeur sans argument
*/
public Configuration() {
// on utilise le dictionnaire d'internationalisation pour lire les variables du fichier javascript
Dictionary configuration = Dictionary.getDictionary("configuration");
listesId.put("stpr", Integer.valueOf(configuration.get("listeStpr")));
listesId.put("stpu", Integer.valueOf(configuration.get("listeStpu")));
listesId.put("statut", Integer.valueOf(configuration.get("listeStatut")));
listesId.put("fonction", Integer.valueOf(configuration.get("listeFonction")));
listesId.put("botaAcronyme", Integer.valueOf(configuration.get("listeAcronymeBota")));
listesId.put("localStockage", Integer.valueOf(configuration.get("listeStockageLocal")));
listesId.put("meubleStockage", Integer.valueOf(configuration.get("listeStockageMeuble")));
listesId.put("parametreStockage", Integer.valueOf(configuration.get("listeStockageParametre")));
listesId.put("autreCollection", Integer.valueOf(configuration.get("listeCollectionAutre")));
listesId.put("opRestau", Integer.valueOf(configuration.get("listeRestaurationOperation")));
listesId.put("onep", Integer.valueOf(configuration.get("listeONEP")));
listesId.put("autreMateriel", Integer.valueOf(configuration.get("listeMaterielAutre")));
listesId.put("poisonTraitement", Integer.valueOf(configuration.get("listeEmpoisonnement")));
listesId.put("insecteTraitement", Integer.valueOf(configuration.get("listeDesinsectisation")));
listesId.put("actionValorisation", Integer.valueOf(configuration.get("listeValorisationAction")));
listesId.put("continentEtFr", Integer.valueOf(configuration.get("listeContinentEtFr")));
listesId.put("typeRecherche", Integer.valueOf(configuration.get("listeRechercheType")));
listesId.put("pays", Integer.valueOf(configuration.get("listePays")));
listesId.put("typeCollectionNcd", Integer.valueOf(configuration.get("listeTypeCollectionNcd")));
listesId.put("typeCollectionBota", Integer.valueOf(configuration.get("listeTypeCollectionBota")));
listesId.put("typeDepot", Integer.valueOf(configuration.get("listeTypeDepot")));
listesId.put("typeUniteRangement", Integer.valueOf(configuration.get("listeTypeUniteRangement")));
listesId.put("etat", Integer.valueOf(configuration.get("listeEtat")));
listesId.put("etatClassement", Integer.valueOf(configuration.get("listeEtatClassement")));
listesId.put("typeUniteBase", Integer.valueOf(configuration.get("listeTypeUniteBase")));
listesId.put("typePapier", Integer.valueOf(configuration.get("listeTypePapier")));
listesId.put("methodeRangement", Integer.valueOf(configuration.get("listeMethodeRangement")));
listesId.put("methodeFixation", Integer.valueOf(configuration.get("listeMethodeFixation")));
listesId.put("methodeFixationSurSpecimen", Integer.valueOf(configuration.get("listeMethodeFixationSurSpecimen")));
listesId.put("typeEcriture", Integer.valueOf(configuration.get("listeTypeEcriture")));
listesId.put("onpi", Integer.valueOf(configuration.get("listeONPI")));
listesId.put("specimenDegradation", Integer.valueOf(configuration.get("listeSpecimenDegradation")));
listesId.put("supportDegradation", Integer.valueOf(configuration.get("listeSupportDegradation")));
listesId.put("niveauDetermination", Integer.valueOf(configuration.get("listeNiveauDetermination")));
listesId.put("natureVegetale", Integer.valueOf(configuration.get("listeNatureVegetale")));
listesId.put("siecleNaturaliste", Integer.valueOf(configuration.get("listeSiecleNaturaliste")));
listesId.put("dateDebut", Integer.valueOf(configuration.get("listeDateDebut")));
listesId.put("dateFin", Integer.valueOf(configuration.get("listeDateFin")));
listesId.put("onp", Integer.valueOf(configuration.get("listeONP")));
listesId.put("niveauImportance", Integer.valueOf(configuration.get("listeNiveauImportance")));
listesId.put("ea", Integer.valueOf(configuration.get("listeEA")));
listesId.put("typeClassement", Integer.valueOf(configuration.get("listeTypeClassement")));
listesId.put("relationPersonneCollection", Integer.valueOf(configuration.get("listeRelationPersonneCollection")));
listesId.put("inventaireForme", Integer.valueOf(configuration.get("listeInventaireForme")));
listesId.put("inventaireLogiciel", Integer.valueOf(configuration.get("listeInventaireLogiciel")));
listesId.put("inventaireEtat", Integer.valueOf(configuration.get("listeInventaireEtat")));
listesId.put("groupementPrincipe", Integer.valueOf(configuration.get("listeGroupementPrincipe")));
listesId.put("realisationBut", Integer.valueOf(configuration.get("listeRealisationBut")));
listesId.put("ion", Integer.valueOf(configuration.get("listeION")));
listesId.put("typeCommentaireCollection", Integer.valueOf(configuration.get("listeTypeCommentaireCollection")));
listesId.put("prefixe", Integer.valueOf(configuration.get("listePrefixes")));
listesId.put("suffixes", Integer.valueOf(configuration.get("listeSuffixes")));
listesId.put("sexe", Integer.valueOf(configuration.get("listeSexe")));
listesId.put("tel", Integer.valueOf(configuration.get("listeTel")));
listesId.put("dureesIndexation", Integer.valueOf(configuration.get("listeDureesIndexation")));
listesId.put("frequencesIndexation", Integer.valueOf(configuration.get("listeFrequencesIndexation")));
listesId.put("langues", Integer.valueOf(configuration.get("listeLangues")));
listesId.put("nbElementsPage", Integer.valueOf(configuration.get("nbElementsPage")));
listesId.put("relationPersonnePublication", Integer.valueOf(configuration.get("relationPersonnePublication")));
urls.put("base", configuration.get("serviceBaseUrl"));
urls.put("baseAuth", configuration.get("serviceAuthBaseUrl"));
urls.put("cel", configuration.get("celUrl"));
urls.put("remarques", configuration.get("remarquesUrl"));
urls.put("bogue", configuration.get("bogueUrl"));
urls.put("commentaire", configuration.get("commentaireUrl"));
urls.put("consultationCollectionsLieesStructures", configuration.get("consultationCollectionsLieesStructuresUrl"));
urls.put("consultationCollections", configuration.get("consultationCollectionsUrl"));
}
/**
* Accesseur pour l'id d'une liste
*
* @return l'identifiant de la liste ou null s'il n'est pas trouvé
*/
public Integer getListeId(String code) {
if (listesId.containsKey(code)) {
return listesId.get(code);
}
return null;
}
/**
* Accesseur pour l'url de base du serveur jrest
*
* @return une url de la forme http://emplacement_serveur/jrest
*/
public String getServiceBaseUrl() {
return getUrl("base");
}
/**
* Accesseur pour l'url de base du service annuaire::auth
*/
public String getAuthServiceBaseUrl() {
return getUrl("baseAuth");
}
 
 
public String getUrl(String code) {
if (urls.containsKey(code)) {
return urls.get(code);
}
return null;
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/configuration/APropos.java
New file
0,0 → 1,93
package org.tela_botanica.client.configuration;
 
import com.google.gwt.i18n.client.Dictionary;
 
/**
* Classe chargeant certains paramètres de configuration à partir d'un fichier
* javascript (config.js)
*
* @author Aurélien PERONNET
*
*/
public class APropos {
private String appliNom;
private String appliCode;
private String appliVersionNom;
private String appliVersionCode;
private String developpeurs;
private String traducteurs;
private String testeurs;
private String licence;
private String dateHeureCompilation;
private String revisionGlobale;
private String revisionGlobaleServices;
private String versionJavaCompilation;
public APropos() {
// on utilise le dictionnaire d'internationalisation pour lire les variables du fichier javascript
Dictionary apropos = Dictionary.getDictionary("apropos");
appliNom = apropos.get("appliNom");
appliCode = apropos.get("appliCode");
appliVersionNom = apropos.get("appliVersionNom");
appliVersionCode = apropos.get("appliVersionCode");
developpeurs = apropos.get("developpeurs");
testeurs = apropos.get("testeurs");
traducteurs = apropos.get("traducteurs");
licence = apropos.get("licence");
dateHeureCompilation = apropos.get("dateHeureCompilation");
revisionGlobale = apropos.get("revisionGlobale");
revisionGlobaleServices = apropos.get("revisionGlobaleServices");
versionJavaCompilation = apropos.get("versionJavaCompilation");
}
 
public String getAppliNom() {
return appliNom;
}
public String getAppliCode() {
return appliCode;
}
public String getAppliVersionNom() {
return appliVersionNom;
}
public String getAppliVersionCode() {
return appliVersionCode;
}
public String getDeveloppeurs() {
return developpeurs;
}
public String getTraducteurs() {
return traducteurs;
}
public String getLicence() {
return licence;
}
public String getDateHeureCompilation() {
return dateHeureCompilation;
}
public String getRevisionGlobale() {
return revisionGlobale;
}
public String getRevisionGlobaleServices() {
return revisionGlobaleServices;
}
public String getVersionJavaCompilation() {
return versionJavaCompilation;
}
 
public String getTesteurs() {
return testeurs;
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/configuration
New file
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/configuration:r1136-1291
Merged /trunk/src/org/tela_botanica/client/configuration:r11-906,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/configuration:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/ComposantClass.java
New file
0,0 → 1,30
package org.tela_botanica.client;
 
public final class ComposantClass {
public static final String ICONE_AIDE = "icone-aide";
public static final String ICONE_AJOUTER = "icone-ajouter";
public static final String ICONE_BASCULE = "icone-bascule";
public static final String ICONE_BEL = "icone-bel";
public static final String ICONE_CEL = "icone-cel";
public static final String ICONE_CONNEXION = "icone-connexion";
public static final String ICONE_DECONNEXION = "icone-deconnexion";
public static final String ICONE_IMPRIMER = "icone-imprimer";
public static final String ICONE_MODIFIER = "icone-modifier";
public static final String ICONE_PANNEAU_LISTE = "icone-appli-panneau-liste";
public static final String ICONE_PARAMETRE = "icone-param";
public static final String ICONE_PREFERENCE = "icone-preference";
public static final String ICONE_RAFRAICHIR = "icone-rafraichir";
public static final String ICONE_SUPPRIMER = "icone-supprimer";
 
public static final String DETAIL_CORPS_CONTENU = "coel-detail-corps-contenu";
public static final String LABEL = "coel-label";
public static final String FIELDSET = "coel-fieldset";
public static final String CLEAR = "coel-clear";
public static final String META = "coel-meta";
public static final String INDENTATION = "coel-indentation";
public static final String OBLIGATOIRE = "coel-obligatoire";
public static final String OBLIGATOIRE_OK = "coel-obligatoire-ok";
public static final String LIEN_EXTERNE = "coel-lien-externe";
public static final String LARGEUR_COLONNE_ID = "coel-largeur-colonne-id";
public static final String INDICATION_TITRE_PETIT = "coel-indication-titre-petit";
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/ComposantClass.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/ComposantClass.java:r11-68,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/ComposantClass.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/util/Log.java
New file
0,0 → 1,103
package org.tela_botanica.client.util;
 
import java.util.logging.Level;
import java.util.logging.Logger;
 
 
/**
* Classe gérant les los et le deboguage.
* Est une abstraction de la bibliothèque java.util.logging.
* Niveau de log :
* SEVERE (le plus haut)
* WARNING
* INFO
* CONFIG
* FINE
* FINER
* FINEST (le moins haut)
*/
public class Log {
/**
* Modifie le niveau de sortie du déboguage.
* @param message
*/
public static void setNiveau(String niveau) {
Logger.getLogger("").setLevel(Level.parse(niveau));
String message = "Nouveau niveau de Log : "+getNiveau();
Logger.getLogger("").log(Level.ALL , message);
}
/**
* Modifie le niveau de sortie du déboguage.
* @param message
*/
public static String getNiveau() {
return Logger.getLogger("").getLevel().toString();
}
/**
* À utiliser pour les messages d'erreur causant une erreur fatale.
* @param message
*/
public static void fatal(String message) {
Logger.getLogger("").log(Level.SEVERE , message);
}
/**
* À utiliser pour les messages d'erreur ne causant pas d'erreur fatale.
* @param message
*/
public static void error(String message) {
Logger.getLogger("").log(Level.SEVERE , message);
}
/**
* À utiliser pour les messages d'avertissement ne causant pas d'erreur fatale.
* @param message
*/
public static void warn(String message) {
Logger.getLogger("").log(Level.WARNING , message);
}
/**
* À utiliser pour les messages d'avertissement ne causant pas d'erreur fatale.
* @param message
* @param exception
*/
public static void warn(String message, Throwable exception) {
Logger.getLogger("").log(Level.WARNING , message, exception);
}
 
/**
* À utiliser pour les messages d'information qui ne sont pas des erreurs.
* @param message
*/
public static void info(String message) {
Logger.getLogger("").log(Level.INFO , message);
}
/**
* À utiliser pour les messages de déboguage.
* @param message
*/
public static void debug(String message) {
Logger.getLogger("").log(Level.FINE , message);
}
/**
* À utiliser pour les messages de trace normale.
* @param message
*/
public static void trace(String message) {
Logger.getLogger("").log(Level.FINER , message);
}
/**
* À utiliser pour les messages de trace le plus complet.
* @param message
*/
public static void traceFine(String message) {
Logger.getLogger("").log(Level.FINEST , message);
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/util/UtilDAO.java
New file
0,0 → 1,127
package org.tela_botanica.client.util;
 
import java.util.HashMap;
import java.util.Iterator;
 
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.http.client.URL;
 
/**
* @author Gréguoire DUCHÉ <greguoire@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @description La classe utilDAO fournit des méthodes communes pour les outils DAO
* */
public class UtilDAO {
private static String baseUrl = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl();
private static String baseAuthUrl = ((Configuration) Registry.get(RegistreId.CONFIG)).getAuthServiceBaseUrl();
public static final String GET = "GET";
public static final String POST = "POST";
public static final String DELETE = "DELETE";
public static final String PUT = "PUT";
private static final String SEPARATEUR_CHEMIN = "/";
private static final String SEPARATEUR_CLE_VALEUR = "=";
private static final String SEPARATEUR_PARAMETRE = "&";
private static final String SEPARATEUR_CHEMIN_PARAMETRE = "?";
private static final String CONTENU_CHEMIN_VIDE = "*";
 
public static JsonRestRequestBuilder construireRequetePost(String nomService) {
return construireRequete(nomService, null, null, POST);
}
 
public static JsonRestRequestBuilder construireRequetePost(String nomService, String[] parametres) {
return construireRequete(nomService, parametres, null, POST);
}
 
public static JsonRestRequestBuilder construireRequete(String nomService) {
return construireRequete(nomService, null, null, GET);
}
public static JsonRestRequestBuilder construireRequete(String nomService, String[] parametres) {
return construireRequete(nomService, parametres, null, GET);
}
public static JsonRestRequestBuilder construireRequete(String nomService, HashMap<String, String> restrictions) {
return construireRequete(nomService, null, restrictions, GET);
}
public static JsonRestRequestBuilder construireRequete(String nomService, String[] parametres, HashMap<String, String> restrictions) {
return construireRequete(nomService, parametres, restrictions, GET);
}
 
private static JsonRestRequestBuilder construireRequete(String nomService, String[] parametres, HashMap<String, String> restrictions, String typeRequete) {
String restrictionsUrl = construireUrlParametres(restrictions);
String parametresUrl = construireUrlChemin(parametres);
String urlComplete = baseUrl + nomService + parametresUrl + restrictionsUrl;
String urlCompleteEncodee = URL.encode(urlComplete);
JsonRestRequestBuilder jrrb;
if (typeRequete.equals(GET)) {
jrrb = new JsonRestRequestBuilder(JsonRestRequestBuilder.GET, urlCompleteEncodee);
} else {
jrrb = new JsonRestRequestBuilder(JsonRestRequestBuilder.POST, urlCompleteEncodee);
}
return jrrb;
}
private static String construireUrlParametres(HashMap<String, String> parametres) {
String parametresUrl = "";
if (parametres != null && parametres.size() > 0) {
parametresUrl = SEPARATEUR_CHEMIN_PARAMETRE;
Iterator<String> iterateur = parametres.keySet().iterator();
while (iterateur.hasNext()) {
String cle = iterateur.next();
parametresUrl += cle + SEPARATEUR_CLE_VALEUR + parametres.get(cle);
if (iterateur.hasNext()) {
parametresUrl = parametresUrl + SEPARATEUR_PARAMETRE;
}
}
}
return parametresUrl;
}
private static String construireUrlChemin(String[] morceauxDuChemin) {
String cheminUrl = "";
if (morceauxDuChemin != null && morceauxDuChemin.length > 0) {
cheminUrl = SEPARATEUR_CHEMIN;
for (int i = 0; i < morceauxDuChemin.length; i++) {
cheminUrl += (UtilString.isEmpty(morceauxDuChemin[i]) ? CONTENU_CHEMIN_VIDE : morceauxDuChemin[i]) + SEPARATEUR_CHEMIN;
}
}
return cheminUrl;
}
 
/**
* Construit un JsonRestRequestBuilder avec le header Authorization
*/
public static JsonRestRequestBuilder construireRequeteAuth(String nomService, HashMap<String, String> parametres) {
return construireRequeteAuth(nomService, parametres, true);
}
 
/**
* Construit un JsonRestRequestBuilder simple; si authorizationHeader vaut true, ajoute le header
* "Authorization" pour le service d'authentification SSO (annuaire::auth)
*
* @param nomService le nom du service (identite, login, logout...)
* @param parametres tableau de paramètres
* @param boolean authorizationHeader si true, enverra le jeton (si existant) dans un header Authorization
* @return JsonRestRequestBuilder
*/
public static JsonRestRequestBuilder construireRequeteAuth(String nomService, HashMap<String, String> parametres, boolean authorizationHeader) {
String parametresUrl = construireUrlParametres(parametres);
String urlComplete = baseAuthUrl + nomService + parametresUrl;
String urlCompleteEncodee = URL.encode(urlComplete);
JsonRestRequestBuilder jrrb = new JsonRestRequestBuilder(JsonRestRequestBuilder.GET, urlCompleteEncodee, authorizationHeader);
return jrrb;
}
 
public static String getUrlService(String nomService) {
return baseUrl + nomService;
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/util/UtilTruk.java
New file
0,0 → 1,34
package org.tela_botanica.client.util;
 
 
import java.util.Iterator;
import java.util.LinkedList;
 
public class UtilTruk {
/**
* Traite une liste récupéré de truk et renvoie une chaîne de caractère formatée
*
* @param la liste truk
* @param le séparateur pour chaque valeur
* */
public static String traiterTrukListe(LinkedList<String> listTruk, String separateur) {
String listeRetour = "";
Iterator<String> it = listTruk.iterator();
while (it.hasNext()) {
String valeurCourante = it.next();
listeRetour += valeurCourante;
if (it.hasNext()) {
listeRetour += separateur;
}
}
return listeRetour;
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/util/UtilString.java
New file
0,0 → 1,70
package org.tela_botanica.client.util;
 
import java.util.ArrayList;
import java.util.Date;
 
import com.google.gwt.i18n.client.DateTimeFormat;
 
public class UtilString {
/**
* Mets la première lettre d'une chaine en majuscule
*
* @param chaineDeCaractere
* @result ChaineDeCaractere
*/
public static String ucFirst(String inputStr) {
if (isEmpty(inputStr)) {
return "";
}
return inputStr.substring(0,1).toUpperCase() + inputStr.substring(1, inputStr.length());
}
public static String mettrePremiereLettreEnMajuscule(String str) {
return str.substring(0, 1).toUpperCase() + str.substring(1);
}
public static boolean isEmpty(String chaine) {
boolean etreVide = false;
if (chaine == null || chaine.equals("") || chaine.equals("0000-00-00") || chaine.equals("0000-00-00 00:00:00")) {
etreVide = true;
}
return etreVide;
}
public static double formaterEnDouble(String nombre) {
if (!isEmpty(nombre)) {
return Double.parseDouble(nombre);
}
return new Double(0);
}
public static int formaterEnEntier(String nombre) {
if (!isEmpty(nombre)) {
return Integer.parseInt(nombre);
}
return new Integer(0);
}
public static Date formaterEnDate(String dateChaine) {
Date date = null;
if (!isEmpty(dateChaine)) {
if (dateChaine.matches("^[0-9]{4}-00-00$")) {
dateChaine = dateChaine.replaceFirst("^([0-9]{4})-00-00$", "$1-01-01");
} else if (dateChaine.matches("^[0-9]{4}-[0-9]{2}-00$")) {
dateChaine = dateChaine.replaceFirst("^([0-9]{4})-([0-9]{2})-00$", "$1-$2-01");
}
date = UtilDate.formatDateMysql.parseStrict(dateChaine);
}
return date;
}
public static boolean isEmpty(ArrayList<String> entree) {
return !(entree!=null && !entree.toString().equals("[]"));
}
public static boolean isNumber(String str, boolean emptyIsTrue) {
if (emptyIsTrue) return (str.matches("[0-9]*"));
else return (str.matches("[0-9]+"));
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/util/Debug.java
New file
0,0 → 1,34
package org.tela_botanica.client.util;
 
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class Debug {
@Deprecated
public static void log(String texte) {
GWT.log(texte, null);
}
public static String getStackTraceAsString(int depth) {
// a décommenter lors de l'utilisation car ne fonctionne qu'en mode
// hosted et pas en mode compilé
/*StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
String trace = "";
for (int i = 2; i < stackTraceElements.length && i < depth+2; i++) {
if(i != 2) {
trace += " < ";
}
trace += stackTraceElements[i].getClassName()+"."+stackTraceElements[i].getMethodName();
}
return trace;*/
return "";
}
public static native void LogVersFirebug(Object o) /*-{
if (!!($wnd.console && $wnd.console.log)) {
console.log(o);
}
}-*/;
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/util/Analytics.java
New file
0,0 → 1,37
package org.tela_botanica.client.util;
 
public class Analytics {
 
/**
* Envoie une notification à Google Analytics, comme quoi la page "url" a été visitée
*
* @param url adresse ou surnom de la page visitée
*/
public static native void pageVisitee(String url) /*-{
if (url == "") {
url = $wnd.location.href;
}
$wnd.ga('send', 'pageview', url);
}-*/;
 
/**
* Envoie une notification à Google Analytics, comme quoi l'événement "action" a été déclenché
* sur la ressource "categorie"
*
* @param categorie - la ressource sur laquelle l'utilisateur a agi
* @param action - ce que l'utilisateur a fait avec cette ressource
* @param label - un bout de JSON avec des détails
* @param nombre - nombre d'actions à enregistrer
*/
public static native void evenement(String categorie, String action, String label, int nombre) /*-{
$wnd.ga('send', 'event', categorie, action, label, nombre);
}-*/;
 
public static void evenement(String categorie, String action, String label) {
Analytics.evenement(categorie, action, label, 1);
}
 
public static void evenement(String categorie, String action) {
Analytics.evenement(categorie, action, "", 1);
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/util/UtilDate.java
New file
0,0 → 1,27
package org.tela_botanica.client.util;
 
import java.util.Date;
 
import com.google.gwt.i18n.client.DateTimeFormat;
 
public class UtilDate {
public final static DateTimeFormat formatDateMysql = DateTimeFormat.getFormat("yyyy-MM-dd");
public final static DateTimeFormat formatDateFr = DateTimeFormat.getFormat("dd/MM/yyyy");
public static String formaterEnString(Date date) {
String dateChaine = "0000-00-00";
if (date != null) {
dateChaine = formatDateMysql.format(date);
}
return dateChaine;
}
public static String formaterEnStringFormatFr(Date date) {
String dateChaine = "0000-00-00";
if (date != null) {
dateChaine = formatDateFr.format(date);
}
return dateChaine;
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/util/Print.java
New file
0,0 → 1,69
package org.tela_botanica.client.util;
 
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.UIObject;
 
/**
* <pre>
* Generic printing class
* can be used to print the Window it self, DOM.Elements, UIObjects (Widgets) and plain HTML
*
* Usage:
* You must insert this iframe in your host page:
* <iframe id="__printingFrame" style="width:0;height:0;border:0"></iframe>
*
* Window:
* Print.it();
*
* Objects/HTML:
* Print.it(RootPanel.get("myId"));
* Print.it(DOM.getElementById("myId"));
 
* Print.it("Just <b>Print.it()</b>!");
*
* Objects/HTML using styles:
* Print.it("<link rel='StyleSheet' type='text/css' media='paper' href='/paperStyle.css'>", RootPanel.get('myId'));
* Print.it("<style type='text/css' media='paper'> .newPage {page-break-after: always; } </style>","Hi<p class='newPage'></p>By");
* </pre>
*/
public class Print {
 
public static native void it() /*-{
$wnd.print();
}-*/;
 
public static native void it(String html) /*-{
var frame = $doc.getElementById('__printingFrame');
if (!frame) {
$wnd.alert("Error: Can't find printing frame.");
return;
}
frame = frame.contentWindow;
var doc = frame.document;
doc.open();
doc.write(html);
doc.close();
frame.focus();
frame.print();
}-*/;
 
public static void it(UIObject obj) {
it("", obj.getElement().toString());
}
 
public static void it(Element element) {
it("", element.toString());
}
 
public static void it(String style, String it) {
it("<it><header>"+style+"</header><body>"+it+"</body></it>");
}
 
public static void it(String style, UIObject obj) {
it(style, obj.getElement().toString());
}
 
public static void it(String style, Element element) {
it(style, element.toString());
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/util/UtilArray.java
New file
0,0 → 1,20
package org.tela_botanica.client.util;
 
public class UtilArray {
/**
* @see http://leghumped.com/blog/2007/12/20/in_array-and-implode-for-java/
* @param ary
* @param delim
* @return
*/
public static String implode(String[] ary, String delim) {
String out = "";
for (int i = 0; i < ary.length; i++) {
if (i != 0) { out += delim; }
out += ary[i];
}
return out;
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/util/Pattern.java
New file
0,0 → 1,46
package org.tela_botanica.client.util;
 
public class Pattern {
public static final String url = "^(?:(?:ht|f)tp(?:s?)\\:\\/\\/|~/|/)?"+ // Protocol
"(?:\\w+:\\w+@)?"+ // Username:Password
"(?:(?:[-\\w]+\\.)+"+ // Subdomains
"(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2}))"+ // TopLevel Domains
"(?::[\\d]{1,5})?"+ // Port
"(?:(?:(?:/(?:[-\\w~!$+|.,=]|%[a-f\\d]{2})+)+|/)+|\\?|#)?"+ // Directories
"(?:(?:\\?(?:[-\\w~!$+|.,*:]|%[a-f\\d{2}])+=(?:[-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)(?:&(?:[-\\w~!$+|.,*:]|%[a-f\\d{2}])+=(?:[-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)*)*"+ // Query
"(?:#(?:[-\\w~!$+|.,*:=]|%[a-f\\d]{2})*)?$"; // Anchor
public static final String email = "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*"+ // Identité
"@"+ // At
"(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?";// Domaine
public static final String heureMinute = "^(?:[0-1][0-9]|2[0-4])"+ // Heure au format 24h
":"+ // Séparateur d'heure et minute
"(?:[0-5][0-9]|60)$"; // Minutes;
public static final String latitude = "^-?"+ // Nombre positif ou négatif
"([0-8]?[0-9]([.,][0-9]*)?|90)$"; // Nombre décimal allant de 0 à 89 ou nombre entier valant 90 avec pour séparateur des décimales "." ou ","
public static final String longitude = "^-?"+ // Nombre positif ou négatif
"((1[0-7][0-9]|[1-9]?[0-9])([.,][0-9]*)?|180)$"; // Nombre décimal allant de 0 à 179 ou nombre entier valant 180 avec pour séparateur des décimales "." ou ","
/**
* Méthode similaire à la méthode : java.util.Pattern.quote().
* java.util.Pattern n'est pas implémenté par GWT.
* Nous protégeons les caractères spéciaux.
*
* @link http://java.developpez.com/faq/java/?page=langage_chaine
* @param chaine
* @return
*/
public static String quote(String chaine) {
chaine.replace("\\", "\\\\");
String[] caracteresSpeciaux = {".", "$", "[", "]", "(", ")", "{", "}", "^", "?", "*", "+", "-", "|"};
for (int i = 0; i < caracteresSpeciaux.length; i++) {
chaine = chaine.replace(caracteresSpeciaux[i], "\\"+caracteresSpeciaux[i]);
}
return chaine;
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/util/UtilNombre.java
New file
0,0 → 1,23
package org.tela_botanica.client.util;
 
import com.google.gwt.i18n.client.NumberFormat;
 
public class UtilNombre {
public static String formaterEnEntier(double nombre) {
NumberFormat formatNbreEntier = NumberFormat.getFormat("#");
return formatNbreEntier.format(nombre);
}
public static boolean estUnNombre(String str) {
try
{
double d = Double.parseDouble(str);
}
catch(NumberFormatException nfe)
{
return false;
}
return true;
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/util
New file
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.6-muscardin/src/org/tela_botanica/client/util:r1816-1817
Merged /trunk/src/org/tela_botanica/client/util:r11-147,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/util:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/util:r1136-1328
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/http/JsonRestRequestCallback.java
New file
0,0 → 1,97
package org.tela_botanica.client.http;
 
import org.tela_botanica.client.Coel;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.util.Log;
 
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
 
public class JsonRestRequestCallback implements RequestCallback {
 
public void onError(Request request, Throwable exception) {
// Gestion des exceptions déclenchées par l'exécution de la requête
Log.warn(Mediateur.i18nM.erreurServiceJrest(request.toString()), exception);
InfoLogger.display(Mediateur.i18nM.erreurRequeteTitre(), Mediateur.i18nM.erreurRequete(), true);
}
public void onErrorHTTP(Request request, Response reponse) {
// Gestion des erreurs HTTP renvoyé par Apache ou JRest
Information info = null;
if (avoirContenu(reponse)) {
info = new Information("erreur_jrest", JSONParser.parseStrict(reponse.getText()).isArray());
} else {
info = new Information("erreur_jrest");
}
Log.debug("Erreur JREST - Code "+reponse.getStatusCode()+"\n"+info.getMessages().toString());
InfoLogger.display("Erreur JREST - Code "+reponse.getStatusCode(), info.toString(), true);
}
public void onResponseReceived(Request request, Response response) {
// Affichage du débogage.
afficherDebug(response);
// Si le code de réponse HTTP ne vaut pas 200 OK, on lance le mécanisme d'erreur HTTP
if (response.getStatusCode() != 200) {
onErrorHTTP(request, response);
} else {
JSONValue responseValue = null;
if (avoirContenu(response)) {
responseValue = JSONParser.parseStrict(response.getText());
}
surReponse(responseValue);
}
}
 
public void surReponse(JSONValue responseValue) {
}
public String formaterDeboguages(JSONArray jsonArray) {
String deboguageFormate = "";
for (int i = 0 ; i < jsonArray.size() ; i++) {
if (jsonArray.get(i).isString() != null) {
deboguageFormate += jsonArray.get(i).isString().stringValue()+"\n";
}
}
return deboguageFormate;
}
private void afficherDebug(Response reponse) {
if (avoirEnteteDebug(reponse)) {
final JSONValue reponseEnteteDeboguage = JSONParser.parseStrict(reponse.getHeader("X-DebugJrest-Data"));
if (reponseEnteteDeboguage.isArray() != null) {
GWT.log("DEBOGUAGE:\n"+formaterDeboguages(reponseEnteteDeboguage.isArray()), null);
}
}
}
public Boolean avoirEnteteDebug(Response reponse) {
Boolean retour = false;
if (reponse.getHeader("X-DebugJrest-Data") != null && reponse.getHeader("X-DebugJrest-Data").length() != 0) {
retour = true;
}
return retour;
}
public Boolean avoirContenu(Response reponse) {
Boolean retour = false;
if (reponse.getText() != null && reponse.getText().length() != 0) {
retour = true;
} else if (reponse.getText() == null) {
Log.debug("La réponse vaul null");
} else if (reponse.getText().length() == 0) {
Log.debug("La réponse a une taille de 0");
}
return retour;
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/http/JsonRestRequestBuilder.java
New file
0,0 → 1,42
package org.tela_botanica.client.http;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.util.Log;
 
import com.google.gwt.http.client.Request;
import org.tela_botanica.client.http.RequestBuilderWithCredentials;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.URL;
 
public class JsonRestRequestBuilder extends RequestBuilderWithCredentials {
 
// avec header "Authorization"
public JsonRestRequestBuilder(Method httpMethod, String url) {
super(httpMethod, url);
}
 
// ajoute le header "Authorization" si authorizationHeader vaut true
public JsonRestRequestBuilder(Method httpMethod, String url, boolean authorizationHeader) {
super(httpMethod, url, authorizationHeader);
}
public Request envoyerRequete(String donneesRequete, RequestCallback retour) {
Request requeteSortie = null;
try {
requeteSortie = sendRequest(donneesRequete, retour);
String m = this.getHTTPMethod()+" : "+this.getUrl();
m += ( donneesRequete != null ? "\n"+URL.decodeQueryString(donneesRequete) : "");
Log.trace(m);
} catch (RequestException e) {
Log.warn(Mediateur.i18nM.erreurJrest(), e);
}
return requeteSortie;
}
public Request envoyerRequeteSuppression(RequestCallback retour) {
Request requeteSortie = envoyerRequete("action=DELETE", retour);
return requeteSortie;
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/http/RequestBuilderWithCredentials.java
New file
0,0 → 1,27
package org.tela_botanica.client.http;
 
import org.tela_botanica.client.modeles.Utilisateur;
 
import com.google.gwt.http.client.RequestBuilder;
 
public class RequestBuilderWithCredentials extends RequestBuilder {
 
/**
* Crée une requête AJAX avec les headers "Credentials" (pour CORS) et "Authorization" (pour SSO)
*/
public RequestBuilderWithCredentials(Method httpMethod, String url) {
this(httpMethod, url, true);
}
 
/**
* Crée une requête AJAX avec les headers "Credentials" (pour CORS); si authorizationHeader est true,
* ajoute le header "Authorization" pour SSO
*/
public RequestBuilderWithCredentials(Method httpMethod, String url, boolean authorizationHeader) {
super(httpMethod, url);
if(authorizationHeader && Utilisateur.getJeton() != null && ! Utilisateur.getJeton().isEmpty()) {
this.setHeader("Authorization", Utilisateur.getJeton());
}
this.setIncludeCredentials(true);
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/http
New file
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/http:r11-462,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/http:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/http:r1136-1291
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/i18n/Constantes.java
New file
0,0 → 1,568
package org.tela_botanica.client.i18n;
 
import com.google.gwt.i18n.client.ConstantsWithLookup;
 
public interface Constantes extends ConstantsWithLookup{
// Identification
String modeAnonyme();
String identificationTitre();
String motDePasse();
String login();
String identificationMauvaise();
String identificationVerification();
String licence();
String licenceAccepter();
String licenceJaccepte();
// Général
String id();
String chargement();
String oui();
String non();
String peutEtre();
String neSaitPas();
String ok();
String autres();
String nom();
String date();
String lieu();
String informationTitreGenerique();
String total();
String inconnue();
String nonRenseigne();
String donneePublic();
String donneePrivee();
String chercher();
String articleUn();
String articleUne();
String articleLe();
String articleLa();
String format();
// Fenetre aide
String plierDeplierToutBtn();
String sommaire();
// Tooltips
String indicationCreerUneFiche();
String indicationModifierUneFiche();
String indicationSupprimerUneFiche();
String indicationAppliquer();
String indicationAnnuler();
String indicationValider();
String indicationAjouterStatistiqueAccueil();
String indicationEnregistrerAccueil();
String indicationImporterUnePubli();
String telechargerModeleImportPubli();
String importDePubli();
// Boutons
String ajouter();
String modifier();
String supprimer();
String rafraichir();
String appliquer();
String annuler();
String valider();
String importer();
// Formulaire
String champObligatoire();
String champNumerique();
// Pagination
String page();
String sur();
String parPage();
String afficher();
String elements();
// Erreurs
String erreurSaisieTitre();
String demanderValeur();
String valeurDejaPresente();
String selectionnerValeur();
String selectionnerValeurOuNull();
String messageUrlNonValide();
String identificationNecessaire();
// Téléphone
String FIX();
String GSM();
String FAX();
String PORT1();
String PORT2();
// Navigation
String titreNavigation();
// Menu
String titreMenu();
String menuAccueil();
String menuStructure();
String menuCollection();
String menuPersonne();
String menuPublication();
String menuCommentaire();
String menuStats();
// Filtre
String titreFiltre();
// Entête
String identification();
String deconnexion();
String bienvenue();
String aide();
String doc();
String apropos();
String feedback();
String bogue();
String remarques();
String contact();
String applicationExterne();
String cel();
// A Propos
String aproposTitre();
String aproposCode();
String aproposVersion();
String aproposVersionNom();
String aproposRevision();
String aproposRevisionServices();
String aproposLicence();
String aproposTitreCompilation();
String aproposCompilationDate();
String aproposVersionJava();
String aproposTitreFramework();
String aproposGwt();
String aproposGxt();
String aproposTitreNavigateur();
String aproposNavigateur();
String aproposTitreContributeur();
String aproposDeveloppeur();
String aproposTraducteur();
String aproposTesteur();
String aproposTitreLicence();
// +---------------------------------------------------------------------------------------------------------------+
// Accueil
String accueil();
String accueilEnregistrement();
String accueilEnregistrementEnCours();
String accueilEnregistrementSucces();
String accueilChargementSucces();
String publicationNomComplet();
// +---------------------------------------------------------------------------------------------------------------+
// Structure : titres
String structure();
String structureSingulier();
String titreStructureListe();
String titreAjoutFormStructurePanneau();
String titreModifFormStructurePanneau();
// Structure : actions
String suppressionStructure();
String suppressionStructureAPersonne();
// Structure : identification
String structureInfoGeneral();
String titreCommunication();
String titreAdministratif();
String acronyme();
String dateFondation();
String nbrePersonnel();
String description();
String acces();
String usage();
String adresse();
String adresseComplement();
String codePostal();
String ville();
String pays();
String latitude();
String longitude();
String telephone();
String courriel();
String siteWeb();
// Structure : personnel
String structureInfoPersonnel();
String titrePersonnel();
String titreMembre();
String nbrePersonnelCollection();
String fonction();
String courrielPrincipal();
String statut();
String tpsTravail();
String specialite();
String boolContact();
// Structure : collection
String structureInfoCollection();
String structureIndicationCollection();
String structureIndicationLienCollection();
String structureLienCollection();
 
// Structure : conservation
String structureInfoConservation();
String titreLocal();
String localSpecifique();
String titreConservationPersonnel();
String formation();
String formationInteret();
String meubleSpecifique();
String localParametre();
String conservationEnCommun();
String accesControle();
String titreOperation();
String restauration();
String materielConservation();
String traitement();
String titreAcquisition();
String acquisitionCollection();
String acquisitionEchantillon();
String acquisitionTraitement();
String acquisitionTraitementInsecte();
String acquisitionTraitementPoison();
 
// Structure : valorisation
String structureInfoValorisation();
String titreActionValorisation();
String titreRechercherScientifique();
String titreAccesUsage();
String action();
String actionPublication();
String collectionAutre();
String actionFuture();
String recherche();
String rechercheProvenance();
String rechercheType();
String visite();
// +---------------------------------------------------------------------------------------------------------------+
// Collection : liste
String collectionSingulier();
String collectionListeTitre();
String collectionTitreFormAjout();
String collectionTitreFormModif();
String suppressionCollection();
// Collection : détail
String collectionGeneral();
String collectionGeneralTitre();
 
String collectionMere();
String idAlternatifCollectionDetail();
String groupementPrincipe();
String groupementBut();
String couvertureGeo();
String specimenTypeCollectionDetail();
String nbreSpecimenTypeCollectionDetail();
String classementSpecimenTypeCollectionDetail();
 
String collectionUniteRangementEtatGeneralDetail();
String typePapierConservationDetail();
String methodeConservationDetail();
String specimenMethodeFixationDetail();
String etiquetteMethodeFixationSurSupportDetail();
String etiquetteMethodeFixationSurSpecimenDetail();
String typeEcritureDetail();
String collectionTraitementDetail();
String collectionTraitementPoisonDetail();
String collectionTraitementInsecteDetail();
String collectionEtatGeneralDetail();
String degradationSpecimenDetail();
String degradationPresentationDetail();
String collectionDeterminationDetail();
String natureVegetaleContenuDetail();
String specialiteCollectionDetail();
String periodeConstitutionDetail();
String periodeConstitutionDetailForm();
String dateDebutCollectionDetail();
String dateFinCollectionDetail();
String etatClassementCollectionDetail();
String annotationClassementCollectionDetail();
String etiquetteRenseignementDetail();
String etiquetteAuteurCollection();
String etiquetteFamille();
String etiquetteGenre();
String etiquetteSp();
String etiquetteAuteurSp();
String etiquetteLocalite();
String etiquetteDateRecolte();
String precisionLocaliteDetail();
String precisionDateDetail();
String etiquetteAnnotationDetail();
String integreCollectionDetail();
String infoIntegreCollectionDetail();
String existenceInventaireCollectionDetail();
String auteurInventaireCollectionDetail();
String formeInventaireCollectionDetail();
String infoInventaireCollectionDetail();
String digitalInventaireCollectionDetail();
String pourcentDigitalInventaireCollectionDetail();
String etatInventaireCollectionDetail();
// Collection : form
String titreModifFormCollection();
String precisionApproximatif();
String precisionExact();
 
String nomCollection();
String typeCollectionNcd();
String guidCollection();
 
String liaisonTitreCollection();
String lienStructureCollection();
String lienMereCollection();
 
String typeDepot();
String cote();
String idAlternatifCollection();
String intituleAlternatifCollection();
String codeAlternatifCollection();
 
String descriptionSpecialiste();
String historique();
String urlsCollection();
 
String collectionCouvertureTitre();
String groupementPrincipeCollection();
String groupementPrincipeCollectionInfo();
String butCollection();
String lieuCouvertureCollection();
 
String collectionSpecimenTypeTitre();
String specimenTypeCollection();
String specimenTypeCollectionInfo();
String nbreSpecimenTypeCollection();
String precisionNbreSpecimenTypeCollectionChpVide();
String classementSpecimenTypeCollection();
// Collection : Personne liées
String collectionPersonne();
String collectionPersonneTitre();
String chercherPersonneSaisi();
String selectionnerPersonne();
String chargementPersonne();
String typeRelationPersonneCollection();
// Collection : Publications liées
String collectionPublication();
String collectionPublicationTitre();
String chercherPublicationSaisi();
String selectionnerPublication();
String chargementPublication();
String collectionPublicationSource();
String ordre();
String deplacerAuteur();
// Collection : description
String collectionDescription();
String collectionDescriptionTitre();
String collectionEtatGeneralEtNombreEchantillons();
String collectionTitrePrecision();
String typeCollectionBotanique();
String nbreEchantillon();
String nbreEchantillonInfo();
String collectionUniteType();
String collectionUniteNbre();
String collectionUnitePrecision();
String collectionUniteFormat();
String collectionUniteRangementTitre();
String selectionnerUniteRangement();
String collectionUniteRangementSaisirType();
String selectionnerUniteRangementAjoute();
String collectionUniteRangementEtatGeneral();
String collectionUniteRangementEtatGeneralInfo();
String collectionUniteRangementEtatGeneralLabel();
String collectionUniteBaseTitre();
String collectionUniteBase();
String collectionUniteBasePart();
String collectionUniteBaseSp();
String selectionnerUniteBase();
String collectionNbPlanchesHerbier();
String collectionNbEspeces();
String collectionCartonsHerbiers();
String collectionLiasses();
String collectionAutreUnitesRangement();
String collectionUniteBaseSaisirType();
String selectionnerUniteBaseAjoute();
String collectionTitreConservation();
String typePapierConservation();
String methodeConservation();
String collectionTitreEtiquette();
String fixationPourcent();
String specimenFixationPourcent();
String etiquetteFixationPourcent();
String specimenMethodeFixation();
String etiquetteMethodeFixationSurSupport();
String etiquetteMethodeFixationSurSpecimen();
String typeEcriture();
String collectionTitreTraitement();
String collectionTraitement();
String collectionTraitementPoison();
String collectionTraitementInsecte();
String collectionTitreEtatEtDegradation();
String collectionEtatGeneral();
String collectionEtatGeneralInfo();
String degradationSpecimen();
String degradationPresentation();
String degradationPresentationLabel();
String collectionDetermination();
// Collection : contenu
String collectionContenu();
String collectionNatureTitre();
String natureVegetaleContenu();
String specialiteCollection();
String specialiteCollectionInfo();
String collectionConstitutionTitre();
String periodeConstitution();
String dateDebutCollection();
String dateFinCollection();
String dateApproximativeInfo();
String collectionClassementTitre();
String etatClassementCollection();
String annotationClassementCollection();
String annotationClassementCollectionInfo();
String collectionEtiquetteTitre();
String renseignementEtiquetteCollection();
String auteurTitrePourcentCollection();
String famillePourcentCollection();
String genrePourcentCollection();
String spPourcentCollection();
String auteurSpPourcentCollection();
String localitePourcentCollection();
String datePourcentCollection();
String precisionLocaliteCollection();
String precisionDateCollection();
String etiquetteAnnotationCollection();
String etiquetteAnnotationCollectionInfo();
String collectionIntegreeTitre();
String integreCollection();
String infoIntegreCollection();
String infoIntegrationCollection();
 
// Collection : inventaire
String collectionInventaire();
String collectionInventaireTitre();
String existenceInventaireCollection();
String auteurInventaireCollection();
String formeInventaireCollection();
String infoInventaireCollection();
String digitalInventaireCollection();
String pourcentDigitalInventaireCollection();
String etatInventaireCollection();
//DELETEME String typeDonneeInventaireCollection();
String typeDonneeInventaireCollectionInfo();
// Collection : Commentaire liées
String collectionCommentaire();
String collectionCommentaireTitre();
String chercherCommentaireSaisi();
String selectionnerCommentaire();
String chargementCommentaire();
// +---------------------------------------------------------------------------------------------------------------+
//Personne
String personneSingulier();
String personneListeLabel();
String personneModeAjout();
String personneModeModifier();
 
String personneIdentite();
String personnePrefixe();
String personnePrefixeInfo();
String personnePrenom();
String personneNom();
String personneNomAutre();
String personneAbreviation();
String personneAbreviationAutre();
String personneNomComplet();
String personneNaissance();
String personneDateNaissance();
String personneLieuNaissance();
String personneDeces();
String personneEstDecedee();
String personneDecedeeInterogation();
String personneDateDeces();
String personneLieuDeces();
String personneAdresses();
String personneCodePostal();
String personneVille();
String personneCourriel();
String personneLogos();
 
String personneBiographie();
String personneSpecialite();
String personneRecolte();
String personneInfoNat();
String tabPublications();
// +---------------------------------------------------------------------------------------------------------------+
// Publication
String publicationSingulier();
String publicationTitreFormAjout();
String publicationTitreFormModif();
String publicationTitreSuppression();
String publicationAuteursTitre();
String publicationAuteurSingulier();
String publicationAuteurs();
String publicationAuteurBoutonAjouter();
String publicationTitre();
String publicationRevueCollection();
String publicationEditeur();
String publicationDateParution();
String publicationNvt();
String publicationFascicule();
String publicationPage();
// Publications : Personnes liées
String selectionnerAuteur();
// +---------------------------------------------------------------------------------------------------------------+
// Commentaire
String commentaireSingulier();
String commentairePluriel();
String commentaireTitreFormAjout();
String commentaireTitreFormModif();
String commentaireCollection();
String commentaireTitre();
String commentaireTitreSuppression();
String commentaireType();
String commentairePonderation();
String commentaireTexte();
String commentairePublic();
String commentaireMessageTitre();
 
//Pour personne: publications liés
String personnePublication();
String personneOngletPublication();
String typeRelationPersonne();
// Journal
String titreJournal();
String heureMessage();
String message();
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/i18n/Constantes.java:r11-119,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/i18n/Constantes.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/i18n/Constantes.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/i18n/ErrorMessages.java
New file
0,0 → 1,38
package org.tela_botanica.client.i18n;
 
import com.google.gwt.i18n.client.Messages;
 
public interface ErrorMessages extends Messages {
 
// Rafraichir
String erreurRafraichir(Class inClass, Class currentClass);
// Pagination
String elementsAffiches(String labelElement, int de, int a, int total);
// ChampMultiValeur
String valeurNonValideMsg(String exemple);
// Entete
String deconnexion(String nomUtilisateur);
String chargementFenetre(String nomFenetre);
String ouvertureLienExterne(String nomLien);
String ouvertureAppliExterne(String nomAppli);
String titreErreurSaisie();
// Divers
String veuillezSelectionner(String uneValeur);
String selectionObligatoire(String selectionDe, String pour);
String nonImplemente(String codeMenuClique);
String erreurJrest();
String erreurServiceJrest(String service);
String erreurRequete();
String erreurRequeteTitre();
String typeChampMulti();
String erreurJson(String erreur);
String retourSuccesImportPublication(String nb);
String retourSuccesImportPublicationPluriel(String nb);
String retourEchecImportPublication(String erreur);
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/i18n/ErrorMessages.java:r11-464,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/i18n/ErrorMessages.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/i18n/ErrorMessages.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/i18n/Constantes.properties
New file
0,0 → 1,581
# Général
id = Id
chargement = Chargement ...
oui = oui
non = non
peutEtre = peut-être
neSaitPas = ne sait pas
ok = ok
autres = Autres
nom = Nom
date = Date
lieu = Lieu
informationTitreGenerique = Information
total = TOTAL
inconnue = inconnue
nonRenseigne =
donneePublic = Public
donneePrivee = Privé
chercher = Chercher
articleUn = un
articleUne = une
articleLe = le
articleLa = la
format = Format(s)
 
# Tooltips
indicationCreerUneFiche = Cliquez ici pour créer une fiche
indicationModifierUneFiche = Selectionnez une fiche et cliquez ici pour la modifier
indicationSupprimerUneFiche = Selectionnez une fiche et cliquez ici pour la supprimer
indicationAppliquer = Enregistrer les modifications sans fermer le formulaire
indicationAnnuler = Fermer le formulaire sans enregistrer les modifications
indicationValider = Enregistrer les modifications et fermer le formulaire
 
indicationAjouterStatistiqueAccueil = Ajouter une statistique à votre écran d'accueil
indicationEnregistrerAccueil = Enregistrer la position et les statistiques affichées pour les retrouver à chaque connexion
 
indicationImporterUnePubli = Importez des publications à l'aide d'un fichier csv
telechargerModeleImportPubli = Télécharger le modèle d'import de publications
importDePubli = Import de publications
 
# Identification
modeAnonyme = Mode anonyme
identificationTitre = Identification
motDePasse = Mot de passe
login = Courriel
identificationMauvaise = Mauvais login ou mot de passe
identificationVerification = Vérification...
licence = <p>En utilisant l'application Collection En Ligne pour transmettre des données sur les collections, vous acceptez de les mettre à disposition sous une licence Creative Commons.</p>\
<p>A l’image d’Internet, système ouvert de communication électronique entre personnes, nous vous invitons à faire avec nous le choix de contenus ouverts, propres à être re-publiés et ré-utilisés.</p>\
<p>Tela Botanica a choisi de publier par défaut son contenu sous licence libre Creative Commons (by-sa) afin d'en faciliter la divulgation.</p>\
<p>Selon cette licence toutes personne sera libre :</p>\
<ul>\
<li>de reproduire, distribuer et communiquer les données au public</li>\
<li>de les modifier</li>\
</ul>\
<p>Selon les conditions suivantes :</p>\
<ul>\
<li>citer le nom de l'auteur original de l'oeuvre ainsi que celui de Tela Botanica qui l'édite.</li>\
<li>s'il y a modification, transformation ou adaptation des oeuvres, vous n'avez le droit de distribuer la création qui en résulte que sous un contrat identique à celui-ci.</li>\
<li>à chaque réutilisation ou distribution, doit apparaître clairement les conditions contractuelles de mise à disposition de cette création.</li>\
<li>chacune de ces conditions peut être levée s'il y a autorisation du titulaire des droits.</li>\
</ul>
licenceAccepter = Vous devez accepter la licence d'utilisation de cette application pour pouvoir l'utiliser
licenceJaccepte = J'accepte les conditions de la licence utilisateur
 
# Boutons
ajouter = Ajouter
modifier = Modifier
supprimer = Supprimer
rafraichir = Rafraichir
appliquer = Appliquer
annuler = Annuler
valider = Valider
importer = Importer
 
# Formulaire
champObligatoire = Ce champ est obligatoire.
champNumerique = Ce champ doit contenir un nombre
 
# Pagination
page = Page
sur = sur
parPage = par page
afficher = Afficher
elements = elements
 
# Téléphone
FIX = Tél. Fixe
GSM = Tel. Portable
FAX = Fax
PORT2 = Tél. Portable
PORT1 = Tél. Portable
 
# Erreurs
erreurSaisieTitre = Erreur de saisie
demanderValeur = Vous devez saisir une valeur
valeurDejaPresente = La valeur saisie est déjà présente dans la liste
selectionnerValeur = Veuillez sélectionner une valeur
selectionnerValeurOuNull = Veuillez sélectionner une valeur ou laisser le champ vide
messageUrlNonValide = L'URL saisie n'est pas valide !
identificationNecessaire = Veuillez vous identifier pour accéder à cette fonctionnalité !
 
# Navigation
titreNavigation = Navigation
 
# Menus
titreMenu = Menu
menuAccueil = Accueil
menuStructure = Institutions
menuCollection = Collections
menuPersonne = Personnes
menuPublication = Publications
menuCommentaire = Notes
menuStats = Statistiques
 
# Filtre
titreFiltre = Filtre
 
# Entête
identification = Identifiez vous...
deconnexion = Deconnexion
bienvenue = Bienvenue :
aide = Aide
doc = Documentation
apropos = À propos
feedback = Retour d'expériences...
contact = Contactez-nous
bogue = Bogues et fonctionnalités
remarques = Commentaires
applicationExterne = Changez d'application...
cel = Carnet en ligne
 
#Aide
plierDeplierToutBtn = Étendre le sommaire
sommaire = Sommaire
 
# A Propos
aproposTitre = À propos...
aproposCode = Code
aproposVersion = Numéro de version
aproposVersionNom = Nom de la version
aproposRevision = Révision
aproposRevisionServices = Révision des services web
aproposLicence = Licence
aproposTitreCompilation = Compilation
aproposCompilationDate = Date
aproposVersionJava = Version de Java
aproposTitreFramework = Cadre de travail
aproposGwt = Version de GWT
aproposGxt = Version de GXT
aproposTitreNavigateur = Navigateur
aproposNavigateur = COEL fonctionne actuellement dans
aproposTitreContributeur = Contributeurs
aproposDeveloppeur = Développeurs
aproposTraducteur = Traducteurs
aproposTesteur = Testeurs
aproposTitreLicence = Conditions d'utilisation
 
# +--------------------------------------------------------------------------------------------------------------------+
# Accueil
accueil = Page d'accueil
accueilEnregistrement = Enregistrement de votre page d'accueil
accueilEnregistrementEnCours = Veuillez patientez, enregistrement en cours...
accueilEnregistrementSucces = Votre page d'accueil a été correctement enregistrée
accueilChargementSucces = Votre page d'accueil a été correctement chargée
 
# +--------------------------------------------------------------------------------------------------------------------+
publicationNomComplet = Nom complet
 
# +--------------------------------------------------------------------------------------------------------------------+
# Structure : titres
structure = Institution
structureSingulier = institution
titreStructureListe = Institutions
titreAjoutFormStructurePanneau = Ajout d'une institution
titreModifFormStructurePanneau = Modification d'une institution
 
# Structure : actions
suppressionStructure = Suppression d'une institution
suppressionStructureAPersonne = Suppression du personnel de l'institution
 
# Grille/Table personnel
fonction = Fonction
courrielPrincipal = Courriel principal
statut = Statut
tpsTravail = Travail hebdo (%)
specialite = Spécialité principale
boolContact = Contact ?
 
# Structure : identification
structureInfoGeneral = Général
titreAdministratif = Renseignements administratifs
titreCommunication = Communication
acronyme = Acronyme
dateFondation = Date de fondation
nbrePersonnel = Personne travaillant dans l'institution
description = Description
acces = Condition d'accès
usage = Condition d'usage
adresse = Adresse
adresseComplement = Complément d'adresse
codePostal = Code Postal
ville = Ville
pays = Pays
latitude = Latitude
longitude = Longitude
telephone = Téléphone
courriel = Courriel
siteWeb = Site web
 
# Structure : personnel
structureInfoPersonnel = Personnel
titrePersonnel = Personnel
titreMembre = Membres du personnel
nbrePersonnelCollection = Personnel des collections
 
# Structure : collections
structureInfoCollection = Collections liées
structureIndicationCollection = les 10 premières
structureIndicationLienCollection = Voir toutes les collections liées à l'institution dans l'interface de consultation
structureLienCollection = Lien vers la fiche
 
# Structure : conservation
structureInfoConservation = Conservation
titreLocal = Local
titreConservationPersonnel = Formation du personnel à la conservation
titreOperation = Opérations & matériels
titreAcquisition = Acquisitions
formation = Formation en conservation
formationInteret = Intérêt pour une formation
localSpecifique = Locaux spécifiques aux collections
meubleSpecifique = Meubles spécifiques aux collections
localParametre = Paramêtres maîtrisés
conservationEnCommun = Conservation des collections en commun
accesControle = Accès contrôlé
restauration = Opérations actuelles de restauration
materielConservation = Utilisation de matériel de conservation
traitement = Traitements globaux
acquisitionCollection = Acquisition de nouvelles collections
acquisitionEchantillon = Mise en herbier de nouveaux échantillons
acquisitionTraitement = Traitement avant intégration
acquisitionTraitementInsecte = Désinsectisation
acquisitionTraitementPoison = Empoisonnement
 
# Structure : valorisation
structureInfoValorisation = Valorisation
titreActionValorisation = Actions de valorisation
titreRechercherScientifique = Recherches scientifiques
titreAccesUsage = Accès & Usages
action = Réalisation d'actions de valorisation
actionPublication = Publications
collectionAutre = Autres collections
actionFuture = Futures actions de valorisation
recherche = Utilisation pour la recherche
rechercheProvenance = Provenance des chercheurs
rechercheType = Type de recherche
visite = Condition de visite
 
# +--------------------------------------------------------------------------------------------------------------------+
# Collection : liste
collectionSingulier = collection
collectionListeTitre = Collections
suppressionCollection = Suppression d'une collection
collectionTitreFormAjout = Ajout d'une collection
collectionTitreFormModif = Modification d'une collection
 
# Collection : détail
collectionGeneral = Général
 
collectionMere = À pour collection parente
idAlternatifCollectionDetail = Acronymes
 
collectionCouvertureTitre = Couvertures
groupementPrincipe = Principe de groupement
groupementBut = But du groupement
couvertureGeo = Lieux concernés
 
specimenTypeCollectionDetail = Présence
nbreSpecimenTypeCollectionDetail = Nombre
classementSpecimenTypeCollectionDetail = Classement
 
collectionUniteRangementEtatGeneralDetail = État des unités de rangement
typePapierConservationDetail = Type de papier
methodeConservationDetail = Méthode
 
specimenMethodeFixationDetail = Méthode de fixation du spécimen
etiquetteMethodeFixationSurSupportDetail = Méthode de fixation des étiquettes au support
etiquetteMethodeFixationSurSpecimenDetail = Méthode de fixation des étiquettes au spécimen
typeEcritureDetail = Type d'écriture des étiquettes
 
collectionTraitementDetail = Traitement
collectionTraitementPoisonDetail = Empoisonnement
collectionTraitementInsecteDetail = Désinsectisation
 
collectionEtatGeneralDetail = État général
degradationSpecimenDetail = Causes de dégradation des spécimens
degradationPresentationDetail = Causes de dégradation de la présentation
collectionDeterminationDetail = Détermination des échantillons
 
natureVegetaleContenuDetail = Nature de la collection
specialiteCollectionDetail = Collection spécialisée
 
periodeConstitutionDetail = Période de constitution
periodeConstitutionDetailForm = Période de constitution (années début - fin)
dateDebutCollectionDetail = Année de DÉBUT de récolte
dateFinCollectionDetail = Année de FIN de récolte
 
etatClassementCollectionDetail = État du classement
annotationClassementCollectionDetail = Principe de classement
 
etiquetteRenseignementDetail = Renseignements
etiquetteAuteurCollection = auteur ou titre de la collection
etiquetteFamille = famille
etiquetteGenre = genre
etiquetteSp = espèce
etiquetteAuteurSp = auteur de l'espèce
etiquetteLocalite = localité
etiquetteDateRecolte = date de récolte
precisionLocaliteDetail = Localités précises
precisionDateDetail = Dates précises
etiquetteAnnotationDetail = Annotations
 
integreCollectionDetail = Intégration de collection antérieures
infoIntegreCollectionDetail Nom de la collection sur les étiquettes
 
existenceInventaireCollectionDetail = Existence inventaire
auteurInventaireCollectionDetail = Participation de l'auteur
formeInventaireCollectionDetail = Forme de l'inventaire
infoInventaireCollectionDetail = Informations disponibles
digitalInventaireCollectionDetail = Logiciel utilisé
pourcentDigitalInventaireCollectionDetail = % en base de données
etatInventaireCollectionDetail = État inventaire
typeDonneeInventaireCollectionDetail = Éléments inventoriés
 
# Collection : form
titreModifFormCollection = Modification d'une collection
 
precisionApproximatif = Approximatif
precisionExact = Exact
 
nomCollection = Intitulé principal
typeCollectionNcd = Type de collection
 
liaisonTitreCollection = Liens de la collection
lienStructureCollection = Institution hébergeant cette collection
lienMereCollection = Lier cette collection à une autre collection
 
collectionGeneralTitre = Statut, intitulés et codes
typeDepot = Statut
cote = Cote
intituleAlternatifCollection = Autres intitulés
codeAlternatifCollection = Acronymes
idAlternatifCollection = Identifiants alternatifs
guidCollection = Identifiant global unique (GUID)
 
descriptionSpecialiste = Description spécialiste
historique = Historique
urlsCollection = Adresses de sites web concernant la collection
 
groupementPrincipeCollection = Principal but de groupement
groupementPrincipeCollectionInfo = Principal but de groupement au niveau intellectuel plutôt que physique
butCollection = Principal but de réalisation
lieuCouvertureCollection = Couverture géographique (Pays, régions, départements, communes...)
 
collectionSpecimenTypeTitre = Spécimens «types»
specimenTypeCollection = La collection renferme-t-elle des spécimens «types» ?
specimenTypeCollectionInfo = Types : parts d'herbier ayant servi de base pour la publication d'un nom nouveau, par exemple celui d'une espèce considérée comme nouvelle ou d'un nouveau taxon infraspécifique.
nbreSpecimenTypeCollection = Quel est le nombre (exact ou approximatif) de spécimens «types» présents dans la collection ?
precisionNbreSpecimenTypeCollectionChpVide = Indiquez la précision...
classementSpecimenTypeCollection = Comment sont-ils classés ?
 
# Collection : Personne liées
collectionPersonne = Personnes
collectionPersonneTitre = Personne(s) liées à la collection
chercherPersonneSaisi = Chercher une personne saisie...
selectionnerPersonne = Veuillez sélectionner une personne
chargementPersonne = Chargement des Personnes
typeRelationPersonneCollection = Relation
 
# Collection : Publications liées
collectionPublication = Publications
collectionPublicationTitre = Publication(s) de la collection
chercherPublicationSaisi = Chercher une publication saisie...
selectionnerPublication = Veuillez sélectionner une publication
chargementPublication = Chargement des publications
collectionPublicationSource = Source
 
# Collection : Description
collectionDescription = Description
collectionDescriptionTitre = Description et état de la collection
collectionEtatGeneralEtNombreEchantillons = Etat général et nombre d'échantillons
collectionTitrePrecision = Précisions
typeCollectionBotanique = Type de collection
nbreEchantillon = Nombre de cartons ou liasses échantillonnés
nbreEchantillonInfo = Privilégier les cartons contenant les Ombellifères ou Apiaceae, les Crucifères ou Brassicaceae et les Composées ou Asteraceae
collectionUniteType = Type d'unité
collectionUniteNbre = Nombre
collectionUnitePrecision = Précision
collectionUniteFormat = Format
collectionUniteRangementTitre = Types d'unité de rangement de la collection botanique
selectionnerUniteRangement = une unité de rangement
collectionUniteRangementSaisirType = Veuillez saisir le type d'unité de rangement :
selectionnerUniteRangementAjoute = Seules les unités de rangement ajoutées peuvent être supprimées
collectionUniteRangementEtatGeneral = État de la majorité des unités de rangements
collectionUniteRangementEtatGeneralInfo = État des rubans, des poignées, des sangles, des cartons...
collectionUniteRangementEtatGeneralLabel = État général :
collectionUniteBaseTitre = Types d'unité de base de la collection si différent de l'untité de rangement
collectionUniteBaseExemple = Ex. : si l'unité de rangement est un carton, l'unité de base peut être une enveloppe
collectionUniteBase = Unité de base
collectionUniteBasePart = Parts
collectionUniteBaseSp = Espèces
selectionnerUniteBase = une unité de base
collectionNbPlanchesHerbier = Planches d'herbier
collectionNbEspeces = Nombres d'espèces
collectionCartonsHerbiers = Cartons d'herbiers
collectionLiasses = Liasses
collectionAutreUnitesRangement = Autres unités de rangement
collectionUniteBaseSaisirType = Veuillez saisir le type d'unité de base :
selectionnerUniteBaseAjoute = Seules les unités de base ajoutées peuvent être supprimées
collectionTitreConservation = Conservation
typePapierConservation = Quel est le type du papier de conservation ?
methodeConservation = Comment les échantillons sont-ils conservés ?
collectionTitreEtiquette = Étiquettes
fixationPourcent = Les spécimens et leurs étiquettes sont-ils fixés ou libres ?
specimenFixationPourcent = % de spécimens fixés
etiquetteFixationPourcent = % d'étiquettes fixées
specimenMethodeFixation = Si les spécimens sont fixés, de quelle(s) manière(s) ?
etiquetteMethodeFixationSurSupport = Si les étiquettes sont fixées au support, de quelle(s) manière(s) ?
etiquetteMethodeFixationSurSpecimen = Si les étiquettes sont fixées aux spécimens, de quelle(s) manière(s) ?
typeEcriture = Quel est le type d'écriture des étiquettes ?
collectionTitreTraitement = Traitements
collectionTraitement = La collection botanique semble-t-elle avoir été empoisonnée ou désinsectisée lors de sa réalisation ?
collectionTraitementPoison = Si oui, avec quel produit pour l'empoisonnement ?
collectionTraitementInsecte = Si oui, avec quel produit pour la désinsectisation ?
collectionTitreEtatEtDegradation = État général et dégradation
collectionEtatGeneral = Quel est l'état général de la collection ?
collectionEtatGeneralInfo = Grosses attaques d'insectes, pourriture, papier très fragile, etc...)
degradationSpecimen = Quelles sont les causes de dégradation des spécimens ?
degradationPresentation = Quelles sont les causes de dégradation de la présentation ?
degradationPresentationLabel = 1 : les spécimens et les étiquettes libres et mélangés, herbier non consultable, restauration à faire d'urgence ; 2 : les spécimens et les étiquettes libres et un peu mélangés ; 3 : les spécimens et les étiquettes libres ou en partie fixés et non mélangés, herbier consultable, fixation à envisager ; 4 = les spécimens et les étiquettes majoritairement fixés, peu de restauration à faire ; 5 = chaque spécimen a son étiquette et les deux sont bien fixés et non mélangés.
collectionDetermination = Les échantillons sont-ils déterminables ?
 
# Collection : Contenu
collectionContenu = Contenu
collectionNatureTitre = Nature
natureVegetaleContenu = Quelle est la nature de la collection ?
specialiteCollection = Cette Collection est-elle spécialisée ?
specialiteCollectionInfo = (ex. herbier de céréales, herbier horticole, plantes médicinales, ethnobatique, mission particulière, ...)
collectionConstitutionTitre = Période de constitution
periodeConstitution = Quelle est la période de constitution ?
dateDebutCollection = Quelle est la date extrême de DÉBUT de récolte des spécimens ?
dateFinCollection = Quelle est la date extrême de FIN de récolte des spécimens ?
dateApproximativeInfo = Notes : si vous ne connaissez que l'année, sélectionnez le 1er janvier de l'année en question. Si vous connaissez l'année et le mois mais pas le jour, sélectionnez le 1er jour du mois.
collectionClassementTitre = Classement
etatClassementCollection = Quel est l'état du classement ?
annotationClassementCollection = Quel est le classement de la collection ?
annotationClassementCollectionInfo = Notes : indiquer le type de classement comme une classification connue, une flore, l'ordre alphabétique des familles... Si l'identification du classement n'est pas possible mais que des numéros sont notés, en relever quelques-uns avec les espèces correspondantes.
collectionEtiquetteTitre = Étiquette
renseignementEtiquetteCollection = Quels sont les renseignements portés sur l'étiquette ou sur la part ?
auteurTitrePourcentCollection = % portant le nom de l'auteur ou le titre de la collection
famillePourcentCollection = % portant le nom de la famille
genrePourcentCollection = % portant le nom de genre
spPourcentCollection = % portant le nom de l'espèce
auteurSpPourcentCollection = % portant le nom de l'auteur de l'espèce
localitePourcentCollection = % portant la localité de récolte
datePourcentCollection = % portant la date de récolte
precisionLocaliteCollection = Les localités sont-elles précises ?
precisionDateCollection = Les dates sont-elles complète ?
etiquetteAnnotationCollection = Autres annotations
etiquetteAnnotationCollectionInfo = Dons, annotations personnelles, recettes, utilisations médicales...
collectionIntegreeTitre = Collections intégrées
integreCollection = La collection observée intègre-t-elle des collections botaniques antérieures ?
infoIntegreCollection = Les noms de ces collections sont-ils-notés sur les étiquettes de chaque échantillon ?
infoIntegrationCollection = Notes : si la collection en intègre d'autres, vous pouvez créer ces collections et les lier à la collection actuelle ou l'indiquer dans le champ "Description spécialiste".
 
# Collection : Inventaire
collectionInventaire = Inventaire
collectionInventaireTitre = Inventaire (autre que celui de l'auteur)
existenceInventaireCollection = Existe-t-il un inventaire de cet herbier ?
auteurInventaireCollection = Si oui, l'auteur a-t-il participé à l'inventaire ?
formeInventaireCollection = Si oui, quelle(s) forme(s) prend l'inventaire ?
infoInventaireCollection = Quelles informations retrouve-t-on (Ex. familles, localités, espèces...) ?
digitalInventaireCollection = Si l'inventaire est informatisé, quel logiciel utilisez vous ?
pourcentDigitalInventaireCollection = % de l'inventaire en base de données
etatInventaireCollection = Est-t-il complet ou partiel ?
typeDonneeInventaireCollection = Quels sont les éléments qui ont déjà été inventoriés ?
typeDonneeInventaireCollectionInfo = Exemples : Familles, localités...
 
#Collection : Commentaire liées
collectionCommentaire = Notes
collectionCommentaireTitre = Notes liées à la collection
chercherCommentaireSaisi = Chercher une note saisie...
selectionnerCommentaire = Veuillez sélectionner une note
chargementCommentaire = Chargement des Notes
 
# +--------------------------------------------------------------------------------------------------------------------+
# Personne : Form
personneSingulier = personne
personneListeLabel = Personnes
personneModeAjout = Ajouter une personne
personneModeModifier = Modifier une personne
 
personneIdentite = Identité
personnePrefixe = Préfixe
personnePrefixeInfo = Civilité (abbé, colonel, etc...)
personnePrenom = Prénom
personneNom = Nom
personneNomAutre = Autre Nom
personneNomComplet = Nom Complet
personneAbreviation = Abréviation
personneAbreviationAutre = Autres abréviations
personneNaissance = Naissance
personneDateNaissance = Date de naissance
personneLieuNaissance = Lieu de naissance
personneDeces = Décès
personneEstDecedee = Est décédée
personneDecedeeInterogation = Décédée?
personneDateDeces = Date de décès
personneLieuDeces = Lieu de décès
 
personneAdresses = Adresses
personneCodePostal = Code Postal
personneVille = Ville
personneCourriel = Courriel
 
personneInfoNat = Informations Naturalistes
tabPublications = Publications liées
personneLogos = Images
 
personneBiographie = Biographie
personneSpecialite = Spécialité
personneRecolte = Recolte
 
# +--------------------------------------------------------------------------------------------------------------------+
# Publication
publicationSingulier = publication
publicationTitreFormAjout = Ajout d'une publication
publicationTitreFormModif = Modification d'une publication
publicationTitreSuppression = Suppression de publication(s)
publicationAuteursTitre = Auteur(s)
publicationAuteurSingulier = Auteur
publicationAuteurs = Auteurs
publicationAuteurBoutonAjouter = Ajouter un auteur
publicationTitre = Titre
publicationRevueCollection = Nom de la revue / collection
publicationEditeur = Éditeur
publicationDateParution = Année
publicationNvt = Série / Tome
publicationFascicule = Fascicule
publicationPage = Page(s)
ordre = Ordre
deplacerAuteur = Déplacer auteur :
 
# Publications : Personnes liées
selectionnerAuteur = Veuillez sélectionner un auteur !
 
# +---------------------------------------------------------------------------------------------------------------+
# Commentaire
commentaireSingulier = note
commentairePluriel = notes
commentaireTitreFormAjout = Ajout d'une note
commentaireTitreFormModif = Modification d'une note
commentaireTitreSuppression = Suppression de note(s)
commentaireCollection = Collection
commentaireTitre = Titre
commentaireType = Type
commentairePonderation = Importance
commentaireTexte = Texte
commentairePublic = Accès
commentaireMessageTitre = Veuillez saisir un titre pour la note !
 
# Pour personne : Publis liées
personneOngletPublication = Publications
personnePublication = dont la personne est le sujet
typeRelationPersonne = Relation
 
# Journal
titreJournal = Journal de l'application
heureMessage = Heure du message
message = Message
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/i18n/Constantes.properties:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/i18n/Constantes.properties:r1136-1368
Merged /trunk/src/org/tela_botanica/client/i18n/Constantes.properties:r11-119,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/i18n/ErrorMessages.properties
New file
0,0 → 1,32
# Rafraichir
erreurRafraichir = Pas de correspondance {0} dans la methode rafraichir() de la classe {1}
 
# Pagination
elementsAffiches = {0} {1} - {2} sur {3}
 
# ChampMultiValeur
valeurNonValideMsg = La valeur saisie n''est pas au bon format {0}
 
# Entete
deconnexion = Déconnexion de l''utilisateur «{0}» en cours...
chargementFenetre = Chargement de la fenêtre «{0}» en cours...
ouvertureLienExterne = Ouverture du lien externe «{0}» en cours...
ouvertureAppliExterne = Ouverture de l''application «{0}» en cours...
titreErreurSaisie = Erreur de saisie
 
# Divers
veuillezSelectionner = Veuillez sélectionner {0}
selectionObligatoire = Veuillez sélectionner {0} pour {1}
 
nonImplemente = Menu {0} non implémenté
erreurRequeteTitre = Erreur de requête
erreurRequete = Une erreur s''est produite lors de l''exécution de la requête.
erreurJrest = Une exception est survenue lors de l''envoi de la requête JRest
erreurServiceJrest = Erreur à l''exécution du service : {0}
typeChampMulti = Vous devez saisir un type
erreurJson = La réponse n''est pas un objet ou un tableau JSON et vaut :{0}
 
# Import de publication
retourSuccesImportPublication = {0} publication a été importée
retourSuccesImportPublicationPluriel = {0} publications ont été importées
retourEchecImportPublication = Une erreur est survenue durant l''upload, le serveur a répondu : {0}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/i18n/ErrorMessages.properties:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/i18n/ErrorMessages.properties:r1136-1368
Merged /trunk/src/org/tela_botanica/client/i18n/ErrorMessages.properties:r11-464,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/i18n
New file
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/i18n:r11-119,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/i18n:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/i18n:r1136-1291
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/RegistreId.java
New file
0,0 → 1,28
package org.tela_botanica.client;
 
public final class RegistreId {
public static final String APPLI_NOM = "Application Nom";
public static final String APPLI_CODE = "Code de l'Application";
public static final String APPLI_VERSION = "Version";
public static final String APPLI_VERSION_NOM = "Version nom";
public static final String APPLI_REVISION = "Révision";
public static final String SERVICES_REVISION = "Révision du Jrest";
public static final String CONFIG = "Configuration";
public static final String MEDIATEUR = "Médiateur";
public static final String MODELE = "Modèle";
public static final String VIEWPORT = "Viewport";
public static final String PANNEAU_OUEST = "Panneau ouest";
public static final String PANNEAU_CENTRE = "Panneau central";
public static final String PANNEAU_INSTITUTION_DETAIL = "Panneau Institution détail";
public static final String PANNEAU_PUBLICATION_DETAIL = "Panneau Publication détail";
public static final String PANNEAU_PERSONNE_DETAIL = "Panneau Personne détail";
public static final String UTILISATEUR_COURANT = "Utilisateur courant";
public static final String POPUP_CHARGEMENT = "Popup chargement";
public static final String PANNEAU_SUD = "Barre de statut";
public static final String APPLI_COMPILATION_JAVA_VERSION = "Version de Java ayant servi à compiler";
public static final String APPLI_COMPILATION_DATE_HEURE = "Date et heure de la compilation de l'application";
public static final String APPLI_DEVELOPPEURS = "Développeurs de l'application";
public static final String APPLI_TRADUCTEURS = "Traducteurs de l'application";
public static final String APPLI_TESTEURS = "Testeur de l'application";
public static final String APPLI_LICENCE = "Licence du code source de l'application";
}
Property changes:
Added: svn:keywords
+Revision
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/DetailVue.java
New file
0,0 → 1,292
package org.tela_botanica.client.vues;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Analytics;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.util.Params;
import com.extjs.gxt.ui.client.widget.HtmlContainer;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.GWT;
 
public abstract class DetailVue extends LayoutContainer implements Rafraichissable {
 
protected Mediateur mediateur = null;
protected Constantes i18nC = null;
 
protected HashMap<String, Valeur> ontologie = null;
protected boolean ontologieChargementOk = false;
private HashMap<Integer, String> ontologiesEnAttenteDeReception = null;
protected String sautLigneTpl = null;
public DetailVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
i18nC = Mediateur.i18nC;
initialiserSautLigneTpl();
ontologie = new HashMap<String, Valeur>();
ontologieChargementOk = false;
ontologiesEnAttenteDeReception = new HashMap<Integer, String>();
setLayout(new FitLayout());
setBorders(false);
setScrollMode(Scroll.AUTO);
}
private void initialiserSautLigneTpl() {
sautLigneTpl = "<br />\n";
}
protected String construireTxtTruck(String chaineAAnalyser) {
return construireTxtTruck(chaineAAnalyser, true);
}
protected String construireTxtTruck(String chaineAAnalyser, boolean ucFirst) {
ArrayList<String> termes = new ArrayList<String>();
if ((chaineAAnalyser != null) && (!chaineAAnalyser.trim().equals(""))) {
String[] valeurs = chaineAAnalyser.split(aDonnee.SEPARATEUR_VALEURS);
int nbreValeurs = valeurs.length;
if (nbreValeurs > 0) {
for (int i = 0; i < nbreValeurs; i++) {
String valeur = valeurs[i];
String valeurFormatee = formaterValeurTruck(valeur);
termes.add(valeurFormatee);
}
}
}
String chaineARetourner = formaterTableauDeTxt(termes, ucFirst);
return chaineARetourner;
}
private String formaterValeurTruck(String valeur) {
String chaineARetourner = "";
if (valeur.matches("^[^#]+##[^$]+$")) {
String[] cleValeur = valeur.split(aDonnee.SEPARATEUR_TYPE_VALEUR);
chaineARetourner = (UtilString.isEmpty(cleValeur[1]) || cleValeur[1].equals("null") ? aDonnee.VALEUR_NULL : cleValeur[1]) +" "+formaterParenthese(cleValeur[0]);
} else if (!valeur.equals("")) {
chaineARetourner = valeur;
} else {
GWT.log("Valeur truck posant problème :"+valeur, null);
}
return chaineARetourner;
}
protected String formaterParenthese(String chaineAAfficher) {
if (!chaineAAfficher.equals("")) {
chaineAAfficher = "("+chaineAAfficher+")";
}
return chaineAAfficher;
}
protected String formaterTableauDeTxt(ArrayList<String> tableauDeTxt, boolean ucFirst) {
String chaineAAfficher = "";
int tailleDuTableau = tableauDeTxt.size();
if (tailleDuTableau > 0) {
int indexAvtDernier = tailleDuTableau - 1;
for (int i = 0; i < tailleDuTableau; i++) {
String mot = tableauDeTxt.get(i);
if (i != indexAvtDernier) {
chaineAAfficher += mot+", ";
} else {
chaineAAfficher += nettoyerPointFinal(mot)+".";
}
}
}
if (ucFirst) return UtilString.ucFirst(chaineAAfficher);
else return chaineAAfficher;
}
protected String nettoyerPointFinal(String mot) {
mot = mot.replaceAll("[.]$", "");
return mot;
}
protected String formaterContenu(String template, Params parametres) {
String cHtml = Format.substitute(template, parametres);
Params cssParams = new Params();
cssParams.set("css_lien_ext", ComposantClass.LIEN_EXTERNE);
cssParams.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
cssParams.set("css_label", ComposantClass.LABEL);
cssParams.set("css_indentation", ComposantClass.INDENTATION);
cssParams.set("css_fieldset", ComposantClass.FIELDSET);
cssParams.set("css_clear", ComposantClass.CLEAR);
cHtml = Format.substitute(cHtml, cssParams);
return cHtml;
}
protected void afficherOnglet(String template, Params parametres, TabItem onglet) {
String cHtml = formaterContenu(template, parametres);
HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml);
onglet.removeAll();
onglet.add(corpsConteneurDuHtml);
}
protected String formaterAutre(String chaineAAfficher) {
if (!chaineAAfficher.equals("")) {
chaineAAfficher = " ["+i18nC.autres()+" : "+chaineAAfficher+"]";
}
return chaineAAfficher;
}
protected String formaterOuiNon(String chaineAFormater) {
String txtARetourner = "";
if (chaineAFormater.equals("0")) {
txtARetourner = i18nC.non();
} else if (chaineAFormater.equals("1")) {
txtARetourner = i18nC.oui();
}
return txtARetourner;
}
 
protected String formaterOuiNon(Integer intAFormater) {
if(intAFormater == null) return "";
if(intAFormater.intValue() == 0) return i18nC.non();
if(intAFormater.intValue() == 1) return i18nC.oui();
return "";
}
protected String formaterSautDeLigne(String chaineAFormater) {
String txtARetourner = chaineAFormater.replaceAll("\n", sautLigneTpl);
return txtARetourner;
}
protected void lancerChargementListesValeurs(String[] listesCodes) {
lancerChargementListesValeurs(listesCodes, null);
}
protected void lancerChargementListesValeurs(String[] listesCodes, Sequenceur sequenceur) {
Configuration configuration = (Configuration) Registry.get(RegistreId.CONFIG);
for (int i = 0; i < listesCodes.length ; i++) {
String code = listesCodes[i];
ontologiesEnAttenteDeReception.put(configuration.getListeId(code), code);
mediateur.obtenirListeValeurEtRafraichir(this, code, sequenceur);
}
}
protected void receptionerListeValeurs(ValeurListe listeValeursReceptionnee) {
mettreAJourOntologieEnAttenteDeReception(listeValeursReceptionnee);
ajouterListeValeursAOntologie(listeValeursReceptionnee);
}
protected void mettreAJourOntologieEnAttenteDeReception(ValeurListe listeValeursReceptionnee) {
ontologiesEnAttenteDeReception.remove(listeValeursReceptionnee.getId());
}
protected void ajouterListeValeursAOntologie(ValeurListe listeValeursReceptionnee) {
Iterator<String> it = listeValeursReceptionnee.keySet().iterator();
while (it.hasNext()) {
String cle = it.next();
Valeur valeur = listeValeursReceptionnee.get(cle);
if (valeur != null) {
ontologie.put(cle, valeur);
}
}
}
public String construireTxtListeOntologie(String chaineAAnalyser) {
return construireTxtListeOntologie(chaineAAnalyser, true, true, false);
}
public String construireTxtListeOntologie(String chaineAAnalyser, boolean valeurEstOntologie, boolean typeEstOntologie, boolean donneeEstOntologie) {
ArrayList<String> termes = new ArrayList<String>();
ArrayList<String> autres = new ArrayList<String>();
chaineAAnalyser = chaineAAnalyser.trim();
if (!UtilString.isEmpty(chaineAAnalyser)) {
String[] valeurs = chaineAAnalyser.split(aDonnee.SEPARATEUR_VALEURS);
int nbreValeurs = valeurs.length;
if (nbreValeurs > 0) {
for (int i = 0; i < nbreValeurs; i++) {
String valeur = valeurs[i];
// VALEUR SANS TYPE
// La valeur sans type est une entrée de l'ontologie
if (valeurEstOntologie && valeur.matches("^[0-9]+$")) {
if (valeur.equals("0")) {
valeur = "";
} else if (ontologie != null) {
Valeur valeurOntologie = ontologie.get(valeur);
if (valeurOntologie != null) {
valeur = valeurOntologie.getNom();
}
}
}
// VALEUR AVEC TYPE
// Type : AUTRE
String valeurTypeAutre = aDonnee.TYPE_AUTRE+aDonnee.SEPARATEUR_TYPE_VALEUR;
if (valeur.matches("^"+valeurTypeAutre+".*$")) {
String txtAutre = valeur.replaceFirst("^"+valeurTypeAutre, "");
if (!txtAutre.equals("")) {
autres.add(txtAutre);
}
valeur = "";
}
// Type correspondant à une entrée de l'ontologie
if (typeEstOntologie) {
String valeurTypeOntologie = "[0-9]+"+aDonnee.SEPARATEUR_TYPE_VALEUR;
if (valeur.matches("^"+valeurTypeOntologie+".+$")) {
String type = valeur.substring(0, valeur.indexOf(aDonnee.SEPARATEUR_TYPE_VALEUR));
if (ontologie != null && ontologie.get(type) != null) {
Valeur valeurOntologie = ontologie.get(type);
valeur = valeur.replaceFirst("^"+type, valeurOntologie.getNom()+": ");
}
}
}
// Donnée correspondant à une entrée de l'ontologie
if (donneeEstOntologie) {
String donneeOntologie = aDonnee.SEPARATEUR_TYPE_VALEUR+"[0-9]+";
if (valeur.matches("^.+"+donneeOntologie+"$")) {
String donnee = valeur.substring(valeur.indexOf(aDonnee.SEPARATEUR_TYPE_VALEUR), valeur.length());
donnee = donnee.replaceFirst("^"+aDonnee.SEPARATEUR_TYPE_VALEUR, "");
if (ontologie != null && ontologie.get(donnee) != null) {
Valeur valeurOntologie = ontologie.get(donnee);
valeur = valeur.replaceFirst(donnee+"$", valeurOntologie.getNom());
}
}
}
// Nettoyage final
valeur = valeur.replaceFirst(aDonnee.SEPARATEUR_TYPE_VALEUR, "");
if (!UtilString.isEmpty(valeur)) {
termes.add(valeur);
}
}
}
}
String chaineTermes = formaterTableauDeTxt(termes, true);
String chaineAutres = formaterTableauDeTxt(autres, true);
String chaineARetourner = chaineTermes+formaterAutre(chaineAutres);
return chaineARetourner;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/DetailVue.java:r1136-1368
Merged /branches/v1.6-muscardin/src/org/tela_botanica/client/vues/DetailVue.java:r1816-1817
Merged /trunk/src/org/tela_botanica/client/vues/DetailVue.java:r11-452,929-935,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/DetailVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/FenetreJournal.java
New file
0,0 → 1,103
package org.tela_botanica.client.vues;
 
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Valeur;
 
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.core.XTemplate;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.InfoConfig;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.grid.RowExpander;
import com.extjs.gxt.ui.client.widget.grid.RowNumberer;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.i18n.client.Dictionary;
 
public class FenetreJournal extends Dialog implements Rafraichissable{
 
private int id = 0;
private EditorGrid<Valeur> grille;
//private int nbLogs = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbLogs"));
private ListStore<Valeur> store;
public FenetreJournal(Mediateur mediateur) {
this.setHeadingHtml(mediateur.i18nC.titreJournal());
this.setWidth(500);
this.setHeight(500);
setLayout(new FitLayout());
// Définition des colomnes de la grille:
RowNumberer numeroPlugin = new RowNumberer();
numeroPlugin.setHeaderHtml("#");
XTemplate infoTpl = XTemplate.create("<p>"+
"<b>" + mediateur.i18nC.heureMessage() + " : </b>{heure}<br />" +
"<b>" + mediateur.i18nC.message() + " : </b>{description}<br />" +
"</p>");
RowExpander expansionPlugin = new RowExpander();
expansionPlugin.setTemplate(infoTpl);
List<ColumnConfig> lstColumns = new ArrayList<ColumnConfig>();
lstColumns.add(expansionPlugin);
lstColumns.add(new ColumnConfig("nom", mediateur.i18nC.publicationTitre(), 200));
lstColumns.add(new ColumnConfig("description", mediateur.i18nC.message() , 400));
 
ColumnModel modeleColonnes = new ColumnModel(lstColumns);
store = new ListStore<Valeur>();
grille = new EditorGrid<Valeur>(store, modeleColonnes);
grille.addPlugin(expansionPlugin);
grille.setAutoExpandColumn("description");
grille.getView().setAutoFill(true);
grille.getView().setForceFit(true);
store.sort("id", SortDir.DESC);
add(grille);
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof InfoConfig) {
InfoConfig info = (InfoConfig) nouvellesDonnees;
id++;
Valeur v = new Valeur(String.valueOf(id), info.titleHtml, null, info.html);
v.set("heure", getDate());
store.add(v);
//if (store.getModels().size() > nbLogs) {
//store.remove(store.getAt(nbLogs));
//}
}
}
public String getDate() {
Date date = new Date();
return String.valueOf(DateTimeFormat.getFormat("HH:mm:ss").format(date));
}
protected void createButtons() {
//Pas de boutons, merci
}
 
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/FenetreJournal.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/FenetreJournal.java:r11-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/FenetreJournal.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/commentaire/CommentaireVue.java
New file
0,0 → 1,52
package org.tela_botanica.client.vues.commentaire;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.commentaire.Commentaire;
import org.tela_botanica.client.modeles.commentaire.CommentaireListe;
 
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class CommentaireVue extends LayoutContainer implements Rafraichissable {
private Mediateur mediateur = null;
private CommentaireListeVue panneauListe;
private CommentaireDetailVue panneauDetail;
public CommentaireVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
BorderLayout layout = new BorderLayout();
layout.setEnableState(false);
setLayout(layout);
 
panneauListe = new CommentaireListeVue(mediateur);
add(panneauListe, new BorderLayoutData(LayoutRegion.CENTER));
 
panneauDetail = new CommentaireDetailVue(mediateur);
BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, .5f, 200, 1000);
southData.setSplit(true);
southData.setMargins(new Margins(5, 0, 0, 0));
add(panneauDetail, southData);
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Commentaire) {
panneauDetail.rafraichir(nouvellesDonnees);
} else if (nouvellesDonnees instanceof CommentaireListe) {
panneauListe.rafraichir(nouvellesDonnees);
mediateur.desactiverChargement(this);
} else if (nouvellesDonnees instanceof Information) {
panneauListe.rafraichir(nouvellesDonnees);
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/commentaire/CommentaireVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/commentaire/CommentaireVue.java:r11-984,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/commentaire/CommentaireVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/commentaire/CommentaireListeVue.java
New file
0,0 → 1,366
package org.tela_botanica.client.vues.commentaire;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.ChampFiltreRecherche;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.MenuApplicationId;
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.commentaire.Commentaire;
import org.tela_botanica.client.modeles.commentaire.CommentaireListe;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.personne.PersonneAsyncDao;
import org.tela_botanica.client.modeles.structure.StructureListe;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.vues.BarrePaginationVue;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.GridEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.GroupingStore;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.util.Util;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
import com.extjs.gxt.ui.client.widget.grid.GridGroupRenderer;
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.grid.GroupColumnData;
import com.extjs.gxt.ui.client.widget.grid.GroupingView;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.menu.Menu;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class CommentaireListeVue extends ContentPanel implements Rafraichissable {
 
private Mediateur mediateur = null;
private Constantes i18nC = null;
 
private Grid<Commentaire> grille = null;
private GroupingStore<Commentaire> store = null;
private ColumnModel modeleDesColonnes = null;
private Button ajouter;
private Button modifier;
private Button supprimer;
private BarrePaginationVue pagination = null;
private ChampFiltreRecherche champFiltreRecherche = null;
private CommentaireListe commentaires = null;
protected boolean commentairesChargementOk = false;
protected HashMap<String, Valeur> ontologie = null;
protected boolean ontologieChargementOk = false;
private int indexElementSelectionne = 0;
private Commentaire commentaireSelectionne = null;
public CommentaireListeVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
i18nC = Mediateur.i18nC;
setLayout(new FitLayout());
setHeaderVisible(false);
// Gestion de l'ontologie
ontologie = new HashMap<String, Valeur>();
mediateur.obtenirListeValeurEtRafraichir(this, "typeCommentaireCollection", null);
// Gestion de la barre d'outil
ToolBar toolBar = new ToolBar();
ajouter = new Button(i18nC.ajouter());
ajouter.setIcon(Images.ICONES.ajouter());
ajouter.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent be) {
mediateur.clicAjouterCommentaire();
}
});
ajouter.setToolTip(i18nC.indicationCreerUneFiche()+" "+i18nC.commentaireSingulier());
toolBar.add(ajouter);
 
modifier = new Button(i18nC.modifier());
modifier.setIcon(Images.ICONES.formModifier());
modifier.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent be) {
mediateur.clicModifierCommentaire(grille.getSelectionModel().getSelectedItems());
}
});
modifier.setToolTip(i18nC.indicationModifierUneFiche());
toolBar.add(modifier);
supprimer = new Button(i18nC.supprimer());
supprimer.setIcon(Images.ICONES.supprimer());
supprimer.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent be) {
mediateur.clicSupprimerCommentaire(grille.getSelectionModel().getSelectedItems());
}
});
supprimer.setToolTip(i18nC.indicationSupprimerUneFiche());
toolBar.add(supprimer);
setTopComponent(toolBar);
 
// Gestion de la grille
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
// ATTENTION : les noms des colonnes doivent correspondre aux noms variables de la classe utilisée dans la liste
colonnes.add(new ColumnConfig("_collection_nom_", i18nC.commentaireCollection(), 150));
colonnes.add(creerColonneType());
colonnes.add(new ColumnConfig("_titre_", i18nC.commentaireTitre(), 150));
colonnes.add(new ColumnConfig("_ponderation_", i18nC.commentairePonderation(), 30));
colonnes.add(creerColonneAcces());
modeleDesColonnes = new ColumnModel(colonnes);
 
GridSelectionModel<Commentaire> modeleDeSelection = new GridSelectionModel<Commentaire>();
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Commentaire>() {
public void selectionChanged(SelectionChangedEvent<Commentaire> event) {
commentaireSelectionne = (Commentaire) event.getSelectedItem();
indexElementSelectionne = store.indexOf(commentaireSelectionne);
clicListe(commentaireSelectionne);
}
});
store = new GroupingStore<Commentaire>();
store.groupBy("_collection_nom_");
store.setRemoteGroup(false);
GroupingView vueDeGroupe = new GroupingView();
vueDeGroupe.setShowGroupedColumn(false);
vueDeGroupe.setForceFit(true);
vueDeGroupe.setAutoFill(true);
vueDeGroupe.setGroupRenderer(new GridGroupRenderer() {
public String render(GroupColumnData data) {
String f = modeleDesColonnes.getColumnById(data.field).getHeaderHtml();
String l = data.models.size() == 1 ? i18nC.commentaireSingulier() : i18nC.commentairePluriel();
if (Util.isEmptyString(data.group)) return f + ": aucune (" + data.models.size() + " " + l + ")";
else return f + ": " + data.group + " (" + data.models.size() + " " + l + ")";
}
});
grille = new Grid<Commentaire>(store, modeleDesColonnes);
grille.setView(vueDeGroupe);
grille.setWidth("100%");
grille.setAutoExpandColumn("_titre_");
grille.setSelectionModel(modeleDeSelection);
grille.addListener(Events.ViewReady, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
grille.getSelectionModel().select(0, false);
}
});
grille.addListener(Events.OnDoubleClick, new Listener<BaseEvent>(){
public void handleEvent(BaseEvent be) {
modifier.fireEvent(Events.Select);
}
});
// @TODO marche pas à cause des méta machin de merde
/*grille.addListener(Events.SortChange, new Listener<BaseEvent>() {
 
@Override
public void handleEvent(BaseEvent be) {
GridEvent ge = (GridEvent<Commentaire>) be;
// TODO rajouter un test sur le sort state pour trier par nom par défaut
String tri = ge.getSortInfo().getSortField();
if(tri.equals("fmt_nom_complet")) {
tri = "nom";
}
CommentaireAsyncDao.tri = Commentaire.PREFIXE+"_"+tri+" "+ge.getSortInfo().getSortDir().toString();
pagination.changePage();
}
});*/
add(grille);
CommentaireListe commentaireListe = new CommentaireListe();
champFiltreRecherche = new ChampFiltreRecherche(mediateur, toolBar, commentaireListe);
// Définition de la barre de pagination
pagination = new BarrePaginationVue(commentaireListe, mediateur, champFiltreRecherche);
setBottomComponent(pagination);
}
private ColumnConfig creerColonneType() {
GridCellRenderer<Commentaire> typeRendu = new GridCellRenderer<Commentaire>() {
public String render(Commentaire model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<Commentaire> store, Grid<Commentaire> grid) {
// FIXME : créer une classe Ontologie qui mixe le code ci-dessous et tout ce qui concerne l'ontologie dans DetailVue
String type = "";
String[] valeurs = model.getCollectionACommentaire().getType().split(aDonnee.SEPARATEUR_VALEURS);
int nbreValeurs = valeurs.length;
int indexAvtDernier = nbreValeurs - 1;
if (nbreValeurs > 0) {
for (int i = 0; i < nbreValeurs; i++) {
String valeur = valeurs[i];
if (valeur.matches("^[0-9]+$")) {
if (valeur.equals("0")) {
valeur = "";
} else if (ontologie != null) {
Valeur valeurOntologie = ontologie.get(valeur);
if (valeurOntologie != null) {
valeur = valeurOntologie.getNom();
}
}
}
if (i != indexAvtDernier) {
type += valeur+", ";
} else {
type += valeur;
}
}
}
model.set("_type_", type);
return type;
}
};
ColumnConfig typeColonne = new ColumnConfig("_type_", i18nC.commentaireType(), 100);
typeColonne.setRenderer(typeRendu);
return typeColonne;
}
private ColumnConfig creerColonneAcces() {
GridCellRenderer<Commentaire> accesRendu = new GridCellRenderer<Commentaire>() {
public String render(Commentaire model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<Commentaire> store, Grid<Commentaire> grid) {
String acces = (model.etrePublic() ? i18nC.donneePublic() : i18nC.donneePrivee());
model.set("_public_", acces);
return acces;
}
};
ColumnConfig accesColonne = new ColumnConfig("_public_", i18nC.commentairePublic(), 30);
accesColonne.setRenderer(accesRendu);
return accesColonne;
}
private void clicListe(Commentaire commentaire) {
if (commentaire != null && store.getCount() > 0) {
mediateur.clicListeCommentaire(commentaire);
}
}
 
private void gererEtatActivationBouton() {
int nbreElementDuMagazin = store.getCount();
ajouter.enable();
if (nbreElementDuMagazin <= 0) {
supprimer.disable();
modifier.disable();
} else if (nbreElementDuMagazin > 0) {
modifier.enable();
if (((Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT)).isIdentifie()) {
supprimer.enable();
}
}
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof CommentaireListe) {
commentaires = (CommentaireListe) nouvellesDonnees;
champFiltreRecherche.setListePaginable(commentaires);
pagination.setlistePaginable(commentaires);
pagination.rafraichir(commentaires.getPageTable());
commentairesChargementOk = true;
} else if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeursReceptionnee = (ValeurListe) nouvellesDonnees;
Iterator<String> it = listeValeursReceptionnee.keySet().iterator();
while (it.hasNext()) {
String cle = it.next();
Valeur valeur = listeValeursReceptionnee.get(cle);
if (valeur != null) {
ontologie.put(cle, valeur);
}
}
ontologieChargementOk = true;
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if (info.getType().equals("suppression_commentaire")) {
String message = info.toString();
if (info.getDonnee(0) != null) {
message = (String) info.getDonnee(0);
}
InfoLogger.display(i18nC.commentaireTitreSuppression(), message);
supprimerCommentairesSelectionnees();
gererEtatActivationBouton();
} else if (info.getType().equals("commentaire_modifiee")) {
// GXT c'est pourri et la grille ne prend en compte les modifications
// du store, donc en attendant, on recharge tout, comme pour la suppression
/*Commentaire commModifie = (Commentaire)info.getDonnee(0);
store.remove(indexElementSelectionne);
store.insert(commModifie, indexElementSelectionne);
grille.reconfigure(store, modeleDesColonnes);
grille.repaint();*/
mediateur.clicMenu(MenuApplicationId.COMMENTAIRE);
}
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
if (etrePretAAfficherListe()) {
chargerListe();
}
layout();
}
private boolean etrePretAAfficherListe() {
boolean ok = false;
if (commentairesChargementOk && ontologieChargementOk) {
ok = true;
}
return ok;
}
private void chargerListe() {
if (commentaires != null) {
List<Commentaire> liste = commentaires.toList();
store.removeAll();
store.add(liste);
mediateur.actualiserPanneauCentral();
}
}
private void supprimerCommentairesSelectionnees() {
// FIXME : le code ci-dessous ne marche pas avec la GroupingView, nous utilisons le rechargement du menu à la place
/*
List<Commentaire> commentairesSelectionnees = grille.getSelectionModel().getSelectedItems();
Iterator<Commentaire> it = commentairesSelectionnees.iterator();
while (it.hasNext()) {
Commentaire commentaireASupprimer = it.next();
Debug.log(commentaireASupprimer.getId());
grille.getStore().remove(commentaireASupprimer);
}
layout(true);
*/
mediateur.clicMenu(MenuApplicationId.COMMENTAIRE);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/commentaire/CommentaireListeVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/commentaire/CommentaireListeVue.java:r11-984,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/commentaire/CommentaireListeVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/commentaire/CommentaireDetailVue.java
New file
0,0 → 1,154
package org.tela_botanica.client.vues.commentaire;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.commentaire.Commentaire;
import org.tela_botanica.client.vues.DetailVue;
 
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.util.Params;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.GWT;
 
public class CommentaireDetailVue extends DetailVue implements Rafraichissable {
private String enteteTpl = null;
private String contenuTpl = null;
private ContentPanel panneauPrincipal = null;
private Html entete = null;
private Html contenu = null;
private Commentaire commentaire = null;
private boolean commentaireChargementOk = false;
 
public CommentaireDetailVue(Mediateur mediateurCourant) {
super(mediateurCourant);
initialiserTousLesTpl();
chargerOntologie();
panneauPrincipal = new ContentPanel();
panneauPrincipal.setLayout(new FitLayout());
panneauPrincipal.setHeaderVisible(false);
panneauPrincipal.setBodyBorder(false);
panneauPrincipal.setScrollMode(Scroll.AUTO);
entete = new Html();
entete.setId(ComposantId.ZONE_DETAIL_ENTETE);
panneauPrincipal.setTopComponent(entete);
contenu = new Html();
panneauPrincipal.add(contenu);
add(panneauPrincipal);
}
 
private void initialiserTousLesTpl() {
initialiserEnteteHtmlTpl();
initialiserGeneralTpl();
}
private void initialiserEnteteHtmlTpl() {
enteteTpl =
"<div id='{css_id}'>"+
" <h1>{titre}</h1>"+
" <h2>{collection}<span class='{css_meta}'><br /> {i18n_id}:{id} - {guid}</span></h2>" +
"</div>";
}
private void initialiserGeneralTpl() {
contenuTpl =
"<div class='{css_corps}'>"+
" <span class='{css_label}'>{i18n_type} :</span> {type}<br />"+
" <span class='{css_label}'>{i18n_public} :</span> {public}<br />"+
" <span class='{css_label}'>{i18n_ponderation} :</span> {ponderation}<br />"+
" <span class='{css_label}'>{i18n_texte} :</span>"+
" {texte}"+
"</div>";
}
private void chargerOntologie() {
String[] listesCodes = {"typeCommentaireCollection"};
lancerChargementListesValeurs(listesCodes);
}
public void afficherDetail() {
if (commentaire != null) {
afficherEntete();
afficherDetailCommentaire();
}
layout();
}
private void afficherEntete() {
Params enteteParams = new Params();
enteteParams.set("css_id", ComposantId.ZONE_DETAIL_ENTETE);
enteteParams.set("css_meta", ComposantClass.META);
enteteParams.set("i18n_id", i18nC.id());
enteteParams.set("collection", commentaire.getCollection().getNom());
enteteParams.set("titre", commentaire.getTitre());
enteteParams.set("id", commentaire.getId());
enteteParams.set("guid", getGuid());
String eHtml = Format.substitute(enteteTpl, enteteParams);
entete.getElement().setInnerHTML(eHtml);
}
public String getGuid() {
String guid = "URN:tela-botanica.org:";
guid += "com"+commentaire.getId();
return guid;
}
public void afficherDetailCommentaire() {
Params contenuParams = new Params();
contenuParams.set("i18n_type", i18nC.commentaireType());
contenuParams.set("i18n_public", i18nC.commentairePublic());
contenuParams.set("i18n_ponderation", i18nC.commentairePonderation());
contenuParams.set("i18n_texte", i18nC.commentaireTexte());
String type = construireTxtListeOntologie(commentaire.getCollectionACommentaire().getType());
contenuParams.set("type", type);
contenuParams.set("ponderation", commentaire.getPonderation());
contenuParams.set("public", (commentaire.etrePublic() ? "public" : "privé"));
contenuParams.set("texte", commentaire.getTexte());
String gHtml = formaterContenu(contenuTpl, contenuParams);
contenu.getElement().setInnerHTML(gHtml);
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Commentaire) {
commentaire = (Commentaire) nouvellesDonnees;
commentaireChargementOk = true;
} else if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeursReceptionnee = (ValeurListe) nouvellesDonnees;
receptionerListeValeurs(listeValeursReceptionnee);
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
if (avoirDonneesChargees()) {
afficherDetail();
}
}
private boolean avoirDonneesChargees() {
boolean ok = false;
if (commentaireChargementOk) {
ok = true;
}
return ok;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/commentaire/CommentaireDetailVue.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/commentaire/CommentaireDetailVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/commentaire/CommentaireDetailVue.java:r11-984,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/commentaire/CommentaireForm.java
New file
0,0 → 1,256
package org.tela_botanica.client.vues.commentaire;
 
import java.util.ArrayList;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.ChampSliderPourcentage;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.MenuApplicationId;
import org.tela_botanica.client.modeles.commentaire.Commentaire;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilArray;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.Formulaire;
 
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.google.gwt.user.client.Window;
 
 
public class CommentaireForm extends Formulaire implements Rafraichissable {
private Commentaire commentaire;
 
private TextField<String> titreChp;
private TextArea texteChp;
private ChampSliderPourcentage ponderationChp;
private CheckBox publicChp;
private static boolean formulaireValideOk = false;
private static boolean commentaireValideOk = false;
private Sequenceur sequenceur = new Sequenceur();
 
public CommentaireForm(Mediateur mediateurCourrant, String commentaireId) {
initialiserCommentaireForm(mediateurCourrant, commentaireId);
}
 
public CommentaireForm(Mediateur mediateurCourrant, String commentaireId, Rafraichissable vueARafraichirApresValidation) {
vueExterneARafraichirApresValidation = vueARafraichirApresValidation;
initialiserCommentaireForm(mediateurCourrant, commentaireId);
}
private void initialiserCommentaireForm(Mediateur mediateurCourrant, String commentaireId) {
initialiserValidation();
commentaire = new Commentaire();
commentaire.setId(commentaireId);
String modeDeCreation = (UtilString.isEmpty(commentaire.getId()) ? Formulaire.MODE_AJOUTER : Formulaire.MODE_MODIFIER);
initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.COMMENTAIRE);
panneauFormulaire.setLayout(new FormLayout());
genererTitreFormulaire();
creerChamps();
 
if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
mediateur.selectionnerCommentaire(this, commentaireId, null);
}
}
private void genererTitreFormulaire() {
String titre = i18nC.commentaireTitreFormAjout();
if (mode.equals(Formulaire.MODE_MODIFIER)) {
titre = i18nC.commentaireTitreFormModif();
if (commentaire != null) {
titre += " - "+i18nC.id()+": "+commentaire.getId();
}
}
panneauFormulaire.setHeadingHtml(titre);
}
private void creerChamps() {
titreChp = new TextField<String>();
titreChp.setFieldLabel(i18nC.commentaireTitre());
titreChp.setAllowBlank(false);
titreChp.addStyleName(ComposantClass.OBLIGATOIRE);
titreChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
titreChp.addListener(Events.Invalid, creerEcouteurChampObligatoire());
panneauFormulaire.add(titreChp, new FormData(450, 0));
texteChp = new TextArea();
texteChp.setFieldLabel(i18nC.commentaireTexte());
panneauFormulaire.add(texteChp, new FormData(450, 250));
ponderationChp = new ChampSliderPourcentage(i18nC.commentairePonderation());
panneauFormulaire.add(ponderationChp, new FormData(450, 0));
publicChp = new CheckBox();
publicChp.setFieldLabel(i18nC.donneePublic());
panneauFormulaire.add(publicChp, new FormData(50, 0));
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Commentaire) {
// Si on a reçu les details d'une publication
rafraichirCommentaire((Commentaire) nouvellesDonnees);
} else if (nouvellesDonnees instanceof Information) {
rafraichirInformation((Information) nouvellesDonnees);
} else {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
if (etreValide()) {
initialiserValidation();
repandreRafraichissement();
controlerFermeture();
}
}
private void rafraichirCommentaire(Commentaire commentaireRecu) {
commentaire = commentaireRecu;
peuplerFormulaire();
genererTitreFormulaire();
}
private void rafraichirInformation(Information info) {
// Gestion des messages d'erreur
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
Debug.log("MESSAGES:\n"+info.getMessages().toString());
}
// Gestion des actions
String type = info.getType();
if (type.equals("ajout_commentaire") || type.equals("modif_commentaire")) {
commentaireValideOk = true;
}
if (info.getType().equals("ajout_commentaire")) {
String noteId = (String) info.getDonnee(0);
commentaire.setId(noteId);
this.mode = MODE_MODIFIER;
}
// Gestion des messages
if (info.getType().equals("modif_commentaire")) {
InfoLogger.display("Modification d'une note", info.toString());
} else if (info.getType().equals("ajout_commentaire")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
String noteId = (String) info.getDonnee(0);
InfoLogger.display("Ajout d'une note", "La note '"+noteId+"' a bien été ajoutée");
} else {
InfoLogger.display("Ajout d'une note", info.toString());
}
}
}
 
private Boolean etreValide() {
Boolean valide = false;
if (formulaireValideOk && commentaireValideOk) {
valide = true;
}
return valide;
}
private void initialiserValidation() {
formulaireValideOk = false;
commentaireValideOk = false;
}
private void repandreRafraichissement() {
if (vueExterneARafraichirApresValidation != null) {
String type = "commentaire_modifiee";
if (mode.equals(Formulaire.MODE_AJOUTER)) {
type = "commentaire_ajoutee";
}
Information info = new Information(type);
info.setDonnee(0, commentaire);
vueExterneARafraichirApresValidation.rafraichir(info);
}
}
public boolean soumettreFormulaire() {
formulaireValideOk = verifierFormulaire();
if (formulaireValideOk) {
soumettreCommentaire();
}
return formulaireValideOk;
}
private void soumettreCommentaire() {
Commentaire commentaireCollectee = collecterCommentaire();
if (commentaireCollectee != null) {
if (mode.equals(Formulaire.MODE_AJOUTER)) {
mediateur.ajouterCommentaire(this, commentaireCollectee);
} else if (mode.equals(Formulaire.MODE_MODIFIER)) {
mediateur.modifierCommentaire(this, commentaireCollectee);
}
} else {
if(clicBoutonvalidation) {
fermerFormulaire();
}
}
}
public boolean verifierFormulaire() {
boolean valide = true;
ArrayList<String> messages = new ArrayList<String>();
String titre = titreChp.getValue();
if (titre == null || titre.equals("")) {
messages.add(i18nC.commentaireMessageTitre());
}
if (messages.size() != 0) {
String[] tableauDeMessages = {};
tableauDeMessages = messages.toArray(tableauDeMessages);
MessageBox.alert(i18nC.erreurSaisieTitre(), UtilArray.implode(tableauDeMessages, "<br />"), null);
valide = false;
}
return valide;
}
private void peuplerFormulaire() {
titreChp.setValue(commentaire.getTitre());
texteChp.setValue(commentaire.getTexte());
ponderationChp.peupler(commentaire.getPonderation());
boolean acces = (commentaire.etrePublic() ? true : false);
publicChp.setValue(acces);
}
private Commentaire collecterCommentaire() {
Commentaire commentaireCollectee = (Commentaire) commentaire.cloner(new Commentaire());
String titre = titreChp.getValue();
commentaireCollectee.setTitre(titre);
String texte = texteChp.getValue();
commentaireCollectee.setTexte(texte);
String ponderation = ponderationChp.getValeur();
commentaireCollectee.setPonderation(ponderation);
String acces = (publicChp.getValue() ? "1" : "0");
commentaireCollectee.setPublic(acces);
Commentaire commentaireARetourner = null;
if (!commentaireCollectee.comparer(commentaire)) {
commentaireARetourner = commentaire = commentaireCollectee;
}
return commentaireARetourner;
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/vues/commentaire/CommentaireForm.java:r11-984,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/commentaire/CommentaireForm.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/commentaire/CommentaireForm.java:r1136-1368
Added: svn:executable
+*
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/commentaire
New file
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/commentaire:r1136-1291
Merged /trunk/src/org/tela_botanica/client/vues/commentaire:r11-984,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/commentaire:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/MenuVue.java
New file
0,0 → 1,79
package org.tela_botanica.client.vues;
 
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.modeles.Menu;
import org.tela_botanica.client.modeles.MenuApplicationId;
 
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.GXT;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.TreePanelEvent;
import com.extjs.gxt.ui.client.store.TreeStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.treepanel.TreePanel;
import com.google.gwt.user.client.Window;
 
public class MenuVue extends ContentPanel {
 
private Mediateur mediateur = null;
private Constantes i18nC = null;
private TreePanel<Menu> arbreMenus;
private TreeStore<Menu> menuStore;
public MenuVue(Mediateur mediateurCourrant) {
mediateur = mediateurCourrant;
i18nC = Mediateur.i18nC;
setHeadingHtml(i18nC.titreMenu());
setLayout(new FitLayout());
setLayoutOnChange(true);
construireMenu();
afficherMenu();
}
 
private void construireMenu() {
menuStore = new TreeStore<Menu>();
Menu accueilMenu = new Menu(i18nC.menuAccueil(), MenuApplicationId.ACCUEIL);
Menu menuInstitution = new Menu(i18nC.menuStructure(), MenuApplicationId.STRUCTURE);
Menu menuCollections = new Menu(i18nC.menuCollection(), MenuApplicationId.COLLECTION);
Menu menuPersonnes = new Menu(i18nC.menuPersonne(), MenuApplicationId.PERSONNE);
Menu menuPublications = new Menu(i18nC.menuPublication(), MenuApplicationId.PUBLICATION);
Menu menuCommentaires = new Menu(i18nC.menuCommentaire(), MenuApplicationId.COMMENTAIRE);
menuStore.add(accueilMenu, false);
menuStore.add(accueilMenu, menuInstitution, true);
menuStore.add(accueilMenu, menuCollections, true);
menuStore.add(accueilMenu, menuPersonnes, true);
menuStore.add(accueilMenu, menuPublications, true);
menuStore.add(accueilMenu, menuCommentaires, true);
}
private void afficherMenu() {
arbreMenus = new TreePanel<Menu>(menuStore);
arbreMenus.getStyle().setNodeCloseIcon(null);
arbreMenus.getStyle().setNodeOpenIcon(null);
arbreMenus.setDisplayProperty("nom");
arbreMenus.setHeight("100%");
arbreMenus.addListener(Events.OnClick, new Listener<TreePanelEvent<Menu>>(){
public void handleEvent(TreePanelEvent<Menu> tpe) {
Menu menuCourant = arbreMenus.getSelectionModel().getSelectedItem();
mediateur.clicMenu(menuCourant.getCode());
}
});
add(arbreMenus);
arbreMenus.setAutoExpand(true);
}
public void selectionMenu(String code) {
arbreMenus.getSelectionModel().select(menuStore.findModel("code", code), false);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/MenuVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/MenuVue.java:r11-443,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/MenuVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/BarrePaginationVue.java
New file
0,0 → 1,435
package org.tela_botanica.client.vues;
 
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.i18n.ErrorMessages;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.ListePaginable;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.composants.ChampFiltreRecherche;
 
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.KeyListener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.store.StoreEvent;
import com.extjs.gxt.ui.client.store.StoreListener;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;
import com.extjs.gxt.ui.client.widget.form.SimpleComboValue;
import com.extjs.gxt.ui.client.widget.form.NumberField;
import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.i18n.client.Dictionary;
import com.google.gwt.user.client.Window;
 
public class BarrePaginationVue extends ToolBar implements Rafraichissable {
 
private Mediateur mediateur = null;
private Constantes i18nC = null;
private ErrorMessages i18nM = null;
public int valeur = 0;
private ListePaginable listePaginable = null;
private Button prevPage, suivPage, premierePage, dernierePage, rafraichir;
private int pageCourante, nbElement = 0;
private int taillePage = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
private int pageTotale = 1;
private Text page, surTotalPage, afficherNbElem, nbElemParPage, intervalleElements;
private NumberField champPage = new NumberField();
private SimpleComboBox<Integer> selecteurTaillePage = new SimpleComboBox<Integer>();
private LinkedList<Integer> intervallePages = new LinkedList<Integer>();
private ListStore storeIntervalle = new ListStore() ;
private String labelElement;
private int taillePageDefaut = 50;
 
private ChampFiltreRecherche champFiltreRecherche = null;
 
public ListePaginable getlistePaginable() {
return listePaginable;
}
public void setlistePaginable(ListePaginable listePaginable) {
this.listePaginable = listePaginable;
}
/***************************************************************************
* constructeur sans argument (privé car ne doit pas être utilisé)
*/
@SuppressWarnings("unused")
private BarrePaginationVue() {
super();
}
 
/**
* constructeur avec paramètres
*
* @param im
* le médiateur à associer à la barre
*/
public BarrePaginationVue(ListePaginable listePaginableCourante, Mediateur mediateurCourant) {
super();
listePaginable = listePaginableCourante;
mediateur = mediateurCourant;
i18nC = Mediateur.i18nC;
i18nM = Mediateur.i18nM;
intervallePages.add(10);
intervallePages.add(20);
intervallePages.add(50);
intervallePages.add(100);
intervallePages.add(200);
premierePage = new Button();
premierePage.setIcon(Images.ICONES.resultsetFirst());
add(premierePage);
prevPage = new Button();
prevPage.setIcon(Images.ICONES.resultsetPrevious());
add(prevPage);
add(new SeparatorToolItem());
page = new Text(i18nC.page());
page.setStyleAttribute("padding", "0 5px 0 5px");
add(page);
champPage.setValue(pageCourante+1);
champPage.setAllowDecimals(false);
champPage.setAllowNegative(false);
champPage.setStyleAttribute("text-align","right");
champPage.setWidth(30);
add(champPage);
surTotalPage = new Text(i18nC.sur() + " " + pageTotale);
surTotalPage.setStyleAttribute("padding-left", "5px");
add(surTotalPage);
//Séparation
add(new SeparatorToolItem());
suivPage = new Button();
suivPage.setIcon(Images.ICONES.resultsetNext());
add(suivPage);
dernierePage = new Button();
dernierePage.setIcon(Images.ICONES.resultsetLast());
add(dernierePage);
 
//Séparation
add(new SeparatorToolItem());
rafraichir = new Button();
rafraichir.setIcon(Images.ICONES.rafraichir());
add(rafraichir);
//Séparation
add(new SeparatorToolItem());
afficherNbElem = new Text(i18nC.afficher());
afficherNbElem.setStyleAttribute("padding", "0 5px 0 5px");
add(afficherNbElem);
 
// Attention l'appel à setTriggerAction avec ALL est indispensable
// pour éviter un bug lors de la selection de la taille de page par défaut
selecteurTaillePage.setTriggerAction(TriggerAction.ALL);
selecteurTaillePage.setLazyRender(false);
selecteurTaillePage.setWidth("40px");
setIntervallesPages();
add(selecteurTaillePage);
labelElement = i18nC.elements();
nbElemParPage = new Text(labelElement+" "+i18nC.parPage());
nbElemParPage.setStyleAttribute("padding-left", "5px");
add(nbElemParPage);
//Séparation
add(new SeparatorToolItem());
intervalleElements = new Text(i18nM.elementsAffiches(UtilString.ucFirst(labelElement),
pageCourante * taillePage, (pageCourante + 1) * taillePage, nbElement));
add(intervalleElements);
// on ajoute les différents listeners
ajouterListeners();
}
 
public BarrePaginationVue(ListePaginable listePaginableCourante, Mediateur mediateurCourant, ChampFiltreRecherche champFiltreRechercheCourant) {
this(listePaginableCourante, mediateurCourant);
champFiltreRecherche = champFiltreRechercheCourant;
}
/**
* Texte nommant les elements pagines (Images, Observation, truc, machin etc...).
* @param label
*/
public void setLabelElement(String label) {
this.labelElement = label;
nbElemParPage.setText(labelElement + " par page ");
intervalleElements.setText(i18nM.elementsAffiches(UtilString.ucFirst(labelElement),
pageCourante * taillePage, (pageCourante + 1) * taillePage, nbElement));
}
 
public void setTaillePageParDefaut(int taille) {
this.taillePageDefaut = taille;
selecteurTaillePage.setRawValue(""+taillePageDefaut);
}
public void setIntervallesPages() {
if (!intervallePages.contains(taillePage)) {
intervallePages.add(taillePage);
}
Iterator<Integer> itIntervallePages = intervallePages.iterator();
while (itIntervallePages.hasNext()) {
Integer intervalle = itIntervallePages.next();
selecteurTaillePage.add(intervalle);
}
 
selecteurTaillePage.setSimpleValue(taillePage);
}
/**
* Change l'état de la barre de pagination a actif ou inactif
* @param etat actif ou inactif
*/
private void changerEtatBarre(boolean etat) {
premierePage.setEnabled(etat);
prevPage.setEnabled(etat);
suivPage.setEnabled(etat);
dernierePage.setEnabled(etat);
champPage.setEnabled(etat);
selecteurTaillePage.setEnabled(etat);
page.setEnabled(etat);
surTotalPage.setEnabled(etat);
afficherNbElem.setEnabled(etat);
nbElemParPage.setEnabled(etat);
}
/**
* ajoute les différents listeners nécessaires au bon fonctionnement des
* éléments de la barre de pagination
*/
@SuppressWarnings("unchecked")
private void ajouterListeners() {
premierePage.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
pageCourante = 0;
rafraichirNumeroPage();
changePage();
}
});
// boutons suivants et précédents
prevPage.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
// si la page courante n'est pas la première
if (pageCourante > 0) {
// on décrémente la page courante de 1
pageCourante--;
// on rafraichit l'affichage
rafraichirNumeroPage();
changePage();
}
}
});
 
suivPage.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
// si la page courante n'est pas la dernière
if (pageCourante < pageTotale - 1) {
// on incrémente la page courante de 1
pageCourante++;
// on rafraichit l'affichage
rafraichirNumeroPage();
changePage();
}
}
});
dernierePage.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
pageCourante = pageTotale;
rafraichirNumeroPage();
changePage();
}
});
rafraichir.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
changePage();
}
});
 
champPage.addKeyListener(new KeyListener() {
public void componentKeyUp(ComponentEvent ce) {
// on teste si la touche entrée a été pressée
if (ce.getKeyCode() == KeyCodes.KEY_ENTER) {
int nouvellePage = champPage.getValue().intValue();
 
// on verifie s'il est nécessaire de changer de page
// et si la nouvelle est comprise dans l'intervalle des
// pages existantes (0..pageTotale)
if (nouvellePage != pageCourante + 1 && nouvellePage > 0
&& nouvellePage <= pageTotale) {
// le cas échéant, on charge la nouvelle page et on
// notifie le médiateur
changerPageCourante(nouvellePage - 1);
changePage();
} else {
// sinon on reaffiche l'ancien numero de page sans rien changer
rafraichirNumeroPage();
champPage.focus();
}
}
}
});
 
// listener pour la selection dans la combobox
selecteurTaillePage.addSelectionChangedListener(new SelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent e) {
SimpleComboBox comboBox = (SimpleComboBox) e.getSource();
String nouvelleTaillePageString = comboBox.getRawValue();
int nouvelleTaillePage = Integer.parseInt(nouvelleTaillePageString);
changerTaillePage(nouvelleTaillePage);
rafraichirNumeroPage();
}
});
}
 
public void changePage() {
// si notre barre de pagination n'a pas été initialisée
// avec un filtre de recherche, contentons-nous de changer de page
// Attention, car tous les webservice ne supporte pas un segment d'URI "null" (500)
if(champFiltreRecherche == null || champFiltreRecherche.getFiltreValue() == null) {
// et on notifie le médiateur de l'évenement
listePaginable.changerNumeroPage(pageCourante);
} else {
// autrement nous pouvons changer de page *tout en conservant* le filtre de recherche,
// charge au modèle de cette liste d'avoir implémenté correctement filtrerParNomEtPage()
listePaginable.filtrerParNomEtPage(champFiltreRecherche.getFiltreValue(), pageCourante);
}
}
 
/**
* Met à jour les affichage sur les numéros de pages et d'intervalle
* d'éléments à partir des variables de classes
*/
public void rafraichirNumeroPage() {
surTotalPage.setText(" sur " + pageTotale);
if (nbElement == 0) {
champPage.setValue(0);
// on met simplement à jour l'intervalle qui contient toujours le
// même nombre d'éléments
intervalleElements.setText(i18nM.elementsAffiches(UtilString.ucFirst(labelElement), 0,0,0));
} else {
champPage.setValue(pageCourante + 1);
// si la page n'est pas la dernière
if (pageCourante + 1 != pageTotale) {
// sauf pour la dernière page qui contient souvent moins
// d'élements que le nombre d'élements par page
intervalleElements.setText(i18nM.elementsAffiches(UtilString.ucFirst(labelElement), pageCourante * taillePage,
(pageCourante + 1) * taillePage, nbElement));
} else {
// on met simplement à jour l'intervalle qui contient toujours
// le même nombre d'éléments
intervalleElements.setText(i18nM.elementsAffiches(UtilString.ucFirst(labelElement), pageCourante * taillePage,
nbElement, nbElement));
}
}
}
 
/**
* Met à jour la page en cours
*
* @param nouvellePageCourante
* la nouvelle page en cours
*/
public void changerPageCourante(int nouvellePageCourante) {
pageCourante = nouvellePageCourante;
}
 
/**
* Envoie au médiateur une demande pour modifier la taille de la page (qui
* va à son tour faire les modifications nécessaires)
*
* @param nouvelleTaillePage
* la nouvelle taille de page (élement appartenant au tableau
* renvoyé par getNbPages())
*/
public void changerTaillePage(int nouvelleTaillePage) {
if (nouvelleTaillePage != taillePage) {
listePaginable.changerTaillePage(nouvelleTaillePage);
}
}
 
/**
* Selectionne la valeur correspond à celle passée en paramètre dans la
* combobox (si elle existe)
*
* @param nouvelleTaillePage
* la nouvelle taille de page
*/
public void selectionnerTaillePage(int nouvelleTaillePage) {
selecteurTaillePage.setRawValue("" + nouvelleTaillePage);
}
public void allerALaDernierePage() {
changerPageCourante(pageTotale);
changePage();
}
 
public void rafraichir(Object nouvelleDonnees) {
// si on reçoit un tableau de int
if (nouvelleDonnees instanceof int[]) {
int[] page = (int[]) nouvelleDonnees;
// le premier élement est le nombre de pages totales
pageTotale = page[0];
// le second la page en cours
pageCourante = page[1];
// le troisième la taille de la page
taillePage = page[2];
// et le dernier le nombre total d'éléments
nbElement = page[3];
// si la page courante dépasse la page totale (cas normalement
// improbable car géré en amont)
// on met le numéro de page à la page courante -1 (car la page
// courante est comptée à partir
// de zéro)
if (pageCourante >= pageTotale && pageCourante != 0) {
pageCourante = pageTotale - 1;
// le cas échéant on en notifie le médiateur
changePage();
}
}
 
// enfin on rafraichit les informations affichées à partir des nouvelles
// variables de classes mises à jour
rafraichirNumeroPage();
layout();
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/BarrePaginationVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/BarrePaginationVue.java:r11-593,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/BarrePaginationVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/accueil/AccueilTutorielVue.java
New file
0,0 → 1,130
package org.tela_botanica.client.vues.accueil;
 
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Menu;
import org.tela_botanica.client.util.Pattern;
import org.tela_botanica.client.util.Print;
 
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.ButtonScale;
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.event.TreePanelEvent;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.store.TreeStore;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.HtmlContainer;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.StoreFilterField;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.custom.Portlet;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.extjs.gxt.ui.client.widget.treepanel.TreePanel;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.Request;
import org.tela_botanica.client.http.RequestBuilderWithCredentials;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.regexp.shared.MatchResult;
import com.google.gwt.regexp.shared.RegExp;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Window;
 
public class AccueilTutorielVue extends LayoutContainer {
 
private static final String SERVICE_NOM = "CoelAide";
private static final String PAGE_A_OUVRIR_CODE = "AideCOELTutoriel";
private static Menu pagePrincipale = null;
private static Menu menuAOuvrirParDefaut = null;
 
private ContentPanel contenuPanneau = null;
private HtmlContainer conteneurDuHtml;
private LayoutContainer entetePanneau;
public AccueilTutorielVue(Mediateur mediateur) {
setLayout(new FitLayout());
creerPanneauContenu();
chargerPageParDefaut();
}
private void chargerPageParDefaut() {
String serviceUrl = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl();
String defautPageUrl = serviceUrl+SERVICE_NOM+"/"+PAGE_A_OUVRIR_CODE+"/";
chargerPageAide(defautPageUrl);
}
 
private void creerPanneauContenu() {
contenuPanneau = new ContentPanel();
contenuPanneau.setScrollMode(Scroll.AUTO);
contenuPanneau.setHeaderVisible(false);
contenuPanneau.setLayout(new FitLayout());
add(contenuPanneau);
}
private void chargerPageAide(String url) {
conteneurDuHtml = new HtmlContainer() {
public void onBrowserEvent(Event e) {
// Nous vérifions que l'évenement est un clic et qu'il a lieu sur un lien
if (e.getTypeInt() == Event.ONCLICK && e.getEventTarget().toString().startsWith("<a href=\"http://")) {
e.preventDefault();
String urlPageCliquee = extraireLien(e.getEventTarget().toString());
if(urlPageCliquee != null) {
chargerPageAide(urlPageCliquee);
}
} else {
GWT.log("Event target:"+e.getEventTarget().toString()+" - type :"+e.getTypeInt()+"="+Event.ONCLICK, null);
}
}
};
conteneurDuHtml.setId(ComposantId.PANNEAU_TUTORIEL);
 
conteneurDuHtml.sinkEvents(Event.ONCLICK);
conteneurDuHtml.setUrl(url);
conteneurDuHtml.recalculate();
contenuPanneau.removeAll();
contenuPanneau.add(conteneurDuHtml);
contenuPanneau.layout();
conteneurDuHtml.setStyleAttribute("padding-left", "5px");
conteneurDuHtml.setStyleAttribute("padding-top", "5px");
}
public String extraireLien(String str) {
String lien = null;
RegExp regExp = RegExp.compile("href=\"(.*?)\"");
MatchResult matcher = regExp.exec(str);
boolean matchOK = (matcher != null);
if (matchOK) {
//TODO plus de vérifications
lien = matcher.getGroup(1);
}
return lien;
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/accueil/Applette.java
New file
0,0 → 1,86
package org.tela_botanica.client.vues.accueil;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.event.IconButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.button.ToolButton;
import com.extjs.gxt.ui.client.widget.custom.Portlet;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
 
abstract public class Applette extends Portlet {
protected Mediateur mediateur = null;
private ToolButton epingleBouton = null;
private ToolButton configurationBouton = null;
private ToolButton fermetureBouton = null;
protected void initialiserApplette(Mediateur mediateurCourrant) {
initialiserApplette(mediateurCourrant, null);
}
protected void initialiserApplette(Mediateur mediateurCourrant, String titre) {
mediateur = mediateurCourrant;
setLayout(new FitLayout());
setHeight(250);
setCollapsible(true);
setAnimCollapse(true);
setScrollMode(Scroll.AUTO);
setTitre(titre);
configurationBouton = new ToolButton("x-tool-gear");
getHeader().addTool(configurationBouton);
epingleBouton = getBoutonEpingle();
getHeader().addTool(epingleBouton);
fermetureBouton = getBoutonFermeture();
getHeader().addTool(fermetureBouton);
}
private ToolButton getBoutonEpingle() {
ToolButton bouton = new ToolButton("x-tool-pin", new SelectionListener<IconButtonEvent>() {
@Override
public void componentSelected(IconButtonEvent ce) {
setEpingler(!isPinned());
}
});
return bouton;
}
private ToolButton getBoutonFermeture() {
ToolButton bouton = new ToolButton("x-tool-close", new SelectionListener<IconButtonEvent>() {
@Override
public void componentSelected(IconButtonEvent ce) {
removeFromParent();
}
});
return bouton;
}
public void setTitre(String titre) {
if (titre != null) {
setHeadingHtml(titre);
}
}
public void setEpingler(boolean epingler) {
if (epingler) {
epingleBouton.setStyleName("x-tool-unpin x-tool");
setPinned(true);
} else {
epingleBouton.setStyleName("x-tool-pin x-tool");
setPinned(false);
}
Debug.log("epingleBouton.getStyleName() = "+epingleBouton.getStyleName());
layout();
}
protected void ajouterConfigurationListener(SelectionListener<IconButtonEvent> configurationListener) {
configurationBouton.addSelectionListener(configurationListener);
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/accueil/AppletteStatistique.java
New file
0,0 → 1,107
package org.tela_botanica.client.vues.accueil;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.modeles.InterneValeur;
import org.tela_botanica.client.vues.Formulaire;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.event.IconButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.event.WindowEvent;
import com.extjs.gxt.ui.client.event.WindowListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.HtmlContainer;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
 
public class AppletteStatistique extends Applette {
private String baseUrl = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl();
 
public AppletteStatistique(Mediateur mediateurCourrant) {
initialiserAppletteStatistique(mediateurCourrant, null);
}
public AppletteStatistique(Mediateur mediateurCourrant, String contenu) {
initialiserAppletteStatistique(mediateurCourrant, contenu);
}
private void initialiserAppletteStatistique(Mediateur mediateurCourrant, String contenu) {
String titre = "Statistiques des collections";
initialiserApplette(mediateurCourrant, titre);
SelectionListener<IconButtonEvent> configurationListener = new SelectionListener<IconButtonEvent>() {
@Override
public void componentSelected(IconButtonEvent ce) {
ContentPanel panneau = new ContentPanel();
panneau.setHeaderVisible(false);
panneau.setLayout(Formulaire.creerFormLayout(350, LabelAlign.TOP));
ListStore<InterneValeur> appletteStore = new ListStore<InterneValeur>();
appletteStore.add(new InterneValeur("NombreDonnees", "Nombre de données"));
appletteStore.add(new InterneValeur("MesDonnees", "Ma participation"));
appletteStore.add(new InterneValeur("TypeDepot", "Types de dépôt des collections"));
appletteStore.add(new InterneValeur("NombreCollectionParStructure", "Nombre de collections par institution"));
final ComboBox<InterneValeur> applettesCombo = new ComboBox<InterneValeur>();
applettesCombo.setFieldLabel("Veuillez sélectionner le type d'applette");
applettesCombo.setForceSelection(true);
applettesCombo.setTriggerAction(TriggerAction.ALL);
applettesCombo.setDisplayField("nom");
applettesCombo.setStore(appletteStore);
applettesCombo.setEditable(false);
applettesCombo.setWidth(300);
panneau.add(applettesCombo);
final Dialog configurationFenetre = new Dialog();
configurationFenetre.setHeadingHtml("Configuration de l'applette");
configurationFenetre.setButtons(Dialog.OK);
configurationFenetre.setSize(350, 150);
configurationFenetre.setPlain(true);
configurationFenetre.setModal(true);
configurationFenetre.setBlinkModal(true);
configurationFenetre.setLayout(new FitLayout());
configurationFenetre.setHideOnButtonClick(true);
configurationFenetre.addWindowListener(new WindowListener(){
public void windowHide(WindowEvent we) {
String abreviation = applettesCombo.getValue().getAbr();
attribuerContenu(abreviation);
}
});
configurationFenetre.add(panneau);
configurationFenetre.show();
}
};
ajouterConfigurationListener(configurationListener);
attribuerContenu(contenu);
}
 
private void attribuerContenu(String abreviation) {
if (abreviation == null) {
abreviation = "NombreDonnees";
}
setData("contenu", abreviation);
String url = baseUrl+"CoelStatistique/"+abreviation;
if (abreviation.equals("MesDonnees")) {
url += "/"+mediateur.getUtilisateurId();
}
HtmlContainer conteneurHtml = new HtmlContainer();
conteneurHtml.setUrl(url);
conteneurHtml.recalculate();
removeAll();
add(conteneurHtml);
layout();
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/accueil/StatistiquesVue.java
New file
0,0 → 1,301
package org.tela_botanica.client.vues.accueil;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.TreeMap;
 
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.EventType;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.event.TabPanelEvent;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.custom.Portal;
import com.extjs.gxt.ui.client.widget.custom.Portlet;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.Element;
import com.google.gwt.xml.client.Node;
import com.google.gwt.xml.client.NodeList;
import com.google.gwt.xml.client.XMLParser;
 
public class StatistiquesVue extends LayoutContainer implements Rafraichissable {
private Mediateur mediateur = null;
private Constantes i18nC = null;
private static Portal portail = null;
private static boolean enregistrementEnCours = false;
private ContentPanel panneauPrincipalPortail = new ContentPanel();
public StatistiquesVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
i18nC = Mediateur.i18nC;
setLayout(new FitLayout());
panneauPrincipalPortail = new ContentPanel();
panneauPrincipalPortail.setLayout(new FitLayout());
panneauPrincipalPortail.setHeaderVisible(false);
panneauPrincipalPortail.setBorders(false);
final ToolBar barreOutils = new ToolBar();
Button ajouter = new Button(i18nC.ajouter());
ajouter.setIcon(Images.ICONES.ajouter());
ajouter.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent be) {
ajouterPortlet();
}
});
ajouter.setToolTip(i18nC.indicationAjouterStatistiqueAccueil());
barreOutils.add(ajouter);
Button enregistrer = new Button("Enregistrer");
enregistrer.setIcon(Images.ICONES.appliquer());
enregistrer.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent be) {
if (enregistrementEnCours == false) {
enregistrerParametres();
} else {
InfoLogger.display(i18nC.accueilEnregistrement(), i18nC.accueilEnregistrementEnCours());
}
}
});
enregistrer.setToolTip(i18nC.indicationEnregistrerAccueil());
barreOutils.add(enregistrer);
panneauPrincipalPortail.setTopComponent(barreOutils);
portail = creerPortail();
ajouterPortletsDefaut();
Utilisateur utilisateur = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateur();
if(utilisateur.isIdentifie()) {
chargerParametres();
}
panneauPrincipalPortail.add(portail);
add(panneauPrincipalPortail);
mediateur.desactiverChargement(this);
}
private Portal creerPortail() {
final Portal portail = new Portal(3);
portail.setBorders(true);
portail.addListener(Events.Render, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
portail.setStyleAttribute("backgroundColor", "white");
}
});
portail.setShadow(true);
portail.setColumnWidth(0, .33);
portail.setColumnWidth(1, .33);
portail.setColumnWidth(2, .33);
return portail;
}
// INFO: Les items d'une classse portal correspondent aux colonnes. Pour vider une Portal, il faut donc vider les éléments de chaque item du Portal.
private void viderPortail() {
portail.getItem(0).removeAll();
portail.getItem(1).removeAll();
portail.getItem(2).removeAll();
}
private void chargerParametres() {
viderPortail();
Document paramXml = XMLParser.parse(mediateur.getUtilisateur().getParametre());
NodeList listeAccueilNoeud = paramXml.getElementsByTagName("accueil");
int nbreAccueilNoeud = listeAccueilNoeud.getLength();
 
// Récupération du noeud accueil
Node accueilNoeud = null;
if (nbreAccueilNoeud == 0) {
ajouterPortletsDefaut();
} else if (nbreAccueilNoeud == 1) {
accueilNoeud = listeAccueilNoeud.item(0);
NodeList listeAppletteNoeud = accueilNoeud.getChildNodes();
// un noeud de type vide indique que l'utilisateur a explicité effacé les applettes de la page d'accueil
if(listeAppletteNoeud.getLength() > 0 && !listeAppletteNoeud.item(0).getNodeName().equals("vide")) {
portail.removeAll();
// Lecture des noeuds "applette"
int nbreAppletteNoeud = listeAppletteNoeud.getLength();
TreeMap<String, HashMap<String, String>> tableApplettes = new TreeMap<String, HashMap<String, String>>();
for (int i = 0; i < nbreAppletteNoeud ; i++) {
Element appletteNoeud = (Element) listeAppletteNoeud.item(i);
int colonne = Integer.parseInt(appletteNoeud.getAttribute("colonne"));
int index = Integer.parseInt(appletteNoeud.getAttribute("index"));
HashMap<String, String> infoApplette = new HashMap<String, String>();
infoApplette.put("reduite", appletteNoeud.getAttribute("reduite"));
infoApplette.put("epingle", appletteNoeud.getAttribute("epingle"));
infoApplette.put("type", appletteNoeud.getAttribute("type"));
infoApplette.put("colonne", appletteNoeud.getAttribute("colonne"));
infoApplette.put("index", appletteNoeud.getAttribute("index"));
infoApplette.put("contenu", appletteNoeud.getAttribute("contenu"));
tableApplettes.put(colonne+"-"+index, infoApplette);
}
Iterator<String> it = tableApplettes.keySet().iterator();
while (it.hasNext()) {
String id = it.next();
HashMap<String, String> infoApplette = tableApplettes.get(id);
boolean reduite = (infoApplette.get("reduite") != null && infoApplette.get("reduite").equals("true")) ? true : false;
boolean epingle = (infoApplette.get("epingle") != null && infoApplette.get("epingle").equals("true")) ? true : false;
int index = Integer.parseInt(infoApplette.get("index"));
int colonne = Integer.parseInt(infoApplette.get("colonne"));
ajouterPortlet(reduite, epingle, infoApplette.get("type"), colonne, index, infoApplette.get("contenu"));
}
} else if(listeAppletteNoeud.getLength() == 0) {
ajouterPortletsDefaut();
}
}
layout();
}
private void enregistrerParametres() {
ArrayList<Portlet> applettes = getPortlets();
Iterator<Portlet> it = applettes.iterator();
Document paramXml = XMLParser.parse(mediateur.getUtilisateur().getParametre());
NodeList listeAccueilNoeud = paramXml.getElementsByTagName("accueil");
int nbreAccueilNoeud = listeAccueilNoeud.getLength();
 
// Suppression des noeuds "accueil" existant car il ne devrait y en avoir qu'un
if (nbreAccueilNoeud > 1) {
for (int i = 0; i < nbreAccueilNoeud ; i++) {
paramXml.getDocumentElement().removeChild(listeAccueilNoeud.item(i));
}
nbreAccueilNoeud = 0;
}
// Création du nouveau noeud accueil
Node accueilNoeud = null;
Element accueilElement = paramXml.createElement("accueil");
if (nbreAccueilNoeud == 0) {
accueilNoeud = paramXml.getDocumentElement().appendChild(accueilElement);
} else if (nbreAccueilNoeud == 1) {
accueilNoeud = listeAccueilNoeud.item(0);
paramXml.getDocumentElement().replaceChild(accueilElement, accueilNoeud);
accueilNoeud = paramXml.getElementsByTagName("accueil").item(0);
}
// si il existe des applettes ouvertes
if(it.hasNext()) {
// Ajout des noeuds "applette" au noeud "accueil"
while (it.hasNext()) {
Portlet applette = it.next();
String reduite = (applette.isCollapsed() ? "true" : "false");
String epingle = (applette.isPinned() ? "true" : "false");
String index = Integer.toString(portail.getPortletIndex(applette));
String colonne = Integer.toString(portail.getPortletColumn(applette));
String contenu = applette.getData("contenu");
Element appletteElement = paramXml.createElement("applette");
appletteElement.setAttribute("reduite", reduite);
appletteElement.setAttribute("epingle", epingle);
appletteElement.setAttribute("type", "statistique");
appletteElement.setAttribute("colonne", colonne);
appletteElement.setAttribute("index", index);
appletteElement.setAttribute("contenu", contenu);
accueilNoeud.appendChild(appletteElement);
}
} else {
// sinon ajout d'un noeud vide
Element videElement = paramXml.createElement("vide");
accueilNoeud.appendChild(videElement);
}
enregistrementEnCours = true;
mediateur.getUtilisateur().setParametre(paramXml.toString());
mediateur.modifierUtilisateur();
}
private ArrayList<Portlet> getPortlets() {
ArrayList<Portlet> applettes = new ArrayList<Portlet>();
for (int i = 0; i < 3; i++) {
int nbreApplette = portail.getItem(i).getItemCount();
if (nbreApplette > 0) {
for (int j = 0; j < nbreApplette; j++) {
applettes.add((Portlet) portail.getItem(i).getItem(j));
}
}
}
return applettes;
}
private void ajouterPortlet() {
ajouterPortlet(false, false, "statistique", 0, 0, null);
}
private void ajouterPortlet(boolean reduite, boolean epingle, String type, int colonne, int index, String contenu) {
Applette applette = null;
if (type.equals("statistique")) {
applette = new AppletteStatistique(mediateur, contenu);
}
if (reduite) {
applette.collapse();
}
portail.insert(applette, index, colonne);
applette.setEpingler(epingle);
layout();
}
private void ajouterPortletsDefaut() {
//TODO créer une énum des différents types de portlet puis faire une boucle
// dessus
Applette applette = new AppletteStatistique(mediateur, "NombreDonnees");
portail.insert(applette, 0, 0);
applette.setEpingler(true);
applette = new AppletteStatistique(mediateur, "MesDonnees");
portail.insert(applette, 0, 1);
applette = new AppletteStatistique(mediateur, "TypeDepot");
portail.insert(applette, 0, 2);
applette = new AppletteStatistique(mediateur, "NombreCollectionParStructure");
portail.insert(applette, 1, 0);
layout();
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
String type = info.getType();
if (type.equals("maj_utilisateur")) {
if (enregistrementEnCours == true) {
enregistrementEnCours = false;
InfoLogger.display(i18nC.accueilEnregistrement(), i18nC.accueilEnregistrementSucces());
} else {
chargerParametres();
InfoLogger.display(i18nC.accueil(), i18nC.accueilChargementSucces());
}
}
} else {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/accueil/AccueilVue.java
New file
0,0 → 1,64
package org.tela_botanica.client.vues.accueil;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.TreeMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.EventType;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.event.TabPanelEvent;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.custom.Portal;
import com.extjs.gxt.ui.client.widget.custom.Portlet;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.Element;
import com.google.gwt.xml.client.Node;
import com.google.gwt.xml.client.NodeList;
import com.google.gwt.xml.client.XMLParser;
 
public class AccueilVue extends LayoutContainer implements Rafraichissable {
private Mediateur mediateur = null;
private Constantes i18nC = null;
private static Widget tutoriel = null;
public AccueilVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
i18nC = Mediateur.i18nC;
setLayout(new FitLayout());
setBorders(false);
tutoriel = new AccueilTutorielVue(mediateur);
add(tutoriel);
mediateur.desactiverChargement(this);
}
 
@Override
public void rafraichir(Object nouvellesDonnees) {
// TODO Auto-generated method stub
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/accueil
New file
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/accueil:r1136-1291
Merged /trunk/src/org/tela_botanica/client/vues/accueil:r11-911,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/accueil:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/publication/PublicationImportForm.java
New file
0,0 → 1,112
package org.tela_botanica.client.vues.publication;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.publication.PublicationAsyncDao;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.Callback;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FileUpload;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent;
import com.google.gwt.user.client.ui.FormPanel.SubmitEvent;
import com.google.gwt.user.client.ui.Hidden;
import com.google.gwt.user.client.ui.VerticalPanel;
 
public abstract class PublicationImportForm extends LayoutContainer {
 
private Mediateur mediateurCourant = null;
 
public PublicationImportForm(Mediateur mediateurCourant) {
this.mediateurCourant= mediateurCourant;
final FormPanel form = new FormPanel();
form.setAction(PublicationAsyncDao.getUrlImport());
 
form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);
VerticalPanel panel = new VerticalPanel();
form.setWidget(panel);
 
FileUpload upload = new FileUpload();
upload.setName("import_publication");
panel.add(upload);
Hidden typeUpload = new Hidden("type", "publication");
Hidden utilisateur = new Hidden("ce_utilisateur", ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId());
panel.add(typeUpload);
panel.add(utilisateur);
 
HorizontalPanel boutonsPanel = new HorizontalPanel();
boutonsPanel.add(new Button(Mediateur.i18nC.importer(), new ClickHandler() {
public void onClick(ClickEvent event) {
form.submit();
}
}));
boutonsPanel.add(new Button(Mediateur.i18nC.annuler(), new ClickHandler() {
public void onClick(ClickEvent event) {
surClicAnnuler();
}
}));
 
form.addSubmitHandler(new FormPanel.SubmitHandler() {
@Override
public void onSubmit(SubmitEvent event) {
surSoumissionFormulaire(event);
}
});
form.addSubmitCompleteHandler(new FormPanel.SubmitCompleteHandler() {
@Override
public void onSubmitComplete(SubmitCompleteEvent event) {
String resultat = event.getResults();
// Le formulaire est envoyé à travers un iframe caché, ce qui pose problème
// à certains navigateurs pour lire le retour
// si rien n'est renvoyé, on demande les stats d'upload au service par une autre requête
if(resultat == null || resultat.isEmpty()) {
PublicationAsyncDao.demanderStatistiquesDernierImport(new Callback<JSONValue, String>() {
@Override
public void onSuccess(JSONValue result) {
surFormulaireEnvoye(result);
}
@Override
public void onFailure(String reason) {
// TODO Auto-generated method stub
}
});
} else {
JSONValue responseValue = JSONParser.parseStrict(resultat);
surFormulaireEnvoye(responseValue);
}
}
});
Html indicationImportForm = new Html("<div id=\"indication_import_csv\"><a target=\"_blank\" href=\"documents/import_publications.csv\">"+Mediateur.i18nC.telechargerModeleImportPubli()+"</a><br />");
add(indicationImportForm);
add(form);
add(boutonsPanel);
}
public abstract void surSoumissionFormulaire(SubmitEvent event);
public abstract void surFormulaireEnvoye(JSONValue reponse);
public abstract void surClicAnnuler();
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/publication/PublicationVue.java
New file
0,0 → 1,55
package org.tela_botanica.client.vues.publication;
 
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
import org.tela_botanica.client.modeles.publication.PublicationListe;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.google.gwt.core.client.GWT;
 
public class PublicationVue extends LayoutContainer implements Rafraichissable {
private Mediateur mediateur = null;
private PublicationListeVue panneauPublicationListe;
private PublicationDetailVue panneauPublicationDetail;
public PublicationVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
BorderLayout layout = new BorderLayout();
layout.setEnableState(false);
setLayout(layout);
 
panneauPublicationListe = new PublicationListeVue(mediateur);
add(panneauPublicationListe, new BorderLayoutData(LayoutRegion.CENTER));
 
panneauPublicationDetail = new PublicationDetailVue(mediateur);
BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, .5f, 200, 1000);
southData.setSplit(true);
southData.setMargins(new Margins(5, 0, 0, 0));
add(panneauPublicationDetail, southData);
setId(ComposantId.PANNEAU_PUBLICATION_LISTE);
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Publication) {
panneauPublicationDetail.rafraichir(nouvellesDonnees);
} else if (nouvellesDonnees instanceof PublicationListe) {
panneauPublicationListe.rafraichir(nouvellesDonnees);
mediateur.desactiverChargement(this);
} else if (nouvellesDonnees instanceof Information) {
panneauPublicationListe.rafraichir(nouvellesDonnees);
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/publication/PublicationVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/publication/PublicationVue.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/publication/PublicationVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/publication/PublicationListeVue.java
New file
0,0 → 1,277
package org.tela_botanica.client.vues.publication;
 
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.ChampFiltreRecherche;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
import org.tela_botanica.client.modeles.publication.PublicationListe;
import org.tela_botanica.client.modeles.structure.StructureListe;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.vues.BarrePaginationVue;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class PublicationListeVue extends ContentPanel implements Rafraichissable {
 
private Mediateur mediateur = null;
private Constantes i18nC = null;
 
private Grid<Publication> grille = null;
private ListStore<Publication> store = null;
private ColumnModel modeleDesColonnes = null;
 
private Button ajouter;
private Button modifier;
private Button supprimer;
private Button importer;
private ChampFiltreRecherche champFiltreRecherche = null;
private BarrePaginationVue pagination = null;
private int indexElementSelectionne = 0;
private Publication publicationSelectionnee = null;
public PublicationListeVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
i18nC = Mediateur.i18nC;
setLayout(new FitLayout());
setHeaderVisible(false);
// Gestion de la barre d'outil
ToolBar toolBar = new ToolBar();
ajouter = new Button(i18nC.ajouter());
ajouter.setIcon(Images.ICONES.ajouter());
ajouter.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent be) {
mediateur.clicAjouterPublication();
}
});
ajouter.setToolTip(i18nC.indicationCreerUneFiche()+" "+i18nC.publicationSingulier());
toolBar.add(ajouter);
 
modifier = new Button(i18nC.modifier());
modifier.setIcon(Images.ICONES.formModifier());
modifier.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent be) {
mediateur.clicModifierPublication(grille.getSelectionModel().getSelectedItems());
}
});
modifier.setToolTip(i18nC.indicationModifierUneFiche());
toolBar.add(modifier);
supprimer = new Button(i18nC.supprimer());
supprimer.setIcon(Images.ICONES.supprimer());
supprimer.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent be) {
mediateur.clicSupprimerPublication(grille.getSelectionModel().getSelectedItems());
}
});
supprimer.setToolTip(i18nC.indicationSupprimerUneFiche());
toolBar.add(supprimer);
setTopComponent(toolBar);
 
// Gestion de la grille
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
// ATTENTION : les noms des colonnes doivent correspondre aux noms variables de la classe utilisée dans la liste
colonnes.add(new ColumnConfig("fmt_auteur", i18nC.publicationAuteurs(), 200));
colonnes.add(new ColumnConfig("titre", i18nC.publicationTitre(), 150));
colonnes.add(new ColumnConfig("collection", i18nC.publicationRevueCollection(), 110));
colonnes.add(creerColonneEditeur());
colonnes.add(creerColonneAnneePublication());
colonnes.add(new ColumnConfig("indication_nvt", i18nC.publicationNvt(), 35));
colonnes.add(new ColumnConfig("fascicule", i18nC.publicationFascicule(), 35));
colonnes.add(new ColumnConfig("truk_pages", i18nC.publicationPage(), 35));
modeleDesColonnes = new ColumnModel(colonnes);
 
GridSelectionModel<Publication> modeleDeSelection = new GridSelectionModel<Publication>();
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Publication>() {
public void selectionChanged(SelectionChangedEvent<Publication> event) {
publicationSelectionnee = (Publication) event.getSelectedItem();
indexElementSelectionne = store.indexOf(publicationSelectionnee);
clicListe(publicationSelectionnee);
}
});
store = new ListStore<Publication>();
store.sort("titre", SortDir.ASC);
grille = new Grid<Publication>(store, modeleDesColonnes);
grille.setWidth("100%");
grille.setAutoExpandColumn("titre");
grille.getView().setAutoFill(true);
grille.getView().setForceFit(true);
grille.setSelectionModel(modeleDeSelection);
grille.addListener(Events.ViewReady, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
grille.getSelectionModel().select(0, false);
}
});
grille.addListener(Events.OnDoubleClick, new Listener<BaseEvent>(){
public void handleEvent(BaseEvent be) {
modifier.fireEvent(Events.Select);
}
});
add(grille);
PublicationListe publicationListe = new PublicationListe();
champFiltreRecherche = new ChampFiltreRecherche(mediateurCourant, toolBar, publicationListe);
importer = new Button(i18nC.importer());
importer.setIcon(Images.ICONES.importerCsv());
importer.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent be) {
if(mediateur.getUtilisateur().isIdentifie()) {
mediateur.clicImporterPublication(PublicationListeVue.this);
} else {
Window.alert(i18nC.identificationNecessaire());
}
}
});
importer.setToolTip(i18nC.indicationImporterUnePubli());
toolBar.add(importer);
// Définition de la barre de pagination
pagination = new BarrePaginationVue(publicationListe, mediateur, champFiltreRecherche);
setBottomComponent(pagination);
}
private ColumnConfig creerColonneEditeur() {
GridCellRenderer<Publication> editeurRendu = new GridCellRenderer<Publication>() {
public String render(Publication model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<Publication> store, Grid<Publication> grid) {
String editeur = model.getNomEditeur();
model.set("_editeur_", editeur);
return editeur;
}
};
ColumnConfig editeurColonne = new ColumnConfig("_editeur_", i18nC.publicationEditeur(), 135);
editeurColonne.setRenderer(editeurRendu);
return editeurColonne;
}
private ColumnConfig creerColonneAnneePublication() {
GridCellRenderer<Publication> datePublicationRendu = new GridCellRenderer<Publication>() {
public String render(Publication model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<Publication> store, Grid<Publication> grid) {
String annee = model.getAnneeParution();
model.set("_annee_", annee);
return annee;
}
};
ColumnConfig datePublicationColonne = new ColumnConfig("_annee_", i18nC.publicationDateParution(), 75);
datePublicationColonne.setRenderer(datePublicationRendu);
return datePublicationColonne;
}
private void clicListe(Publication publication) {
if (publication != null && store.getCount() > 0) {
mediateur.clicListePublication(publication);
}
}
 
private void gererEtatActivationBouton() {
int nbreElementDuMagazin = store.getCount();
ajouter.enable();
if (nbreElementDuMagazin <= 0) {
supprimer.disable();
modifier.disable();
} else if (nbreElementDuMagazin > 0) {
modifier.enable();
if (((Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT)).isIdentifie()) {
supprimer.enable();
}
}
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof PublicationListe) {
PublicationListe publications = (PublicationListe) nouvellesDonnees;
champFiltreRecherche.setListePaginable(publications);
pagination.setlistePaginable(publications);
pagination.rafraichir(publications.getPageTable());
if (publications != null) {
List<Publication> liste = publications.toList();
store.removeAll();
store.add(liste);
mediateur.actualiserPanneauCentral();
}
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if (info.getType().equals("publication_modifiee")) {
if(publicationSelectionnee != null) {
store.remove(indexElementSelectionne);
publicationSelectionnee = null;
}
Publication publiModifee = (Publication)info.getDonnee(0);
// au cas ou le bouton appliquer aurait été cliqué avant de valider
store.remove(publiModifee);
store.insert(publiModifee, indexElementSelectionne);
publicationSelectionnee = publiModifee;
int indexElementSelectionne = store.indexOf(publicationSelectionnee);
grille.getSelectionModel().select(indexElementSelectionne, false);
grille.getView().focusRow(indexElementSelectionne);
clicListe(publicationSelectionnee);
} else if (info.getType().equals("suppression_publication")) {
InfoLogger.display(i18nC.publicationTitreSuppression(), info.getMessages().toString());
supprimerPublicationsSelectionnees();
gererEtatActivationBouton();
}
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
layout();
}
 
private void supprimerPublicationsSelectionnees() {
List<Publication> publicationsSelectionnees = grille.getSelectionModel().getSelectedItems();
Iterator<Publication> it = publicationsSelectionnees.iterator();
while (it.hasNext()) {
grille.getStore().remove(it.next());
}
layout(true);
}
public void afficherDernierePage() {
pagination.allerALaDernierePage();
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/publication/PublicationListeVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/publication/PublicationListeVue.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/publication/PublicationListeVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/publication/PublicationDetailVue.java
New file
0,0 → 1,155
package org.tela_botanica.client.vues.publication;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.vues.DetailVue;
 
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.util.Params;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.GWT;
 
public class PublicationDetailVue extends DetailVue implements Rafraichissable {
private String enteteTpl = null;
private String contenuTpl = null;
private ContentPanel panneauPrincipal = null;
private Html entete = null;
private Html contenu = null;
private Publication publication = null;
private boolean publicationChargementOk = false;
 
public PublicationDetailVue(Mediateur mediateurCourant) {
super(mediateurCourant);
initialiserTousLesTpl();
panneauPrincipal = new ContentPanel();
panneauPrincipal.setLayout(new FitLayout());
panneauPrincipal.setHeaderVisible(false);
panneauPrincipal.setBodyBorder(false);
entete = new Html();
entete.setId(ComposantId.ZONE_DETAIL_ENTETE);
panneauPrincipal.setTopComponent(entete);
contenu = new Html();
panneauPrincipal.add(contenu);
add(panneauPrincipal);
}
 
private void initialiserTousLesTpl() {
initialiserEnteteHtmlTpl();
initialiserGeneralTpl();
}
private void initialiserEnteteHtmlTpl() {
enteteTpl =
"<div id='{css_id}'>"+
" <h1>{titre}</h1>"+
" <h2>{auteurs} ({annee})<span class='{css_meta}'><br /> {i18n_id}:{id} - {guid}</span></h2>" +
"</div>";
}
private void initialiserGeneralTpl() {
contenuTpl =
"<div class='{css_corps}'>"+
" <span class='{css_label}'>{i18n_nom_complet} :</span> {nom_complet}<br />"+
" <span class='{css_label}'>{i18n_auteurs} :</span> {auteurs}<br />"+
" <span class='{css_label}'>{i18n_titre} :</span> {titre}<br />"+
" <span class='{css_label}'>{i18n_collection} :</span> {collection}<br />"+
" <span class='{css_label}'>{i18n_editeur} :</span> {editeur}<br />"+
" <span class='{css_label}'>{i18n_annee} :</span> {annee}<br />"+
" <span class='{css_label}'>{i18n_nvt} :</span> {nvt}<br />"+
" <span class='{css_label}'>{i18n_fascicule} :</span> {fascicule}<br />"+
" <span class='{css_label}'>{i18n_pages} :</span> {pages}<br />"+
"</div>";
}
public void afficherDetail() {
if (publication != null) {
afficherEntete();
afficherDetailPublication();
}
layout();
}
private void afficherEntete() {
Params enteteParams = new Params();
enteteParams.set("css_id", ComposantId.ZONE_DETAIL_ENTETE);
enteteParams.set("css_meta", ComposantClass.META);
enteteParams.set("i18n_id", i18nC.id());
enteteParams.set("titre", publication.getTitre());
enteteParams.set("auteurs", publication.getAuteur());
enteteParams.set("annee", publication.getAnneeParution());
enteteParams.set("id", publication.getId());
enteteParams.set("guid", getGuid());
 
String eHtml = Format.substitute(enteteTpl, enteteParams);
entete.getElement().setInnerHTML(eHtml);
}
public String getGuid() {
String guid = "URN:tela-botanica.org:";
guid += "pub"+publication.getId();
return guid;
}
public void afficherDetailPublication() {
Params contenuParams = new Params();
contenuParams.set("i18n_nom_complet", i18nC.publicationNomComplet());
contenuParams.set("i18n_auteurs", i18nC.publicationAuteurs());
contenuParams.set("i18n_titre", i18nC.publicationTitre());
contenuParams.set("i18n_collection", i18nC.publicationRevueCollection());
contenuParams.set("i18n_editeur", i18nC.publicationEditeur());
contenuParams.set("i18n_annee", i18nC.publicationDateParution());
contenuParams.set("i18n_nvt", i18nC.publicationNvt());
contenuParams.set("i18n_fascicule", i18nC.publicationFascicule());
contenuParams.set("i18n_pages", i18nC.publicationPage());
contenuParams.set("nom_complet", publication.getNomComplet());
contenuParams.set("auteurs", publication.getAuteur());
contenuParams.set("titre", publication.getTitre());
contenuParams.set("collection", publication.getCollection());
contenuParams.set("editeur", publication.getNomEditeur());
contenuParams.set("annee", publication.getAnneeParution());
contenuParams.set("nvt", publication.getIndicationNvt());
contenuParams.set("fascicule", publication.getFascicule());
contenuParams.set("pages", publication.getPages());
String gHtml = formaterContenu(contenuTpl, contenuParams);
contenu.getElement().setInnerHTML(gHtml);
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Publication) {
publication = (Publication) nouvellesDonnees;
publicationChargementOk = true;
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
if (avoirDonneesChargees()) {
afficherDetail();
}
}
private boolean avoirDonneesChargees() {
boolean ok = false;
if (publicationChargementOk) {
ok = true;
}
return ok;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/publication/PublicationDetailVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/publication/PublicationDetailVue.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/publication/PublicationDetailVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/publication/PublicationForm.java
New file
0,0 → 1,1257
package org.tela_botanica.client.vues.publication;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.GrillePaginable;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.ProxyPersonnes;
import org.tela_botanica.client.composants.pagination.ProxyPersonnesAPublication;
import org.tela_botanica.client.composants.pagination.ProxyStructures;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.MenuApplicationId;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.Log;
import org.tela_botanica.client.util.Pattern;
import org.tela_botanica.client.util.UtilArray;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.FenetreForm;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireBarreValidation;
import org.tela_botanica.client.vues.personne.PersonneForm;
 
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.data.BaseModelData;
import com.extjs.gxt.ui.client.data.LoadEvent;
import com.extjs.gxt.ui.client.data.Loader;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.store.StoreEvent;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.Label;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.extjs.gxt.ui.client.widget.layout.RowData;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
 
public class PublicationForm extends Formulaire implements Rafraichissable {
//-------------//
// ATTRIBUTS //
//-------------//
/** Publication **/
// on se sert d'un objet Publication lorsque l'on est en mode MODIFIER
private Publication publication;
// on se sert de l'identifiant d'une publication lorsque l'on est en mode AJOUTER
private String publicationId = null;
/** Auteurs **/
private PublicationAPersonneListe auteursInitialListe = null;
private PublicationAPersonneListe auteursAjoutes = null;
private PublicationAPersonneListe auteursSupprimes = null;
private PublicationAPersonneListe auteursModifies = null;
private ContentPanel auteursFieldset = null;
private FieldSet generalitesFieldset = null;
private TextField<String> titreChp = null;
private TextField<String> collectionChp = null;
private TextField<String> uriChp = null;
private FieldSet editionFieldset = null;
private ChampComboBoxRechercheTempsReelPaginable editeurCombobox = null;
private TextField<String> datePublicationChp = null;
private TextField<String> tomeChp = null;
private TextField<String> fasciculeChp = null;
private TextField<String> pagesChp = null;
private LayoutContainer zoneHaut, zoneBas;
private ToolBar barreOutils = null;
private GrillePaginable<ModelData> grilleAuteurs;
private ChampComboBoxRechercheTempsReelPaginable personnesSaisiesComboBox = null;
private Button personnesBoutonSupprimer = null;
private Button personnesBoutonModifier = null;
private Button boutonAuteurUp = null;
private Button boutonAuteurDown = null;
private FenetreForm fenetreFormulaire = null;
private Sequenceur sequenceur;
private String modeDeCreation = null;
boolean changeOrderMarker = false;
private Label infosAuteurFmt = null;
private ContentPanel infosAuteursNonPresentsPanel = null;
//+----------------------------------------------------------------------------------------------------------------+
// Constructeurs
public PublicationForm(Mediateur mediateurCourrant, String publicationId) {
initialiserPublicationForm(mediateurCourrant, publicationId);
}
 
public PublicationForm(Mediateur mediateurCourrant, String publicationId, Rafraichissable vueARafraichirApresValidation) {
vueExterneARafraichirApresValidation = vueARafraichirApresValidation;
initialiserPublicationForm(mediateurCourrant, publicationId);
}
 
//+----------------------------------------------------------------------------------------------------------------+
// Initialisation
private void initialiserPublicationForm(Mediateur mediateurCourrant, String publicationId) {
sequenceur = new Sequenceur();
publication = new Publication();
publication.setId(publicationId);
this.publicationId = publicationId;
auteursInitialListe = new PublicationAPersonneListe();
initialiserAuteurs(); // Crée les listes d'auteurs ajoutés et supprimés
// Si 'publicationId' est vide alors on est en mode "AJOUTER", sinon on est en mode "MODIFIER"
modeDeCreation = (UtilString.isEmpty(publicationId) ? Formulaire.MODE_AJOUTER : Formulaire.MODE_MODIFIER);
initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.PUBLICATION);
panneauFormulaire.setLayout(new RowLayout());
panneauFormulaire.setStyleAttribute("padding", "0");
panneauFormulaire.setHeight(600);
zoneHaut = new LayoutContainer(new FitLayout());
zoneBas = new LayoutContainer(new FlowLayout());
panneauFormulaire.add(zoneHaut, new RowData(0.99, 0.45));
panneauFormulaire.add(zoneBas, new RowData(0.99, 0.55));
panneauFormulaire.setScrollMode(Scroll.AUTO);
genererTitreFormulaire();
creerZoneAuteurs();
zoneHaut.add(auteursFieldset);
creerZoneGeneralites();
zoneBas.add(generalitesFieldset);
creerZoneEdition();
zoneBas.add(editionFieldset);
if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
mediateurCourrant.selectionnerPublication(this, publicationId, sequenceur);
sequenceur.enfilerRafraichissement(this, new Information("chargement_modifier_ok"));
}
}
 
private void initialiserAuteurs() {
auteursAjoutes = new PublicationAPersonneListe();
auteursSupprimes = new PublicationAPersonneListe();
auteursModifies = new PublicationAPersonneListe();
}
//+----------------------------------------------------------------------------------------------------------------+
// User Interface
private ToolBar creerBarreOutilsGrille() {
ToolBar barreOutils = new ToolBar();
creerComboBoxPersonnesSaisies();
barreOutils.add(personnesSaisiesComboBox);
personnesSaisiesComboBox.getCombo().setEmptyText("Rechercher et sélectionner une personne existante dans la base");
barreOutils.add(new Text(" ou "));
Button ajouterBouton = creerBoutonAjouter();
barreOutils.add(ajouterBouton);
barreOutils.add(new SeparatorToolItem());
personnesBoutonModifier = creerBoutonModifier();
barreOutils.add(personnesBoutonModifier);
barreOutils.add(new SeparatorToolItem());
personnesBoutonSupprimer = creerBoutonSupprimer();
barreOutils.add(personnesBoutonSupprimer);
barreOutils.add(new SeparatorToolItem());
Button rafraichirBouton = creerBoutonRafraichir();
barreOutils.add(rafraichirBouton);
barreOutils.add(new SeparatorToolItem());
barreOutils.add(new Text(i18nC.deplacerAuteur()));
boutonAuteurUp = creerBoutonAuteurUp();
barreOutils.add(boutonAuteurUp);
boutonAuteurDown = creerBoutonAuteurDown();
barreOutils.add(boutonAuteurDown);
return barreOutils;
}
public void actualiserEtatBoutonsBarreOutils() {
// Activation des boutons si la grille contient un élément
if (grilleAuteurs.getStore().getCount() > 0) {
personnesBoutonSupprimer.enable();
personnesBoutonModifier.enable();
}
// Désactivation des boutons si la grille ne contient plus d'élément
if (grilleAuteurs.getStore().getCount() == 0) {
personnesBoutonSupprimer.disable();
personnesBoutonModifier.disable();
}
}
private Button creerBoutonAuteurUp() {
Button bouton = new Button();
bouton.setIcon(Images.ICONES.arrowUp());
bouton.setEnabled(false);
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
if (grilleAuteurs.getGrille().getSelectionModel().getSelectedItem() != null) {
mettreAJourOrdreAuteur(-1);
}
}
});
return bouton;
}
private Button creerBoutonAuteurDown() {
Button bouton = new Button();
bouton.setIcon(Images.ICONES.arrowDown());
bouton.setEnabled(false);
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
if (grilleAuteurs.getSelectionModel().getSelectedItem() != null) {
mettreAJourOrdreAuteur(+1);
}
}
});
return bouton;
}
private void formaterOrdreAuteurs() {
List<ModelData> auteurs = grilleAuteurs.getStore().getModels();
Iterator<ModelData> itAuteurs = auteurs.iterator();
while (itAuteurs.hasNext()) {
ModelData selection = itAuteurs.next();
PublicationAPersonne pap = new PublicationAPersonne(selection, false);
String ordre = String.valueOf(grilleAuteurs.getStore().indexOf(selection) + 1);
if (pap.getOrdreAuteurs() != ordre) {
selection.set("_ordre_", ordre);
grilleAuteurs.getStore().update(selection);
pap.setOrdreAuteurs(ordre);
auteursModifies.put(pap.getId(), pap);
}
}
}
private void mettreAJourOrdreAuteur(int monterOuDescendre) {
ModelData publiAPersonneSelectionnee = grilleAuteurs.getSelectionModel().getSelectedItem();
int index = grilleAuteurs.getStore().indexOf(publiAPersonneSelectionnee);
int nouvelIndex = index + monterOuDescendre;
if (verifierOrdreAuteur(nouvelIndex)) {
// le marqueur suivant est obligatoire sinon les évènements liés au magasin se
// déclenchent et posent problème
changeOrderMarker = true;
int indexAPermuter = index + monterOuDescendre;
ModelData publiAPersonneSwitch = grilleAuteurs.getStore().getAt(indexAPermuter);
String ordreAPermuter = String.valueOf((indexAPermuter + 1) - monterOuDescendre);
publiAPersonneSwitch.set("_ordre_", ordreAPermuter);
grilleAuteurs.getStore().update(publiAPersonneSwitch);
PublicationAPersonne papSwitch = new PublicationAPersonne(publiAPersonneSwitch, false);
papSwitch.setOrdreAuteurs(ordreAPermuter);
auteursModifies.put(papSwitch.getId(), papSwitch);
 
grilleAuteurs.getStore().remove(publiAPersonneSelectionnee);
String nouvelOrdre = String.valueOf((index + 1) + monterOuDescendre);
publiAPersonneSelectionnee.set("_ordre_", nouvelOrdre);
grilleAuteurs.getStore().insert(publiAPersonneSelectionnee, nouvelIndex);
PublicationAPersonne papSelectionnee = new PublicationAPersonne(publiAPersonneSelectionnee, false);
papSelectionnee.setOrdreAuteurs(nouvelOrdre);
auteursModifies.put(papSelectionnee.getId(), papSelectionnee);
changeOrderMarker = false;
grilleAuteurs.getSelectionModel().select(nouvelIndex, false);
}
}
private boolean verifierOrdreAuteur(int nouvelIndex) {
int nbrElement = grilleAuteurs.getStore().getCount();
boolean ok = true;
if (nouvelIndex < 0 || nouvelIndex >= nbrElement) {
ok = false;
}
return ok;
}
private void activerBoutonsOrdreAuteur() {
ModelData papSelectionnee = grilleAuteurs.getGrille().getSelectionModel().getSelectedItem();
int index = grilleAuteurs.getStore().indexOf(papSelectionnee);
if (index >= 1) {
boutonAuteurUp.setEnabled(true);
} else {
boutonAuteurUp.setEnabled(false);
}
if ((index+1) < grilleAuteurs.getStore().getCount()) {
boutonAuteurDown.setEnabled(true);
} else {
boutonAuteurDown.setEnabled(false);
}
}
private Button creerBoutonAjouter() {
Button bouton = new Button(i18nC.ajouter());
bouton.setIcon(Images.ICONES.vcardAjouter());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_AJOUTER);
fenetreFormulaire.show();
}
});
return bouton;
}
private Button creerBoutonModifier() {
Button bouton = new Button(i18nC.modifier());
bouton.setIcon(Images.ICONES.vcardModifier());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
Personne personneSaisieSelectionnee = new PublicationAPersonne(grilleAuteurs.getSelectionModel().getSelectedItem(), false).getPersonne();
if (personneSaisieSelectionnee == null) {
InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPublication());
} else {
fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_MODIFIER);
fenetreFormulaire.show();
}
}
});
return bouton;
}
private FenetreForm creerFenetreModaleAvecFormulairePersonne(String mode) {
String personneId = null;
if (mode.equals(Formulaire.MODE_MODIFIER)) {
Personne personneSaisieSelectionnee = new PublicationAPersonne(grilleAuteurs.getSelectionModel().getSelectedItem(), false).getPersonne();
personneId = personneSaisieSelectionnee.getId();
}
final FenetreForm fenetre = new FenetreForm("");
final PersonneForm formulaire = creerFormulairePersonne(fenetre, personneId);
fenetre.add(formulaire);
return fenetre;
}
private PersonneForm creerFormulairePersonne(final FenetreForm fenetre, final String personneId) {
PersonneForm formulairePersonne = new PersonneForm(mediateur, personneId, this);
FormPanel panneauFormulaire = formulairePersonne.getFormulaire();
fenetre.setHeadingHtml(panneauFormulaire.getHeadingHtml());
panneauFormulaire.setHeaderVisible(false);
panneauFormulaire.setTopComponent(null);
// FIXME : avec GXT-2.1.0 la redéfinition du bottom component ne marche plus. Nous le cachons et en créeons un dans la fenêtre.
panneauFormulaire.getBottomComponent().hide();
SelectionListener<ButtonEvent> ecouteur = creerEcouteurValidationFormulairePersonne(fenetre, formulairePersonne);
final ButtonBar barreValidation = new FormulaireBarreValidation(ecouteur);
fenetre.setBottomComponent(barreValidation);
return formulairePersonne;
}
private SelectionListener<ButtonEvent> creerEcouteurValidationFormulairePersonne(final FenetreForm fenetre, final PersonneForm formulaire) {
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
String code = ((Button) ce.getComponent()).getData("code");
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
if (formulaire.soumettreFormulaire()) {
fenetre.hide();
}
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
formulaire.soumettreFormulaire();
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
fenetre.hide();
}
}
};
return ecouteur;
}
private Button creerBoutonSupprimer() {
Button bouton = new Button(i18nC.supprimer());
bouton.setIcon(Images.ICONES.vcardSupprimer());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
supprimerDansGrille();
}
});
return bouton;
}
private Button creerBoutonRafraichir() {
Button bouton = new Button(i18nC.rafraichir());
bouton.setIcon(Images.ICONES.rafraichir());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
actualiserGrille();
}
});
return bouton;
}
private void actualiserGrille() {
if (mode.equals(Formulaire.MODE_MODIFIER)) {
// FIXME : c'est la merde
grilleAuteurs.reload();
} else {
grilleAuteurs.getStore().removeAll();
layout();
}
}
private void creerComboBoxPersonnesSaisies() {
ModelType modelTypePersonnes = new ModelType();
modelTypePersonnes.setRoot("personnes");
modelTypePersonnes.setTotalName("nbElements");
modelTypePersonnes.addField("cp_fmt_nom_complet");
modelTypePersonnes.addField("cp_nom");
modelTypePersonnes.addField("cp_prenom");
modelTypePersonnes.addField("cp_id_personne");
modelTypePersonnes.addField("cp_code_postal");
modelTypePersonnes.addField("cp_ville");
modelTypePersonnes.addField("cp_truk_courriel");
String displayNamePersonnes = "cp_fmt_nom_complet";
ProxyPersonnes<ModelData> proxyPersonnes = new ProxyPersonnes<ModelData>(null);
personnesSaisiesComboBox = new ChampComboBoxRechercheTempsReelPaginable(proxyPersonnes, modelTypePersonnes, displayNamePersonnes);
personnesSaisiesComboBox.getCombo().addListener(Events.Select, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
if (personnesSaisiesComboBox.getValeur() instanceof ModelData) {
// N'ajouter l'auteur que s'il n'est pas déjà présent dans la grille et dans les valeurs initiales
Personne personneSaisieSelectionnee = new Personne(personnesSaisiesComboBox.getValeur());
Log.debug("Récupération info combo :"+personneSaisieSelectionnee.toString());
PublicationAPersonne pap = new PublicationAPersonne(aDonnee.GARDER_PREFIXE);
pap.setPersonne(personneSaisieSelectionnee, aDonnee.INTEGRER_PROPRIETES);
pap.setOrdreAuteurs(String.valueOf(grilleAuteurs.getStore().getCount()+1));
if (modeDeCreation != Formulaire.MODE_AJOUTER) {
pap.setPublicationLiee(publication);
pap.setIdPublication(publicationId);
}
pap.setIdRole(PublicationAPersonne.ROLE_AUTEUR);
Log.debug("Récupération info combo pap id :"+pap.getId());
if (ajouterDansGrille(pap)) {
personnesSaisiesComboBox.getCombo().setValue(null);
}
}
}
});
}
private boolean ajouterDansGrille(PublicationAPersonne pap) {
return ajouterDansGrille(pap, grilleAuteurs.getStore().getCount());
}
private boolean ajouterDansGrille(PublicationAPersonne pap, int index) {
boolean ok = false;
if (pap != null) {
Log.debug("Début ajout dans grille :"+pap.toString());
if (grilleAuteurs.getStore().contains((ModelData) pap)) {
InfoLogger.display("Information", "La personne choisie existe déjà dans la liste d'auteurs.");
} else {
// 1) si elle ne fait pas partie des initiaux, ajouter à la liste à ajouter
if (!auteursInitialListe.containsValue(pap)) {
auteursAjoutes.put(pap.getId(), pap);
Log.debug("Ajout dans grille -> auteur '"+pap.getId()+"' a été ajouté à la liste des ajoutés (il ne fait pas parti de la liste initiale).");
}
// L'enlever de la liste à supprimer
if (auteursSupprimes.containsValue(pap)) {
auteursSupprimes.remove(pap);
Log.debug("Ajout dans grille -> auteur '"+pap.getId()+"' a été retiré de la liste des supprimés.");
}
// 2) Ajouter a la grille
grilleAuteurs.getStore().insert((ModelData) pap, index);
grilleAuteurs.getSelectionModel().select(index, false);
ok = true;
}
}
return ok;
}
private void supprimerDansGrille() {
List<ModelData> listeDonneesSelectionnees = grilleAuteurs.getSelectionModel().getSelectedItems();
for (ModelData donneeSelectionnee : listeDonneesSelectionnees) {
supprimerAuteurDansGrille(donneeSelectionnee);
}
}
private void supprimerAuteurDansGrille(ModelData donneeSelectionnee) {
PublicationAPersonne personneSelectionnee = new PublicationAPersonne(donneeSelectionnee, aDonnee.GARDER_PREFIXE);
Log.debug("Début supprimer auteur dans grille : "+personneSelectionnee.toString());
if (personneSelectionnee.getId() == null) {
InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerAuteur());
} else {
// 1) Ajouter a la liste des personne à supprimer uniquement si est présente dans la liste initiale
if (auteursInitialListe.containsKey(personneSelectionnee.getId())) {
auteursSupprimes.put(personneSelectionnee.getId(), personneSelectionnee);
Log.debug("Ajout Personne à supprimer : "+auteursSupprimes.toString());
}
if (auteursAjoutes.containsKey(personneSelectionnee.getId())) {
auteursAjoutes.remove(personneSelectionnee.getId());
}
if (auteursModifies.containsKey(personneSelectionnee.getId())) {
auteursModifies.remove(personneSelectionnee.getId());
}
// 2) Supprimer la personne de la liste
Log.debug("Personne trouvée : "+grilleAuteurs.getStore().findModel(donneeSelectionnee).toString());
grilleAuteurs.getStore().remove(donneeSelectionnee);
formaterOrdreAuteurs();
}
}
private GrillePaginable<ModelData> creerGrilleAuteurs() {
// ModelType
ModelType modelTypePersonnesAPublication = new ModelType();
modelTypePersonnesAPublication.setRoot("publicationsAPersonne");
modelTypePersonnesAPublication.setTotalName("nbElements");
modelTypePersonnesAPublication.addField("cpuap_id_personne");
modelTypePersonnesAPublication.addField("cpuap_id_publication");
modelTypePersonnesAPublication.addField("cpuap_id_role");
modelTypePersonnesAPublication.addField("cpuap_ordre");
modelTypePersonnesAPublication.addField("cp_id_personne");
modelTypePersonnesAPublication.addField("cp_fmt_nom_complet");
modelTypePersonnesAPublication.addField("cp_nom");
modelTypePersonnesAPublication.addField("cp_prenom");
modelTypePersonnesAPublication.addField("cp_id_personne");
modelTypePersonnesAPublication.addField("cp_code_postal");
modelTypePersonnesAPublication.addField("cp_ville");
modelTypePersonnesAPublication.addField("cp_truk_courriel");
// Proxy
ProxyPersonnesAPublication<ModelData> proxyPersonnesAPublication = new ProxyPersonnesAPublication<ModelData>(null, publicationId);
 
// Colonnes
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
ColumnConfig columnOrdre = new ColumnConfig("_ordre_", i18nC.ordre(), 15);
colonnes.add(columnOrdre);
colonnes.add(new ColumnConfig("cp_fmt_nom_complet", i18nC.personneNomComplet(), 150));
colonnes.add(new ColumnConfig("cp_code_postal", i18nC.personneCodePostal(), 150));
colonnes.add(new ColumnConfig("cp_ville", i18nC.personneVille(), 75));
colonnes.add(new ColumnConfig("cp_truk_courriel", i18nC.personneCourriel(), 75));
// Champs de traitement
HashMap<String, String> virtualFields = new HashMap<String, String>();
virtualFields.put("_ordre_", "cpuap_ordre");
// Modele de selection
GridSelectionModel<ModelData> modeleDeSelection = new GridSelectionModel<ModelData>();
modeleDeSelection.addListener(Events.SelectionChange, new SelectionChangedListener<ModelData>() {
public void selectionChanged(SelectionChangedEvent<ModelData> se) {
activerBoutonsOrdreAuteur();
}
});
ColumnModel modeleDeColonnes = new ColumnModel(colonnes);
// Grille
// ATTENTION : le constructure de cette grille est à vérifier!
final GrillePaginable<ModelData> grilleAuteurs = new GrillePaginable<ModelData>(modelTypePersonnesAPublication, virtualFields, proxyPersonnesAPublication, colonnes, modeleDeColonnes);
grilleAuteurs.getGrille().setHeight("100%");
grilleAuteurs.getGrille().setBorders(true);
grilleAuteurs.getGrille().setSelectionModel(modeleDeSelection);
grilleAuteurs.getGrille().getView().setForceFit(true);
grilleAuteurs.getGrille().setAutoExpandColumn("fmt_nom_complet");
grilleAuteurs.getGrille().setStripeRows(true);
grilleAuteurs.getGrille().setTrackMouseOver(true);
grilleAuteurs.getStore().getLoader().addListener(Loader.Load, new Listener<LoadEvent>() {
public void handleEvent(LoadEvent be) {
List<ModelData> auteurs = grilleAuteurs.getStore().getModels();
Iterator<ModelData> itAuteurs = auteurs.iterator();
while (itAuteurs.hasNext()) {
ModelData selection = itAuteurs.next();
PublicationAPersonne pap = new PublicationAPersonne(selection, aDonnee.GARDER_PREFIXE);
auteursInitialListe.put(pap.getId(), pap);
Log.debug("PublicationAPersonne ajoutée à la liste initiale avec l'id :"+pap.getId()+pap.toString()+selection.getProperties().toString());
}
controlerCoherenceAuteurs();
//zefgzf
Log.debug("Initialisation liste auteur :"+auteursInitialListe.size());
}
});
// Rajouter des écouteurs
grilleAuteurs.getStore().addListener(Store.Add, new Listener<StoreEvent<ModelData>>() {
public void handleEvent(StoreEvent<ModelData> ce) {
if (!changeOrderMarker) {
actualiserEtatBoutonsBarreOutils();
}
}
});
grilleAuteurs.getStore().addListener(Store.Remove, new Listener<StoreEvent<ModelData>>() {
public void handleEvent(StoreEvent<ModelData> ce) {
if (!changeOrderMarker) {
actualiserEtatBoutonsBarreOutils();
Log.debug("Dans listener remove de grilleAuteur");
}
}
});
grilleAuteurs.getStore().addListener(Store.Update, new Listener<StoreEvent<ModelData>>() {
public void handleEvent(StoreEvent<ModelData> ce) {
}
});
return grilleAuteurs;
}
private void genererTitreFormulaire() {
String titre = i18nC.publicationTitreFormAjout();
if (mode.equals(Formulaire.MODE_MODIFIER)) {
titre = i18nC.publicationTitreFormModif();
if (publication != null) {
titre += " - "+i18nC.id()+": "+publication.getId()+" - "+publication.getTitre();
}
}
panneauFormulaire.setHeadingHtml(titre);
}
 
private void creerZoneAuteurs() {
auteursFieldset = new ContentPanel();
auteursFieldset.setLayout(new FitLayout());
auteursFieldset.setHeadingHtml("Auteurs");
creerChampsAuteur();
}
private void creerChampsAuteur() {
auteursFieldset.removeAll();
barreOutils = creerBarreOutilsGrille();
auteursFieldset.setTopComponent(barreOutils);
grilleAuteurs = creerGrilleAuteurs();
auteursFieldset.add(grilleAuteurs);
auteursFieldset.layout();
}
private void creerZoneGeneralites() {
FormLayout layout = new FormLayout();
layout.setLabelWidth(200);
// Fieldset Infos Générales
generalitesFieldset = new FieldSet();
generalitesFieldset.setHeadingHtml("Informations générales");
generalitesFieldset.setCollapsible(true);
generalitesFieldset.setLayout(layout);
infosAuteursNonPresentsPanel = new ContentPanel();
Label LabelAuteurFmt = new Label("Auteurs de la publication : ");
LabelAuteurFmt.setId("label-auteurs-non-presents");
infosAuteurFmt = new Label(publication.getAuteur());
Label avertissementAuteurs = new Label("Attention, Certains auteurs apparaissent ci-dessous mais pas dans la grille des auteurs. "+
"Ceci signifie que la publication a été importée sans que tous les auteurs aient été créés auparavant.<br />"+
"Si vous souhaitez modifier cette publication, nous vous invitons à y associer correctement les auteurs grâce à la grille ci-dessus.<br />");
infosAuteursNonPresentsPanel.setHeaderVisible(false);
infosAuteursNonPresentsPanel.setId("infos-auteurs-non-presents");
infosAuteursNonPresentsPanel.add(avertissementAuteurs);
infosAuteursNonPresentsPanel.add(LabelAuteurFmt);
infosAuteursNonPresentsPanel.add(infosAuteurFmt);
infosAuteursNonPresentsPanel.setVisible(false);
generalitesFieldset.add(infosAuteursNonPresentsPanel);
titreChp = new TextField<String>();
titreChp.setName("cpu");
titreChp.setFieldLabel("Titre de l'article ou de l'ouvrage");
titreChp.addStyleName(ComposantClass.OBLIGATOIRE);
titreChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
generalitesFieldset.add(titreChp, new FormData(450, 0));
collectionChp = new TextField<String>();
collectionChp.setFieldLabel("Intitulé de la revue ou de la collection");
generalitesFieldset.add(collectionChp, new FormData(450, 0));
uriChp = new TextField<String>();
uriChp.setFieldLabel("URL de la publication");
generalitesFieldset.add(uriChp, new FormData(450, 0));
}
private void creerZoneEdition() {
FormLayout layout = new FormLayout();
layout.setLabelWidth(200);
 
// Fieldset Edition
editionFieldset = new FieldSet();
editionFieldset.setHeadingHtml("Édition");
editionFieldset.setCollapsible(true);
editionFieldset.setLayout(layout);
/*****************************************************/
/** Champ 'Editeur de la publication' **/
/*****************************************************/
ModelType modelTypeStructures = new ModelType();
modelTypeStructures.setRoot("structures");
modelTypeStructures.setTotalName("nbElements");
modelTypeStructures.addField("cs_nom");
modelTypeStructures.addField("cs_id_structure");
String displayNameStructures = "cs_nom";
ProxyStructures<ModelData> proxyStructures = new ProxyStructures<ModelData>(null);
editeurCombobox = new ChampComboBoxRechercheTempsReelPaginable(proxyStructures, modelTypeStructures, displayNameStructures);
editeurCombobox.setWidth(200, 600);
editeurCombobox.getCombo().setTabIndex(tabIndex++);
editeurCombobox.getCombo().setEmptyText("Sélectionner un éditeur...");
editeurCombobox.getCombo().setFieldLabel("Éditeur de la publication");
editeurCombobox.getCombo().setEditable(true);
editionFieldset.add(editeurCombobox, new FormData(600, 0));
/*********************************************/
/** Champ 'Date de publication' **/
/*********************************************/
datePublicationChp = new TextField<String>();
datePublicationChp.setMaxLength(9);
datePublicationChp.setMinLength(4);
datePublicationChp.setFieldLabel("Année de publication");
datePublicationChp.addStyleName(ComposantClass.OBLIGATOIRE);
datePublicationChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
editionFieldset.add(datePublicationChp, new FormData(80, 0));
/*********************************/
/** Champ 'Tome' **/
/*********************************/
tomeChp = new TextField<String>();
tomeChp.setFieldLabel("Série de la revue ou tome");
editionFieldset.add(tomeChp, new FormData(75, 0));
 
/*************************************/
/** Champ 'Fascicule' **/
/*************************************/
fasciculeChp = new TextField<String>();
fasciculeChp.setFieldLabel("Fascicule de la revue");
editionFieldset.add(fasciculeChp, new FormData(75, 0));
 
/*********************************/
/** Champ 'Pages' **/
/*********************************/
pagesChp = new TextField<String>();
pagesChp.setFieldLabel("Pages");
pagesChp.setToolTip("Fomat : NBRE ou NBRE-NBRE. ('NBRE' correspond à une suite de chiffres arabes ou romains ou à un point d'interrogation '?' dans le cas d'une donnée inconnue)");
editionFieldset.add(pagesChp, new FormData(100, 0));
}
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes privées
private void miseAJourAuteursInitialListe() {
Iterator<String> clesAjoutees = auteursAjoutes.keySet().iterator();
while (clesAjoutees.hasNext()) {
PublicationAPersonne auteurAjoute = auteursAjoutes.get(clesAjoutees.next());
auteursInitialListe.put(auteurAjoute.getId(), auteurAjoute);
}
Iterator<String> clesSupprimees = auteursSupprimes.keySet().iterator();
while (clesSupprimees.hasNext()) {
PublicationAPersonne auteurSupprime = auteursSupprimes.get(clesSupprimees.next());
auteursInitialListe.remove(auteurSupprime.getId());
}
}
public boolean soumettreFormulaire() {
boolean formulaireValideOk = verifierFormulaire();
if (formulaireValideOk) {
soumettrePublication();
}
if(clicBoutonvalidation) {
fermerFormulaire();
}
return formulaireValideOk;
}
 
private void soumettrePublication() {
Publication publicationCollectee = collecterPublication();
if (publicationCollectee != null) {
// Pour l'enregistrement des publications, on utilise le séquenceur
// Il doit attendre le retour de l'enregistrement pour poursuivre
sequenceur = new Sequenceur();
int seqId = sequenceur.lancerRequeteSynchrone(this);
if (mode.equals(Formulaire.MODE_AJOUTER)) {
mediateur.ajouterPublication(sequenceur, publicationCollectee, seqId);
} else if (mode.equals(Formulaire.MODE_MODIFIER)) {
mediateur.modifierPublication(sequenceur, publicationCollectee, seqId);
}
// si l'on est en mode MODIFIER, on soumet les auteurs meme si les informations de la publication
// restent inchangées car il se peut que les auteurs aient été modifiés
} else if (mode.equals(Formulaire.MODE_MODIFIER)) {
soumettreAuteurs();
if(clicBoutonvalidation) {
fermerFormulaire();
}
}
}
private void soumettreAuteurs() {
//1) Auteurs ajoutés :
PublicationAPersonneListe listeAuteursAAjouter = new PublicationAPersonneListe();
Iterator<String> itAuteur = auteursAjoutes.keySet().iterator();
while (itAuteur.hasNext()) {
String cle = itAuteur.next();
PublicationAPersonne publiAPersonne = auteursAjoutes.get(cle);
Log.debug("Ajouter :"+publiAPersonne.toString());
publiAPersonne.setIdPublication(this.publicationId);
publiAPersonne.setOrdreAuteurs(publiAPersonne.getOrdreAuteurs());
listeAuteursAAjouter.put(cle, publiAPersonne);
}
// - envoyer au mediateur SSI personnes à ajouter
if (listeAuteursAAjouter.size() > 0) {
int seqId = sequenceur.lancerRequeteSynchrone(this);
mediateur.ajouterPublicationAPersonne(sequenceur, this.publicationId, listeAuteursAAjouter, PublicationAPersonne.ROLE_AUTEUR, seqId);
}
//2) Auteurs supprimés :
PublicationAPersonneListe listeAuteursASupprimer = new PublicationAPersonneListe();
itAuteur = auteursSupprimes.keySet().iterator();
while (itAuteur.hasNext()) {
String cle = itAuteur.next();
PublicationAPersonne publiAPersonne = auteursSupprimes.get(cle);
Log.debug("Supprimer :"+publiAPersonne.toString());
listeAuteursASupprimer.put(cle, publiAPersonne);
}
// - Envoyer au médiateur SSI personnes à supprimer
if (listeAuteursASupprimer.size() > 0) {
// Pour une suppression des auteurs, on a pas besoin d'attendre le retour
Log.debug("Lancement suppression :"+listeAuteursASupprimer.size());
mediateur.supprimerPublicationAPersonne(this, listeAuteursASupprimer);
}
//3) Auteurs modifiés :
PublicationAPersonneListe listeAuteursAModifier = new PublicationAPersonneListe();
itAuteur = auteursModifies.keySet().iterator();
while (itAuteur.hasNext()) {
String cle = itAuteur.next();
PublicationAPersonne publiAPersonne = auteursModifies.get(cle);
Log.debug("Modifier :"+publiAPersonne.toString());
listeAuteursAModifier.put(cle, publiAPersonne);
}
// - Envoyer au médiateur SSI personnes à modifier
if (listeAuteursAModifier.size() > 0) {
int seqId = sequenceur.lancerRequeteSynchrone(this);
mediateur.modifierPublicationAPersonne(sequenceur, this.publicationId, listeAuteursAModifier, PublicationAPersonne.ROLE_AUTEUR, seqId);
}
sequenceur.enfilerRafraichissement(this, new Information("auteurs_enregistres"));
}
private void peuplerFormulaire() {
titreChp.setValue(publication.getTitre());
collectionChp.setValue(publication.getCollection());
uriChp.setValue(publication.getURI());
datePublicationChp.setValue(publication.getAnneeParution());
tomeChp.setValue(publication.getIndicationNvt());
fasciculeChp.setValue(publication.getFascicule());
pagesChp.setValue(publication.getPages());
// Éditeur est soit une référence à une structure de la base soit une chaine
if (publication.getEditeur().matches("^[0-9]+$")) {
//editeurCombobox.getCombo().setValue(editeurCombobox.getStore().findModel("cs_id_structure", publication.getEditeur()));
editeurCombobox.chargerValeurInitiale(publication.getEditeur(), "cs_id_structure");
} else {
editeurCombobox.getCombo().setRawValue(publication.getEditeur());
}
}
private Publication collecterPublication() {
 
Publication publicationCollectee = (Publication) publication.cloner(new Publication());
publicationCollectee.setAuteur(construireIntituleAuteur());
String titre = titreChp.getValue();
publicationCollectee.setTitre(titre);
String collection = collectionChp.getValue();
publicationCollectee.setCollection(collection);
publicationCollectee.setNomComplet(construireNomComplet());
String uri = uriChp.getValue();
publicationCollectee.setUri(uri);
String editeur = "";
if (editeurCombobox.getValeur() != null) {
Structure structure = new Structure(editeurCombobox.getValeur());
editeur = structure.getId();
publicationCollectee.setStructureEditeur(structure);
} else if (!UtilString.isEmpty(editeurCombobox.getCombo().getRawValue())) {
editeur = editeurCombobox.getCombo().getRawValue();
}
Publication.editeurs.put(editeur, editeurCombobox.getCombo().getRawValue());
publicationCollectee.setEditeur(editeur);
String anneePublication = datePublicationChp.getRawValue();
publicationCollectee.setAnneeParution(anneePublication);
String tome = tomeChp.getValue();
publicationCollectee.setIndicationNvt(tome);
String fascicule = fasciculeChp.getValue();
publicationCollectee.setFascicule(fascicule);
String pages = pagesChp.getValue();
publicationCollectee.setPages(pages);
Publication publicationARetourner = null;
if (!publicationCollectee.comparer(publication)) {
publicationARetourner = publication = publicationCollectee;
}
Publication.publisSaisiesModifieesCache.put(publicationId, publicationARetourner);
return publicationARetourner;
}
private String construireDate(String valeurDate) {
String dateComplete = "";
if (!UtilString.isEmpty(valeurDate)){
String jour = "00";
String mois = "00";
String annee = "0000";
String messageErreur = null;
/** JJ/MM/AAAA **/
if (valeurDate.matches("\\d{2}/\\d{2}/\\d{4}")) {
}
/** MM/AAAA **/
if (valeurDate.matches("\\d{2}/\\d{4}")) {
dateComplete = valeurDate+"-00";
}
/** AAAA **/
if (valeurDate.matches("\\d{4}")) {
dateComplete = valeurDate+"-00-00";
}
}
return dateComplete;
}
private String construireIntituleEditeur() {
String editeur = "";
if (editeurCombobox.getValeur() != null) {
Structure structure = new Structure(editeurCombobox.getValeur());
editeur = structure.getNom();
} else if (!UtilString.isEmpty(editeurCombobox.getCombo().getRawValue())) {
editeur = editeurCombobox.getCombo().getRawValue();
}
return editeur;
}
private String construireIntituleAuteur() {
String intituleAuteur = "";
// rangé par ordre désigné par le champ 'cpuap_ordre' de la table PublicationAPersonne
grilleAuteurs.getStore().sort("_ordre_", SortDir.ASC);
List<ModelData> auteurs = grilleAuteurs.getStore().getModels();
Iterator<ModelData> itAuteurs = auteurs.iterator();
while (itAuteurs.hasNext()) {
Personne personneCourante = new PublicationAPersonne(itAuteurs.next(), false).getPersonne();
intituleAuteur += personneCourante.getNom().toUpperCase() + " " + personneCourante.getPrenom();
if (itAuteurs.hasNext()) {
intituleAuteur+=", ";
}
}
return intituleAuteur;
}
private String construireNomComplet() {
// Intitulé de la publication complet : fmt_auteur, date_parution(année). titre. Editeur (nom), collection, fascicule, indication_nvt. pages.
String nomComplet = "";
String auteurs = construireIntituleAuteur();
String annee = datePublicationChp.getRawValue();
String titre = titreChp.getValue();
String editeur = construireIntituleEditeur();
nomComplet += auteurs+", "+annee+". "+titre+".";
if (!UtilString.isEmpty(editeur)) {
nomComplet += " Éditeur "+editeur+".";
}
if (collectionChp.getValue() != null) {
String revue = collectionChp.getValue();
nomComplet += ", "+revue;
}
if (fasciculeChp.getValue() != null) {
String fascicule = fasciculeChp.getValue();
nomComplet += ", "+fascicule;
}
if (tomeChp.getValue() != null) {
String tomaison = tomeChp.getValue();
nomComplet += ", "+tomaison;
}
if (collectionChp.getValue() != null || fasciculeChp.getValue() != null || tomeChp.getValue() != null) {
nomComplet += ".";
}
if (pagesChp.getValue() != null) {
String pages = pagesChp.getValue();
nomComplet += pages+".";
}
return nomComplet;
}
public void controlerCoherenceAuteurs() {
if(doitAfficherAvertissementAuteur()) {
infosAuteurFmt.setHtml(publication.getAuteur());
infosAuteursNonPresentsPanel.setVisible(true);
infosAuteursNonPresentsPanel.setHeight(50);
} else {
infosAuteursNonPresentsPanel.setVisible(false);
infosAuteursNonPresentsPanel.setHeight(0);
}
}
private boolean doitAfficherAvertissementAuteur() {
// La construction du fmt nom complet des auteurs étant mal fichue
// il est plus simple de comparer le nombre d'item une fois les chaines
// splittées par virgules, ainsi que le nombre d'espace
String auteurFmtreconstruit = construireIntituleAuteur();
String[] auteurFmtreconstruitParts = auteurFmtreconstruit.split(",");
String[] auteurParts = publication.getAuteur().split(",");
String[] auteurFmtreconstruitSpaces = auteurFmtreconstruit.split(" ");
String[] auteurPartsSpaces = publication.getAuteur().split(" ");
boolean unEstVideEtAutreNon = (auteurFmtreconstruit.trim().isEmpty() != publication.getAuteur().isEmpty());
return (modeDeCreation == MODE_MODIFIER &&
(unEstVideEtAutreNon ||
auteurFmtreconstruitParts.length != auteurParts.length ||
auteurFmtreconstruitSpaces.length != auteurPartsSpaces.length));
}
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes publiques
public boolean verifierFormulaire() {
boolean valide = true;
ArrayList<String> messages = new ArrayList<String>();
// Tester si au moins un auteur est présent
if (grilleAuteurs.getStore().getModels().size() == 0) {
messages.add("Veuillez saisir au moins un auteur.");
}
String titre = titreChp.getValue();
if (titre == null || titre.equals("")) {
messages.add("Veuillez saisir le titre de la publication !");
}
String uri = uriChp.getValue();
if (uri != null && ! uri.isEmpty() && ! uri.matches(Pattern.url)) {
messages.add("L'URL saisie n'est pas valide !");
}
String datePublication = datePublicationChp.getRawValue();
if (datePublication == null || datePublication.equals("")) {
messages.add("Veuillez saisir une année de parution !");
} else {
if (!Publication.etreAnneeParutionValide(datePublication)) {
messages.add("Le format de l'année saisie est incorrect ! Formats acceptés : AAAA ou AAAA-AAAA");
}
}
String pages = pagesChp.getValue();
String valeurPage = "(?:[0-9]+|[IVXLCDM]+|\\?)";
if (pages != null && ! pages.matches("^(?:"+valeurPage+"|"+valeurPage+"-"+valeurPage+")$")) {
messages.add("Le format des pages est incorrect !");
}
if (messages.size() != 0) {
String[] tableauDeMessages = {};
tableauDeMessages = messages.toArray(tableauDeMessages);
MessageBox.alert("Erreurs de saisies", UtilArray.implode(tableauDeMessages, "<br />"), null);
valide = false;
}
return valide;
}
//+----------------------------------------------------------------------------------------------------------------+
// Accesseurs
//+----------------------------------------------------------------------------------------------------------------+
// Rafraichir
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Publication) {
publication = (Publication) nouvellesDonnees;
} else if (nouvellesDonnees instanceof Information) {
rafraichirInformation((Information) nouvellesDonnees);
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
}
private void rafraichirInformation(Information info) {
String type = info.getType();
if (type.equals("auteurs_enregistres")) {
miseAJourAuteursInitialListe();
initialiserAuteurs();
repandreRafraichissement();
controlerFermeture();
} else if (type.equals("chargement_modifier_ok")) {
Debug.log("Chargement 1");
peuplerFormulaire();
genererTitreFormulaire();
}
 
if (type.equals("personne_ajoutee")) {
if (info.getDonnee(0) != null) {
Personne personne = (Personne) info.getDonnee(0);
personne = formaterChampPersonnePourGrille(personne);
PublicationAPersonne pap = new PublicationAPersonne(personne, false);
if (modeDeCreation != Formulaire.MODE_AJOUTER) pap.setPublicationLiee(publication);
ajouterDansGrille(pap);
}
} else if (type.equals("personne_modifiee")) {
if (info.getDonnee(0) != null) {
// créer la nouvelle entrée
Personne personne = (Personne) info.getDonnee(0);
PublicationAPersonne pap = new PublicationAPersonne();
pap.setPersonne(personne);
if (modeDeCreation != Formulaire.MODE_AJOUTER) pap.setPublicationLiee(publication);
// supprimer l'entrée précédente
PublicationAPersonne personneDansGrille = new PublicationAPersonne(grilleAuteurs.getStore().findModel("cp_id_personne", personne.getId()), false);
int index = grilleAuteurs.getStore().indexOf(personneDansGrille);
grilleAuteurs.getStore().remove(personneDansGrille);
if(index != -1) {
// ajouter la nouvelle entrée dans la grille
ajouterDansGrille(pap, index);
} else {
ajouterDansGrille(pap);
}
}
} else if (info.getType().equals("modif_publication")) {
InfoLogger.display("Modification d'une publication", info.toString());
soumettreAuteurs();
} else if (info.getType().equals("ajout_publication")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String && ((String) info.getDonnee(0)).matches("[0-9]+")) {
String idPublication = (String) info.getDonnee(0);
this.publicationId = idPublication;
this.publication.setId(idPublication);
soumettreAuteurs();
InfoLogger.display("Ajout d'une publication", "La publication '"+publicationId+"' a bien été ajoutée");
} else {
InfoLogger.display("Ajout d'une publication", info.toString());
}
} else if (info.getType().equals("suppression_publication_a_personne")) {
InfoLogger.display("Suppression d'auteur", info.getMessages().toString());
}
}
private Personne formaterChampPersonnePourGrille(Personne personne) {
personne.set("cp_id_personne", personne.getId());
personne.set("cp_fmt_nom_complet", personne.getNomComplet());
personne.set("cp_fmt_nom_complet", personne.getNomComplet());
personne.set("cpuap_id_personne", personne.getId());
personne.set("cp_code_postal", personne.get("code_postal"));
personne.set("cp_ville", personne.get("ville"));
personne.set("cp_truk_courriel", personne.getCourriel());
personne.set("cpuap_ordre", grilleAuteurs.getStore().getCount());
personne.set("cp_nom", personne.getNom());
personne.set("cp_prenom", personne.getPrenom());
return personne;
}
private void repandreRafraichissement() {
if (vueExterneARafraichirApresValidation != null) {
String type = "publication_modifiee";
if (mode.equals(Formulaire.MODE_AJOUTER)) {
type = "publication_ajoutee";
}
Information info = new Information(type);
info.setDonnee(0, publication);
vueExterneARafraichirApresValidation.rafraichir(info);
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/publication/PublicationForm.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/publication/PublicationForm.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/publication/PublicationForm.java:r1383-1511
Added: svn:executable
+*
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/publication
New file
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/publication:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/publication:r1136-1291
Merged /trunk/src/org/tela_botanica/client/vues/publication:r11-934,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/ContenuVue.java
New file
0,0 → 1,70
package org.tela_botanica.client.vues;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.collection.CollectionListe;
import org.tela_botanica.client.modeles.commentaire.CommentaireListe;
import org.tela_botanica.client.modeles.personne.PersonneListe;
import org.tela_botanica.client.modeles.publication.PublicationListe;
import org.tela_botanica.client.modeles.structure.StructureListe;
 
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class ContenuVue extends LayoutContainer implements Rafraichissable {
private Mediateur mediateur = null;
public ContenuVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
setLayout(new FitLayout());
setBorders(true);
}
public Rafraichissable getContenu() {
Rafraichissable contenuPanneauCentre = null;
if (getItems() != null && getItems().size() == 1) {
contenuPanneauCentre = (Rafraichissable) getItem(0);
}
return contenuPanneauCentre;
}
 
//+----------------------------------------------------------------------------------------------------------------+
// RAFRAICHISSEMENT
//+----------------------------------------------------------------------------------------------------------------+
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof StructureListe) {
mediateur.afficherListeStructures((StructureListe) nouvellesDonnees);
} else if (nouvellesDonnees instanceof CollectionListe) {
mediateur.afficherListeCollections((CollectionListe) nouvellesDonnees);
} else if (nouvellesDonnees instanceof PersonneListe) {
mediateur.afficherListePersonnes((PersonneListe) nouvellesDonnees);
} else if (nouvellesDonnees instanceof PublicationListe) {
mediateur.afficherListePublication((PublicationListe) nouvellesDonnees);
} else if (nouvellesDonnees instanceof CommentaireListe) {
mediateur.afficherListeCommentaire((CommentaireListe) nouvellesDonnees);
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("maj_utilisateur")) {
if (getContenu() != null) {
getContenu().rafraichir(info);
}
} else {
// Affichage des éventuels messages de déboguage ou d'alerte
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
GWT.log(info.getMessages().toString(), null);
}
// Traitement en fonction des types d'information
if (info.getType().equals("liste_personne")) {
mediateur.afficherListePersonnes((PersonneListe) info.getDonnee(0));
InfoLogger.display("Chargement d'une liste de personnes", "");
}
}
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/vues/ContenuVue.java:r11-443,923-935,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/ContenuVue.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/ContenuVue.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/FormulaireBarreValidation.java
New file
0,0 → 1,78
package org.tela_botanica.client.vues;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.images.Images;
 
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
 
public class FormulaireBarreValidation extends ButtonBar {
private SelectionListener<ButtonEvent> ecouteur = null;
public static final String CODE_BOUTON_VALIDER = "VA";
public static final String CODE_BOUTON_APPLIQUER = "AP";
public static final String CODE_BOUTON_ANNULER = "AN";
public FormulaireBarreValidation(SelectionListener<ButtonEvent> ecouteurCourrant) {
ecouteur = ecouteurCourrant;
creerBarreOutilsValidation();
}
private void creerBarreOutilsValidation() {
this.setAlignment(HorizontalAlignment.LEFT);
this.add(new FillToolItem());
Button appliquer = creerBouton(CODE_BOUTON_APPLIQUER);
this.add(appliquer);
appliquer.setToolTip(Mediateur.i18nC.indicationAppliquer());
Button annuler = creerBouton(CODE_BOUTON_ANNULER);
annuler.setToolTip(Mediateur.i18nC.indicationAnnuler());
this.add(annuler);
Button valider = creerBouton(CODE_BOUTON_VALIDER);
valider.setToolTip(Mediateur.i18nC.indicationValider());
this.add(valider);
}
private Button creerBouton(final String code) {
String nom = getNom(code);
Button bouton = new Button(nom);
bouton.setData("code", code);
bouton.setIcon(getIcone(code));
bouton.addSelectionListener(ecouteur);
return bouton;
}
private AbstractImagePrototype getIcone(final String code) {
AbstractImagePrototype icone = null;
if (code.equals(CODE_BOUTON_VALIDER)) {
icone = Images.ICONES.valider();
} else if (code.equals(CODE_BOUTON_APPLIQUER)) {
icone = Images.ICONES.appliquer();
} else if (code.equals(CODE_BOUTON_ANNULER)) {
icone = Images.ICONES.annuler();
}
return icone;
}
private String getNom(final String code) {
String nom = null;
if (code.equals(CODE_BOUTON_VALIDER)) {
nom = Mediateur.i18nC.valider();
} else if (code.equals(CODE_BOUTON_APPLIQUER)) {
nom = Mediateur.i18nC.appliquer();
} else if (code.equals(CODE_BOUTON_ANNULER)) {
nom = Mediateur.i18nC.annuler();
}
return nom;
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/vues/FormulaireBarreValidation.java:r11-774,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/FormulaireBarreValidation.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/FormulaireBarreValidation.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/MenuHorizontalVue.java
New file
0,0 → 1,126
package org.tela_botanica.client.vues;
 
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.modeles.Menu;
import org.tela_botanica.client.modeles.MenuApplicationId;
 
import com.extjs.gxt.ui.client.Style.HideMode;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.TabPanelEvent;
import com.extjs.gxt.ui.client.event.TreePanelEvent;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Document;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Window;
 
 
public class MenuHorizontalVue extends ContentPanel {
private Mediateur mediateur = null;
private Constantes i18nC = null;
private TabPanel tbp = null;
public MenuHorizontalVue(Mediateur mediateurCourant) {
setId(ComposantId.PANNEAU_NAVIGATION);
mediateur = mediateurCourant;
i18nC = Mediateur.i18nC;
setHeaderVisible(false);
// Ce tab Panel est un peu spécial car chaque onglet ne contient rien du tout
// ils ne servent qu'a être cliqués afin de déclencher une action de la part du médiateur
// ceci afin de pouvoir facilement changer d'avis si jamais on prend une autre forme de navigation
tbp = new TabPanel();
tbp.setId("ListeOngletsNavigation");
tbp.setWidth("100%");
TabItem tbAcc = new TabItem(i18nC.menuAccueil());
tbAcc.setBorders(false);
tbAcc.setId(MenuApplicationId.ACCUEIL);
tbAcc.setHeight(0);
TabItem tbIns = new TabItem(i18nC.menuStructure());
tbIns.setBorders(false);
tbIns.setId(MenuApplicationId.STRUCTURE);
tbIns.setHeight(0);
TabItem tbCol = new TabItem(i18nC.menuCollection());
tbCol.setBorders(false);
tbCol.setId(MenuApplicationId.COLLECTION);
tbCol.setHeight(0);
TabItem tbPer = new TabItem(i18nC.menuPersonne());
tbPer.setBorders(false);
tbPer.setId(MenuApplicationId.PERSONNE);
tbPer.setHeight(0);
TabItem tbPub = new TabItem(i18nC.menuPublication());
tbPub.setBorders(false);
tbPub.setId(MenuApplicationId.PUBLICATION);
tbPub.setHeight(0);
TabItem tbCom = new TabItem(i18nC.menuCommentaire());
tbCom.setBorders(false);
tbCom.setId(MenuApplicationId.COMMENTAIRE);
tbCom.setHeight(0);
TabItem tbStats = new TabItem(i18nC.menuStats());
tbStats.setBorders(false);
tbStats.setId(MenuApplicationId.STATS);
tbStats.setStyleAttribute("float", "right");
tbStats.setHeight(0);
tbp.add(tbAcc);
tbp.add(tbIns);
tbp.add(tbCol);
tbp.add(tbPer);
tbp.add(tbPub);
tbp.add(tbCom);
tbp.add(tbStats);
// Supression du conteneur vide de l'onglet (pour éviter un décalage de l'interface)
tbp.addListener(Events.BeforeSelect, new Listener<TabPanelEvent>() {
public void handleEvent(TabPanelEvent be) {
be.getItem().getElement().removeFromParent();
}
});
// interception de la selection afin de prévenir le médiateur pour qu'il charge
// le panneau central correspondant
tbp.addListener(Events.Select, new Listener<TabPanelEvent>() {
public void handleEvent(TabPanelEvent be) {
mediateur.clicMenu(be.getItem().getId());
}
});
// interception de la selection afin de prévenir le médiateur pour qu'il charge
// le panneau central correspondant
tbp.addListener(Events.Resize, new Listener<TabPanelEvent>() {
public void handleEvent(TabPanelEvent be) {
tbp.setWidth("100%");
}
});
this.add(tbp);
}
 
public void selectionMenu(String codeMenuClique) {
int nbTab = tbp.getItemCount();
for(int i = 0; i < nbTab; i++) {
if(tbp.getItem(i).getId().equals(codeMenuClique)) {
tbp.setSelection(tbp.getItem(i));
}
}
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/PopupChargement.java
New file
0,0 → 1,36
package org.tela_botanica.client.vues;
 
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.images.Images;
 
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.PopupPanel;
 
public class PopupChargement extends PopupPanel{
private Mediateur mediateur = null;
private Constantes i18nC = null;
public PopupChargement(Mediateur mediateurCourrant) {
super();
mediateur = mediateurCourrant;
i18nC = mediateur.i18nC;
LayoutContainer cp = new LayoutContainer();
cp.setLayout(new TableLayout(2));
 
Image imageChargement = Images.ICONES.ajaxLoader().createImage();
cp.add(imageChargement);
Text texteChargement = new Text(i18nC.chargement());
cp.add(texteChargement);
add(cp);
center();
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/PopupChargement.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/PopupChargement.java:r11-334,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/PopupChargement.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/EnteteVue.java
New file
0,0 → 1,241
package org.tela_botanica.client.vues;
 
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.i18n.ErrorMessages;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Style;
import com.extjs.gxt.ui.client.Style.Orientation;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.MenuEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.util.Params;
import com.extjs.gxt.ui.client.widget.HtmlContainer;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.button.SplitButton;
import com.extjs.gxt.ui.client.widget.layout.RowData;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.extjs.gxt.ui.client.widget.menu.Menu;
import com.extjs.gxt.ui.client.widget.menu.MenuItem;
import com.google.gwt.user.client.Window;
 
public class EnteteVue extends LayoutContainer implements Rafraichissable {
 
private Mediateur mediateur = null;
private Constantes i18nC = null;
private ErrorMessages i18nM = null;
 
private String identificationInfoTpl = null;
private String titreTpl = null;
private HtmlContainer conteneurHtml = null;
private SelectionListener<ButtonEvent> boutonEcouteur = null;
private ButtonBar barreBoutons = null;
private Button identificationBouton = null;
//private SplitButton feedbackBouton = null;
private Button contactBouton = null;
private SplitButton aideBouton = null;
private SplitButton applisBouton = null;
 
public EnteteVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
i18nC = Mediateur.i18nC;
i18nM = Mediateur.i18nM;
setId(ComposantId.PANNEAU_ENTETE);
setLayout(new RowLayout(Orientation.HORIZONTAL));
initialiserSquelettes();
boutonEcouteur = getEcouteurDesBoutons();
conteneurHtml = getIdentification();
identificationBouton = getBoutonIdentification();
//feedbackBouton = getBoutonAFeedback();
contactBouton = getBoutonContact();
aideBouton = getBoutonAide();
applisBouton = getBoutonApplications();
barreBoutons = new ButtonBar();
barreBoutons.setAlignment(Style.HorizontalAlignment.RIGHT);
barreBoutons.add(conteneurHtml);
barreBoutons.add(identificationBouton);
barreBoutons.add(aideBouton);
//barreBoutons.add(feedbackBouton);
barreBoutons.add(contactBouton);
barreBoutons.add(applisBouton);
add(getTitre(), new RowData(.20, 1));
add(barreBoutons, new RowData(.8, 1));
}
private void initialiserSquelettes() {
identificationInfoTpl = "<div id='"+ComposantId.DIV_IDENTIFICATION+"'>{0}</div>";
titreTpl = "<div id='"+ComposantId.DIV_TITRE+"'>{0}</div>";
}
private HtmlContainer getTitre() {
HtmlContainer titreConteneurHtml = new HtmlContainer();
titreConteneurHtml.setHtml(Format.substitute(titreTpl, Images.ICONES.logoCoel().getHTML()));//Registry.get(RegistreId.APPLI_NOM)));
return titreConteneurHtml;
}
private HtmlContainer getIdentification() {
HtmlContainer conteneurHtml = new HtmlContainer();
conteneurHtml.setHtml(Format.substitute(identificationInfoTpl, (new Params()).add(i18nC.modeAnonyme())));
return conteneurHtml;
}
 
private SelectionListener<ButtonEvent> getEcouteurDesBoutons() {
SelectionListener<ButtonEvent> boutonEcouteur = new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent be) {
Button btn = (Button) be.getComponent();
String id = btn.getId();
String message = "";
if (id.equals(ComposantId.BTN_AIDE)
|| id.equals(ComposantId.BTN_FEEDBACK)
|| id.equals(ComposantId.BTN_APPLIS)) {
btn.showMenu();
} else if (id.equals(ComposantId.BTN_CONNEXION)) {
mediateur.ouvrirIdentification();
message = i18nM.chargementFenetre(btn.getHtml());
} else if (id.equals(ComposantId.BTN_DECONNEXION)) {
mediateur.deconnecterUtilisateur();
Utilisateur utilisateurCourant = mediateur.getUtilisateur();
message = i18nM.deconnexion(utilisateurCourant.getNomComplet());
} else if (id.equals(ComposantId.BTN_APPLIS)) {
btn.getMenu().show(btn);
}
if (!message.equals("")) {
InfoLogger.display(i18nC.chargement(), message);
}
}
};
return boutonEcouteur;
}
 
private Button getBoutonIdentification() {
Button bouton = new Button(i18nC.identification(), boutonEcouteur);
bouton.setId(ComposantId.BTN_CONNEXION);
return bouton;
}
 
private SplitButton getBoutonAide() {
MenuItem menuDoc = new MenuItem(i18nC.doc());
menuDoc.addSelectionListener(new SelectionListener<MenuEvent>() {
@Override
public void componentSelected(MenuEvent mEvent) {
mediateur.ouvrirAide();
}
});
menuDoc.setId(ComposantId.MENU_DOC);
 
MenuItem menuApropos = new MenuItem(i18nC.apropos());
menuApropos.addSelectionListener(new SelectionListener<MenuEvent>() {
@Override
public void componentSelected(MenuEvent mEvent) {
mediateur.ouvrirParametres();
}
});
menuApropos.setId(ComposantId.MENU_APROPOS);
 
MenuItem fenetreJournal = new MenuItem("Journal de l'application");
fenetreJournal.addSelectionListener(new SelectionListener<MenuEvent>() {
@Override
public void componentSelected(MenuEvent mEvent) {
//Menu me = (Menu) mEvent.getComponent();
//MenuItem mi = (MenuItem) me.getItemByItemId(ComposantId.MENU_COMMENTAIRE);
//InfoLogger.display(Mediateur.i18nC.chargement(), i18nM.ouvertureLienExterne(mi.getHtml()));
mediateur.ouvrirFenetreJournal();
}
});
 
Menu menuAide = new Menu();
menuAide.add(menuDoc);
menuAide.add(menuApropos);
menuAide.add(fenetreJournal);
 
SplitButton boutonAvecMenus = new SplitButton(i18nC.aide());
boutonAvecMenus.setId(ComposantId.BTN_AIDE);
boutonAvecMenus.setIcon(Images.ICONES.aide());
boutonAvecMenus.addSelectionListener(boutonEcouteur);
boutonAvecMenus.setMenu(menuAide);
return boutonAvecMenus;
}
 
private Button getBoutonContact() {
Button menuContact = new Button(i18nC.contact());
menuContact.setId(ComposantId.MENU_CONTACT);
menuContact.addListener(Events.OnClick, new Listener<ButtonEvent>() {
@Override
public void handleEvent(ButtonEvent mEvent) {
mediateur.ouvrirUrlExterne(ComposantId.MENU_CONTACT);
}
});
menuContact.setId(ComposantId.MENU_CONTACT);
menuContact.setIcon(Images.ICONES.flecheDedansDehors());
 
return menuContact;
}
 
private SplitButton getBoutonApplications() {
MenuItem menuCel = new MenuItem(i18nC.cel());
menuCel.addSelectionListener(new SelectionListener<MenuEvent>() {
@Override
public void componentSelected(MenuEvent mEvent) {
Menu me = (Menu) mEvent.getComponent();
MenuItem mi = (MenuItem) me.getItemByItemId(ComposantId.MENU_CEL);
InfoLogger.display(i18nC.chargement(), i18nM.ouvertureAppliExterne(mi.getHtml()));
mediateur.ouvrirUrlExterne(ComposantId.MENU_CEL);
}
});
menuCel.setId(ComposantId.MENU_CEL);
 
Menu menu = new Menu();
menu.add(menuCel);
 
SplitButton boutonAvecMenus = new SplitButton(i18nC.applicationExterne());
boutonAvecMenus.setId(ComposantId.BTN_APPLIS);
boutonAvecMenus.addSelectionListener(boutonEcouteur);
boutonAvecMenus.setMenu(menu);
boutonAvecMenus.setIcon(Images.ICONES.flecheBascule());
 
return boutonAvecMenus;
}
 
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("maj_utilisateur")) {
Utilisateur utilisateur = mediateur.getUtilisateur();
if (utilisateur.isIdentifie()) {
conteneurHtml.setHtml(Format.substitute(identificationInfoTpl, (new Params()).add(i18nC.bienvenue()+utilisateur.getNomComplet())));
identificationBouton.setText(i18nC.deconnexion());
identificationBouton.setIcon(Images.ICONES.deconnexion());
identificationBouton.setId(ComposantId.BTN_DECONNEXION);
} else {
conteneurHtml.setHtml(Format.substitute(identificationInfoTpl, (new Params()).add(i18nC.modeAnonyme())));
identificationBouton.setText(i18nC.identification());
identificationBouton.setIcon(Images.ICONES.connexion());
identificationBouton.setId(ComposantId.BTN_CONNEXION);
}
}
} else {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
layout();
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/EnteteVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/EnteteVue.java:r11-443,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/EnteteVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/StatutVue.java
New file
0,0 → 1,91
package org.tela_botanica.client.vues;
 
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.Orientation;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.EventType;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.event.WidgetListener;
import com.extjs.gxt.ui.client.widget.InfoConfig;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Status;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
 
public class StatutVue extends LayoutContainer {
private Status barreStatut = null;
private Button messageErreur = null;
private Status messages = null;
private int nbErreursNonLues = 0;
public StatutVue() {
setLayout(new FitLayout());
setId(ComposantId.PANNEAU_STATUT);
 
ToolBar toolBar = new ToolBar();
barreStatut = new Status();
toolBar.add(barreStatut);
toolBar.add(new FillToolItem());
messages = new Status();
toolBar.add(messages);
messageErreur = new Button();
messageErreur.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
reinitialiserNonLue();
((Mediateur) Registry.get(RegistreId.MEDIATEUR)).ouvrirFenetreJournal();
}
});
toolBar.add(messageErreur);
Status version = new Status();
String infoVersionAppli = Registry.get(RegistreId.APPLI_CODE)+" v"+Registry.get(RegistreId.APPLI_VERSION)+" - "+Registry.get(RegistreId.APPLI_VERSION_NOM);
version.setText(infoVersionAppli);
toolBar.add(version);
add(toolBar);
}
public void showBusy(String message) {
barreStatut.setBusy(message);
}
public void clear() {
barreStatut.clearStatus("");
}
public void afficherMessage(InfoConfig info) {
messages.setText(info.titleHtml +" - " + info.html);
}
 
public void afficherErreur() {
nbErreursNonLues++;
String labelErreur = " erreur";
if (nbErreursNonLues > 1) {
labelErreur+="s";
}
messageErreur.setText("<b style=\"color:red\">" + nbErreursNonLues + labelErreur + "</b>");
}
public void reinitialiserNonLue() {
nbErreursNonLues = 0;
messageErreur.setText("");
messageErreur.setVisible(false);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/StatutVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/StatutVue.java:r11-442,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/StatutVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/Formulaire.java
New file
0,0 → 1,373
package org.tela_botanica.client.vues;
 
import java.util.Iterator;
import java.util.List;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.i18n.ErrorMessages;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.aDonneeListe;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.Radio;
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
import com.google.gwt.core.client.GWT;
 
public abstract class Formulaire extends LayoutContainer implements Rafraichissable {
 
public static final String MODE_AJOUTER = "AJOUT";
public static final String MODE_MODIFIER = "MODIF";
public Constantes i18nC = null;
public ErrorMessages i18nM = null;
public Mediateur mediateur = null;
public Configuration config = null;
public String mode = null;
public int tabIndex = 100;
public FormPanel panneauFormulaire = null;
public ButtonBar barreOutilsValidation = null;
public String menuIdCourant = null;
public static Boolean clicBoutonvalidation = false;
public Rafraichissable vueExterneARafraichirApresValidation = null;
 
public FormPanel getFormulaire() {
return panneauFormulaire;
}
public void initialiserFormulaire(Mediateur mediateurCourrant, String modeDeCreation, String idMenuCourrant) {
// Initialisation de variables
mode = modeDeCreation;
mediateur = mediateurCourrant;
i18nC = Mediateur.i18nC;
i18nM = Mediateur.i18nM;
menuIdCourant = idMenuCourrant;
config = (Configuration) Registry.get(RegistreId.CONFIG);
// Iniatilisation du layoutContainer
setLayout(new FitLayout());
setBorders(false);
// Création du panneau du FORMULAIRE GÉNÉRAL
panneauFormulaire = new FormPanel();
panneauFormulaire.setBodyBorder(false);
panneauFormulaire.setFrame(true);
panneauFormulaire.setCollapsible(false);
panneauFormulaire.setButtonAlign(HorizontalAlignment.CENTER);
panneauFormulaire.setLayout(new FitLayout());
panneauFormulaire.setPadding(0);
if (modeDeCreation.equals(MODE_AJOUTER)) {
panneauFormulaire.setIcon(Images.ICONES.formAjouter());
} else if (modeDeCreation.equals(MODE_AJOUTER)) {
panneauFormulaire.setIcon(Images.ICONES.formModifier());
}
barreOutilsValidation = new FormulaireBarreValidation(creerEcouteurValidation());
panneauFormulaire.setBottomComponent(barreOutilsValidation);
add(panneauFormulaire);
}
public SelectionListener<ButtonEvent> creerEcouteurValidation() {
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
String code = ((Button) ce.getComponent()).getData("code");
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
if (mediateur.getUtilisateur().isIdentifie()) {
clicBoutonvalidation = true;
soumettreFormulaire();
} else {
InfoLogger.display(i18nC.modeAnonyme(), i18nC.identificationNecessaire());
}
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
if (mediateur.getUtilisateur().isIdentifie()) {
soumettreFormulaire();
} else {
InfoLogger.display(i18nC.modeAnonyme(), i18nC.identificationNecessaire());
}
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
fermerFormulaire();
}
}
};
return ecouteur;
}
public abstract boolean verifierFormulaire();
public abstract boolean soumettreFormulaire();
public TabItem creerOnglet(String nom, String id) {
TabItem onglet = new TabItem();
onglet.setId(id);
onglet.setText(nom);
FormulaireOnglet.parametrer(onglet);
return onglet;
}
 
public void controlerFermeture() {
if (clicBoutonvalidation) {
fermerFormulaire();
}
}
public void fermerFormulaire() {
clicBoutonvalidation = false;
panneauFormulaire.setEnabled(false);
surFermetureFormulaire();
//mediateur.clicMenu(menuIdCourant);
}
public void surFermetureFormulaire() {
// A surcharger si jamais une action spécifique doit être entreprise
}
/** Méthode simplifiant la création de FormLayout.
* Chacun des paramètres peut prendre la valeur null pour utiliser la valeur par défaut.
*
* @param labelWidth largeur des labels.
* @param labelAlign alignement des labels
* @return
*/
public static FormLayout creerFormLayout(Integer labelWidth, LabelAlign labelAlign) {
FormLayout formLayout = new FormLayout();
if (labelWidth != null) {
formLayout.setLabelWidth(labelWidth);
}
if (labelAlign != null) {
formLayout.setLabelAlign(labelAlign);
}
return formLayout;
}
/** Méthode simplifiant la création de bouton radio oui/non
*
* @param listeNom nom de la liste de valeur
* @return
*/
public RadioGroup creerChoixUniqueRadioGroupe(String groupeNom, String listeNom) {
groupeNom += "_grp";
// NOTE : il semblerait qu'il faille aussi utiliser setName() pour éviter tout problème...
RadioGroup radioGroup = new RadioGroup(groupeNom);
radioGroup.setName(groupeNom);
 
if (listeNom.equals("ouiNon")) {
ValeurListe ouiNonListe = new ValeurListe();
ouiNonListe.ajouter(new Valeur("1", i18nC.oui(), "NULL", "NULL"));
ouiNonListe.ajouter(new Valeur("0", i18nC.non(), "NULL", "NULL"));
creerChoixUniqueBoutonRadio(radioGroup, ouiNonListe);
}
return radioGroup;
}
public void creerChoixUniqueBoutonRadio(RadioGroup radioGroupe, ValeurListe listeValeurs) {
for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
Valeur val = listeValeurs.get(it.next());
Radio radioBtn = new Radio();
radioBtn.setName(radioGroupe.getName().replace("_grp", ""));
radioBtn.setId(val.getId()+"_"+radioBtn.getName());
radioBtn.setBoxLabel(val.getNom());
radioBtn.setValueAttribute(val.getId());
radioBtn.addListener(Events.Change, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
//Window.alert(((Radio) be.component).getName());
afficherChampSupplementaire(((Radio) be.getComponent()));
}
});
if (! val.getDescription().equals("NULL")) {
radioBtn.setToolTip(new ToolTipConfig(val.getNom(), val.getDescription()));
}
radioGroupe.add(radioBtn);
}
}
public void afficherChampSupplementaire(Radio radioBtn) {
GWT.log("Vous devez redéfinir la méthode afficherChampSupplementaire(Radio radioBtn) dans votre classe formulaire.", null);
};
/** Méthode simplifiant la création de choix multiple sous forme de case à cocher.
* Apelle un service retournant la liste des valeurs représentant les cases à cocher.
* Ajoute ou pas un champ "Autre".
*
* @return ContentPanel le panneau contenant les cases à cocher
*/
public static LayoutContainer creerChoixMultipleCp() {
LayoutContainer conteneur = new LayoutContainer();
conteneur.setLayout(creerFormLayout(650, LabelAlign.TOP));
return conteneur;
}
/** Méthode simplifiant la création de choix multiple sous forme de case à cocher.
* Apelle un service retournant la liste des valeurs représentant les cases à cocher.
* Ajoute ou pas un champ "Autre".
*
* @param cp panneau conteant le groupe de case à cocher
* @param cacGroup le groupe de case à cocher
* @param listeValeurs la liste de valeurs à transformer en case à cocher
* @param boolAutreChp booléen indiquant si oui ou non le champ autre doit apparaître
* @return
*/
public static void creerChoixMultipleCac(LayoutContainer cp, final CheckBoxGroup cacGroupe, ValeurListe listeValeurs, final Field<String> autreChp) {
cp.addListener(Events.Hide, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
cacGroupe.reset();
autreChp.setValue("");
}
});
cacGroupe.setAutoWidth(true);
cacGroupe.setStyleAttribute("padding", "3px");
cacGroupe.setData("liste_id", listeValeurs.getId());
for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
Valeur val = listeValeurs.get(it.next());
String nom = val.get("nom");
CheckBox cac = new CheckBox();
cac.setId("val-"+val.getId());
cac.setData("id", val.getId());
cac.setBoxLabel(nom);
if (! val.getDescription().equals("NULL")) {
cac.setToolTip(new ToolTipConfig(val.getNom(), val.getDescription()));
}
cacGroupe.add(cac);
}
cp.add(cacGroupe);
if (autreChp != null) {
// FIXME : éviter le chevauchement du texte des cases à cocher avec le label "Autre" sur les petits écrans
LayoutContainer conteneur = new LayoutContainer();
conteneur.setLayout(creerFormLayout(50, LabelAlign.TOP));
autreChp.setFieldLabel("Autre");
autreChp.setLabelStyle("font-weight:normal;");
conteneur.add(autreChp, new FormData(500, 0));
cp.add(conteneur);
}
cp.layout();
}
@SuppressWarnings({"unchecked"})
public static void rafraichirComboBox(aDonneeListe<?> listeValeurs, ComboBox combo) {
rafraichirComboBox(listeValeurs, combo, "nom");
}
@SuppressWarnings({"unchecked"})
public static void rafraichirComboBox(aDonneeListe<?> listeValeurs, ComboBox combo, String champATrier) {
List<?> liste = listeValeurs.toList();
if (liste.size() > 0) {
ListStore store = combo.getStore();
store.removeAll();
store.add(liste);
store.sort(champATrier, SortDir.ASC);
combo.setStore(store);
}
}
public static Listener<BaseEvent> creerEcouteurChampObligatoire() {
return new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
Field<?> champ = null;
boolean etreVide = true;
if (be.getSource() instanceof TextField<?>) {
champ = (TextField<?>) be.getSource();
etreVide = (champ.getRawValue().isEmpty()) ? true : false;
} else if (be.getSource() instanceof TextArea) {
champ = (TextArea) be.getSource();
etreVide = (champ.getRawValue().isEmpty()) ? true : false;
} else if (be.getSource() instanceof ChampComboBoxListeValeurs) {
champ = (ChampComboBoxListeValeurs) be.getSource();
etreVide = (champ.getValue() == null) ? true : false;
} else if (be.getSource() instanceof ComboBox<?>) {
champ = (ComboBox<?>) be.getSource();
etreVide = (champ.getValue() == null) ? true : false;
}
champ.removeStyleName(ComposantClass.OBLIGATOIRE);
champ.removeStyleName(ComposantClass.OBLIGATOIRE_OK);
if (etreVide == false) {
champ.addStyleName(ComposantClass.OBLIGATOIRE_OK);
} else {
champ.addStyleName(ComposantClass.OBLIGATOIRE);
}
}
};
}
public static ValeurListe trierListeOuiNonEnPartie(ValeurListe listeValeurs) {
ValeurListe listeValeursTriees = new ValeurListe();
Valeur valeurOui = null;
Valeur valeurNon = null;
Valeur valeurEnpartie = null;
String idValeurOui = null;
String idValeurNon = null;
String idValeurEnpartie = null;
for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
String strId = it.next();
Valeur valeurDeLaListe = listeValeurs.get(strId);
//Window.alert(strId+" "+valeurDeLaListe.getNom());
if(valeurDeLaListe.getNom().equals("Oui")) {
idValeurOui = strId;
valeurOui = valeurDeLaListe;
}
if(valeurDeLaListe.getNom().equals("Non")) {
idValeurNon = strId;
valeurNon = valeurDeLaListe;
}
if(valeurDeLaListe.getNom().equals("En partie")) {
idValeurEnpartie = strId;
valeurEnpartie = valeurDeLaListe;
}
}
listeValeursTriees.put(idValeurOui, valeurOui);
listeValeursTriees.put(idValeurNon, valeurNon);
listeValeursTriees.put(idValeurEnpartie, valeurEnpartie);
return listeValeursTriees;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/Formulaire.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/Formulaire.java:r11-636,649-686,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/Formulaire.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/personne/PersonneFormPublication.java
New file
0,0 → 1,728
package org.tela_botanica.client.vues.personne;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.GrillePaginable;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.ProxyCollectionAPublication;
import org.tela_botanica.client.composants.pagination.ProxyPublications;
import org.tela_botanica.client.composants.pagination.ProxyPublicationsAPersonne;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
import org.tela_botanica.client.modeles.publication.PublicationListe;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.FenetreForm;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireBarreValidation;
import org.tela_botanica.client.vues.FormulaireOnglet;
import org.tela_botanica.client.vues.publication.PublicationForm;
 
import com.extjs.gxt.ui.client.core.XTemplate;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.KeyListener;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.store.StoreEvent;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.grid.RowExpander;
import com.extjs.gxt.ui.client.widget.grid.RowNumberer;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
 
public class PersonneFormPublication extends FormulaireOnglet implements Rafraichissable {
private Personne personneSelectionnee = null;
private static int idGenere = 1;
private ContentPanel panneauPrincipal = null;
private ToolBar barreOutils = null;
private GrillePaginable<ModelData> grille;
private PublicationAPersonneListe publicationsAjoutees = null;
private PublicationAPersonneListe publicationsSupprimees = null;
private ChampComboBoxRechercheTempsReelPaginable publicationsSaisiesComboBox = null;
private Button publicationsBoutonSupprimer = null;
private Button publicationsBoutonModifier = null;
private ComboBox<Valeur> typeRelationCombo = null;
private List<Valeur> roles = null;
private PublicationAPersonneListe listePublicationsLiees = new PublicationAPersonneListe();
boolean personneRecue = false;
boolean rolesRecus = false;
private FenetreForm fenetreFormulaire = null;
public PersonneFormPublication(Formulaire formulaireCourrant) {
initialiserOnglet(formulaireCourrant);
setId("publication");
setText(Mediateur.i18nC.personneOngletPublication());
setStyleAttribute("padding", "0");
initialiser();
panneauPrincipal = creerPanneauContenantGrille();
setLayout(new FitLayout());
barreOutils = creerBarreOutilsGrille();
panneauPrincipal.setTopComponent(barreOutils);
panneauPrincipal.setLayout(new FitLayout());
grille = creerGrille();
panneauPrincipal.add(grille);
add(panneauPrincipal);
}
private void initialiser() {
// Remise à zéro des modification dans la liste des auteurs
idGenere = 1;
publicationsAjoutees = new PublicationAPersonneListe();
publicationsSupprimees = new PublicationAPersonneListe();
}
public void mettreAJourPersonne() {
personneSelectionnee = ((PersonneForm) formulaire).personneSelectionnee;
}
private ContentPanel creerPanneauContenantGrille() {
ContentPanel panneau = new ContentPanel();
panneau.setHeadingHtml(i18nC.personneOngletPublication()+" " + i18nC.personnePublication());
panneau.setIcon(Images.ICONES.table());
panneau.setLayout(new FitLayout());
panneau.setFrame(true);
return panneau;
}
 
private ToolBar creerBarreOutilsGrille() {
ToolBar barreOutils = new ToolBar();
publicationsSaisiesComboBox = creerComboBoxPublicationsSaisis();
barreOutils.add(publicationsSaisiesComboBox);
barreOutils.add(new Text(" ou "));
Button ajouterBouton = creerBoutonAjouter();
barreOutils.add(ajouterBouton);
barreOutils.add(new SeparatorToolItem());
publicationsBoutonModifier = creerBoutonModifier();
barreOutils.add(publicationsBoutonModifier);
barreOutils.add(new SeparatorToolItem());
publicationsBoutonSupprimer = creerBoutonSupprimer();
barreOutils.add(publicationsBoutonSupprimer);
barreOutils.add(new SeparatorToolItem());
Button rafraichirBouton = creerBoutonRafraichir();
barreOutils.add(rafraichirBouton);
return barreOutils;
}
 
private Button creerBoutonAjouter() {
Button bouton = new Button(i18nC.ajouter());
bouton.setIcon(Images.ICONES.vcardAjouter());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_AJOUTER);
fenetreFormulaire.show();
}
});
return bouton;
}
private Button creerBoutonModifier() {
Button bouton = new Button(i18nC.modifier());
bouton.setIcon(Images.ICONES.vcardModifier());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
ModelData publicationSaisieSelectionnee = grille.getGrille().getSelectionModel().getSelectedItem();
if (publicationSaisieSelectionnee == null) {
InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPublication());
} else {
fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_MODIFIER);
fenetreFormulaire.show();
}
}
});
return bouton;
}
private FenetreForm creerFenetreModaleAvecFormulairePersonne(String mode) {
String publicationId = null;
if (mode.equals(Formulaire.MODE_MODIFIER)) {
PublicationAPersonne publicationSaisiSelectionne = new PublicationAPersonne(grille.getGrille().getSelectionModel().getSelectedItem(), false);
publicationId = publicationSaisiSelectionne.getIdPublication();
}
final FenetreForm fenetre = new FenetreForm("");
final PublicationForm formulaire = creerFormulairePublication(fenetre, publicationId);
fenetre.add(formulaire);
return fenetre;
}
private PublicationForm creerFormulairePublication(final FenetreForm fenetre, final String publicationId) {
PublicationForm formulairePublication = new PublicationForm(mediateur, publicationId, this);
FormPanel panneauFormulaire = formulairePublication.getFormulaire();
fenetre.setHeadingHtml(panneauFormulaire.getHeadingHtml());
panneauFormulaire.setHeaderVisible(false);
panneauFormulaire.setTopComponent(null);
// FIXME : avec GXT-2.1.0 la redéfinition du bottom component ne marche plus. Nous le cachons et en créeons un dans la fenêtre.
panneauFormulaire.getBottomComponent().hide();
SelectionListener<ButtonEvent> ecouteur = creerEcouteurValidationFormulairePublication(fenetre, formulairePublication);
final ButtonBar barreValidation = new FormulaireBarreValidation(ecouteur);
fenetre.setBottomComponent(barreValidation);
return formulairePublication;
}
private SelectionListener<ButtonEvent> creerEcouteurValidationFormulairePublication(final FenetreForm fenetre, final PublicationForm formulaire) {
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
String code = ((Button) ce.getComponent()).getData("code");
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
if (formulaire.soumettreFormulaire()) {
fenetre.hide();
}
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
formulaire.soumettreFormulaire();
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
fenetre.hide();
}
}
};
return ecouteur;
}
private Button creerBoutonSupprimer() {
Button bouton = new Button(i18nC.supprimer());
bouton.setIcon(Images.ICONES.vcardSupprimer());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
List<ModelData> listeDonneesSelectionnees = grille.getGrille().getSelectionModel().getSelectedItems();
for (ModelData donneeSelectionnee : listeDonneesSelectionnees) {
PublicationAPersonne publicationSaisieSelectionnee = new PublicationAPersonne(donneeSelectionnee, false);
supprimerDansGrille(publicationSaisieSelectionnee, donneeSelectionnee);
}
}
});
return bouton;
}
private Button creerBoutonRafraichir() {
Button bouton = new Button(i18nC.rafraichir());
bouton.setIcon(Images.ICONES.rafraichir());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
actualiserGrille();
}
});
return bouton;
}
private void actualiserGrille() {
if (mode.equals(Formulaire.MODE_MODIFIER)) {
mediateur.selectionnerPublicationAPersonne(this, null, personneSelectionnee.getId(), "%", null);
} else {
grille.getStore().removeAll();
layout();
}
}
private ChampComboBoxRechercheTempsReelPaginable creerComboBoxPublicationsSaisis() {
ModelType modelTypePublications = new ModelType();
modelTypePublications.setRoot("publications");
modelTypePublications.setTotalName("nbElements");
modelTypePublications.addField("ccapu_id_personne");
modelTypePublications.addField("ccapu_id_publication");
modelTypePublications.addField("cpu_id_publication");
modelTypePublications.addField("cpu_fmt_nom_complet");
modelTypePublications.addField("cpu_titre");
modelTypePublications.addField("cpu_nom");
modelTypePublications.addField("cpu_fmt_auteur");
modelTypePublications.addField("cpu_indication_nvt");
modelTypePublications.addField("cpu_truk_pages");
modelTypePublications.addField("cpu_fascicule");
modelTypePublications.addField("cpu_date_parution");
modelTypePublications.addField("cpu_ce_truk_editeur");
modelTypePublications.addField("cpu_collection");
String displayNamePublications = "cpu_fmt_nom_complet";
ProxyPublications<ModelData> proxyPublications= new ProxyPublications<ModelData>(null);
final ChampComboBoxRechercheTempsReelPaginable publicationsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyPublications, modelTypePublications, displayNamePublications);
publicationsCombo.getCombo().setTabIndex(tabIndex++);
publicationsCombo.getCombo().setForceSelection(true);
 
publicationsCombo.getCombo().setValidator(new Validator() {
public String validate(Field<?> field, String value) {
String retour = null;
if (field.getRawValue().equals("")) {
field.setValue(null);
} else if (publicationsCombo.getStore().findModel("cpu_fmt_nom_complet", field.getRawValue()) == null) {
String contenuBrut = field.getRawValue();
field.setValue(null);
field.setRawValue(contenuBrut);
retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
}
return retour;
}
});
publicationsCombo.getCombo().setEmptyText("Rechercher et sélectionner une publication existante dans la base");
publicationsCombo.getCombo().addListener(Events.Select, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
if (publicationsSaisiesComboBox.getValeur() instanceof ModelData) {
Publication publicationSaisieSelectionne = new Publication(publicationsSaisiesComboBox.getValeur(), false);
ajouterDansGrille(publicationSaisieSelectionne);
publicationsSaisiesComboBox.getCombo().setValue(null);
}
}
});
return publicationsCombo;
}
private void ajouterDansGrille(Publication publication) {
ajouterDansGrille(publication, 0);
}
private void ajouterDansGrille(Publication publication, int index) {
if (publication != null) {
if (!listePublicationsLiees.containsKey(publication.getId())) {
PublicationAPersonne publicationLiee = new PublicationAPersonne(false);
publicationLiee.setPersonne(personneSelectionnee);
publicationLiee.setPublicationLiee(publication);
publicationLiee.setIdPublication(publication.getId());
 
publicationLiee.set("_etat_", aDonnee.ETAT_AJOUTE);
listePublicationsLiees.put(publication.getId(), publicationLiee);
// Ajout à la grille
grille.getGrille().stopEditing();
grille.getGrille().getStore().insert(publicationLiee, 0);
grille.getGrille().startEditing(index, 0);
grille.getGrille().getSelectionModel().select(index, false);
} else {
InfoLogger.display("Information", "La publication choisie existe déjà dans la liste.");
}
}
}
/**
* Met à jour la grille avec les informations contenus dans la variable listePublicationsLiees
*/
private void mettreAJourGrille() {
 
grille.getStore().removeAll();
grille.getStore().add(listePublicationsLiees.toList());
}
private void supprimerDansGrille(PublicationAPersonne publicationLiee, ModelData publicationLieeModele) {
if (publicationLiee != null) {
// Ajout de la personne supprimée à la liste
if ((publicationLiee.get("_etat_").equals("") || !publicationLiee.get("_etat_").equals(aDonnee.ETAT_AJOUTE))
&& publicationLiee.getId() != null
&& !publicationLiee.getId().equals("")) {
publicationsSupprimees.put("id"+idGenere++, publicationLiee);
}
// Suppression de l'enregistrement de la grille
grille.getStore().remove(publicationLieeModele);
}
}
 
private GrillePaginable<ModelData> creerGrille() {
GrillePaginable<ModelData> grillePublications = null;
// ModelType
ModelType modelTypePublicationAPersonne = new ModelType();
modelTypePublicationAPersonne.setRoot("publicationsAPersonne");
modelTypePublicationAPersonne.setTotalName("nbElements");
modelTypePublicationAPersonne.addField("cpuap_id_personne");
modelTypePublicationAPersonne.addField("cpuap_id_publication");
modelTypePublicationAPersonne.addField("cpuap_id_role");
modelTypePublicationAPersonne.addField("cpu_id_publication");
modelTypePublicationAPersonne.addField("cpu_fmt_auteur");
modelTypePublicationAPersonne.addField("cpu_titre");
modelTypePublicationAPersonne.addField("cpu_collection");
modelTypePublicationAPersonne.addField("cpu_ce_truk_editeur");
modelTypePublicationAPersonne.addField("cpu_date_parution");
modelTypePublicationAPersonne.addField("cpu_fascicule");
modelTypePublicationAPersonne.addField("cpu_truk_pages");
modelTypePublicationAPersonne.addField("cpu_indication_nvt");
// Proxy
ProxyPublicationsAPersonne<ModelData> proxyPublicationsAPersonne = new ProxyPublicationsAPersonne<ModelData>(null, null, null);
 
// Colonnes
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
RowNumberer numeroPlugin = new RowNumberer();
numeroPlugin.setHeaderHtml("#");
XTemplate infoTpl = XTemplate.create("<p>"+
"<span style='font-weight:bold;'>"+i18nC.publicationAuteurs()+" :</span> {cpu_fmt_auteur}<br />"+
"<span style='font-weight:bold;'>"+i18nC.publicationTitre()+" :</span> {cpu_titre}<br />"+
"<span style='font-weight:bold;'>"+i18nC.publicationRevueCollection()+" :</span> {cpu_collection}<br />"+
"<span style='font-weight:bold;'>"+i18nC.publicationEditeur()+" :</span> {_editeur_}"+
"</p>");
RowExpander expansionPlugin = new RowExpander();
expansionPlugin.setTemplate(infoTpl);
colonnes.add(expansionPlugin);
colonnes.add(numeroPlugin);
colonnes.add(creerColonneTypeRelation());
colonnes.add(new ColumnConfig("cpu_fmt_auteur", i18nC.publicationAuteurs(), 150));
colonnes.add(new ColumnConfig("cpu_titre", i18nC.publicationTitre(), 150));
colonnes.add(new ColumnConfig("cpu_collection", i18nC.publicationRevueCollection(), 75));
colonnes.add(creerColonneEditeur());
colonnes.add(creerColonneAnneePublication());
colonnes.add(new ColumnConfig("cpu_indication_nvt", i18nC.publicationNvt(), 75));
colonnes.add(new ColumnConfig("cpu_fascicule", i18nC.publicationFascicule(), 75));
colonnes.add(new ColumnConfig("cpu_truk_pages", i18nC.publicationPage(), 50));
HashMap<String, String> virtualFields = new HashMap<String, String>();
virtualFields.put("_editeur_", "cpu_ce_truk_editeur");
virtualFields.put("_annee_", "cpu_date_parution");
virtualFields.put("_role_", "cpuap_id_role");
virtualFields.put("_etat_", "");
// Modele de selection
GridSelectionModel<ModelData> modeleDeSelection = new GridSelectionModel<ModelData>();
ColumnModel modeleDeColonnes = new ColumnModel(colonnes);
modeleDeColonnes.getColumn(0).setWidget(Images.ICONES.information().createImage(), "Info");
// Grille
grillePublications = new GrillePaginable<ModelData>(modelTypePublicationAPersonne, virtualFields, proxyPublicationsAPersonne, colonnes, modeleDeColonnes);
grillePublications.getGrille().setBorders(true);
grillePublications.getGrille().setSelectionModel(modeleDeSelection);
grillePublications.getGrille().addPlugin(expansionPlugin);
grillePublications.getGrille().addPlugin(numeroPlugin);
grillePublications.getGrille().getView().setForceFit(true);
grillePublications.getGrille().setAutoExpandColumn("titre");
grillePublications.getGrille().setStripeRows(true);
grillePublications.getGrille().setTrackMouseOver(true);
// Rajouter des écouteurs
grillePublications.getStore().addListener(Store.Add, new Listener<StoreEvent<ModelData>>() {
public void handleEvent(StoreEvent<ModelData> ce) {
actualiserEtatBoutonsBarreOutils();
}
});
grillePublications.getStore().addListener(Store.Remove, new Listener<StoreEvent<ModelData>>() {
public void handleEvent(StoreEvent<ModelData> ce) {
actualiserEtatBoutonsBarreOutils();
}
});
grillePublications.getStore().addListener(Store.Update, new Listener<StoreEvent<ModelData>>() {
public void handleEvent(StoreEvent<ModelData> ce) {
if (ce.getModel().get("_role_") != null && ce.getRecord().isModified("_role_") && ce.getModel().get("_etat_") != null && !ce.getModel().get("_etat_").equals(aDonnee.ETAT_AJOUTE)) {
ce.getModel().set("_etat_", aDonnee.ETAT_MODIFIE);
}
}
});
return grillePublications;
}
private ColumnConfig creerColonneEditeur() {
GridCellRenderer<ModelData> editeurRendu = new GridCellRenderer<ModelData>() {
public String render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ModelData> store, Grid<ModelData> grid) {
PublicationAPersonne pap = new PublicationAPersonne(model, true);
String editeur = pap.getPublicationLiee().getNomEditeur();
model.set("_editeur_", editeur);
return editeur;
}
};
ColumnConfig editeurColonne = new ColumnConfig("_editeur_", Mediateur.i18nC.publicationEditeur(), 135);
editeurColonne.setRenderer(editeurRendu);
return editeurColonne;
}
private ColumnConfig creerColonneAnneePublication() {
GridCellRenderer<ModelData> datePublicationRendu = new GridCellRenderer<ModelData>() {
public String render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ModelData> store, Grid<ModelData> grid) {
PublicationAPersonne pap = new PublicationAPersonne(model, true);
String annee = pap.getPublicationLiee().getAnneeParution();
model.set("_annee_", annee);
return annee;
}
};
ColumnConfig datePublicationColonne = new ColumnConfig("_annee_", Mediateur.i18nC.publicationDateParution(), 75);
datePublicationColonne.setRenderer(datePublicationRendu);
return datePublicationColonne;
}
private ColumnConfig creerColonneTypeRelation() {
typeRelationCombo = new ComboBox<Valeur>();
typeRelationCombo.setForceSelection(true);
typeRelationCombo.setTriggerAction(TriggerAction.ALL);
typeRelationCombo.setDisplayField("nom");
typeRelationCombo.setStore(new ListStore<Valeur>());
typeRelationCombo.setEditable(false);
typeRelationCombo.addStyleName(ComposantClass.OBLIGATOIRE);
typeRelationCombo.addListener(Events.Select, Formulaire.creerEcouteurChampObligatoire());
CellEditor editeurRelation = new CellEditor(typeRelationCombo) {
public Object preProcessValue(Object valeur) {
Valeur retour = null;
if (valeur != null ) {
if (typeRelationCombo.getStore().findModel("nom", valeur.toString()) != null) {
retour = typeRelationCombo.getStore().findModel("nom", valeur.toString());
} else if (typeRelationCombo.getStore().findModel("abr", valeur.toString()) != null) {
retour = typeRelationCombo.getStore().findModel("abr", valeur.toString());
} else if (typeRelationCombo.getStore().findModel("id_valeur", valeur.toString()) != null) {
retour = typeRelationCombo.getStore().findModel("id_valeur", valeur.toString());
}
}
return retour;
}
 
public Object postProcessValue(Object valeur) {
String retour = null;
if (valeur != null ) {
if (valeur instanceof Valeur) {
Valeur valeurOntologie = (Valeur) valeur;
retour = valeurOntologie.getId();
}
}
return retour;
}
};
GridCellRenderer<ModelData> relationRendu = new GridCellRenderer<ModelData>() {
public String render(ModelData modele, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ModelData> store, Grid<ModelData> grille) {
// Gestion du texte afficher dans la cellule
String role = modele.get("_role_");
String roleNom = "";
if (typeRelationCombo.getStore() != null && role!=null && role.matches("[0-9]+")) {
if (typeRelationCombo.getStore().findModel("id_valeur", role) != null) {
roleNom = typeRelationCombo.getStore().findModel("id_valeur", role).getNom();
role = typeRelationCombo.getStore().findModel("id_valeur", role).getId();
} else { Debug.log("role recherche="+role);
Debug.log("typeRelationCombo.getStore().getCount()="+typeRelationCombo.getStore().getCount());
for(int i=0; i<typeRelationCombo.getStore().getCount(); i++) {
Debug.log(""+typeRelationCombo.getStore().getAt(i));
}
}
}
modele.set("_role_", role);
return roleNom;
}
};
ColumnConfig typeRelationColonne = new ColumnConfig("_role_", i18nC.typeRelationPersonne(), 75);
typeRelationColonne.setEditor(editeurRelation);
typeRelationColonne.setRenderer(relationRendu);
return typeRelationColonne;
}
 
public void actualiserEtatBoutonsBarreOutils() {
// Activation des boutons si la grille contient un élément
if (grille.getStore().getCount() > 0) {
publicationsBoutonSupprimer.enable();
publicationsBoutonModifier.enable();
}
// Désactivation des boutons si la grille ne contient plus d'élément
if (grille.getStore().getCount() == 0) {
publicationsBoutonSupprimer.disable();
publicationsBoutonModifier.disable();
}
}
public void rafraichir(Object nouvellesDonnees) {
 
if (nouvellesDonnees instanceof Information)
{
Information info = (Information) nouvellesDonnees;
rafraichirInformation(info);
}
else if (nouvellesDonnees instanceof ValeurListe)
{
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
if (listeValeurs.getId().equals(config.getListeId("relationPersonnePublication"))) {
Formulaire.rafraichirComboBox(listeValeurs, typeRelationCombo);
roles = listeValeurs.toList();
rolesRecus = true;
((ProxyPublicationsAPersonne)grille.getProxy()).setRolesId(roles);
if (rolesRecus && personneRecue) grille.reload();
}
}
else if (nouvellesDonnees instanceof PublicationAPersonneListe)
{
PublicationAPersonneListe papl = (PublicationAPersonneListe) nouvellesDonnees;
List<PublicationAPersonne> paplListe = papl.toList();
if (paplListe.size()>0){
Iterator<PublicationAPersonne> it = paplListe.iterator();
while (it.hasNext()) {
PublicationAPersonne pap = it.next();
listePublicationsLiees.put(pap.getPublicationLiee().getId(), pap);
}
mettreAJourGrille();
}
}
else
{
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
}
public void rafraichirInformation(Information info) {
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
}
String type = info.getType();
if (type.equals("personne")) {
mettreAJourPersonne();
((ProxyPublicationsAPersonne)grille.getProxy()).setPersonneId(personneSelectionnee.getId());
personneRecue = true;
if (rolesRecus && personneRecue) grille.reload();
} else if (type.equals("publication_liees")) {
if (info.getDonnee(0) != null) {
initialiser();
personneSelectionnee.setPublicationsLiees((PublicationAPersonneListe) info.getDonnee(0));
peupler();
}
} else if (type.equals("publication_modifiee")) {
if (info.getDonnee(0) != null) {
Publication publication = (Publication) info.getDonnee(0);
ModelData publicationDansGrille = grille.getStore().findModel("cpu_id_publication", publication.getId());
int index = grille.getStore().indexOf(publicationDansGrille);
grille.getStore().remove(publicationDansGrille);
ajouterDansGrille(publication, index);
}
} else if (type.equals("publication_ajoutee")) {
if (info.getDonnee(0) != null) {
Publication publication = (Publication) info.getDonnee(0);
ajouterDansGrille(publication);
}
} else if (type.equals("ajout_publication_a_personne")) {
InfoLogger.display("Ajout publication à personne", info.getDonnees().toString());
} else if (type.equals("suppression_publication_a_personne")) {
InfoLogger.display("Suppression publication à personne", info.getMessages().toString());
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(info.getClass(), this.getClass()), null);
}
}
 
public void peupler() {
grille.getStore().removeAll();
grille.getStore().add(personneSelectionnee.getPublicationsLiees().toList());
layout();
InfoLogger.display(i18nC.chargementPublication(), i18nC.ok());
}
 
public void collecter() {
if (etreAccede()) {
int nbrePublication = grille.getStore().getCount();
for (int i = 0; i < nbrePublication; i++) {
ModelData publicationLiee = grille.getStore().getAt(i);
PublicationAPersonne pap = new PublicationAPersonne(publicationLiee, false);
if (publicationLiee.get("_etat_") != null) {
if (publicationLiee.get("_etat_").equals(aDonnee.ETAT_MODIFIE)) {
// Comme il est impossible de modifier les relations nous supprimons l'ancien enregistrement et ajoutons un nouveau avec le nouveau id_role
publicationsSupprimees.put("id"+idGenere++, pap);
PublicationAPersonne relationAAjouter = pap;
publicationsAjoutees.put("id"+idGenere++, relationAAjouter);
}
if (publicationLiee.get("_etat_").equals(aDonnee.ETAT_AJOUTE)) {
publicationsAjoutees.put("id"+idGenere++, pap);
}
// Initialisation de la grille
publicationLiee.set("_etat_", "");
}
}
grille.getStore().commitChanges();
}
}
public List verifier() {
List lstMessageErreur = new LinkedList<String>();
//Vérifier les roles
List<ModelData> listePublis = grille.getStore().getModels();
Iterator<ModelData> itPublis = listePublis.iterator();
while (itPublis.hasNext()) {
ModelData publi = itPublis.next();
if (UtilString.isEmpty((String) publi.get("_role_"))) {
lstMessageErreur.add("Vous devez choisir le rôle de la relation " + (grille.getStore().indexOf(publi) + 1));
}
}
return lstMessageErreur;
}
public void soumettre() {
if (mode.equals(Formulaire.MODE_MODIFIER)) {
if (publicationsAjoutees.size() == 0 && publicationsSupprimees.size() == 0) {
//InfoLogger.display("Modification des publications liées", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
} else {
// Ajout des relations PublicationAPersonne
if (publicationsAjoutees.size() != 0) {
//TODO : utiliser le role d'une liste déroulante
mediateur.ajouterPublicationAPersonne(this, publicationsAjoutees, personneSelectionnee.getId(), null, null);
}
// Suppression des relations PublicationAPersonne
if (publicationsSupprimees.size() != 0) {
mediateur.supprimerPublicationAPersonne(this, publicationsSupprimees);
}
}
}
}
private void obtenirPublicationsSaisies(String nom) {
mediateur.selectionnerPublicationParNomComplet(this, "%"+nom+"%");
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/personne/PersonneFormPublication.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/personne/PersonneFormPublication.java:r11-990,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/personne/PersonneFormPublication.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/personne/PersonneVue.java
New file
0,0 → 1,84
package org.tela_botanica.client.vues.personne;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.personne.PersonneListe;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.google.gwt.core.client.GWT;
 
public class PersonneVue extends LayoutContainer implements Rafraichissable {
 
private PersonneListeVue panneauPersonneListe;
private PersonneDetailVue panneauPersonneDetail;
private Mediateur mediateur = null;
 
//Sequenceur pour la gestion du synchrone
private Sequenceur sequenceur = new Sequenceur();
public PersonneVue(Mediateur mediateur) {
this.mediateur = mediateur;
BorderLayout layout = new BorderLayout();
layout.setEnableState(false);
setLayout(layout);
 
panneauPersonneListe = new PersonneListeVue();
//Charger les ontologies nécessaires à l'affichage des personnes
this.add(panneauPersonneListe, new BorderLayoutData(LayoutRegion.CENTER));
 
panneauPersonneDetail = new PersonneDetailVue(mediateur);
BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH, .5f, 200, 1000);
southData.setSplit(true);
southData.setMargins(new Margins(5, 0, 0, 0));
this.add(panneauPersonneDetail, southData);
 
mediateur.obtenirListeValeurEtRafraichir(this, "pays", sequenceur);
mediateur.obtenirListeValeurEtRafraichir(this, "tel", sequenceur);
mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonnePublication", sequenceur);
}
 
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Personne) {
sequenceur.enfilerRafraichissement(panneauPersonneDetail, (Personne) nouvellesDonnees);
} else if (nouvellesDonnees instanceof PersonneListe) {
panneauPersonneListe.rafraichir((PersonneListe) nouvellesDonnees);
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
// Affichage des éventuels messages de déboguage ou d'alerte
if (!UtilString.isEmpty(info.getMessages())) {
GWT.log(info.getMessages().toString(), null);
}
// Traitement en fonction des types d'information
if (info.getType().equals("liste_personne")) {
panneauPersonneListe.rafraichir((PersonneListe) info.getDonnee(0));
InfoLogger.display("Chargement d'une liste de personnes", "");
} else {
panneauPersonneListe.rafraichir(info);
}
} else if (nouvellesDonnees instanceof ValeurListe) {
panneauPersonneDetail.rafraichir((ValeurListe) nouvellesDonnees);
} else {
GWT.log(mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/personne/PersonneVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/personne/PersonneVue.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/personne/PersonneVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/personne/PersonneListeVue.java
New file
0,0 → 1,267
package org.tela_botanica.client.vues.personne;
 
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.ChampFiltreRecherche;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.personne.PersonneAsyncDao;
import org.tela_botanica.client.modeles.personne.PersonneListe;
import org.tela_botanica.client.vues.BarrePaginationVue;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.GridEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.Constants;
import com.google.gwt.user.client.Window;
 
public class PersonneListeVue extends ContentPanel implements Rafraichissable {
private Mediateur mediateur = null ;
private Grid<Personne> grille = null;
private ListStore<Personne> store = null;
private ChampFiltreRecherche champFiltreRecherche = null;
private BarrePaginationVue pagination = null;
private ColumnModel modeleColonnes = null;
private Button ajouter = null;
private Button modifier = null;
private Button supprimer = null;
private int indexElementSelectionne = 0;
private Personne personneSelectionnee = null;
public PersonneListeVue() {
mediateur = Registry.get(RegistreId.MEDIATEUR);
Constants i18nC = mediateur.i18nC;
setHeaderVisible(false);
setLayout(new FitLayout());
//Définition de la barre d'outil
ToolBar toolBar = new ToolBar();
ajouter = new Button(Mediateur.i18nC.ajouter());
ajouter.setIcon(Images.ICONES.ajouter());
ajouter.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
mediateur.clicAjouterPersonne();
}
});
ajouter.setToolTip(mediateur.i18nC.indicationCreerUneFiche()+" "+mediateur.i18nC.collectionSingulier());
toolBar.add(ajouter);
 
modifier = new Button(Mediateur.i18nC.modifier());
modifier.setIcon(Images.ICONES.formModifier());
modifier.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
mediateur.clicModifierPersonne(grille.getSelectionModel().getSelectedItems());
}
});
modifier.setToolTip(mediateur.i18nC.indicationModifierUneFiche());
toolBar.add(modifier);
supprimer = new Button(Mediateur.i18nC.supprimer());
supprimer.setIcon(Images.ICONES.supprimer());
supprimer.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
clicSupprimerPersonne(grille.getSelectionModel().getSelectedItems());
}
});
supprimer.setToolTip(mediateur.i18nC.indicationSupprimerUneFiche());
toolBar.add(supprimer);
setTopComponent(toolBar);
 
// Définition des colomnes de la grille:
List<ColumnConfig> lstColumns = new ArrayList<ColumnConfig>();
lstColumns.add(new ColumnConfig("id_personne", "Id", 45));
lstColumns.add(new ColumnConfig("nom", "Nom", 100));
lstColumns.add(new ColumnConfig("prenom", "Prénom", 100));
lstColumns.add(new ColumnConfig("fmt_nom_complet", "Nom Complet", 200));
lstColumns.add(new ColumnConfig("code_postal", "Code postal", 100));
lstColumns.add(new ColumnConfig("ville", "Ville", 100));
lstColumns.add(new ColumnConfig("_courriel_princ_", "Courriel", 200));
 
lstColumns.get(0).setHidden(true);
lstColumns.get(1).setHidden(true);
lstColumns.get(2).setHidden(true);
modeleColonnes = new ColumnModel(lstColumns);
 
// Définition de la grille
GridSelectionModel<Personne> gsmSelectionGrille = new GridSelectionModel<Personne>();
gsmSelectionGrille.addSelectionChangedListener(new SelectionChangedListener<Personne>() {
public void selectionChanged(SelectionChangedEvent<Personne> event) {
personneSelectionnee = (Personne) event.getSelectedItem();
indexElementSelectionne = store.indexOf(personneSelectionnee);
clicListe(personneSelectionnee);
}
});
store = new ListStore<Personne>();
grille = new Grid<Personne>(store, modeleColonnes);
grille.setSelectionModel(gsmSelectionGrille);
grille.setWidth("100%");
grille.setAutoExpandColumn("fmt_nom_complet");
grille.getView().setAutoFill(true);
grille.getView().setForceFit(true);
grille.addListener(Events.ViewReady, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
grille.getSelectionModel().select(0, false);
}
});
grille.addListener(Events.OnDoubleClick, new Listener<BaseEvent>(){
public void handleEvent(BaseEvent be) {
modifier.fireEvent(Events.Select);
}
});
 
grille.addListener(Events.SortChange, new Listener<BaseEvent>() {
 
@Override
public void handleEvent(BaseEvent be) {
GridEvent ge = (GridEvent<Personne>) be;
ge.preventDefault();
// TODO rajouter un test sur le sort state pour trier par nom par défaut
// bref, on verra plus tard parce que c'est chiant et qu'on en a marre de coel
String tri = ge.getSortInfo().getSortField();
if(tri.equals("_courriel_princ_")) {
tri = "truk_courriel";
}
if(tri.equals("fmt_nom_complet")) {
tri = "nom";
}
PersonneAsyncDao.tri = Personne.PREFIXE+"_"+tri+" "+ge.getSortInfo().getSortDir().toString();
pagination.changePage();
}
});
add(grille);
PersonneListe personneListe = new PersonneListe();
champFiltreRecherche = new ChampFiltreRecherche(mediateur, toolBar, personneListe);
// Définition de la barre de pagination
pagination = new BarrePaginationVue(personneListe, mediateur, champFiltreRecherche);
setBottomComponent(pagination);
}
 
private void clicListe(Personne personne) {
if (personne != null && store.getCount() > 0) {
mediateur.clicListePersonne(personne);
}
}
private void clicSupprimerPersonne(List<Personne> personnesASupprimer) {
if (store.getCount() > 0) {
mediateur.clicSupprimerPersonne(this, personnesASupprimer);
}
}
private void gererEtatActivationBouton() {
int nbreElementDuMagazin = store.getCount();
ajouter.enable();
if (nbreElementDuMagazin == 0) {
supprimer.disable();
modifier.disable();
} else if (nbreElementDuMagazin > 0) {
modifier.enable();
if (((Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT)).isIdentifie()) {
supprimer.enable();
}
}
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof PersonneListe) {
PersonneListe listePersonnes = (PersonneListe) nouvellesDonnees;
// la grille de gxt est case sensitive, on harmonise donc tous les noms en majuscule et sans espaces
// au début et à la fin afin de pouvoir trier correctement
// (la colonne nom ne sert qu'au tri et n'est pas affichée)
for (Iterator<Personne> iterator = listePersonnes.toList().iterator(); iterator.hasNext();) {
Personne personne = iterator.next();
personne.setNom(personne.getNom().toUpperCase().trim());
}
champFiltreRecherche.setListePaginable(listePersonnes);
pagination.setlistePaginable(listePersonnes);
pagination.rafraichir(listePersonnes.getPageTable());
if (listePersonnes != null) {
List<Personne> liste = (List<Personne>) listePersonnes.toList();
store.removeAll();
store.add(liste);
mediateur.actualiserPanneauCentral();
grille.fireEvent(Events.ViewReady);
}
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if(info.getType().equals("personne_modifiee")) {
// curieusement la suppression efface aussi l'index de l'élément
// car elle redéclenche l'évenement de selection (on le stocke donc temporairement)
int temporaire = indexElementSelectionne;
if(personneSelectionnee != null) {
store.remove(indexElementSelectionne);
personneSelectionnee = null;
}
Personne personneModifiee = (Personne)info.getDonnee(0);
// au cas ou le bouton appliquer aurait été cliqué avant de valider
store.remove(personneModifiee);
indexElementSelectionne = temporaire;
store.insert(personneModifiee, temporaire);
personneSelectionnee = personneModifiee;
int indexElementSelectionne = store.indexOf(personneSelectionnee);
grille.getSelectionModel().select(indexElementSelectionne, false);
grille.getView().focusRow(indexElementSelectionne);
clicListe(personneSelectionnee);
} else if (info.getType().equals("suppression_personne")) {
InfoLogger.display("Suppression de personne", info.getMessages().toString());
pagination.getlistePaginable().recharger();
gererEtatActivationBouton();
} else if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else {
InfoLogger.display("Erreur", info.getMessages().toString(), true);
}
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
layout();
}
}
 
 
 
 
 
 
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/personne/PersonneListeVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/personne/PersonneListeVue.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/personne/PersonneListeVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/personne/PersonneDetailVue.java
New file
0,0 → 1,407
package org.tela_botanica.client.vues.personne;
 
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
 
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.vues.DetailVue;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.util.Params;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.layout.AnchorLayout;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.google.gwt.user.client.ui.Image;
 
public class PersonneDetailVue extends DetailVue implements Rafraichissable {
 
private TabPanel tabPanel;
private Html entete;
private TabItem tabIdentite;
private TabItem tabAdresse;
private TabItem tabInfosNat;
private TabItem tabLogos;
private TabItem tabPublications;
private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
private Personne personneAAfficher = null;
 
private String tableauPublicationsLieesTpl = "";
private String lignePublicationLieeTpl = "";
private Sequenceur sequenceur = new Sequenceur();
public PersonneDetailVue(Mediateur mediateur) {
super(mediateur);
 
setLayout(new FitLayout());
 
entete = new Html();
entete.setId(ComposantId.ZONE_DETAIL_ENTETE);
 
ContentPanel panneauPrincipal = new ContentPanel();
panneauPrincipal.setLayout(new FitLayout());
panneauPrincipal.setHeaderVisible(false);
panneauPrincipal.setBodyBorder(true);
panneauPrincipal.setTopComponent(entete);
 
tabIdentite = new TabItem(i18nC.personneIdentite());
tabIdentite.setTitle(i18nC.personneIdentite());
tabIdentite.setLayout(new AnchorLayout());
tabIdentite.setScrollMode(Scroll.AUTO);
 
tabAdresse = new TabItem(i18nC.personneAdresses());
tabAdresse.setTitle(i18nC.personneAdresses());
tabAdresse.setLayout(new FitLayout());
tabAdresse.setScrollMode(Scroll.AUTO);
 
tabInfosNat = new TabItem(i18nC.personneInfoNat());
tabInfosNat.setTitle(i18nC.personneInfoNat());
tabInfosNat.setScrollMode(Scroll.AUTO);
 
tabPublications = new TabItem(i18nC.tabPublications());
tabPublications.setTitle(i18nC.tabPublications());
tabPublications.setScrollMode(Scroll.AUTO);
tabPublications.setLayout(new FlowLayout());
tabLogos = new TabItem(i18nC.personneLogos());
tabLogos.setTitle(i18nC.personneLogos());
tabLogos.setScrollMode(Scroll.AUTO);
tabLogos.setLayout(new FlowLayout());
 
tabPanel = new TabPanel();
tabPanel.setId(ComposantId.ZONE_DETAIL_CORPS);
tabPanel.setBodyBorder(false);
 
tabPanel.add(tabIdentite);
tabPanel.add(tabAdresse);
tabPanel.add(tabInfosNat);
tabPanel.add(tabPublications);
tabPanel.add(tabLogos);
 
panneauPrincipal.add(tabPanel);
add(panneauPrincipal);
}
 
public void afficherDetailPersonne(Personne personne) {
if (personne != null) {
String tplEntete = initialiserTplEntete();
//Sélection des publication à personne
mediateur.selectionnerPublicationAPersonne(this, null, personne.getId(), new LinkedList(), null);
 
Params enteteParams = new Params();
enteteParams.set("nom", (String) personne.get("fmt_nom_complet"));
enteteParams.set("mail", (String) personne.getCourrielPrinc());
 
tabLogos.removeAll();
LinkedList lstLogos = (LinkedList) personne
.getChaineDenormaliseAsMapOrList("truk_logo");
if (lstLogos != null && lstLogos.size() > 0) {
 
String urlLogoPrinc = (String) lstLogos.get(0);
if (!urlLogoPrinc.trim().equals("")) {
tplEntete = "<div id='personne-logo-div'><img src='{image}' alt='logo' /></div>"
+ tplEntete;
enteteParams.set("image", urlLogoPrinc);
}
 
Iterator<String> itLogo = lstLogos.iterator();
while (itLogo.hasNext()) {
String urlLogoCourant = itLogo.next();
Image imgCourante = new Image(urlLogoCourant);
tabLogos.add(imgCourante);
}
tabLogos.enable();
 
} else {
enteteParams.set("image", "");
tabLogos.disable();
}
 
entete.el().setInnerHtml(Format.substitute(tplEntete, enteteParams));
 
String tplIdentite = initialiserTplIdentite();
 
Params tabIdentiteParams = new Params();
tabIdentiteParams.set("nom_complet", personne.getString("fmt_nom_complet"));
tabIdentiteParams.set("abreviation", personne.getString("abreviation"));
tabIdentiteParams.set("naissance_date", personne.getAnneeOuDateNaiss().equals("") ? "" : personne.getAnneeOuDateNaiss());
tabIdentiteParams.set("naissance_lieu", personne.getString("naissance_lieu"));
String tplDeces = "";
if (personne.estDecedee()) {
tplDeces = " <h2>Décès:</h2>"
+ " <span><b>"
+ i18nC.personneDateDeces()
+ ":</b></span> {deces_date}<br />"
+ " <span><b>"
+ i18nC.personneLieuDeces()
+ ":</b></span> {deces_lieu}<br /><br />";
tabIdentiteParams.set("deces_date", personne.getAnneeOuDateDeces().equals("") ? "" : personne.getAnneeOuDateDeces());
tabIdentiteParams.set("deces_lieu", personne.getString("deces_lieu"));
}
Params paramsDeces = new Params();
paramsDeces.set("tplDeces", tplDeces);
tplIdentite = Format.substitute(tplIdentite, paramsDeces);
tabIdentiteParams.set("description", personne.getString("description"));
 
tabInfosNat.removeAll();
 
tabIdentiteParams.set("nom_autre", construireTxtTruck(personne.getString("truk_nom_autre")));
tabIdentiteParams.set("abreviation_autre", construireTxtTruck(personne.getString("truk_abreviation_autre")));
 
tplIdentite += construireTxtListeOntologie(personne.getString("truk_telephone"));
 
// Courriel :Champ truk de la forme
// "Adresse@adr.com;; adr2@adr.fr ..."
LinkedList<String> listeCourriel = (LinkedList<String>) personne
.getChaineDenormaliseAsMapOrList("truk_courriel");
if ((listeCourriel != null) && (listeCourriel.size() > 0)) {
String strLabelCourriel = "Courriel";
if (listeCourriel.size() > 1) {
strLabelCourriel += "s";
}
 
String valeurCourriel = "";
Iterator<String> itCourriel = listeCourriel.iterator();
while (itCourriel.hasNext()) {
String valeurCourante = itCourriel.next();
valeurCourriel += "<br /><a href=\"mailto:"
+ valeurCourante + "\">" + valeurCourante + "</a>";
}
tplIdentite += valeurCourriel;
}
 
// Url Site Webs
LinkedList listeUrl = (LinkedList) personne
.getChaineDenormaliseAsMapOrList("truk_url");
if (listeUrl != null && listeUrl.size() > 0) {
 
tplIdentite += "<br /><br /><b>Sites web:</b><br /><span style='display:inline-block'>";
String strUrl = "";
Iterator<String> urlIt = listeUrl.iterator();
while (urlIt.hasNext()) {
String urlCourante = urlIt.next();
strUrl += "<a href=\"" + urlCourante + "\">" + urlCourante
+ "</a> <br/>";
}
tplIdentite += strUrl + "</span><br />";
}
 
tplIdentite += "</div>";
 
afficherOnglet(tplIdentite, tabIdentiteParams, tabIdentite);
 
String tabAdresseTpl = "<div class='{css_corps}'>"
+ " <div class='{css_fieldset}'>"
+ " <h2>Adresse personnelle:</h2>"
+ " <b>Adresse:</b> {adresse01} <br />"
+ " <b>Boite postale: </b>{boitePostale}<br />"
+ " <b>Code postal:</b>{codePostal} <br />"
+ " <b>Pays :</b><span style='uppercase'>{pays}</span><br />"
+ "</div>";
// Adresses :
Params paramAdresseTpl = new Params();
paramAdresseTpl.set("adresse01", (String) personne
.obtenirValeurChamp("adresse_01"));
paramAdresseTpl.set("boitePostale", (String) personne
.obtenirValeurChamp("bp"));
paramAdresseTpl.set("codePostal", (String) personne
.obtenirValeurChamp("code_postal"));
paramAdresseTpl.set("ville", (String) personne
.obtenirValeurChamp("ville"));
paramAdresseTpl.set("pays", construireTxtListeOntologie((String) personne
.obtenirValeurChamp("ce_truk_pays")));
 
afficherOnglet(tabAdresseTpl, paramAdresseTpl, tabAdresse);
tabAdresse.setStyleAttribute("padding", "15px");
 
// Infos naturalistes :Biographie, Spécialité (typé)
String tplInfosNat = "<div class='{css_corps}'>"
+ " <div class='{css_fieldset}'>" + " <h2>"
+ i18nC.personneBiographie() + "</h2>"
+ " {biographie}" + " "
+ "<h2>" + i18nC.personneSpecialite() + "</h2>"
+ " {specialites}" + " <h2>"
+ i18nC.personneRecolte() + "</h2>"
+ " {recoltes}" + " </div>" + "</div>";
Params prmInfosNat = new Params();
 
prmInfosNat.set("biographie", personne.get("biographie"));
String specialite = construireTxtTruck(personne.getSpecialite());
prmInfosNat.set("specialites", specialite);
 
String recolte = construireTxtListeOntologie(personne.getString("truk_recolte"));
prmInfosNat.set("recoltes", recolte);
 
afficherOnglet(tplInfosNat, prmInfosNat, tabInfosNat);
tabAdresse.setStyleAttribute("padding", "15px");
 
layout();
}
}
 
public String initialiserTplEntete() {
return "<div id='{css_id}'>" + "<h1>{nom}</h1>"
+ "<h2><a href='{mail}'>{mail}</a></h2>" + "</div>";
}
 
public String initialiserTplIdentite() {
return "<div class='{css_corps}'>" + " <div class='{css_fieldset}'>"
+ " <h2>Noms:</h2>" + " <span><b>"
+ i18nC.personneNomComplet()
+ ":</b></span> {nom_complet}<br />"
+ " <span><b>"
+ i18nC.personneNomAutre()
+ ":</b></span> {nom_autre}<br />"
+ " <span><b>"
+ i18nC.personneAbreviation()
+ ":</b></span> {abreviation}<br />"
+ " <span><b>"
+ i18nC.personneAbreviationAutre()
+ ":</b></b></span> {abreviation_autre}<br /><br />"
+ " <h2>Naissance:</h2>"
+ " <span><b>"
+ i18nC.personneDateNaissance()
+ ":</b></span> {naissance_date}<br />"
+ " <span><b>"
+ i18nC.personneLieuNaissance()
+ ":</b></span> {naissance_lieu}<br /><br />"
+ "{tplDeces}"
+ " </div>"
+ "</div>"
+ "<div class='{css_corps}'>"
+ " <div class='css_fieldset'> "
+ " <h2>Description:</h2>"
+ " {description}<br />" + " </div>" + "<br />";
}
private void initialiserTableauPublicationsLieesTpl() {
tableauPublicationsLieesTpl =
"<div class='{css_corps}'>" +
" <h2>{i18n_titre_publication}</h2>"+
" <table>"+
" <thead>"+
" <tr>" +
" <th>{i18n_relation}</th>" +
" <th>{i18n_auteur}</th>" +
" <th>{i18n_titre}</th>" +
" <th>{i18n_revue}</th>" +
" <th>{i18n_editeur}</th>" +
" <th>{i18n_annee}</th>" +
" <th>{i18n_nvt}</th>" +
" <th>{i18n_fascicule}</th>" +
" <th>{i18n_page}</th>" +
" </tr>"+
" </thead>"+
" <tbody>"+
" {lignes}"+
" </tbody>"+
"</table>";
}
private void initialiserLignePublicationLieeTpl() {
lignePublicationLieeTpl =
"<tr>"+
" <td>{relation}</td>"+
" <td>{auteur}</td>"+
" <td>{titre}</td>"+
" <td>{revue}</td>"+
" <td>{editeur}</td>"+
" <td>{annee}</td>"+
" <td>{nvt}</td>"+
" <td>{fascicule}</td>"+
" <td>{page}</td>"+
"</tr>";
}
/**
* @author greg
* Rempli l'onglet des publications liées
* @param listePublications la liste des publications
*/
private void afficherPublications(PublicationAPersonneListe listePublications) {
List<PublicationAPersonne> publicationsLiees = listePublications.toList();
Iterator<PublicationAPersonne> iterateur = publicationsLiees.iterator();
//Onglet Publications
initialiserTableauPublicationsLieesTpl();
Params paramsPublis = new Params();
String contenuLignes = "";
while (iterateur.hasNext()) {
initialiserLignePublicationLieeTpl();
PublicationAPersonne publicationAPersonneCourante = iterateur.next();
Publication publication = publicationAPersonneCourante.getPublicationLiee();
Params ligneParams = new Params();
ligneParams.set("relation", construireTxtListeOntologie(publicationAPersonneCourante.getRole()));
ligneParams.set("auteur", publication.getAuteur());
ligneParams.set("titre", publication.getTitre());
ligneParams.set("revue", publication.getCollection());
ligneParams.set("editeur", publication.getEditeur());
ligneParams.set("annee", publication.getAnneeParution());
ligneParams.set("nvt", publication.getIndicationNvt());
ligneParams.set("fascicule", publication.getFascicule());
ligneParams.set("page", publication.getPages());
contenuLignes += Format.substitute(lignePublicationLieeTpl, ligneParams);
}
paramsPublis.set("lignes", contenuLignes);
paramsPublis.set("i18n_titre_publication", i18nC.tabPublications());
paramsPublis.set("i18n_relation", i18nC.publicationAuteurs());
paramsPublis.set("i18n_auteur", i18nC.publicationAuteurs());
paramsPublis.set("i18n_titre", i18nC.publicationTitre());
paramsPublis.set("i18n_revue", i18nC.publicationRevueCollection());
paramsPublis.set("i18n_editeur", i18nC.publicationEditeur());
paramsPublis.set("i18n_annee", i18nC.publicationDateParution());
paramsPublis.set("i18n_nvt", i18nC.publicationNvt());
paramsPublis.set("i18n_fascicule", i18nC.publicationFascicule());
paramsPublis.set("i18n_page", i18nC.publicationPage());
afficherOnglet(tableauPublicationsLieesTpl, paramsPublis, tabPublications);
}
public void rafraichir(Object nouvellesDonnees) {
 
if (nouvellesDonnees instanceof ValeurListe) {
ajouterListeValeursAOntologie((ValeurListe) nouvellesDonnees);
} else if (nouvellesDonnees instanceof Personne) {
afficherDetailPersonne((Personne) nouvellesDonnees);
} else if (nouvellesDonnees instanceof PublicationAPersonneListe) {
afficherPublications((PublicationAPersonneListe) nouvellesDonnees);
layout();
}
}
 
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/personne/PersonneDetailVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/personne/PersonneDetailVue.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/personne/PersonneDetailVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/personne/PersonneForm.java
New file
0,0 → 1,1412
package org.tela_botanica.client.vues.personne;
 
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.ChampMultiValeurs;
import org.tela_botanica.client.composants.ChampMultiValeursImage;
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypes;
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypesPaginable;
import org.tela_botanica.client.composants.HashMapComposants;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
 
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.MenuApplicationId;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.personne.PersonneAsyncDao;
import org.tela_botanica.client.modeles.personne.PersonneListe;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
import org.tela_botanica.client.modeles.publication.PublicationListe;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.Pattern;
import org.tela_botanica.client.util.UtilDate;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.Formulaire;
 
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.Style.VerticalAlignment;
 
import com.extjs.gxt.ui.client.binding.FieldBinding;
import com.extjs.gxt.ui.client.binding.FormBinding;
 
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.KeyListener;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.event.WidgetListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.MessageBox;
 
import com.extjs.gxt.ui.client.widget.ContentPanel;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.Proxy;
import org.tela_botanica.client.composants.pagination.ProxyValeur;
 
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.Text;
 
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.form.Radio;
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.extjs.gxt.ui.client.widget.layout.TableData;
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.Callback;
import com.google.gwt.core.client.GWT;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.user.client.Window;
 
public class PersonneForm extends Formulaire implements Rafraichissable {
 
// VARIABLES
private TabItem tiIdentite, tiAdresses, tiInfosNat;
PersonneFormPublication tiPubli;
private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
protected Personne personneSelectionnee, personneSauvegarde = null;
//hmIdentite[...] référence par une chaine de caractère tous les composants de l'onglet Identite
private HashMapComposants hmIdentite = new HashMapComposants();
private HashMapComposants hmAdresse = new HashMapComposants();
private HashMapComposants hmInfosNat = new HashMapComposants();
private HashMap<String, Valeur> hmCbSelectionnee = new HashMap();
private FormData fd100 = new FormData("95%");
private Button enregistrer, enregistrerEtRevenir;
private Personne personne = null;
private String personneId = null;
private FormBinding binding = null;
//Gestion du mode synchrone
private Sequenceur sequenceur;
//Publi
private ComboBox<Publication> cbPubli;
private ListStore<Publication> storePubli;
// Gestion de la vérification des doublons
private boolean verificationDoublonEffectuee = false;
// CONSTRUCTEUR
public PersonneForm(Mediateur mediateurCourrant, String personneId) {
initialiserPersonneForm(mediateurCourrant, personneId);
}
public PersonneForm(Mediateur mediateurCourrant, String personneId, Rafraichissable vueARafraichirApresValidation) {
vueExterneARafraichirApresValidation = vueARafraichirApresValidation;
initialiserPersonneForm(mediateurCourrant, personneId);
}
private void initialiserPersonneForm(Mediateur mediateurCourrant, String personneIdCourrant) {
//Initialisation du séquenceur
sequenceur = new Sequenceur();
personne = new Personne();
personne.setId(personneIdCourrant);
personneId = personneIdCourrant;
String modeDeCreation = (UtilString.isEmpty(personneId) ? Formulaire.MODE_AJOUTER : Formulaire.MODE_MODIFIER);
initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.PERSONNE);
 
initialiserComposants();
genererTitreFormulaire();
mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonnePublication", sequenceur);
mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonnePublication", null);
if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
mediateur.selectionnerPersonne(this, personne.getId(), sequenceur);
}
}
private void genererTitreFormulaire() {
String titre = i18nC.personneModeAjout();
if (mode.equals(Formulaire.MODE_MODIFIER)) {
titre = i18nC.personneModeModifier()+" - "+i18nC.id()+": "+personneId;
}
panneauFormulaire.setHeadingHtml(titre);
}
public void initialiserComposants() {
personneSelectionnee = new Personne();
personneSauvegarde = new Personne();
initialiserOnglets();
creerComposantsIdentite();
creerComposantsAdresse();
creerComposantsInfosNat();
//creerComposantsPubli();
binderPersonne(personneSelectionnee);
}
/**
* Crée les onglets identité, adresse et informations naturaliste
*
* */
public void initialiserOnglets() {
//TabPanel
TabPanel formulaireOnglets = new TabPanel();
//Tab 1 : identite
tiIdentite = creerOnglet(i18nC.personneIdentite(), "tiIdentite");
tiIdentite.setStyleAttribute("padding", "0");
formulaireOnglets.add(tiIdentite);
//Tab 2 : Adresse
tiAdresses = creerOnglet(i18nC.adresse(), "tiAdresses");
formulaireOnglets.add(tiAdresses);
//Tab 3 : Infos Naturalistes
tiInfosNat = creerOnglet(i18nC.personneInfoNat(), "tiInfosNat");
formulaireOnglets.add(tiInfosNat);
//Tab 4 : Publications
tiPubli = new PersonneFormPublication(this);
formulaireOnglets.add(tiPubli);
getFormulaire().add(formulaireOnglets);
}
/**
* Crée les widgets pour l'onglet identité
*
* */
public void creerComposantsIdentite() {
// Gestion de l'affichage en colonnes : 3 Layout container : principal, gauche & droite
LayoutContainer left = new LayoutContainer();
left.setLayout(new FormLayout());
left.setStyleAttribute("padding", "15px");
LayoutContainer right = new LayoutContainer();
right.setLayout(new FormLayout());
right.setStyleAttribute("padding", "15px");
LayoutContainer main = new LayoutContainer();
main.add(left, new ColumnData(.45));
main.add(right, new ColumnData(.50));
main.setLayout(new ColumnLayout());
main.setHeight("100%");
main.setScrollMode(Scroll.AUTO);
// Création des champs
FormLayout formLayout = new FormLayout();
formLayout.setLabelAlign(LabelAlign.LEFT);
//+------------------------------------------------------------------------------------------------------------+
// Fieldset NOM
FieldSet fsNoms = new FieldSet();
fsNoms.setHeadingHtml("Noms");
fsNoms.setLayout(formLayout);
// Nom complet : Affiché que si valeurs saisies
LabelField nomComplet = new LabelField();
nomComplet.setFieldLabel(i18nC.personneNomComplet() +" :");
nomComplet.hide();
fsNoms.add(nomComplet);
hmIdentite.put("nomComplet", nomComplet);
//Préfixe
ListStore<Valeur> storePrefixe = new ListStore<Valeur>();
ComboBox<Valeur> cbPrefixe = new ComboBox<Valeur>();
cbPrefixe.setStore(storePrefixe);
cbPrefixe.setDisplayField("nom");
cbPrefixe.setEmptyText("Choisissez le préfixe:");
cbPrefixe.setFieldLabel("Prefix");
fsNoms.add(cbPrefixe);
hmIdentite.put("cbPrefixe", cbPrefixe);
mediateur.obtenirListeValeurEtRafraichir(this, "prefixe", sequenceur);
 
//Prénom
TextField<String> tfPrenom = new TextField<String>();
tfPrenom.setFieldLabel("Prénom");
tfPrenom.setName("prenom");
 
fsNoms.add(tfPrenom, new FormData(300, 0));
hmIdentite.put("tfPrenom", tfPrenom);
tfPrenom.addListener(Events.Blur, creerEcouteurNomPrenomExistant());
tfPrenom.addListener(Events.Change, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
verificationDoublonEffectuee = false;
}
});
 
//Nom
TextField<String> tfNom = new TextField<String>();
tfNom.setFieldLabel("Nom");
tfNom.setAllowBlank(false);
tfNom.setName("nom");
tfNom.addStyleName(ComposantClass.OBLIGATOIRE);
tfNom.addListener(Events.Valid, creerEcouteurChampObligatoire());
tfNom.addListener(Events.Blur, creerEcouteurNomPrenomExistant());
tfNom.addListener(Events.Change, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
verificationDoublonEffectuee = false;
}
});
fsNoms.add(tfNom, new FormData(300, 0));
hmIdentite.put("tfNom", tfNom);
//Suffixe
ListStore<Valeur> storeSuffixe = new ListStore<Valeur>();
ComboBox<Valeur> cbSuffixe = new ComboBox<Valeur>();
cbSuffixe.setStore(storeSuffixe);
cbSuffixe.setFieldLabel("Suffixe");
cbSuffixe.setDisplayField("nom");
cbSuffixe.setEmptyText("Choisissez un suffixe:");
fsNoms.add(cbSuffixe);
hmIdentite.put("cbSuffixe", cbSuffixe);
mediateur.obtenirListeValeurEtRafraichir(this, "suffixes", sequenceur);
 
TextField<String> tfAbreviation = new TextField<String>();
tfAbreviation.setFieldLabel("Abréviation");
tfAbreviation.setName("abreviation");
fsNoms.add(tfAbreviation);
hmIdentite.put("tfAbreviation", tfAbreviation);
 
TableLayout layoutAutreNoms = new TableLayout(2);
layoutAutreNoms.setCellVerticalAlign(VerticalAlignment.TOP);
LayoutContainer autresNoms = new LayoutContainer(layoutAutreNoms);
ChampMultiValeurs nomAutre = new ChampMultiValeurs("Autres noms",150);
hmIdentite.put("nomAutre", nomAutre);
autresNoms.add(nomAutre, new TableData("200px", "15px"));
ChampMultiValeurs abreviationAutre = new ChampMultiValeurs("Autres abréviation",150);
hmIdentite.put("abreviationAutre", abreviationAutre);
autresNoms.add(abreviationAutre, new TableData("200px", "15px"));
fsNoms.add(autresNoms);
left.add(fsNoms);
//+------------------------------------------------------------------------------------------------------------+
// Fieldset NAISSANCE ET DÉCÈS
FieldSet fsNaissanceEtDeces = new FieldSet();
fsNaissanceEtDeces.setHeadingHtml("Naissance et Décès");
fsNaissanceEtDeces.setLayout(new ColumnLayout());
formLayout = new FormLayout();
formLayout.setLabelAlign(LabelAlign.TOP);
LayoutContainer containerNaissance = new LayoutContainer(formLayout);
//Remplacement du DateField par un champ texte
TextField tfDateNaissance = new TextField();
tfDateNaissance.setFieldLabel("Date de naissance");
containerNaissance.add(tfDateNaissance);
hmIdentite.put("tfDateNaissance", tfDateNaissance);
// Lieu naissance
TextField<String> tfLieuNaissance = new TextField<String>();
tfLieuNaissance.setFieldLabel("Lieu de naissance");
tfLieuNaissance.setName("naissance_lieu");
containerNaissance.add(tfLieuNaissance);
hmIdentite.put("tfLieuNaissance", tfLieuNaissance);
fsNaissanceEtDeces.add(containerNaissance, new ColumnData(.5));
left.add(fsNaissanceEtDeces);
formLayout = new FormLayout();
formLayout.setLabelAlign(LabelAlign.TOP);
LayoutContainer containerDeces = new LayoutContainer(formLayout);
Radio rbEstDecedee = new Radio();
rbEstDecedee.setId("ce_deces");
rbEstDecedee.setBoxLabel("oui");
rbEstDecedee.setValueAttribute("1");
rbEstDecedee.setId("rbEstD");
rbEstDecedee.addListener(Events.Change, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
if(((Radio) be.getComponent()).getValue().equals(true)) {
hmIdentite.getTextField("tfDateDeces").setVisible(true);
hmIdentite.getTextField("tfLieuDeces").setVisible(true);
} else {
TextField tfDateDeces = hmIdentite.getTextField("tfDateDeces");
tfDateDeces.setValue(null);
tfDateDeces.setVisible(false);
TextField tfLieuDeces = hmIdentite.getTextField("tfLieuDeces");
tfLieuDeces.setValue(null);
tfLieuDeces.setVisible(false);
}
}
});
TextField tfDateDeces = new TextField();
tfDateDeces.setFieldLabel("Date de décès");
tfDateDeces.setVisible(false);
 
containerDeces.add(tfDateDeces);
hmIdentite.put("tfDateDeces", tfDateDeces);
 
TextField<String> tfLieuDeces = new TextField<String>();
tfLieuDeces.setFieldLabel("Lieu de décès");
tfLieuDeces.setName("deces_lieu");
tfLieuDeces.setVisible(false);
containerDeces.add(tfLieuDeces);
hmIdentite.put("tfLieuDeces", tfLieuDeces);
hmIdentite.put("rbEstDecedee", rbEstDecedee);
Radio rbNestPasDecedee = new Radio();
rbNestPasDecedee.setValueAttribute("0");
rbNestPasDecedee.setBoxLabel("non");
rbNestPasDecedee.setValue(true);
RadioGroup rbgDeces = new RadioGroup();
rbgDeces.setId("rbgDeces");
rbgDeces.setFieldLabel("Est décédée");
rbgDeces.add(rbEstDecedee);
rbgDeces.add(rbNestPasDecedee);
hmIdentite.put("rbgDeces", rbgDeces);
containerDeces.add(rbgDeces);
fsNaissanceEtDeces.add(containerDeces, new ColumnData(.5));
tiIdentite.add(main);
//+------------------------------------------------------------------------------------------------------------+
// Fieldset CONTACT
FieldSet fsContact = new FieldSet();
fsContact.setHeadingHtml("Contact");
fsContact.setWidth("95%");
fsContact.setLayout(new RowLayout());
ChampMultiValeursMultiTypes telephones = new ChampMultiValeursMultiTypes("Téléphones", 180, 100);
telephones.initialiserType("tel");
fsContact.add(telephones, new FormData(450, 0));
hmIdentite.put("telephones", telephones);
ChampMultiValeurs courriels = new ChampMultiValeurs("Courriels", 280);
courriels.setValidation(Pattern.email, "moi@domaine.fr");
fsContact.add(courriels, new FormData(450, 0));
hmIdentite.put("courriels", courriels);
LayoutContainer lcCourrielContainer = new LayoutContainer(new RowLayout());
fsContact.add(lcCourrielContainer);
hmIdentite.put("lcCourrielContainer", lcCourrielContainer);
 
fsContact.add(new Text(""));
ChampMultiValeurs sites = new ChampMultiValeurs("Sites web");
sites.setWidth("95%");
sites.setValeurParDefaut("http://");
sites.setValidation(Pattern.url, "http://www.monsite.com");
fsContact.add(sites);
hmIdentite.put("sites", sites);
right.add(fsContact);
//+------------------------------------------------------------------------------------------------------------+
// Fieldset AUTRES INFOS
FieldSet fsAutresInfos = new FieldSet();
fsAutresInfos.setHeadingHtml("Autres informations");
fsAutresInfos.setWidth("95%");
formLayout = new FormLayout();
formLayout.setLabelAlign(LabelAlign.LEFT);
fsAutresInfos.setLayout(formLayout);
formLayout = new FormLayout();
formLayout.setLabelAlign(LabelAlign.TOP);
LayoutContainer lcAutreInformations1 = new LayoutContainer(formLayout);
ListStore<Valeur> storeSexe = new ListStore<Valeur>();
ComboBox<Valeur> cbSexe = new ComboBox<Valeur>();
cbSexe.setStore(storeSexe);
cbSexe.setFieldLabel("Sexe");
cbSexe.setDisplayField("nom");
cbSexe.setEmptyText("Choisissez le sexe:");
cbSexe.setTypeAhead(true);
cbSexe.setTriggerAction(TriggerAction.ALL);
FormData fd = new FormData();
fd.setWidth(100);
lcAutreInformations1.add(cbSexe, fd);
hmIdentite.put("cbSexe", cbSexe);
mediateur.obtenirListeValeurEtRafraichir(this, "sexe", sequenceur);
//Description
final TextArea taDescription = new TextArea();
taDescription.setEmptyText("Saisissez une description");
taDescription.setFieldLabel("Description");
taDescription.setName("description");
lcAutreInformations1.add(taDescription, new FormData(300, 200));
hmIdentite.put("taDescription", taDescription);
fsAutresInfos.add(lcAutreInformations1);
// Logo
LayoutContainer lcLogoUrl = new LayoutContainer();
hmIdentite.put("lcLogoUrl", lcLogoUrl);
final ChampMultiValeursImage logo = new ChampMultiValeursImage(i18nC.personneLogos());
logo.setImageHeight("150px");
logo.setValeurParDefaut("http://");
logo.setValidation(Pattern.url, "http://www.monsite.com/mon_image.jpg");
logo.setValeurBoutonSupprimer("Supprimer");
logo.setWidth("95%");
hmIdentite.put("logos", logo);
lcLogoUrl.add(logo);
fsAutresInfos.add(logo);
LayoutContainer lcAutreInformations2 = new LayoutContainer(new ColumnLayout());
hmIdentite.put("lcAutreInformations2", lcAutreInformations2);
fsAutresInfos.add(lcAutreInformations2);
right.add(fsAutresInfos);
//+------------------------------------------------------------------------------------------------------------+
// Ajout des évènements saisi
KeyListener klNoms = new KeyListener() {
public void componentKeyUp(ComponentEvent ev) {
rafraichir(null);
}
};
SelectionChangedListener<Valeur> selectionChange = new SelectionChangedListener<Valeur>() {
public void selectionChanged(SelectionChangedEvent se) {
rafraichir(null);
}
};
cbPrefixe.addSelectionChangedListener(selectionChange);
cbPrefixe.addKeyListener(klNoms);
tfPrenom.addKeyListener(klNoms);
tfNom.addKeyListener(klNoms);
cbSuffixe.addSelectionChangedListener(selectionChange);
}
public void creerComposantsAdresse() {
// Gauche
LayoutContainer left = new LayoutContainer();
left.setLayout(new FormLayout());
left.setStyleAttribute("padding", "15px");
// Droite
LayoutContainer right = new LayoutContainer();
right.setLayout(new FormLayout());
// Principal
LayoutContainer main = new LayoutContainer();
main.setLayout(new TableLayout(2));
// Ajout au principal
main.add(left);
main.add(right);
TextField<String> tfAdresse1 = new TextField();
tfAdresse1.setFieldLabel("Adresse");
tfAdresse1.setName("adresse_01");
left.add(tfAdresse1, fd100);
hmAdresse.put("tfAdresse1", tfAdresse1);
ComboBox<Valeur> cbPays = new ComboBox<Valeur>();
cbPays.setFieldLabel("Pays");
cbPays.setDisplayField("nom");
cbPays.setEmptyText("Sélectionnez le pays:");
ListStore<Valeur> storePays = new ListStore<Valeur>();
cbPays.setStore(storePays);
right.add(cbPays, fd100);
hmAdresse.put("cbPays", cbPays);
TextField<String> tfBoitePostale = new TextField<String>();
tfBoitePostale.setFieldLabel("Boite postale");
tfBoitePostale.setName("bp");
left.add(tfBoitePostale, fd100);
hmAdresse.put("tfBoitePostale", tfBoitePostale);
TextField<Integer> tfCodePostal = new TextField<Integer>();
tfCodePostal.setFieldLabel("Code postal");
tfCodePostal.setName("code_postal");
right.add(tfCodePostal, fd100);
hmAdresse.put("tfCodePostal", tfCodePostal);
TextField tfVille = new TextField();
tfVille.setFieldLabel("Ville");
tfVille.setName("ville");
right.add(tfVille, fd100);
hmAdresse.put("tfVille", tfVille);
// MAJ ComboBox
mediateur.obtenirListeValeurEtRafraichir(this, "pays", sequenceur);
FieldSet fsAdresse = new FieldSet();
fsAdresse.setHeadingHtml("Adresse personnelle");
fsAdresse.add(main);
tiAdresses.add(fsAdresse);
}
public void creerComposantsInfosNat() {
FormLayout fl = new FormLayout();
fl.setLabelAlign(LabelAlign.TOP);
FieldSet fsInfosNat = new FieldSet();
fsInfosNat.setLayout(fl);
fsInfosNat.setTitle("Informations Naturaliste");
 
TextArea taBiographie = new TextArea();
taBiographie.setFieldLabel("Vie et renommée de l'auteur");
taBiographie.setWidth("400");
taBiographie.setName("biographie");
fsInfosNat.add(taBiographie, new FormData(800, 200));
 
ChampMultiValeurs specialite = new ChampMultiValeurs(i18nC.personneSpecialite());
fsInfosNat.add(specialite);
hmInfosNat.put("specialite", specialite);
 
ModelType typeTypes = new ModelType();
typeTypes.setRoot("valeurs");
typeTypes.setTotalName("nbElements");
typeTypes.addField("cmlv_nom");
typeTypes.addField("cmlv_id_valeur");
typeTypes.addField("cmlv_abreviation");
typeTypes.addField("cmlv_description");
String displayNameTypes = "cmlv_nom";
String nomListeTypes = "pays";
ProxyValeur<ModelData> proxyTypes = new ProxyValeur<ModelData>(nomListeTypes, null);
ChampMultiValeursMultiTypesPaginable recolte = new ChampMultiValeursMultiTypesPaginable(i18nC.personneRecolte(), 450, false, null, null, null, typeTypes, proxyTypes, displayNameTypes);
hmInfosNat.put("recolte", recolte);
fsInfosNat.add(recolte);
tiInfosNat.add(fsInfosNat);
}
public void creerComposantsPubli(){
//Création des composants de l'onglet publication
 
ContentPanel cp = new ContentPanel();
cp.setHeadingHtml("Publications dont la personne est le sujet");
cp.setIcon(Images.ICONES.table());
cp.setLayout(new FitLayout());
cp.setFrame(true);
ToolBar toolBar = new ToolBar();
 
Button ajouterPubli = new Button("Ajouter");
ajouterPubli.setIcon(Images.ICONES.vcardAjouter());
ajouterPubli.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
/*StructureAPersonne membreDuPersonnel = new StructureAPersonne("", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
ajouterMembreAGrillePersonnel(membreDuPersonnel);*/
}
});
toolBar.add(ajouterPubli);
toolBar.add(new SeparatorToolItem());
Button supprimerPubli = new Button("Supprimer");
supprimerPubli.setIcon(Images.ICONES.vcardSupprimer());
supprimerPubli.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
/*StructureAPersonne personne = grillePersonnel.getSelectionModel().getSelectedItem();
if (personne != null) {
// Ajout de la personne supprimée à la liste
if (personne.getIdPersonne() != null && !personne.getIdPersonne().equals("")) {
personnelSupprime.put(personne.getId(), personne);
}
// Suppression de l'enregistrement de la grille
grillePersonnel.getStore().remove(personne);
// Désactivation du bouton supprimer si la grille contient plus d'élément
if (grillePersonnel.getStore().getCount() == 0) {
//TODO : check : Item -> component
ce.getComponent().disable();
}
}*/
Window.alert("supprimer");
}
});
toolBar.add(supprimerPubli);
toolBar.add(new SeparatorToolItem());
Button rafraichirPersonnelBtn = new Button("Rafraichir");
rafraichirPersonnelBtn.setIcon(Images.ICONES.rafraichir());
rafraichirPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
//rafraichirPersonnel();
Window.alert("rafraichir");
}
});
toolBar.add(rafraichirPersonnelBtn);
//Ajout d'une ComboBox
storePubli = new ListStore<Publication>();
storePubli.add(new ArrayList<Publication>());
cbPubli = new ComboBox<Publication>();
cbPubli.setWidth(200);
cbPubli.setEmptyText("Chercher une publication existante...");
cbPubli.setTriggerAction(TriggerAction.ALL);
cbPubli.setEditable(true);
cbPubli.setDisplayField("fmt_nom_complet");
cbPubli.setStore(storePubli);
cbPubli.addKeyListener(new KeyListener() {
public void componentKeyUp(ComponentEvent ce) {
if (!ce.isNavKeyPress() && cbPubli.getRawValue() != null && cbPubli.getRawValue().length() > 0) {
rafraichirPublicationsExistante(cbPubli.getRawValue());
}
}
});
toolBar.add(cbPubli);
toolBar.add(new SeparatorToolItem());
cp.setTopComponent(toolBar);
tiPubli.add(cp);
}
 
public void rafraichirPublicationsExistante(String nomPubli) {
nomPubli +="%";
mediateur.selectionnerPublicationParNomComplet(this, nomPubli);
}
/**
* Ajouter le bouton annuler à la barre d'outils donnée
*
* @param barreOutils la barre d'outils à modifier
* */
public static void ajouterBoutonAnnuler(ButtonBar barreOutils) {
// Le bouton annuler ne sauvegarde pas les informations et renvoie vers la page précédente
Button annuler = new Button("Revenir à la liste");
annuler.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
((Mediateur) Registry.get(RegistreId.MEDIATEUR)).clicMenu("Personnes");
}
});
annuler.setIconStyle(ComposantClass.ICONE_SUPPRIMER);
barreOutils.add(annuler);
}
// RAFRAICHISSEMENT DU PANNEAU
 
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof PublicationAPersonneListe) {
Information info = new Information();
info.setType("publication_liees");
info.setDonnee(0, (PublicationAPersonneListe) nouvellesDonnees);
tiPubli.rafraichir(info);
} else if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
// Créer une liste de valeurs
List<Valeur> liste = new ArrayList<Valeur>();
for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
liste.add(listeValeurs.get(it.next()));
}
if (listeValeurs.getId().equals(config.getListeId("relationPersonnePublication"))) {
tiPubli.rafraichir(nouvellesDonnees);
} else if (listeValeurs.getId().equals(config.getListeId("prefixe"))) {
remplirCombobox("cbPrefixe", liste, "hmIdentite");
} else if (listeValeurs.getId().equals(config.getListeId("suffixes"))) {
remplirCombobox("cbSuffixe", liste, "hmIdentite");
} else if (listeValeurs.getId().equals(config.getListeId("sexe"))) {
//Ajout de la valeur "Inconnu"
ComboBox<Valeur> cbSexe = hmAdresse.getComboBoxValeur("cbSexe");
Valeur inconnu = new Valeur();
inconnu.set("nom", "Inconnu");
inconnu.set("id", "0");
liste.add(0, inconnu);
remplirCombobox("cbSexe", liste, "hmIdentite");
/*List<Valeur> selection = new LinkedList<Valeur>();
selection.add(inconnu);
cbSexe.setSelection(s);*/
} else if (listeValeurs.getId().equals(config.getListeId("tel"))) {
remplirCombobox("cbTelephone", liste, "hmIdentite");
 
//Préselection du tél
ComboBox<Valeur> cbTelephone = hmIdentite.getComboBoxValeur("cbTelephone");
cbTelephone.setValue(liste.get(1));
} else if (listeValeurs.getId().equals(config.getListeId("pays"))) {
remplirCombobox("cbPays", liste, "hmAdresse");
}
} else if (nouvellesDonnees instanceof PublicationListe) {
PublicationListe publicationListe = (PublicationListe) nouvellesDonnees;
List<Publication> liste = publicationListe.toList();
storePubli.removeAll();
storePubli.add(liste);
cbPubli.setStore(storePubli);
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("ajout_personne")) {
if (info.getDonnee(0) != null) {
personneSelectionnee.setId(info.getDonnee(0).toString());
GWT.log("Ajout de la personne " + personneSelectionnee.getId(), null);
this.personne = personneSelectionnee;
this.personneId = personneSelectionnee.getId();
InfoLogger.display("Enregistrement", "La personne a été ajoutée (id: " + personneSelectionnee.getId() + ")");
repandreRafraichissement();
if (clicBoutonvalidation) {
mediateur.clicMenu(menuIdCourant);
} else {
this.mode = MODE_MODIFIER;
}
} else {
InfoLogger.display("Enregistrement", info.getMessages().toString());
}
} else if (info.getType().equals("modification_personne")) {
InfoLogger.display("Enregistrement", "Les modifications apportées à la personne " + personneSelectionnee.getId() + " ont été correctement enregistrées.");
repandreRafraichissement();
controlerFermeture();
} else if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if (info.getDonnee(0) instanceof PersonneListe) {
Collection colPersonneListe = ((PersonneListe) info.getDonnee(0)).values();
Iterator itPersonneListe = colPersonneListe.iterator();
Personne personne = (Personne) itPersonneListe.next();
//TODO : Je vois pas l'intérêt des lignes ci dessous..
personneSauvegarde = new Personne();
personneSauvegarde = (Personne) personne.cloner(personneSauvegarde);
binderPersonne(personne);
mettreAJourPersonne(personne);
this.personne = personne;
this.personneId = personne.getId();
tiPubli.rafraichirInformation(new Information("personne"));
nouvellesDonnees = null;
} else {
InfoLogger.display("messages", info.getMessages().toString());
}
}
if (nouvellesDonnees == null) {
ComboBox<Valeur> cb= hmIdentite.getComboBoxValeur("cbPrefixe");
//Met à jour le nom Complet du formulaire
String valeurRetour = "";
// Prefixe
String prefixe = "";
Valeur valPrefixe = cb.getValue();
if (valPrefixe != null) {
prefixe = valPrefixe.getNom();
} else {
prefixe = (String) cb.getRawValue();
}
// Prénom
String prenom = (String) hmIdentite.getTextField("tfPrenom").getValue();
// Nom
String nom = (String) hmIdentite.getTextField("tfNom").getValue();
// Suffixe
ComboBox<Valeur> cbSuffixe = hmIdentite.getComboBoxValeur("cbSuffixe");
String suffixe = "";
Valeur valSuffixe = cbSuffixe.getValue();
if (valSuffixe != null) {
suffixe = valSuffixe.getNom();
} else {
suffixe = (String) cbSuffixe.getRawValue();
}
// Mettre à jour la valeur
valeurRetour = prefixe + " " + prenom + " " + nom + " " + suffixe;
valeurRetour = valeurRetour.replaceAll("null", "");
hmIdentite.getLabelField("nomComplet").setValue(valeurRetour);
if (!valeurRetour.trim().equals("")) {
hmIdentite.getLabelField("nomComplet").show();
} else {
hmIdentite.getLabelField("nomComplet").hide();
}
}
mediateur.masquerPopinChargement();
if (this.mode.equals(MODE_AJOUTER)) {
gererEtatActivationBouton();
}
}
 
private void repandreRafraichissement() {
if (vueExterneARafraichirApresValidation != null) {
String type = "personne_modifiee";
if (mode.equals(Formulaire.MODE_AJOUTER)) {
type = "personne_ajoutee";
}
Information info = new Information(type);
info.setDonnee(0, personneSelectionnee);
vueExterneARafraichirApresValidation.rafraichir(info);
}
}
private void mettreAJourPersonne(Personne personne) {
//Mise à jour de la personne
//Prefixe
String prefixe = personne.get("ce_truk_prefix");
ComboBox<Valeur> cbPrefixe = hmIdentite.getComboBoxValeur("cbPrefixe");
String prefixeCourant = personne.get("ce_truk_prefix");
if (cbPrefixe.getStore().findModel("id_valeur", prefixeCourant) != null) {
cbPrefixe.setValue(cbPrefixe.getStore().findModel("id_valeur", prefixeCourant));
} else {
cbPrefixe.setRawValue(prefixeCourant);
}
hmIdentite.getTextField("tfPrenom").setValue(personne.get("prenom"));
hmIdentite.getTextField("tfNom").setValue(personne.get("nom"));
//Suffixe
String suffixe = personne.get("ce_truk_suffixe");
ComboBox<Valeur> cbSuffixe = hmIdentite.getComboBoxValeur("cbSuffixe");
String suffixeCourant = personne.get("ce_truk_suffix");
if (cbSuffixe.getStore().findModel("id_valeur", suffixeCourant) != null) {
cbSuffixe.setValue(cbSuffixe.getStore().findModel("id_valeur", suffixeCourant));
} else {
cbSuffixe.setRawValue(suffixeCourant);
}
hmIdentite.getChampMultiValeurs("nomAutre").peupler(personne.getString("truk_nom_autre"));
hmIdentite.getTextField("tfAbreviation").setValue(personne.get("abreviation"));
hmIdentite.getChampMultiValeurs("abreviationAutre").peupler(personne.getString("truk_abreviation_autre"));
hmIdentite.getTextField("tfDateNaissance").setValue(personne.getAnneeOuDateNaiss());
hmIdentite.getTextField("tfLieuNaissance").setValue(personne.get("naissance_lieu"));
if (personne.estDecedee()) {
hmIdentite.getTextField("tfDateDeces").setValue(personne.getAnneeOuDateDeces());
hmIdentite.getTextField("tfLieuDeces").setValue(personne.get("deces_lieu"));
Radio rbEstDecede = hmIdentite.getRadio("rbEstDecedee");
rbEstDecede.setValue(true);
}
hmIdentite.getChampMultiValeurs("telephones").peupler(personne.getString("truk_telephone"));
//Courriel
hmIdentite.getChampMultiValeurs("courriels").peupler(personne.getCourriel());
//Sites web
hmIdentite.getChampMultiValeurs("sites").peupler(personne.getString("truk_url"));
// Sexe
String strSexe = personne.get("ce_sexe");
ComboBox<Valeur> cbSexe = hmIdentite.getComboBoxValeur("cbSexe");
 
if (cbSexe.getStore().findModel("id_valeur", strSexe) != null) {
cbSexe.setValue(cbSexe.getStore().findModel("id_valeur", strSexe));
}
hmIdentite.getTextArea("taDescription").setRawValue((String) personne.get("description"));
//Logo
hmIdentite.getChampMultiValeurs("logos").peupler(personne.getString("truk_logo"));
/*--------------------------------------------------
Adresse
---------------------------------------------------*/
// Adresse
hmAdresse.getTextField("tfAdresse1").setValue((String) personne.get("adresse_01"));
//Boite postale
hmAdresse.getTextField("tfBoitePostale").setValue((String) personne.get("bp"));
//Pays
String strPays = personne.get("ce_truk_pays");
ComboBox<Valeur> cbPays = hmAdresse.getComboBoxValeur("cbPays");
cbPays.getStore().sort("nom", SortDir.ASC);
if (cbPays.getStore().findModel("id_valeur", strPays) != null) {
cbPays.setValue(cbPays.getStore().findModel("id_valeur", strPays));
cbPays.fireEvent(Events.OnChange);
} else {
cbPays.setRawValue(strPays);
}
//Cp
hmAdresse.getTextField("tfCodePostal").setValue(personne.get("code_postal"));
//Ville
hmAdresse.getTextField("tfVille").setValue(personne.get("ville"));
/*--------------------------------------------------------
* Infos naturalistes
* -----------------------------------------------------*/
hmInfosNat.getChampMultiValeurs("specialite").peupler(personne.getString("ce_truk_specialite"));
String tr = personne.getString("truk_recolte");
hmInfosNat.getChampMultiValeursMultiTypesPaginable("recolte").peupler(tr);
//Onglet publi
tiPubli.mettreAJourPersonne();
gererEtatActivationBouton();
}
public void remplirCombobox(String idComboBox, List liste, String hashMapId) {
HashMap hm = null;
if (hashMapId.equals("hmIdentite")) {
hm = hmIdentite;
} else if (hashMapId.equals("hmAdresse")){
hm = hmAdresse;
} else {
hm = hmInfosNat;
}
ListStore<Valeur> store = ((ComboBox) hm.get(idComboBox)).getStore();
store.removeAll();
store.add(liste);
((ComboBox) hm.get(idComboBox)).setStore(store);
}
private void gererEtatActivationBouton() {
/* if (((Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT)).isIdentifie() == false) {
enregistrer.setEnabled(false);
enregistrerEtRevenir.setEnabled(false);
} else {
enregistrer.setEnabled(true);
enregistrerEtRevenir.setEnabled(true);
}*/
}
public void binderPersonne(Personne personne) {
binding = new FormBinding(getFormulaire());
personneSelectionnee = personne;
FieldBinding f = new FieldBinding((RadioGroup) hmIdentite.get("rbgDeces"), null);
binding.autoBind();
binding.removeFieldBinding(f);
binding.bind(personneSelectionnee);
layout();
}
 
private String obtenirValeurCombo(String strComboName) {
String strValeur = "";
Valeur valeur;
ComboBox<Valeur> combo = hmIdentite.getComboBoxValeur(strComboName);
if (combo == null) {
combo = hmAdresse.getComboBoxValeur(strComboName);
}
strValeur = combo.getRawValue();
valeur = combo.getValue();
if (valeur != null) {
strValeur = valeur.getId();
}
return strValeur;
}
 
public boolean soumettreFormulaire() {
tiPubli.collecter();
if (verifierFormulaire()) {
tiPubli.soumettre();
mediateur.enregistrerPersonne(this, personneSelectionnee);
return true;
}
else return false;
}
 
public boolean verifierFormulaire() {
boolean success = true;
LinkedList<String> lstMessageErreur = new LinkedList<String>();
String strTfNom = (String) hmIdentite.getTextField("tfNom").getValue();
if ((strTfNom == null)||(strTfNom.trim().equals(""))) {
lstMessageErreur.add("Le nom n'a pas été saisi");
} else {
strTfNom = UtilString.ucFirst(strTfNom);
personneSelectionnee.set("nom", strTfNom);
}
String strTfPrenom = (String) hmIdentite.getTextField("tfPrenom").getValue();
personneSelectionnee.set("prenom", UtilString.ucFirst(strTfPrenom));
//Préparer les données
ComboBox<Valeur> combo = hmIdentite.getComboBoxValeur("cbSexe");
Valeur valeur;
String strValeur = "";
valeur = combo.getValue();
if (valeur!=null) {
personneSelectionnee.set("ce_sexe", valeur.getId());
}
strValeur = obtenirValeurCombo("cbPrefixe");
personneSelectionnee.set("ce_truk_prefix", strValeur);
strValeur = obtenirValeurCombo("cbSuffixe");
personneSelectionnee.set("ce_truk_suffix", strValeur);
String nomAutre = hmIdentite.getChampMultiValeurs("nomAutre").getValeurs();
personneSelectionnee.set("truk_nom_autre", nomAutre);
String abreviationAutre = hmIdentite.getChampMultiValeurs("abreviationAutre").getValeurs();
personneSelectionnee.set("truk_abreviation_autre", abreviationAutre);
personneSelectionnee.set("truk_courriel", hmIdentite.getChampMultiValeurs("courriels").getValeurs());
//Pour le nom complet, on enregistre dans la bdd la valeur du prefixe/suffixe et non l'id
String strPrefixe = "";
combo = hmIdentite.getComboBoxValeur("cbPrefixe");
valeur = combo.getValue();
if (valeur != null) {
strPrefixe = valeur.getNom();
} else {
strPrefixe = combo.getRawValue();
}
String strSuffixe = "";
combo = hmIdentite.getComboBox("cbSuffixe");
valeur = combo.getValue();
if (valeur != null) {
strSuffixe = valeur.getNom() + " ";
} else {
strSuffixe = combo.getRawValue() +" ";
}
personneSelectionnee.setFmtNomComplet(strPrefixe, strSuffixe);
 
/** NAISSANCE **/
String valeurDateNaissance = (String) hmIdentite.getTextField("tfDateNaissance").getValue();
traiterDate("naissance", valeurDateNaissance, personneSelectionnee, lstMessageErreur);
/** DECES **/
Radio rbEstDecedee = hmIdentite.getRadio("rbEstDecedee");
if (rbEstDecedee.getValue() == true) {
// date
String valeurDateDeces = (String) hmIdentite.getTextField("tfDateDeces").getValue();
traiterDate("décès", valeurDateDeces, personneSelectionnee, lstMessageErreur);
// lieu
String decesLieu = (String) hmIdentite.getTextField("tfLieuDeces").getValue();
personneSelectionnee.setDecesLieu(decesLieu);
} else {
personneSelectionnee.setNonDecedee();
}
strValeur = obtenirValeurCombo("cbPays");
personneSelectionnee.set("ce_truk_pays", strValeur);
success = hmIdentite.getChampMultiValeursMultiTypes("telephones").estValide(true);
personneSelectionnee.set("truk_telephone", hmIdentite.getChampMultiValeursMultiTypes("telephones").getValeurs());
String logoUrls = hmIdentite.getChampMultiValeursImage("logos").getValeurs();
personneSelectionnee.set("truk_logo", logoUrls);
personneSelectionnee.set("truk_url", hmIdentite.getChampMultiValeurs("sites").getValeurs());
//Infos Naturalistes
String recolte = ((ChampMultiValeursMultiTypesPaginable) hmInfosNat.get("recolte")).getValeurs();
personneSelectionnee.set("truk_recolte", recolte);
String specialite = ((ChampMultiValeurs) hmInfosNat.get("specialite")).getValeurs();
personneSelectionnee.set("ce_truk_specialite", specialite);
lstMessageErreur.addAll(tiPubli.verifier());
if (lstMessageErreur.size() != 0) {
String strMessagesErreur = "<span><br />";
Iterator<String> itMessagesErreur = lstMessageErreur.iterator();
while (itMessagesErreur.hasNext()) {
strMessagesErreur += "<br /> - " + itMessagesErreur.next();
}
strMessagesErreur += "</span>";
MessageBox.alert("Erreurs", "Les erreurs suivantes ont été commises : \n" + strMessagesErreur, null);
success = false;
}
return success;
}
private void traiterDate(String typeDate, String date, Personne personneSelectionnee, LinkedList<String> lstMessageErreur) {
String valeurDate = date;
if (!UtilString.isEmpty(valeurDate)){
String jour = "";
String mois = "";
String annee = "";
String dateComplete = "";
String messageErreur = null;
/** JJ/MM/AAAA **/
if (valeurDate.matches("\\d{2}/\\d{2}/\\d{4}")) {
jour = valeurDate.substring(0,2);
mois = valeurDate.substring(3,5);
annee = valeurDate.substring(6,10);
if (jour.equals("00") || mois.equals("00") || annee.equals("0000")) {
messageErreur = "La date de "+typeDate+" n'est pas au format JJ/MM/AAAA ou MM/AAAA ou AAAA.";
} else {
dateComplete = annee+"-"+mois+"-"+jour;
}
/** MM/AAAA **/
} else if (valeurDate.matches("\\d{2}/\\d{4}")) {
jour = "00";
mois = valeurDate.substring(0,2);
annee = valeurDate.substring(3,7);
if (mois.equals("00") || annee.equals("0000")) {
messageErreur = "La date de "+typeDate+" n'est pas au format JJ/MM/AAAA ou MM/AAAA ou AAAA.";
} else {
dateComplete = annee+"-"+mois+"-"+jour;
}
}
/** AAAA **/
else if (valeurDate.matches("\\d{4}")) {
if (valeurDate.equals("0000")) {
messageErreur = "La date de "+typeDate+" n'est pas au format JJ/MM/AAAA ou MM/AAAA ou AAAA.";
}
else {
dateComplete = valeurDate + "-00-00";
}
}
else {
lstMessageErreur.add("La date de "+typeDate+" n'est pas au format JJ/MM/AAAA ou MM/AAAA ou AAAA.");
}
if (messageErreur == null) {
if (typeDate=="naissance") personneSelectionnee.set("naissance_date", dateComplete);
else if (typeDate=="décès") {
personneSelectionnee.set("deces_date", dateComplete);
personneSelectionnee.set("ce_deces", personneSelectionnee.ETRE_DECEDE);
}
} else {
lstMessageErreur.add(messageErreur);
}
if(typeDate.equals("décès")) {
String valeurDateDeces = hmIdentite.getTextField("tfDateDeces").getRawValue();
String valeurDateNaissance = hmIdentite.getTextField("tfDateNaissance").getRawValue();
if(valeurDateDeces != null && valeurDateNaissance != null &&
!valeurDateDeces.isEmpty() && !valeurDateNaissance.isEmpty()) {
Date dateNaissance = parserDate(valeurDateNaissance);
Date dateDeces = parserDate(valeurDateDeces);
if(dateDeces.compareTo(dateNaissance) < 0) {
lstMessageErreur.add("La date de décès ne peut pas précéder la date de naissance");
}
}
}
/** Date vide **/
} else {
if (typeDate=="naissance") {
personneSelectionnee.setNaissanceDate(null);
} else if (typeDate=="décès") {
personneSelectionnee.setDecesDate(null);
personneSelectionnee.set("ce_deces", personneSelectionnee.ETRE_DECEDE);
}
}
}
private Date parserDate(String valeurDate) {
Date dateParsee = new Date();
String[] composantsDate = valeurDate.split("/");
// Attention : la fonction setYear ajoute 1900 à l'année
int annee = Integer.parseInt(composantsDate[(composantsDate.length-1)]) - 1900;
// Attention : les mois commencent à 0, donc janvier = 0, février = 1
int mois = (composantsDate.length > 1) ? Integer.parseInt(composantsDate[(composantsDate.length-2)]) - 1 : 0;
int jour = (composantsDate.length > 2) ? Integer.parseInt(composantsDate[0]) : 1;
dateParsee.setYear(annee);
dateParsee.setMonth(mois);
dateParsee.setDate(jour);
return dateParsee;
}
public Personne getPersonne() {
return this.personne;
}
public String getPersonneId() {
return this.personneId;
}
private Listener<BaseEvent> creerEcouteurNomPrenomExistant() {
return new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
if(mode.equals(MODE_AJOUTER) && !verificationDoublonEffectuee) {
TextField<String> nom = (TextField<String>) hmIdentite.get("tfNom");
TextField<String> prenom = (TextField<String>) hmIdentite.get("tfPrenom");
LabelField nomComplet = (LabelField) hmIdentite.get("nomComplet");
if(nom.getValue() != null && !nom.getValue().isEmpty()) {
PersonneAsyncDao dao = new PersonneAsyncDao(PersonneForm.this);
// Suppression d'éventuels doubles espaces (ou plus) et ajout d'un joker devant
// (pour gérer la recherche lorsqu'on a qu'un nom de famille)
String nomCompletStr = "%"+nomComplet.getValue().toString().trim().replaceAll(" +", " ");
if(prenom.getValue() != null && !prenom.getValue().isEmpty()) {
// Ajouter un % derrière le prénom permet de gérer facilement le cas de l'initiale
// et également de rechercher des noms potentiels si l'on a saisi qu'une initiale
nomCompletStr = nomCompletStr.replaceAll(prenom+" ", prenom+"%");
}
dao.testerExistencePersonne(nomCompletStr, new Callback<JSONObject, String>() {
@Override
public void onSuccess(JSONObject objet) {
String message = formaterMessageAvertissementDoublon(objet);
verificationDoublonEffectuee = true;
if(!message.isEmpty()) {
Window.alert(message);
}
}
@Override
public void onFailure(String reason) {
// TODO Auto-generated method stub
}
});
}
}
}
};
}
private String formaterMessageAvertissementDoublon(JSONObject objet) {
double nbPers = objet.get("nbElements").isNumber().getValue();
JSONArray personnes = objet.isObject().get("personnes").isArray();
String message = "";
if(nbPers > 0) {
String pers = nbPers == 1 ? "personne" : "personnes";
String exist = nbPers == 1 ? "existe" : "existent";
message = "Attention : "+(int)nbPers+" "+pers+" portant ce nom "+exist+" déjà"+"\n";
for(int i = 0; i < personnes.size(); i++) {
message += "- "+personnes.get(i).isObject().get("cp_fmt_nom_complet").isString().stringValue();
if(personnes.get(i).isObject().get("cp_ville") != null && personnes.get(i).isObject().get("cp_ville").isString() != null) {
message += " à "+personnes.get(i).isObject().get("cp_ville").isString().stringValue();
}
if(personnes.get(i).isObject().get("cp_naissance_date") != null
&& personnes.get(i).isObject().get("cp_naissance_date").isString()!= null
&& !personnes.get(i).isObject().get("cp_naissance_date").isString().stringValue().equals("0000-00-00")) {
String dateChaine = personnes.get(i).isObject().get("cp_naissance_date").isString().stringValue();
String dateNaissance = "";
// Quelque fois on ne possède que l'année de naissance de la personne,
// dans ce cas là la date est de la forme XXXX-00-00
if(dateChaine.endsWith("-00-00")) {
dateNaissance = dateChaine.substring(0, 4);
} else {
dateNaissance = UtilDate.formaterEnStringFormatFr(UtilString.formaterEnDate(dateChaine));
}
 
message += ", date de naissance : "+dateNaissance;
}
message += "\n";
}
}
return message;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/personne/PersonneForm.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/personne/PersonneForm.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/personne/PersonneForm.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/collection/CollectionForm.java
New file
0,0 → 1,418
package org.tela_botanica.client.vues.collection;
 
import java.util.ArrayList;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.MenuApplicationId;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilArray;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.structure.StructureForm;
 
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.google.gwt.user.client.Window;
 
public class CollectionForm extends Formulaire implements Rafraichissable {
 
protected Collection collection = null;
protected Collection collectionCollectee = null;
 
private ChampComboBoxListeValeurs typesCollectionCombo = null;
private TabPanel onglets = null;
private CollectionFormGeneral generalOnglet = null;
private CollectionFormPersonne personneOnglet = null;
private CollectionFormPublication publicationOnglet = null;
private CollectionFormDescription descriptionOnglet = null;
private CollectionFormContenu contenuOnglet = null;
private CollectionFormInventaire inventaireOnglet = null;
private CollectionFormCommentaire commentaireOnglet = null;
private TextField<String> nomChp = null;
private Sequenceur sequenceur = new Sequenceur();
public CollectionForm(Mediateur mediateurCourrant, String collectionId) {
initialiserCollectionForm(mediateurCourrant, collectionId);
}
private void initialiserCollectionForm(Mediateur mediateurCourrant, String collectionId) {
collection = new Collection();
collection.setId(collectionId);
String modeDeCreation = (UtilString.isEmpty(collection.getId()) ? Formulaire.MODE_AJOUTER : Formulaire.MODE_MODIFIER);
initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.COLLECTION);
genererTitreFormulaire();
creerOnglets();
creerFieldsetPrincipal();
if (modeDeCreation.equals(Formulaire.MODE_MODIFIER)) {
mediateurCourrant.selectionnerCollection(this, collectionId, null, sequenceur);
mediateurCourrant.selectionnerCollectionAPersonne(this, collectionId, null, sequenceur);
//mediateurCourrant.selectionnerCollectionAPublication(this, collectionId, sequenceur);
//mediateurCourrant.selectionnerCollectionACommentaire(this, collectionId, sequenceur);
}
}
private void genererTitreFormulaire() {
String titre = i18nC.collectionTitreFormAjout();
if (mode.equals(Formulaire.MODE_MODIFIER)) {
titre = i18nC.collectionTitreFormModif();
if (collection != null) {
titre += " - "+i18nC.id()+": "+collection.getId();
}
}
panneauFormulaire.setHeadingHtml(titre);
}
private void creerFieldsetPrincipal() {
FieldSet principalFieldSet = new FieldSet();
principalFieldSet.setHeadingHtml("Info");
principalFieldSet.setCollapsible(true);
principalFieldSet.setLayout(Formulaire.creerFormLayout(150, LabelAlign.LEFT));
nomChp = new TextField<String>();
nomChp.setTabIndex(tabIndex++);
nomChp.setFieldLabel(i18nC.nomCollection());
nomChp.setAllowBlank(false);
nomChp.addStyleName(ComposantClass.OBLIGATOIRE);
nomChp.addListener(Events.Valid, creerEcouteurChampObligatoire());
nomChp.getMessages().setBlankText(i18nC.champObligatoire());
principalFieldSet.add(nomChp, new FormData(450, 0));
Listener<BaseEvent> ecouteurTypeCollection = new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
Valeur valeur = typesCollectionCombo.getValue();
// Gestion des onglets en fonction du type de collection
mediateur.activerChargement(this, "Chargement des onglets");
if (valeur != null && valeur.getId().equals(Valeur.COLLECTION_NCD_HERBIER)) {
activerOngletsHerbier();
} else {
activerOngletsDefaut();
}
mediateur.desactiverChargement(this);
}
};
typesCollectionCombo = new ChampComboBoxListeValeurs(i18nC.typeCollectionNcd(), "typeCollectionNcd", tabIndex++);
typesCollectionCombo.peupler(Valeur.COLLECTION_NCD_HERBIER);
typesCollectionCombo.addStyleName(ComposantClass.OBLIGATOIRE);
typesCollectionCombo.addListener(Events.Change, ecouteurTypeCollection);
typesCollectionCombo.addListener(Events.Select, ecouteurTypeCollection);
typesCollectionCombo.addListener(Events.Valid, creerEcouteurChampObligatoire());
principalFieldSet.add(typesCollectionCombo, new FormData(150, 0));
typesCollectionCombo.fireEvent(Events.Select);
panneauFormulaire.setTopComponent(principalFieldSet);
}
private void activerOngletsDefaut() {
if (onglets.findItem(CollectionFormGeneral.ID, false) == null) {
onglets.add(generalOnglet);
}
if (onglets.findItem(CollectionFormPersonne.ID, false) == null) {
onglets.add(personneOnglet);
}
if (onglets.findItem(CollectionFormPublication.ID, false) != null) {
onglets.remove(publicationOnglet);
}
if (onglets.findItem(CollectionFormDescription.ID, false) != null) {
onglets.remove(descriptionOnglet);
}
if (onglets.findItem(CollectionFormContenu.ID, false) != null) {
onglets.remove(contenuOnglet);
}
if (onglets.findItem(CollectionFormInventaire.ID, false) != null) {
onglets.remove(inventaireOnglet);
}
if (onglets.findItem(CollectionFormCommentaire.ID, false) != null) {
onglets.remove(commentaireOnglet);
}
panneauFormulaire.layout();
}
 
private void activerOngletsHerbier() {
if (onglets.findItem(CollectionFormGeneral.ID, false) == null) {
onglets.add(generalOnglet);
}
if (onglets.findItem(CollectionFormPersonne.ID, false) == null) {
onglets.add(personneOnglet);
}
if (onglets.findItem(CollectionFormPublication.ID, false) == null) {
onglets.add(publicationOnglet);
}
if (onglets.findItem(CollectionFormDescription.ID, false) == null) {
onglets.add(descriptionOnglet);
}
if (onglets.findItem(CollectionFormContenu.ID, false) == null) {
onglets.add(contenuOnglet);
}
if (onglets.findItem(CollectionFormInventaire.ID, false) == null) {
onglets.add(inventaireOnglet);
}
if (onglets.findItem(CollectionFormCommentaire.ID, false) == null) {
onglets.add(commentaireOnglet);
}
panneauFormulaire.layout();
}
private void creerOnglets() {
onglets = new TabPanel();
// NOTE : pour faire apparaître les scrollBar il faut définir la hauteur du panneau d'onglets à 100% (autoHeight ne semble pas fonctionner)
onglets.setHeight("100%");
// Onlget formulaire GENERAL
onglets.add(creerOngletGeneral());
// Onlget formulaire AUTEUR
onglets.add(creerOngletPersonne());
// Onlget formulaire PUBLICATION
onglets.add(creerOngletPublication());
// Onlget formulaire DESCRIPTION
onglets.add(creerOngletDescription());
// Onlget formulaire CONTENU
onglets.add(creerOngletContenu());
// Onlget formulaire INVENTAIRE
onglets.add(creerOngletInventaire());
// Onlget formulaire COMMENTAIRE
onglets.add(creerOngletCommentaire());
// Sélection de l'onglet par défaut
onglets.setSelection(generalOnglet);
panneauFormulaire.add(onglets);
}
private TabItem creerOngletGeneral() {
generalOnglet = new CollectionFormGeneral(this);
return generalOnglet;
}
private TabItem creerOngletPersonne() {
personneOnglet = new CollectionFormPersonne(this);
return personneOnglet;
}
private TabItem creerOngletPublication() {
publicationOnglet = new CollectionFormPublication(this);
return publicationOnglet;
}
private TabItem creerOngletDescription() {
descriptionOnglet = new CollectionFormDescription(this);
return descriptionOnglet;
}
private TabItem creerOngletContenu() {
contenuOnglet = new CollectionFormContenu(this);
return contenuOnglet;
}
private TabItem creerOngletInventaire() {
inventaireOnglet = new CollectionFormInventaire(this);
return inventaireOnglet;
}
private TabItem creerOngletCommentaire() {
commentaireOnglet = new CollectionFormCommentaire(this);
return commentaireOnglet;
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
rafraichirInformation(info);
} else {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
controlerFermeture();
}
 
private void rafraichirInformation(Information info) {
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
Debug.log("MESSAGES:\n"+info.getMessages().toString());
}
String infoType = info.getType();
if (infoType.equals("modif_collection")) {
InfoLogger.display("Modification d'une collection", info.toString());
repandreRafraichissement();
} else if (infoType.equals("selection_collection")) {
InfoLogger.display("Modification d'une collection", info.toString());
if (info.getDonnee(0) != null) {
collection = (Collection) info.getDonnee(0);
}
peupler();
genererTitreFormulaire();
} else if (infoType.equals("ajout_collection")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
String collectionId = (String) info.getDonnee(0);
InfoLogger.display("Ajout d'une collection", "La collection '"+collectionId+"' a bien été ajoutée");
collection.setId(collectionId);
// Suite à la récupération de l'id de l'institution nouvellement ajoutée nous ajoutons les personnes et les publications liées
personneOnglet.rafraichir(info);
publicationOnglet.rafraichir(info);
commentaireOnglet.rafraichir(info);
this.mode = MODE_MODIFIER;
} else {
InfoLogger.display("Ajout d'une collection", info.toString());
}
} else if (infoType.equals("liste_collection_a_personne")) {
personneOnglet.rafraichir(info);
} else if (infoType.equals("liste_collection_a_publication")) {
publicationOnglet.rafraichir(info);
} else if (infoType.equals("liste_collection_a_commentaire")) {
commentaireOnglet.rafraichir(info);
}
}
private void peupler() {
if (collection != null) {
nomChp.setValue(collection.getNom());
typesCollectionCombo.peupler(collection.getTypeNcd());
peuplerOnglets();
}
}
 
private void peuplerOnglets() {
generalOnglet.peupler();
descriptionOnglet.peupler();
contenuOnglet.peupler();
inventaireOnglet.peupler();
commentaireOnglet.peupler();
}
 
public boolean soumettreFormulaire() {
// Vérification de la validité des champs du formulaire
boolean formulaireValide = verifierFormulaire();
 
if (formulaireValide) {
// Collecte des données du formulaire
Collection collectionAEnregistrer = collecterCollection();
if (mode.equals(MODE_AJOUTER)) {
mediateur.ajouterCollection(this, collectionAEnregistrer);
} else if (mode.equals(MODE_MODIFIER)) {
if (collectionAEnregistrer == null) {
//InfoLogger.display("Modification d'une collection", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
this.controlerFermeture();
} else {
mediateur.modifierCollection(this, collectionAEnregistrer);
}
}
soumettreOnglets();
}
return formulaireValide;
}
private void soumettreOnglets() {
personneOnglet.soumettre();
publicationOnglet.soumettre();
commentaireOnglet.soumettre();
}
private Collection collecterCollection() {
collectionCollectee = (Collection) collection.cloner(new Collection());
this.collecter();
collecterOnglets();
Collection collectionARetourner = null;
if (!collectionCollectee.comparer(collection) ||
!collectionCollectee.getBotanique().comparer(collection.getBotanique()) ||
publicationOnglet.publicationsSontModifiees) {
collectionARetourner = collection = collectionCollectee;
publicationOnglet.publicationsSontModifiees = false;
}
return collectionARetourner;
}
private void collecter() {
collectionCollectee.setNom(nomChp.getValue());
collectionCollectee.setTypeNcd(typesCollectionCombo.getValue().getId());
}
 
private void collecterOnglets() {
generalOnglet.collecter();
personneOnglet.collecter();
publicationOnglet.collecter();
descriptionOnglet.collecter();
contenuOnglet.collecter();
inventaireOnglet.collecter();
commentaireOnglet.collecter();
}
 
public boolean verifierFormulaire() {
ArrayList<String> messages = new ArrayList<String>();
// Vérification des infos sur le nom de la collection
if (nomChp.getValue() == null
|| nomChp.getValue().equals("")
|| (mode.equals(MODE_MODIFIER) && collection != null && collection.getNom().equals(""))) {
messages.add("Veuillez donner un nom à la collection.");
}
// Vérification des infos sur le type de collection
if (typesCollectionCombo.getValue() == null
|| typesCollectionCombo.getValue().equals("")) {
messages.add("Veuillez sélectionner un type pour la collection.");
}
messages.addAll(verifierOnglets());
// Affichage des messages d'alerte
if (messages.size() != 0) {
String[] tableauDesMessages = {};
tableauDesMessages = messages.toArray(tableauDesMessages);
MessageBox.alert("Erreurs de saisies", UtilArray.implode(tableauDesMessages, "<br />"), null);
return false;
}
return true;
}
private ArrayList<String> verifierOnglets() {
ArrayList<String> messages = new ArrayList<String>();
messages.addAll(generalOnglet.verifier());
messages.addAll(personneOnglet.verifier());
return messages;
}
private void repandreRafraichissement() {
if (vueExterneARafraichirApresValidation != null) {
String type = "modif_collection";
if (mode.equals(Formulaire.MODE_AJOUTER)) {
type = "ajout_collection";
}
Information info = new Information(type);
info.setDonnee(0, collection);
vueExterneARafraichirApresValidation.rafraichir(info);
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/vues/collection/CollectionForm.java:r11-933,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/collection/CollectionForm.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/collection/CollectionForm.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/collection/CollectionFormCommentaire.java
New file
0,0 → 1,652
package org.tela_botanica.client.vues.collection;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampComboBoxMultiSelect;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.GrillePaginable;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.ProxyCollectionACommentaire;
import org.tela_botanica.client.composants.pagination.ProxyCollectionAPersonne;
import org.tela_botanica.client.composants.pagination.ProxyCommentaires;
import org.tela_botanica.client.composants.pagination.ProxyPublications;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionACommentaire;
import org.tela_botanica.client.modeles.collection.CollectionACommentaireListe;
import org.tela_botanica.client.modeles.commentaire.Commentaire;
import org.tela_botanica.client.modeles.commentaire.CommentaireListe;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.vues.FenetreForm;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireBarreValidation;
import org.tela_botanica.client.vues.FormulaireOnglet;
import org.tela_botanica.client.vues.commentaire.CommentaireForm;
 
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.KeyListener;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.store.StoreEvent;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.grid.HeaderGroupConfig;
import com.extjs.gxt.ui.client.widget.grid.RowNumberer;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
 
public class CollectionFormCommentaire extends FormulaireOnglet implements Rafraichissable {
public static final String ID = "commentaire";
private Collection collection = null;
private static int idGenere = 1;
private ContentPanel panneauPrincipal = null;
private ToolBar barreOutils = null;
private GrillePaginable<ModelData> grille = null;
private ChampComboBoxMultiSelect<Valeur> typeCombo = null;
private CollectionACommentaireListe commentairesAjoutes = null;
private CollectionACommentaireListe commentairesModifies = null;
private CollectionACommentaireListe commentairesSupprimes = null;
private ChampComboBoxRechercheTempsReelPaginable commentairesSaisisComboBox = null;
private Button commentairesBoutonSupprimer = null;
private Button commentairesBoutonModifier = null;
private static boolean chargementTypesOk = false;
private static boolean chargementCommentairesOk = false;
private FenetreForm fenetreFormulaire = null;
private Sequenceur sequenceur;
public CollectionFormCommentaire(Formulaire formulaireCourrant) {
initialiserOnglet(formulaireCourrant);
setLayout(new FitLayout());
setId(ID);
setText(Mediateur.i18nC.collectionCommentaire());
setStyleAttribute("padding", "0");
initialiser();
panneauPrincipal = creerPanneauContenantGrille();
barreOutils = creerBarreOutilsGrille();
panneauPrincipal.setTopComponent(barreOutils);
grille = creerGrille();
panneauPrincipal.add(grille);
mediateur.obtenirListeValeurEtRafraichir(this, "typeCommentaireCollection", null);
add(panneauPrincipal);
}
private void initialiser() {
// Remise à zéro des modification dans la liste des commentaires
initialiserGestionCommentaires();
collection = ((CollectionForm) formulaire).collection;
}
private void initialiserGestionCommentaires() {
idGenere = 1;
commentairesAjoutes = new CollectionACommentaireListe();
commentairesModifies = new CollectionACommentaireListe();
commentairesSupprimes = new CollectionACommentaireListe();
}
private void initialiserChargement() {
chargementCommentairesOk = false;
}
private ContentPanel creerPanneauContenantGrille() {
ContentPanel panneau = new ContentPanel();
panneau.setHeadingHtml(i18nC.collectionCommentaireTitre());
panneau.setIcon(Images.ICONES.table());
panneau.setLayout(new FitLayout());
panneau.setFrame(true);
return panneau;
}
 
private ToolBar creerBarreOutilsGrille() {
ToolBar barreOutils = new ToolBar();
commentairesSaisisComboBox = creerComboBoxCommentairesSaisies();
barreOutils.add(commentairesSaisisComboBox);
barreOutils.add(new Text(" ou "));
Button ajouterPersonneBouton = creerBoutonAjouter();
barreOutils.add(ajouterPersonneBouton);
barreOutils.add(new SeparatorToolItem());
commentairesBoutonModifier = creerBoutonModifier();
barreOutils.add(commentairesBoutonModifier);
barreOutils.add(new SeparatorToolItem());
commentairesBoutonSupprimer = creerBoutonSupprimer();
barreOutils.add(commentairesBoutonSupprimer);
barreOutils.add(new SeparatorToolItem());
Button rafraichirPersonneBouton = creerBoutonRafraichir();
barreOutils.add(rafraichirPersonneBouton);
return barreOutils;
}
 
private Button creerBoutonAjouter() {
Button bouton = new Button(i18nC.ajouter());
bouton.setIcon(Images.ICONES.vcardAjouter());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
 
@Override
public void componentSelected(ButtonEvent ce) {
fenetreFormulaire = creerFenetreModaleAvecFormulaireCommentaire(Formulaire.MODE_AJOUTER);
fenetreFormulaire.show();
}
});
return bouton;
}
private Button creerBoutonModifier() {
Button bouton = new Button(i18nC.modifier());
bouton.setIcon(Images.ICONES.vcardModifier());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
ModelData commentaireSaisiSelectionne = grille.getGrille().getSelectionModel().getSelectedItem();
if (commentaireSaisiSelectionne == null) {
InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerCommentaire());
} else {
fenetreFormulaire = creerFenetreModaleAvecFormulaireCommentaire(Formulaire.MODE_MODIFIER);
fenetreFormulaire.show();
}
}
});
return bouton;
}
private FenetreForm creerFenetreModaleAvecFormulaireCommentaire(String mode) {
String commentaireId = null;
if (mode.equals(Formulaire.MODE_MODIFIER)) {
ModelData commentaierSaisieSelectionnee = grille.getGrille().getSelectionModel().getSelectedItem();
CollectionACommentaire cac = new CollectionACommentaire(commentaierSaisieSelectionnee, false);
commentaireId = cac.getIdCommentaire();
}
final FenetreForm fenetre = new FenetreForm("");
final CommentaireForm formulaire = creerFormulaireCommentaire(fenetre, commentaireId);
fenetre.add(formulaire);
return fenetre;
}
private CommentaireForm creerFormulaireCommentaire(final FenetreForm fenetre, String commentaireId) {
CommentaireForm formulaire = new CommentaireForm(mediateur, commentaireId, this);
FormPanel panneauFormulaire = formulaire.getFormulaire();
fenetre.setHeadingHtml(panneauFormulaire.getHeadingHtml());
panneauFormulaire.setHeaderVisible(false);
panneauFormulaire.setTopComponent(null);
 
// FIXME : avec GXT-2.1.0 la redéfinition du bottom component ne marche plus. Nous le cachons et en créeons un dans la fenêtre.
panneauFormulaire.getBottomComponent().hide();
SelectionListener<ButtonEvent> ecouteur = creerEcouteurValidationFormulaireCommentaire(fenetre, formulaire);
final ButtonBar barreValidation = new FormulaireBarreValidation(ecouteur);
fenetre.setBottomComponent(barreValidation);
return formulaire;
}
private SelectionListener<ButtonEvent> creerEcouteurValidationFormulaireCommentaire(final FenetreForm fenetre, final CommentaireForm formulaire) {
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
String code = ((Button) ce.getComponent()).getData("code");
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
if (formulaire.soumettreFormulaire()) {
fenetre.hide();
}
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
formulaire.soumettreFormulaire();
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
fenetre.hide();
}
}
};
return ecouteur;
}
private Button creerBoutonSupprimer() {
Button bouton = new Button(i18nC.supprimer());
bouton.setIcon(Images.ICONES.vcardSupprimer());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
ModelData commentaireSaisiSelectionnee = grille.getGrille().getSelectionModel().getSelectedItem();
CollectionACommentaire cac = new CollectionACommentaire(commentaireSaisiSelectionnee, false);
if (commentaireSaisiSelectionnee == null) {
InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerCommentaire());
} else {
supprimerDansGrille(cac);
}
}
});
return bouton;
}
private Button creerBoutonRafraichir() {
Button bouton = new Button(i18nC.rafraichir());
bouton.setIcon(Images.ICONES.rafraichir());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
actualiserGrille();
}
});
return bouton;
}
private ChampComboBoxRechercheTempsReelPaginable creerComboBoxCommentairesSaisies() {
ModelType modelTypeCommentaires = new ModelType();
modelTypeCommentaires.setRoot("commentaires");
modelTypeCommentaires.setTotalName("nbElements");
modelTypeCommentaires.addField("ccm_id_commentaire");
modelTypeCommentaires.addField("ccm_ce_pere");
modelTypeCommentaires.addField("ccm_titre");
modelTypeCommentaires.addField("ccm_texte");
modelTypeCommentaires.addField("ccm_ponderation");
modelTypeCommentaires.addField("ccm_mark_public");
String displayNameCommentaires = "ccm_titre";
ProxyCommentaires<ModelData> proxyCommentaires = new ProxyCommentaires<ModelData>(null);
final ChampComboBoxRechercheTempsReelPaginable commentairesCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyCommentaires, modelTypeCommentaires, displayNameCommentaires);
commentairesCombo.getCombo().setTabIndex(tabIndex++);
commentairesCombo.getCombo().setForceSelection(true);
commentairesCombo.getCombo().setValidator(new Validator() {
public String validate(Field<?> field, String value) {
String retour = null;
if (field.getRawValue().equals("")) {
field.setValue(null);
} else if (commentairesCombo.getStore().findModel("ccm_titre", field.getRawValue()) == null) {
String contenuBrut = field.getRawValue();
field.setValue(null);
field.setRawValue(contenuBrut);
retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
}
return retour;
}
});
commentairesCombo.getCombo().setEmptyText("Rechercher et sélectionner une note existante dans la base");
commentairesCombo.getCombo().addListener(Events.Select, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
if (commentairesSaisisComboBox.getValeur() instanceof ModelData) {
Commentaire commentaireSaisiSelectionnee = new Commentaire(commentairesSaisisComboBox.getValeur());
ajouterDansGrille(commentaireSaisiSelectionnee);
commentairesSaisisComboBox.getCombo().setValue(null);
}
}
});
return commentairesCombo;
}
private void ajouterDansGrille(Commentaire commentaire) {
ajouterDansGrille(commentaire, null, 0);
}
private void ajouterDansGrille(Commentaire commentaire, String type, int index) {
if (commentaire != null) {
CollectionACommentaire relationCollectionACommentaire = new CollectionACommentaire();
relationCollectionACommentaire.setCommentaire(commentaire);
relationCollectionACommentaire.setIdCommentaire(commentaire.getId());
if (type != null) {
relationCollectionACommentaire.set("_type_", type);
}
// Gestion de l'id de la collection
if (mode.equals(Formulaire.MODE_MODIFIER)) {
relationCollectionACommentaire.setIdCollection(collection.getId());
}
relationCollectionACommentaire.set("_etat_", aDonnee.ETAT_AJOUTE);
corrigerChampsGrille(relationCollectionACommentaire);
// Ajout à la grille
grille.getGrille().stopEditing();
grille.getGrille().getStore().insert(relationCollectionACommentaire, index);
grille.getGrille().startEditing(index, 0);
grille.getGrille().getSelectionModel().select(index, false);
}
}
private void supprimerDansGrille(CollectionACommentaire relationCollectionACommentaire) {
if (relationCollectionACommentaire != null) {
// Ajout de la personne supprimée à la liste
if ((relationCollectionACommentaire.get("_etat_").equals("") || !relationCollectionACommentaire.get("_etat_").equals(aDonnee.ETAT_AJOUTE))
&& relationCollectionACommentaire.getId() != null
&& !relationCollectionACommentaire.getId().equals("")) {
commentairesSupprimes.put("id"+idGenere++, relationCollectionACommentaire);
}
// Suppression de l'enregistrement de la grille
grille.getStore().remove(relationCollectionACommentaire);
}
}
 
private GrillePaginable<ModelData> creerGrille() {
GrillePaginable<ModelData> grillePaginable = null;
 
// ModelType
ModelType modelTypeCollectionACommentaire = new ModelType();
modelTypeCollectionACommentaire.setRoot("collectionsACommentaire");
modelTypeCollectionACommentaire.setTotalName("nbElements");
modelTypeCollectionACommentaire.addField("ccac_id_commentaire");
modelTypeCollectionACommentaire.addField("ccac_id_collection");
modelTypeCollectionACommentaire.addField("ccac_truk_type");
modelTypeCollectionACommentaire.addField("ccm_id_commentaire");
modelTypeCollectionACommentaire.addField("ccm_titre");
modelTypeCollectionACommentaire.addField("ccm_texte");
modelTypeCollectionACommentaire.addField("ccm_ponderation");
modelTypeCollectionACommentaire.addField("ccm_mark_public");
modelTypeCollectionACommentaire.addField("ccm_ce_pere");
// Proxy
ProxyCollectionACommentaire<ModelData> proxyCollectionACommentaire = new ProxyCollectionACommentaire<ModelData>(null, collection.getId());
// Colonnes
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
RowNumberer pluginLigneNumero = new RowNumberer();
colonnes.add(pluginLigneNumero);
colonnes.add(creerColonneType());
colonnes.add(new ColumnConfig("_titre_", i18nC.commentaireTitre(), 150));
colonnes.add(new ColumnConfig("_texte_", i18nC.commentaireTexte(), 75));
colonnes.add(new ColumnConfig("_ponderation_", i18nC.commentairePonderation(), 35));
colonnes.add(creerColonneAcces());
// Modèle de colonnes
ColumnModel modeleDeColonnes = new ColumnModel(colonnes);
GridSelectionModel<ModelData> modeleDeSelection = new GridSelectionModel<ModelData>();
HashMap<String, String> virtualFields = new HashMap<String, String>();
virtualFields.put("_titre_", "ccm_titre");
virtualFields.put("_texte_", "ccm_texte");
virtualFields.put("_ponderation_", "ccm_ponderation");
virtualFields.put("_type_", "ccac_truk_type");
virtualFields.put("_public_", "ccm_mark_public");
virtualFields.put("_etat_", "");
// Grille
grillePaginable = new GrillePaginable<ModelData>(modelTypeCollectionACommentaire, virtualFields, proxyCollectionACommentaire, colonnes, modeleDeColonnes);
grillePaginable.getGrille().setBorders(true);
grillePaginable.getGrille().setSelectionModel(modeleDeSelection);
grillePaginable.getGrille().addPlugin(pluginLigneNumero);
grillePaginable.getGrille().getView().setForceFit(true);
grillePaginable.getGrille().setAutoExpandColumn("_titre_");
grillePaginable.getGrille().setStripeRows(true);
grillePaginable.getGrille().setTrackMouseOver(true);
// Rajouter des écouteurs
grillePaginable.getStore().addListener(Store.Update, new Listener<StoreEvent<ModelData>>() {
public void handleEvent(StoreEvent<ModelData> ce) {
if (ce.getRecord().isModified("_type_") && ce.getModel().get("_etat_") == null || !ce.getModel().get("_etat_").equals(aDonnee.ETAT_AJOUTE)) {
ce.getModel().set("_etat_", aDonnee.ETAT_MODIFIE);
}
}
});
return grillePaginable;
}
private ColumnConfig creerColonneType() {
typeCombo = new ChampComboBoxMultiSelect<Valeur>();
typeCombo.setDisplayField("nom");
typeCombo.setValueField("id_valeur");
typeCombo.setStore(new ListStore<Valeur>());
typeCombo.setEditable(false);
typeCombo.setForceSelection(true);
CellEditor typeEditeur = new CellEditor(typeCombo) {
@SuppressWarnings("unchecked")
@Override
public Object preProcessValue(Object valeur) {
Valeur retour = new Valeur();
if (valeur != null ) {
if (valeur instanceof String) {
((ChampComboBoxMultiSelect<Valeur>) getField()).peuplerAvecTexte(valeur.toString());
}
}
return retour;
}
 
@Override
public Object postProcessValue(Object valeur) {
String retour = null;
if (getField().getRawValue() != null ) {
retour = getField().getRawValue();
}
return retour;
}
};
 
GridCellRenderer<ModelData> typeRendu = new GridCellRenderer<ModelData>() {
public String render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ModelData> store, Grid<ModelData> grid) {
String type = model.get("_type_");
if (typeCombo.getStore() != null && type != null && (type.matches("[0-9]+") || type.contains(aDonnee.SEPARATEUR_VALEURS))) {
type = typeCombo.formaterIdentifiantsEnTexte(type);
model.set("_type_", type);
}
return type;
}
};
ColumnConfig typeColonne = new ColumnConfig("_type_", i18nC.commentaireType(), 100);
typeColonne.setEditor(typeEditeur);
typeColonne.setRenderer(typeRendu);
return typeColonne;
}
private ColumnConfig creerColonneAcces() {
GridCellRenderer<ModelData> accesRendu = new GridCellRenderer<ModelData>() {
public String render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ModelData> store, Grid<ModelData> grid) {
CollectionACommentaire cac = new CollectionACommentaire(model, true);
String acces = (cac.getCommentaire().etrePublic() ? i18nC.donneePublic() : i18nC.donneePrivee());
model.set("_public_", acces);
return acces;
}
};
ColumnConfig accesColonne = new ColumnConfig("_public_", i18nC.commentairePublic(), 30);
accesColonne.setRenderer(accesRendu);
return accesColonne;
}
public void actualiserEtatBoutonsBarreOutils() {
// Activation des boutons si la grille contient un élément
if (grille.getStore().getCount() > 0) {
commentairesBoutonSupprimer.enable();
commentairesBoutonModifier.enable();
}
// Désactivation des boutons si la grille ne contient plus d'élément
if (grille.getStore().getCount() == 0) {
commentairesBoutonSupprimer.disable();
commentairesBoutonModifier.disable();
}
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
rafraichirValeurListe(listeValeurs);
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
rafraichirInformation(info);
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
if (chargementTypesOk && chargementCommentairesOk) {
peupler();
initialiserChargement();
}
}
private void rafraichirValeurListe(ValeurListe listeValeurs) {
if (listeValeurs.getId().equals(config.getListeId("typeCommentaireCollection"))) {
List<Valeur> liste = listeValeurs.toList();
if (liste.size() > 0) {
ListStore<Valeur> store = typeCombo.getStore();
store.removeAll();
store.add(liste);
store.sort("nom", SortDir.ASC);
typeCombo.setStore(store);
}
chargementTypesOk = true;
} else {
GWT.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!", null);
}
}
public void rafraichirInformation(Information info) {
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
}
String type = info.getType();
if (info.getType().equals("liste_collection_a_commentaire")) {
if (info.getDonnee(0) != null) {
initialiser();
collection.setCommentairesLiees((CollectionACommentaireListe) info.getDonnee(0));
chargementCommentairesOk = true;
}
} else if (info.getType().equals("ajout_collection")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
String collectionId = (String) info.getDonnee(0);
// Suite à la récupération de l'id de la collection nouvellement ajoutée nous ajoutons les personnes liées
// En mode AJOUT, il ne peut que y avoir des personnes liées ajoutées
mediateur.ajouterCollectionACommentaire(this, collectionId, commentairesAjoutes);
}
} else if (type.equals("commentaire_modifiee")) {
if (info.getDonnee(0) != null) {
Commentaire commentaire = (Commentaire) info.getDonnee(0);
ModelData commentaireDansGrille = grille.getStore().findModel("ccm_id_commentaire", commentaire.getId());
int index = grille.getStore().indexOf(commentaireDansGrille);
grille.getStore().remove(commentaireDansGrille);
String typeCommentaire = (String) commentaireDansGrille.get("_type_");
ajouterDansGrille(commentaire, typeCommentaire, index);
}
} else if (type.equals("commentaire_ajoutee")) {
if (info.getDonnee(0) != null) {
Commentaire commentaire = (Commentaire) info.getDonnee(0);
ajouterDansGrille(commentaire);
}
} else if (info.getType().equals("modif_collection_a_commentaire")) {
InfoLogger.display("Modification des notes liées à la collection", info.toString());
initialiserGestionCommentaires();
} else if (info.getType().equals("suppression_collection_a_commentaire")) {
InfoLogger.display("Suppression des notes liées à la collection", info.toString());
initialiserGestionCommentaires();
} else if (info.getType().equals("ajout_collection_a_commentaire")) {
InfoLogger.display("Ajout des notes liées à la collection", info.toString());
initialiserGestionCommentaires();
}
}
public void peupler() {
grille.getStore().removeAll();
grille.getStore().add(collection.getCommentairesLiees().toList());
grille.recalculate();
layout();
InfoLogger.display(i18nC.chargementCommentaire(), i18nC.ok());
}
public void collecter() {
if (etreAccede()) {
int nbreCommentaire = grille.getStore().getCount();
for (int i = 0; i < nbreCommentaire; i++) {
ModelData relationCollectionACommentaire = grille.getStore().getAt(i);
CollectionACommentaire cac = new CollectionACommentaire(relationCollectionACommentaire, false);
if (relationCollectionACommentaire.get("_etat_") != null) {
if (relationCollectionACommentaire.get("_etat_").equals(aDonnee.ETAT_MODIFIE)) {
corrigerChampsGrille(cac);// Nous modifions l'id_type
commentairesModifies.put("id"+idGenere++, cac);
}
if (relationCollectionACommentaire.get("_etat_").equals(aDonnee.ETAT_AJOUTE)) {
corrigerChampsGrille(cac);// Nous modifions l'id_type
commentairesAjoutes.put("id"+idGenere++, cac);
}
// Initialisation de la grille
relationCollectionACommentaire.set("_etat_", "");
}
}
grille.getStore().commitChanges();
}
}
private void corrigerChampsGrille(CollectionACommentaire relationCollectionACommentaire) {
String type = relationCollectionACommentaire.get("_type_");
relationCollectionACommentaire.setType(typeCombo.formaterTexteEnIdentifiants(type));
relationCollectionACommentaire.setIdCollection(collection.getId());
}
 
public void soumettre() {
if (mode.equals(Formulaire.MODE_MODIFIER)) {
if (commentairesAjoutes.size() == 0 && commentairesModifies.size() == 0 && commentairesSupprimes.size() == 0) {
//InfoLogger.display("Modification des notes liées", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
} else {
mediateur.ajouterCollectionACommentaire(this, collection.getId(), commentairesAjoutes);
mediateur.modifierCollectionACommentaire(this, commentairesModifies);
mediateur.supprimerCollectionACommentaire(this, commentairesSupprimes);
}
}
}
private void actualiserGrille() {
if (mode.equals(Formulaire.MODE_MODIFIER)) {
mediateur.selectionnerCollectionACommentaire(this, collection.getId(), null);
} else {
grille.getStore().removeAll();
layout();
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/vues/collection/CollectionFormCommentaire.java:r11-996,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/collection/CollectionFormCommentaire.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/collection/CollectionFormCommentaire.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/collection/CollectionFormDescription.java
New file
0,0 → 1,473
package org.tela_botanica.client.vues.collection;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampCaseACocher;
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
import org.tela_botanica.client.composants.ChampMultiValeursMultiTypes;
import org.tela_botanica.client.composants.ChampSliderPourcentage;
import org.tela_botanica.client.composants.ChampNombre;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.InterneValeur;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
import org.tela_botanica.client.modeles.collection.UniteBase;
import org.tela_botanica.client.modeles.collection.UniteRangement;
import org.tela_botanica.client.modeles.OntologiesLocales;
import org.tela_botanica.client.modeles.SimpleModelData;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireOnglet;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.FieldEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.widget.Label;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.NumberField;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.user.client.ui.HorizontalPanel;
 
 
public class CollectionFormDescription extends FormulaireOnglet implements Rafraichissable {
public static final String ID = "description";
private Collection collection = null;
private CollectionBotanique collectionBotanique = null;
private Collection collectionCollectee = null;
private CollectionBotanique collectionBotaniqueCollectee = null;
private static ListStore<InterneValeur> precisionStore = null;
private ChampComboBoxListeValeurs typesCollectionBotaCombo = null;
private NumberField nbreEchantillonChp = null;
private EditorGrid<UniteRangement> uniteRangementGrille = null;
private ComboBox<SimpleModelData> etatUniteRangementCombo = null;
private EditorGrid<UniteBase> uniteBaseGrille = null;
private ChampCaseACocher typePapierConservationChp = null;
private ChampCaseACocher methodeConservationChp = null;
private ChampSliderPourcentage specimenFixationPourcentChp = null;
private ChampSliderPourcentage etiquetteFixationPourcentChp = null;
private ChampCaseACocher specimentMethodeFixationChp = null;
private ChampCaseACocher etiquetteMethodeFixationSurSupportChp = null;
private ChampCaseACocher etiquetteMethodeFixationSurSpecimenChp = null;
private ChampCaseACocher typeEcritureChp = null;
private ChampComboBoxListeValeurs traitementCombo = null;
private ChampCaseACocher poisonTraitementChp = null;
private ChampCaseACocher insecteTraitementChp = null;
private ComboBox<SimpleModelData> etatGeneralCombo = null;
private ChampComboBoxListeValeurs determinationCombo = null;
private ChampMultiValeursMultiTypes specimenDegradationChp = null;
private ChampMultiValeursMultiTypes presentationDegradationChp = null;
private Text labelPresentationDegradationChp = null;
private ChampNombre planchesHerbier = null;
private ChampNombre nbEspeces = null;
private ChampNombre nbCartonsHerbier = null;
private TextField<String> cartonsHerbierFormat = null;
private ChampNombre nbLiasses = null;
private TextField<String> liassesFormat = null;
private TextArea autresUnitesRangement = null;
public CollectionFormDescription(Formulaire formulaireCourrant) {
initialiserOnglet(formulaireCourrant);
setId(ID);
setText(Mediateur.i18nC.collectionDescription());
 
FormLayout formulaireLayout = (FormLayout) this.getLayout();
formulaireLayout.setLabelAlign(LabelAlign.LEFT);
formulaireLayout.setLabelWidth(300);
creerFieldsetTypesUniteEtat();
creerFieldsetConservation(); // Papier
creerFieldsetEtiquette(); // RAS
creerFieldsetTraitement(); // RAS
creerFieldsetPrecision(); // A supprimer ou déplacer plus tard
creerStorePrecision();
layout();
}
private void creerFieldsetPrecision() {
FieldSet precisionFieldSet = new FieldSet();
precisionFieldSet.setHeadingHtml(i18nC.collectionTitrePrecision());
precisionFieldSet.setCollapsible(true);
precisionFieldSet.collapse();
precisionFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
typesCollectionBotaCombo = new ChampComboBoxListeValeurs(i18nC.typeCollectionBotanique(), "typeCollectionBota");
typesCollectionBotaCombo.setTabIndex(tabIndex++);
precisionFieldSet.add(typesCollectionBotaCombo, new FormData(250, 0));
nbreEchantillonChp = new NumberField();
nbreEchantillonChp.setFieldLabel(i18nC.nbreEchantillon());
nbreEchantillonChp.setToolTip(i18nC.nbreEchantillonInfo());
nbreEchantillonChp.setFormat(NumberFormat.getFormat("#"));
precisionFieldSet.add(nbreEchantillonChp);
this.add(precisionFieldSet);
}
private static void creerStorePrecision() {
if (precisionStore == null) {
precisionStore = new ListStore<InterneValeur>();
precisionStore.add(new InterneValeur(UniteRangement.COMPTE_APPROXIMATIF, Mediateur.i18nC.precisionApproximatif()));
precisionStore.add(new InterneValeur(UniteRangement.COMPTE_EXACT, Mediateur.i18nC.precisionExact()));
}
}
private void creerFieldsetConservation() {
FieldSet conservationFieldSet = new FieldSet();
conservationFieldSet.setHeadingHtml(i18nC.collectionTitreConservation());
conservationFieldSet.setCollapsible(true);
conservationFieldSet.collapse();
conservationFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
typePapierConservationChp = new ChampCaseACocher(i18nC.typePapierConservation(), "typePapier", true);
conservationFieldSet.add(typePapierConservationChp);
methodeConservationChp = new ChampCaseACocher(i18nC.methodeConservation(), "methodeRangement", true);
conservationFieldSet.add(methodeConservationChp);
this.add(conservationFieldSet);
}
private void creerFieldsetEtiquette() {
FieldSet etiquetteFieldSet = new FieldSet();
etiquetteFieldSet.setHeadingHtml(i18nC.collectionTitreEtiquette());
etiquetteFieldSet.setCollapsible(true);
etiquetteFieldSet.collapse();
etiquetteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
Text fixationPoucentLabel = new Text(i18nC.fixationPourcent());
etiquetteFieldSet.add(fixationPoucentLabel);
specimenFixationPourcentChp = new ChampSliderPourcentage(i18nC.specimenFixationPourcent());
etiquetteFieldSet.add(specimenFixationPourcentChp, new FormData(200, 0));
etiquetteFixationPourcentChp = new ChampSliderPourcentage(i18nC.etiquetteFixationPourcent());
etiquetteFieldSet.add(etiquetteFixationPourcentChp, new FormData(200, 0));
specimentMethodeFixationChp = new ChampCaseACocher(i18nC.specimenMethodeFixation(), "methodeFixation", true);
etiquetteFieldSet.add(specimentMethodeFixationChp);
etiquetteMethodeFixationSurSupportChp = new ChampCaseACocher(i18nC.etiquetteMethodeFixationSurSupport(), "methodeFixation", true);
etiquetteFieldSet.add(etiquetteMethodeFixationSurSupportChp);
etiquetteMethodeFixationSurSpecimenChp = new ChampCaseACocher(i18nC.etiquetteMethodeFixationSurSpecimen(), "methodeFixationSurSpecimen", true);
etiquetteFieldSet.add(etiquetteMethodeFixationSurSpecimenChp);
typeEcritureChp = new ChampCaseACocher(i18nC.typeEcriture(), "typeEcriture", false);
etiquetteFieldSet.add(typeEcritureChp);
this.add(etiquetteFieldSet);
}
private void creerFieldsetTraitement() {
FieldSet traitementFieldSet = new FieldSet();
traitementFieldSet.setHeadingHtml(i18nC.collectionTitreTraitement());
traitementFieldSet.setCollapsible(true);
traitementFieldSet.collapse();
traitementFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
traitementCombo = new ChampComboBoxListeValeurs(i18nC.collectionTraitement(), "onpi");
traitementCombo.setTrie("id_valeur");
traitementFieldSet.add(traitementCombo, new FormData(300, 0));
poisonTraitementChp = new ChampCaseACocher(i18nC.collectionTraitementPoison(), "poisonTraitement", true);
traitementFieldSet.add(poisonTraitementChp);
insecteTraitementChp = new ChampCaseACocher(i18nC.collectionTraitementInsecte(), "insecteTraitement", true);
traitementFieldSet.add(insecteTraitementChp);
 
this.add(traitementFieldSet);
}
private void creerFieldsetTypesUniteEtat() {
FieldSet etatTypesUniteFieldSet = new FieldSet();
// Etat général et nombre d'échantillons (à changer dans l'i18n
etatTypesUniteFieldSet.setHeadingHtml(i18nC.collectionEtatGeneralEtNombreEchantillons());
etatTypesUniteFieldSet.setCollapsible(true);
etatTypesUniteFieldSet.collapse();
etatTypesUniteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
etatUniteRangementCombo = creerSimpleComboBonMauvaisEtat(i18nC.collectionUniteRangementEtatGeneral());
etatTypesUniteFieldSet.add(etatUniteRangementCombo, new FormData(300, 0));
// Liasses et cartons d'herbier
Label labelcartonsHerbiersFormat = new Label(i18nC.collectionCartonsHerbiers());
labelcartonsHerbiersFormat.setStyleName("labelChampNombreFormat");
nbCartonsHerbier = new ChampNombre();
nbCartonsHerbier.setStyleName("champNombreFormat");
nbCartonsHerbier.setWidth(55);
nbCartonsHerbier.setEmptyText(i18nC.collectionUniteNbre());
cartonsHerbierFormat = new TextField<String>();
cartonsHerbierFormat.setStyleName("champNombreFormat");
cartonsHerbierFormat.setEmptyText(i18nC.collectionUniteFormat());
HorizontalPanel conteneurCartonsHerbiers = new HorizontalPanel();
conteneurCartonsHerbiers.setBorderWidth(0);
conteneurCartonsHerbiers.add(labelcartonsHerbiersFormat);
conteneurCartonsHerbiers.add(nbCartonsHerbier);
conteneurCartonsHerbiers.add(cartonsHerbierFormat);
etatTypesUniteFieldSet.add(conteneurCartonsHerbiers);
Label labelLiasses = new Label(i18nC.collectionLiasses());
labelLiasses.setStyleName("labelChampNombreFormat");
nbLiasses = new ChampNombre();
nbLiasses.setStyleName("champNombreFormat");
nbLiasses.setWidth(55);
nbLiasses.setEmptyText(i18nC.collectionUniteNbre());
liassesFormat = new TextField<String>();
liassesFormat.setStyleName("champNombreFormat");
liassesFormat.setEmptyText(i18nC.collectionUniteFormat());
HorizontalPanel conteneurLiasses = new HorizontalPanel();
conteneurLiasses.setBorderWidth(0);
conteneurLiasses.add(labelLiasses);
conteneurLiasses.add(nbLiasses);
conteneurLiasses.add(liassesFormat);
etatTypesUniteFieldSet.add(conteneurLiasses);
autresUnitesRangement = new TextArea();
autresUnitesRangement.setStyleName("textAreaAutreUniteRangement");
autresUnitesRangement.setHeight(90);
autresUnitesRangement.setFieldLabel(i18nC.collectionAutreUnitesRangement());
etatTypesUniteFieldSet.add(autresUnitesRangement);
planchesHerbier = new ChampNombre();
planchesHerbier.setFieldLabel(i18nC.collectionNbPlanchesHerbier());
nbEspeces = new ChampNombre();
nbEspeces.setFieldLabel(i18nC.collectionNbEspeces());
etatTypesUniteFieldSet.add(planchesHerbier);
etatTypesUniteFieldSet.add(nbEspeces);
add(etatTypesUniteFieldSet);
 
etatGeneralCombo = creerSimpleComboBonMauvaisEtat(i18nC.collectionEtatGeneral());
etatTypesUniteFieldSet.add(etatGeneralCombo, new FormData(300, 0));
specimenDegradationChp = new ChampMultiValeursMultiTypes(i18nC.degradationSpecimen(), 150, true);
specimenDegradationChp.initialiserType("specimenDegradation");
specimenDegradationChp.initialiserCombobox("niveauImportance");
etatTypesUniteFieldSet.add(specimenDegradationChp);
labelPresentationDegradationChp = new Text();
labelPresentationDegradationChp.setWidth("95%");
labelPresentationDegradationChp.setVisible(false);
presentationDegradationChp = new ChampMultiValeursMultiTypes(i18nC.degradationPresentation(), 150, 200, true);
presentationDegradationChp.initialiserType("supportDegradation");
presentationDegradationChp.initialiserCombobox("niveauImportance");
presentationDegradationChp.getTypes().addListener(Events.Select,
new Listener<FieldEvent>() {
public void handleEvent(FieldEvent be) {
if (((Valeur)(be.getField().getValue())).get("id_valeur").equals("2310")) {
labelPresentationDegradationChp.setText(i18nC.degradationPresentationLabel());
labelPresentationDegradationChp.setVisible(true);
}
else {
labelPresentationDegradationChp.setText("");
labelPresentationDegradationChp.setVisible(false);
}
}
});
etatTypesUniteFieldSet.add(presentationDegradationChp);
etatTypesUniteFieldSet.add(labelPresentationDegradationChp);
determinationCombo = new ChampComboBoxListeValeurs(i18nC.collectionDetermination(), "niveauDetermination");
determinationCombo.setTrie("id_valeur");
etatTypesUniteFieldSet.add(determinationCombo, new FormData(450, 0));
this.add(etatTypesUniteFieldSet);
}
public void peupler() {
initialiserCollection();
if (collectionBotanique != null) {
typesCollectionBotaCombo.peupler(collectionBotanique.getType());
if (!UtilString.isEmpty(collectionBotanique.getNbreEchantillon())) {
nbreEchantillonChp.setValue(Integer.parseInt(collectionBotanique.getNbreEchantillon()));
}
if(!collectionBotanique.getNbCartonsHerbiers().isEmpty()) {
nbCartonsHerbier.setValue((Integer.parseInt(collectionBotanique.getNbCartonsHerbiers())));
}
cartonsHerbierFormat.setValue(collectionBotanique.getFormatCartonsHerbiers());
if(!collectionBotanique.getNbLiasses().isEmpty()) {
nbLiasses.setValue((Integer.parseInt(collectionBotanique.getNbLiasses())));
}
liassesFormat.setValue(collectionBotanique.getFormatLiasses());
autresUnitesRangement.setValue(collectionBotanique.getAutresUnitesRangement());
 
remplirSimpleCombo(etatUniteRangementCombo, collectionBotanique.getUniteRangementEtat());
if(!collectionBotanique.getNbPlanchesHerbiers().isEmpty()) {
planchesHerbier.setValue((Integer.parseInt(collectionBotanique.getNbPlanchesHerbiers())));
}
if(!collectionBotanique.getNbEspeces().isEmpty()) {
nbEspeces.setValue((Integer.parseInt(collectionBotanique.getNbEspeces())));
}
typePapierConservationChp.peupler(collectionBotanique.getConservationPapierType());
methodeConservationChp.peupler(collectionBotanique.getConservationMethode());
specimenFixationPourcentChp.peupler(collectionBotanique.getSpecimenFixationPourcent());
etiquetteFixationPourcentChp.peupler(collectionBotanique.getEtiquetteFixationPourcent());
specimentMethodeFixationChp.peupler(collectionBotanique.getSpecimenFixationMethode());
etiquetteMethodeFixationSurSupportChp.peupler(collectionBotanique.getEtiquetteFixationSupport());
etiquetteMethodeFixationSurSpecimenChp.peupler(collectionBotanique.getEtiquetteFixationSpecimen());
typeEcritureChp.peupler(collectionBotanique.getEtiquetteEcriture());
traitementCombo.peupler(collectionBotanique.getTraitement());
poisonTraitementChp.peupler(collectionBotanique.getTraitementPoison());
insecteTraitementChp.peupler(collectionBotanique.getTraitementInsecte());
remplirSimpleCombo(etatGeneralCombo, collectionBotanique.getEtatGeneral());
specimenDegradationChp.peupler(collectionBotanique.getDegradationSpecimen());
presentationDegradationChp.peupler(collectionBotanique.getDegradationPresentation());
determinationCombo.peupler(collectionBotanique.getDetermination());
}
}
public void collecter() {
initialiserCollection();
if (etreAccede()) {
collectionBotaniqueCollectee.setType(typesCollectionBotaCombo.getValeur());
if (nbreEchantillonChp.getValue() != null) {
collectionBotaniqueCollectee.setNbreEchantillon(Integer.toString(nbreEchantillonChp.getValue().intValue()));
}
collectionBotaniqueCollectee.setNbCartonsHerbiers(nbCartonsHerbier.getValue()+"");
collectionBotaniqueCollectee.setFormatCartonsHerbiers(cartonsHerbierFormat.getValue());
collectionBotaniqueCollectee.setNbLiasses(nbLiasses.getValue()+"");
collectionBotaniqueCollectee.setFormatLiasses(liassesFormat.getValue());
collectionBotaniqueCollectee.setAutresUnitesRangement(autresUnitesRangement.getValue());
collectionBotaniqueCollectee.setUniteRangementEtat(etatUniteRangementCombo.getValue().getCle());
collectionBotaniqueCollectee.setNbPlanchesHerbiers(planchesHerbier.getValue()+"");
collectionBotaniqueCollectee.setNbEspeces(nbEspeces.getValue()+"");
collectionBotaniqueCollectee.setConservationPapierType(typePapierConservationChp.getValeur());
collectionBotaniqueCollectee.setConservationMethode(methodeConservationChp.getValeur());
collectionBotaniqueCollectee.setSpecimenFixationPourcent(specimenFixationPourcentChp.getValeur());
collectionBotaniqueCollectee.setEtiquetteFixationPourcent(etiquetteFixationPourcentChp.getValeur());
collectionBotaniqueCollectee.setSpecimenFixationMethode(specimentMethodeFixationChp.getValeur());
collectionBotaniqueCollectee.setEtiquetteFixationSupport(etiquetteMethodeFixationSurSupportChp.getValeur());
collectionBotaniqueCollectee.setEtiquetteFixationSpecimen(etiquetteMethodeFixationSurSpecimenChp.getValeur());
collectionBotaniqueCollectee.setEtiquetteEcriture(typeEcritureChp.getValeur());
collectionBotaniqueCollectee.setTraitement(traitementCombo.getValeur());
collectionBotaniqueCollectee.setTraitementPoison(poisonTraitementChp.getValeur());
collectionBotaniqueCollectee.setTraitementInsecte(insecteTraitementChp.getValeur());
collectionBotaniqueCollectee.setEtatGeneral(etatGeneralCombo.getValue().getCle());
collectionBotaniqueCollectee.setDegradationSpecimen(specimenDegradationChp.getValeurs());
collectionBotaniqueCollectee.setDegradationPresentation(presentationDegradationChp.getValeurs());
collectionBotaniqueCollectee.setDetermination(determinationCombo.getValeur());
}
}
 
private void initialiserCollection() {
collection = ((CollectionForm) formulaire).collection;
if (collection != null) {
collectionBotanique = collection.getBotanique();
}
collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
if (collectionCollectee != null) {
collectionBotaniqueCollectee = collectionCollectee.getBotanique();
}
}
public void remplirSimpleCombo(ComboBox<SimpleModelData> simpleCombo, String valeur) {
SimpleModelData selectionne = simpleCombo.getStore().findModel("cle", valeur);
simpleCombo.setValue(selectionne);
}
public ComboBox<SimpleModelData> creerSimpleComboBonMauvaisEtat(String label) {
ListStore<SimpleModelData> listeBonMauvaisEtat = OntologiesLocales.convertirVersListeStore(OntologiesLocales.getListeBonMauvaisEtat());
ComboBox<SimpleModelData> combo = new ComboBox<SimpleModelData>();
combo.setForceSelection(true);
combo.setTriggerAction(TriggerAction.ALL);
combo.setFieldLabel(label);
combo.setDisplayField("valeur");
combo.setValueField("cle");
listeBonMauvaisEtat.sort("ordre", SortDir.ASC);
combo.setStore(listeBonMauvaisEtat);
return combo;
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
rafraichirValeurListe(listeValeurs);
} else {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
}
private void rafraichirValeurListe(ValeurListe listeValeurs) {
if (listeValeurs.getId().equals(config.getListeId("typeUniteRangement"))) {
Iterator<String> it = listeValeurs.keySet().iterator();
while (it.hasNext()) {
Valeur valeur = listeValeurs.get(it.next());
UniteRangement unite = new UniteRangement();
unite.setId(valeur.getId());
unite.setType(valeur.getNom());
unite.setTypeAutre(false);
uniteRangementGrille.getStore().add(unite);
}
} else if (listeValeurs.getId().equals(config.getListeId("typeUniteBase"))) {
Iterator<String> it = listeValeurs.keySet().iterator();
while (it.hasNext()) {
Valeur valeur = listeValeurs.get(it.next());
UniteBase unite = new UniteBase();
unite.setId(valeur.getId());
unite.setType(valeur.getNom());
unite.setTypeAutre(false);
uniteBaseGrille.getStore().add(unite);
}
} else {
Debug.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!");
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/vues/collection/CollectionFormDescription.java:r11-933,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/collection/CollectionFormDescription.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/collection/CollectionFormDescription.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/collection/CollectionFormInventaire.java
New file
0,0 → 1,134
package org.tela_botanica.client.vues.collection;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampCaseACocher;
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
import org.tela_botanica.client.composants.ChampSliderPourcentage;
import org.tela_botanica.client.modeles.OntologiesLocales;
import org.tela_botanica.client.modeles.SimpleModelData;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireOnglet;
 
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.layout.FormData;
 
public class CollectionFormInventaire extends FormulaireOnglet {
 
public static final String ID = "inventaire";
private Collection collection = null;
private CollectionBotanique collectionBotanique = null;
private Collection collectionCollectee = null;
private CollectionBotanique collectionBotaniqueCollectee = null;
private ComboBox<SimpleModelData> existenceInventaireCombo = null;
private ComboBox<SimpleModelData> auteurInventaireCombo = null;
private ChampComboBoxListeValeurs formeInventaireCombo = null;
private TextArea infoInventaireChp = null;
private ChampCaseACocher digitalInventaireChp = null;
private ChampSliderPourcentage pourcentDigitalInventaireChp = null;
private ChampComboBoxListeValeurs etatInventaireCombo = null;
 
public CollectionFormInventaire(Formulaire formulaireCourrant) {
initialiserOnglet(formulaireCourrant);
setId(ID);
setText(Mediateur.i18nC.collectionInventaire());
int tabIndex = formulaireCourrant.tabIndex;
existenceInventaireCombo = creerSimpleComboOuiNonPeutEtre(i18nC.existenceInventaireCollection());
add(existenceInventaireCombo, new FormData(300, 0));
auteurInventaireCombo = creerSimpleComboOuiNonPeutEtre(i18nC.auteurInventaireCollection());
add(auteurInventaireCombo, new FormData(300, 0));
formeInventaireCombo = new ChampComboBoxListeValeurs(i18nC.formeInventaireCollection(), "inventaireForme", tabIndex++);
formeInventaireCombo.setTabIndex(tabIndex++);
add(formeInventaireCombo, new FormData(300, 0));
infoInventaireChp = new TextArea();
infoInventaireChp.setTabIndex(tabIndex++);
infoInventaireChp.setFieldLabel(i18nC.infoInventaireCollection());
add(infoInventaireChp, new FormData(550, 0));
digitalInventaireChp = new ChampCaseACocher(i18nC.digitalInventaireCollection(), "inventaireLogiciel", true);
add(digitalInventaireChp);
pourcentDigitalInventaireChp = new ChampSliderPourcentage(i18nC.pourcentDigitalInventaireCollection());
pourcentDigitalInventaireChp.setTabIndex(tabIndex++);
add(pourcentDigitalInventaireChp, new FormData(200, 0));
etatInventaireCombo = new ChampComboBoxListeValeurs(i18nC.etatInventaireCollection(), "inventaireEtat", tabIndex++);
etatInventaireCombo.setTabIndex(tabIndex++);
add(etatInventaireCombo, new FormData(300, 0));
}
public void peupler() {
initialiserCollection();
if (collectionBotanique != null) {
remplirSimpleCombo(existenceInventaireCombo, collectionBotanique.getInventaire());
remplirSimpleCombo(auteurInventaireCombo, collectionBotanique.getInventaireAuteur());
formeInventaireCombo.peupler(collectionBotanique.getInventaireForme());
infoInventaireChp.setValue(collectionBotanique.getInventaireInfo());
digitalInventaireChp.peupler(collectionBotanique.getInventaireDigital());
pourcentDigitalInventaireChp.peupler(collectionBotanique.getInventaireDigitalPourcent());
etatInventaireCombo.peupler(collectionBotanique.getInventaireEtat());
}
}
public void collecter() {
initialiserCollection();
if (etreAccede()) {
collectionBotaniqueCollectee.setInventaire(existenceInventaireCombo.getValue().getCle());
collectionBotaniqueCollectee.setInventaireAuteur(auteurInventaireCombo.getValue().getCle());
collectionBotaniqueCollectee.setInventaireForme(formeInventaireCombo.getValeur());
collectionBotaniqueCollectee.setInventaireInfo(infoInventaireChp.getValue());
collectionBotaniqueCollectee.setInventaireDigital(digitalInventaireChp.getValeur());
collectionBotaniqueCollectee.setInventaireDigitalPourcent(pourcentDigitalInventaireChp.getValeur());
collectionBotaniqueCollectee.setInventaireEtat(etatInventaireCombo.getValeur());
}
}
private void initialiserCollection() {
collection = ((CollectionForm) formulaire).collection;
if (collection != null) {
collectionBotanique = collection.getBotanique();
}
collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
if (collectionCollectee != null) {
collectionBotaniqueCollectee = collectionCollectee.getBotanique();
}
}
public void rafraichir(Object nouvellesDonnees) {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
public void remplirSimpleCombo(ComboBox<SimpleModelData> simpleCombo, String valeur) {
SimpleModelData selectionne = simpleCombo.getStore().findModel("cle", valeur);
simpleCombo.setValue(selectionne);
}
public ComboBox<SimpleModelData> creerSimpleComboOuiNonPeutEtre(String label) {
ListStore<SimpleModelData> listeOuiNonPeutEtre = OntologiesLocales.convertirVersListeStore(OntologiesLocales.getListeOuiNonPeutEtre());
ComboBox<SimpleModelData> combo = new ComboBox<SimpleModelData>();
combo.setForceSelection(true);
combo.setTriggerAction(TriggerAction.ALL);
combo.setFieldLabel(label);
combo.setDisplayField("valeur");
combo.setValueField("cle");
listeOuiNonPeutEtre.sort("ordre", SortDir.ASC);
combo.setStore(listeOuiNonPeutEtre);
return combo;
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/vues/collection/CollectionFormInventaire.java:r11-933,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/collection/CollectionFormInventaire.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/collection/CollectionFormInventaire.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/collection/CollectionFormPersonne.java
New file
0,0 → 1,681
package org.tela_botanica.client.vues.collection;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.GrillePaginable;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.ProxyCollectionAPersonne;
import org.tela_botanica.client.composants.pagination.ProxyPersonnes;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
import org.tela_botanica.client.modeles.collection.CollectionAPersonneListe;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.vues.FenetreForm;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireBarreValidation;
import org.tela_botanica.client.vues.FormulaireOnglet;
import org.tela_botanica.client.vues.personne.PersonneForm;
 
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.FieldEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.store.StoreEvent;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
import com.extjs.gxt.ui.client.widget.grid.HeaderGroupConfig;
import com.extjs.gxt.ui.client.widget.grid.RowNumberer;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
 
public class CollectionFormPersonne extends FormulaireOnglet implements Rafraichissable {
public static final String ID = "personne";
private Collection collection = null;
private static int idGenere = 1;
private ContentPanel panneauPrincipal = null;
private ToolBar barreOutils = null;
private GrillePaginable<ModelData> grille;
private ComboBox<Valeur> typeRelationCombo = null;
private CollectionAPersonneListe personnesAjoutees = null;
private CollectionAPersonneListe personnesSupprimees = null;
private ChampComboBoxRechercheTempsReelPaginable personnesSaisisComboBox = null;
private ChampComboBoxRechercheTempsReelPaginable recherchePersonnesCombo = null;
private Button personnesBoutonSupprimer = null;
private Button personnesBoutonModifier = null;
private ListStore<Valeur> listeIon = null;
private FenetreForm fenetreFormulaire = null;
private Sequenceur sequenceur = new Sequenceur();
public CollectionFormPersonne(Formulaire formulaireCourrant) {
initialiserOnglet(formulaireCourrant);
setLayout(new FitLayout());
setScrollMode(Scroll.AUTO);
setId(ID);
setText(Mediateur.i18nC.collectionPersonne());
setStyleAttribute("padding", "0");
initialiser();
panneauPrincipal = creerPanneauContenantGrille();
barreOutils = creerBarreOutilsGrille();
panneauPrincipal.setTopComponent(barreOutils);
grille = creerGrille();
panneauPrincipal.add(grille);
mediateur.obtenirListeValeurEtRafraichir(this, "ion", sequenceur);
mediateur.obtenirListeValeurEtRafraichir(this, "relationPersonneCollection", sequenceur);
add(panneauPrincipal);
}
private void initialiser() {
// Remise à zéro des modification dans la liste des auteurs
idGenere = 1;
personnesAjoutees = new CollectionAPersonneListe();
personnesSupprimees = new CollectionAPersonneListe();
collection = ((CollectionForm) formulaire).collection;
}
private ContentPanel creerPanneauContenantGrille() {
ContentPanel panneau = new ContentPanel();
panneau.setHeadingHtml(i18nC.collectionPersonneTitre());
panneau.setIcon(Images.ICONES.table());
panneau.setLayout(new FitLayout());
panneau.setFrame(true);
panneau.setScrollMode(Scroll.AUTO);
return panneau;
}
 
private ToolBar creerBarreOutilsGrille() {
ToolBar barreOutils = new ToolBar();
personnesSaisisComboBox = creerComboBoxPersonnesSaisies();
barreOutils.add(personnesSaisisComboBox);
barreOutils.add(new Text(" ou "));
Button ajouterPersonneBouton = creerBoutonAjouter();
barreOutils.add(ajouterPersonneBouton);
barreOutils.add(new SeparatorToolItem());
personnesBoutonModifier = creerBoutonModifier();
barreOutils.add(personnesBoutonModifier);
barreOutils.add(new SeparatorToolItem());
personnesBoutonSupprimer = creerBoutonSupprimer();
barreOutils.add(personnesBoutonSupprimer);
barreOutils.add(new SeparatorToolItem());
Button rafraichirPersonneBouton = creerBoutonRafraichir();
barreOutils.add(rafraichirPersonneBouton);
return barreOutils;
}
 
private Button creerBoutonAjouter() {
Button bouton = new Button(i18nC.ajouter());
bouton.setIcon(Images.ICONES.vcardAjouter());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
 
public void componentSelected(ButtonEvent ce) {
fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_AJOUTER);
fenetreFormulaire.show();
}
});
return bouton;
}
private Button creerBoutonModifier() {
Button bouton = new Button(i18nC.modifier());
bouton.setIcon(Images.ICONES.vcardModifier());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
CollectionAPersonne personneSaisiSelectionne = new CollectionAPersonne(grille.getSelection());
if (personneSaisiSelectionne == null) {
InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPersonne());
} else {
fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_MODIFIER);
fenetreFormulaire.show();
}
}
});
return bouton;
}
private FenetreForm creerFenetreModaleAvecFormulairePersonne(String mode) {
String personneId = null;
if (mode.equals(Formulaire.MODE_MODIFIER)) {
CollectionAPersonne personneSaisieSelectionnee = new CollectionAPersonne(grille.getSelection());
personneId = personneSaisieSelectionnee.getIdPersonne();
}
final FenetreForm fenetre = new FenetreForm("");
final PersonneForm formulaire = creerFormulairePersonne(fenetre, personneId);
fenetre.add(formulaire);
return fenetre;
}
private PersonneForm creerFormulairePersonne(final FenetreForm fenetre, String personneId) {
PersonneForm formulaire = new PersonneForm(mediateur, personneId, this);
FormPanel panneauFormulaire = formulaire.getFormulaire();
fenetre.setHeadingHtml(panneauFormulaire.getHeadingHtml());
panneauFormulaire.setHeaderVisible(false);
panneauFormulaire.setTopComponent(null);
 
// FIXME : avec GXT-2.1.0 la redéfinition du bottom component ne marche plus. Nous le cachons et en créeons un dans la fenêtre.
panneauFormulaire.getBottomComponent().hide();
SelectionListener<ButtonEvent> ecouteur = creerEcouteurValidationFormulairePersonne(fenetre, formulaire);
final ButtonBar barreValidation = new FormulaireBarreValidation(ecouteur);
fenetre.setBottomComponent(barreValidation);
return formulaire;
}
private SelectionListener<ButtonEvent> creerEcouteurValidationFormulairePersonne(final FenetreForm fenetre, final PersonneForm formulaire) {
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
String code = ((Button) ce.getComponent()).getData("code");
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
if (formulaire.soumettreFormulaire()) {
fenetre.hide();
}
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
formulaire.soumettreFormulaire();
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
fenetre.hide();
}
}
};
return ecouteur;
}
private Button creerBoutonSupprimer() {
Button bouton = new Button(i18nC.supprimer());
bouton.setIcon(Images.ICONES.vcardSupprimer());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
ModelData personneSaisiSelectionnee = grille.getSelection();
if (personneSaisiSelectionnee == null) {
InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPersonne());
} else {
supprimerDansGrille(personneSaisiSelectionnee);
}
}
});
return bouton;
}
private Button creerBoutonRafraichir() {
Button bouton = new Button(i18nC.rafraichir());
bouton.setIcon(Images.ICONES.rafraichir());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
actualiserGrille();
}
});
return bouton;
}
private ChampComboBoxRechercheTempsReelPaginable creerComboBoxPersonnesSaisies() {
ModelType modelTypePersonnes = new ModelType();
modelTypePersonnes.setRoot("personnes");
modelTypePersonnes.setTotalName("nbElements");
modelTypePersonnes.addField("cp_fmt_nom_complet");
modelTypePersonnes.addField("cp_id_personne");
modelTypePersonnes.addField("cp_nom");
modelTypePersonnes.addField("cp_prenom");
modelTypePersonnes.addField("cp_code_postal");
modelTypePersonnes.addField("cp_naissance_date");
modelTypePersonnes.addField("cp_naissance_lieu");
modelTypePersonnes.addField("cp_ce_deces");
modelTypePersonnes.addField("cp_deces_date");
modelTypePersonnes.addField("cp_deces_lieu");
String displayNamePersonnes = "cp_fmt_nom_complet";
ProxyPersonnes<ModelData> proxyPersonnes = new ProxyPersonnes<ModelData>(null);
recherchePersonnesCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyPersonnes, modelTypePersonnes, displayNamePersonnes);
recherchePersonnesCombo.getCombo().setForceSelection(true);
recherchePersonnesCombo.getCombo().setValidator(new Validator() {
public String validate(Field<?> field, String value) {
String retour = null;
if (field.getRawValue().equals("")) {
field.setValue(null);
} else if (recherchePersonnesCombo.getStore().findModel("cp_fmt_nom_complet", field.getRawValue()) == null) {
String contenuBrut = field.getRawValue();
field.setValue(null);
field.setRawValue(contenuBrut);
retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
}
return retour;
}
});
recherchePersonnesCombo.getCombo().addListener(Events.Select, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
if (personnesSaisisComboBox.getValeur() instanceof ModelData) {
Personne personneSaisiSelectionnee = new Personne(personnesSaisisComboBox.getValeur());
ajouterDansGrille(personneSaisiSelectionnee);
personnesSaisisComboBox.getCombo().setValue(null);
}
}
});
recherchePersonnesCombo.getCombo().setEmptyText("Rechercher et sélectionner une personne existante dans la base");
 
return recherchePersonnesCombo;
}
private void ajouterDansGrille(Personne personne) {
ajouterDansGrille(personne, null, 0);
}
private void ajouterDansGrille(Personne personne, String relation, int index) {
if (personne != null) {
CollectionAPersonne relationCollectionPersonne = new CollectionAPersonne();
relationCollectionPersonne.setPersonnePourGrillePaginable(personne);
relationCollectionPersonne.setIdPersonne(personne.getId());
relationCollectionPersonne.set("ccap_id_personne", personne.getId());
if (relation != null) {
relationCollectionPersonne.set("_role_", relation);
}
// Gestion de l'id de la collection
if (mode.equals(Formulaire.MODE_MODIFIER)) {
relationCollectionPersonne.setIdCollection(collection.getId());
}
relationCollectionPersonne.set("_etat_", aDonnee.ETAT_AJOUTE);
// FIXME besoin de ça ?
//corrigerChampsGrille(relationCollectionPersonne);
// Ajout à la grille
grille.getGrille().stopEditing();
grille.getGrille().getStore().insert(relationCollectionPersonne, index);
grille.getGrille().startEditing(index, 0);
grille.getGrille().getSelectionModel().select(index, false);
}
}
private void supprimerDansGrille(ModelData relationCollectionPersonne) {
CollectionAPersonne cap = new CollectionAPersonne(relationCollectionPersonne);
if (relationCollectionPersonne != null) {
// Ajout de la personne supprimée à la liste
if ((relationCollectionPersonne.get("_etat_") == null
|| relationCollectionPersonne.get("_etat_").equals("")
|| !relationCollectionPersonne.get("_etat_").equals(aDonnee.ETAT_AJOUTE))
&& cap.getId() != null
&& !cap.getId().equals("")) {
personnesSupprimees.put("id"+idGenere++, cap);
}
grille.getStore().remove(relationCollectionPersonne);
}
}
 
private GrillePaginable<ModelData> creerGrille() {
// ModelType
ModelType modelTypeCollectionAPersonne = new ModelType();
modelTypeCollectionAPersonne.setRoot("collectionsAPersonne");
modelTypeCollectionAPersonne.setTotalName("nbElements");
modelTypeCollectionAPersonne.addField("cp_fmt_nom_complet");
modelTypeCollectionAPersonne.addField("cp_nom");
modelTypeCollectionAPersonne.addField("cp_prenom");
modelTypeCollectionAPersonne.addField("cp_code_postal");
modelTypeCollectionAPersonne.addField("cp_naissance_date");
modelTypeCollectionAPersonne.addField("cp_naissance_lieu");
modelTypeCollectionAPersonne.addField("cp_ce_deces");
modelTypeCollectionAPersonne.addField("cp_deces_date");
modelTypeCollectionAPersonne.addField("cp_deces_lieu");
modelTypeCollectionAPersonne.addField("ccap_id_collection");
modelTypeCollectionAPersonne.addField("ccap_id_personne");
modelTypeCollectionAPersonne.addField("ccap_id_role");
// Proxy
ProxyCollectionAPersonne<ModelData> proxyCollectionAPersonne = new ProxyCollectionAPersonne<ModelData>(null, collection.getId(), null);
 
// Colonnes
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
colonnes.add(new RowNumberer());
colonnes.add(creerColonneRole());
colonnes.add(new ColumnConfig("cp_fmt_nom_complet", i18nC.personneNomComplet(), 150));
colonnes.add(new ColumnConfig("cp_nom", i18nC.personneNom(), 75));
colonnes.add(new ColumnConfig("cp_prenom", i18nC.personnePrenom(), 75));
colonnes.add(new ColumnConfig("cp_naissance_date", i18nC.date(), 75));
colonnes.add(new ColumnConfig("cp_naissance_lieu", i18nC.lieu(), 100));
colonnes.add(creerColonneDeces());
colonnes.add(new ColumnConfig("cp_deces_date", i18nC.date(), 75));
colonnes.add(new ColumnConfig("cp_deces_lieu", i18nC.lieu(), 100));
// Modèle de colonnes
ColumnModel modeleDeColonnes = new ColumnModel(colonnes);
modeleDeColonnes.addHeaderGroup(0, 1, new HeaderGroupConfig(i18nC.personneIdentite(), 1, 4));
modeleDeColonnes.addHeaderGroup(0, 5, new HeaderGroupConfig(i18nC.personneNaissance(), 1, 2));
modeleDeColonnes.addHeaderGroup(0, 7, new HeaderGroupConfig(i18nC.personneDeces(), 1, 3));
HashMap<String, String> virtualFields = new HashMap<String, String>();
virtualFields.put("_role_", "ccap_id_role");
virtualFields.put("_etat_", "");
// Grille
GrillePaginable<ModelData> grillePaginable = new GrillePaginable<ModelData>(modelTypeCollectionAPersonne, virtualFields, proxyCollectionAPersonne, colonnes, modeleDeColonnes);
// Rajouter des écouteurs
grillePaginable.getStore().addListener(Store.Update, new Listener<StoreEvent<ModelData>>() {
public void handleEvent(StoreEvent<ModelData> ce) {
if (ce.getRecord().isModified("_role_") && ce.getModel().get("_etat_") == null || !ce.getModel().get("_etat_").equals(aDonnee.ETAT_AJOUTE)) {
ce.getModel().set("_etat_", aDonnee.ETAT_MODIFIE);
}
}
});
return grillePaginable;
}
private ColumnConfig creerColonneRole() {
typeRelationCombo = new ComboBox<Valeur>();
typeRelationCombo.setForceSelection(true);
typeRelationCombo.setTriggerAction(TriggerAction.ALL);
typeRelationCombo.setDisplayField("nom");
typeRelationCombo.setStore(new ListStore<Valeur>());
typeRelationCombo.setEditable(false);
typeRelationCombo.addStyleName(ComposantClass.OBLIGATOIRE);
typeRelationCombo.addListener(Events.Select, Formulaire.creerEcouteurChampObligatoire());
 
CellEditor editeurRelation = new CellEditor(typeRelationCombo) {
// Sert à retourner un ModelData à partir d'une String (la string est passée par le Renderer)
public Object preProcessValue(Object valeur) {
Valeur retour = null;
if (valeur != null ) {
if (typeRelationCombo.getStore().findModel("nom", valeur.toString()) != null) {
retour = typeRelationCombo.getStore().findModel("nom", valeur.toString());
} else if (typeRelationCombo.getStore().findModel("abr", valeur.toString()) != null) {
retour = typeRelationCombo.getStore().findModel("abr", valeur.toString());
} else if (typeRelationCombo.getStore().findModel("id_valeur", valeur.toString()) != null) {
retour = typeRelationCombo.getStore().findModel("id_valeur", valeur.toString());
}
}
return retour;
}
// Sert à retourner un String à Partir d'une Valeur
// en postProcess on remplace la valeur du champ par l'Id de la valeur au lieu de son Nom
public Object postProcessValue(Object valeur) {
String retour = null;
if (valeur != null ) {
if (valeur instanceof Valeur) {
Valeur valeurOntologie = (Valeur) valeur;
String id = valeurOntologie.getId();
retour = id;
}
}
return retour;
}
};
// Sert à afficher le nom du role au lieu de l'id
GridCellRenderer<ModelData> relationRendu = new GridCellRenderer<ModelData>() {
public String render(ModelData modele, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ModelData> store, Grid<ModelData> grille) {
// Gestion du texte afficher dans la cellule
String role = modele.get("_role_");
if (typeRelationCombo.getStore() != null && typeRelationCombo.getStore().getCount() > 0 && role.matches("[0-9]+")) {
role = typeRelationCombo.getStore().findModel("id_valeur", role).getNom();
}
return role;
}
};
ColumnConfig typeRelationColonne = new ColumnConfig("_role_", i18nC.typeRelationPersonneCollection(), 75);
typeRelationColonne.setEditor(editeurRelation);
typeRelationColonne.setRenderer(relationRendu);
return typeRelationColonne;
}
public ColumnConfig creerColonneDeces() {
GridCellRenderer<ModelData> decesRendu = new GridCellRenderer<ModelData>() {
public String render(ModelData modele, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ModelData> store, Grid<ModelData> grid) {
CollectionAPersonne cap = new CollectionAPersonne(modele);
String deces = cap.getPersonne().getDeces();
deces = deces.equals("0") ? "" : deces;
if (listeIon != null && cap.getPersonne().getDeces().matches("[0-9]+")) {
Valeur valeurDeces = listeIon.findModel("id_valeur", cap.getPersonne().getDeces());
if(valeurDeces != null) {
deces = valeurDeces.getNom();
}
}
modele.set("_deces_", deces);
return deces;
}
};
ColumnConfig decesColonne = new ColumnConfig("_deces_", Mediateur.i18nC.personneDecedeeInterogation(), 50);
decesColonne.setRenderer(decesRendu);
return decesColonne;
}
public void actualiserEtatBoutonsBarreOutils() {
// Activation des boutons si la grille contient un élément
if (grille.getStore().getCount() > 0) {
personnesBoutonSupprimer.enable();
personnesBoutonModifier.enable();
}
// Désactivation des boutons si la grille ne contient plus d'élément
if (grille.getStore().getCount() == 0) {
personnesBoutonSupprimer.disable();
personnesBoutonModifier.disable();
}
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
rafraichirValeurListe(listeValeurs);
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
rafraichirInformation(info);
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
}
private void rafraichirValeurListe(ValeurListe listeValeurs) {
if (listeValeurs.getId().equals(config.getListeId("ion"))) {
listeIon = new ListStore<Valeur>();
listeIon.add(listeValeurs.toList());
} else if (listeValeurs.getId().equals(config.getListeId("relationPersonneCollection"))) {
Formulaire.rafraichirComboBox(listeValeurs, typeRelationCombo);
} else {
GWT.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!", null);
}
}
public void rafraichirInformation(Information info) {
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
}
String type = info.getType();
if (info.getType().equals("liste_collection_a_personne")) {
if (info.getDonnee(0) != null) {
collection.setPersonnesLiees((CollectionAPersonneListe) info.getDonnee(0));
}
} else if (info.getType().equals("ajout_collection")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
String collectionId = (String) info.getDonnee(0);
// Suite à la récupération de l'id de la collection nouvellement ajoutée nous ajoutons les personnes liées
// En mode AJOUT, il ne peut que y avoir des personnes liées ajoutées
mediateur.ajouterCollectionAPersonne(this, collectionId, personnesAjoutees);
}
} else if (type.equals("personne_modifiee")) {
if (info.getDonnee(0) != null) {
Personne personne = (Personne) info.getDonnee(0);
ModelData personneDansGrille = grille.getStore().findModel("ccap_id_personne", personne.getId());
int index = grille.getStore().indexOf(personneDansGrille);
grille.getStore().remove(personneDansGrille);
String role = "";
if(personneDansGrille != null) {
role = (String) personneDansGrille.get("_role_");
}
ajouterDansGrille(personne, role, index);
}
} else if (type.equals("personne_ajoutee")) {
if (info.getDonnee(0) != null) {
Personne personne = (Personne) info.getDonnee(0);
ajouterDansGrille(personne);
}
} else if (info.getType().equals("modif_collection_a_personne")) {
InfoLogger.display("Modification des personnes liées à la collection", info.toString());
} else if (info.getType().equals("suppression_collection_a_personne")) {
InfoLogger.display("Suppression des personnes liées à la collection", info.toString());
actualiserGrille();
} else if (info.getType().equals("ajout_collection_a_personne")) {
InfoLogger.display("Ajout des personnes liées à la collection", info.toString());
}
}
public ArrayList<String> verifier() {
ArrayList<String> messages = new ArrayList<String>();
String personneNumero = "";
int nbrePersonne = grille.getStore().getCount();
if (nbrePersonne > 0) {
for (int i = 0; i < nbrePersonne; i++) {
if (grille.getStore().getAt(i).get("_role_").equals("")) {
personneNumero += (i != 0 ? ", " : "")+(i+1);
}
}
if (!personneNumero.equals("")) {
messages.add("Veuillez indiquez le type de relation existant entre la collection et les personnes numéros : "+personneNumero);
}
}
return messages;
}
public void collecter() {
if (etreAccede()) {
int nbrePersonne = grille.getStore().getCount();
for (int i = 0; i < nbrePersonne; i++) {
CollectionAPersonne relationCollectionPersonne = new CollectionAPersonne(grille.getStore().getAt(i));
relationCollectionPersonne.set("_role_", grille.getStore().getAt(i).get("_role_"));
if (grille.getStore().getAt(i).get("_etat_") != null) {
if (grille.getStore().getAt(i).get("_etat_").equals(aDonnee.ETAT_MODIFIE)) {
// Comme il est impossible de modifier les relations nous supprimons l'ancien enregistrement et ajoutons un nouveau avec le nouveau id_role
personnesSupprimees.put("id"+idGenere++, relationCollectionPersonne);
CollectionAPersonne relationAAjouter = (CollectionAPersonne) relationCollectionPersonne.cloner(new CollectionAPersonne());
corrigerChampsGrille(relationAAjouter);// Nous modifions l'id_role
personnesAjoutees.put("id"+idGenere++, relationAAjouter);
}
if (grille.getStore().getAt(i).get("_etat_").equals(aDonnee.ETAT_AJOUTE)) {
corrigerChampsGrille(relationCollectionPersonne);// Nous modifions l'id_role
personnesAjoutees.put("id"+idGenere++, relationCollectionPersonne);
}
// Initialisation de la grille
grille.getStore().getAt(i).set("_etat_", "");
}
}
grille.getStore().commitChanges();
}
}
private void corrigerChampsGrille(CollectionAPersonne relationCollectionPersonne) {
String role = relationCollectionPersonne.get("_role_");
String champModele = "nom";
if (role.matches("[0-9]+")) {
champModele = "id_valeur";
}
 
if (typeRelationCombo.getStore().findModel(champModele, role) != null) {
String idRole = typeRelationCombo.getStore().findModel(champModele, role).getId();
relationCollectionPersonne.setIdRole(idRole);
}
}
 
public void soumettre() {
if (mode.equals(Formulaire.MODE_MODIFIER)) {
if (personnesAjoutees.size() == 0 && personnesSupprimees.size() == 0) {
//InfoLogger.display("Modification des personnes liées", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
} else {
// Ajout des relations CollectionAPersonne
if (personnesAjoutees.size() != 0) {
mediateur.ajouterCollectionAPersonne(this, collection.getId(), personnesAjoutees);
}
// Suppression des relations StructureAPersonne
if (personnesSupprimees.size() != 0) {
mediateur.supprimerCollectionAPersonne(this, personnesSupprimees);
}
}
}
}
private void actualiserGrille() {
if (mode.equals(Formulaire.MODE_MODIFIER)) {
mediateur.selectionnerCollectionAPersonne(this, collection.getId(), null, null);
} else {
grille.getStore().removeAll();
layout();
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/collection/CollectionFormPersonne.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/collection/CollectionFormPersonne.java:r11-933,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/collection/CollectionFormPersonne.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/collection/CollectionFormPublication.java
New file
0,0 → 1,621
package org.tela_botanica.client.vues.collection;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.GrillePaginable;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.ProxyCollectionAPublication;
import org.tela_botanica.client.composants.pagination.ProxyPublications;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionAPublication;
import org.tela_botanica.client.modeles.collection.CollectionAPublicationListe;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.vues.FenetreForm;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireBarreValidation;
import org.tela_botanica.client.vues.FormulaireOnglet;
import org.tela_botanica.client.vues.publication.PublicationForm;
 
import com.extjs.gxt.ui.client.core.XTemplate;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.store.StoreEvent;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnData;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.grid.GridCellRenderer;
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.grid.RowExpander;
import com.extjs.gxt.ui.client.widget.grid.RowNumberer;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
 
public class CollectionFormPublication extends FormulaireOnglet implements Rafraichissable {
public static final String ID = "publication";
private Collection collection = null;
private static int idGenere = 1;
private ContentPanel panneauPrincipal = null;
private ToolBar barreOutils = null;
private GrillePaginable<ModelData> grille;
private CollectionAPublicationListe publicationsAjoutees = null;
private CollectionAPublicationListe publicationsSupprimees = null;
private CollectionAPublicationListe publicationsModifiees = null;
private ChampComboBoxRechercheTempsReelPaginable publicationsSaisiesComboBox = null;
private Button publicationsBoutonSupprimer = null;
private Button publicationsBoutonModifier = null;
private FenetreForm fenetreFormulaire = null;
public boolean publicationsSontModifiees = false;
public CollectionFormPublication(Formulaire formulaireCourrant) {
initialiserOnglet(formulaireCourrant);
setId(ID);
setText(Mediateur.i18nC.collectionPublication());
setStyleAttribute("padding", "0");
initialiser();
panneauPrincipal = creerPanneauContenantGrille();
setLayout(new FitLayout());
barreOutils = creerBarreOutilsGrille();
panneauPrincipal.setTopComponent(barreOutils);
grille = creerGrille();
panneauPrincipal.setLayout(new FitLayout());
panneauPrincipal.add(grille);
add(panneauPrincipal);
}
private void initialiser() {
// Remise à zéro des modification dans la liste des auteurs
idGenere = 1;
publicationsAjoutees = new CollectionAPublicationListe();
publicationsSupprimees = new CollectionAPublicationListe();
publicationsModifiees = new CollectionAPublicationListe();
collection = ((CollectionForm) formulaire).collection;
}
private ContentPanel creerPanneauContenantGrille() {
ContentPanel panneau = new ContentPanel();
panneau.setHeadingHtml(i18nC.collectionPublicationTitre());
panneau.setIcon(Images.ICONES.table());
panneau.setLayout(new FitLayout());
panneau.setFrame(true);
return panneau;
}
 
private ToolBar creerBarreOutilsGrille() {
ToolBar barreOutils = new ToolBar();
 
publicationsSaisiesComboBox = creerComboBoxPublicationsSaisis();
barreOutils.add(publicationsSaisiesComboBox);
barreOutils.add(new Text(" ou "));
 
Button ajouterBouton = creerBoutonAjouter();
barreOutils.add(ajouterBouton);
barreOutils.add(new SeparatorToolItem());
publicationsBoutonModifier = creerBoutonModifier();
barreOutils.add(publicationsBoutonModifier);
barreOutils.add(new SeparatorToolItem());
publicationsBoutonSupprimer = creerBoutonSupprimer();
barreOutils.add(publicationsBoutonSupprimer);
barreOutils.add(new SeparatorToolItem());
 
return barreOutils;
}
 
private Button creerBoutonAjouter() {
Button bouton = new Button(i18nC.ajouter());
bouton.setIcon(Images.ICONES.vcardAjouter());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
fenetreFormulaire = creerFenetreModaleAvecFormulairePublication(Formulaire.MODE_AJOUTER);
fenetreFormulaire.show();
}
});
return bouton;
}
private Button creerBoutonModifier() {
Button bouton = new Button(i18nC.modifier());
bouton.setIcon(Images.ICONES.vcardModifier());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
ModelData publicationSaisieSelectionnee = grille.getGrille().getSelectionModel().getSelectedItem();
if (publicationSaisieSelectionnee == null) {
InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPublication());
} else {
fenetreFormulaire = creerFenetreModaleAvecFormulairePublication(Formulaire.MODE_MODIFIER);
fenetreFormulaire.show();
}
}
});
return bouton;
}
private FenetreForm creerFenetreModaleAvecFormulairePublication(String mode) {
String publicationId = null;
if (mode.equals(Formulaire.MODE_MODIFIER)) {
CollectionAPublication publicationSaisiSelectionne = new CollectionAPublication(grille.getGrille().getSelectionModel().getSelectedItem(), false);
publicationId = publicationSaisiSelectionne.getIdPublication();
}
final FenetreForm fenetre = new FenetreForm("");
final PublicationForm formulaire = creerFormulairePublication(fenetre, publicationId);
fenetre.add(formulaire);
return fenetre;
}
private PublicationForm creerFormulairePublication(final FenetreForm fenetre, final String publicationId) {
PublicationForm formulairePublication = new PublicationForm(mediateur, publicationId, this);
FormPanel panneauFormulaire = formulairePublication.getFormulaire();
fenetre.setHeadingHtml(panneauFormulaire.getHeadingHtml());
panneauFormulaire.setHeaderVisible(false);
panneauFormulaire.setTopComponent(null);
// FIXME : avec GXT-2.1.0 la redéfinition du bottom component ne marche plus. Nous le cachons et en créeons un dans la fenêtre.
panneauFormulaire.getBottomComponent().hide();
SelectionListener<ButtonEvent> ecouteur = creerEcouteurValidationFormulairePublication(fenetre, formulairePublication);
final ButtonBar barreValidation = new FormulaireBarreValidation(ecouteur);
fenetre.setBottomComponent(barreValidation);
return formulairePublication;
}
private SelectionListener<ButtonEvent> creerEcouteurValidationFormulairePublication(final FenetreForm fenetre, final PublicationForm formulaire) {
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
String code = ((Button) ce.getComponent()).getData("code");
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
if (formulaire.soumettreFormulaire()) {
fenetre.hide();
}
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
formulaire.soumettreFormulaire();
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
fenetre.hide();
}
}
};
return ecouteur;
}
private Button creerBoutonSupprimer() {
Button bouton = new Button(i18nC.supprimer());
bouton.setIcon(Images.ICONES.vcardSupprimer());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
List<ModelData> listeDonneesSelectionnees = grille.getGrille().getSelectionModel().getSelectedItems();
for (ModelData donneeSelectionnee : listeDonneesSelectionnees) {
CollectionAPublication publicationSaisieSelectionnee = new CollectionAPublication(grille.getGrille().getSelectionModel().getSelectedItem(), false);
supprimerDansGrille(publicationSaisieSelectionnee, donneeSelectionnee);
}
}
});
return bouton;
}
 
private void actualiserGrille() {
if (mode.equals(Formulaire.MODE_MODIFIER)) {
mediateur.selectionnerCollectionAPublication(this, collection.getId(), null);
} else {
grille.getStore().removeAll();
layout();
}
}
private ChampComboBoxRechercheTempsReelPaginable creerComboBoxPublicationsSaisis() {
ModelType modelTypePublications = new ModelType();
modelTypePublications.setRoot("publications");
modelTypePublications.setTotalName("nbElements");
modelTypePublications.addField("ccapu_id_collection");
modelTypePublications.addField("ccapu_id_publication");
modelTypePublications.addField("ccapu_source");
modelTypePublications.addField("cc_nom");
modelTypePublications.addField("cc_id_collection");
modelTypePublications.addField("cpu_id_publication");
modelTypePublications.addField("cpu_fmt_nom_complet");
modelTypePublications.addField("cpu_titre");
modelTypePublications.addField("cpu_nom");
modelTypePublications.addField("cpu_fmt_auteur");
modelTypePublications.addField("cpu_indication_nvt");
modelTypePublications.addField("cpu_truk_pages");
modelTypePublications.addField("cpu_fascicule");
modelTypePublications.addField("cpu_date_parution");
modelTypePublications.addField("cpu_ce_truk_editeur");
String displayNamePublications = "cpu_fmt_nom_complet";
ProxyPublications<ModelData> proxyPublications= new ProxyPublications<ModelData>(null);
final ChampComboBoxRechercheTempsReelPaginable publicationsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyPublications, modelTypePublications, displayNamePublications);
publicationsCombo.getCombo().setTabIndex(tabIndex++);
publicationsCombo.getCombo().setForceSelection(true);
publicationsCombo.getCombo().setValidator(new Validator() {
public String validate(Field<?> field, String value) {
String retour = null;
if (field.getRawValue().equals("")) {
field.setValue(null);
} else if (publicationsCombo.getStore().findModel("cpu_fmt_nom_complet", field.getRawValue()) == null) {
String contenuBrut = field.getRawValue();
field.setValue(null);
field.setRawValue(contenuBrut);
retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
}
return retour;
}
});
publicationsCombo.getCombo().setEmptyText("Rechercher et sélectionner une publication existante dans la base");
publicationsCombo.getCombo().addListener(Events.Select, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
if (publicationsSaisiesComboBox.getValeur() instanceof ModelData) {
Publication publicationSaisieSelectionne = new Publication(publicationsSaisiesComboBox.getValeur(), false);
ajouterDansGrille(publicationSaisieSelectionne);
publicationsSaisiesComboBox.getCombo().setValue(null);
}
}
});
return publicationsCombo;
}
private void ajouterDansGrille(Publication publication) {
ajouterDansGrille(publication, 0);
}
private void ajouterDansGrille(Publication publication, int index) {
if (publication != null) {
CollectionAPublication publicationLiee = new CollectionAPublication(false);
publicationLiee.setPublication(publication);
publicationLiee.setIdPublication(publication.getId());
// Gestion de l'id de la collection
if (mode.equals(Formulaire.MODE_MODIFIER)) {
publicationLiee.setIdCollection(collection.getId());
}
// ajout au cache si nécessaire
if(!Publication.publisSaisiesModifieesCache.containsKey(publication.getId())) {
Publication.publisSaisiesModifieesCache.put(publication.getId(), publication);
}
publicationLiee.set("_etat_", aDonnee.ETAT_AJOUTE);
grille.getGrille().stopEditing();
grille.getGrille().getStore().insert(publicationLiee, index);
grille.getGrille().startEditing(index, 0);
grille.getGrille().getSelectionModel().select(index, false);
}
}
private void supprimerDansGrille(CollectionAPublication publicationLiee, ModelData publicationLieeModele) {
if (publicationLiee != null) {
// Ajout de la personne supprimée à la liste
if ((publicationLiee.get("_etat_").equals("") || !publicationLiee.get("_etat_").equals(aDonnee.ETAT_AJOUTE))
&& publicationLiee.getId() != null
&& !publicationLiee.getId().equals("")) {
publicationsSupprimees.put("id"+idGenere++, publicationLiee);
}
// Suppression de l'enregistrement de la grille
grille.getStore().remove(publicationLieeModele);
}
}
private GrillePaginable<ModelData> creerGrille() {
GrillePaginable<ModelData> grillePublications = null;
// ModelType
ModelType modelTypeCollectionAPublication = new ModelType();
modelTypeCollectionAPublication.setRoot("collectionsAPublication");
modelTypeCollectionAPublication.setTotalName("nbElements");
modelTypeCollectionAPublication.addField("ccapu_id_collection");
modelTypeCollectionAPublication.addField("ccapu_id_publication");
modelTypeCollectionAPublication.addField("ccapu_source");
modelTypeCollectionAPublication.addField("ccapu_mark_licence");
modelTypeCollectionAPublication.addField("cpu_id_publication");
modelTypeCollectionAPublication.addField("cpu_fmt_auteur");
modelTypeCollectionAPublication.addField("cpu_titre");
modelTypeCollectionAPublication.addField("cpu_collection");
modelTypeCollectionAPublication.addField("cpu_ce_truk_editeur");
modelTypeCollectionAPublication.addField("cpu_date_parution");
modelTypeCollectionAPublication.addField("cpu_fascicule");
modelTypeCollectionAPublication.addField("cpu_truk_pages");
modelTypeCollectionAPublication.addField("cpu_indication_nvt");
// Proxy
ProxyCollectionAPublication<ModelData> proxyCollectionAPublication = new ProxyCollectionAPublication<ModelData>(null, collection.getId());
 
// Colonnes
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
RowNumberer numeroPlugin = new RowNumberer();
numeroPlugin.setHeaderHtml("#");
XTemplate infoTpl = XTemplate.create("<p>"+
"<span style='font-weight:bold;'>"+i18nC.publicationAuteurs()+" :</span> {cpu_fmt_auteur}<br />"+
"<span style='font-weight:bold;'>"+i18nC.publicationTitre()+" :</span> {cpu_titre}<br />"+
"<span style='font-weight:bold;'>"+i18nC.publicationRevueCollection()+" :</span> {cpu_collection}<br />"+
"<span style='font-weight:bold;'>"+i18nC.publicationEditeur()+" :</span> {_editeur_}"+
"</p>");
RowExpander expansionPlugin = new RowExpander();
expansionPlugin.setTemplate(infoTpl);
colonnes.add(expansionPlugin);
ColumnConfig sourceColonne = new ColumnConfig("ccapu_source", i18nC.collectionPublicationSource(), 60);
sourceColonne.setRenderer(new GridCellRenderer<ModelData>() {
@Override
public Object render(ModelData model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<ModelData> store, Grid<ModelData> grid) {
CheckBox cbSource = new CheckBox();
boolean source = model.get("ccapu_source") != null && model.get("ccapu_source").equals("1");
Publication publiFromCache = Publication.publisSaisiesModifieesCache.get((new CollectionAPublication(model, false)).getPublication().getId());
if(publiFromCache != null) {
source = publiFromCache.get("ccapu_source") != null && publiFromCache.get("ccapu_source").equals("1");
}
cbSource.setValue(source);
 
final Integer ligne = rowIndex;
final ModelData ceModele = model;
cbSource.addListener(Events.Change, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
String estSource = ((CheckBox)be.getSource()).getValue() ? "1" : "0";
ceModele.set("ccapu_source", estSource);
if (!(ceModele.get("_etat_") != null && ceModele.get("_etat_").equals(aDonnee.ETAT_AJOUTE))) {
ceModele.set("_etat_", aDonnee.ETAT_MODIFIE);
}
grille.getStore().commitChanges();
}
});
return cbSource;
}
});
colonnes.add(sourceColonne);
colonnes.add(numeroPlugin);
colonnes.add(new ColumnConfig("cpu_fmt_auteur", i18nC.publicationAuteurs(), 135));
colonnes.add(new ColumnConfig("cpu_titre", i18nC.publicationTitre(), 135));
colonnes.add(new ColumnConfig("cpu_collection", i18nC.publicationRevueCollection(), 100));
colonnes.add(creerColonneEditeur());
colonnes.add(creerColonneAnneePublication());
colonnes.add(new ColumnConfig("cpu_indication_nvt", i18nC.publicationNvt(), 75));
colonnes.add(new ColumnConfig("cpu_fascicule", i18nC.publicationFascicule(), 70));
colonnes.add(new ColumnConfig("cpu_truk_pages", i18nC.publicationPage(), 50));
HashMap<String, String> virtualFields = new HashMap<String, String>();
virtualFields.put("_editeur_", "cpu_ce_truk_editeur");
virtualFields.put("_annee_", "cpu_date_parution");
virtualFields.put("_etat_", "");
// Modele de selection
GridSelectionModel<ModelData> modeleDeSelection = new GridSelectionModel<ModelData>();
ColumnModel modeleDeColonnes = new ColumnModel(colonnes);
modeleDeColonnes.getColumn(0).setWidget(Images.ICONES.information().createImage(), "Info");
// Grille
grillePublications = new GrillePaginable<ModelData>(modelTypeCollectionAPublication, virtualFields, proxyCollectionAPublication, colonnes, modeleDeColonnes);
grillePublications.getGrille().setBorders(true);
grillePublications.getGrille().setSelectionModel(modeleDeSelection);
grillePublications.getGrille().addPlugin(expansionPlugin);
grillePublications.getGrille().addPlugin(numeroPlugin);
grillePublications.getGrille().getView().setForceFit(true);
grillePublications.getGrille().setAutoExpandColumn("titre");
grillePublications.getGrille().setStripeRows(true);
grillePublications.getGrille().setTrackMouseOver(true);
// Rajouter des écouteurs
grillePublications.getStore().addListener(Store.Add, new Listener<StoreEvent<ModelData>>() {
public void handleEvent(StoreEvent<ModelData> ce) {
actualiserEtatBoutonsBarreOutils();
}
});
grillePublications.getStore().addListener(Store.Remove, new Listener<StoreEvent<ModelData>>() {
public void handleEvent(StoreEvent<ModelData> ce) {
actualiserEtatBoutonsBarreOutils();
}
});
return grillePublications;
}
private ColumnConfig creerColonneEditeur() {
GridCellRenderer<ModelData> editeurRendu = new GridCellRenderer<ModelData>() {
public String render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ModelData> store, Grid<ModelData> grid) {
String editeur = (new CollectionAPublication(model, false)).getPublication().getNomEditeur();
// Des fois l'éditeur est vide, là intervient le caché fabriqué dans publication
if(editeur.isEmpty() && Publication.publisSaisiesModifieesCache.containsKey((new CollectionAPublication(model, false)).getPublication().getId())) {
editeur = Publication.publisSaisiesModifieesCache.get((new CollectionAPublication(model, false)).getPublication().getId()).getNomEditeur();
}
model.set("_editeur_", editeur);
return editeur;
}
};
ColumnConfig editeurColonne = new ColumnConfig("_editeur_", Mediateur.i18nC.publicationEditeur(), 130);
editeurColonne.setRenderer(editeurRendu);
return editeurColonne;
}
private ColumnConfig creerColonneAnneePublication() {
GridCellRenderer<ModelData> datePublicationRendu = new GridCellRenderer<ModelData>() {
public String render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex, ListStore<ModelData> store, Grid<ModelData> grid) {
String annee = (new CollectionAPublication(model, false)).getPublication().getAnneeParution();
if(annee.isEmpty() && Publication.publisSaisiesModifieesCache.containsKey((new CollectionAPublication(model, false)).getPublication().getId())) {
annee = Publication.publisSaisiesModifieesCache.get((new CollectionAPublication(model, false)).getPublication().getId()).getAnneeParution();
}
model.set("_annee_", annee);
return annee;
}
};
ColumnConfig datePublicationColonne = new ColumnConfig("_annee_", Mediateur.i18nC.publicationDateParution(), 40);
datePublicationColonne.setRenderer(datePublicationRendu);
return datePublicationColonne;
}
 
public void actualiserEtatBoutonsBarreOutils() {
// Activation des boutons si la grille contient un élément
if (grille.getStore().getCount() > 0) {
publicationsBoutonSupprimer.enable();
publicationsBoutonModifier.enable();
}
// Désactivation des boutons si la grille ne contient plus d'élément
if (grille.getStore().getCount() == 0) {
publicationsBoutonSupprimer.disable();
publicationsBoutonModifier.disable();
}
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
rafraichirInformation(info);
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
}
public void rafraichirInformation(Information info) {
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
}
String type = info.getType();
if (type.equals("liste_collection_a_publication")) {
if (info.getDonnee(0) != null) {
initialiser();
collection.setPublicationsLiees((CollectionAPublicationListe) info.getDonnee(0));
peupler();
}
} else if (info.getType().equals("ajout_collection")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
String collectionId = (String) info.getDonnee(0);
// Suite à la récupération de l'id de la collection nouvellement ajoutée nous ajoutons les publications liées
// En mode AJOUT, il ne peut que y avoir des publications liées ajoutées
mediateur.ajouterCollectionAPublication(this, collectionId, publicationsAjoutees);
}
} else if (type.equals("publication_modifiee")) {
if (info.getDonnee(0) != null) {
Publication publication = (Publication) info.getDonnee(0);
ModelData publicationDansGrille = null;
publicationDansGrille = grille.getStore().findModel("cpu_id_publication", publication.getId());
publication.set("ccapu_source", publicationDansGrille.get("ccapu_source"));
int index = grille.getStore().indexOf(publicationDansGrille);
grille.getStore().remove(publicationDansGrille);
ajouterDansGrille(publication, index);
}
} else if (type.equals("publication_ajoutee")) {
if (info.getDonnee(0) != null) {
Publication publication = (Publication) info.getDonnee(0);
ajouterDansGrille(publication);
}
} else if (type.equals("suppression_collection_a_publication")) {
InfoLogger.display("Suppression des publications liées à la collection", info.toString());
} else if (type.equals("ajout_collection_a_publication")) {
InfoLogger.display("Ajout des publications liées à la collection", info.toString());
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(info.getClass(), this.getClass()), null);
}
}
 
public void peupler() {
grille.getStore().removeAll();
grille.getStore().add(collection.getPublicationsLiees().toList());
layout();
InfoLogger.display(i18nC.chargementPublication(), i18nC.ok());
}
 
public void collecter() {
if (etreAccede()) {
int nbrePublication = grille.getStore().getCount();
for (int i = 0; i < nbrePublication; i++) {
ModelData publicationLiee = grille.getStore().getAt(i);
CollectionAPublication cap = new CollectionAPublication(grille.getStore().getAt(i), false);
if (publicationLiee.get("_etat_") != null) {
if (publicationLiee.get("_etat_").equals(aDonnee.ETAT_MODIFIE)) {
publicationsModifiees.put(cap.getIdPublication(), cap);
}
if (publicationLiee.get("_etat_").equals(aDonnee.ETAT_AJOUTE)) {
publicationsAjoutees.put("id"+idGenere++, cap);
}
// Initialisation de la grille
publicationLiee.set("_etat_", "");
}
}
grille.getStore().commitChanges();
}
}
public void soumettre() {
if (mode.equals(Formulaire.MODE_MODIFIER)) {
if (publicationsAjoutees.size() == 0 && publicationsSupprimees.size() == 0 && publicationsModifiees.size() == 0) {
//InfoLogger.display("Modification des publications liées", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
} else {
//Window.alert(publicationsAjoutees.size()+" | "+publicationsSupprimees.size()+" | "+publicationsModifiees.size());
publicationsSontModifiees = true;
// Ajout des relations CollectionAPublication
if (publicationsAjoutees.size() != 0) {
mediateur.ajouterCollectionAPublication(this, collection.getId(), publicationsAjoutees);
}
// Modification des relations CollectionAPublication
if (publicationsModifiees.size() != 0) {
mediateur.modifierCollectionAPublication(this, publicationsModifiees);
}
// Suppression des relations CollectionAPublication
if (publicationsSupprimees.size() != 0) {
mediateur.supprimerCollectionAPublication(this, publicationsSupprimees);
}
}
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/collection/CollectionFormPublication.java:r1136-1368
Merged /branches/v1.8-narince/src/org/tela_botanica/client/vues/collection/CollectionFormPublication.java:r1891-1892
Merged /trunk/src/org/tela_botanica/client/vues/collection/CollectionFormPublication.java:r11-933,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/collection/CollectionFormPublication.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/collection/CollectionFormContenu.java
New file
0,0 → 1,278
package org.tela_botanica.client.vues.collection;
 
import java.util.HashMap;
import java.util.Iterator;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampCaseACocher;
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
import org.tela_botanica.client.composants.ChampSliderPourcentage;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.Pattern;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireOnglet;
 
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.layout.FormData;
 
public class CollectionFormContenu extends FormulaireOnglet implements Rafraichissable {
public static final String ID = "contenu";
private Collection collection = null;
private CollectionBotanique collectionBotanique = null;
private Collection collectionCollectee = null;
private CollectionBotanique collectionBotaniqueCollectee = null;
private ChampCaseACocher natureChp = null;
private TextArea specialiteChp = null;
private TextArea annotationClassementChp = null;
private ChampComboBoxListeValeurs etatClassementCombo = null;
private ChampComboBoxListeValeurs precisionDateCombo = null;
private ChampComboBoxListeValeurs precisionLocaliteCombo = null;
private TextArea etiquetteAnnotationChp = null;
private ChampComboBoxListeValeurs integreCollectionCombo = null;
private ChampComboBoxListeValeurs infoIntegreCollectionCombo = null;
private ChampSliderPourcentage auteurTitrePourcentChp;
private ChampSliderPourcentage famillePourcentChp;
private ChampSliderPourcentage genrePourcentChp;
private ChampSliderPourcentage spPourcentChp;
private ChampSliderPourcentage auteurSpPourcentChp;
private ChampSliderPourcentage localitePourcentChp;
private ChampSliderPourcentage datePourcentChp;
 
public CollectionFormContenu(Formulaire formulaireCourrant) {
initialiserOnglet(formulaireCourrant);
setId(ID);
setText(Mediateur.i18nC.collectionContenu());
creerFieldsetNature();
// TODO : réaliser un champ couverture géographique détaillé
creerFieldsetClassement();
creerFieldsetEtiquette();
creerFieldsetIntegration();
}
private void creerFieldsetNature() {
FieldSet natureFieldSet = new FieldSet();
natureFieldSet.setHeadingHtml(i18nC.collectionNatureTitre());
natureFieldSet.setCollapsible(true);
natureFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
natureChp = new ChampCaseACocher(i18nC.natureVegetaleContenu(), "natureVegetale", false);
natureFieldSet.add(natureChp);
specialiteChp = new TextArea();
specialiteChp.setFieldLabel(i18nC.specialiteCollection());
specialiteChp.setToolTip(i18nC.specialiteCollectionInfo());
natureFieldSet.add(specialiteChp, new FormData(550, 0));
add(natureFieldSet);
}
 
private void creerFieldsetClassement() {
FieldSet classementFieldSet = new FieldSet();
classementFieldSet.setHeadingHtml(i18nC.collectionClassementTitre());
classementFieldSet.setCollapsible(true);
classementFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
 
etatClassementCombo = new ChampComboBoxListeValeurs(i18nC.etatClassementCollection(), "etatClassement", tabIndex++);
classementFieldSet.add(etatClassementCombo, new FormData(550, 0));
 
annotationClassementChp = new TextArea();
annotationClassementChp.setFieldLabel(i18nC.annotationClassementCollection());
classementFieldSet.add(annotationClassementChp, new FormData(550, 0));
Text infoClassement = new Text(i18nC.annotationClassementCollectionInfo());
classementFieldSet.add(infoClassement);
add(classementFieldSet);
}
private void creerFieldsetEtiquette() {
FieldSet etiquetteFieldSet = new FieldSet();
etiquetteFieldSet.setHeadingHtml(i18nC.collectionEtiquetteTitre());
etiquetteFieldSet.setCollapsible(true);
etiquetteFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
Text renseignementPoucentLabel = new Text(i18nC.renseignementEtiquetteCollection());
renseignementPoucentLabel.setTagName("label");
renseignementPoucentLabel.setStyleName("x-form-item-label");
etiquetteFieldSet.add(renseignementPoucentLabel);
auteurTitrePourcentChp = new ChampSliderPourcentage(i18nC.auteurTitrePourcentCollection());
etiquetteFieldSet.add(auteurTitrePourcentChp, new FormData(200, 0));
famillePourcentChp = new ChampSliderPourcentage(i18nC.famillePourcentCollection());
etiquetteFieldSet.add(famillePourcentChp, new FormData(200, 0));
genrePourcentChp = new ChampSliderPourcentage(i18nC.genrePourcentCollection());
etiquetteFieldSet.add(genrePourcentChp, new FormData(200, 0));
spPourcentChp = new ChampSliderPourcentage(i18nC.spPourcentCollection());
etiquetteFieldSet.add(spPourcentChp, new FormData(200, 0));
auteurSpPourcentChp = new ChampSliderPourcentage(i18nC.auteurSpPourcentCollection());
etiquetteFieldSet.add(auteurSpPourcentChp, new FormData(200, 0));
localitePourcentChp = new ChampSliderPourcentage(i18nC.localitePourcentCollection());
etiquetteFieldSet.add(localitePourcentChp, new FormData(200, 0));
datePourcentChp = new ChampSliderPourcentage(i18nC.datePourcentCollection());
etiquetteFieldSet.add(datePourcentChp, new FormData(200, 0));
precisionLocaliteCombo = new ChampComboBoxListeValeurs(i18nC.precisionLocaliteCollection(), "onep", tabIndex++);
etiquetteFieldSet.add(precisionLocaliteCombo);
precisionDateCombo = new ChampComboBoxListeValeurs(i18nC.precisionDateCollection(), "onep", tabIndex++);
etiquetteFieldSet.add(precisionDateCombo);
 
etiquetteAnnotationChp = new TextArea();
etiquetteAnnotationChp.setFieldLabel(i18nC.etiquetteAnnotationCollection());
etiquetteAnnotationChp.setToolTip(i18nC.etiquetteAnnotationCollectionInfo());
etiquetteFieldSet.add(etiquetteAnnotationChp, new FormData(550, 0));
add(etiquetteFieldSet);
}
private String collecterEtiquetteRenseignement() {
String renseignement = "";
renseignement += creerTypeValeur("AT", auteurTitrePourcentChp.getValeur());
renseignement += creerTypeValeur("F", famillePourcentChp.getValeur());
renseignement += creerTypeValeur("G", genrePourcentChp.getValeur());
renseignement += creerTypeValeur("SP", spPourcentChp.getValeur());
renseignement += creerTypeValeur("ASP", auteurSpPourcentChp.getValeur());
renseignement += creerTypeValeur("L", localitePourcentChp.getValeur());
renseignement += creerTypeValeur("D", datePourcentChp.getValeur());
renseignement = renseignement.replaceFirst(aDonnee.SEPARATEUR_VALEURS+"$", "");
return renseignement;
}
private String creerTypeValeur(String type, String valeur) {
String retour = "";
if (!UtilString.isEmpty(valeur)) {
retour = type+aDonnee.SEPARATEUR_TYPE_VALEUR+valeur+aDonnee.SEPARATEUR_VALEURS;
}
return retour;
}
private void peuplerEtiquetteRenseignement(String valeurTruk) {
HashMap<String,String> infos = parserEtiquetteRenseignement(valeurTruk);
if (infos != null) {
Iterator<String> it = infos.keySet().iterator();
while (it.hasNext()) {
String cle = it.next();
if (cle.equals("AT")) {
auteurTitrePourcentChp.peupler(infos.get(cle));
} else if (cle.equals("F")) {
famillePourcentChp.peupler(infos.get(cle));
} else if (cle.equals("G")) {
genrePourcentChp.peupler(infos.get(cle));
} else if (cle.equals("SP")) {
spPourcentChp.peupler(infos.get(cle));
} else if (cle.equals("ASP")) {
auteurSpPourcentChp.peupler(infos.get(cle));
} else if (cle.equals("L")) {
localitePourcentChp.peupler(infos.get(cle));
} else if (cle.equals("D")) {
datePourcentChp.peupler(infos.get(cle));
}
}
}
}
public static HashMap<String,String> parserEtiquetteRenseignement(String valeurTruk) {
HashMap<String,String> infos = null;
if (!UtilString.isEmpty(valeurTruk)) {
infos = new HashMap<String,String>();
String[] pourcentages = valeurTruk.split(Pattern.quote(aDonnee.SEPARATEUR_VALEURS));
for (int i = 0; i < pourcentages.length; i++) {
String[] pourcentageIdValeur = pourcentages[i].split(Pattern.quote(aDonnee.SEPARATEUR_TYPE_VALEUR));
String id = pourcentageIdValeur[0];
String valeur = pourcentageIdValeur[1];
infos.put(id, valeur);
}
}
return infos;
}
private void creerFieldsetIntegration() {
FieldSet integrationFieldSet = new FieldSet();
integrationFieldSet.setHeadingHtml(i18nC.collectionIntegreeTitre());
integrationFieldSet.setCollapsible(true);
integrationFieldSet.setLayout(Formulaire.creerFormLayout(350, alignementLabelDefaut));
integreCollectionCombo = new ChampComboBoxListeValeurs(i18nC.integreCollection(), "onpi", tabIndex++);
integrationFieldSet.add(integreCollectionCombo);
infoIntegreCollectionCombo = new ChampComboBoxListeValeurs(i18nC.infoIntegreCollection(), "onp", tabIndex++);
integrationFieldSet.add(infoIntegreCollectionCombo);
Text infoIntegration = new Text(i18nC.infoIntegrationCollection());
integrationFieldSet.add(infoIntegration);
add(integrationFieldSet);
}
public void peupler() {
initialiserCollection();
if (collectionBotanique != null) {
natureChp.peupler(collectionBotanique.getNature());
specialiteChp.setValue(collectionBotanique.getSpecialite());
etatClassementCombo.peupler(collectionBotanique.getClassementEtat());
annotationClassementChp.setValue(collectionBotanique.getClassementAnnotation());
peuplerEtiquetteRenseignement(collectionBotanique.getEtiquetteRenseignement());
precisionLocaliteCombo.peupler(collectionBotanique.getPrecisionLocalite());
precisionDateCombo.peupler(collectionBotanique.getPrecisionDate());
etiquetteAnnotationChp.setValue(collectionBotanique.getAnnotationsDiverses());
integreCollectionCombo.peupler(collectionBotanique.getCollectionIntegre());
infoIntegreCollectionCombo.peupler(collectionBotanique.getCollectionIntegreInfo());
}
}
public void collecter() {
initialiserCollection();
if (etreAccede()) {
collectionBotaniqueCollectee.setNature(natureChp.getValeur());
collectionBotaniqueCollectee.setSpecialite(specialiteChp.getValue());
collectionBotaniqueCollectee.setClassementEtat(etatClassementCombo.getValeur());
collectionBotaniqueCollectee.setClassementAnnotation(annotationClassementChp.getValue());
collectionBotaniqueCollectee.setEtiquetteRenseignement(collecterEtiquetteRenseignement());
collectionBotaniqueCollectee.setPrecisionLocalite(precisionLocaliteCombo.getValeur());
collectionBotaniqueCollectee.setPrecisionDate(precisionDateCombo.getValeur());
collectionBotaniqueCollectee.setAnnotationsDiverses(etiquetteAnnotationChp.getValue());
collectionBotaniqueCollectee.setCollectionIntegre(integreCollectionCombo.getValeur());
collectionBotaniqueCollectee.setCollectionIntegreInfo(infoIntegreCollectionCombo.getValeur());
}
}
private void initialiserCollection() {
collection = ((CollectionForm) formulaire).collection;
if (collection != null) {
collectionBotanique = collection.getBotanique();
}
collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
if (collectionCollectee != null) {
collectionBotaniqueCollectee = collectionCollectee.getBotanique();
}
}
public void rafraichir(Object nouvellesDonnees) {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/collection/CollectionFormContenu.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/collection/CollectionFormContenu.java:r11-933,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/collection/CollectionFormContenu.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/collection/CollectionVue.java
New file
0,0 → 1,68
package org.tela_botanica.client.vues.collection;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.MenuApplicationId;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionListe;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.google.gwt.user.client.Window;
 
public class CollectionVue extends LayoutContainer implements Rafraichissable {
 
private Mediateur mediateur = null;
private CollectionListeVue listeCollectionPanneau = null;
private CollectionDetailVue detailCollectionPanneau = null;
 
private Sequenceur sequenceur = new Sequenceur();
public CollectionVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
BorderLayout layout = new BorderLayout();
layout.setEnableState(false);
setLayout(layout);
 
listeCollectionPanneau = new CollectionListeVue(mediateur);
add(listeCollectionPanneau, new BorderLayoutData(LayoutRegion.CENTER));
detailCollectionPanneau = new CollectionDetailVue(mediateur, sequenceur);
BorderLayoutData dispositionSud = new BorderLayoutData(LayoutRegion.SOUTH, .5f, 200, 1000);
dispositionSud.setSplit(true);
dispositionSud.setMargins(new Margins(5, 0, 0, 0));
add(detailCollectionPanneau, dispositionSud);
}
 
public void rafraichir(Object nouvellesDonnees) {
// Nous passons l'objet aux méthodes rafraichir des panneaux composant le panneau principal Structure
if (nouvellesDonnees instanceof Collection) {
detailCollectionPanneau.rafraichir(nouvellesDonnees);
} else if (nouvellesDonnees instanceof CollectionListe) {
listeCollectionPanneau.rafraichir(nouvellesDonnees);
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("liste_collection_a_personne")
|| info.getType().equals("liste_collection_a_publication")
|| info.getType().equals("liste_collection_a_commentaire")) {
detailCollectionPanneau.rafraichir(nouvellesDonnees);
} else if (info.getType().equals("suppression_collection")) {
listeCollectionPanneau.rafraichir(nouvellesDonnees);
} else if (info.getType().equals("modif_collection")) {
listeCollectionPanneau.rafraichir(nouvellesDonnees);
} else if(info.getType().equals("collection_ajoutee")) {
mediateur.clicMenu(MenuApplicationId.COLLECTION);
}
} else {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/collection/CollectionVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/collection/CollectionVue.java:r11-933,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/collection/CollectionVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/collection/CollectionListeVue.java
New file
0,0 → 1,252
package org.tela_botanica.client.vues.collection;
 
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
 
import org.tela_botanica.client.Coel;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.ChampFiltreRecherche;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionAsyncDao;
import org.tela_botanica.client.modeles.collection.CollectionListe;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.personne.PersonneAsyncDao;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.structure.StructureListe;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.vues.BarrePaginationVue;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.GridEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.user.client.Window;
 
public class CollectionListeVue extends ContentPanel implements Rafraichissable {
private Mediateur mediateur = null;
private Constantes i18nC = null;
 
private Grid<Collection> grille = null;
private ListStore<Collection> store = null;
 
private Button modifier;
private Button supprimer;
private Button ajouter;
private BarrePaginationVue pagination = null;
private ChampFiltreRecherche champFiltreRecherche = null;
private int indexElementSelectionne = 0;
private Collection collectionSelectionnee = null;
public CollectionListeVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
i18nC = Mediateur.i18nC;
setLayout(new FitLayout());
setHeaderVisible(false);
ToolBar toolBar = new ToolBar();
ajouter = new Button(i18nC.ajouter());
ajouter.setIcon(Images.ICONES.ajouter());
ajouter.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
mediateur.clicAjouterCollection();
}
});
ajouter.setToolTip(i18nC.indicationCreerUneFiche()+" "+i18nC.collectionSingulier());
toolBar.add(ajouter);
 
modifier = new Button(i18nC.modifier());
modifier.setIcon(Images.ICONES.formModifier());
modifier.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
mediateur.clicModifierCollection(grille.getSelectionModel().getSelectedItems());
}
});
modifier.setToolTip(i18nC.indicationModifierUneFiche());
toolBar.add(modifier);
supprimer = new Button(i18nC.supprimer());
supprimer.setIcon(Images.ICONES.supprimer());
supprimer.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
clicSupprimerCollection(grille.getSelectionModel().getSelectedItems());
}
});
supprimer.setToolTip(i18nC.indicationSupprimerUneFiche());
toolBar.add(supprimer);
setTopComponent(toolBar);
 
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
colonnes.add(new ColumnConfig("nom", i18nC.personneNom(), 300));
colonnes.add(new ColumnConfig("_structure_nom_", i18nC.structure(), 200));
colonnes.add(new ColumnConfig("_structure_ville_", i18nC.ville(), 150));
colonnes.get(1).setHidden(true);
ColumnModel modeleDeColonne = new ColumnModel(colonnes);
GridSelectionModel<Collection> modeleDeSelection = new GridSelectionModel<Collection>();
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Collection>() {
public void selectionChanged(SelectionChangedEvent<Collection> event) {
collectionSelectionnee = (Collection) event.getSelectedItem();
indexElementSelectionne = store.indexOf(collectionSelectionnee);
clicListe(collectionSelectionnee);
}
});
store = new ListStore<Collection>();
grille = new Grid<Collection>(store, modeleDeColonne);
grille.setWidth("100%");
grille.setAutoExpandColumn("nom");
grille.getView().setAutoFill(true);
grille.getView().setForceFit(true);
grille.setSelectionModel(modeleDeSelection);
grille.addListener(Events.ViewReady, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
grille.getSelectionModel().select(0, false);
}
});
grille.addListener(Events.OnDoubleClick, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
modifier.fireEvent(Events.Select);
}
});
 
grille.addListener(Events.SortChange, new Listener<BaseEvent>() {
 
@Override
public void handleEvent(BaseEvent be) {
GridEvent ge = (GridEvent<Collection>) be;
// TODO rajouter un test sur le sort state pour trier par nom par défaut
String tri = ge.getSortInfo().getSortField();
if(tri.equals("_structure_ville_")) {
tri = "cs_ville";
} else {
tri = Collection.PREFIXE+"_"+tri;
}
CollectionAsyncDao.tri = tri+" "+ge.getSortInfo().getSortDir().toString();
pagination.changePage();
}
});
add(grille);
CollectionListe collectionListe = new CollectionListe();
champFiltreRecherche = new ChampFiltreRecherche(mediateur, toolBar, collectionListe);
// Définition de la barre de pagination
pagination = new BarrePaginationVue(collectionListe, mediateur, champFiltreRecherche);
setBottomComponent(pagination);
}
 
private void clicListe(Collection collection) {
if (collection != null && store.getCount() > 0) {
mediateur.clicListeCollection(collection);
}
}
 
private void clicSupprimerCollection(List<Collection> collectionsASupprimer) {
if (store.getCount() > 0) {
mediateur.clicSupprimerCollection(this, collectionsASupprimer);
}
}
private void gererEtatActivationBouton() {
int nbreElementDuMagazin = store.getCount();
ajouter.enable();
if (nbreElementDuMagazin == 0) {
supprimer.disable();
modifier.disable();
} else if (nbreElementDuMagazin > 0) {
modifier.enable();
if (((Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT)).isIdentifie()) {
supprimer.enable();
}
}
}
 
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof CollectionListe) {
CollectionListe collections = (CollectionListe) nouvellesDonnees;
 
pagination.setlistePaginable(collections);
int[] pt = collections.getPageTable();
pagination.rafraichir(collections.getPageTable());
champFiltreRecherche.setListePaginable(collections);
if (collections != null) {
List<Collection> liste = collections.toList();
store.removeAll();
store.add(liste);
mediateur.actualiserPanneauCentral();
}
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if (info.getType().equals("modif_collection")) {
// curieusement la suppression efface aussi l'index de l'élément
// car elle redéclenche l'évenement de selection (on le stocke donc temporairement)
int temporaire = indexElementSelectionne;
if(collectionSelectionnee != null) {
store.remove(collectionSelectionnee);
collectionSelectionnee = null;
}
Collection collecModifiee = (Collection)info.getDonnee(0);
// au cas ou le bouton appliquer aurait été cliqué avant de valider
store.remove(collecModifiee);
indexElementSelectionne = temporaire;
store.insert(collecModifiee, temporaire);
collectionSelectionnee = collecModifiee;
int indexElementSelectionne = store.indexOf(collectionSelectionnee);
grille.getSelectionModel().select(indexElementSelectionne, false);
grille.getView().focusRow(indexElementSelectionne);
clicListe(collectionSelectionnee);
} else if (info.getType().equals("suppression_collection")) {
// Affichage d'un message d'information
InfoLogger.display(i18nC.suppressionCollection(), info.toString().replaceAll("\n", "<br />"));
 
supprimerCollectionsSelectionnees();
gererEtatActivationBouton();
}
} else {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
layout();
}
private void supprimerCollectionsSelectionnees() {
List<Collection> collectionsSelectionnees = grille.getSelectionModel().getSelectedItems();
Iterator<Collection> it = collectionsSelectionnees.iterator();
while (it.hasNext()) {
grille.getStore().remove(it.next());
}
layout(true);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/collection/CollectionListeVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/collection/CollectionListeVue.java:r11-933,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/collection/CollectionListeVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/collection/CollectionFormGeneral.java
New file
0,0 → 1,425
package org.tela_botanica.client.vues.collection;
 
import java.util.ArrayList;
 
import org.tela_botanica.client.Coel;
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampCaseACocher;
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.ChampMultiValeurs;
import org.tela_botanica.client.composants.ChampNombre;
import org.tela_botanica.client.composants.ConteneurMultiChamps;
import org.tela_botanica.client.composants.pagination.ProxyCollections;
import org.tela_botanica.client.composants.pagination.ProxyStructures;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilDate;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireOnglet;
 
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.Label;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.HiddenField;
import com.extjs.gxt.ui.client.widget.form.NumberField;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData;
import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.user.client.ui.HorizontalPanel;
 
public class CollectionFormGeneral extends FormulaireOnglet implements Rafraichissable {
public static final String ID = "general";
private Collection collection = null;
private Collection collectionCollectee = null;
 
private HiddenField<String> idCollectionChp = null;
private ChampComboBoxRechercheTempsReelPaginable structuresCombo = null;
private ChampComboBoxRechercheTempsReelPaginable collectionsCombo = null;
private ChampNombre periodeConstitutionDebutChp = null;
private ChampNombre periodeConstitutionFinChp = null;
private ChampMultiValeurs lieuCouvertureChp = null;
 
private ChampComboBoxListeValeurs specimenTypeCombo = null;
private ChampComboBoxListeValeurs precisionTypeNbreCombo = null;
private NumberField nbreTypeChp = null;
private ChampComboBoxListeValeurs classementSpecimenTypeCombo = null;
private ChampComboBoxListeValeurs typeDepotCombo = null;
private TextField<String> coteChp = null;
private ChampMultiValeurs nomsAlternatifsChp = null;
private ChampMultiValeurs codesAlternatifsChp = null;
private TextArea descriptionChp = null;
private TextArea historiqueChp = null;
private ChampMultiValeurs urlsChp = null;
private Sequenceur sequenceur = new Sequenceur();
public CollectionFormGeneral(Formulaire formulaireCourrant) {
initialiserOnglet(formulaireCourrant);
setId(ID);
setText(Mediateur.i18nC.collectionGeneral());
creerChampsCache();
creerFieldsetLiaison();
creerFieldsetAdministratif();
creerFieldsetDescription();
creerFieldsetCouverture();
creerFieldsetType();
}
 
private void initialiserCollection() {
collection = ((CollectionForm) formulaire).collection;
collectionCollectee = ((CollectionForm) formulaire).collectionCollectee;
}
private void creerChampsCache() {
// Champs cachés
idCollectionChp = new HiddenField<String>();
this.add(idCollectionChp);
}
private void creerFieldsetLiaison() {
FieldSet liaisonFieldSet = new FieldSet();
liaisonFieldSet.setHeadingHtml(i18nC.liaisonTitreCollection());
liaisonFieldSet.setCollapsible(true);
liaisonFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
//+-----------------------------------------------------------------------------------------------------------+
// Champ Structures
 
ModelType modelTypeStructures = new ModelType();
modelTypeStructures.setRoot("structures");
modelTypeStructures.setTotalName("nbElements");
modelTypeStructures.addField("cs_nom");
modelTypeStructures.addField("cs_id_structure");
String displayNameStructures = "cs_nom";
ProxyStructures<ModelData> proxyStructures = new ProxyStructures<ModelData>(null);
structuresCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyStructures, modelTypeStructures, displayNameStructures);
structuresCombo.setWidth(250, 600);
structuresCombo.getCombo().setTabIndex(tabIndex++);
structuresCombo.getCombo().setFieldLabel(i18nC.lienStructureCollection());
structuresCombo.getCombo().setForceSelection(true);
structuresCombo.getCombo().setValidator(new Validator() {
public String validate(Field<?> field, String value) {
String retour = null;
if (field.getRawValue().equals("")) {
field.setValue(null);
} else if (structuresCombo.getStore().findModel("cs_nom", field.getRawValue()) == null) {
String contenuBrut = field.getRawValue();
field.setValue(null);
field.setRawValue(contenuBrut);
retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
}
return retour;
}
});
 
liaisonFieldSet.add(structuresCombo, new FormData(600, 0));
//+-----------------------------------------------------------------------------------------------------------+
// Champ Collections
ModelType modelTypeCollections = new ModelType();
modelTypeCollections.setRoot("collections");
modelTypeCollections.setTotalName("nbElements");
modelTypeCollections.addField("cc_nom");
modelTypeCollections.addField("cc_id_collection");
modelTypeCollections.addField("cc_ce_mere");
String displayNameCollections = "cc_nom";
ProxyCollections<ModelData> proxyCollections = new ProxyCollections<ModelData>(null);
collectionsCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyCollections, modelTypeCollections, displayNameCollections);
collectionsCombo.setWidth(250, 600);
collectionsCombo.getCombo().setTabIndex(tabIndex++);
collectionsCombo.getCombo().setFieldLabel(i18nC.lienMereCollection());
collectionsCombo.getCombo().setForceSelection(true);
collectionsCombo.getCombo().setValidator(new Validator() {
public String validate(Field<?> field, String value) {
String retour = null;
if (field.getRawValue().equals("")) {
field.setValue(null);
} else if (collectionsCombo.getStore().findModel("cc_nom", field.getRawValue()) == null) {
String contenuBrut = field.getRawValue();
field.setValue(null);
field.setRawValue(contenuBrut);
retour = "Veuillez sélectionner une valeur ou laisser le champ vide";
}
return retour;
}
});
 
liaisonFieldSet.add(collectionsCombo, new FormData(600, 0));
this.add(liaisonFieldSet);
}
private void creerFieldsetAdministratif() {
// Fieldset ADMINISTRATIF
FieldSet administratifFieldSet = new FieldSet();
administratifFieldSet.setHeadingHtml(i18nC.collectionGeneralTitre());
administratifFieldSet.setCollapsible(true);
administratifFieldSet.collapse();
administratifFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
typeDepotCombo = new ChampComboBoxListeValeurs(i18nC.typeDepot(), "typeDepot", tabIndex++);
administratifFieldSet.add(typeDepotCombo);
coteChp = new TextField<String>();
coteChp.setTabIndex(tabIndex++);
coteChp.setFieldLabel(i18nC.cote());
administratifFieldSet.add(coteChp, new FormData(450, 0));
nomsAlternatifsChp = new ChampMultiValeurs(i18nC.intituleAlternatifCollection());
administratifFieldSet.add(nomsAlternatifsChp);
codesAlternatifsChp = new ChampMultiValeurs(i18nC.codeAlternatifCollection());
administratifFieldSet.add(codesAlternatifsChp);
this.add(administratifFieldSet);
}
private void creerFieldsetDescription() {
// Fieldset DESCRIPTION
FieldSet descriptionFieldSet = new FieldSet();
descriptionFieldSet.setHeadingHtml(i18nC.collectionDescriptionTitre());
descriptionFieldSet.setCollapsible(true);
descriptionFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
 
descriptionChp = new TextArea();
descriptionChp.setFieldLabel(i18nC.description());
descriptionFieldSet.add(descriptionChp, new FormData(550, 0));
historiqueChp = new TextArea();
historiqueChp.setFieldLabel(i18nC.historique());
descriptionFieldSet.add(historiqueChp, new FormData(550, 0));
urlsChp = new ChampMultiValeurs(i18nC.urlsCollection());
descriptionFieldSet.add(urlsChp);
 
this.add(descriptionFieldSet);
}
private void creerFieldsetCouverture() {
FieldSet couvertureFieldSet = new FieldSet();
couvertureFieldSet.setHeadingHtml("Couvertures");
couvertureFieldSet.setCollapsible(true);
couvertureFieldSet.collapse();
couvertureFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
// à modifier
//periodeConstitutionChp = new ChampCaseACocher(i18nC.periodeConstitution(), "siecleNaturaliste", false);
//couvertureFieldSet.add(periodeConstitutionChp);
Label labelperiodeDebut = new Label(i18nC.periodeConstitutionDetailForm());
labelperiodeDebut.setStyleName("labelChampNombreFormat");
periodeConstitutionDebutChp = new ChampNombre();
periodeConstitutionDebutChp.setStyleName("champNombreFormat");
periodeConstitutionDebutChp.setWidth(55);
periodeConstitutionDebutChp.setEmptyText(i18nC.publicationDateParution());
periodeConstitutionFinChp = new ChampNombre();
periodeConstitutionFinChp.setStyleName("champNombreFormat");
periodeConstitutionFinChp.setWidth(55);
periodeConstitutionFinChp.setEmptyText(i18nC.publicationDateParution());
HorizontalPanel conteneurPeriode = new HorizontalPanel();
conteneurPeriode.setBorderWidth(0);
conteneurPeriode.add(labelperiodeDebut);
conteneurPeriode.add(periodeConstitutionDebutChp);
conteneurPeriode.add(periodeConstitutionFinChp);
couvertureFieldSet.add(conteneurPeriode);
lieuCouvertureChp = new ChampMultiValeurs(i18nC.lieuCouvertureCollection());
couvertureFieldSet.add(lieuCouvertureChp);
this.add(couvertureFieldSet);
}
 
private void creerFieldsetType() {
FieldSet typeFieldSet = new FieldSet();
typeFieldSet.setHeadingHtml("Spécimens «types»");
typeFieldSet.setCollapsible(true);
typeFieldSet.collapse();
typeFieldSet.setLayout(Formulaire.creerFormLayout(largeurLabelDefaut, alignementLabelDefaut));
specimenTypeCombo = new ChampComboBoxListeValeurs(i18nC.specimenTypeCollection(), "onpi", tabIndex++);
typeFieldSet.add(specimenTypeCombo);
ConteneurMultiChamps nbreTypeConteneur = new ConteneurMultiChamps(i18nC.nbreSpecimenTypeCollection());
nbreTypeChp = new NumberField();
nbreTypeChp.setFormat(NumberFormat.getFormat("#"));
nbreTypeConteneur.ajouterChamp(nbreTypeChp, new HBoxLayoutData(new Margins(0, 20, 0, 0)));
precisionTypeNbreCombo = new ChampComboBoxListeValeurs(null, "ea");
precisionTypeNbreCombo.setTrie("id_valeur");
precisionTypeNbreCombo.setEmptyText(i18nC.precisionNbreSpecimenTypeCollectionChpVide());
nbreTypeConteneur.ajouterChamp(precisionTypeNbreCombo);
typeFieldSet.add(nbreTypeConteneur);
classementSpecimenTypeCombo = new ChampComboBoxListeValeurs(i18nC.classementSpecimenTypeCollection(), "typeClassement", tabIndex++);
typeFieldSet.add(classementSpecimenTypeCombo);
Text infoType = new Text(i18nC.specimenTypeCollectionInfo());
typeFieldSet.add(infoType);
this.add(typeFieldSet);
}
public void peupler() {
initialiserCollection();
if (collection != null) {
idCollectionChp.setValue(collection.getId());
setValeurComboStructures();
setValeurComboCollections();
typeDepotCombo.peupler(collection.getTypeDepot());
coteChp.setValue(collection.getCote());
nomsAlternatifsChp.peupler(collection.getNomAlternatif());
codesAlternatifsChp.peupler(collection.getCode());
descriptionChp.setValue(collection.getDescription());
historiqueChp.setValue(collection.getHistorique());
urlsChp.peupler(collection.getUrls());
if(!collection.getPeriodeConstitutionDebut().equals("")) {
periodeConstitutionDebutChp.setValue((Integer.parseInt(collection.getPeriodeConstitutionDebut())));
}
if(!collection.getPeriodeConstitutionFin().equals("")) {
periodeConstitutionFinChp.setValue((Integer.parseInt(collection.getPeriodeConstitutionFin())));
}
lieuCouvertureChp.peupler(collection.getCouvertureLieu());
specimenTypeCombo.peupler(collection.getSpecimenType());
nbreTypeChp.setValue((collection.getSpecimenTypeNbre().equals("") ? 0 : Integer.parseInt(collection.getSpecimenTypeNbre())));
precisionTypeNbreCombo.peupler(collection.getSpecimenTypeNbrePrecision());
classementSpecimenTypeCombo.peupler(collection.getSpecimenTypeClassement());
}
}
public ArrayList<String> verifier() {
ArrayList<String> messages = new ArrayList<String>();
return messages;
}
public void collecter() {
initialiserCollection();
// l'onglet collection est obligatoirement rempli lors d'un ajout
if (this.mode == Formulaire.MODE_AJOUTER || etreAccede()) {
collectionCollectee.setId(idCollectionChp.getValue());
collectionCollectee.setIdStructure(getValeurComboStructures());
collectionCollectee.setCollectionMereId(getValeurComboCollections());
collectionCollectee.setTypeDepot(typeDepotCombo.getValeur());
collectionCollectee.setCote(coteChp.getValue());
collectionCollectee.setNomAlternatif(nomsAlternatifsChp.getValeurs());
collectionCollectee.setCode(codesAlternatifsChp.getValeurs());
collectionCollectee.setDescription(descriptionChp.getValue());
collectionCollectee.setHistorique(historiqueChp.getValue());
collectionCollectee.setUrls(urlsChp.getValeurs());
 
collectionCollectee.setPeriodeConstitutionDebut("" + periodeConstitutionDebutChp.getValue());
collectionCollectee.setPeriodeConstitutionFin("" + periodeConstitutionFinChp.getValue());
collectionCollectee.setCouvertureLieu(lieuCouvertureChp.getValeurs());
collectionCollectee.setSpecimenType(specimenTypeCombo.getValeur());
if (nbreTypeChp.getValue() != null) {
collectionCollectee.setSpecimenTypeNbre(nbreTypeChp.getValue().toString());
}
collectionCollectee.setSpecimenTypeNbrePrecision(precisionTypeNbreCombo.getValeur());
collectionCollectee.setSpecimenTypeClassement(classementSpecimenTypeCombo.getValeur());
}
}
private String getValeurComboStructures() {
String valeur = "";
if (structuresCombo.getCombo().getValue() != null) {
Structure structure = new Structure(structuresCombo.getValeur());
valeur = structure.getId();
}
return valeur;
}
private void setValeurComboStructures() {
if (structuresCombo.getCombo().getStore() != null
&& collection != null
&& collection.getStructureNom() != null
&& !UtilString.isEmpty(collection.getStructureNom())) {
structuresCombo.chargerValeurInitiale(collection.getStructureNom(), "cs_nom");
} else {
structuresCombo.getCombo().setValue(null);
}
}
private String getValeurComboCollections() {
String valeur = "";
if (collectionsCombo.getCombo().getValue() != null) {
Collection collection = new Collection(collectionsCombo.getValeur());
valeur = collection.getId();
}
return valeur;
}
private void setValeurComboCollections() {
if (collectionsCombo.getCombo().getStore() != null
&& collection != null
&& collection.getCollectionMereNom() != null
&& !UtilString.isEmpty(collection.getCollectionMereNom())) {
collectionsCombo.chargerValeurInitiale(collection.getCollectionMereNom(), "cc_nom");
}
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
rafraichirValeurListe(listeValeurs);
} else {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
}
private void rafraichirValeurListe(ValeurListe listeValeurs) {
if (listeValeurs.getId().equals(config.getListeId("typeDepot"))) {
Formulaire.rafraichirComboBox(listeValeurs, typeDepotCombo);
} else {
Debug.log("Gestion de la liste "+listeValeurs.getId()+" non implémenté!");
}
}
 
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/collection/CollectionFormGeneral.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/collection/CollectionFormGeneral.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/collection/CollectionFormGeneral.java:r11-933,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/collection/CollectionDetailVue.java
New file
0,0 → 1,972
package org.tela_botanica.client.vues.collection;
 
import java.util.HashMap;
import java.util.Iterator;
 
import org.tela_botanica.client.Coel;
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.OntologiesLocales;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionACommentaire;
import org.tela_botanica.client.modeles.collection.CollectionACommentaireListe;
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
import org.tela_botanica.client.modeles.collection.CollectionAPersonneListe;
import org.tela_botanica.client.modeles.collection.CollectionAPublication;
import org.tela_botanica.client.modeles.collection.CollectionAPublicationListe;
import org.tela_botanica.client.modeles.collection.CollectionBotanique;
import org.tela_botanica.client.modeles.commentaire.Commentaire;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.DetailVue;
 
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.util.Params;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.layout.AnchorLayout;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
 
public class CollectionDetailVue extends DetailVue implements Rafraichissable {
 
private Collection collection = null;
private boolean collectionChargementOk = false;
private boolean personnesLieesChargementOk = false;
private boolean publicationsLieesChargementOk = false;
private boolean commentairesLieesChargementOk = false;
private Structure structure = null;
 
private String enteteTpl = null;
private String generalTpl = null;
private String personneTpl = null;
private String tableauPersonnesLieesTpl = null;
private String lignePersonneLieeTpl = null;
private String publicationTpl = null;
private String tableauPublicationsLieesTpl = null;
private String lignePublicationLieeTpl = null;
private String descriptionTpl = null;
private String contenuTpl = null;
private String inventaireTpl = null;
private String commentaireTpl = null;
private String tableauCommentairesLieesTpl = null;
private String ligneCommentaireLieeTpl = null;
private ContentPanel panneauPrincipal = null;
private Html entete = null;
private TabPanel onglets = null;
private TabItem generalOnglet = null;
private TabItem personneOnglet = null;
private TabItem publicationOnglet = null;
private TabItem descriptionOnglet = null;
private TabItem contenuOnglet = null;
private TabItem inventaireOnglet = null;
private TabItem commentaireOnglet = null;
 
private Sequenceur sequenceur;
public CollectionDetailVue(Mediateur mediateurCourant, Sequenceur sequenceur) {
super(mediateurCourant);
this.sequenceur = sequenceur;
initialiserTousLesTpl();
chargerOntologie();
panneauPrincipal = new ContentPanel();
panneauPrincipal.setLayout(new FitLayout());
panneauPrincipal.setHeaderVisible(false);
panneauPrincipal.setBodyBorder(false);
entete = new Html();
entete.setId(ComposantId.ZONE_DETAIL_ENTETE);
panneauPrincipal.setTopComponent(entete);
onglets = new TabPanel();
onglets.setId(ComposantId.ZONE_DETAIL_CORPS);
onglets.setBodyBorder(false);
 
generalOnglet = new TabItem(i18nC.structureInfoGeneral());
generalOnglet.setLayout(new AnchorLayout());
generalOnglet.setScrollMode(Scroll.AUTO);
onglets.add(generalOnglet);
personneOnglet = new TabItem(i18nC.collectionPersonne());
personneOnglet.setLayout(new AnchorLayout());
personneOnglet.setScrollMode(Scroll.AUTO);
onglets.add(personneOnglet);
publicationOnglet = new TabItem(i18nC.collectionPublication());
publicationOnglet.setLayout(new AnchorLayout());
publicationOnglet.setScrollMode(Scroll.AUTO);
onglets.add(publicationOnglet);
descriptionOnglet = new TabItem(i18nC.collectionDescription());
descriptionOnglet.setLayout(new AnchorLayout());
descriptionOnglet.setScrollMode(Scroll.AUTO);
onglets.add(descriptionOnglet);
contenuOnglet = new TabItem(i18nC.collectionContenu());
contenuOnglet.setLayout(new AnchorLayout());
contenuOnglet.setScrollMode(Scroll.AUTO);
onglets.add(contenuOnglet);
inventaireOnglet = new TabItem(i18nC.collectionInventaire());
inventaireOnglet.setLayout(new AnchorLayout());
inventaireOnglet.setScrollMode(Scroll.AUTO);
onglets.add(inventaireOnglet);
commentaireOnglet = new TabItem(i18nC.collectionCommentaire());
commentaireOnglet.setLayout(new AnchorLayout());
commentaireOnglet.setScrollMode(Scroll.AUTO);
onglets.add(commentaireOnglet);
panneauPrincipal.add(onglets);
add(panneauPrincipal);
}
private void initialiserTousLesTpl() {
initialiserEnteteHtmlTpl();
initialiserGeneralTpl();
initialiserPersonneTpl();
initialiserTableauPersonnesLieesTpl();
initialiserLignePersonneLieeTpl();
initialiserPublicationTpl();
initialiserTableauPublicationsLieesTpl();
initialiserLignePublicationLieeTpl();
initialiserContenuTpl();
initialiserDescriptionTpl();
initialiserInventaireTpl();
initialiserCommentaireTpl();
initialiserTableauCommentairesLieesTpl();
initialiserLigneCommentaireLieeTpl();
}
private void initialiserEnteteHtmlTpl() {
enteteTpl =
"<div id='{css_id}'>"+
" <h1>{nom}</h1>"+
" <h2>{structure}<span class='{css_meta}'><br /> {i18n_id}:{id} - {guid}</span></h2>" +
"</div>";
}
private void initialiserGeneralTpl() {
generalTpl =
"<div class='{css_corps}'>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_identification}</h2>"+
" <span class='{css_label}'>{i18n_nom_alternatif} :</span> {nom_alternatif}<br />"+
" <span class='{css_label}'>{i18n_mere} :</span> {mere}<br />"+
" <span class='{css_label}'>{i18n_type_ncd} :</span> {type_ncd}<br />"+
" <span class='{css_label}'>{i18n_type_depot} :</span> {type_depot}<br />"+
" <span class='{css_label}'>{i18n_code} :</span> {code}<br />"+
" <span class='{css_label}'>{i18n_cote} :</span> {cote}<br />"+
" </div>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_general_collection_titre}</h2>"+
" <span class='{css_label}'>{i18n_description} :</span> {description}<br />"+
" <span class='{css_label}'>{i18n_historique} :</span> {historique}<br />"+
" <span class='{css_label}'>{i18n_web} :</span> {web}<br />"+
" </div>"+
" <hr class='{css_clear}'/>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_couverture_collection_titre}</h2>"+
" <span class='{css_label}'>{i18n_couverture_geo} :</span> {couverture_geo}<br />"+
" <span class='{css_label}'>{i18n_periode} :</span> {periode}<br />"+
" </div>"+
" </div>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_specimen_type_titre}</h2>"+
" <span class='{css_label}'>{i18n_specimen_type_presence} :</span> {specimen_type_presence}<br />"+
" <span class='{css_label}'>{i18n_specimen_type_nombre} :</span> {specimen_type_nombre}<br />"+
" <span class='{css_label}'>{i18n_specimen_type_classement} :</span> {specimen_type_classement}<br />"+
" </div>"+
" <hr class='{css_clear}'/>"+
"</div>";
}
private void initialiserPersonneTpl() {
personneTpl =
"<div class='{css_corps}'>"+
" <h2>{i18n_titre_personne}</h2>"+
" {tableau_personnes_liees}"+
"</div>";
}
private void initialiserTableauPersonnesLieesTpl() {
tableauPersonnesLieesTpl =
"<table>"+
" <thead>"+
" <tr>" +
" <th>{i18n_relation}</th>" +
" <th>{i18n_nom_complet}</th>" +
" <th>{i18n_nom}</th>" +
" <th>{i18n_prenom}</th>" +
" <th>{i18n_naissance_date}</th>" +
" <th>{i18n_naissance_lieu}</th>" +
" <th>{i18n_etre_decede}</th>" +
" <th>{i18n_deces_date}</th>" +
" <th>{i18n_deces_lieu}</th>" +
" </tr>"+
" </thead>"+
" <tbody>"+
" {lignes}"+
" </tbody>"+
"</table>";
}
private void initialiserLignePersonneLieeTpl() {
lignePersonneLieeTpl =
"<tr>"+
" <td>{relation}</td>"+
" <td>{nom_complet}</td>"+
" <td>{nom}</td>"+
" <td>{prenom}</td>"+
" <td>{naissance_date}</td>"+
" <td>{naissance_lieu}</td>"+
" <td>{etre_decede}</td>"+
" <td>{deces_date}</td>"+
" <td>{deces_lieu}</td>"+
"</tr>";
}
private void initialiserPublicationTpl() {
publicationTpl =
"<div class='{css_corps}'>"+
" <h2>{i18n_titre_publication}</h2>"+
" {tableau_publications_liees}"+
"</div>";
}
private void initialiserTableauPublicationsLieesTpl() {
tableauPublicationsLieesTpl =
"<table>"+
" <thead>"+
" <tr>" +
" <th>{i18n_auteur}</th>" +
" <th>{i18n_titre}</th>" +
" <th>{i18n_revue}</th>" +
" <th>{i18n_editeur}</th>" +
" <th>{i18n_annee}</th>" +
" <th>{i18n_nvt}</th>" +
" <th>{i18n_fascicule}</th>" +
" <th>{i18n_page}</th>" +
" <th>{i18n_source}</th>" +
" </tr>"+
" </thead>"+
" <tbody>"+
" {lignes}"+
" </tbody>"+
"</table>";
}
private void initialiserLignePublicationLieeTpl() {
lignePublicationLieeTpl =
"<tr>"+
" <td>{auteur}</td>"+
" <td>{titre}</td>"+
" <td>{revue}</td>"+
" <td>{editeur}</td>"+
" <td>{annee}</td>"+
" <td>{nvt}</td>"+
" <td>{fascicule}</td>"+
" <td>{page}</td>"+
" <td>{source}</td>"+
"</tr>";
}
private void initialiserDescriptionTpl() {
descriptionTpl =
"<div class='{css_corps}'>"+
" <div>"+
" <h2>{i18n_titre_description}</h2>"+
" <span class='{css_label}'>{i18n_type_botanique} :</span> {type_botanique}<br />"+
" <span class='{css_label}'>{i18n_nbre_echantillon} :</span> {nbre_echantillon}<br />"+
" <span class='{css_label}'>{i18n_etat_unite_rangement} :</span> {etat_unite_rangement}<br />"+
" <span class='{css_label}'>{i18n_collection_cartons_herbiers} :</span> {nb_cartons_herbier}<br />"+
" <span class='{css_label}'>{i18n_nb_liasses} :</span> {nb_liasses}<br />"+
" <span class='{css_label}'>{i18n_autres_unites_rangement} : </span>{autres_unites_rangement}<br />"+
" <span class='{css_label}'>{i18n_nb_planches_herbier} :</span> {nb_planches_herbier}<br />"+
" <span class='{css_label}'>{i18n_nb_especes} :</span> {nb_especes}<br />"+
" </div>"+
" <div>"+
" <h2>{i18n_titre_conservation}</h2>"+
" <span class='{css_label}'>{i18n_type_papier} :</span> {type_papier}<br />"+
" <span class='{css_label}'>{i18n_conservation_methode} :</span> {conservation_methode}<br />"+
" </div>"+
" <div>"+
" <h2>{i18n_titre_etiquette}</h2>"+
" <span class='{css_label}'>{i18n_specimen_fixation_pourcent} :</span> {specimen_fixation_pourcent}<br />"+
" <span class='{css_label}'>{i18n_etiquette_fixation_pourcent} :</span> {etiquette_fixation_pourcent}<br />"+
" <span class='{css_label}'>{i18n_specimen_fixation_methode} :</span> {specimen_fixation_methode}<br />"+
" <span class='{css_label}'>{i18n_etiquette_fixation_methode_support} :</span> {etiquette_fixation_methode_support}<br />"+
" <span class='{css_label}'>{i18n_etiquette_fixation_methode_specimen} :</span> {etiquette_fixation_methode_specimen}<br />"+
" <span class='{css_label}'>{i18n_etiquette_type_ecriture} :</span> {etiquette_type_ecriture}<br />"+
" </div>"+
" <div>"+
" <h2>{i18n_titre_traitement}</h2>"+
" <span class='{css_label}'>{i18n_traitement} :</span> {traitement}<br />"+
" <span class='{css_label}'>{i18n_traitement_poison} :</span> {traitement_poison}<br />"+
" <span class='{css_label}'>{i18n_traitement_insecte} :</span> {traitement_insecte}<br />"+
" </div>"+
" <div>"+
" <h2>{i18n_titre_etat_degradation}</h2>"+
" <span class='{css_label}'>{i18n_etat_general} :</span> {etat_general}<br />"+
" <span class='{css_label}'>{i18n_degradation_specimen} :</span> {degradation_specimen}<br />"+
" <span class='{css_label}'>{i18n_degradation_presentation} :</span> {degradation_presentation}<br />"+
" <span class='{css_label}'>{i18n_determination} :</span> {determination}<br />"+
" </div>"+
"</div>";
}
private void initialiserContenuTpl() {
contenuTpl =
"<div class='{css_corps}'>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_nature}</h2>"+
" <span class='{css_label}'>{i18n_nature} :</span> {nature}<br />"+
" <span class='{css_label}'>{i18n_specialite} :</span> {specialite}<br />"+
" </div>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_etiquette}</h2>"+
" <span class='{css_label}'>{i18n_etiquette_renseignement} :</span> {etiquette_renseignement}<br />"+
" <span class='{css_label}'>{i18n_precision_localite} :</span> {precision_localite}<br />"+
" <span class='{css_label}'>{i18n_precision_date} :</span> {precision_date}<br />"+
" <span class='{css_label}'>{i18n_etiquette_annotation} :</span> {etiquette_annotation}<br />"+
" </div>"+
" <hr class='{css_clear}'/>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_classement}</h2>"+
" <span class='{css_label}'>{i18n_classement_etat} :</span> {classement_etat}<br />"+
" <span class='{css_label}'>{i18n_classement} :</span> {classement}<br />"+
" </div>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_integree}</h2>"+
" <span class='{css_label}'>{i18n_collection_integration} :</span> {collection_integration}<br />"+
" <span class='{css_label}'>{i18n_collection_integration_info} :</span> {collection_integration_info}<br />"+
" </div>"+
"</div>";
}
private void initialiserInventaireTpl() {
inventaireTpl =
"<div class='{css_corps}'>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_inventaire}</h2>"+
" <span class='{css_label}'>{i18n_existence} :</span> {existence}<br />"+
" <span class='{css_label}'>{i18n_participation_auteur} :</span> {participation_auteur}<br />"+
" <span class='{css_label}'>{i18n_forme} :</span> {forme}<br />"+
" <span class='{css_label}'>{i18n_info} :</span> {info}<br />"+
" <span class='{css_label}'>{i18n_digital} :</span> {digital}<br />"+
" <span class='{css_label}'>{i18n_digital_pourcent} :</span> {digital_pourcent}<br />"+
" <span class='{css_label}'>{i18n_etat} :</span> {etat}<br />"+
" </div>"+
" <hr class='{css_clear}'/>"+
"</div>";
}
private void initialiserCommentaireTpl() {
commentaireTpl =
"<div class='{css_corps}'>"+
" <h2>{i18n_titre_commentaire}</h2>"+
" {tableau_commentaires_liees}"+
"</div>";
}
private void initialiserTableauCommentairesLieesTpl() {
tableauCommentairesLieesTpl =
"<table>"+
" <thead>"+
" <tr>" +
" <th>{i18n_type}</th>" +
" <th>{i18n_titre}</th>" +
" <th>{i18n_ponderation}</th>" +
" <th>{i18n_public}</th>" +
" </tr>"+
" </thead>"+
" <tbody>"+
" {lignes}"+
" </tbody>"+
"</table>";
}
private void initialiserLigneCommentaireLieeTpl() {
ligneCommentaireLieeTpl =
"<tr>"+
" <td>{type}</td>"+
" <td>{titre}</td>"+
" <td>{ponderation}</td>"+
" <td>{public}</td>"+
"</tr>"+
"<tr>"+
" <td colspan='4'>{texte}</td>"+
"</tr>";
}
private void chargerOntologie() {
String[] listesCodes = {"typeCollectionBota", "typeCollectionNcd", "typeDepot", "groupementPrincipe",
"realisationBut", "onpi", "ea", "typeClassement", "relationPersonneCollection", "ion",
"typeUniteRangement", "etat", "typeUniteBase", "typePapier", "methodeRangement", "methodeFixation",
"methodeFixationSurSpecimen", "typeEcriture", "poisonTraitement", "insecteTraitement", "specimenDegradation",
"niveauImportance", "supportDegradation", "niveauDetermination", "natureVegetale", "siecleNaturaliste",
"dateDebut", "dateFin", "etat", "onep", "onp", "inventaireForme", "inventaireLogiciel", "inventaireEtat",
"etatClassement", "typeCommentaireCollection"};
lancerChargementListesValeurs(listesCodes, sequenceur);
sequenceur.enfilerRafraichissement(this, new Information("ontologie_chargee"));
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Collection) {
collection = (Collection) nouvellesDonnees;
collectionChargementOk = true;
} else if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeursReceptionnee = (ValeurListe) nouvellesDonnees;
receptionerListeValeurs(listeValeursReceptionnee);
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("liste_collection_a_personne")) {
lierCollectionAPersonne((CollectionAPersonneListe) info.getDonnee(0));
} else if (info.getType().equals("liste_collection_a_publication")) {
lierCollectionAPublication((CollectionAPublicationListe) info.getDonnee(0));
} else if (info.getType().equals("liste_collection_a_commentaire")) {
lierCollectionACommentaire((CollectionACommentaireListe) info.getDonnee(0));
} else if (info.getType().equals("ontologie_chargee")) {
ontologieChargementOk = true;
}
} else {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
if (avoirDonneesChargees()) {
afficherDetail();
}
}
protected void lierCollectionAPersonne(CollectionAPersonneListe personnes) {
collection.setPersonnesLiees(personnes);
personnesLieesChargementOk = true;
}
protected void lierCollectionAPublication(CollectionAPublicationListe publications) {
collection.setPublicationsLiees(publications);
publicationsLieesChargementOk = true;
}
protected void lierCollectionACommentaire(CollectionACommentaireListe commentaires) {
collection.setCommentairesLiees(commentaires);
commentairesLieesChargementOk = true;
}
private boolean avoirDonneesChargees() {
boolean ok = false;
if (collectionChargementOk && ontologieChargementOk && personnesLieesChargementOk && publicationsLieesChargementOk && commentairesLieesChargementOk) {
ok = true;
}
return ok;
}
private void afficherDetail() {
if (collection != null) {
afficherEntete();
afficherIdentification();
afficherPersonne();
afficherPublication();
afficherDescription();
afficherContenu();
afficherInventaire();
afficherCommentaire();
}
layout();
}
private void afficherEntete() {
Params enteteParams = new Params();
enteteParams.set("css_id", ComposantId.ZONE_DETAIL_ENTETE);
enteteParams.set("css_meta", ComposantClass.META);
enteteParams.set("i18n_id", i18nC.id());
enteteParams.set("nom", collection.getNom());
enteteParams.set("structure", collection.getStructureNom());
enteteParams.set("id", collection.getId());
enteteParams.set("guid", collection.getGuid());
String eHtml = Format.substitute(enteteTpl, enteteParams);
entete.getElement().setInnerHTML(eHtml);
}
private void afficherIdentification() {
Params generalParams = new Params();
generalParams.set("i18n_titre_identification", i18nC.titreAdministratif());
generalParams.set("i18n_nom_alternatif", i18nC.intituleAlternatifCollection());
generalParams.set("i18n_mere", i18nC.collectionMere());
generalParams.set("i18n_type_ncd", i18nC.typeCollectionNcd());
generalParams.set("i18n_type_depot", i18nC.typeDepot());
generalParams.set("i18n_code", i18nC.codeAlternatifCollection());
generalParams.set("i18n_cote", i18nC.cote());
generalParams.set("i18n_general_collection_titre", i18nC.collectionGeneralTitre());
generalParams.set("i18n_description", i18nC.description());
generalParams.set("i18n_historique", i18nC.historique());
generalParams.set("i18n_web", i18nC.siteWeb());
generalParams.set("i18n_couverture_collection_titre", i18nC.collectionCouvertureTitre());
generalParams.set("i18n_couverture_geo", i18nC.couvertureGeo());
generalParams.set("i18n_periode", i18nC.periodeConstitutionDetail());
String periode = "";
if (!collection.getPeriodeConstitutionDebut().equals("0")) {
periode = collection.getPeriodeConstitutionDebut();
}
if (!collection.getPeriodeConstitutionFin().equals("0")) {
periode += " - "+collection.getPeriodeConstitutionFin();
}
generalParams.set("periode", periode);
generalParams.set("i18n_specimen_type_titre", i18nC.collectionSpecimenTypeTitre());
generalParams.set("i18n_specimen_type_presence", i18nC.specimenTypeCollectionDetail());
generalParams.set("i18n_specimen_type_nombre", i18nC.nbreSpecimenTypeCollectionDetail());
generalParams.set("i18n_specimen_type_classement", i18nC.classementSpecimenTypeCollectionDetail());
String nomAlternatif = construireTxtTruck(collection.getNomAlternatif());
String typeNcd = construireTxtListeOntologie(collection.getTypeNcd());
String typeDepot = construireTxtListeOntologie(collection.getTypeDepot());
String code = construireTxtTruck(collection.getCode());
String urls = construireTxtTruck(collection.getUrls(), false);
String couvertureGeo = construireTxtTruck(collection.getCouvertureLieu());
String specimenTypePresence = construireTxtListeOntologie(collection.getSpecimenType());
String specimenTypeNombrePrecision = construireTxtListeOntologie(collection.getSpecimenTypeNbrePrecision());
String specimenTypeNombre = "";
if (!collection.getSpecimenTypeNbre().equals("0") && !collection.getSpecimenTypeNbre().equals("")) {
specimenTypeNombre = collection.getSpecimenTypeNbre()+" ("+specimenTypeNombrePrecision+")";
}
String specimenTypeClassement = construireTxtListeOntologie(collection.getSpecimenTypeClassement());
generalParams.set("nom_alternatif", nomAlternatif);
generalParams.set("mere", collection.getCollectionMereNom());
generalParams.set("type_ncd", typeNcd);
generalParams.set("type_depot", typeDepot);
generalParams.set("code", code);
generalParams.set("cote", collection.getCote());
generalParams.set("description", collection.getDescription());
generalParams.set("historique", collection.getHistorique());
generalParams.set("web", urls);
generalParams.set("couverture_geo", couvertureGeo);
generalParams.set("specimen_type_presence", specimenTypePresence);
generalParams.set("specimen_type_nombre", specimenTypeNombre);
generalParams.set("specimen_type_classement", specimenTypeClassement);
afficherOnglet(generalTpl, generalParams, generalOnglet);
}
private void afficherPersonne() {
String tableauPersonneHtml = "";
if (collection.getPersonnesLiees() != null && collection.getPersonnesLiees().size() > 0) {
tableauPersonneHtml = construireTableauPersonnesLiees();
}
Params personneParams = new Params();
personneParams.set("i18n_titre_personne", i18nC.collectionPersonneTitre());
personneParams.set("tableau_personnes_liees", tableauPersonneHtml);
afficherOnglet(personneTpl, personneParams, personneOnglet);
}
private String construireTableauPersonnesLiees() {
Params contenuParams = new Params();
contenuParams.set("i18n_relation", i18nC.typeRelationPersonneCollection());
contenuParams.set("i18n_nom_complet", i18nC.personneNomComplet());
contenuParams.set("i18n_prenom", i18nC.personnePrenom());
contenuParams.set("i18n_nom", i18nC.personneNom());
contenuParams.set("i18n_naissance_date", i18nC.personneDateNaissance());
contenuParams.set("i18n_naissance_lieu", i18nC.personneLieuNaissance());
contenuParams.set("i18n_etre_decede", i18nC.personneDeces());
contenuParams.set("i18n_deces_date", i18nC.personneDateDeces());
contenuParams.set("i18n_deces_lieu", i18nC.personneLieuDeces());
String lignesPersonnel = "";
if (collection.getPersonnesLiees() != null) {
Iterator<String> it = collection.getPersonnesLiees().keySet().iterator();
while (it.hasNext()) {
CollectionAPersonne relationCollectionAPersonne = collection.getPersonnesLiees().get(it.next());
Personne personne = relationCollectionAPersonne.getPersonne();
String relation = construireTxtListeOntologie(relationCollectionAPersonne.getIdRole());
String etreDecede = construireTxtListeOntologie(personne.getDeces());
Params ligneParams = new Params();
ligneParams.set("relation", relation);
ligneParams.set("nom_complet", personne.getNomComplet());
ligneParams.set("nom", personne.getNom());
ligneParams.set("prenom", personne.getPrenom());
ligneParams.set("naissance_date", personne.getNaissanceDate());
ligneParams.set("naissance_lieu", personne.getNaissanceLieu());
ligneParams.set("etre_decede", etreDecede);
ligneParams.set("deces_date", personne.getDecesDate());
ligneParams.set("deces_lieu", personne.getDecesLieu());
lignesPersonnel += Format.substitute(lignePersonneLieeTpl, ligneParams);
}
}
String cHtml = i18nC.nonRenseigne();
if (!UtilString.isEmpty(lignesPersonnel)) {
contenuParams.set("lignes", lignesPersonnel);
cHtml = Format.substitute(tableauPersonnesLieesTpl, contenuParams);
}
return cHtml;
}
private void afficherPublication() {
Params publicationParams = new Params();
publicationParams.set("i18n_titre_publication", i18nC.collectionPublicationTitre());
String tableauPublicationHtml = "";
if (collection.getPersonnesLiees() != null && collection.getPersonnesLiees().size() > 0) {
tableauPublicationHtml = construireTableauPublicationsLiees();
}
publicationParams.set("tableau_publications_liees", tableauPublicationHtml);
afficherOnglet(publicationTpl, publicationParams, publicationOnglet);
}
private String construireTableauPublicationsLiees() {
Params contenuParams = new Params();
contenuParams.set("i18n_auteur", i18nC.publicationAuteurs());
contenuParams.set("i18n_titre", i18nC.publicationTitre());
contenuParams.set("i18n_revue", i18nC.publicationRevueCollection());
contenuParams.set("i18n_editeur", i18nC.publicationEditeur());
contenuParams.set("i18n_annee", i18nC.publicationDateParution());
contenuParams.set("i18n_nvt", i18nC.publicationNvt());
contenuParams.set("i18n_fascicule", i18nC.publicationFascicule());
contenuParams.set("i18n_page", i18nC.publicationPage());
contenuParams.set("i18n_source", i18nC.collectionPublicationSource());
String lignesPublication = "";
if (collection.getPublicationsLiees() != null) {
Iterator<String> it = collection.getPublicationsLiees().keySet().iterator();
while (it.hasNext()) {
CollectionAPublication relationCollectionAPublication = collection.getPublicationsLiees().get(it.next());
Publication publication = relationCollectionAPublication.getPublication();
Params ligneParams = new Params();
ligneParams.set("auteur", publication.getAuteur());
ligneParams.set("titre", publication.getTitre());
ligneParams.set("revue", publication.getCollection());
ligneParams.set("editeur", publication.getNomEditeur());
ligneParams.set("annee", publication.getAnneeParution());
ligneParams.set("nvt", publication.getIndicationNvt());
ligneParams.set("fascicule", publication.getFascicule());
ligneParams.set("page", publication.getPages());
ligneParams.set("source", relationCollectionAPublication.getSource() == "1" ? i18nC.oui() : i18nC.non());
lignesPublication += Format.substitute(lignePublicationLieeTpl, ligneParams);
}
}
 
String cHtml = i18nC.nonRenseigne();
if (!UtilString.isEmpty(lignesPublication)) {
contenuParams.set("lignes", lignesPublication);
cHtml = Format.substitute(tableauPublicationsLieesTpl, contenuParams);
}
return cHtml;
}
private void afficherDescription() {
Params descriptionParams = new Params();
descriptionParams.set("i18n_titre_description", i18nC.collectionEtatGeneralEtNombreEchantillons());
descriptionParams.set("i18n_type_botanique", i18nC.typeCollectionBotanique());
descriptionParams.set("i18n_nbre_echantillon", i18nC.nbreEchantillon());
descriptionParams.set("i18n_titre_unite_rangement", i18nC.collectionUniteRangementTitre());
descriptionParams.set("i18n_etat_unite_rangement", i18nC.collectionUniteRangementEtatGeneralDetail());
descriptionParams.set("i18n_titre_unite_base", i18nC.collectionUniteBaseTitre());
descriptionParams.set("i18n_titre_conservation", i18nC.collectionTitreConservation());
descriptionParams.set("i18n_type_papier", i18nC.typePapierConservationDetail());
descriptionParams.set("i18n_conservation_methode", i18nC.methodeConservationDetail());
descriptionParams.set("i18n_titre_etiquette", i18nC.collectionTitreEtiquette());
descriptionParams.set("i18n_specimen_fixation_pourcent", i18nC.specimenFixationPourcent());
descriptionParams.set("i18n_etiquette_fixation_pourcent", i18nC.etiquetteFixationPourcent());
descriptionParams.set("i18n_specimen_fixation_methode", i18nC.specimenMethodeFixationDetail());
descriptionParams.set("i18n_etiquette_fixation_methode_support", i18nC.etiquetteMethodeFixationSurSupportDetail());
descriptionParams.set("i18n_etiquette_fixation_methode_specimen", i18nC.etiquetteMethodeFixationSurSpecimenDetail());
descriptionParams.set("i18n_etiquette_type_ecriture", i18nC.typeEcritureDetail());
descriptionParams.set("i18n_titre_traitement", i18nC.collectionTitreTraitement());
descriptionParams.set("i18n_traitement", i18nC.collectionTraitementDetail());
descriptionParams.set("i18n_traitement_poison", i18nC.collectionTraitementPoisonDetail());
descriptionParams.set("i18n_traitement_insecte", i18nC.collectionTraitementInsecteDetail());
descriptionParams.set("i18n_titre_etat_degradation", i18nC.collectionTitreEtatEtDegradation());
descriptionParams.set("i18n_etat_general", i18nC.collectionEtatGeneralDetail());
descriptionParams.set("i18n_degradation_specimen", i18nC.degradationSpecimenDetail());
descriptionParams.set("i18n_degradation_presentation", i18nC.degradationPresentationDetail());
descriptionParams.set("i18n_determination", i18nC.collectionDeterminationDetail());
String typeBota = construireTxtListeOntologie(collection.getBotanique().getType());
descriptionParams.set("type_botanique", typeBota);
descriptionParams.set("nbre_echantillon", collection.getBotanique().getNbreEchantillon());
CollectionBotanique collectionBotanique = collection.getBotanique();
descriptionParams.set("i18n_collection_cartons_herbiers", i18nC.collectionCartonsHerbiers());
descriptionParams.set("i18n_nb_liasses", i18nC.collectionLiasses());
descriptionParams.set("i18n_autres_unites_rangement", i18nC.collectionAutreUnitesRangement());
String cartonsHerbiers = collectionBotanique.getNbCartonsHerbiers();
if(!collectionBotanique.getNbCartonsHerbiers().trim().isEmpty() &&
! collectionBotanique.getFormatCartonsHerbiers().trim().isEmpty()) {
cartonsHerbiers += " - "+i18nC.format()+": ";
}
cartonsHerbiers += collectionBotanique.getFormatCartonsHerbiers();
descriptionParams.set("nb_cartons_herbier", cartonsHerbiers);
String liasses = collectionBotanique.getNbLiasses();
if(!collectionBotanique.getNbLiasses().trim().isEmpty() &&
! collectionBotanique.getFormatLiasses().trim().isEmpty()) {
liasses += " - "+i18nC.format()+": ";
}
liasses += collectionBotanique.getFormatLiasses();
descriptionParams.set("nb_liasses", liasses);
 
descriptionParams.set("autres_unites_rangement", collectionBotanique.getAutresUnitesRangement().replaceAll("\r\n|\r|\n", ", "));
 
String etatUniteRangement = collectionBotanique.getUniteRangementEtat();
String[] ontoValEtatUniteRangement = OntologiesLocales.getListeBonMauvaisEtat().get(etatUniteRangement);
String eur = etatUniteRangement;
if (ontoValEtatUniteRangement != null && ontoValEtatUniteRangement.length > 0) {
eur = ontoValEtatUniteRangement[0];
Coel.LogVersFirebug("ontoValEtatUniteRangement[0]: " + eur);
}
descriptionParams.set("etat_unite_rangement", eur);
descriptionParams.set("i18n_nb_planches_herbier", i18nC.collectionNbPlanchesHerbier());
descriptionParams.set("i18n_nb_especes", i18nC.collectionNbEspeces());
descriptionParams.set("nb_planches_herbier", collectionBotanique.getNbPlanchesHerbiers());
descriptionParams.set("nb_especes", collectionBotanique.getNbEspeces());
String typePapier = construireTxtListeOntologie(collectionBotanique.getConservationPapierType());
String conservationMethode = construireTxtListeOntologie(collectionBotanique.getConservationMethode());
descriptionParams.set("type_papier", typePapier);
descriptionParams.set("conservation_methode", conservationMethode);
String specimenFixationMethode = construireTxtListeOntologie(collectionBotanique.getSpecimenFixationMethode());
String etiquetteFixationMethodeSupport = construireTxtListeOntologie(collectionBotanique.getEtiquetteFixationSupport());
String etiquetteFixationMethodeSpecimen = construireTxtListeOntologie(collectionBotanique.getEtiquetteFixationSpecimen());
String etiquetteTypeEcriture = construireTxtListeOntologie(collectionBotanique.getEtiquetteEcriture());
descriptionParams.set("specimen_fixation_pourcent", collectionBotanique.getSpecimenFixationPourcent());
descriptionParams.set("etiquette_fixation_pourcent", collectionBotanique.getEtiquetteFixationPourcent());
descriptionParams.set("specimen_fixation_methode", specimenFixationMethode);
descriptionParams.set("etiquette_fixation_methode_support", etiquetteFixationMethodeSupport);
descriptionParams.set("etiquette_fixation_methode_specimen", etiquetteFixationMethodeSpecimen);
descriptionParams.set("etiquette_type_ecriture", etiquetteTypeEcriture);
String traitement = construireTxtListeOntologie(collectionBotanique.getTraitement());
String traitementPoison = construireTxtListeOntologie(collectionBotanique.getTraitementPoison());
String traitementInsecte = construireTxtListeOntologie(collectionBotanique.getTraitementInsecte());
descriptionParams.set("traitement", traitement);
descriptionParams.set("traitement_poison", traitementPoison);
descriptionParams.set("traitement_insecte", traitementInsecte);
 
String etatGeneral = collectionBotanique.getEtatGeneral();
boolean valeurEstOntologie = false;
boolean typeEstOntologie = true;
boolean donneeEstOntologie = true;
String degradationSpecimen = construireTxtListeOntologie(collectionBotanique.getDegradationSpecimen(), valeurEstOntologie, typeEstOntologie, donneeEstOntologie);
String degradationPresentation = construireTxtListeOntologie(collectionBotanique.getDegradationPresentation(), valeurEstOntologie, typeEstOntologie, donneeEstOntologie);
String determination = construireTxtListeOntologie(collectionBotanique.getDetermination());
 
String[] ontoVal2 = OntologiesLocales.getListeBonMauvaisEtat().get(etatGeneral);
//Coel.LogVersFirebug("ontoval2: " + ontoVal2);
String eg = etatGeneral;
if (ontoVal2 != null && ontoVal2.length > 0) {
//Coel.LogVersFirebug("ontoval2[0]: " + ontoVal2[0]);
eg = ontoVal2[0];
}
descriptionParams.set("etat_general", eg);
 
descriptionParams.set("degradation_specimen", degradationSpecimen);
descriptionParams.set("degradation_presentation", degradationPresentation);
descriptionParams.set("determination", determination);
afficherOnglet(descriptionTpl, descriptionParams, descriptionOnglet);
}
private void afficherContenu() {
Params contenuParams = new Params();
contenuParams.set("i18n_titre_nature", i18nC.collectionNatureTitre());
contenuParams.set("i18n_nature", i18nC.natureVegetaleContenuDetail());
contenuParams.set("i18n_specialite", i18nC.specialiteCollectionDetail());
contenuParams.set("i18n_titre_classement", i18nC.collectionClassementTitre());
contenuParams.set("i18n_classement_etat", i18nC.etatClassementCollectionDetail());
contenuParams.set("i18n_classement", i18nC.annotationClassementCollectionDetail());
contenuParams.set("i18n_titre_etiquette", i18nC.collectionEtiquetteTitre());
contenuParams.set("i18n_etiquette_renseignement", i18nC.etiquetteRenseignementDetail());
contenuParams.set("i18n_precision_localite", i18nC.precisionLocaliteDetail());
contenuParams.set("i18n_precision_date", i18nC.precisionDateDetail());
contenuParams.set("i18n_etiquette_annotation", i18nC.etiquetteAnnotationDetail());
contenuParams.set("i18n_titre_integree", i18nC.collectionIntegreeTitre());
contenuParams.set("i18n_collection_integration", i18nC.integreCollectionDetail());
contenuParams.set("i18n_collection_integration_info", i18nC.infoIntegreCollectionDetail());
CollectionBotanique collectionBotanique = collection.getBotanique();
String nature = construireTxtListeOntologie(collectionBotanique.getNature());
contenuParams.set("nature", nature);
contenuParams.set("specialite", collectionBotanique.getSpecialite());
String classementEtat = construireTxtListeOntologie(collectionBotanique.getClassementEtat());
contenuParams.set("classement_etat", classementEtat);
contenuParams.set("classement", collectionBotanique.getClassementAnnotation());
String etiquetteRenseignements = "";
HashMap<String,String> infos = CollectionFormContenu.parserEtiquetteRenseignement(collectionBotanique.getEtiquetteRenseignement());
if (infos != null) {
Iterator<String> it = infos.keySet().iterator();
while (it.hasNext()) {
String cle = it.next();
if (cle.equals("AT")) {
etiquetteRenseignements += i18nC.etiquetteAuteurCollection();
} else if (cle.equals("F")) {
etiquetteRenseignements += i18nC.etiquetteFamille();
} else if (cle.equals("G")) {
etiquetteRenseignements += i18nC.etiquetteGenre();
} else if (cle.equals("SP")) {
etiquetteRenseignements += i18nC.etiquetteSp();
} else if (cle.equals("ASP")) {
etiquetteRenseignements += i18nC.etiquetteAuteurSp();
} else if (cle.equals("L")) {
etiquetteRenseignements += i18nC.etiquetteLocalite();
} else if (cle.equals("D")) {
etiquetteRenseignements += i18nC.etiquetteDateRecolte();
} else {
etiquetteRenseignements += i18nC.inconnue();
}
if (it.hasNext()) etiquetteRenseignements += ": "+infos.get(cle)+"%, ";
else etiquetteRenseignements += ": "+infos.get(cle)+"%.";
}
}
String precisionLocalite = construireTxtListeOntologie(collectionBotanique.getPrecisionLocalite());
String precisionDate = construireTxtListeOntologie(collectionBotanique.getPrecisionDate());
contenuParams.set("etiquette_renseignement", etiquetteRenseignements);
contenuParams.set("precision_localite", precisionLocalite);
contenuParams.set("precision_date", precisionDate);
contenuParams.set("etiquette_annotation", collectionBotanique.getAnnotationsDiverses());
String collectionIntegration = construireTxtListeOntologie(collectionBotanique.getCollectionIntegre());
String collectionIntegrationInfo = construireTxtListeOntologie(collectionBotanique.getCollectionIntegreInfo());
contenuParams.set("collection_integration", collectionIntegration);
contenuParams.set("collection_integration_info", collectionIntegrationInfo);
afficherOnglet(contenuTpl, contenuParams, contenuOnglet);
}
private void afficherInventaire() {
Params inventaireParams = new Params();
inventaireParams.set("i18n_titre_inventaire", i18nC.collectionInventaireTitre());
inventaireParams.set("i18n_existence", i18nC.existenceInventaireCollectionDetail());
inventaireParams.set("i18n_participation_auteur", i18nC.auteurInventaireCollectionDetail());
inventaireParams.set("i18n_forme", i18nC.formeInventaireCollectionDetail());
inventaireParams.set("i18n_info", i18nC.infoInventaireCollectionDetail());
inventaireParams.set("i18n_digital", i18nC.digitalInventaireCollectionDetail());
inventaireParams.set("i18n_digital_pourcent", i18nC.pourcentDigitalInventaireCollectionDetail());
inventaireParams.set("i18n_etat", i18nC.etatInventaireCollectionDetail());
//DELETEME inventaireParams.set("i18n_type_donnee", i18nC.typeDonneeInventaireCollectionDetail());
CollectionBotanique collectionBotanique = collection.getBotanique();
String existence = OntologiesLocales.getValeurOntologie(OntologiesLocales.getListeOuiNonPeutEtre(), collectionBotanique.getInventaire());
String participationAuteur = OntologiesLocales.getValeurOntologie(OntologiesLocales.getListeOuiNonPeutEtre(), collectionBotanique.getInventaireAuteur());
String forme = construireTxtListeOntologie(collectionBotanique.getInventaireForme());
String digital = construireTxtListeOntologie(collectionBotanique.getInventaireDigital());
String digitalPourcent = collectionBotanique.getInventaireDigitalPourcent()+"%";
String etat = construireTxtListeOntologie(collectionBotanique.getInventaireEtat());
inventaireParams.set("existence", existence);
inventaireParams.set("participation_auteur", participationAuteur);
inventaireParams.set("forme", forme);
inventaireParams.set("info", collectionBotanique.getInventaireInfo());
inventaireParams.set("digital", digital);
inventaireParams.set("digital_pourcent", digitalPourcent);
inventaireParams.set("etat", etat);
afficherOnglet(inventaireTpl, inventaireParams, inventaireOnglet);
}
private void afficherCommentaire() {
String tableauCommentaireHtml = "";
if (collection.getCommentairesLiees() != null && collection.getCommentairesLiees().size() > 0) {
tableauCommentaireHtml = construireTableauCommentairesLiees();
}
Params personneParams = new Params();
personneParams.set("i18n_titre_commentaire", i18nC.collectionCommentaireTitre());
personneParams.set("tableau_commentaires_liees", tableauCommentaireHtml);
afficherOnglet(commentaireTpl, personneParams, commentaireOnglet);
}
private String construireTableauCommentairesLiees() {
Params contenuParams = new Params();
contenuParams.set("i18n_type", i18nC.commentaireType());
contenuParams.set("i18n_titre", i18nC.commentaireTitre());
contenuParams.set("i18n_texte", i18nC.commentaireTexte());
contenuParams.set("i18n_ponderation", i18nC.commentairePonderation());
contenuParams.set("i18n_public", i18nC.commentairePublic());
String lignesCommentaire = "";
if (collection.getCommentairesLiees() != null) {
Iterator<String> it = collection.getCommentairesLiees().keySet().iterator();
while (it.hasNext()) {
CollectionACommentaire relationCollectionACommentaire = collection.getCommentairesLiees().get(it.next());
Commentaire commentaire = relationCollectionACommentaire.getCommentaire();
String type = construireTxtListeOntologie(relationCollectionACommentaire.getType());
String acces = (commentaire.etrePublic() ? i18nC.donneePublic() : i18nC.donneePrivee());
Params ligneParams = new Params();
ligneParams.set("type", type);
ligneParams.set("titre", commentaire.getTitre());
ligneParams.set("texte", commentaire.getTexte());
ligneParams.set("ponderation", commentaire.getPonderation()+"/100");
ligneParams.set("public", acces);
lignesCommentaire += Format.substitute(ligneCommentaireLieeTpl, ligneParams);
}
}
String cHtml = i18nC.nonRenseigne();
if (!UtilString.isEmpty(lignesCommentaire)) {
contenuParams.set("lignes", lignesCommentaire);
cHtml = Format.substitute(tableauCommentairesLieesTpl, contenuParams);
}
return cHtml;
}
protected String getNomStructure() {
String nomStructure = "";
if (structure != null) {
nomStructure = structure.getNom();
} else {
nomStructure = collection.getIdStructure();
}
return nomStructure;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/collection/CollectionDetailVue.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/collection/CollectionDetailVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/collection/CollectionDetailVue.java:r11-933,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/collection
New file
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/vues/collection:r11-933,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/collection:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/collection:r1136-1291
Merged /branches/v1.8-narince/src/org/tela_botanica/client/vues/collection:r1891-1892
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/FenetreForm.java
New file
0,0 → 1,30
package org.tela_botanica.client.vues;
 
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.GWT;
 
public class FenetreForm extends Window {
 
public FenetreForm(String titre) {
int hauteur = (int) Math.ceil(com.google.gwt.user.client.Window.getClientHeight() * .8);
int largeur = (int) Math.ceil(com.google.gwt.user.client.Window.getClientWidth() * .8);
setSize(largeur, hauteur);
setPlain(true);
setModal(true);
setBlinkModal(true);
setHeadingHtml(titre);
setLayout(new FitLayout());
setOnEsc(false);
}
public void setTailleFenetre(double ratioParRapportAEcran) {
int hauteur = (int) Math.ceil(com.google.gwt.user.client.Window.getClientHeight() * ratioParRapportAEcran);
int largeur = (int) Math.ceil(com.google.gwt.user.client.Window.getClientWidth() * ratioParRapportAEcran);
setSize(largeur, hauteur);
}
public void setTailleFenetre(int hauteur, int largeur) {
setSize(largeur, hauteur);
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/vues/FenetreForm.java:r11-702,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/FenetreForm.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/FenetreForm.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/FormulaireOnglet.java
New file
0,0 → 1,81
package org.tela_botanica.client.vues;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.i18n.ErrorMessages;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.synchronisation.Sequenceur;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
 
public abstract class FormulaireOnglet extends TabItem implements Rafraichissable {
protected Formulaire formulaire = null;
protected Mediateur mediateur = null;
protected Constantes i18nC = null;
protected ErrorMessages i18nM = null;
protected Configuration config = null;
protected String mode = null;
protected int tabIndex = 100;
protected static LabelAlign alignementLabelDefaut = LabelAlign.LEFT;
protected static int largeurLabelDefaut = 250;
public FormulaireOnglet() {
parametrer(this);
addListener(Events.Select, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
setAcces(true);
actualiser();
}
});
}
public static void parametrer(TabItem onglet) {
FormLayout layout = new FormLayout();
layout.setLabelWidth(largeurLabelDefaut);
layout.setLabelAlign(alignementLabelDefaut);
onglet.setLayout(layout);
onglet.setStyleAttribute("padding", "10px");
onglet.setScrollMode(Scroll.AUTO);
onglet.setData("acces", false);
}
 
protected void initialiserOnglet(Formulaire formulaireCourrant) {
formulaire = formulaireCourrant;
mediateur = formulaire.mediateur;
i18nC = Mediateur.i18nC;
i18nM = Mediateur.i18nM;
config = (Configuration) Registry.get(RegistreId.CONFIG);
mode = formulaire.mode;
tabIndex = formulaire.tabIndex;
}
public void actualiser() {
layout();
}
public void setAcces(boolean acces) {
this.setData("acces", acces);
}
public boolean etreAccede() {
boolean acces = false;
if (isAttached()) {
acces = this.getData("acces");
}
return acces;
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/vues/FormulaireOnglet.java:r11-686,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/FormulaireOnglet.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/FormulaireOnglet.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/structure/StructureForm.java
New file
0,0 → 1,488
package org.tela_botanica.client.vues.structure;
 
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.GrillePaginable;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.ProxyCollectionAPersonne;
import org.tela_botanica.client.composants.pagination.ProxyPersonnes;
import org.tela_botanica.client.composants.pagination.ProxyStructureAPersonne;
import org.tela_botanica.client.composants.pagination.ProxyValeur;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.InterneValeur;
import org.tela_botanica.client.modeles.InterneValeurListe;
import org.tela_botanica.client.modeles.MenuApplicationId;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.personne.PersonneListe;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
import org.tela_botanica.client.modeles.structure.StructureConservation;
import org.tela_botanica.client.modeles.structure.StructureValorisation;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.Pattern;
import org.tela_botanica.client.util.UtilArray;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.structure.StructureFormPersonne.EtatPersonnelStructure;
 
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.EventType;
import com.extjs.gxt.ui.client.event.KeyListener;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.store.Record;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.store.StoreEvent;
import com.extjs.gxt.ui.client.widget.Component;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.HiddenField;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.form.NumberField;
import com.extjs.gxt.ui.client.widget.form.Radio;
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
import com.extjs.gxt.ui.client.widget.grid.CheckColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.grid.HeaderGroupConfig;
import com.extjs.gxt.ui.client.widget.grid.RowNumberer;
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.user.client.Window;
 
public class StructureForm extends Formulaire implements Rafraichissable {
private TabPanel onglets = null;
private StructureFormIdentification identificationOnglet = null;
private StructureFormPersonne personnelOnglet = null;
private StructureFormConservation conservationOnglet = null;
private StructureFormValorisation valorisationOnglet = null;
// Onglet IDENTIFICATION
public Structure identification = null;
 
// Onglet PERSONNEL
// Vide suite à refactoring
// Onglet CONSERVATION
public StructureConservation conservation = null;
// Onglet VALORISATION
public StructureValorisation valorisation = null;
private Sequenceur sequenceur;
public Structure structure = null;
public Rafraichissable vueExterneARafraichirApresValidation = null;
public StructureForm(Mediateur mediateurCourrant, String modeDeCreation, Sequenceur sequenceur) {
initialiserFormulaire(mediateurCourrant, modeDeCreation, MenuApplicationId.STRUCTURE);
this.sequenceur = sequenceur;
// Ajout du titre
panneauFormulaire.setHeadingHtml(i18nC.titreAjoutFormStructurePanneau());
// Création des onglets
onglets = creerOnglets();
// Ajout des onglets au formulaire général
panneauFormulaire.add(onglets);
}
protected TabPanel creerOnglets() {
TabPanel ongletsStructure = new TabPanel();
// NOTE : pour faire apparaître les scrollBar il faut définir la hauteur du panneau d'onglets à 100% (autoHeight ne semble pas fonctionner)
ongletsStructure.setHeight("100%");
// Onlget formulaire IDENTIFICATION
ongletsStructure.add(creerOngletIdentification());
// Onlget formulaire PERSONNEL
ongletsStructure.add(creerOngletPersonnel());
// Onlget formulaire CONSERVATION
ongletsStructure.add(creerOngletConservation());
// Onlget formulaire VALORISATION
ongletsStructure.add(creerOngletValorisation());
// Sélection de l'onglet par défaut
//ongletsStructure(personnelOnglet);
return ongletsStructure;
}
private void repandreRafraichissement() {
if (vueExterneARafraichirApresValidation != null) {
String type = "structure_modifiee";
if (mode.equals(Formulaire.MODE_AJOUTER)) {
type = "structure_ajoutee";
}
Information info = new Information(type);
info.setDonnee(0, structure);
vueExterneARafraichirApresValidation.rafraichir(info);
}
}
public boolean soumettreFormulaire() {
// Vérification de la validité des champs du formulaire
boolean fomulaireValide = verifierFormulaire();
Structure identification = collecterStructureIdentification();
if(identification != null) {
structure = identification;
} else {
structure = this.identification;
}
 
structure.setConservation(this.conservation);
structure.setValorisation(this.valorisation);
if (fomulaireValide) {
// Collecte des données du formulaire
StructureConservation conservation = collecterStructureConservation();
StructureValorisation valorisation = collecterStructureValorisation();
if(conservation != null) {
structure.setConservation(conservation);
}
if(valorisation != null) {
structure.setValorisation(valorisation);
}
EtatPersonnelStructure etatPersonnel = personnelOnglet.collecter();
structure.setPersonnel(etatPersonnel.personnel);
structure.setConservation(conservation);
structure.setValorisation(valorisation);
if (mode.equals(MODE_AJOUTER)) {
// Ajout des informations sur la Structure
mediateur.ajouterStructure(this, structure, conservation, valorisation);
// L'ajout des relations StructureAPersonne se fait quand la structure a été ajoutée
// Voir la méthode rafraichir().
} else if (mode.equals(MODE_MODIFIER)) {
// Modification des informations sur la Structure
if (structure == null && conservation == null && valorisation == null) {
//InfoLogger.display("Modification d'une institution", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
} else {
mediateur.modifierStructure(this, structure.getId(), structure, conservation, valorisation);
}
if (etatPersonnel.personnelModifie.size() == 0 && etatPersonnel.personnelAjoute.size() == 0 && etatPersonnel.personnelSupprime.size() == 0) {
//InfoLogger.display("Modification du personnel", "Rien n'a été enregistré car le formulaire n'a pas été modifié.");
} else {
if (etatPersonnel.personnelModifie.size() != 0) {
personnelOnglet.incrementerDecompteRafraichissementPersonnel();
mediateur.modifierStructureAPersonne(this, etatPersonnel.personnelModifie);
}
// Ajout des relations StructureAPersonne
if (etatPersonnel.personnelAjoute.size() != 0) {
personnelOnglet.incrementerDecompteRafraichissementPersonnel();
mediateur.ajouterStructureAPersonne(this, structure.getId(), etatPersonnel.personnelAjoute);
}
// Suppression des relations StructureAPersonne
if (etatPersonnel.personnelSupprime.size() != 0) {
personnelOnglet.incrementerDecompteRafraichissementPersonnel();
mediateur.supprimerStructureAPersonne(this, etatPersonnel.personnelSupprime);
}
}
}
}
return fomulaireValide;
}
public boolean verifierFormulaire() {
ArrayList<String> messages = new ArrayList<String>();
messages.addAll(verifierOnglets());
// Affichage des messages d'alerte
if (messages.size() != 0) {
String[] a = {};
a = messages.toArray(a);
MessageBox.alert("Erreurs de saisies", UtilArray.implode(a, "\n\n"), null);
return false;
}
return true;
}
private ArrayList<String> verifierOnglets() {
ArrayList<String> messages = new ArrayList<String>();
messages.addAll(identificationOnglet.verifier());
messages.addAll(personnelOnglet.verifier());
return messages;
}
private StructureValorisation collecterStructureValorisation() {
return valorisationOnglet.collecter();
}
private void peuplerStructureValorisation() {
valorisationOnglet.peupler();
}
private StructureConservation collecterStructureConservation() {
return conservationOnglet.collecter();
}
private void peuplerStructureConservation() {
conservationOnglet.peupler();
}
private Structure collecterStructureIdentification() {
Structure structureARetourner = identificationOnglet.collecter();
return structureARetourner;
}
private TabItem creerOngletValorisation() {
valorisationOnglet = new StructureFormValorisation(mediateur, this, sequenceur);
return valorisationOnglet;
}
private TabItem creerOngletConservation() {
conservationOnglet = new StructureFormConservation(mediateur, this, sequenceur);
return conservationOnglet;
}
private EtatPersonnelStructure collecterStructurePersonnel() {
return personnelOnglet.collecter();
}
private void peuplerStructurePersonnel(StructureAPersonneListe personnel) {
personnelOnglet.peupler(personnel);
}
private TabItem creerOngletPersonnel() {
personnelOnglet = new StructureFormPersonne(this, mediateur);
return personnelOnglet;
}
private TabItem creerOngletIdentification() {
identificationOnglet = new StructureFormIdentification(this);
return identificationOnglet;
}
public void peuplerCasesACocher(String donnees, CheckBoxGroup groupeCac, TextField<String> champAutre) {
String[] valeurs = donnees.split(";;");
for (int i = 0; i < valeurs.length; i++) {
if (valeurs[i].startsWith("AUTRE##")) {
champAutre.setValue(valeurs[i].replaceFirst("^AUTRE##", ""));
} else {
//TODO : check : List<CheckBox> cases = groupeCac.getAll();
List<Field<?>> cases = groupeCac.getAll();
for (int j = 0; j < cases.size(); j++) {
if (cases.get(j).getId().equals("val-"+valeurs[i])) {
((CheckBox) cases.get(j)).setValue(true);
}
}
}
}
}
public void peuplerBoutonsRadio(String valeur, RadioGroup groupeBr) {
//List<Radio> boutons = groupeBr.getAll();
List<Field<?>> boutons = groupeBr.getAll();
String id = valeur+"_"+groupeBr.getName().replace("_grp", "");
for (int i = 0; i < boutons.size(); i++) {
if (boutons.get(i).getId().equals(id)) {
((Radio) boutons.get(i)).setValue(true);
}
}
}
public String creerChaineDenormalisee(List<CheckBox> liste) {
String identifiants = "";
if (liste != null) {
int taille = liste.size();
for (int i = 0; i < taille; i++) {
CheckBox cac = liste.get(i);
if (cac.isEnabled()) {
identifiants = identifiants.concat(";;"+cac.getData("id"));
}
}
identifiants.replaceFirst("^;;", "");
}
return identifiants;
}
public void afficherChampSupplementaire(Radio radioBtn) {
valorisationOnglet.afficherChampSupplementaire(radioBtn) ;
conservationOnglet.afficherChampSupplementaires(radioBtn);
}
public void rafraichir(Object nouvellesDonnees) {
try {
if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
rafraichirInformation(info);
if(!info.getType().equals("selection_structure") && !info.getType().equals("selection_structure")) {
repandreRafraichissement();
}
} else if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
rafraichirValeurListe(listeValeurs);
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
} catch (Exception e) {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), e);
}
controlerFermeture();
}
public void rafraichirInformation(Information info) {
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) {
GWT.log("MESSAGES:\n"+info.getMessages().toString(), null);
}
if (info.getType().equals("modif_structure")) {
InfoLogger.display("Modification d'une institution", info.toString());
Structure structureMaj = (Structure)(info.getDonnee(0));
if(structureMaj != null) {
// TRUE uniquement si la modification a retourné un objet JSON pour mise à jour
// (contenant les coordonnées générées, cf r1673)
structure.setLatitude(structureMaj.getLatitude());
structure.setLongitude(structureMaj.getLongitude());
}
controlerFermeture();
} else if (info.getType().equals("ajout_structure")) {
if (info.getDonnee(0) != null && ( info.getDonnee(0) instanceof String || info.getDonnee(0) instanceof Object) ) {
this.mode = MODE_MODIFIER;
String structureId;
 
if(info.getDonnee(0) instanceof String) {
structureId = (String) info.getDonnee(0);
}
else {
// le backend renvoie un objet si longitude et latitude ont
// été générés
Structure structureMaj = (Structure)(info.getDonnee(0));
// structureMaj == null ? erreur horriblement impensable
structure.setLatitude(structureMaj.getLatitude());
structure.setLongitude(structureMaj.getLongitude());
structureId = structureMaj.getId();
}
 
structure.setId(structureId);
identification = structure;
identificationOnglet.rafraichir(info);
personnelOnglet.rafraichir(info);
conservationOnglet.rafraichir(info);
valorisationOnglet.rafraichir(info);
InfoLogger.display("Ajout d'une Institution", "L'intitution '"+structureId+"' a bien été ajoutée");
} else {
InfoLogger.display("Ajout d'une Institution", info.toString());
}
} else if (info.getType().equals("modif_structure_a_personne")) {
InfoLogger.display("Modification du Personnel", info.toString());
personnelOnglet.rafraichir(info);
} else if (info.getType().equals("suppression_structure_a_personne")) {
InfoLogger.display("Suppression du Personnel", info.toString());
personnelOnglet.rafraichir(info);
} else if (info.getType().equals("ajout_structure_a_personne")) {
InfoLogger.display("Ajout du Personnel", info.toString());
personnelOnglet.rafraichir(info);
} else if (info.getType().equals("selection_structure")) {
InfoLogger.display("Modification d'une institution", info.toString());
String titre = i18nC.titreModifFormStructurePanneau();
if (info.getDonnee(0) != null) {
identification = (Structure)info.getDonnee(0);
identificationOnglet.rafraichir(info);
// Composition du titre
titre += " - ID : "+identification.getId();
}
if (info.getDonnee(1) != null) {
conservation = (StructureConservation)info.getDonnee(1);
conservationOnglet.rafraichir(info);
}
if (info.getDonnee(2) != null) {
valorisation = (StructureValorisation)info.getDonnee(2);
valorisationOnglet.rafraichir(info);
}
} else if (info.getType().equals("liste_structure_a_personne")) {
personnelOnglet.rafraichir(info);
}
}
public void rafraichirValeurListe(ValeurListe listeValeurs) {
List<Valeur> liste = listeValeurs.toList();
 
// Test pour savoir si la liste contient des éléments
if (liste.size() > 0) {
identificationOnglet.rafraichir(listeValeurs);
personnelOnglet.rafraichir(listeValeurs);
conservationOnglet.rafraichir(listeValeurs);
valorisationOnglet.rafraichir(listeValeurs);
//GWT.log("La liste #"+listeValeurs.getId()+" a été reçue!", null);
} else {
GWT.log("La liste #"+listeValeurs.getId()+" ne contient aucune valeurs!", null);
}
}
 
public String getIdIdentification() {
return identification.getId();
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/structure/StructureForm.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/structure/StructureForm.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/structure/StructureForm.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/structure/StructureFormIdentification.java
New file
0,0 → 1,757
package org.tela_botanica.client.vues.structure;
 
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.ChampComboBoxListeValeurs;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.ChampNombre;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.ProxyValeur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.InterneValeur;
import org.tela_botanica.client.modeles.InterneValeurListe;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
import org.tela_botanica.client.modeles.structure.StructureConservation;
import org.tela_botanica.client.modeles.structure.StructureValorisation;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.Pattern;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireOnglet;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.HiddenField;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.form.NumberField;
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.user.client.Window;
 
public class StructureFormIdentification extends FormulaireOnglet implements Rafraichissable {
public TabItem personnelOnglet;
public TabItem conservationOnglet;
public TabItem valorisationOnglet;
public HiddenField<String> idStructureChp;
public Structure identification;
public ListStore<Valeur> magazinLstpr;
public ComboBox<Valeur> comboLstpr;
public ListStore<Valeur> magazinLstpu;
public ComboBox<Valeur> comboLstpu;
public ComboBox<InterneValeur> comboAcronyme;
public TextField<String> ihChp;
public TextField<String> mnhnChp;
public ComboBox<InterneValeur> comboTypeStructure;
public TextField<String> nomStructureChp;
public TextField<String> dateFondationChp;
public TextArea descriptionChp;
public TextArea conditionAccesChp;
public TextArea conditionUsageChp;
public TextArea adrChp;
public TextField<String> cpChp;
public TextField<String> villeChp;
public ListStore<Valeur> magazinPays;
public ChampComboBoxRechercheTempsReelPaginable comboPays;
public TextField<String> latitudeChp;
public TextField<String> longitudeChp;
public TextField<String> telChp;
public TextField<String> faxChp;
public TextField<String> emailChp;
public TextField<String> urlChp;
public StructureAPersonneListe personnel;
public StructureAPersonneListe personnelAjoute;
public StructureAPersonneListe personnelModifie;
public StructureAPersonneListe personnelSupprime;
public NumberField nbreTotalPersonneStructureChp;
public EditorGrid<StructureAPersonne> grillePersonnel;
public ListStore<StructureAPersonne> personnelGrilleMagazin;
public StructureConservation conservation;
public RadioGroup formationMarkRGrpChp;
public RadioGroup interetFormationMarkRGrpChp;
public RadioGroup collectionCommuneMarkRGrpChp;
public RadioGroup accesControleMarkRGrpChp;
public RadioGroup restaurationMarkRGrpChp;
public RadioGroup traitementMarkRGrpChp;
public RadioGroup collectionAcquisitionMarkRGrpChp;
public RadioGroup echantillonAcquisitionMarkRGrpChp;
public TextField<String> localStockageAutreChp;
public TextField<String> meubleStockageAutreChp;
public TextField<String> parametreStockageAutreChp;
public TextField<String> collectionAutreAutreChp;
public TextField<String> autreCollectionAutreChp;
public TextField<String> opRestauAutreChp;
public TextField<String> autreMaterielAutreChp;
public TextField<String> poisonTraitementAutreChp;
public TextField<String> traitementAutreChp;
public TextField<String> insecteTraitementAutreChp;
public TextField<String> actionAutreChp;
public TextField<String> provenanceRechercheAutreChp;
public TextField<String> typeRechercheAutreChp;
public CheckBoxGroup localStockageTrukCacGrpChp;
public LayoutContainer localStockageTrukCp;
public CheckBoxGroup meubleStockageTrukCacGrpChp;
public LayoutContainer meubleStockageTrukCp;
public CheckBoxGroup parametreStockageTrukCacGrpChp;
public LayoutContainer parametreStockageTrukCp;
public LayoutContainer collectionAutreTrukCp;
public CheckBoxGroup collectionAutreTrukCacGrpChp;
public CheckBoxGroup opRestauTrukCacGrpChp;
public LayoutContainer opRestauTrukCp;
public CheckBoxGroup autreMaterielTrukCacGrpChp;
public LayoutContainer autreMaterielTrukCp;
public LayoutContainer traitementTrukCp;
public CheckBoxGroup traitementTrukCacGrpChp;
public LayoutContainer poisonTraitementTrukCp;
public LayoutContainer insecteTraitementTrukCp;
public CheckBoxGroup insecteTraitementTrukCacGrpChp;
public CheckBoxGroup poisonTraitementTrukCacGrpChp;
public LayoutContainer autreCollectionTrukCp;
public CheckBoxGroup autreCollectionTrukCacGrpChp;
public LayoutContainer provenanceRechercheTrukCp;
public CheckBoxGroup provenanceRechercheTrukCacGrpChp;
public CheckBoxGroup typeRechercheTrukCacGrpChp;
public LayoutContainer typeRechercheTrukCp;
public TextField<String> futureActionChp;
public TextField<String> sansMotifAccesChp;
public TextField<String> avecMotifAccesChp;
public TextField<String> formationChp;
public RadioGroup traitementAcquisitionMarkRGrpChp;
public LabelField traitementAcquisitionMarkLabel;
public RadioGroup materielConservationCeRGrpChp;
public StructureValorisation valorisation;
public RadioGroup actionMarkRGrpChp;
public LayoutContainer actionTrukCp;
public CheckBoxGroup actionTrukCacGrpChp;
public RadioGroup futureActionMarkRGrpChp;
public RadioGroup rechercheMarkRGrpChp;
public RadioGroup sansMotifAccesMarkRGrpChp;
public RadioGroup avecMotifAccesMarkRGrpChp;
public TextField<String> publicationChp;
public LayoutContainer materielConservationCp;
public ListStore<Personne> personneExistanteMagazin;
public ChampComboBoxRechercheTempsReelPaginable personneExistanteCombo;
public Button supprimerPersonnelBtn;
public CellEditor fonctionEditor;
public List<Valeur> fonctionsListe;
public Sequenceur sequenceur;
public Structure structure;
public Rafraichissable vueExterneARafraichirApresValidation;
private String ID = "identification";
Formulaire formulaireCourant;
public StructureFormIdentification(Formulaire formulaireCourant) {
initialiserOnglet(formulaireCourant);
setLayout(new FitLayout());
setId(ID);
setText(Mediateur.i18nC.structureInfoGeneral());
setStyleAttribute("padding", "0");
this.formulaireCourant = formulaireCourant;
//+-----------------------------------------------------------------------------------------------------------+
//+-----------------------------------------------------------------------------------------------------------+
// Champs cachés
idStructureChp = new HiddenField<String>();
//+-----------------------------------------------------------------------------------------------------------+
// Fieldset IDENTITÉ
FieldSet fieldSetIdentite = new FieldSet();
fieldSetIdentite.setHeadingHtml("Identité");
fieldSetIdentite.setCollapsible(true);
fieldSetIdentite.setLayout(Formulaire.creerFormLayout(120, LabelAlign.LEFT));
fieldSetIdentite.setAutoHeight(true);
nomStructureChp = new TextField<String>();
nomStructureChp.setTabIndex(tabIndex++);
nomStructureChp.setFieldLabel("Nom de la structure");
nomStructureChp.setAllowBlank(false);
nomStructureChp.getMessages().setBlankText("Ce champ est obligatoire.");
nomStructureChp.addStyleName(ComposantClass.OBLIGATOIRE);
nomStructureChp.addListener(Events.Valid, Formulaire.creerEcouteurChampObligatoire());
fieldSetIdentite.add(nomStructureChp, new FormData(450, 0));
// Création du sous-formulaire : Acronyme
LayoutContainer ligne = new LayoutContainer();
ligne.setLayout(new ColumnLayout());
ligne.setSize(600, -1);
LayoutContainer gauche = new LayoutContainer();
gauche.setLayout(Formulaire.creerFormLayout(120, LabelAlign.LEFT));
LayoutContainer droite = new LayoutContainer();
droite.setLayout(Formulaire.creerFormLayout(10, LabelAlign.LEFT));
ListStore<InterneValeur> acronymes = new ListStore<InterneValeur>();
acronymes.add(InterneValeurListe.getTypeAcronyme());
comboAcronyme = new ComboBox<InterneValeur>();
comboAcronyme.setTabIndex(tabIndex++);
comboAcronyme.setEmptyText("Sélectioner un type d'acronyme...");
comboAcronyme.setFieldLabel("Type d'acronyme");
comboAcronyme.setDisplayField("nom");
comboAcronyme.setStore(acronymes);
comboAcronyme.setEditable(false);
comboAcronyme.setTypeAhead(true);
comboAcronyme.setTriggerAction(TriggerAction.ALL);
comboAcronyme.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
@Override
public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
String acronymeAbr = se.getSelectedItem().getAbr();
if (acronymeAbr.equals("IH")) {
mnhnChp.hide();
ihChp.show();
} else if (acronymeAbr.equals("MNHN")) {
ihChp.hide();
mnhnChp.show();
} else if (acronymeAbr.equals("")) {
ihChp.hide();
mnhnChp.hide();
comboAcronyme.clearSelections();
}
}
});
gauche.add(comboAcronyme, new FormData("95%"));
ihChp = new TextField<String>();
ihChp.setTabIndex(tabIndex++);
ihChp.setLabelSeparator("");
ihChp.setToolTip("Index Herbariorum : herbier de plus de 5000 échantillons");
ihChp.hide();
droite.add(ihChp, new FormData("95%"));
mnhnChp = new TextField<String>();
mnhnChp.setTabIndex(tabIndex++);
mnhnChp.setLabelSeparator("");
mnhnChp.setToolTip("Acronyme MNHN : herbier de moins de 5000 échantillons");
mnhnChp.hide();
droite.add(mnhnChp, new FormData("95%"));
ligne.add(gauche, new ColumnData(.5));
ligne.add(droite, new ColumnData(.5));
fieldSetIdentite.add(ligne);
// Création du sous-formulaire : Type de Structure
LayoutContainer ligneTs = new LayoutContainer();
ligneTs.setLayout(new ColumnLayout());
ligneTs.setSize(600, -1);
LayoutContainer gaucheTs = new LayoutContainer();
gaucheTs.setLayout(Formulaire.creerFormLayout(120, LabelAlign.LEFT));
LayoutContainer droiteTs = new LayoutContainer();
droiteTs.setLayout(Formulaire.creerFormLayout(10, LabelAlign.LEFT));
ListStore<InterneValeur> typesStructure = new ListStore<InterneValeur>();
typesStructure.add(InterneValeurListe.getTypeStructure());
comboTypeStructure = new ComboBox<InterneValeur>();
comboTypeStructure.setTabIndex(tabIndex++);
comboTypeStructure.setEmptyText("Sélectioner un type de structure...");
comboTypeStructure.setFieldLabel("Statut des structures");
comboTypeStructure.setDisplayField("nom");
comboTypeStructure.setStore(typesStructure);
comboTypeStructure.setEditable(false);
comboTypeStructure.setTypeAhead(true);
comboTypeStructure.setTriggerAction(TriggerAction.ALL);
comboTypeStructure.addSelectionChangedListener(new SelectionChangedListener<InterneValeur>() {
@Override
public void selectionChanged(SelectionChangedEvent<InterneValeur> se) {
String typeAbr = se.getSelectedItem().getAbr();
if (typeAbr.equals("stpu")) {
comboLstpr.hide();
comboLstpu.show();
} else if (typeAbr.equals("stpr")) {
comboLstpu.hide();
comboLstpr.show();
} else if (typeAbr.equals("")) {
comboLstpr.hide();
comboLstpu.hide();
comboTypeStructure.clearSelections();
}
}
});
gaucheTs.add(comboTypeStructure, new FormData("95%"));
magazinLstpu = new ListStore<Valeur>();
comboLstpu = new ComboBox<Valeur>();
comboLstpu.setTabIndex(tabIndex++);
//comboLstpu.setFieldLabel("Statut des structures publiques");
comboLstpu.setLabelSeparator("");
comboLstpu.setDisplayField("nom");
comboLstpu.setEditable(false);
comboLstpu.setTriggerAction(TriggerAction.ALL);
comboLstpu.setStore(magazinLstpu);
comboLstpu.hide();
droiteTs.add(comboLstpu, new FormData("95%"));
mediateur.obtenirListeValeurEtRafraichir(this, "stpu", sequenceur);
magazinLstpr = new ListStore<Valeur>();
comboLstpr = new ComboBox<Valeur>();
comboLstpr.setTabIndex(tabIndex++);
//comboLstpr.setFieldLabel("Statut des structures privées");
comboLstpr.setLabelSeparator("");
comboLstpr.setDisplayField("nom");
comboLstpr.setEditable(false);
comboLstpr.setTriggerAction(TriggerAction.ALL);
comboLstpr.setStore(magazinLstpr);
comboLstpr.hide();
droiteTs.add(comboLstpr, new FormData("95%"));
mediateur.obtenirListeValeurEtRafraichir(this, "stpr", sequenceur);
ligneTs.add(gaucheTs, new ColumnData(0.5));
ligneTs.add(droiteTs, new ColumnData(0.5));
fieldSetIdentite.add(ligneTs);
dateFondationChp = new TextField();
dateFondationChp.setTabIndex(tabIndex++);
dateFondationChp.setFieldLabel("Date de fondation");
fieldSetIdentite.add(dateFondationChp);
nbreTotalPersonneStructureChp = new NumberField();
nbreTotalPersonneStructureChp.setFieldLabel("Nombre de personnes travaillant dans l'institution");
nbreTotalPersonneStructureChp.setFormat(NumberFormat.getFormat("#"));
nbreTotalPersonneStructureChp.setToolTip(i18nC.champNumerique());
nbreTotalPersonneStructureChp.setAllowDecimals(false);
nbreTotalPersonneStructureChp.setAllowNegative(false);
nbreTotalPersonneStructureChp.setEmptyText("");
fieldSetIdentite.add(nbreTotalPersonneStructureChp);
 
this.add(fieldSetIdentite);
//+-----------------------------------------------------------------------------------------------------------+
// Fieldset ADRESSE
LayoutContainer principalFdAdresse = new LayoutContainer();
principalFdAdresse.setLayout(new ColumnLayout());
principalFdAdresse.setSize(1050, -1);
LayoutContainer gaucheFdAdresse = new LayoutContainer();
gaucheFdAdresse.setLayout(Formulaire.creerFormLayout(null, LabelAlign.LEFT));
LayoutContainer droiteFdAdresse = new LayoutContainer();
droiteFdAdresse.setLayout(Formulaire.creerFormLayout(100, LabelAlign.LEFT));
droiteFdAdresse.setWidth(700);
FieldSet fieldSetAdresse = new FieldSet();
fieldSetAdresse.setHeadingHtml("Adresse");
fieldSetAdresse.setCollapsible(true);
fieldSetAdresse.setLayout(Formulaire.creerFormLayout(null, LabelAlign.LEFT));
adrChp = new TextArea();
adrChp.setTabIndex(tabIndex++);
adrChp.setFieldLabel("Adresse (Nom du batiment, rue...)");
fieldSetAdresse.add(adrChp, new FormData(550, 0));
cpChp = new TextField<String>();
cpChp.setTabIndex(tabIndex++);
cpChp.setFieldLabel("Code postal");
gaucheFdAdresse.add(cpChp, new FormData("95%"));
villeChp = new TextField<String>();
villeChp.setTabIndex(tabIndex++);
villeChp.setFieldLabel("Ville");
gaucheFdAdresse.add(villeChp, new FormData("95%"));
ModelType modelTypesPays = new ModelType();
modelTypesPays.setRoot("valeurs");
modelTypesPays.setTotalName("nbElements");
modelTypesPays.addField("cmlv_nom");
modelTypesPays.addField("cmlv_id_valeur");
modelTypesPays.addField("cmlv_abreviation");
modelTypesPays.addField("cmlv_description");
String displayNamePays = "cmlv_nom";
String nomListeTypes = "pays";
ProxyValeur<ModelData> proxyPays = new ProxyValeur<ModelData>(nomListeTypes, null);
comboPays = new ChampComboBoxRechercheTempsReelPaginable(proxyPays, modelTypesPays, displayNamePays);
comboPays.setWidth(100,500);
comboPays.getCombo().setTabIndex(tabIndex++);
comboPays.getCombo().setFieldLabel("Pays");
comboPays.getCombo().setForceSelection(true);
comboPays.getCombo().setTemplate(getTemplatePays());
droiteFdAdresse.add(comboPays, new FormData("95%"));
latitudeChp = new TextField<String>();
latitudeChp.setRegex(Pattern.latitude);
latitudeChp.setToolTip("Format : nombre décimal positif ou négatif de 0 à 90.");
latitudeChp.getMessages().setRegexText("La valeur saisie n'est pas une latitude valide. Exemples de latitude : -45,302010 ou 45.252423 ou 25,16.");
latitudeChp.setTabIndex(tabIndex++);
latitudeChp.setFieldLabel("Latitude (Nord)");
gaucheFdAdresse.add(latitudeChp, new FormData("95%"));
longitudeChp = new TextField<String>();
longitudeChp.setRegex(Pattern.longitude);
longitudeChp.setToolTip("Format : nombre décimal positif ou négatif de 0 à 180.");
longitudeChp.getMessages().setRegexText("La valeur saisie n'est pas une longitude valide. Exemples de longitude : -150,302010 ou 150.252423 ou 25,16.");
longitudeChp.setTabIndex(tabIndex++);
longitudeChp.setFieldLabel("Longitude (Est)");
droiteFdAdresse.add(longitudeChp, new FormData("95%"));
principalFdAdresse.add(gaucheFdAdresse, new ColumnData(.5));
principalFdAdresse.add(droiteFdAdresse, new ColumnData(.5));
fieldSetAdresse.add(principalFdAdresse);
this.add(fieldSetAdresse);
//+-----------------------------------------------------------------------------------------------------------+
// Fieldset TÉLÉPHONE et EMAIL
LayoutContainer principalFdTelMail = new LayoutContainer();
principalFdTelMail.setLayout(new ColumnLayout());
principalFdTelMail.setSize(700, -1);
LayoutContainer gaucheFdTelMail = new LayoutContainer();
gaucheFdTelMail.setLayout(Formulaire.creerFormLayout(60, LabelAlign.LEFT));
LayoutContainer droiteFdTelMail = new LayoutContainer();
droiteFdTelMail.setLayout(Formulaire.creerFormLayout(60, LabelAlign.LEFT));
FieldSet fieldSetTelMail = new FieldSet();
fieldSetTelMail.setHeadingHtml("Communication");
fieldSetTelMail.setCollapsible(true);
fieldSetTelMail.setLayout(Formulaire.creerFormLayout(null, LabelAlign.LEFT));
telChp = new TextField<String>();
telChp.setTabIndex(tabIndex++);
telChp.setFieldLabel("Téléphone");
gaucheFdTelMail.add(telChp, new FormData("95%"));
faxChp = new TextField<String>();
faxChp.setTabIndex(tabIndex++);
faxChp.setFieldLabel("Fax");
droiteFdTelMail.add(faxChp, new FormData("95%"));
emailChp = new TextField<String>();
emailChp.setTabIndex(tabIndex++);
emailChp.setFieldLabel("Courriel");
emailChp.setToolTip("Saisir le courriel de l'organisation, pas de courriel individuel. Ex. : accueil@organisation.org");
gaucheFdTelMail.add(emailChp, new FormData("95%"));
urlChp = new TextField<String>();
urlChp.setTabIndex(tabIndex++);
urlChp.setFieldLabel("Site web");
droiteFdTelMail.add(urlChp, new FormData("95%"));
principalFdTelMail.add(gaucheFdTelMail, new ColumnData(.5));
principalFdTelMail.add(droiteFdTelMail, new ColumnData(.5));
fieldSetTelMail.add(principalFdTelMail);
this.add(fieldSetTelMail);
//+-----------------------------------------------------------------------------------------------------------+
// Fieldset DESCRIPTION
FieldSet fieldSetDescription = new FieldSet();
fieldSetDescription.setHeadingHtml("Description");
fieldSetDescription.setCollapsible(true);
fieldSetDescription.setLayout(Formulaire.creerFormLayout(120, LabelAlign.LEFT));
descriptionChp = new TextArea();
descriptionChp.setTabIndex(tabIndex++);
descriptionChp.setFieldLabel("Description");
fieldSetDescription.add(descriptionChp, new FormData(550, 0));
conditionAccesChp = new TextArea();
conditionAccesChp.setTabIndex(tabIndex++);
conditionAccesChp.setFieldLabel("Conditions d'accès");
fieldSetDescription.add(conditionAccesChp, new FormData(550, 0));
conditionUsageChp = new TextArea();
conditionUsageChp.setTabIndex(tabIndex++);
conditionUsageChp.setFieldLabel("Conditions d'usage");
fieldSetDescription.add(conditionUsageChp, new FormData(550, 0));
this.add(fieldSetDescription);
}
private native String getTemplatePays() /*-{
return [
'<tpl for=".">',
'<div class="x-combo-list-item">{cmlv_nom} ({cmlv_abreviation})</div>',
'</tpl>'
].join("");
}-*/;
public void peuplerIdSurRetourAjout() {
initialiserIdentification();
idStructureChp.setValue(identification.getId());
nomStructureChp.setValue(identification.getNom());
}
public void peupler() {
if(identification == null) {
initialiserIdentification();
}
if (formulaireCourant.mode.equals(Formulaire.MODE_AJOUTER)) {
// Indique que l'ongleta pu être modifié pour la méthode collecter...
this.setData("acces", true);
// Initialisation de l'objet Structure
identification = new Structure();
}
 
if (formulaireCourant.mode.equals(Formulaire.MODE_MODIFIER) && identification != null && getData("acces").equals(false)) {
idStructureChp.setValue(identification.getId());
nomStructureChp.setValue(identification.getNom());
if (!identification.getIdAlternatif().isEmpty()) {
String[] acronyme = identification.getIdAlternatif().split("##");
//#436 : Ne pas afficher "null"
if (UtilString.isEmpty(acronyme[1]) || acronyme[1].equals("null")) {
acronyme[1] = "";
}
if (acronyme[0].matches("^IH$")) {
comboAcronyme.setValue(InterneValeurListe.getTypeAcronymeIH());
ihChp.setValue(acronyme[1]);
} else if (acronyme[0].matches("^MNHN$")) {
comboAcronyme.setValue(InterneValeurListe.getTypeAcronymeMNHN());
mnhnChp.setValue(acronyme[1]);
}
}
if (!identification.getTypePrive().isEmpty()) {
if (identification.getTypePrive().matches("^[0-9]+$")) {
comboTypeStructure.setValue(InterneValeurListe.getTypePrivee());
comboLstpr.setValue(comboLstpr.getStore().findModel("id_valeur", identification.getTypePrive()));
}
} else if (!identification.getTypePublic().isEmpty()) {
if (identification.getTypePublic().matches("^[0-9]+$")) {
comboTypeStructure.setValue(InterneValeurListe.getTypePublique());
comboLstpu.setValue(comboLstpu.getStore().findModel("id_valeur", identification.getTypePublic()));
}
}
String dateFondation = identification.getAnneeOuDateFondation();
dateFondationChp.setValue(dateFondation);
descriptionChp.setValue(identification.getDescription());
conditionAccesChp.setValue(identification.getConditionAcces());
conditionUsageChp.setValue(identification.getConditionUsage());
adrChp.setValue(identification.getAdresse());
cpChp.setValue(identification.getCodePostal());
villeChp.setValue(identification.getVille());
 
if (identification.getPays().matches("^[0-9]+$")) {
comboPays.chargerValeurInitiale(identification.getPays(), "cmlv_id_valeur");
} else {
comboPays.getCombo().setRawValue(identification.getPays());
}
latitudeChp.setValue(identification.getLatitude());
longitudeChp.setValue(identification.getLongitude());
telChp.setValue(identification.getTelephoneFixe());
faxChp.setValue(identification.getFax());
emailChp.setValue(identification.getCourriel());
urlChp.setValue(identification.getUrl("WEB"));
nbreTotalPersonneStructureChp.setValue(identification.getNbrePersonne());
// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
this.setData("acces", true);
}
}
private void initialiserIdentification() {
identification = ((StructureForm)formulaireCourant).identification;
}
 
public Structure collecter() {
peupler();
Structure structureARetourner = null;
if (this.getData("acces").equals(true)) {
if(identification == null) {
initialiserIdentification();
}
Structure structureCollectee = (Structure) identification.cloner(new Structure());
structureCollectee.setId(idStructureChp.getValue());
structureCollectee.setNom(nomStructureChp.getValue());
// Récupération de l'acronyme (= identifiant alternatif)
structureCollectee.setIdAlternatif(null);
if (comboAcronyme.getValue() != null) {
String typeAcronyme = comboAcronyme.getValue().getAbr();
if (typeAcronyme == "IH") {
structureCollectee.setIdAlternatif(typeAcronyme+"##"+ihChp.getValue());
} else if (typeAcronyme == "MNHN") {
structureCollectee.setIdAlternatif(typeAcronyme+"##"+mnhnChp.getValue());
}
}
// Récupération statut de la structure
structureCollectee.setTypePublic(null);
structureCollectee.setTypePrive(null);
if (comboTypeStructure.getValue() != null) {
String typeStructure = comboTypeStructure.getValue().getAbr();
if (typeStructure == "stpu" && comboLstpu.getValue() != null) {
structureCollectee.setTypePublic(comboLstpu.getValue().getId());
} else if (typeStructure == "stpr" && comboLstpr.getValue() != null) {
structureCollectee.setTypePrive(comboLstpr.getValue().getId());
}
}
String valeurDateFondation = dateFondationChp.getValue();
if (!UtilString.isEmpty(valeurDateFondation)) {
if (valeurDateFondation.matches("\\d{2}/\\d{2}/\\d{4}")) {
Date dateFondation = DateTimeFormat.getFormat("dd/MM/yyyy").parse(valeurDateFondation);
structureCollectee.setDateFondation(dateFondation);
} else if (valeurDateFondation.matches("\\d{4}")) {
structureCollectee.setDateFondation(valeurDateFondation + "-00-00");
}
}
structureCollectee.setDescription(descriptionChp.getValue());
structureCollectee.setConditionAcces(conditionAccesChp.getValue());
structureCollectee.setConditionUsage(conditionUsageChp.getValue());
structureCollectee.setAdresse(adrChp.getValue());
structureCollectee.setCodePostal(cpChp.getValue());
structureCollectee.setVille(villeChp.getValue());
structureCollectee.setPays(null);
if (comboPays.getCombo().getValue() != null) {
structureCollectee.setPays(new Valeur(comboPays.getValeur()).getId());
} else if (comboPays.getCombo().getRawValue() != "") {
structureCollectee.setPays(comboPays.getCombo().getRawValue());
}
structureCollectee.setLatitude(latitudeChp.getValue());
structureCollectee.setLongitude(longitudeChp.getValue());
structureCollectee.setTelephoneFixe(telChp.getValue());
structureCollectee.setFax(faxChp.getValue());
structureCollectee.setCourriel(emailChp.getValue());
structureCollectee.setUrl(Structure.URL_SITE, urlChp.getValue());
structureCollectee.setNbrePersonne(nbreTotalPersonneStructureChp.getValue());
structureARetourner = identification = structureCollectee;
} else {
 
}
return structureARetourner;
}
 
@Override
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
rafraichirValeurListe(listeValeurs);
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
rafraichirInformation(info);
} else {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
}
public void rafraichirInformation(Information info) {
if (info.getType().equals("ajout_structure")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
String structureId = (String) info.getDonnee(0);
identification.setId(structureId);
this.setData("acces", false);
peupler();
} else {
InfoLogger.display("Ajout d'une Institution", info.toString());
}
} else if (info.getType().equals("selection_structure")) {
InfoLogger.display("Modification d'une institution", info.toString());
String titre = i18nC.titreModifFormStructurePanneau();
if (info.getDonnee(0) != null) {
try {
identification = (Structure) info.getDonnee(0);
setAcces(false);
peupler();
} catch(Exception e) {
GWT.log("Problème de cast. "+info.getDonnee(0)+" ne peut être casté en Structure", e);
}
// Composition du titre
titre += " - ID : "+identification.getId();
}
}
}
private void rafraichirValeurListe(ValeurListe listeValeurs) {
List<Valeur> liste = listeValeurs.toList();
 
// Test pour savoir si la liste contient des éléments
if (liste.size() > 0) {
if (listeValeurs.getId().equals(config.getListeId("stpr"))) {
magazinLstpr.removeAll();
magazinLstpr.add(liste);
comboLstpr.setStore(magazinLstpr);
}
if (listeValeurs.getId().equals(config.getListeId("stpu"))) {
magazinLstpu.removeAll();
magazinLstpu.add(liste);
comboLstpu.setStore(magazinLstpu);
}
}
}
 
public Collection<? extends String> verifier() {
ArrayList<String> messages = new ArrayList<String>();
// Vérification des infos sur le nom de la structure
if ( (this.getData("acces").equals(true) && nomStructureChp.getValue() == null) ||
(this.getData("acces").equals(true) && nomStructureChp.getValue().equals("")) ||
(this.getData("acces").equals(false) && identification.getNom().equals(""))) {
messages.add("Veuillez indiquez un nom à l'institution.");
}
//Vérification de la date de fondation
String valeurDateFondation = dateFondationChp.getValue();
if (!UtilString.isEmpty(valeurDateFondation) && (!valeurDateFondation.matches("\\d{2}/\\d{2}/\\d{4}") &&
!valeurDateFondation.matches("\\d{4}"))) {
messages.add("La date de fondation n'est pas au format jj/MM/AAAA ou AAAA");
}
return messages;
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/structure/StructureFormPersonne.java
New file
0,0 → 1,789
package org.tela_botanica.client.vues.structure;
 
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.composants.ChampComboBoxRechercheTempsReelPaginable;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.pagination.ProxyPersonnes;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
import org.tela_botanica.client.vues.FenetreForm;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireBarreValidation;
import org.tela_botanica.client.vues.FormulaireOnglet;
import org.tela_botanica.client.vues.personne.PersonneForm;
 
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.store.Record;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.store.StoreEvent;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.NumberField;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.grid.CellEditor;
import com.extjs.gxt.ui.client.widget.grid.CheckColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.grid.RowNumberer;
import com.extjs.gxt.ui.client.widget.layout.FitData;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.NumberFormat;
import com.google.gwt.user.client.Window;
 
public class StructureFormPersonne extends FormulaireOnglet implements Rafraichissable {
private StructureAPersonneListe personnel = null;
private StructureAPersonneListe personnelAjoute = null;
private StructureAPersonneListe personnelModifie = null;
private StructureAPersonneListe personnelSupprime = null;
private NumberField nbreTotalPersonneStructureChp = null;
private EditorGrid<StructureAPersonne> grillePersonnel = null;
private ListStore<StructureAPersonne> personnelGrilleMagazin = null;
public ListStore<Valeur> fonctionsMagazin;
public ComboBox<Valeur> fonctionsCombo;
public ListStore<Valeur> magazinLiStatut;
public ComboBox<Valeur> comboLiStatut;
private ListStore<Personne> personneExistanteMagazin = null;
private ChampComboBoxRechercheTempsReelPaginable personneExistanteCombo = null;
private Button supprimerPersonnelBtn = null;
private CellEditor fonctionEditor = null;
private List<Valeur> fonctionsListe = null;
private String ID = "personnel";
private Formulaire formulaireCourant = null;
private int decompteRafraichissementPersonnel;
private FenetreForm fenetreFormulaire = null;
private Sequenceur sequenceur = null;
final class EtatPersonnelStructure {
public StructureAPersonneListe personnelModifie;
public StructureAPersonneListe personnelAjoute;
public StructureAPersonneListe personnelSupprime;
public StructureAPersonneListe personnel;
}
 
public StructureFormPersonne(Formulaire formulaireCourant, Mediateur mediateur) {
initialiserOnglet(formulaireCourant);
this.formulaireCourant = formulaireCourant;
// Création des objets contenant les manipulations de la grille
personnelModifie = new StructureAPersonneListe();
personnelAjoute = new StructureAPersonneListe();
personnelSupprime = new StructureAPersonneListe();
setId(ID);
setText(Mediateur.i18nC.personneSingulier());
FormulaireOnglet.parametrer(this);
this.setLayout(Formulaire.creerFormLayout(400, LabelAlign.LEFT));
this.setStyleAttribute("padding", "0");
this.addListener(Events.Select, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
setData("acces", true);
 
// Rafraichissement du contenu de la grille du personnel
if (StructureFormPersonne.this.formulaireCourant.mode.equals(Formulaire.MODE_AJOUTER)) {
rafraichirPersonnel();
}
}
});
ContentPanel cp = new ContentPanel();
cp.setHeadingHtml("Personnes travaillant sur les collections");
cp.setIcon(Images.ICONES.table());
cp.setScrollMode(Scroll.AUTO);
cp.setLayout(new FitLayout());
//cp.setWidth(1250);
//cp.setHeight("100%");
cp.setFrame(true);
personnelGrilleMagazin = new ListStore<StructureAPersonne>();
personnelGrilleMagazin.setMonitorChanges(true);
personnelGrilleMagazin.addListener(Store.Add, new Listener<StoreEvent<StructureAPersonne>>() {
public void handleEvent(StoreEvent<StructureAPersonne> ce) {
// Activation du bouton supprimer si la grille contient un élément
if (grillePersonnel.getStore().getCount() > 0) {
supprimerPersonnelBtn.enable();
}
}
});
RowNumberer r = new RowNumberer();
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
 
GridSelectionModel<StructureAPersonne> sm = new GridSelectionModel<StructureAPersonne>();
configs.add(r);
ColumnConfig column = new ColumnConfig("fonction", "Fonction", 150);
fonctionsMagazin = new ListStore<Valeur>();
fonctionsCombo = new ComboBox<Valeur>();
fonctionsCombo.setTriggerAction(TriggerAction.ALL);
fonctionsCombo.setEditable(true);
fonctionsCombo.setDisplayField("nom");
fonctionsCombo.setStore(fonctionsMagazin);
mediateur.obtenirListeValeurEtRafraichir(this, "fonction", sequenceur);
fonctionEditor = new CellEditor(fonctionsCombo) {
@Override
public Object preProcessValue(Object valeur) {
Valeur retour = null;
if (valeur != null) {
String chaineTransmise = (String) valeur;
if (fonctionsMagazin.getCount() == 0 && fonctionsListe != null) {
fonctionsMagazin.add(fonctionsListe);
}
if (fonctionsMagazin.findModel("id_valeur", chaineTransmise) != null) {
retour = fonctionsMagazin.findModel("id_valeur", chaineTransmise);
} else if (fonctionsMagazin.findModel("nom", chaineTransmise) != null) {
retour = fonctionsMagazin.findModel("nom", chaineTransmise);
} else {
retour = new Valeur("", chaineTransmise, "", "");
}
}
return retour;
}
@Override
public Object postProcessValue(Object valeur) {
String retour = "";
Valeur fonctionTrouvee = null;
if (valeur == null) {
String valeurBrute = this.getField().getRawValue();
if (fonctionsMagazin.getCount() == 0 && fonctionsListe != null) {
fonctionsMagazin.add(fonctionsListe);
}
if (valeurBrute.matches("^[0-9]+$") && fonctionsMagazin.findModel("id_valeur", valeurBrute) != null) {
fonctionTrouvee = fonctionsMagazin.findModel("id_valeur", valeurBrute);
} else {
retour = valeurBrute;
}
} else if (valeur instanceof Valeur) {
fonctionTrouvee = (Valeur) valeur;
}
if (fonctionTrouvee != null) {
retour = fonctionTrouvee.getNom();
}
return retour;
}
};
column.setEditor(fonctionEditor);
configs.add(column);
column = new ColumnConfig("prenom", "Prénom", 100);
configs.add(column);
column = new ColumnConfig("nom", "Nom", 100);
configs.add(column);
 
column = new ColumnConfig("tel_fix", "Téléphone", 100);
configs.add(column);
 
column = new ColumnConfig("tel_fax", "Fax", 100);
configs.add(column);
column = new ColumnConfig("courriel", "Courriel principal", 200);
configs.add(column);
magazinLiStatut = new ListStore<Valeur>();
magazinLiStatut.add(new ArrayList<Valeur>());
comboLiStatut = new ComboBox<Valeur>();
comboLiStatut.setTriggerAction(TriggerAction.ALL);
comboLiStatut.setEditable(false);
comboLiStatut.disableTextSelection(true);
comboLiStatut.setDisplayField("nom");
comboLiStatut.setStore(magazinLiStatut);
mediateur.obtenirListeValeurEtRafraichir(this, "statut", sequenceur);
CellEditor statutEditor = new CellEditor(comboLiStatut) {
@Override
public Object preProcessValue(Object value) {
if (value == null) {
return value;
}
return comboLiStatut.getStore().findModel("nom", (String) value);
}
@Override
public Object postProcessValue(Object value) {
if (value == null) {
return value;
}
return ((Valeur) value).get("nom");
}
};
column = new ColumnConfig("statut", "Statut", 100);
column.setEditor(statutEditor);
configs.add(column);
column = new ColumnConfig("travail", "Travail hebdo (%)", 100);
column.setNumberFormat(NumberFormat.getFormat("##"));
NumberField tpsWChp = new NumberField();
tpsWChp.setFormat(NumberFormat.getFormat("##"));
tpsWChp.setToolTip("Ce champ doit contenir un nombre");
column.setEditor(new CellEditor(tpsWChp));
configs.add(column);
column = new ColumnConfig("specialite", "Spécialité botanique principale", 150);
configs.add(column);
CheckColumnConfig checkColumn = new CheckColumnConfig("contact", "Contact ?", 60);
configs.add(checkColumn);
ToolBar toolBar = new ToolBar();
personneExistanteMagazin = new ListStore<Personne>();
personneExistanteMagazin.add(new ArrayList<Personne>());
ModelType modelTypePersonnes = new ModelType();
modelTypePersonnes.setRoot("personnes");
modelTypePersonnes.setTotalName("nbElements");
modelTypePersonnes.addField("cp_fmt_nom_complet");
modelTypePersonnes.addField("cp_nom");
modelTypePersonnes.addField("cp_prenom");
modelTypePersonnes.addField("cp_truk_courriel");
modelTypePersonnes.addField("cp_truk_telephone");
modelTypePersonnes.addField("cp_ce_truk_specialite");
modelTypePersonnes.addField("cp_id_personne");
String displayNamePersonnes = "cp_fmt_nom_complet";
ProxyPersonnes<ModelData> proxyPersonnes = new ProxyPersonnes<ModelData>(null);
personneExistanteCombo = new ChampComboBoxRechercheTempsReelPaginable(proxyPersonnes, modelTypePersonnes, displayNamePersonnes);
personneExistanteCombo.getCombo().setEmptyText("Rechercher et sélectionner une personne existante dans la base");
// TODO : dans GXT 2.0 plus besoin de l'adaptateur, on peut ajouter la combobox directement sur la toolbar
//> CHECK
toolBar.add(personneExistanteCombo);
personneExistanteCombo.getCombo().addListener(Events.Select, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
if (personneExistanteCombo.getValeur() instanceof ModelData) {
Personne personneExistante = new Personne(personneExistanteCombo.getValeur());
StructureAPersonne membreDuPersonnel = new StructureAPersonne(personneExistante, "", StructureAPersonne.ROLE_EQUIPE, StructureAPersonne.ETAT_AJOUTE);
ajouterMembreAGrillePersonnel(membreDuPersonnel);
personneExistanteCombo.getCombo().setValue(null);
}
}
});
 
toolBar.add(new Text(" ou "));
Button ajouterPersonnelBtn = creerBoutonAjouter();
toolBar.add(ajouterPersonnelBtn);
toolBar.add(new SeparatorToolItem());
Button modifierPersonnelBtn = creerBoutonModifier();
toolBar.add(modifierPersonnelBtn);
toolBar.add(new SeparatorToolItem());
supprimerPersonnelBtn = new Button("Supprimer");
supprimerPersonnelBtn.setIcon(Images.ICONES.vcardSupprimer());
supprimerPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
StructureAPersonne personne = grillePersonnel.getSelectionModel().getSelectedItem();
if (personne != null) {
// Ajout de la personne supprimée à la liste
if (personne.getIdPersonne() != null && !personne.getIdPersonne().equals("")) {
personnelSupprime.put(personne.getId(), personne);
}
// Suppression de l'enregistrement de la grille
grillePersonnel.getStore().remove(personne);
// Désactivation du bouton supprimer si la grille contient plus d'élément
if (grillePersonnel.getStore().getCount() == 0) {
//TODO : check : Item -> component
ce.getComponent().disable();
}
}
}
});
toolBar.add(supprimerPersonnelBtn);
toolBar.add(new SeparatorToolItem());
Button rafraichirPersonnelBtn = new Button("Rafraichir");
rafraichirPersonnelBtn.setIcon(Images.ICONES.rafraichir());
rafraichirPersonnelBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
rafraichirPersonnel();
}
});
toolBar.add(rafraichirPersonnelBtn);
toolBar.add(new SeparatorToolItem());
cp.setTopComponent(toolBar);
 
ColumnModel cm = new ColumnModel(configs);
grillePersonnel = new EditorGrid<StructureAPersonne>(personnelGrilleMagazin, cm);
//grillePersonnel.setHeight("100%");
grillePersonnel.setAutoHeight(true);
grillePersonnel.setBorders(true);
grillePersonnel.setSelectionModel(sm);
grillePersonnel.addPlugin(checkColumn);
grillePersonnel.addPlugin(r);
grillePersonnel.getView().setForceFit(true);
grillePersonnel.setAutoExpandColumn("specialite");
grillePersonnel.setStripeRows(true);
grillePersonnel.setTrackMouseOver(true);
personnelGrilleMagazin.addListener(Store.Update, new Listener<StoreEvent<StructureAPersonne>>() {
public void handleEvent(StoreEvent<StructureAPersonne> ce) {
StructureAPersonne structureAPersonne = ce.getModel();
String etat = structureAPersonne.get("etat");
if ((etat==null || !etat.equals(aDonnee.ETAT_AJOUTE)) && structureAPersonne!=null && !UtilString.isEmpty(structureAPersonne.getId())) {
ce.getModel().set("etat", aDonnee.ETAT_MODIFIE);
}
}
});
cp.add(grillePersonnel);
this.add(cp);
this.setAutoHeight(true);
}
private Button creerBoutonAjouter() {
Button bouton = new Button(i18nC.ajouter());
bouton.setIcon(Images.ICONES.vcardAjouter());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_AJOUTER);
fenetreFormulaire.show();
}
});
return bouton;
}
private Button creerBoutonModifier() {
Button bouton = new Button(i18nC.modifier());
bouton.setIcon(Images.ICONES.vcardModifier());
bouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
String IdpersonneSaisieSelectionnee = (grillePersonnel.getSelectionModel().getSelectedItem()).getIdPersonne();
if (IdpersonneSaisieSelectionnee == null) {
InfoLogger.display(i18nC.informationTitreGenerique(), i18nC.selectionnerPersonne());
} else {
fenetreFormulaire = creerFenetreModaleAvecFormulairePersonne(Formulaire.MODE_MODIFIER);
fenetreFormulaire.show();
}
}
});
return bouton;
}
private FenetreForm creerFenetreModaleAvecFormulairePersonne(String mode) {
String personneId = null;
if (mode.equals(Formulaire.MODE_MODIFIER)) {
personneId = (grillePersonnel.getSelectionModel().getSelectedItem()).getIdPersonne();
}
final FenetreForm fenetre = new FenetreForm("");
final PersonneForm formulaire = creerFormulairePersonne(fenetre, personneId);
fenetre.add(formulaire);
return fenetre;
}
private PersonneForm creerFormulairePersonne(final FenetreForm fenetre, final String personneId) {
PersonneForm formulairePersonne = new PersonneForm(mediateur, personneId, this);
FormPanel panneauFormulaire = formulairePersonne.getFormulaire();
fenetre.setHeadingHtml(panneauFormulaire.getHeadingHtml());
panneauFormulaire.setHeaderVisible(false);
panneauFormulaire.setTopComponent(null);
// FIXME : avec GXT-2.1.0 la redéfinition du bottom component ne marche plus. Nous le cachons et en créeons un dans la fenêtre.
panneauFormulaire.getBottomComponent().hide();
SelectionListener<ButtonEvent> ecouteur = creerEcouteurValidationFormulairePersonne(fenetre, formulairePersonne);
final ButtonBar barreValidation = new FormulaireBarreValidation(ecouteur);
fenetre.setBottomComponent(barreValidation);
return formulairePersonne;
}
private SelectionListener<ButtonEvent> creerEcouteurValidationFormulairePersonne(final FenetreForm fenetre, final PersonneForm formulaire) {
SelectionListener<ButtonEvent> ecouteur = new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
String code = ((Button) ce.getComponent()).getData("code");
if (code.equals(FormulaireBarreValidation.CODE_BOUTON_VALIDER)) {
if (formulaire.soumettreFormulaire()) {
fenetre.hide();
}
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_APPLIQUER)) {
formulaire.soumettreFormulaire();
} else if (code.equals(FormulaireBarreValidation.CODE_BOUTON_ANNULER)) {
fenetre.hide();
}
}
};
return ecouteur;
}
public Collection<? extends String> verifier() {
ArrayList<String> messages = new ArrayList<String>();
// Vérification du Personnel
if (getData("acces").equals(true)) {
String personnelNumero = "";
int nbrePersonne = personnelGrilleMagazin.getCount();
for (int i = 0; i < nbrePersonne; i++) {
StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
if (personne.getNom().equals("") || personne.getPrenom().equals("")) {
personnelNumero += (i != 0 ? ", " : "")+(i+1);
}
}
if (!personnelNumero.equals("")) {
messages.add("Veuillez indiquez un prénom et un nom au personnel numéro : "+personnelNumero);
}
}
return messages;
}
 
@Override
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
rafraichirValeurListe(listeValeurs);
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
rafraichirInformation(info);
} else {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
}
public void rafraichirInformation(Information info) {
if (info.getType().equals("ajout_structure")) {
if (info.getDonnee(0) != null && info.getDonnee(0) instanceof String) {
String structureId = (String) info.getDonnee(0);
// Suite à la récupération de l'id de l'institution nouvellement ajoutée nous ajoutons le personnel
mediateur.ajouterStructureAPersonne(this, structureId, getPersonnelAjoute());
}
} else if (info.getType().equals("modif_structure_a_personne")) {
InfoLogger.display("Modification du Personnel", info.toString());
testerLancementRafraichirPersonnel();
} else if (info.getType().equals("suppression_structure_a_personne")) {
InfoLogger.display("Suppression du Personnel", info.toString());
testerLancementRafraichirPersonnel();
} else if (info.getType().equals("ajout_structure_a_personne")) {
InfoLogger.display("Ajout du Personnel", info.toString());
testerLancementRafraichirPersonnel();
} else if (info.getType().equals("liste_structure_a_personne")) {
if (info.getDonnee(0) != null) {
StructureAPersonneListe personnel = (StructureAPersonneListe) info.getDonnee(0);
peupler(personnel);
layout();
InfoLogger.display("Chargement du Personnel", "ok");
}
} else if (info.getType().equals("personne_modifiee")) {
if (info.getDonnee(0) != null) {
Personne personne = (Personne) info.getDonnee(0);
StructureAPersonne personneDansGrille = grillePersonnel.getStore().findModel("id_personne", personne.getId());
StructureAPersonne personneDansGrilleModif = new StructureAPersonne(personne, personneDansGrille.getFonction(), personneDansGrille.getIdRole(), personneDansGrille.getIdEtat());
int index = grillePersonnel.getStore().indexOf(personneDansGrille);
grillePersonnel.getStore().remove(personneDansGrille);
grillePersonnel.getStore().insert(personneDansGrilleModif, index);
personnelModifie.put(personne.getId()+"", personneDansGrilleModif);
}
} else if (info.getType().equals("personne_ajoutee")) {
if (info.getDonnee(0) != null) {
Personne personne = (Personne) info.getDonnee(0);
StructureAPersonne structAPersonne = new StructureAPersonne(personne,"",StructureAPersonne.ROLE_EQUIPE, "");
Structure structure = ((StructureForm) formulaire).identification;
structAPersonne.setIdStructure(structure.getId());
personnelAjoute.put(personne.getId(), structAPersonne);
ajouterMembreAGrillePersonnel(structAPersonne);
}
}
}
public void rafraichirValeurListe(ValeurListe listeValeurs) {
List<Valeur> liste = listeValeurs.toList();
if (listeValeurs.getId().equals(config.getListeId("statut"))) {
magazinLiStatut.removeAll();
magazinLiStatut.add(liste);
comboLiStatut.setStore(magazinLiStatut);
}
if (listeValeurs.getId().equals(config.getListeId("fonction"))) {
// FIXME : le store ne contient pas tout le temps les données, chose étrange.
// On stocke donc les données dans une variables de la classe pour recharger le store si besoin.
fonctionsListe = liste;
fonctionsMagazin.removeAll();
fonctionsMagazin.add(liste);
fonctionsCombo.setStore(fonctionsMagazin);
}
}
 
public EtatPersonnelStructure collecter() {
StructureForm formulaire = (StructureForm)formulaireCourant;
if (getData("acces").equals(true)) {
personnelGrilleMagazin.commitChanges();
int nbrePersonne = personnelGrilleMagazin.getCount();
for (int i = 0; i < nbrePersonne; i++) {
StructureAPersonne personne = personnelGrilleMagazin.getAt(i);
// Seules les lignes ajoutées ou modifiées sont prises en compte.
Record record = personnelGrilleMagazin.getRecord(personne);
if (personnelGrilleMagazin.getModifiedRecords().contains(record) == true
|| (personne.get("etat") != null && (personne.get("etat").equals(StructureAPersonne.ETAT_AJOUTE) || personne.get("etat").equals(StructureAPersonne.ETAT_MODIFIE)) )) {
// Gestion de l'id de la structure
if (mode.equals("MODIF")) {
personne.setIdStructure(getIdIdentification());
}
// Gestion de la fonction
String fonction = personne.get("fonction");
if (fonction != null && !fonction.equals("")) {
Valeur valeurRecherche = fonctionsCombo.getStore().findModel("nom", fonction);
if (valeurRecherche != null) {
personne.setFonction(valeurRecherche.getId());
} else {
personne.setFonction("AUTRE", fonction);
}
} else {
personne.setFonction("");
}
 
// Gestion du nom complet
String nomComplet = personne.getPrenom()+" "+personne.getNom();
personne.setNomComplet(nomComplet);
// Gestion de la notion de "contact"
personne.setContact(false);
if (personne.get("contact").equals(true)) {
personne.setContact(true);
}
// Gestion du statut
String statut = personne.get("statut");
if (statut != null && !statut.equals("")) {
Valeur valeurRecherche = comboLiStatut.getStore().findModel("nom", statut);
if (valeurRecherche != null) {
personne.setStatut(valeurRecherche.getId());
} else {
personne.setStatut("AUTRE", statut);
}
} else {
personne.setStatut("");
}
// Gestion du temps de travail
String personneTravail = "";
if(personne.get("travail") != null) {
personneTravail = personne.get("travail").toString();
}
personne.setBotaTravailHebdoTps(personneTravail);
// Gestion du téléphone
String telephoneFixe = personne.get("tel_fix");
personne.setTelephoneFixe(telephoneFixe);
// Gestion du fax
String fax = personne.get("tel_fax");
personne.setFax(fax);
// Gestion du courriel
String courriel = personne.get("courriel");
personne.setCourriel(courriel);
// Gestion de la spécialité
String specialite = personne.get("specialite");
personne.setSpecialite(specialite);
// On met à faux le décès
personne.setDeces(Personne.ETRE_VIVANT);
// Ajout de la personne dans la liste correspondant à son état (ajouté ou modifié)
if (personne.get("etat") != null && personne.get("etat").equals(StructureAPersonne.ETAT_AJOUTE)) { // Une personne ajoutée
personnelAjoute.put(""+i, personne);
} else {// Une personne modifiée
personnelModifie.put(personne.getId(), personne);
}
} else {
GWT.log("Personne non modifiées : "+personne.getPrenom()+" "+personne.getNom(), null);
}
}
}
EtatPersonnelStructure etatPersonnel = new EtatPersonnelStructure();
etatPersonnel.personnelAjoute = personnelAjoute;
etatPersonnel.personnelModifie = personnelModifie;
etatPersonnel.personnelSupprime = personnelSupprime;
// Remise à zéro des modification dans la liste du personnel
personnelModifie = new StructureAPersonneListe();
personnelAjoute = new StructureAPersonneListe();
personnelSupprime = new StructureAPersonneListe();
return etatPersonnel;
}
 
public void peupler(StructureAPersonneListe personnel) {
//this.personnel = personnel;
if (formulaireCourant.mode.equals(Formulaire.MODE_MODIFIER) && personnel != null) {
ArrayList<StructureAPersonne> personnes = new ArrayList<StructureAPersonne>();
for (Iterator<String> it = personnel.keySet().iterator(); it.hasNext();) {
String index = it.next();
// Gestion de la fonction
if (fonctionsMagazin != null && !((String) personnel.get(index).getFonction()).startsWith("AUTRE##")) {
if (fonctionsMagazin.findModel("id_valeur", personnel.get(index).getFonction()) != null) {
personnel.get(index).set("fonction", fonctionsMagazin.findModel("id_valeur", personnel.get(index).getFonction()).getNom());
}
} else {
personnel.get(index).set("fonction", personnel.get(index).getFonction().replaceFirst("AUTRE##", ""));
}
// Gestion de la notion de "contact"
personnel.get(index).set("contact", (personnel.get(index).getContact().equals("1") ? true : false));
// Gestion du statut
if (magazinLiStatut != null && ((String) personnel.get(index).getStatut()).matches("^[0-9]+$")) {
personnel.get(index).set("statut", magazinLiStatut.findModel("id_valeur", personnel.get(index).getStatut()).getNom());
} else {
personnel.get(index).set("statut", personnel.get(index).getStatut().replaceFirst("AUTRE##", ""));
}
// Gestion de la specialite
if (((String) personnel.get(index).getSpecialite()).matches("^[0-9]+$")) {
// Author : Cyprien
// TODO
// Ici faire un combobox ?
// ...
} else {
personnel.get(index).set("specialite", personnel.get(index).getSpecialite().replaceFirst("AUTRE##", ""));
}
// Gestion du temps de travail
String tps = personnel.get(index).getBotaTravailHebdoTps();
personnel.get(index).set("travail", (tps.matches("^[0-9]+$") ? Integer.parseInt(tps) : 0));
personnes.add(personnel.get(index));
}
personnelGrilleMagazin.removeAll();
personnelGrilleMagazin.add(personnes);
// Remise à zéro des modification dans la liste du personnel
personnelModifie = new StructureAPersonneListe();
personnelAjoute = new StructureAPersonneListe();
personnelSupprime = new StructureAPersonneListe();
// Nous vidons la variable personnel une fois qu'elle a remplie la grille
personnel = null;
}
}
public StructureAPersonneListe getPersonnelAjoute() {
return personnelAjoute;
}
private void ajouterMembreAGrillePersonnel(StructureAPersonne personnel) {
grillePersonnel.stopEditing();
personnelGrilleMagazin.insert(personnel, 0);
grillePersonnel.startEditing(0, 0);
}
public void testerLancementRafraichirPersonnel() {
decompteRafraichissementPersonnel--;
if (decompteRafraichissementPersonnel <= 0) {
// Nous rechargeons la liste du Personnel
rafraichirPersonnel();
}
}
private void rafraichirPersonnel() {
decompteRafraichissementPersonnel = 0;
if (formulaireCourant.mode.equals(Formulaire.MODE_MODIFIER)) {
initialiserGrillePersonnelEnModification();
} else if (formulaireCourant.mode.equals(Formulaire.MODE_AJOUTER)) {
initialiserGrillePersonnelEnAjout();
}
}
private void rafraichirPersonneExistante(String nom) {
mediateur.selectionnerPersonneParNomComplet(this, nom+"%", null);
}
public void incrementerDecompteRafraichissementPersonnel() {
decompteRafraichissementPersonnel++;
}
private void initialiserGrillePersonnelEnAjout() {
personnelGrilleMagazin.removeAll();
layout();
}
private String getIdIdentification() {
return ((StructureForm)formulaireCourant).getIdIdentification();
}
private void initialiserGrillePersonnelEnModification() {
mediateur.selectionnerStructureAPersonne(this, getIdIdentification(), StructureAPersonne.ROLE_EQUIPE, null);
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/structure/StructureFormConservation.java
New file
0,0 → 1,562
package org.tela_botanica.client.vues.structure;
 
import java.util.ArrayList;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.structure.StructureConservation;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireOnglet;
 
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.Component;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.form.Radio;
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class StructureFormConservation extends FormulaireOnglet implements Rafraichissable {
 
private StructureConservation conservation = null;
private CheckBoxGroup localStockageTrukCacGrpChp = null;
private LayoutContainer localStockageTrukCp = null;
private CheckBoxGroup meubleStockageTrukCacGrpChp = null;
private LayoutContainer meubleStockageTrukCp = null;
private CheckBoxGroup parametreStockageTrukCacGrpChp = null;
private LayoutContainer parametreStockageTrukCp = null;
private LayoutContainer collectionAutreTrukCp = null;
private CheckBoxGroup collectionAutreTrukCacGrpChp = null;
private CheckBoxGroup opRestauTrukCacGrpChp = null;
private LayoutContainer opRestauTrukCp = null;
private CheckBoxGroup autreMaterielTrukCacGrpChp = null;
private LayoutContainer autreMaterielTrukCp = null;
private RadioGroup formationMarkRGrpChp = null;
private RadioGroup interetFormationMarkRGrpChp = null;
private RadioGroup collectionCommuneMarkRGrpChp = null;
private RadioGroup accesControleMarkRGrpChp = null;
private RadioGroup restaurationMarkRGrpChp = null;
private RadioGroup traitementMarkRGrpChp = null;
private RadioGroup collectionAcquisitionMarkRGrpChp = null;
private RadioGroup echantillonAcquisitionMarkRGrpChp = null;
private LayoutContainer traitementTrukCp = null;
private CheckBoxGroup traitementTrukCacGrpChp = null;
private LayoutContainer poisonTraitementTrukCp = null;
private LayoutContainer insecteTraitementTrukCp = null;
private CheckBoxGroup insecteTraitementTrukCacGrpChp = null;
private CheckBoxGroup poisonTraitementTrukCacGrpChp = null;
private TextField<String> formationChp = null;
private RadioGroup materielConservationCeRGrpChp = null;
private LayoutContainer materielConservationCp = null;
private RadioGroup traitementAcquisitionMarkRGrpChp = null;
private LabelField traitementAcquisitionMarkLabel = null;
private TextField<String> localStockageAutreChp = null;
private TextField<String> meubleStockageAutreChp = null;
private TextField<String> parametreStockageAutreChp = null;
private TextField<String> collectionAutreAutreChp = null;
private TextField<String> opRestauAutreChp = null;
private TextField<String> autreMaterielAutreChp = null;
private TextField<String> traitementAutreChp = null;
private TextField<String> poisonTraitementAutreChp = null;
private TextField<String> insecteTraitementAutreChp = null;
private String ID = "conservation";
private Formulaire formulaireCourant = null;
private Mediateur mediateur = null;
private Sequenceur sequenceur = null;
public StructureFormConservation(Mediateur mediateur, Formulaire formulaireCourant, Sequenceur sequenceur) {
initialiserOnglet(formulaireCourant);
this.mediateur = mediateur;
this.formulaireCourant = formulaireCourant;
this.sequenceur = sequenceur;
setId(ID);
setText(Mediateur.i18nC.structureInfoConservation());
FormulaireOnglet.parametrer(this);
this.setLayout(Formulaire.creerFormLayout(650, LabelAlign.TOP));
Listener<ComponentEvent> ecouteurSelection = new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
peupler();
layout();
}
};
this.addListener(Events.Select, ecouteurSelection);
formationMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("formation_mark", "ouiNon");
formationMarkRGrpChp.setFieldLabel("Le personnel s'occupant des collections a-t-il suivi des formations en conservation ?");
this.add(formationMarkRGrpChp);
formationChp = new TextArea();
formationChp.hide();
formationChp.addListener(Events.Hide, new Listener<BaseEvent>() {
 
public void handleEvent(BaseEvent be) {
((TextArea) be.getSource()).setValue("");
}
});
formationChp.setFieldLabel("Si oui, lesquelles ?");
this.add(formationChp);
interetFormationMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("interet_formation_mark", "ouiNon");
interetFormationMarkRGrpChp.setFieldLabel("Seriez vous intéressé par une formation à la conservation et à la restauration d'herbier ?");
interetFormationMarkRGrpChp.setHeight(35);
this.add(interetFormationMarkRGrpChp);
localStockageTrukCacGrpChp = new CheckBoxGroup();
localStockageTrukCacGrpChp.setFieldLabel("Avez vous des locaux spécifiques de stockage des collections botaniques ?");
localStockageTrukCp = Formulaire.creerChoixMultipleCp();
this.add(localStockageTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "localStockage", sequenceur);
meubleStockageTrukCp = Formulaire.creerChoixMultipleCp();
meubleStockageTrukCacGrpChp = new CheckBoxGroup();
meubleStockageTrukCacGrpChp.setFieldLabel("Avez vous des meubles spécifiques au stockage des collections botaniques ?");
this.add(meubleStockageTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "meubleStockage", sequenceur);
parametreStockageTrukCp = Formulaire.creerChoixMultipleCp();
parametreStockageTrukCacGrpChp = new CheckBoxGroup();
parametreStockageTrukCacGrpChp.setFieldLabel("Quels paramètres maîtrisez vous ?");
this.add(parametreStockageTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "parametreStockage", sequenceur);
collectionCommuneMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("collection_commune_mark", "ouiNon");
collectionCommuneMarkRGrpChp.setFieldLabel("Les collections botaniques sont-elles conservées avec d'autres collections dans les mêmes locaux (problème de conservation en commun) ?");
this.add(collectionCommuneMarkRGrpChp);
collectionAutreTrukCp = Formulaire.creerChoixMultipleCp();
collectionAutreTrukCacGrpChp = new CheckBoxGroup();
collectionAutreTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
collectionAutreTrukCp.hide();
this.add(collectionAutreTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "autreCollection", sequenceur);
accesControleMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("mark_acces_controle", "ouiNon");
accesControleMarkRGrpChp.setFieldLabel("L'accès à vos collections botanique est-il contrôlé (ex. : manipulation réservées à des personnes compétentes) ?");
this.add(accesControleMarkRGrpChp);
restaurationMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("restauration_mark", "ouiNon");
restaurationMarkRGrpChp.setFieldLabel("Effectuez vous des opérations de restauration ou de remise en état de vos collections botaniques ?");
this.add(restaurationMarkRGrpChp);
opRestauTrukCp = Formulaire.creerChoixMultipleCp();
opRestauTrukCacGrpChp = new CheckBoxGroup();
opRestauTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
opRestauTrukCp.hide();
this.add(opRestauTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "opRestau", sequenceur);
// Création d'un ContentPanel vide et du groupe de bouton radio
// Le groupe de bouton radio recevra les boutons au moment de la réception des données (rafraichir()) et ser à ce moment là ajouter au ContenetPanel
materielConservationCp = Formulaire.creerChoixMultipleCp();
this.add(materielConservationCp);
materielConservationCeRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("materiel_conservation_ce", "onep");
materielConservationCeRGrpChp.setFieldLabel("Utilisez vous du matériel de conservation ?");
materielConservationCeRGrpChp.setToolTip(new ToolTipConfig("Matériel de conservation", "matériel spécialisé pour la conservation des archives ou du patrimoine fragile. Ce matériel possède des propriétés mécaniques et chimiques qui font qu'il résiste dans le temps et que sa dégradation n'entraîne pas de dommages sur le matériel qu'il aide à conserver. Exemples : papier neutre, papier gommé, etc..."));
mediateur.obtenirListeValeurEtRafraichir(this, "onep", sequenceur);
autreMaterielTrukCp = Formulaire.creerChoixMultipleCp();
autreMaterielTrukCacGrpChp = new CheckBoxGroup();
autreMaterielTrukCacGrpChp.setFieldLabel("Si non, qu'utilisez vous comme matériel ?");
autreMaterielTrukCp.hide();
this.add(autreMaterielTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "autreMateriel", sequenceur);
traitementMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("traitement_mark", "ouiNon");
traitementMarkRGrpChp.setFieldLabel("Réalisez vous actuellement des traitements globaux contre les insectes ?");
this.add(traitementMarkRGrpChp);
traitementTrukCp = Formulaire.creerChoixMultipleCp();
traitementTrukCp.hide();
traitementTrukCacGrpChp = new CheckBoxGroup();
traitementTrukCacGrpChp.setFieldLabel("Si oui, lesquels ?");
this.add(traitementTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "insecteTraitement", sequenceur);
collectionAcquisitionMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("collection_acquisition_mark", "ouiNon");
collectionAcquisitionMarkRGrpChp.setFieldLabel("Actuellement, vos collections botaniques s'accroissent-elles de nouvelles acquisitions ?");
this.add(collectionAcquisitionMarkRGrpChp);
echantillonAcquisitionMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("echantillon_acquisition_mark", "ouiNon");
echantillonAcquisitionMarkRGrpChp.setFieldLabel("Actuellement, mettez vous en herbier de nouveaux échantillons ?");
this.add(echantillonAcquisitionMarkRGrpChp);
 
traitementAcquisitionMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("traitement_acquisition_mark", "ouiNon");
traitementAcquisitionMarkRGrpChp.hide();
traitementAcquisitionMarkRGrpChp.setFieldLabel("Si oui, faites-vous un traitement contre les insectes avant l'intégration dans vos collections ?");
this.add(traitementAcquisitionMarkRGrpChp);
traitementAcquisitionMarkLabel = new LabelField();
traitementAcquisitionMarkLabel.hide();
traitementAcquisitionMarkLabel.setFieldLabel("Si oui, lesquels ?");
this.add(traitementAcquisitionMarkLabel);
poisonTraitementTrukCp = Formulaire.creerChoixMultipleCp();
poisonTraitementTrukCp.hide();
poisonTraitementTrukCacGrpChp = new CheckBoxGroup();
poisonTraitementTrukCacGrpChp.setFieldLabel("Empoisonnement");
poisonTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");
poisonTraitementTrukCacGrpChp.setLabelSeparator("");
this.add(poisonTraitementTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "poisonTraitement", sequenceur);
insecteTraitementTrukCp = Formulaire.creerChoixMultipleCp();
insecteTraitementTrukCp.hide();
insecteTraitementTrukCacGrpChp = new CheckBoxGroup();
insecteTraitementTrukCacGrpChp.setLabelStyle("font-weight:normal;text-decoration:underline;");
insecteTraitementTrukCacGrpChp.setLabelSeparator("");
insecteTraitementTrukCacGrpChp.setFieldLabel("Désinsectisation");
this.add(insecteTraitementTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "insecteTraitement", sequenceur);
this.add(new Html("<br />"));
}
@Override
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
rafraichirValeurListe(listeValeurs);
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
rafraichirInformation(info);
}
}
public void rafraichirInformation(Information info) {
if (info.getDonnee(1) != null) {
conservation = (StructureConservation) info.getDonnee(1);
peupler();
}
}
public void rafraichirValeurListe(ValeurListe listeValeurs) {
List<Valeur> liste = listeValeurs.toList();
if (listeValeurs.getId().equals(config.getListeId("localStockage"))) {
localStockageAutreChp = new TextField<String>();
Formulaire.creerChoixMultipleCac(localStockageTrukCp, localStockageTrukCacGrpChp, listeValeurs, localStockageAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("meubleStockage"))) {
meubleStockageAutreChp = new TextField<String>();
Formulaire.creerChoixMultipleCac(meubleStockageTrukCp, meubleStockageTrukCacGrpChp, listeValeurs, meubleStockageAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("parametreStockage"))) {
parametreStockageAutreChp = new TextField<String>();
Formulaire.creerChoixMultipleCac(parametreStockageTrukCp, parametreStockageTrukCacGrpChp, listeValeurs, parametreStockageAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("autreCollection"))) {
if (collectionAutreTrukCp != null && collectionAutreTrukCp.getItemByItemId("collectionAutreTrukCacGrpChp") == null) {
collectionAutreTrukCacGrpChp.setId("collectionAutreTrukCacGrpChp");
collectionAutreAutreChp = new TextField<String>();
Formulaire.creerChoixMultipleCac(collectionAutreTrukCp, collectionAutreTrukCacGrpChp, listeValeurs, collectionAutreAutreChp);
}
}
if (listeValeurs.getId().equals(config.getListeId("opRestau"))) {
opRestauAutreChp = new TextField<String>();
Formulaire.creerChoixMultipleCac(opRestauTrukCp, opRestauTrukCacGrpChp, listeValeurs, opRestauAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("onep"))) {
formulaireCourant.creerChoixUniqueBoutonRadio(materielConservationCeRGrpChp, Formulaire.trierListeOuiNonEnPartie(listeValeurs));
materielConservationCp.add(materielConservationCeRGrpChp);
materielConservationCp.layout();
}
if (listeValeurs.getId().equals(config.getListeId("autreMateriel"))) {
autreMaterielAutreChp = new TextField<String>();
Formulaire.creerChoixMultipleCac(autreMaterielTrukCp, autreMaterielTrukCacGrpChp, listeValeurs, autreMaterielAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("poisonTraitement"))) {
poisonTraitementAutreChp = new TextField<String>();
Formulaire.creerChoixMultipleCac(poisonTraitementTrukCp, poisonTraitementTrukCacGrpChp, listeValeurs, poisonTraitementAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("insecteTraitement"))) {
if (traitementTrukCp != null && traitementTrukCp.getItemByItemId("traitementTrukCacGrpChp") == null) {
traitementTrukCacGrpChp.setId("traitementTrukCacGrpChp");
traitementAutreChp = new TextField<String>();
Formulaire.creerChoixMultipleCac(traitementTrukCp, traitementTrukCacGrpChp, listeValeurs, traitementAutreChp);
}
if (insecteTraitementTrukCp != null && insecteTraitementTrukCp.getItemByItemId("insecteTraitementTrukCacGrpChp") == null) {
insecteTraitementTrukCacGrpChp.setId("insecteTraitementTrukCacGrpChp");
insecteTraitementAutreChp = new TextField<String>();
Formulaire.creerChoixMultipleCac(insecteTraitementTrukCp, insecteTraitementTrukCacGrpChp, listeValeurs, insecteTraitementAutreChp);
}
}
}
private void initialiserConservation() {
conservation = ((StructureForm)formulaireCourant).conservation;
}
public StructureConservation collecter() {
if(conservation == null) {
initialiserConservation();
}
StructureConservation conservationARetourner = null;
if (this.getData("acces").equals(true)) {
// Création de l'objet
StructureConservation conservationCollectee = (StructureConservation) conservation.cloner(new StructureConservation());
// FORMATION
conservationCollectee.setFormation(formationMarkRGrpChp.getValue() == null ?
null :
formationMarkRGrpChp.getValue().getValueAttribute());
 
// FORMATION INFO
conservationCollectee.setFormationInfo(formationChp.getValue());
// FORMATION INTERET
conservationCollectee.setFormationInteret(interetFormationMarkRGrpChp.getValue() == null ?
null :
interetFormationMarkRGrpChp.getValue().getValueAttribute());
// STOCKAGE LOCAL
conservationCollectee.setStockageLocal(creerChaineDenormalisee(localStockageTrukCacGrpChp.getValues()));
conservationCollectee.setStockageLocal("AUTRE", localStockageAutreChp.getValue());
// STOCKAGE MEUBLE
conservationCollectee.setStockageMeuble(creerChaineDenormalisee(meubleStockageTrukCacGrpChp.getValues()));
conservationCollectee.setStockageMeuble("AUTRE", meubleStockageAutreChp.getValue());
// STOCKAGE PAREMETRE
conservationCollectee.setStockageParametre(creerChaineDenormalisee(parametreStockageTrukCacGrpChp.getValues()));
conservationCollectee.setStockageParametre("AUTRE", parametreStockageAutreChp.getValue());
// COLLECTION COMMUNE
if (collectionCommuneMarkRGrpChp.getValue() != null) {
conservationCollectee.setCollectionCommune(collectionCommuneMarkRGrpChp.getValue().getValueAttribute());
}
// COLLECTION AUTRE
conservationCollectee.setCollectionAutre(creerChaineDenormalisee(collectionAutreTrukCacGrpChp.getValues()));
conservationCollectee.setCollectionAutre("AUTRE", collectionAutreAutreChp.getValue());
// ACCÈS CONTROLÉ
if (accesControleMarkRGrpChp.getValue() != null) {
conservationCollectee.setAccesControle(accesControleMarkRGrpChp.getValue().getValueAttribute());
}
// RESTAURATION
if (restaurationMarkRGrpChp.getValue() != null) {
conservationCollectee.setRestauration(restaurationMarkRGrpChp.getValue().getValueAttribute());
}
// RESTAURATION OPÉRATION
conservationCollectee.setRestaurationOperation(creerChaineDenormalisee(opRestauTrukCacGrpChp.getValues()));
conservationCollectee.setRestaurationOperation("AUTRE", opRestauAutreChp.getValue());
// MATERIEL CONSERVATION
if (materielConservationCeRGrpChp.getValue() != null) {
conservationCollectee.setMaterielConservation(materielConservationCeRGrpChp.getValue().getValueAttribute());
 
// MATERIEL AUTRE
conservationCollectee.setMaterielAutre(creerChaineDenormalisee(autreMaterielTrukCacGrpChp.getValues()));
conservationCollectee.setMaterielAutre("AUTRE", autreMaterielAutreChp.getValue());
}
// TRAITEMENT
if (traitementMarkRGrpChp.getValue() != null) {
conservationCollectee.setTraitement(traitementMarkRGrpChp.getValue().getValueAttribute());
}
// TRAIEMENTS
conservationCollectee.setTraitements(creerChaineDenormalisee(traitementTrukCacGrpChp.getValues()));
conservationCollectee.setTraitements("AUTRE", traitementAutreChp.getValue());
// ACQUISITION COLLECTION
if (collectionAcquisitionMarkRGrpChp.getValue() != null) {
conservationCollectee.setAcquisitionCollection(collectionAcquisitionMarkRGrpChp.getValue().getValueAttribute());
}
// ACQUISITION ECHANTILLON
if (echantillonAcquisitionMarkRGrpChp.getValue() != null) {
conservationCollectee.setAcquisitionEchantillon(echantillonAcquisitionMarkRGrpChp.getValue().getValueAttribute());
}
// ACQUISITION TRAITEMENT
if (traitementAcquisitionMarkRGrpChp.getValue() != null) {
conservationCollectee.setAcquisitionTraitement(traitementAcquisitionMarkRGrpChp.getValue().getValueAttribute());
}
// ACQUISITION TRAITEMENT POISON
conservationCollectee.setAcquisitionTraitementPoison(creerChaineDenormalisee(poisonTraitementTrukCacGrpChp.getValues()));
conservationCollectee.setAcquisitionTraitementPoison("AUTRE", poisonTraitementAutreChp.getValue());
// ACQUISITION TRAITEMENT INSECTE
conservationCollectee.setAcquisitionTraitementInsecte(creerChaineDenormalisee(insecteTraitementTrukCacGrpChp.getValues()));
conservationCollectee.setAcquisitionTraitementInsecte("AUTRE", insecteTraitementAutreChp.getValue());
// Retour de l'objet
if (!conservationCollectee.comparer(conservation)) {
GWT.log("Collecte différent de Retour", null);
conservationARetourner = conservation = conservationCollectee;
}
}
return conservationARetourner;
}
private String creerChaineDenormalisee(List<CheckBox> liste) {
return ((StructureForm)formulaireCourant).creerChaineDenormalisee(liste);
}
private void peuplerCasesACocher(String donnees, CheckBoxGroup groupeCac, TextField<String> champAutre) {
((StructureForm)formulaireCourant).peuplerCasesACocher(donnees, groupeCac, champAutre);
}
private void peuplerBoutonsRadio(String valeur, RadioGroup groupeBr) {
((StructureForm)formulaireCourant).peuplerBoutonsRadio(valeur, groupeBr);
}
public void afficherChampSupplementaires(Radio radioBtn) {
//GWT.log("Nom btn : "+radioBtn.getName()+" - Nom group : "+radioBtn.getGroup().getName(), null);
// Valeur du bouton radio déclenchant l'affichage des composants cachés
String valeurPourAfficher = "oui";
// Construction de la liste des composants à afficher/cacher
String radioGroupeNom = radioBtn.getGroup().getName();
ArrayList<Object> composants = new ArrayList<Object>();
if (radioGroupeNom.equals("formation_mark_grp")) {
composants.add(formationChp);
} else if (radioGroupeNom.equals("collection_commune_mark_grp")) {
composants.add(collectionAutreTrukCp);
} else if (radioGroupeNom.equals("restauration_mark_grp")) {
composants.add(opRestauTrukCp);
} else if (radioGroupeNom.equals("traitement_mark_grp")) {
composants.add(traitementTrukCp);
} else if (radioGroupeNom.equals("echantillon_acquisition_mark_grp")) {
composants.add(traitementAcquisitionMarkRGrpChp);
} else if (radioGroupeNom.equals("traitement_acquisition_mark_grp")) {
composants.add(traitementAcquisitionMarkLabel);
composants.add(poisonTraitementTrukCp);
composants.add(insecteTraitementTrukCp);
} else if (radioGroupeNom.equals("materiel_conservation_ce_grp")) {
composants.add(autreMaterielTrukCp);
valeurPourAfficher = "non";
}
// Nous affichons/cachons les composant de la liste
final int nbreComposants = composants.size();
//GWT.log("Id : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax, null);
//Window.alert("Radio grp nom : "+radioGroupeNom+" - Id btn : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax);
for (int i = 0; i < nbreComposants; i++) {
// En fonction du type de bouton cliquer, on affiche ou cache les champs
String type = radioBtn.getBoxLabel().toLowerCase();
//GWT.log(type, null);
if (radioBtn.getValue() == true) {
if (type.equals(valeurPourAfficher)) {
((Component) composants.get(i)).show();
} else {
((Component) composants.get(i)).hide();
}
}
// Si on a à faire à un ContentPanel, on l'actualise pour déclencher l'affichage
if (composants.get(i) instanceof ContentPanel) {
((ContentPanel) composants.get(i)).layout();
}
}
}
public void peupler() {
if(conservation == null) {
initialiserConservation();
}
if (formulaireCourant.mode.equals(Formulaire.MODE_AJOUTER)) {
// Indique que l'onglet a pu être modifié pour la méthode collecter...
this.setData("acces", true);
// Initialisation de l'objet Structure
conservation = new StructureConservation();
}
if (formulaireCourant.mode.equals(Formulaire.MODE_MODIFIER) && conservation != null) {
// FORMATION
// Bouton oui, à toujours l'index 0, mais dans le modèle, value == 0
// donc ^ 1, car 0 ^ 1 = 1 et 1 ^ 1 = 0
if(conservation.getFormation() != null) {
((Radio) formationMarkRGrpChp.get(conservation.getFormation() ^ 1)).setValue(true);
}
 
// FORMATION INFO
formationChp.setValue(conservation.getFormationInfo());
// FORMATION INTERET
if(conservation.getFormationInteret() != null) {
((Radio) interetFormationMarkRGrpChp.get(conservation.getFormationInteret() ^ 1)).setValue(true);
}
// STOCKAGE LOCAL
peuplerCasesACocher(conservation.getStockageLocal(), localStockageTrukCacGrpChp,localStockageAutreChp);
// STOCKAGE MEUBLE
peuplerCasesACocher(conservation.getStockageMeuble(), meubleStockageTrukCacGrpChp, meubleStockageAutreChp);
// STOCKAGE PAREMETRE
peuplerCasesACocher(conservation.getStockageParametre(), parametreStockageTrukCacGrpChp, parametreStockageAutreChp);
// COLLECTION COMMUNE
if(conservation.getCollectionCommune() != null) {
((Radio) collectionCommuneMarkRGrpChp.get(conservation.getCollectionCommune() ^ 1)).setValue(true);
}
// COLLECTION AUTRE
peuplerCasesACocher(conservation.getCollectionAutre(), collectionAutreTrukCacGrpChp, collectionAutreAutreChp);
// ACCÈS CONTROLÉ
if(conservation.getAccesControle() != null) {
((Radio) accesControleMarkRGrpChp.get(conservation.getAccesControle() ^ 1)).setValue(true);
}
// RESTAURATION
if(conservation.getRestauration() != null) {
((Radio) restaurationMarkRGrpChp.get(conservation.getRestauration() ^ 1)).setValue(true);
}
// RESTAURATION OPÉRATION
peuplerCasesACocher(conservation.getRestaurationOperation(), opRestauTrukCacGrpChp, opRestauAutreChp);
// MATERIEL CONSERVATION
peuplerBoutonsRadio(conservation.getMaterielConservation(), materielConservationCeRGrpChp);
// MATERIEL AUTRE
peuplerCasesACocher(conservation.getMaterielAutre(), autreMaterielTrukCacGrpChp, autreMaterielAutreChp);
// TRAITEMENT
if(conservation.getTraitement() != null) {
((Radio) traitementMarkRGrpChp.get(conservation.getTraitement() ^ 1)).setValue(true);
}
// TRAITEMENTS
peuplerCasesACocher(conservation.getTraitements(), traitementTrukCacGrpChp, traitementAutreChp);
// ACQUISITION COLLECTION
if(conservation.getAcquisitionCollection() != null) {
((Radio) collectionAcquisitionMarkRGrpChp.get(conservation.getAcquisitionCollection() ^ 1)).setValue(true);
}
// ACQUISITION ECHANTILLON
if(conservation.getAcquisitionEchantillon() != null) {
((Radio) echantillonAcquisitionMarkRGrpChp.get(conservation.getAcquisitionEchantillon() ^ 1)).setValue(true);
}
// ACQUISITION TRAITEMENT
((Radio) traitementAcquisitionMarkRGrpChp.get((conservation.getAcquisitionTraitement().equals("1") ? 0 : 1))).setValue(true);
// ACQUISITION TRAITEMENT POISON
peuplerCasesACocher(conservation.getAcquisitionTraitementPoison(), poisonTraitementTrukCacGrpChp, poisonTraitementAutreChp);
// ACQUISITION TRAITEMENT INSECTE
peuplerCasesACocher(conservation.getAcquisitionTraitementInsecte(), insecteTraitementTrukCacGrpChp, insecteTraitementAutreChp);
// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
this.setData("acces", true);
}
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/structure/StructureFormValorisation.java
New file
0,0 → 1,401
package org.tela_botanica.client.vues.structure;
 
import java.util.ArrayList;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.structure.StructureValorisation;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FormulaireOnglet;
 
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.Component;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
import com.extjs.gxt.ui.client.widget.form.Radio;
import com.extjs.gxt.ui.client.widget.form.RadioGroup;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.layout.FormData;
 
public class StructureFormValorisation extends FormulaireOnglet implements Rafraichissable {
 
private StructureValorisation valorisation = null;
private LayoutContainer autreCollectionTrukCp = null;
private TextField<String> typeRechercheAutreChp = null;
private CheckBoxGroup autreCollectionTrukCacGrpChp = null;
private LayoutContainer provenanceRechercheTrukCp = null;
private CheckBoxGroup provenanceRechercheTrukCacGrpChp = null;
private CheckBoxGroup typeRechercheTrukCacGrpChp = null;
private LayoutContainer typeRechercheTrukCp = null;
private TextField<String> futureActionChp = null;
private TextField<String> sansMotifAccesChp = null;
private TextField<String> avecMotifAccesChp = null;
private TextField<String> autreCollectionAutreChp = null;
private TextField<String> actionAutreChp = null;
private TextField<String> provenanceRechercheAutreChp = null;
private RadioGroup actionMarkRGrpChp = null;
private LayoutContainer actionTrukCp = null;
private CheckBoxGroup actionTrukCacGrpChp = null;
private RadioGroup futureActionMarkRGrpChp = null;
private RadioGroup rechercheMarkRGrpChp = null;
private RadioGroup sansMotifAccesMarkRGrpChp = null;
private RadioGroup avecMotifAccesMarkRGrpChp = null;
private TextField<String> publicationChp = null;
private String ID = "valorisation";
private Mediateur mediateur = null;
private Formulaire formulaireCourant = null;
private Sequenceur sequenceur = null;
public StructureFormValorisation(Mediateur mediateur, Formulaire formulaireCourant, Sequenceur sequenceur) {
this.mediateur = mediateur;
this.formulaireCourant = formulaireCourant;
this.sequenceur = sequenceur;
initialiserOnglet(formulaireCourant);
setId(ID);
setText(Mediateur.i18nC.structureInfoValorisation());
FormulaireOnglet.parametrer(this);
this.setLayout(Formulaire.creerFormLayout(650, LabelAlign.TOP));
Listener<ComponentEvent> ecouteurSelection = new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
peupler();
layout();
}
};
this.addListener(Events.Select, ecouteurSelection);
actionMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("action_mark", "ouiNon");
actionMarkRGrpChp.setFieldLabel("Avez-vous réalisé des actions de valorisation de vos collections botaniques ou avez-vous été sollicités pour la valorisation de ces collections ?");
this.add(actionMarkRGrpChp);
actionTrukCp = Formulaire.creerChoixMultipleCp();
actionTrukCp.hide();
actionTrukCacGrpChp = new CheckBoxGroup();
actionTrukCacGrpChp.setFieldLabel("Si oui, lesquelles ?");
this.add(actionTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "actionValorisation", sequenceur);
mediateur.obtenirListeValeurEtRafraichir(this, "statut", sequenceur);
publicationChp = new TextArea();
publicationChp.setFieldLabel("Quelques titres des ouvrages, articles scientifiques, ...");
this.add(publicationChp, new FormData(550, 0));
autreCollectionTrukCp = Formulaire.creerChoixMultipleCp();
autreCollectionTrukCacGrpChp = new CheckBoxGroup();
autreCollectionTrukCacGrpChp.setFieldLabel("L'organisme dispose-t-il d'autres collections (permettant une valorisation pluridisciplinaire) ?");
this.add(autreCollectionTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "autreCollection", sequenceur);
futureActionMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("future_action_mark", "ouiNon");
futureActionMarkRGrpChp.setFieldLabel("Envisagez vous des actions de valorisation dans le cadre de votre politique culturelle ?");
this.add(futureActionMarkRGrpChp);
futureActionChp = new TextArea();
futureActionChp.setFieldLabel("Si oui, lesquelles ?");
futureActionChp.hide();
futureActionChp.addListener(Events.Hide, new Listener<BaseEvent>() {
 
public void handleEvent(BaseEvent be) {
((TextArea) be.getSource()).setValue("");
}
});
this.add(futureActionChp, new FormData(550, 0));
rechercheMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("recherche_mark", "ouiNon");
rechercheMarkRGrpChp.setFieldLabel("Vos collections botaniques sont-elles utilisées pour des recherches scientifiques ?");
this.add(rechercheMarkRGrpChp);
provenanceRechercheTrukCp = Formulaire.creerChoixMultipleCp();
provenanceRechercheTrukCp.hide();
provenanceRechercheTrukCacGrpChp = new CheckBoxGroup();
provenanceRechercheTrukCacGrpChp.setFieldLabel("Si oui, par des chercheurs (professionnels ou amateurs) de quelle provenance ?");
this.add(provenanceRechercheTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "continentEtFr", sequenceur);
typeRechercheTrukCp = Formulaire.creerChoixMultipleCp();
typeRechercheTrukCp.hide();
typeRechercheTrukCacGrpChp = new CheckBoxGroup();
typeRechercheTrukCacGrpChp.setFieldLabel("Et pour quelles recherches ?");
this.add(typeRechercheTrukCp);
mediateur.obtenirListeValeurEtRafraichir(this, "typeRecherche", sequenceur);
sansMotifAccesMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("sans_motif_acces_mark", "ouiNon");
sansMotifAccesMarkRGrpChp.setFieldLabel("Peut-on consulter vos collections botaniques sans motif de recherches scientifiques ?");
this.add(sansMotifAccesMarkRGrpChp);
this.add(sansMotifAccesChp = new TextArea(), new FormData(550, 0));
sansMotifAccesChp.hide();
sansMotifAccesChp.addListener(Events.Hide, new Listener<BaseEvent>() {
 
public void handleEvent(BaseEvent be) {
((TextArea) be.getSource()).setValue("");
}
});
sansMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les consulter ?");
avecMotifAccesMarkRGrpChp = formulaireCourant.creerChoixUniqueRadioGroupe("avec_motif_acces_mark", "ouiNon");
avecMotifAccesMarkRGrpChp.setFieldLabel("Peut-on visiter vos collections botaniques avec des objectifs de recherches scientifiques ?");
this.add(avecMotifAccesMarkRGrpChp);
this.add(avecMotifAccesChp = new TextArea(), new FormData(550, 0));
avecMotifAccesChp.hide();
avecMotifAccesChp.addListener(Events.Hide, new Listener<BaseEvent>() {
 
public void handleEvent(BaseEvent be) {
((TextArea) be.getSource()).setValue("");
}
});
avecMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les visiter ?");
}
public void peupler() {
if(valorisation == null) {
initialiserValorisation();
}
if (formulaireCourant.mode.equals(Formulaire.MODE_AJOUTER)) {
// Indique que l'onglet a pu être modifié pour la méthode collecter...
setData("acces", true);
// Initialisation de l'objet Structure
valorisation = new StructureValorisation();
}
if (formulaireCourant.mode.equals(Formulaire.MODE_MODIFIER) && valorisation != null) {
// ACTION :
//TODO : check below:
if(valorisation.getAction() != null) {
((Radio) actionMarkRGrpChp.get(valorisation.getAction() ^ 1)).setValue(true);
}
// ACTION INFO
peuplerCasesACocher(valorisation.getActionInfo(), actionTrukCacGrpChp, actionAutreChp);
// PUBLICATION
publicationChp.setValue(valorisation.getPublication());
// COLLECTION AUTRE
peuplerCasesACocher(valorisation.getCollectionAutre(), autreCollectionTrukCacGrpChp, autreCollectionAutreChp);
// ACTION FUTURE
if(valorisation.getActionFuture() != null) {
((Radio) futureActionMarkRGrpChp.get(valorisation.getActionFuture() ^ 1)).setValue(true);
}
// ACTION FUTURE INFO
futureActionChp.setValue(valorisation.getActionFutureInfo());
// RECHERCHE
if(valorisation.getRecherche() != null) {
((Radio) rechercheMarkRGrpChp.get(valorisation.getRecherche() ^ 1)).setValue(true);
}
// RECHERCHE PROVENANCE
peuplerCasesACocher(valorisation.getRechercheProvenance(), provenanceRechercheTrukCacGrpChp, provenanceRechercheAutreChp);
// RECHERCHE TYPE
peuplerCasesACocher(valorisation.getRechercheType(), typeRechercheTrukCacGrpChp, typeRechercheAutreChp);
// ACCÈS SANS MOTIF
if(valorisation.getAccesSansMotif() != null) {
((Radio) sansMotifAccesMarkRGrpChp.get(valorisation.getAccesSansMotif() ^ 1)).setValue(true);
}
// ACCÈS SANS MOTIF INFO
sansMotifAccesChp.setValue(valorisation.getAccesSansMotifInfo());
// VISITE AVEC MOTIF
if(valorisation.getVisiteAvecMotif() != null) {
((Radio) avecMotifAccesMarkRGrpChp.get(valorisation.getVisiteAvecMotif() ^ 1)).setValue(true);
}
// VISITE AVEC MOTIF INFO
avecMotifAccesChp.setValue(valorisation.getVisiteAvecMotifInfo());
// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter...
this.setData("acces", true);
}
}
private String creerChaineDenormalisee(List<CheckBox> liste) {
return ((StructureForm)formulaireCourant).creerChaineDenormalisee(liste);
}
private void peuplerCasesACocher(String donnees, CheckBoxGroup groupeCac, TextField<String> champAutre) {
((StructureForm)formulaireCourant).peuplerCasesACocher(donnees, groupeCac, champAutre);
}
private void initialiserValorisation() {
valorisation = ((StructureForm)formulaireCourant).valorisation;
}
 
public StructureValorisation collecter() {
if(valorisation == null) {
initialiserValorisation();
}
StructureValorisation valorisationARetourner = null;
if (getData("acces").equals(true)) {
// Création de l'objet
StructureValorisation valorisationCollectee = (StructureValorisation) valorisation.cloner(new StructureValorisation());
// ACTION
if (actionMarkRGrpChp.getValue() != null) {
valorisationCollectee.setAction(actionMarkRGrpChp.getValue().getValueAttribute());
}
// ACTION INFO
valorisationCollectee.setActionInfo(creerChaineDenormalisee(actionTrukCacGrpChp.getValues()));
valorisationCollectee.setActionInfo("AUTRE", actionAutreChp.getValue());
// PUBLICATION
valorisationCollectee.setPublication(publicationChp.getValue());
// COLLECTION AUTRE
valorisationCollectee.setCollectionAutre(creerChaineDenormalisee(autreCollectionTrukCacGrpChp.getValues()));
valorisationCollectee.setCollectionAutre("AUTRE", autreCollectionAutreChp.getValue());
// ACTION FUTURE
if (futureActionMarkRGrpChp.getValue() != null) {
valorisationCollectee.setActionFuture(futureActionMarkRGrpChp.getValue().getValueAttribute());
}
// ACTION FUTURE INFO
valorisationCollectee.setActionFutureInfo(futureActionChp.getValue());
// RECHERCHE
if (rechercheMarkRGrpChp.getValue() != null) {
valorisationCollectee.setRecherche(rechercheMarkRGrpChp.getValue().getValueAttribute());
 
// RECHERCHE PROVENANCE
valorisationCollectee.setRechercheProvenance(creerChaineDenormalisee(provenanceRechercheTrukCacGrpChp.getValues()));
valorisationCollectee.setRechercheProvenance("AUTRE", provenanceRechercheAutreChp.getValue());
// RECHERCHE TYPE
valorisationCollectee.setRechercheType(creerChaineDenormalisee(typeRechercheTrukCacGrpChp.getValues()));
valorisationCollectee.setRechercheType("AUTRE", typeRechercheAutreChp.getValue());
}
// ACCÈS SANS MOTIF
if (sansMotifAccesMarkRGrpChp.getValue() != null) {
valorisationCollectee.setAccesSansMotif(sansMotifAccesMarkRGrpChp.getValue().getValueAttribute());
}
// ACCÈS SANS MOTIF INFO
valorisationCollectee.setAccesSansMotifInfo(sansMotifAccesChp.getValue());
// VISITE AVEC MOTIF
if (avecMotifAccesMarkRGrpChp.getValue() != null) {
valorisationCollectee.setVisiteAvecMotif(avecMotifAccesMarkRGrpChp.getValue().getValueAttribute());
}
// VISITE AVEC MOTIF INFO
valorisationCollectee.setVisiteAvecMotifInfo(avecMotifAccesChp.getValue());
// Retour de l'objet
if (!valorisationCollectee.comparer(valorisation)) {
valorisationARetourner = valorisation = valorisationCollectee;
}
}
return valorisationARetourner;
}
 
@Override
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
rafraichirValeurListe(listeValeurs);
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
rafraichirInformation(info);
}
}
public void rafraichirInformation(Information info) {
if (info.getDonnee(2) != null) {
valorisation = (StructureValorisation) info.getDonnee(2);
if (valorisation != null) {
peupler();
}
}
}
private void rafraichirValeurListe(ValeurListe listeValeurs) {
List<Valeur> liste = listeValeurs.toList();
if (listeValeurs.getId().equals(config.getListeId("autreCollection"))) {
if (autreCollectionTrukCp != null && autreCollectionTrukCp.getItemByItemId("autreCollectionTrukCacGrpChp") == null) {
autreCollectionTrukCacGrpChp.setId("autreCollectionTrukCacGrpChp");
autreCollectionAutreChp = new TextField<String>();
Formulaire.creerChoixMultipleCac(autreCollectionTrukCp, autreCollectionTrukCacGrpChp, listeValeurs, autreCollectionAutreChp);
}
}
if (listeValeurs.getId().equals(config.getListeId("actionValorisation"))) {
actionAutreChp = new TextField<String>();
Formulaire.creerChoixMultipleCac(actionTrukCp, actionTrukCacGrpChp, listeValeurs, actionAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("continentEtFr"))) {
provenanceRechercheAutreChp = new TextField<String>();
Formulaire.creerChoixMultipleCac(provenanceRechercheTrukCp, provenanceRechercheTrukCacGrpChp, listeValeurs, provenanceRechercheAutreChp);
}
if (listeValeurs.getId().equals(config.getListeId("typeRecherche"))) {
typeRechercheAutreChp = new TextField<String>();
Formulaire.creerChoixMultipleCac(typeRechercheTrukCp, typeRechercheTrukCacGrpChp, listeValeurs, typeRechercheAutreChp);
}
}
 
public void afficherChampSupplementaire(Radio radioBtn) {
//GWT.log("Nom btn : "+radioBtn.getName()+" - Nom group : "+radioBtn.getGroup().getName(), null);
// Valeur du bouton radio déclenchant l'affichage des composants cachés
String valeurPourAfficher = "oui";
// Construction de la liste des composants à afficher/cacher
String radioGroupeNom = radioBtn.getGroup().getName();
ArrayList<Object> composants = new ArrayList<Object>();
if (radioGroupeNom.equals("action_mark_grp")) {
composants.add(actionTrukCp);
} else if (radioGroupeNom.equals("future_action_mark_grp")) {
composants.add(futureActionChp);
} else if (radioGroupeNom.equals("sans_motif_acces_mark_grp")) {
composants.add(sansMotifAccesChp);
} else if (radioGroupeNom.equals("avec_motif_acces_mark_grp")) {
composants.add(avecMotifAccesChp);
} else if (radioGroupeNom.equals("recherche_mark_grp")) {
composants.add(provenanceRechercheTrukCp);
composants.add(typeRechercheTrukCp);
}
// Nous affichons/cachons les composant de la liste
final int nbreComposants = composants.size();
//GWT.log("Id : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax, null);
//Window.alert("Radio grp nom : "+radioGroupeNom+" - Id btn : "+radioBtn.getId()+" - Class : "+radioBtn.getClass().toString()+"- Taille : "+tailleMax);
for (int i = 0; i < nbreComposants; i++) {
// En fonction du type de bouton cliquer, on affiche ou cache les champs
String type = radioBtn.getBoxLabel().toLowerCase();
//GWT.log(type, null);
if (radioBtn.getValue() == true) {
if (type.equals(valeurPourAfficher)) {
((Component) composants.get(i)).show();
} else {
((Component) composants.get(i)).hide();
}
}
// Si on a à faire à un ContentPanel, on l'actualise pour déclencher l'affichage
if (composants.get(i) instanceof ContentPanel) {
((ContentPanel) composants.get(i)).layout();
}
}
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/structure/StructureVue.java
New file
0,0 → 1,65
package org.tela_botanica.client.vues.structure;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.MenuApplicationId;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.modeles.structure.StructureListe;
import org.tela_botanica.client.synchronisation.Sequenceur;
 
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.google.gwt.core.client.GWT;
 
public class StructureVue extends LayoutContainer implements Rafraichissable {
 
private Mediateur mediateur = null;
private StructureListeVue panneauInstitutionListe = null;
private StructureDetailVue panneauInstitutionDetail = null;
 
private Sequenceur sequenceur = new Sequenceur();
public StructureVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
BorderLayout layout = new BorderLayout();
layout.setEnableState(false);
setLayout(layout);
 
panneauInstitutionListe = new StructureListeVue(mediateur);
add(panneauInstitutionListe, new BorderLayoutData(LayoutRegion.CENTER));
 
panneauInstitutionDetail = new StructureDetailVue(mediateur, sequenceur);
BorderLayoutData dispositionSud = new BorderLayoutData(LayoutRegion.SOUTH, .5f, 200, 1000);
dispositionSud.setSplit(true);
dispositionSud.setMargins(new Margins(5, 0, 0, 0));
add(panneauInstitutionDetail, dispositionSud);
}
 
public void rafraichir(Object nouvellesDonnees) {
// Nous passons l'objet aux méthodes rafraichir des panneaux composant le panneau principal Structure
if (nouvellesDonnees instanceof Structure) {
panneauInstitutionDetail.rafraichir(nouvellesDonnees);
} else if (nouvellesDonnees instanceof StructureListe) {
panneauInstitutionListe.rafraichir(nouvellesDonnees);
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("liste_structure_a_personne")) {
panneauInstitutionDetail.rafraichir(nouvellesDonnees);
} else if(info.getType().equals("structure_ajoutee")) {
mediateur.clicMenu(MenuApplicationId.STRUCTURE);
} else if (info.getType().equals("liste_collection_a_structure")) {
panneauInstitutionDetail.rafraichir(nouvellesDonnees);
} else {
panneauInstitutionListe.rafraichir(nouvellesDonnees);
}
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/structure/StructureVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/structure/StructureVue.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/structure/StructureVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/structure/StructureListeVue.java
New file
0,0 → 1,247
package org.tela_botanica.client.vues.structure;
 
import java.util.ArrayList;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.ChampFiltreRecherche;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.personne.PersonneAsyncDao;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.publication.PublicationListe;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.modeles.structure.StructureAsyncDao;
import org.tela_botanica.client.modeles.structure.StructureListe;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.vues.BarrePaginationVue;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.GridEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.Grid;
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class StructureListeVue extends ContentPanel implements Rafraichissable {
private Mediateur mediateur = null;
private Constantes i18nC = null;
 
private Grid<Structure> grille = null;
private ListStore<Structure> store = null;
private Button modifier;
private Button supprimer;
private Button ajouter;
private ChampFiltreRecherche champFiltreRecherche = null;
private BarrePaginationVue pagination = null;
private int indexElementSelectionne = 0;
private Structure structureSelectionnee = null;
 
public StructureListeVue(Mediateur mediateurCourant) {
mediateur = mediateurCourant;
i18nC = mediateur.i18nC;
setHeaderVisible(false);
setLayout(new FitLayout());
ToolBar toolBar = new ToolBar();
ajouter = new Button(i18nC.ajouter());
ajouter.setIcon(Images.ICONES.ajouter());
ajouter.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
mediateur.clicAjouterStructure();
}
});
ajouter.setToolTip(i18nC.indicationCreerUneFiche()+" "+i18nC.structureSingulier());
toolBar.add(ajouter);
 
modifier = new Button(i18nC.modifier());
modifier.setIcon(Images.ICONES.formModifier());
modifier.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
mediateur.clicModifierStructure(grille.getSelectionModel().getSelectedItems());
}
});
modifier.setToolTip(i18nC.indicationModifierUneFiche());
toolBar.add(modifier);
supprimer = new Button(i18nC.supprimer());
supprimer.setIcon(Images.ICONES.supprimer());
supprimer.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
clicSupprimerStructure(grille.getSelectionModel().getSelectedItems());
}
});
supprimer.setToolTip(i18nC.indicationSupprimerUneFiche());
toolBar.add(supprimer);
 
setTopComponent(toolBar);
 
List<ColumnConfig> colonnes = new ArrayList<ColumnConfig>();
colonnes.add(new ColumnConfig("ville", "Ville", 150));
colonnes.add(new ColumnConfig("nom", "Nom", 450));
ColumnModel modeleDeColonne = new ColumnModel(colonnes);
GridSelectionModel<Structure> modeleDeSelection = new GridSelectionModel<Structure>();
modeleDeSelection.addSelectionChangedListener(new SelectionChangedListener<Structure>() {
public void selectionChanged(SelectionChangedEvent<Structure> event) {
if((Structure) event.getSelectedItem() != null) {
structureSelectionnee = (Structure) event.getSelectedItem();
indexElementSelectionne = store.indexOf(structureSelectionnee);
clicListe(structureSelectionnee);
}
}
});
store = new ListStore<Structure>();
 
grille = new Grid<Structure>(store, modeleDeColonne);
grille.setWidth("100%");
grille.setAutoExpandColumn("nom");
grille.getView().setAutoFill(true);
grille.getView().setForceFit(true);
grille.setSelectionModel(modeleDeSelection);
grille.addListener(Events.ViewReady, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
grille.getSelectionModel().select(0, false);
}
});
grille.addListener(Events.OnDoubleClick, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
modifier.fireEvent(Events.Select);
}
});
grille.addListener(Events.SortChange, new Listener<BaseEvent>() {
 
@Override
public void handleEvent(BaseEvent be) {
GridEvent ge = (GridEvent<Structure>) be;
// TODO rajouter un test sur le sort state pour trier par nom par défaut
String tri = ge.getSortInfo().getSortField();
StructureAsyncDao.tri = Structure.PREFIXE+"_"+tri+" "+ge.getSortInfo().getSortDir().toString();
pagination.changePage();
}
});
add(grille);
StructureListe structureListe = new StructureListe();
champFiltreRecherche = new ChampFiltreRecherche(mediateurCourant, toolBar, structureListe);
// Définition de la barre de pagination
pagination = new BarrePaginationVue(structureListe, mediateur, champFiltreRecherche);
setBottomComponent(pagination);
}
 
private void clicListe(Structure structure) {
if (structure != null && store.getCount() > 0) {
mediateur.clicListeStructure(structure);
}
}
private void clicSupprimerStructure(List<Structure> structuresASupprimer) {
mediateur.clicSupprimerStructure(this, structuresASupprimer);
}
 
private void gererEtatActivationBouton() {
int nbreElementDuMagazin = store.getCount();
if (nbreElementDuMagazin == 0) {
supprimer.disable();
modifier.disable();
} else if (nbreElementDuMagazin > 0) {
modifier.enable();
if (((Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT)).isIdentifie()) {
supprimer.enable();
}
}
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof StructureListe) {
StructureListe structures = (StructureListe) nouvellesDonnees;
champFiltreRecherche.setListePaginable(structures);
pagination.setlistePaginable(structures);
pagination.rafraichir(structures.getPageTable());
if (structures != null) {
List<Structure> liste = structures.toList();
store.removeAll();
store.add(liste);
 
gererEtatActivationBouton();
mediateur.actualiserPanneauCentral();
grille.fireEvent(Events.ViewReady);
}
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("suppression_structure")) {
// Affichage d'un message d'information
InfoLogger.display(i18nC.suppressionStructure(), info.toString().replaceAll("\n", "<br />"));
List<Structure> selectionStructure = grille.getSelectionModel().getSelectedItems();
if (info.toString().replaceAll("\n", "").equals("OK")) {
mediateur.supprimerStructureAPersonne(this, selectionStructure);
}
// Suppression des structures sélectionnées de la grille
final int taille = selectionStructure.size();
for (int i = 0; i < taille; i++) {
store.remove(selectionStructure.get(i));
}
gererEtatActivationBouton();
} else if(info.getType().equals("structure_modifiee")) {
Structure structureModifiee = (Structure)info.getDonnee(0);
if(structureSelectionnee != null && structureModifiee != null) {
if(structureSelectionnee.getId().equals(structureModifiee.getId())) {
store.remove(indexElementSelectionne);
} else {
structureSelectionnee = null;
}
// au cas ou le bouton appliquer aurait été cliqué avant de valider
store.remove(structureModifiee);
store.insert(structureModifiee, indexElementSelectionne);
structureSelectionnee = structureModifiee;
int indexElementSelectionne = store.indexOf(structureSelectionnee);
grille.getSelectionModel().select(indexElementSelectionne, false);
grille.getView().focusRow(indexElementSelectionne);
clicListe(structureSelectionnee);
}
} else if (info.getType().equals("maj_utilisateur")) {
gererEtatActivationBouton();
} else if (info.getType().equals("suppression_structure_a_personne")) {
// Affichage d'un message d'information
InfoLogger.display(i18nC.suppressionStructureAPersonne(), info.toString().replaceAll("\n", "<br />"));
}
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
layout();
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/structure/StructureListeVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/structure/StructureListeVue.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/structure/StructureListeVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/structure/StructureDetailVue.java
New file
0,0 → 1,769
package org.tela_botanica.client.vues.structure;
 
import java.util.Iterator;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.collection.CollectionAStructure;
import org.tela_botanica.client.modeles.collection.CollectionAStructureListe;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
import org.tela_botanica.client.modeles.structure.StructureConservation;
import org.tela_botanica.client.modeles.structure.StructureValorisation;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.vues.DetailVue;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.util.Params;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Html;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.layout.AnchorLayout;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.GWT;
 
public class StructureDetailVue extends DetailVue implements Rafraichissable {
 
private String enteteTpl = null;
private String identificationTpl = null;
private String personnelTpl = null;
private String tableauPersonnelTpl = null;
private String lignePersonnelTpl = null;
private String conservationTpl = null;
private String traitementConservationTpl = null;
private String valorisationTpl = null;
private String typeTraitementConservationTpl = null;
private String rechercheValorisationTpl = null;
private String collectionTpl = null;
private String ligneCollectionTpl = null;
private String tableauCollectionTpl = null;
private Structure structure = null;
private boolean structureChargementOk = false;
private StructureAPersonneListe personnel = null;
private boolean personnelChargementOk = false;
private StructureValorisation valorisation = null;
private StructureConservation conservation = null;
private CollectionAStructureListe collection = null;
private boolean collectionChargementOk = false;
private ContentPanel panneauPrincipal = null;
private Html entete = null;
private TabPanel onglets = null;
private TabItem identificationOnglet = null;
private TabItem personnelOnglet = null;
private TabItem collectionOnglet = null;
private TabItem conservationOnglet = null;
private TabItem valorisationOnglet = null;
private Sequenceur sequenceur;
public StructureDetailVue(Mediateur mediateurCourant, Sequenceur sequenceur) {
super(mediateurCourant);
this.sequenceur = sequenceur;
initialiserTousLesTpl();
chargerOntologie();
panneauPrincipal = new ContentPanel();
panneauPrincipal.setLayout(new FitLayout());
panneauPrincipal.setHeaderVisible(false);
panneauPrincipal.setBodyBorder(false);
entete = new Html();
entete.setId(ComposantId.ZONE_DETAIL_ENTETE);
panneauPrincipal.setTopComponent(entete);
onglets = new TabPanel();
onglets.setId(ComposantId.ZONE_DETAIL_CORPS);
onglets.setBodyBorder(false);
identificationOnglet = new TabItem(i18nC.structureInfoGeneral());
identificationOnglet.setLayout(new AnchorLayout());
identificationOnglet.setScrollMode(Scroll.AUTO);
onglets.add(identificationOnglet);
personnelOnglet = new TabItem(i18nC.structureInfoPersonnel());
personnelOnglet.setLayout(new AnchorLayout());
personnelOnglet.setScrollMode(Scroll.AUTO);
onglets.add(personnelOnglet);
collectionOnglet = new TabItem(i18nC.structureInfoCollection());
collectionOnglet.setLayout(new AnchorLayout());
collectionOnglet.setScrollMode(Scroll.AUTO);
onglets.add(collectionOnglet);
conservationOnglet = new TabItem(i18nC.structureInfoConservation());
conservationOnglet.setLayout(new AnchorLayout());
conservationOnglet.setScrollMode(Scroll.AUTO);
onglets.add(conservationOnglet);
valorisationOnglet = new TabItem(i18nC.structureInfoValorisation());
valorisationOnglet.setLayout(new AnchorLayout());
valorisationOnglet.setScrollMode(Scroll.AUTO);
onglets.add(valorisationOnglet);
panneauPrincipal.add(onglets);
add(panneauPrincipal);
}
 
private void chargerOntologie() {
String[] listesCodes = {"stpr", "stpu", "pays", "statut", "fonction", "localStockage", "meubleStockage",
"parametreStockage", "autreCollection", "onep", "opRestau", "autreMateriel", "poisonTraitement",
"insecteTraitement", "actionValorisation", "continentEtFr", "typeRecherche"};
lancerChargementListesValeurs(listesCodes, this.sequenceur);
sequenceur.enfilerRafraichissement(this, new Information("ontologie_chargee"));
}
 
private void afficherDetailInstitution() {
if (structure != null) {
personnel = structure.getPersonnel();
valorisation = structure.getValorisation();
conservation = structure.getConservation();
afficherEntete();
afficherIdentification();
if (personnel != null) {
afficherPersonnel();
}
if (conservation != null) {
afficherConservation();
}
if (valorisation != null) {
afficherValorisation();
}
if (collection != null) {
afficherCollection();
}
}
layout();
}
private void afficherEntete() {
Params enteteParams = new Params();
enteteParams.set("css_id", ComposantId.ZONE_DETAIL_ENTETE);
enteteParams.set("css_meta", ComposantClass.META);
enteteParams.set("i18n_id", i18nC.id());
enteteParams.set("nom", structure.getNom());
enteteParams.set("ville", structure.getVille());
enteteParams.set("id", structure.getId());
enteteParams.set("guid", structure.getGuid());
String eHtml = Format.substitute(enteteTpl, enteteParams);
entete.getElement().setInnerHTML(eHtml);
}
private void afficherIdentification() {
Params identificationParams = new Params();
identificationParams.set("i18n_titre_administratif", i18nC.titreAdministratif());
identificationParams.set("i18n_acronyme", i18nC.acronyme());
identificationParams.set("i18n_statut", i18nC.statut());
identificationParams.set("i18n_date_fondation", i18nC.dateFondation());
identificationParams.set("i18n_nbre_personnel", i18nC.nbrePersonnel());
identificationParams.set("i18n_titre_description", i18nC.description());
identificationParams.set("i18n_description", i18nC.description());
identificationParams.set("i18n_acces", i18nC.acces());
identificationParams.set("i18n_usage", i18nC.usage());
identificationParams.set("i18n_titre_adresse", i18nC.adresse());
identificationParams.set("i18n_adresse", i18nC.adresse());
identificationParams.set("i18n_cp", i18nC.codePostal());
identificationParams.set("i18n_ville", i18nC.ville());
identificationParams.set("i18n_pays", i18nC.pays());
identificationParams.set("i18n_latitude", i18nC.latitude());
identificationParams.set("i18n_longitude", i18nC.longitude());
identificationParams.set("i18n_titre_communication", i18nC.titreCommunication());
identificationParams.set("i18n_tel", i18nC.telephone());
identificationParams.set("i18n_fax", i18nC.FAX());
identificationParams.set("i18n_courriel", i18nC.courriel());
identificationParams.set("i18n_web", i18nC.siteWeb());
 
String acronyme = construireTxtTruck(structure.getIdAlternatif());
String typePrive = construireTxtListeOntologie(structure.getTypePrive());
String typePublic = construireTxtListeOntologie(structure.getTypePublic());
String pays = construireTxtListeOntologie(structure.getPays());
String web = construireTxtTruck(structure.getUrl(), false);
String latitude = structure.getLatitude();
String longitude = structure.getLongitude();
String latitudeLongitude = (!longitude.equals("") && !latitude.equals("")) ? latitude+" / "+longitude : "";
identificationParams.set("acronyme", acronyme);
identificationParams.set("statut", typePrive+typePublic);
String dateFondation = structure.getAnneOuDateFondationFormatLong();
dateFondation = dateFondation.equals("0000") ? "" : dateFondation;
identificationParams.set("date_fondation", dateFondation);
identificationParams.set("nbre_personnel", structure.getNbrePersonne() != null ? structure.getNbrePersonne() : "");
identificationParams.set("description", structure.getDescription());
identificationParams.set("acces", structure.getConditionAcces());
identificationParams.set("usage", structure.getConditionUsage());
identificationParams.set("adresse", structure.getAdresse());
identificationParams.set("cp", structure.getCodePostal());
identificationParams.set("ville", structure.getVille());
identificationParams.set("pays", pays);
identificationParams.set("latitude_longitude", latitudeLongitude);
identificationParams.set("tel", structure.getTelephoneFixe());
identificationParams.set("fax", structure.getFax());
identificationParams.set("courriel", structure.getCourriel());
identificationParams.set("web", web);
afficherOnglet(identificationTpl, identificationParams, identificationOnglet);
}
private void afficherPersonnel() {
String tableauPersonnelHtml = "";
if (personnel.size() > 0) {
tableauPersonnelHtml = construireTableauDuPersonnel();
}
Params personnelParams = new Params();
personnelParams.set("i18n_titre_personnel", i18nC.titrePersonnel());
personnelParams.set("i18n_nbre_personnel_collection", i18nC.nbrePersonnelCollection());
personnelParams.set("nbre_personnel_collection", personnel.size());
personnelParams.set("tableau_personnel", tableauPersonnelHtml);
afficherOnglet(personnelTpl, personnelParams, personnelOnglet);
}
private String construireTableauDuPersonnel() {
Params contenuParams = new Params();
contenuParams.set("i18n_titre_membre", i18nC.titreMembre());
contenuParams.set("i18n_fonction", i18nC.fonction());
contenuParams.set("i18n_prenom", i18nC.personnePrenom());
contenuParams.set("i18n_nom", i18nC.personneNom());
contenuParams.set("i18n_tel", i18nC.FIX());
contenuParams.set("i18n_fax", i18nC.FAX());
contenuParams.set("i18n_courriel", i18nC.courrielPrincipal());
contenuParams.set("i18n_statut", i18nC.statut());
contenuParams.set("i18n_tps_w", i18nC.tpsTravail());
contenuParams.set("i18n_specialite", i18nC.specialite());
contenuParams.set("i18n_contact", i18nC.boolContact());
String lignesPersonnel = "";
Iterator<String> it = personnel.keySet().iterator();
while (it.hasNext()) {
StructureAPersonne personne = personnel.get(it.next());
Params ligneParams = new Params();
String fonction = construireTxtListeOntologie(personne.getFonction());
String statut = construireTxtListeOntologie(personne.getStatut());
String contact = formaterOuiNon(personne.getContact());
ligneParams.set("fonction", fonction);
ligneParams.set("prenom", personne.getPrenom());
ligneParams.set("nom", personne.getNom());
ligneParams.set("tel_fix", personne.getTelephoneFixe());
ligneParams.set("tel_fax", personne.getFax());
ligneParams.set("courriel", personne.getCourriel());
ligneParams.set("statut", statut);
ligneParams.set("tps_w", personne.getBotaTravailHebdoTps());
ligneParams.set("specialite", personne.afficherSpecialite());
ligneParams.set("contact", contact);
lignesPersonnel += Format.substitute(lignePersonnelTpl, ligneParams);
}
contenuParams.set("lignes", lignesPersonnel);
String cHtml = Format.substitute(tableauPersonnelTpl, contenuParams);
return cHtml;
}
private void afficherConservation() {
Params conservationParams = new Params();
conservationParams.set("i18n_titre_conservation_personnel", i18nC.titreConservationPersonnel());
conservationParams.set("i18n_formation", i18nC.formation());
conservationParams.set("i18n_formation_interet", i18nC.formationInteret());
conservationParams.set("i18n_titre_local", i18nC.titreLocal());
conservationParams.set("i18n_local_specifique", i18nC.localSpecifique());
conservationParams.set("i18n_meuble_specifique", i18nC.meubleSpecifique());
conservationParams.set("i18n_local_parametre", i18nC.localParametre());
conservationParams.set("i18n_conservation_en_commun", i18nC.conservationEnCommun());
conservationParams.set("i18n_acces_controle", i18nC.accesControle());
conservationParams.set("i18n_titre_operation", i18nC.titreOperation());
conservationParams.set("i18n_restauration", i18nC.restauration());
conservationParams.set("i18n_materiel_conservation", i18nC.materielConservation());
conservationParams.set("i18n_traitement", i18nC.traitement());
conservationParams.set("i18n_titre_acquisition", i18nC.titreAcquisition());
conservationParams.set("i18n_acquisition_collection", i18nC.acquisitionCollection());
conservationParams.set("i18n_acquisition_echantillon", i18nC.acquisitionEchantillon());
conservationParams.set("formation", formaterOuiNon(conservation.getFormation()));
conservationParams.set("formation_info", formaterSautDeLigne(conservation.getFormationInfo()));
conservationParams.set("formation_interet", formaterOuiNon(conservation.getFormationInteret()));
conservationParams.set("meuble_specifique", conservation.getStockageMeuble());
String chaineAAnalyser = conservation.getStockageLocal();
String chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
conservationParams.set("local_specifique", chaineAAfficher);
chaineAAnalyser = conservation.getStockageMeuble();
chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
conservationParams.set("meuble_specifique", chaineAAfficher);
chaineAAnalyser = conservation.getStockageParametre();
chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
conservationParams.set("local_parametre", chaineAAfficher);
conservationParams.set("conservation_en_commun", formaterOuiNon(conservation.getCollectionCommune()));
chaineAAnalyser = conservation.getCollectionAutre();
chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
conservationParams.set("collection_autre", formaterParenthese(chaineAAfficher));
conservationParams.set("acces_controle", formaterOuiNon(conservation.getAccesControle()));
conservationParams.set("restauration", formaterOuiNon(conservation.getRestauration()));
chaineAAnalyser = conservation.getRestaurationOperation();
chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
conservationParams.set("restauration_operation", formaterParenthese(chaineAAfficher));
chaineAAnalyser = conservation.getMaterielConservation();
chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
conservationParams.set("materiel_conservation", chaineAAfficher);
chaineAAnalyser = conservation.getMaterielAutre();
chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
conservationParams.set("materiel_autre", formaterParenthese(chaineAAfficher));
conservationParams.set("traitement", formaterOuiNon(conservation.getTraitement()));
chaineAAnalyser = conservation.getTraitements();
chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
conservationParams.set("traitements", formaterParenthese(chaineAAfficher));
conservationParams.set("acquisition_collection", formaterOuiNon(conservation.getAcquisitionCollection()));
conservationParams.set("acquisition_echantillon", formaterOuiNon(conservation.getAcquisitionEchantillon()));
conservationParams.set("acquisition_traitement_info", construireTraitement());
afficherOnglet(conservationTpl, conservationParams, conservationOnglet);
}
private String construireTraitement() {
String cHtml = "";
Integer echantillon = conservation.getAcquisitionEchantillon();
if (echantillon != null && echantillon.intValue() == 1) {
Params traitementConservationParams = new Params();
traitementConservationParams.set("i18n_acquisition_traitement", i18nC.acquisitionTraitement());
traitementConservationParams.set("acquisition_traitement", formaterOuiNon(conservation.getAcquisitionTraitement()));
traitementConservationParams.set("acquisition_traitement_type_info", construireTraitementType());
cHtml = Format.substitute(traitementConservationTpl, traitementConservationParams);
}
return cHtml;
}
private String construireTraitementType() {
String cHtml = "";
String traitement = conservation.getAcquisitionTraitement();
if (traitement.equals("1")) {
Params typeTraitementParams = new Params();
typeTraitementParams.set("i18n_acquisition_traitement_insecte", i18nC.acquisitionTraitementInsecte());
typeTraitementParams.set("i18n_acquisition_traitement_poison", i18nC.acquisitionTraitementPoison());
String acquisitionTraitementInsecte = construireTxtListeOntologie(conservation.getAcquisitionTraitementInsecte());
typeTraitementParams.set("acquisition_traitement_insecte", acquisitionTraitementInsecte);
String acquisitionTraitementPoison = construireTxtListeOntologie(conservation.getAcquisitionTraitementPoison());
typeTraitementParams.set("acquisition_traitement_poison", acquisitionTraitementPoison);
cHtml = Format.substitute(typeTraitementConservationTpl, typeTraitementParams);
}
return cHtml;
}
private void afficherValorisation() {
Params valorisationParams = new Params();
valorisationParams.set("i18n_titre_action_valorisation", i18nC.titreActionValorisation());
valorisationParams.set("i18n_action", i18nC.action());
valorisationParams.set("i18n_action_publication", i18nC.actionPublication());
valorisationParams.set("i18n_collection_autre", i18nC.collectionAutre());
valorisationParams.set("i18n_action_future", i18nC.actionFuture());
valorisationParams.set("action", formaterOuiNon(valorisation.getAction()));
String actionInfo = construireTxtListeOntologie(valorisation.getActionInfo());
valorisationParams.set("action_info", formaterParenthese(actionInfo));
valorisationParams.set("action_publication", valorisation.getPublication());
String collectionAutre = construireTxtListeOntologie(valorisation.getCollectionAutre());
valorisationParams.set("collection_autre", collectionAutre);
valorisationParams.set("action_future", formaterOuiNon(valorisation.getActionFuture()));
valorisationParams.set("action_future_info", formaterParenthese(valorisation.getActionFutureInfo()));
 
valorisationParams.set("i18n_titre_recherche_scientifique", i18nC.titreRechercherScientifique());
valorisationParams.set("i18n_recherche", i18nC.recherche());
valorisationParams.set("recherche", formaterOuiNon(valorisation.getRecherche()));
valorisationParams.set("recherche_info", construireRecherche());
valorisationParams.set("i18n_titre_acces_usage", i18nC.titreAccesUsage());
valorisationParams.set("i18n_acces", i18nC.acces());
valorisationParams.set("i18n_visite", i18nC.visite());
valorisationParams.set("acces", formaterOuiNon(valorisation.getAccesSansMotif()));
valorisationParams.set("acces_info", formaterParenthese(valorisation.getAccesSansMotifInfo()));
valorisationParams.set("visite", formaterOuiNon(valorisation.getVisiteAvecMotif()));
valorisationParams.set("visite_info", formaterParenthese(valorisation.getVisiteAvecMotifInfo()));
afficherOnglet(valorisationTpl, valorisationParams, valorisationOnglet);
}
private String construireRecherche() {
String cHtml = "";
Integer recherche = valorisation.getRecherche();
if (recherche != null && recherche.intValue() == 1) {
Params rechercheParams = new Params();
rechercheParams.set("i18n_recherche_provenance", i18nC.rechercheProvenance());
rechercheParams.set("i18n_recherche_type", i18nC.rechercheType());
String rechercheProvenance = construireTxtListeOntologie(valorisation.getRechercheProvenance());
rechercheParams.set("recherche_provenance", rechercheProvenance);
String rechercheType = construireTxtListeOntologie(valorisation.getRechercheType());
rechercheParams.set("recherche_type", rechercheType);
cHtml = Format.substitute(rechercheValorisationTpl, rechercheParams);
}
return cHtml;
}
private void afficherCollection() {
Params collectionParams = new Params();
collectionParams.set("i18n_titre_collection", i18nC.structureInfoCollection());
collectionParams.set("i18n_indication_collection", i18nC.structureIndicationCollection());
collectionParams.set("i18n_indication_lien_collection", i18nC.structureIndicationLienCollection());
collectionParams.set("css_indication_titre_petit", ComposantClass.INDICATION_TITRE_PETIT);
String guidTpl = ((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("consultationCollectionsLieesStructures");
String guid = guidTpl.replace("{str_id}", structure.getId());
collectionParams.set("guid_structure", guid);
String tableauCollectionHtml = "";
if (collection.size() > 0) {
tableauCollectionHtml = construireTableauCollection();
}
collectionParams.set("tableau_collection", tableauCollectionHtml);
afficherOnglet(collectionTpl, collectionParams, collectionOnglet);
}
private String construireTableauCollection() {
Params contenuParams = new Params();
String lignesCollection = "";
contenuParams.set("i18n_nom_collection", i18nC.nomCollection());
contenuParams.set("i18n_id_collection", i18nC.id());
contenuParams.set("i18n_lien_collection", i18nC.structureLienCollection());
contenuParams.set("css_largeur_colonne_id", ComposantClass.LARGEUR_COLONNE_ID);
String guidTpl = ((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("consultationCollections");
Iterator<String> it = collection.keySet().iterator();
while (it.hasNext()) {
CollectionAStructure collectionCourante = collection.get(it.next());
Params ligneParams = new Params();
String guidCollection = guidTpl.replace("{col_id}", collectionCourante.getIdCollection());
ligneParams.set("guid_structure", guidCollection);
ligneParams.set("id_collection", collectionCourante.getIdCollection());
ligneParams.set("nom_collection", collectionCourante.getNom());
ligneParams.set("lien_collection", guidCollection);
lignesCollection += Format.substitute(ligneCollectionTpl, ligneParams);
}
contenuParams.set("lignes", lignesCollection);
String cHtml = Format.substitute(tableauCollectionTpl, contenuParams);
return cHtml;
}
private void initialiserTousLesTpl() {
initialiserEnteteTpl();
initialiserIdentificationTpl();
initialiserPersonnelTpl();
initialiserTableauPersonnelTpl();
initialiserLignePersonnelTpl();
initialiserConservationTpl();
initialiserTraitementConservationTpl();
initialiserTypeTraitementConservationTpl();
initialiserValorisationTpl();
initialiserRechercheValorisationTpl();
initialiserCollectionTpl();
initialiserTableauCollectionTpl();
initialiserLigneCollectionTpl();
}
private void initialiserEnteteTpl() {
enteteTpl =
"<div id='{css_id}'>"+
" <h1>{nom}</h1>"+
" <h2>{ville}<span class='{css_meta}'> <br /> {i18n_id}:{id} - {guid}</span></h2>" +
" " +
"</div>";
}
private void initialiserIdentificationTpl() {
identificationTpl =
"<div class='{css_corps}'>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_administratif}</h2>"+
" <span class='{css_label}'>{i18n_acronyme} :</span> {acronyme}<br />"+
" <span class='{css_label}'>{i18n_statut} :</span> {statut}<br />"+
" <span class='{css_label}'>{i18n_date_fondation} :</span> {date_fondation}<br />"+
" <span class='{css_label}'>{i18n_nbre_personnel} :</span> {nbre_personnel}<br />"+
" </div>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_description}</h2>"+
" <span class='{css_label}'>{i18n_description} :</span> {description}<br />"+
" <span class='{css_label}'>{i18n_acces} :</span> {acces}<br />"+
" <span class='{css_label}'>{i18n_usage} :</span> {usage}<br />"+
" </div>"+
" <hr class='{css_clear}'/>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_adresse}</h2>"+
" <span class='{css_label}'>{i18n_adresse} :</span> {adresse}<br />" +
" <span class='{css_label}'>{i18n_cp} :</span> {cp}<br />" +
" <span class='{css_label}'>{i18n_ville} :</span> {ville}<br />" +
" <span class='{css_label}'>{i18n_pays} :</span> {pays}<br />" +
" <span class='{css_label}'>{i18n_latitude} / {i18n_longitude} :</span> {latitude_longitude}<br />" +
" </div>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_communication}</h2>"+
" <span class='{css_label}'>{i18n_tel} :</span> {tel}<br />"+
" <span class='{css_label}'>{i18n_fax} :</span> {fax}<br />"+
" <span class='{css_label}'>{i18n_courriel} :</span> {courriel}<br />"+
" <span class='{css_label}'>{i18n_web} :</span> {web}<br />"+
" </div>"+
"</div>";
}
private void initialiserPersonnelTpl() {
personnelTpl =
"<div class='{css_corps}'>"+
" <h2>{i18n_titre_personnel}</h2>"+
" <p><span class='{css_label}'>{i18n_nbre_personnel_collection} :</span> {nbre_personnel_collection}</p>"+
" {tableau_personnel}"+
"</div>";
}
private void initialiserTableauPersonnelTpl() {
tableauPersonnelTpl =
"<h3>{i18n_titre_membre}</h3>"+
"<table>"+
" <thead>"+
" <tr>" +
" <th>{i18n_fonction}</th>" +
" <th>{i18n_prenom}</th>" +
" <th>{i18n_nom}</th>" +
" <th>{i18n_tel}</th>" +
" <th>{i18n_fax}</th>" +
" <th>{i18n_courriel}</th>" +
" <th>{i18n_statut}</th>" +
" <th>{i18n_tps_w}</th>" +
" <th>{i18n_specialite}</th>" +
" <th>{i18n_contact}</th>" +
" </tr>"+
" </thead>"+
" <tbody>"+
" {lignes}"+
" </tbody>"+
"</table>";
}
private void initialiserLignePersonnelTpl() {
lignePersonnelTpl =
"<tr>"+
" <td>{fonction}</td>"+
" <td>{prenom}</td>"+
" <td>{nom}</td>"+
" <td>{tel_fix}</td>" +
" <td>{tel_fax}</td>" +
" <td>{courriel}</td>" +
" <td>{statut}</td>" +
" <td>{tps_w}</td>" +
" <td>{specialite}</td>" +
" <td>{contact}</td>" +
"</tr>";
}
private void initialiserConservationTpl() {
conservationTpl =
"<div class='{css_corps}'>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_conservation_personnel}</h2>"+
" <span class='{css_label}'>{i18n_formation} :</span> {formation}<br />"+
" {formation_info}<br />"+
" <span class='{css_label}'>{i18n_formation_interet} :</span> {formation_interet}<br />"+
" </div>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_local}</h2>"+
" <span class='{css_label}'>{i18n_local_specifique} :</span> {local_specifique}<br />"+
" <span class='{css_label}'>{i18n_meuble_specifique} :</span> {meuble_specifique}<br />"+
" <span class='{css_label}'>{i18n_local_parametre} :</span> {local_parametre}<br />"+
" <span class='{css_label}'>{i18n_conservation_en_commun} :</span> {conservation_en_commun} {collection_autre}<br />"+
" <span class='{css_label}'>{i18n_acces_controle} :</span> {acces_controle}<br />"+
" </div>"+
" <hr class='{css_clear}'Window/>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_operation}</h2>"+
" <span class='{css_label}'>{i18n_restauration} :</span> {restauration} {restauration_operation}<br />"+
" <span class='{css_label}'>{i18n_materiel_conservation} :</span> {materiel_conservation} {materiel_autre}<br />"+
" <span class='{css_label}'>{i18n_traitement} :</span> {traitement} {traitements}<br />"+
" </div>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_acquisition}</h2>"+
" <span class='{css_label}'>{i18n_acquisition_collection} :</span> {acquisition_collection}<br />"+
" <span class='{css_label}'>{i18n_acquisition_echantillon} :</span> {acquisition_echantillon}<br />"+
" {acquisition_traitement_info}" +
" </div>"+
"</div>";
}
private void initialiserTraitementConservationTpl() {
traitementConservationTpl =
"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement} :</span> {acquisition_traitement}<br />"+
" <div class='{css_indentation}'>"+
" {acquisition_traitement_type_info}"+
" </div>";
}
private void initialiserTypeTraitementConservationTpl() {
typeTraitementConservationTpl =
"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement_insecte} :</span> {acquisition_traitement_insecte}<br />"+
"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement_poison} :</span> {acquisition_traitement_poison}<br />";
}
private void initialiserValorisationTpl() {
valorisationTpl =
"<div class='{css_corps}'>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_action_valorisation}</h2>"+
" <span class='{css_label}'>{i18n_action} :</span> {action} {action_info}<br />"+
" <span class='{css_label}'>{i18n_action_publication} :</span> {action_publication}<br />"+
" <span class='{css_label}'>{i18n_collection_autre} :</span> {collection_autre}<br />"+
" <span class='{css_label}'>{i18n_action_future} :</span> {action_future} {action_future_info}<br />"+
" </div>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_recherche_scientifique}</h2>"+
" <span class='{css_label}'>{i18n_recherche} :</span> {recherche}<br />"+
" {recherche_info}"+
" </div>"+
" <hr class='{css_clear}'/>"+
" <div class='{css_fieldset}'>"+
" <h2>{i18n_titre_acces_usage}</h2>"+
" <span class='{css_label}'>{i18n_visite} :</span> {visite} {visite_info}<br />"+
" <span class='{css_label}'>{i18n_acces} :</span> {acces} {acces_info}<br />"+
" </div>"+
"</div>";
}
private void initialiserRechercheValorisationTpl() {
rechercheValorisationTpl =
"<span class='{css_indentation} {css_label}'>{i18n_recherche_provenance} :</span> {recherche_provenance}<br />"+
"<span class='{css_indentation} {css_label}'>{i18n_recherche_type} :</span> {recherche_type}<br />";
}
private void initialiserCollectionTpl() {
collectionTpl =
"<div class='{css_corps}'>"+
" <h2>{i18n_titre_collection} (<span class='{css_label} {css_indication_titre_petit}'>{i18n_indication_collection}</span>)</h2>"+
" {tableau_collection}"+
" <p> "+
" <a href=\"{guid_structure}\" class=\"{css_indication_titre_petit}\" target=\"_blank\">{i18n_indication_lien_collection}</a>"+
" </p>"+
"</div>";
}
private void initialiserTableauCollectionTpl() {
tableauCollectionTpl =
"<table>"+
" <thead>"+
" <tr>" +
" <th class=\"{css_largeur_colonne_id}\">{i18n_id_collection}</th>" +
" <th>{i18n_nom_collection}</th>" +
" <th>{i18n_lien_collection}</th>" +
" </tr>"+
" </thead>"+
" <tbody>"+
" {lignes}"+
" </tbody>"+
"</table>";
}
private void initialiserLigneCollectionTpl() {
ligneCollectionTpl =
"<tr>"+
" <td>{id_collection}</td>"+
" <td>{nom_collection}</td>"+
" <td><a href=\"{lien_collection}\" target=\"_blank\">{lien_collection}</a></td>"+
"</tr>";
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Structure) {
structure = (Structure) nouvellesDonnees;
structureChargementOk = true;
} else if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeursReceptionnee = (ValeurListe) nouvellesDonnees;
receptionerListeValeurs(listeValeursReceptionnee);
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("liste_structure_a_personne")) {
allouerPersonnelAStructure((StructureAPersonneListe) info.getDonnee(0));
personnelChargementOk = true;
} else if (info.getType().equals("liste_collection_a_structure")) {
allouerCollectionAStructure((CollectionAStructureListe) info.getDonnee(0));
collectionChargementOk = true;
} else if (info.getType().equals("ontologie_chargee")) {
ontologieChargementOk = true;
}
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
if (avoirDonneesChargees()) {
afficherDetailInstitution();
}
}
private void allouerCollectionAStructure(CollectionAStructureListe donnee) {
collection = donnee;
}
 
protected void allouerPersonnelAStructure(StructureAPersonneListe personnel) {
structure.setPersonnel(personnel);
}
private boolean avoirDonneesChargees() {
boolean ok = false;
if (structureChargementOk && personnelChargementOk && ontologieChargementOk) {
ok = true;
}
return ok;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/structure/StructureDetailVue.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/vues/structure/StructureDetailVue.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/structure/StructureDetailVue.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/vues/structure
New file
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/vues/structure:r1136-1291
Merged /trunk/src/org/tela_botanica/client/vues/structure:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/vues/structure:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/interfaces/Rafraichissable.java
New file
0,0 → 1,25
package org.tela_botanica.client.interfaces;
 
/**
* Toutes les classes qui reçoivent des données de manières asynchrones ou
* imprévisible implémentent cette interface. Elle permet de faire transiter le
* rafraichissable jusqu'au DAO et d'appeler sa méthode rafraîchir un fois les
* données reçues, tout cela en préservant bien la séparation des rôles car les
* classes qui font transiter le rafraichissable ne connaissent que cette
* interface et pas le reste de l'objet
*
* @author aurelien
*
*/
public interface Rafraichissable {
 
/**
* Méthode de mise à jour d'un objet
*
* @param nouvelleDonnees
* Un objet de n'importe quel type (programmation générique) qui
* contient les données de mise à jour
*/
public void rafraichir(Object nouvellesDonnees);
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/interfaces/ListePaginable.java
New file
0,0 → 1,16
package org.tela_botanica.client.interfaces;
 
/**
* Toutes les classes qui affichent des listes paginables
* implémentent cette interface.
* @author david delon
*
*/
public interface ListePaginable {
public void changerTaillePage(int nouvelleTaillePage);
public void changerNumeroPage(int pageCourante);
public void recharger();
public void filtrerParNom(String nom);
public void filtrerParNomEtPage(String nom, int pageCourante);
}
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/interfaces
New file
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/interfaces:r1136-1328
Merged /trunk/src/org/tela_botanica/client/interfaces:r11-59,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/interfaces:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/Modele.java
New file
0,0 → 1,438
package org.tela_botanica.client;
 
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
 
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.modeles.UtilisateurAsyncDao;
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionACommentaire;
import org.tela_botanica.client.modeles.collection.CollectionACommentaireAsyncDao;
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
import org.tela_botanica.client.modeles.collection.CollectionAPersonneAsyncDao;
import org.tela_botanica.client.modeles.collection.CollectionAPublication;
import org.tela_botanica.client.modeles.collection.CollectionAPublicationAsyncDao;
import org.tela_botanica.client.modeles.collection.CollectionAStructureAsyncDao;
import org.tela_botanica.client.modeles.collection.CollectionAsyncDao;
import org.tela_botanica.client.modeles.commentaire.Commentaire;
import org.tela_botanica.client.modeles.commentaire.CommentaireAsyncDao;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.personne.PersonneAsyncDao;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
import org.tela_botanica.client.modeles.publication.PublicationAPersonneAsyncDao;
import org.tela_botanica.client.modeles.publication.PublicationAsyncDao;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
import org.tela_botanica.client.modeles.structure.StructureAPersonneAsyncDao;
import org.tela_botanica.client.modeles.structure.StructureAsyncDao;
import org.tela_botanica.client.modeles.structure.StructureConservation;
import org.tela_botanica.client.modeles.structure.StructureValorisation;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Analytics;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
// TODO : le transformer en SINGLETON
public class Modele {
 
public Modele() {
Registry.register(RegistreId.MODELE, this);
}
 
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES VALEURS ET LISTES
//+----------------------------------------------------------------------------------------------------------------+
public void obtenirListeValeurs(Rafraichissable vue, Integer id, Integer seqId) {
ValeurListeAsyncDao lsDao = new ValeurListeAsyncDao(vue);
lsDao.obtenirListe(id, seqId);
}
 
public void obtenirListeValeurs(Rafraichissable vue, String type, int id, Integer seqId) {
ValeurListeAsyncDao lsDao = new ValeurListeAsyncDao(vue);
lsDao.obtenirListe(type, String.valueOf(id), seqId);
}
public void obtenirListeValeurs(Rafraichissable vue, Integer listId, boolean pagination, String recherche, int start, int nbElements, Integer seqId) {
ValeurListeAsyncDao lsDao = new ValeurListeAsyncDao(vue);
lsDao.obtenirListe(listId, pagination, recherche, start, nbElements, seqId);
}
 
public void obtenirListeValeurs(Rafraichissable vue, String type, String id, Integer seqId) {
ValeurListeAsyncDao lsDao = new ValeurListeAsyncDao(vue);
lsDao.obtenirListe(type, String.valueOf(id), seqId);
}
public void obtenirValeur(Rafraichissable vue, String type, Integer id, String identifiant, Integer seqId) {
ValeurListeAsyncDao lsDao = new ValeurListeAsyncDao(vue);
lsDao.selectionner(type, id, null, identifiant, seqId);
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES UTILISATEURS
//+----------------------------------------------------------------------------------------------------------------+
public void connecterUtilisateur(Rafraichissable vue, String login, String mdp) {
Utilisateur utilisateur = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
utilisateur.setLogin(login);
utilisateur.setMotDePasse(mdp);
UtilisateurAsyncDao uDao = new UtilisateurAsyncDao(vue);
uDao.connecterUtilisateur();
}
public void deconnecterUtilisateur(Rafraichissable vue) {
UtilisateurAsyncDao uDao = new UtilisateurAsyncDao(vue);
uDao.deconnecterUtilisateur();
}
public void getEtatUtilisateur(Rafraichissable vue) {
UtilisateurAsyncDao uDao = new UtilisateurAsyncDao(vue);
uDao.getEtatUtilisateur();
}
public void accepterLicence(Rafraichissable vue) {
UtilisateurAsyncDao uDao = new UtilisateurAsyncDao(vue);
uDao.accepterLicence();
}
public void modifierUtilisateur(Rafraichissable vueARafraichir, Utilisateur utilisateur) {
PersonneAsyncDao pAdao = new PersonneAsyncDao(vueARafraichir);
Personne personne = new Personne();
personne.setId(utilisateur.getId());
personne.setPrenom(utilisateur.getPrenom());
personne.setNom(utilisateur.getNom());
personne.setNomComplet(utilisateur.getNomComplet());
personne.setParametre(utilisateur.getParametre());
pAdao.modifier(personne);
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES STRUCTURES
//+----------------------------------------------------------------------------------------------------------------+
 
public void selectionnerStructure(Rafraichissable vueARafraichir, String structureId, String nomStructure, int start, int nbElements, Integer seqId, boolean searchCity) {
// Gestion des données des tables coel_structure, coel_structure_conservation et coel_structure_valorisation
StructureAsyncDao sDao = new StructureAsyncDao(vueARafraichir);
sDao.selectionner(false, structureId, nomStructure, null, start, nbElements, seqId, searchCity);
}
public void selectionnerStructureAvecPaginationProgressive(Rafraichissable vueARafraichir, String structureId, String nomStructure, String formatRetour, int start, int nbElements, Integer seqId, boolean searchCity) {
// Gestion des données des tables coel_structure, coel_structure_conservation et coel_structure_valorisation
StructureAsyncDao sDao = new StructureAsyncDao(vueARafraichir);
sDao.selectionner(true, structureId, nomStructure, formatRetour, start, nbElements, seqId, searchCity);
}
public void selectionnerStructure(Rafraichissable vueARafraichir, String recherche, int start, int nbElements, Integer seqId, boolean searchCity) {
// Gestion des données des tables coel_structure, coel_structure_conservation et coel_structure_valorisation
StructureAsyncDao sDao = new StructureAsyncDao(vueARafraichir);
sDao.selectionner(true, null, recherche, null, start, nbElements, seqId, searchCity);
}
/** Lance la creation d'une Structure
* @param vueARafraichir la vue demandant a être rafraichie
* @param structure les données de la structure
*/
public void ajouterStructure(Rafraichissable vueARafraichir, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
StructureAsyncDao structureDao = new StructureAsyncDao(vueARafraichir);
structureDao.ajouter(structure, conservation, valorisation);
}
 
public void supprimerStructure(Rafraichissable vueARafraichir, String idStr) {
StructureAsyncDao structureDao = new StructureAsyncDao(vueARafraichir);
structureDao.supprimer(idStr);
}
public void modifierStructure(Rafraichissable vueARafraichir, String structureId, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
StructureAsyncDao structureDao = new StructureAsyncDao(vueARafraichir);
structureDao.modifier(structureId, structure, conservation, valorisation);
}
 
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de la relation STRUCTURE A PERSONNE
public void selectionnerStructureAPersonne(Rafraichissable vueARafraichir, String structureId, String roleId, Integer seqId) {
// Gestion des données de la table coel_structure_a_personne
if (structureId != null && roleId != null) {
StructureAPersonneAsyncDao sapDao = new StructureAPersonneAsyncDao(vueARafraichir);
sapDao.selectionner(false, structureId, roleId, null, 0, -1, seqId);
}
}
public void selectionnerStructureAPersonne(Rafraichissable vueARafraichir, String structureId, String roleId, String recherche, int start, int nbElements, Integer seqId) {
StructureAPersonneAsyncDao sapDao = new StructureAPersonneAsyncDao(vueARafraichir);
sapDao.selectionner(true, structureId, roleId, recherche, start, nbElements, seqId);
}
public void modifierStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonne personnel) {
StructureAPersonneAsyncDao structureAPersonneDao = new StructureAPersonneAsyncDao(vueARafraichir);
structureAPersonneDao.modifier(personnel);
}
public void ajouterStructureAPersonne(Rafraichissable vueARafraichir, String structureId, StructureAPersonne personnel) {
StructureAPersonneAsyncDao structureAPersonneDao = new StructureAPersonneAsyncDao(vueARafraichir);
structureAPersonneDao.ajouter(structureId, personnel);
}
public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, String personnelId) {
StructureAPersonneAsyncDao structureAPersonneDao = new StructureAPersonneAsyncDao(vueARafraichir);
structureAPersonneDao.supprimer(personnelId);
}
 
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES COLLECTIONS
//+----------------------------------------------------------------------------------------------------------------+
public void selectionnerCollection(Rafraichissable vueARafraichir, String collectionId, String nom, int start, int nbElements, Integer seqId) {
CollectionAsyncDao cDao = new CollectionAsyncDao(vueARafraichir);
//Coel.LogVersFirebug("> selectionnerCollection : [" + collectionId + "]");
cDao.selectionner(false, collectionId, nom, start, nbElements, seqId);
}
public void selectionnerCollection(Rafraichissable vueARafraichir, String recherche, int start, int nbElements, Integer seqId) {
CollectionAsyncDao cDao = new CollectionAsyncDao(vueARafraichir);
cDao.selectionner(true, null, recherche, start, nbElements, seqId);
}
public void ajouterCollection(Rafraichissable vueARafraichir, Collection collection) {
CollectionAsyncDao cDao = new CollectionAsyncDao(vueARafraichir);
cDao.ajouter(collection);
Analytics.evenement("collection", "ajout", "{'nom': '" + collection.getNom() + "'}");
}
 
public void modifierCollection(Rafraichissable vueARafraichir, Collection collection) {
CollectionAsyncDao cDao = new CollectionAsyncDao(vueARafraichir);
cDao.modifier(collection);
Analytics.evenement("collection", "modification", "{'nom': '" + collection.getNom() + "'}");
}
 
public void supprimerCollection(Rafraichissable vueARafraichir, String identifiantsCollectionSepareParVirgule) {
CollectionAsyncDao cDao = new CollectionAsyncDao(vueARafraichir);
cDao.supprimer(identifiantsCollectionSepareParVirgule);
int nombreDeCollectionsSupprimees = identifiantsCollectionSepareParVirgule.split(",").length;
Analytics.evenement("collection", "suppression", "{'identifiants': '[" + identifiantsCollectionSepareParVirgule + "]'}", nombreDeCollectionsSupprimees);
}
public void selectionnerCollectionAStructure(Rafraichissable vueARafraichir, String structureId, int start, int nbElements,
Integer seqId) {
CollectionAStructureAsyncDao cDao = new CollectionAStructureAsyncDao(vueARafraichir);
cDao.selectionner(structureId, start, nbElements, seqId);
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de la relation COLLECTION A PERSONNE
public void selectionnerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, String roleId, String recherche, int start, int nbElements, Integer seqId) {
CollectionAPersonneAsyncDao sapDao = new CollectionAPersonneAsyncDao(vueARafraichir);
sapDao.selectionner(true, collectionId, roleId, recherche, start, nbElements, seqId);
}
public void selectionnerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, String roleId, Integer seqId) {
CollectionAPersonneAsyncDao sapDao = new CollectionAPersonneAsyncDao(vueARafraichir);
sapDao.selectionner(false, collectionId, roleId, null, 0, -1, seqId);
}
public void modifierCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonne collectionAPersonne) {
CollectionAPersonneAsyncDao collectionAPersonneDao = new CollectionAPersonneAsyncDao(vueARafraichir);
collectionAPersonneDao.modifier(collectionAPersonne);
}
public void ajouterCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, CollectionAPersonne collectionAPersonne) {
CollectionAPersonneAsyncDao collectionAPersonneDao = new CollectionAPersonneAsyncDao(vueARafraichir);
collectionAPersonneDao.ajouter(collectionId, collectionAPersonne);
}
public void supprimerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionAPersonneId) {
CollectionAPersonneAsyncDao collectionAPersonneDao = new CollectionAPersonneAsyncDao(vueARafraichir);
collectionAPersonneDao.supprimer(collectionAPersonneId);
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de la relation COLLECTION A PUBLICATION
 
public void selectionnerCollectionAPublication(Rafraichissable vueARafraichir, String collectionId, String recherche, int start, int nbElements, Integer seqId) {
CollectionAPublicationAsyncDao capDao = new CollectionAPublicationAsyncDao(vueARafraichir);
capDao.selectionner(true, collectionId, recherche, start, nbElements, seqId);
}
public void selectionnerCollectionAPublication(Rafraichissable vueARafraichir, String collectionId, Integer seqId) {
CollectionAPublicationAsyncDao capDao = new CollectionAPublicationAsyncDao(vueARafraichir);
capDao.selectionner(false, collectionId, null, 0, -1, seqId);
}
public void modifierCollectionAPublication(Rafraichissable vueARafraichir, CollectionAPublication collectionAPublication) {
CollectionAPublicationAsyncDao collectionAPublicationDao = new CollectionAPublicationAsyncDao(vueARafraichir);
collectionAPublicationDao.modifier(collectionAPublication);
}
public void ajouterCollectionAPublication(Rafraichissable vueARafraichir, String collectionId, CollectionAPublication collectionAPublication) {
CollectionAPublicationAsyncDao collectionAPublicationDao = new CollectionAPublicationAsyncDao(vueARafraichir);
collectionAPublicationDao.ajouter(collectionId, collectionAPublication);
}
public void supprimerCollectionAPublication(Rafraichissable vueARafraichir, String collectionAPublicationId) {
CollectionAPublicationAsyncDao collectionAPublicationDao = new CollectionAPublicationAsyncDao(vueARafraichir);
collectionAPublicationDao.supprimer(collectionAPublicationId);
}
 
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de la relation COLLECTION A COMMENTAIRE
public void selectionnerCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId, Integer seqId) {
CollectionACommentaireAsyncDao cacDao = new CollectionACommentaireAsyncDao(vueARafraichir);
cacDao.selectionner(false, collectionId, null, 0, -1, seqId);
}
public void selectionnerCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId, String recherche, int start, int nbElements, Integer seqId) {
CollectionACommentaireAsyncDao cacDao = new CollectionACommentaireAsyncDao(vueARafraichir);
cacDao.selectionner(true, collectionId, recherche, start, nbElements, seqId);
}
public void modifierCollectionACommentaire(Rafraichissable vueARafraichir, CollectionACommentaire collectionACommentaire) {
CollectionACommentaireAsyncDao cacDao = new CollectionACommentaireAsyncDao(vueARafraichir);
cacDao.modifier(collectionACommentaire);
}
public void ajouterCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId, CollectionACommentaire collectionACommentaire) {
CollectionACommentaireAsyncDao cacDao = new CollectionACommentaireAsyncDao(vueARafraichir);
cacDao.ajouter(collectionId, collectionACommentaire);
}
public void supprimerCollectionACommentaire(Rafraichissable vueARafraichir, String collectionACommentaireId, String mode) {
CollectionACommentaireAsyncDao cacDao = new CollectionACommentaireAsyncDao(vueARafraichir);
cacDao.supprimer(collectionACommentaireId, mode);
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES PERSONNES
//+----------------------------------------------------------------------------------------------------------------+
public void selectionnerPersonne(Rafraichissable vueARafraichir, String personneId, String nomComplet, int start, int nbElements) {
selectionnerPersonne(vueARafraichir, personneId, nomComplet, start, nbElements, null);
}
public void selectionnerPersonne(Rafraichissable vueARafraichir, String personneId, String nomComplet, int start, int nbElements, Integer seqId) {
PersonneAsyncDao pDao = new PersonneAsyncDao(vueARafraichir);
pDao.selectionner(false, personneId, nomComplet, start, nbElements, seqId);
}
public void selectionnerPersonne(Rafraichissable vueARafraichir, String recherche, int start, int nbElements, Integer seqId) {
PersonneAsyncDao pDao = new PersonneAsyncDao(vueARafraichir);
pDao.selectionner(true, null, recherche, start, nbElements, seqId);
}
 
public void supprimerPersonne(Rafraichissable vueARafraichir, String idPersonneSepareParVirgule) {
PersonneAsyncDao personneDao = new PersonneAsyncDao(vueARafraichir);
personneDao.supprimer(idPersonneSepareParVirgule);
}
public void ajouterPersonne(Rafraichissable vue, Personne personne) {
PersonneAsyncDao personneDao = new PersonneAsyncDao(vue);
personneDao.ajouter(personne);
}
public void modifierPersonne(Rafraichissable vueARafraichir, Personne personne) {
PersonneAsyncDao personneDao = new PersonneAsyncDao(vueARafraichir);
personneDao.modifier(personne);
}
 
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES PUBLICATIONS
//+----------------------------------------------------------------------------------------------------------------+
public void selectionnerPublication(Rafraichissable vueARafraichir, String publicationId, String nomComplet, int pageCourante, int nbElements, Integer seqId) {
PublicationAsyncDao lsDao = new PublicationAsyncDao(vueARafraichir);
lsDao.selectionner(false, publicationId, nomComplet, pageCourante, nbElements, seqId);
}
public void selectionnerPublication(Rafraichissable vueARafraichir, String recherche, int start, int nbElements, Integer seqId) {
PublicationAsyncDao lsDao = new PublicationAsyncDao(vueARafraichir);
lsDao.selectionner(true, null, recherche, start, nbElements, seqId);
}
public void modifierPublication(Rafraichissable vueRafraichir, Publication publication, Integer seqId) {
PublicationAsyncDao pDao = new PublicationAsyncDao(vueRafraichir);
pDao.modifier(publication, seqId);
}
 
public void ajouterPublication(Rafraichissable vueARafraichir, Publication publication, Integer seqId) {
PublicationAsyncDao pDao = new PublicationAsyncDao(vueARafraichir);
pDao.ajouter(publication, seqId);
}
 
public void supprimerPublication(Rafraichissable vueARafraichir, String idPublicationSeparesParVirgule) {
PublicationAsyncDao pDao = new PublicationAsyncDao(vueARafraichir);
pDao.supprimer(idPublicationSeparesParVirgule);
}
 
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de la relation PUBLICATION A PERSONNE
 
public void selectionPersonnesAPublication(Rafraichissable vueARafraichir, String publicationId, String recherche, int start, int nbElements, Integer seqId) {
PublicationAPersonneAsyncDao paDao = new PublicationAPersonneAsyncDao(vueARafraichir);
paDao.selectionner(true, publicationId, null, PublicationAPersonne.ROLE_AUTEUR, recherche, start, nbElements, seqId);
}
public void selectionPublicationsAPersonne(Rafraichissable vueARafraichir, String personneId, String roleIds, String recherche, int start, int nbElements, Integer seqId) {
PublicationAPersonneAsyncDao paDao = new PublicationAPersonneAsyncDao(vueARafraichir);
paDao.selectionner(true, null, personneId, roleIds, recherche, start, nbElements, seqId);
}
public void selectionPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId, Integer seqId) {
PublicationAPersonneAsyncDao paDao = new PublicationAPersonneAsyncDao(vueARafraichir);
paDao.selectionner(false, publicationId, personnesId, roleId, null, 0, -1, seqId);
}
public void ajouterPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, String ordreAuteursSepareParVirgule, String roleId, Integer seqId) {
PublicationAPersonneAsyncDao paDao = new PublicationAPersonneAsyncDao(vueARafraichir);
paDao.ajouter(publicationId, personnesId, ordreAuteursSepareParVirgule, roleId, seqId);
}
public void modifierPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, String ordreAuteurs, String roleId, Integer seqId) {
PublicationAPersonneAsyncDao paDao = new PublicationAPersonneAsyncDao(vueARafraichir);
paDao.modifier(publicationId, personnesId, ordreAuteurs, roleId, seqId);
}
 
public void supprimerPublicationAPersonne(Rafraichissable vueARafraichir, String publicationsAPersonneId) {
PublicationAPersonneAsyncDao publicationAPersonneDao = new PublicationAPersonneAsyncDao(vueARafraichir);
publicationAPersonneDao.supprimer(publicationsAPersonneId);
}
 
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES COMMENTAIRES
//+----------------------------------------------------------------------------------------------------------------+
public void selectionnerCommentaire(Rafraichissable vueARafraichir, String commentaireId, String titre, int pageCourante, int nbElements, Integer seqId) {
CommentaireAsyncDao cDao = new CommentaireAsyncDao(vueARafraichir);
cDao.selectionner(false, commentaireId, titre, pageCourante, nbElements, seqId);
}
public void selectionnerCommentaire(Rafraichissable vueARafraichir, String recherche, int pageCourante, int nbElements, Integer seqId) {
CommentaireAsyncDao cDao = new CommentaireAsyncDao(vueARafraichir);
cDao.selectionner(true, null, recherche, pageCourante, nbElements, seqId);
}
public void modifierCommentaire(Rafraichissable vueRafraichir, Commentaire commentaire) {
CommentaireAsyncDao cDao = new CommentaireAsyncDao(vueRafraichir);
cDao.modifier(commentaire);
}
 
public void ajouterCommentaire(Rafraichissable vueARafraichir, Commentaire commentaire) {
CommentaireAsyncDao cDao = new CommentaireAsyncDao(vueARafraichir);
cDao.ajouter(commentaire);
}
 
public void supprimerCommentaire(Rafraichissable vueARafraichir, String idCommentaireSeparesParVirgule) {
CommentaireAsyncDao cDao = new CommentaireAsyncDao(vueARafraichir);
cDao.supprimer(idCommentaireSeparesParVirgule);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/Modele.java:r1136-1368
Merged /branches/v1.6-muscardin/src/org/tela_botanica/client/Modele.java:r1816-1817
Merged /trunk/src/org/tela_botanica/client/Modele.java:r11-59,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/Modele.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/ChampComboBoxRechercheTempsReelPaginable.java
New file
0,0 → 1,211
package org.tela_botanica.client.composants;
 
import java.util.List;
 
import org.tela_botanica.client.composants.pagination.ChargeurListe;
import org.tela_botanica.client.composants.pagination.Proxy;
import org.tela_botanica.client.composants.pagination.TransformateurJSONaModelData;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.FieldEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
 
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.LoadEvent;
import com.extjs.gxt.ui.client.data.Loader;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
 
public class ChampComboBoxRechercheTempsReelPaginable extends LayoutContainer implements Rafraichissable {
 
//-------------//
// ATTRIBUTS //
//-------------//
private ListStore<ModelData> store = null;
private ComboBox<ModelData> combo = null;
 
private Proxy<?> proxy = null;
private TransformateurJSONaModelData<PagingLoadResult<ModelData>> reader = null;
private ChargeurListe<PagingLoadResult<ModelData>> loader = null;
private int start = 0;
private int limit = 10;
private int largeur = 370;
 
private BasePagingLoadConfig plc = null;
private ModelType modeltype = null;
private String displayName = "";
private String recherche = "";
private String champValeurInitiale = "";
private String valeurInitiale = "";
private boolean valeurInitialeAffectee = false;
//-------------//
// METHODES //
//-------------//
 
/*--------------
Constructeur
--------------*/
public ChampComboBoxRechercheTempsReelPaginable(Proxy<?> proxy, ModelType modelType, String displayName, int taillePage) {
initialiserChamp(proxy, modelType, displayName);
}
public ChampComboBoxRechercheTempsReelPaginable(Proxy<?> proxy, ModelType modelType, String displayName) {
initialiserChamp(proxy, modelType, displayName);
}
private void initialiserChamp(Proxy<?> proxy, ModelType modelType, String displayName) {
this.modeltype = modelType;
this.proxy = proxy;
this.displayName = displayName;
 
plc = new BasePagingLoadConfig();
plc.setLimit(limit);
plc.setOffset(start);
reader = new TransformateurJSONaModelData<PagingLoadResult<ModelData>>(this.modeltype, null);
loader = new ChargeurListe<PagingLoadResult<ModelData>>(this.proxy, reader, this);
loader.setLimit(plc.getLimit());
loader.setOffset(plc.getOffset());
 
loader.addListener(Loader.BeforeLoad, new Listener<LoadEvent>() {
public void handleEvent(LoadEvent be) {
be.<ModelData> getConfig().set("start", be.<ModelData> getConfig().get("offset"));
}
});
 
loader.addListener(Loader.Load, new Listener<LoadEvent>() {
public void handleEvent(LoadEvent be) {
 
}
});
loader.addListener(Loader.LoadException, new Listener<LoadEvent>() {
public void handleEvent(LoadEvent be) {
 
}
});
combo = new ComboBox<ModelData>();
this.setWidth(largeur);
combo.setDisplayField(this.displayName);
combo.setHideTrigger(false);
combo.setPageSize(plc.getLimit());
store = new ListStore<ModelData>(loader);
combo.setStore(store);
loader.load(plc, recherche, false);
 
combo.addListener(Events.KeyUp, new Listener<FieldEvent>() {
public void handleEvent(FieldEvent fe) {
// on vérifie que les touches enfoncées ne sont pas les flèches du clavier
if (!fe.isNavKeyPress()) {
recherche = combo.getRawValue();
plc.setLimit(limit);
plc.setOffset(start);
loader.setLimit(limit);
loader.setOffset(start);
loader.load(plc, recherche, false);
}
}
});
 
this.add(combo);
}
 
/*------------
Accesseurs
------------*/
public ComboBox<ModelData> getCombo() {
return this.combo;
}
public ModelData getValeur() {
if (combo.getSelection() != null && combo.getSelection().size() > 0) {
return combo.getSelection().get(0);
} else {
return null;
}
}
public ListStore<?> getStore() {
return combo.getStore();
}
public void setWidth(int largeur) {
this.largeur = largeur;
this.combo.setWidth(largeur);
}
public void setWidth(int tailleLabel, int largeurTotale) {
this.setWidth(largeurTotale);
this.largeur = largeurTotale;
this.combo.setWidth(largeurTotale - tailleLabel);
FormLayout fl = new FormLayout();
fl.setLabelWidth(tailleLabel);
fl.setDefaultWidth(largeurTotale - tailleLabel);
this.setLayout(fl);
 
this.layout();
}
/*-----------------------------
Gestion du contenu du champ
-----------------------------*/
public List<ModelData> collecterValeursDuChamp() {
return combo.getSelection();
}
public void peuplerChamp(List<ModelData> selection) {
combo.setSelection(selection);
}
 
public void chargerValeurInitiale(String valeurInitiale, String champ) {
this.valeurInitiale = valeurInitiale;
this.champValeurInitiale = champ;
if(combo.getStore().findModel(champValeurInitiale, valeurInitiale) == null) {
loader.load(plc, "", true);
this.getCombo().disable();
} else {
combo.setValue(combo.getStore().findModel(champValeurInitiale, valeurInitiale));
}
}
 
/*-----------------------------
Rafraichir
-----------------------------*/
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("selectionnerValeurCombo")) {
if (combo.getStore().findModel(champValeurInitiale, valeurInitiale) == null) {
// Si la valeur ne fait pas partie de la première page, on doit charger la liste complète
// C'est un peu moche mais pour le moment ça marche (les listes ne dépassant pas quelques
// centaines d'élements), on s'arrete par contre si on a atteint le total d'éléments
if(!valeurInitialeAffectee && combo.getStore().getCount() < loader.getTotalCount()) {
loader.load(start, loader.getTotalCount());
} else {
this.getCombo().enable();
}
} else {
combo.setValue(combo.getStore().findModel(champValeurInitiale, valeurInitiale));
valeurInitialeAffectee = true;
this.getCombo().enable();
}
}
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/ChampComboBoxRechercheTempsReelPaginable.java:r1136-1208,1292-1367
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/ChampComboBoxRechercheTempsReelPaginable.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/GrillePaginable.java
New file
0,0 → 1,193
package org.tela_botanica.client.composants;
 
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import org.tela_botanica.client.composants.pagination.ChargeurListe;
import org.tela_botanica.client.composants.pagination.Proxy;
import org.tela_botanica.client.composants.pagination.TransformateurJSONaModelData;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.composants.GrilleParametrable;
 
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.LoadEvent;
import com.extjs.gxt.ui.client.data.Loader;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.data.PagingLoadConfig;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.GridEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.store.StoreEvent;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.grid.ColumnConfig;
import com.extjs.gxt.ui.client.widget.grid.ColumnModel;
import com.extjs.gxt.ui.client.widget.grid.EditorGrid;
import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
import com.extjs.gxt.ui.client.widget.grid.RowNumberer;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar;
 
public class GrillePaginable<D extends ModelData> extends ContentPanel implements Rafraichissable, GrilleParametrable<D> {
 
//+---------------------------------------------------------------------------------------------------------------+
// Attributs
// Pagination
private int start = 0;
private int limit = 50;
// Récupération, stockage et pagination des données
private ModelType modelType = null;
private Proxy<D> proxy = null;
private TransformateurJSONaModelData<PagingLoadResult<D>> reader = null;
private BasePagingLoadConfig plc = null;
private ChargeurListe<PagingLoadResult<D>> loader = null;
private ListStore<D> storeGrille = null;
// Elements graphiques
EditorGrid<D> grille = null;
List<ColumnConfig> colonnes = null;
ColumnModel modeleDeColonnes = null;
//+---------------------------------------------------------------------------------------------------------------+
// Constructeur
public GrillePaginable(ModelType modeltype, HashMap<String, String> virtualFields, Proxy<D> proxy, List<ColumnConfig> colonnes, ColumnModel modeleDeColonnes) {
// Récupération des paramètres
this.modelType = modeltype;
this.proxy = proxy;
this.colonnes = colonnes;
this.modeleDeColonnes = modeleDeColonnes;
// Formatage du conteneur;
this.setLayout(new FitLayout());
// Création des objets pour la récupération et la pagination des données
plc = new BasePagingLoadConfig();
plc.setLimit(limit);
plc.setOffset(start);
reader = new TransformateurJSONaModelData<PagingLoadResult<D>>(modelType, virtualFields);
creerChargeurDeListe();
creerGrille();
}
 
//+---------------------------------------------------------------------------------------------------------------+
// Accesseurs
public EditorGrid<D> getGrille() {
return grille;
}
public ListStore<D> getStore() {
return storeGrille;
}
public GridSelectionModel<D> getSelectionModel() {
return grille.getSelectionModel();
}
public D getSelection() {
return grille.getSelectionModel().getSelectedItem();
}
@SuppressWarnings("unchecked")
public Proxy getProxy() {
return this.proxy;
}
//+---------------------------------------------------------------------------------------------------------------+
// Méthodes publiques
public void rafraichir(Object nouvellesDonnees) {
}
//+---------------------------------------------------------------------------------------------------------------+
// Méthodes privées
private void creerChargeurDeListe() {
loader = new ChargeurListe<PagingLoadResult<D>>(proxy, reader, this);
loader.setLimit(plc.getLimit());
loader.setOffset(plc.getOffset());
loader.addListener(Loader.BeforeLoad, new Listener<LoadEvent>() {
public void handleEvent(LoadEvent be) {
 
}
});
loader.addListener(Loader.Load, new Listener<LoadEvent>() {
public void handleEvent(LoadEvent be) {
 
}
});
}
private void creerGrille() {
final PagingToolBar toolBar = new PagingToolBar(this.limit);
toolBar.bind(loader);
this.setBottomComponent(toolBar);
storeGrille = new ListStore<D>(loader);
storeGrille.addListener(Store.Add, new Listener<StoreEvent<D>>() {
public void handleEvent(StoreEvent<D> ce) {
 
}
});
storeGrille.addListener(Store.Remove, new Listener<StoreEvent<D>>() {
public void handleEvent(StoreEvent<D> ce) {
 
}
});
storeGrille.addListener(Store.Update, new Listener<StoreEvent<D>>() {
public void handleEvent(StoreEvent<D> ce) {
 
}
});
GridSelectionModel<D> modeleDeSelection = new GridSelectionModel<D>();
grille = new EditorGrid<D>(storeGrille, modeleDeColonnes);
grille.setHeight("100%");
grille.setBorders(true);
grille.setSelectionModel(modeleDeSelection);
grille.getView().setForceFit(true);
grille.setStripeRows(true);
grille.setBorders(true);
grille.setStateful(true);
grille.addListener(Events.Attach, new Listener<GridEvent<D>>() {
public void handleEvent(GridEvent<D> be) {
PagingLoadConfig config = new BasePagingLoadConfig();
config.setOffset(start);
config.setLimit(limit);
Map<String, Object> state = grille.getState();
if (state.containsKey("offset")) {
int offset = (Integer)state.get("offset");
int limit = (Integer)state.get("limit");
config.setOffset(offset);
config.setLimit(limit);
}
if (state.containsKey("sortField")) {
config.setSortField((String)state.get("sortField"));
config.setSortDir(SortDir.valueOf((String)state.get("sortDir")));
}
loader.load(config);
}
});
this.add(grille);
}
public void reload() {
loader.load();
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/ChampComboBoxListeValeurs.java
New file
0,0 → 1,158
package org.tela_botanica.client.composants;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.vues.Formulaire;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.SortDir;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.Validator;
import com.google.gwt.core.client.GWT;
 
public class ChampComboBoxListeValeurs extends ComboBox<Valeur> implements Rafraichissable {
private Configuration config = null;
private Mediateur mediateur = null;
 
private String listeValeursCode = null;
private String nomChampATrier = null;
private String valeurDefautId = null;
public ChampComboBoxListeValeurs(String labelDuChamp, String codeDeLaliste) {
initialiserChampComboBox(labelDuChamp, codeDeLaliste, 0);
}
public ChampComboBoxListeValeurs(String labelDuChamp, String codeDeLaliste, int tabIndex) {
initialiserChampComboBox(labelDuChamp, codeDeLaliste, tabIndex);
}
public ChampComboBoxListeValeurs(String labelDuChamp, ValeurListe listeDeValeurs, int tabIndex) {
initialiserChampComboBox(labelDuChamp, null, tabIndex);
rafraichir(listeDeValeurs);
}
private void initialiserChampComboBox(String labelDuChamp, String codeDeLaliste, int tabIndex) {
config = (Configuration) Registry.get(RegistreId.CONFIG);
mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
setForceSelection(true);
setTriggerAction(TriggerAction.ALL);
setDisplayField("nom");
setStore(new ListStore<Valeur>());
setEditable(false);
 
setTabIndex(tabIndex);
if (labelDuChamp == null) {
setLabelSeparator("");
} else {
setFieldLabel(labelDuChamp);
}
setValidator(new Validator() {
public String validate(Field<?> field, String value) {
String retour = null;
if (field.getRawValue().equals("")) {
field.setValue(null);
} else if (getStore().findModel("nom", field.getRawValue()) == null) {
String contenuBrut = field.getRawValue();
field.setValue(null);
field.setRawValue(contenuBrut);
retour = Mediateur.i18nC.selectionnerValeurOuNull();
}
return retour;
}
});
if (codeDeLaliste != null) {
setListeCode(codeDeLaliste);
mediateur.obtenirListeValeurEtRafraichir(this, getListeCode(), null);
}
}
public String getListeCode() {
return listeValeursCode;
}
public void setListeCode(String code) {
listeValeursCode = code;
}
public String getValeur() {
String valeur = "";
if (getValue() != null) {
valeur = getValue().getId();
}
return valeur;
}
public void peupler(String valeur) {
if (valeur.matches("[0-9]+")) {
valeurDefautId = valeur;
actualiserValeurParDefaut();
} else {
setRawValue(valeur);
}
}
public String getTrie() {
String champATrier = "nom";
if (nomChampATrier != null) {
champATrier = nomChampATrier;
}
return champATrier;
}
 
/**
* Définit le nom du champ selon lequel trier, et si trierJusteApres vaut true, trie
* @param champATrier
*/
public void setTrie(String champATrier, boolean trierJusteApres) {
nomChampATrier = champATrier;
if (trierJusteApres) {
trier();
}
}
 
/**
* Définit le nom du champ selon lequel trier, et trie juste après
* @param champATrier
*/
public void setTrie(String champATrier) {
setTrie(champATrier, true);
}
public void actualiserValeurParDefaut() {
if (valeurDefautId != null && getStore() != null) {
setValue(getStore().findModel("id_valeur", valeurDefautId));
}
}
 
/**
* Trie le contenu de la comboboîte selon le nomChampATrier défini. S'il n'y en a aucun, échoue silencieusement (niark niark)
*/
public void trier() {
if (! this.nomChampATrier.isEmpty()) {
this.getStore().sort(this.nomChampATrier, SortDir.ASC);
}
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
if (listeValeurs.getId().equals(config.getListeId(getListeCode()))) {
Formulaire.rafraichirComboBox(listeValeurs, this, getTrie());
actualiserValeurParDefaut();
}
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
}
 
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/ChampComboBoxListeValeurs.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/ChampComboBoxListeValeurs.java:r1136-1367
Merged /trunk/src/org/tela_botanica/client/composants/ChampComboBoxListeValeurs.java:r11-853,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/HashMapComposants.java
New file
0,0 → 1,72
package org.tela_botanica.client.composants;
 
import java.util.HashMap;
 
import org.tela_botanica.client.modeles.Valeur;
 
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.form.Radio;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
 
public class HashMapComposants extends HashMap<Object, Object> {
 
private static final long serialVersionUID = -3087869118215860287L;
 
@SuppressWarnings("unchecked")
public TextField getTextField(String name) {
return (TextField) get(name);
}
public DateField getDateField(String name) {
return (DateField) get(name);
}
public LabelField getLabelField(String name) {
return (LabelField) get(name);
}
public ChampMultiValeurs getChampMultiValeurs(String name) {
return (ChampMultiValeurs) get(name);
}
public ChampMultiValeursPaginable getChampMultiValeursPaginable(String name) {
return (ChampMultiValeursPaginable) get(name);
}
public ChampMultiValeursMultiTypes getChampMultiValeursMultiTypes(String name) {
return (ChampMultiValeursMultiTypes) get(name);
}
public ChampMultiValeursMultiTypesPaginable getChampMultiValeursMultiTypesPaginable(String name) {
return (ChampMultiValeursMultiTypesPaginable) get(name);
}
public ChampMultiValeursImage getChampMultiValeursImage(String name) {
return (ChampMultiValeursImage) get(name);
}
public Radio getRadio(String name) {
return (Radio) get(name);
}
public TextArea getTextArea(String name) {
return (TextArea) get(name);
}
@SuppressWarnings("unchecked")
public ComboBox<Valeur> getComboBoxValeur(String nom) {
return (ComboBox<Valeur>) get(nom);
}
@SuppressWarnings("unchecked")
public ComboBox getComboBox(String nom) {
return (ComboBox) get(nom);
}
public ChampComboBoxRechercheTempsReelPaginable getComboBoxRechercheTempsReelPaginable(String nom) {
return (ChampComboBoxRechercheTempsReelPaginable) get(nom);
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/composants/HashMapComposants.java:r11-969,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/HashMapComposants.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/HashMapComposants.java:r1136-1367
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/ChampSliderPourcentage.java
New file
0,0 → 1,52
package org.tela_botanica.client.composants;
 
import org.tela_botanica.client.util.UtilNombre;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SliderEvent;
import com.extjs.gxt.ui.client.widget.Slider;
import com.extjs.gxt.ui.client.widget.form.SliderField;
 
public class ChampSliderPourcentage extends SliderField {
private String message = null;
public ChampSliderPourcentage(String label) {
super(creerSliderPoucentage(label));
message = label;
this.getSlider().addListener(Events.Change, new Listener<SliderEvent>() {
public void handleEvent(SliderEvent be) {
int pourcent = ((Slider) be.getComponent()).getValue();
setFieldLabel(message+" ("+pourcent+"%) ");
}
});
this.setFieldLabel(message);
}
private static Slider creerSliderPoucentage(String message) {
Slider slider = new Slider();
slider.setMinValue(0);
slider.setMaxValue(100);
slider.setValue(0);
slider.setIncrement(1);
slider.setMessage("{0} "+message);
return slider;
}
public String getValeur() {
String valeur = "";
int pourcentage = getSlider().getValue();
if (pourcentage != 0) {
valeur = UtilNombre.formaterEnEntier(pourcentage);
}
return valeur;
}
public void peupler(String valeur) {
if (!UtilString.isEmpty(valeur)) {
setValue(UtilString.formaterEnEntier(valeur));
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/composants/ChampSliderPourcentage.java:r11-857,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/ChampSliderPourcentage.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/ChampSliderPourcentage.java:r1136-1367
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/InfoLogger.java
New file
0,0 → 1,43
package org.tela_botanica.client.composants;
import java.util.Vector;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.vues.FenetreJournal;
import org.tela_botanica.client.vues.StatutVue;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.fx.FxConfig;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.InfoConfig;
 
public class InfoLogger {
/**
* La méthode permet de logger dans la fenêtre journal le message affiché.
* */
public static void display(String title, String text) {
Info.display(title, text);
InfoConfig info = new InfoConfig(title, text);
((Mediateur) Registry.get(RegistreId.MEDIATEUR)).obtenirFenetreJournal().rafraichir(info);
}
public static void display(String title, String text, boolean estErreur) {
Info.display(title, text);
InfoConfig info = new InfoConfig(title, text);
((Mediateur) Registry.get(RegistreId.MEDIATEUR)).obtenirFenetreJournal().rafraichir(info);
}
/**
* Displays a message using the specified config.
*
* @param config the info config
*/
/* public static void display(InfoConfig config, boolean estErreur) {
StatutVue panneauSud = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).obtenirPanneauSud();
panneauSud.afficherMessage(config);
if (estErreur) {
panneauSud.afficherErreur();
}
}*/
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/composants/InfoLogger.java:r11-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/InfoLogger.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/InfoLogger.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/ChampNombre.java
New file
0,0 → 1,73
package org.tela_botanica.client.composants;
 
import java.util.List;
 
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.FieldEvent;
import com.extjs.gxt.ui.client.widget.form.NumberField;
import com.google.gwt.event.dom.client.KeyCodes;
 
/**
* Un bug dans le champ NumberField originel empêche la saisie de nombres sous
* certaines versions de firefox, d'où la présence de cette classe
*
*/
public class ChampNombre extends NumberField {
public int lastKeyCode;
public List<Character> allowed;
@Override
protected void onKeyDown( FieldEvent fe )
{
super.onKeyDown( fe ) ;
int keyCode = fe.getKeyCode( ) ;
 
if( keyCode == 0 )
{
keyCode = fe.getEvent( ).getCharCode( ) ;
}
 
_setLastKeyCode( keyCode ) ;
}
 
@Override
protected void onKeyPress( FieldEvent fe )
{
fireEvent( Events.KeyPress, new FieldEvent( this, fe.getEvent( ) ) ) ;
 
int keyCode = fe.getKeyCode( ) ;
 
char key = ( char )keyCode ;
 
if( keyCode == 0 )
{
key = ( char )fe.getEvent( ).getCharCode( ) ;
}
 
if( fe.isSpecialKey( _getLastKeyCode( ) )
|| _getLastKeyCode( ) == KeyCodes.KEY_BACKSPACE
|| _getLastKeyCode( ) == KeyCodes.KEY_DELETE
|| fe.isControlKey( ) )
{
return ;
}
 
if( !_getAllowed( ).contains( key ) )
{
fe.stopEvent( ) ;
}
}
 
private native int _getLastKeyCode( ) /*-{
return this.@org.tela_botanica.client.composants.ChampNombre::lastKeyCode ;
}-*/;
 
private native void _setLastKeyCode( int keycode ) /*-{
this.@org.tela_botanica.client.composants.ChampNombre::lastKeyCode = keycode ;
}-*/;
 
private native List<Character> _getAllowed( ) /*-{
return this.@org.tela_botanica.client.composants.ChampNombre::allowed ;
}-*/;
};
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/ChampComboBoxMultiSelect.java
New file
0,0 → 1,1491
package org.tela_botanica.client.composants;
 
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
 
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.GXT;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.core.El;
import com.extjs.gxt.ui.client.core.XDOM;
import com.extjs.gxt.ui.client.core.XTemplate;
import com.extjs.gxt.ui.client.data.BaseModelData;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.PagingLoadConfig;
import com.extjs.gxt.ui.client.data.PagingLoader;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.DomEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.FieldEvent;
import com.extjs.gxt.ui.client.event.ListViewEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.PreviewEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedEvent;
import com.extjs.gxt.ui.client.event.SelectionChangedListener;
import com.extjs.gxt.ui.client.event.SelectionProvider;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.store.StoreEvent;
import com.extjs.gxt.ui.client.store.StoreListener;
import com.extjs.gxt.ui.client.util.BaseEventPreview;
import com.extjs.gxt.ui.client.util.DelayedTask;
import com.extjs.gxt.ui.client.util.KeyNav;
import com.extjs.gxt.ui.client.util.Util;
import com.extjs.gxt.ui.client.widget.CheckBoxListView;
import com.extjs.gxt.ui.client.widget.ComponentHelper;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.ListView;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.ListModelPropertyEditor;
import com.extjs.gxt.ui.client.widget.form.PropertyEditor;
import com.extjs.gxt.ui.client.widget.form.TriggerField;
import com.extjs.gxt.ui.client.widget.form.ComboBox.ComboBoxMessages;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.form.TextField.TextFieldMessages;
import com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.InputElement;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.RootPanel;
 
 
public class ChampComboBoxMultiSelect<D extends ModelData> extends TriggerField<D> implements SelectionProvider<D> {
 
/**
* ComboBox error messages.
*/
public class ComboBoxMessages extends TextFieldMessages {
 
private String loadingText = GXT.MESSAGES.loadMask_msg();
private String valueNoutFoundText;
 
/**
* Returns the loading text.
*
* @return the loading text
*/
public String getLoadingText() {
return loadingText;
}
 
/**
* Returns the value not found error text.
*
* @return the error text
*/
public String getValueNoutFoundText() {
return valueNoutFoundText;
}
 
/**
* Sets the loading text.
*
* @param loadingText the loading text
*/
public void setLoadingText(String loadingText) {
this.loadingText = loadingText;
}
 
/**
* When using a name/value combo, if the value passed to setValue is not
* found in the store, valueNotFoundText will be displayed as the field text
* if defined.
*
* @param valueNoutFoundText
*/
public void setValueNoutFoundText(String valueNoutFoundText) {
this.valueNoutFoundText = valueNoutFoundText;
}
 
}
 
/**
* TriggerAction enum.
*/
public enum TriggerAction {
ALL, QUERY;
}
 
protected boolean autoComplete = false;
protected boolean delayedCheck;
protected String lastQuery;
 
protected ListStore<D> store;
private String allQuery = "";
private BaseEventPreview eventPreview;
private boolean expanded;
private El footer;
private boolean forceSelection;
private InputElement hiddenInput;
private String itemSelector;
private String lastSelectionText;
private boolean lazyRender = true, initialized;
private LayoutContainer list;
private String listAlign = "tl-bl?";
private String listStyle = "x-combo-list";
private int maxHeight = 300;
private int minChars = 4;
private int minListWidth = 70;
private String mode = "remote";
private int pageSize;
private PagingToolBar pageTb;
private int queryDelay = 500;
private D selectedItem;
private String selectedStyle = "x-combo-selected";
private StoreListener<D> storeListener;
private DelayedTask taTask, dqTask;
private XTemplate template;
private TriggerAction triggerAction = TriggerAction.QUERY;
private boolean typeAhead;
private int typeAheadDelay = 250;
private boolean useQueryCache = true;
private String valueField;
//+----------------------------------------------------------------------------------------------------------------+
// Attributs modifiés ou ajoutés
private CheckBoxListView<D> listView = null;
private String valueFieldSeparator = aDonnee.SEPARATEUR_VALEURS;
private String rawSeparator = ", ";
private List<D> listeInitiale = new ArrayList<D>();
private boolean initialisation = false;
private boolean premierAppel = true;
//+----------------------------------------------------------------------------------------------------------------+
//+----------------------------------------------------------------------------------------------------------------+
// Constructeur modifiés
public ChampComboBoxMultiSelect() {
messages = new ComboBoxMessages();
listView = new CheckBoxListView<D>();
setPropertyEditor(new ListModelPropertyEditor<D>());
monitorWindowResize = true;
windowResizeDelay = 0;
initComponent();
setTriggerAction(TriggerAction.ALL);
}
//+----------------------------------------------------------------------------------------------------------------+
 
public void addSelectionChangedListener(SelectionChangedListener<D> listener) {
addListener(Events.SelectionChange, listener);
}
 
@Override
public void clear() {
getStore().clearFilters();
boolean f = forceSelection;
forceSelection = false;
super.clear();
forceSelection = f;
}
 
/**
* Clears any text/value currently set in the field.
*/
public void clearSelections() {
setRawValue("");
lastSelectionText = "";
applyEmptyText();
value = null;
}
/**
* Execute a query to filter the dropdown list. Fires the BeforeQuery event
* prior to performing the query allowing the query action to be canceled if
* needed.
*
* @param q the query
* @param forceAll true to force the query to execute even if there are
* currently fewer characters in the field than the minimum specified
* by the minChars config option. It also clears any filter
* previously saved in the current store
*/
public void doQuery(String q, boolean forceAll) {
if (q == null) {
q = "";
}
 
FieldEvent fe = new FieldEvent(this);
fe.setValue(q);
if (!fireEvent(Events.BeforeQuery, fe)) {
return;
}
 
if (forceAll || q.length() >= minChars) {
if (!useQueryCache || !q.equals(lastQuery)) {
lastQuery = q;
if (mode.equals("local")) {
selectedItem = null;
store.filter(getDisplayField(), q);
onLoad(null);
} else {
expand();
store.getLoader().load(getParams(q));
}
} else {
selectedItem = null;
onLoad(null);
}
}
}
 
/**
* Returns the all query.
*
* @return the all query
*/
public String getAllQuery() {
return allQuery;
}
 
/**
* Returns the display field.
*
* @return the display field
*/
public String getDisplayField() {
return getPropertyEditor().getDisplayProperty();
}
 
/**
* Returns true if the field's value is forced to one of the value in the
* list.
*
* @return the force selection state
*/
public boolean getForceSelection() {
return forceSelection;
}
 
/**
* Returns the item selector.
*
* @return the item selector
*/
public String getItemSelector() {
return itemSelector;
}
 
/**
* Returns the list's list align value.
*
* @return the list align value
*/
public String getListAlign() {
return listAlign;
}
 
/**
* Returns the list style.
*
* @return the list style
*/
public String getListStyle() {
return listStyle;
}
 
/**
* Returns the loading text.
*
* @return the loading text
*/
public String getLoadingText() {
return getMessages().getLoadingText();
}
 
/**
* Returns the dropdown list's max height.
*
* @return the max height
*/
public int getMaxHeight() {
return maxHeight;
}
 
@Override
public ComboBoxMessages getMessages() {
return (ComboBoxMessages) messages;
}
 
/**
* Returns the min characters used for autocompete and typeahead.
*
* @return the minimum number of characters
*/
public int getMinChars() {
return minChars;
}
 
/**
* Returns the dropdown list's min width.
*
* @return the min width
*/
public int getMinListWidth() {
return minListWidth;
}
 
/**
* Returns the page size.
*
* @return the page size
*/
public int getPageSize() {
return pageSize;
}
 
/**
* Returns the combo's paging tool bar.
*
* @return the tool bar
*/
public PagingToolBar getPagingToolBar() {
return pageTb;
}
 
@Override
public ListModelPropertyEditor<D> getPropertyEditor() {
return (ListModelPropertyEditor<D>) propertyEditor;
}
 
/**
* Returns the query delay.
*
* @return the query delay
*/
public int getQueryDelay() {
return queryDelay;
}
 
/**
* Returns the selected style.
*
* @return the selected style
*/
public String getSelectedStyle() {
return selectedStyle;
}
 
/**
* Returns the combo's store.
*
* @return the store
*/
public ListStore<D> getStore() {
return store;
}
 
/**
* Returns the custom template.
*
* @return the template
*/
public XTemplate getTemplate() {
return template;
}
 
/**
* Returns the trigger action.
*
* @return the trigger action
*/
public TriggerAction getTriggerAction() {
return triggerAction;
}
 
/**
* Returns the type ahead delay in milliseconds.
*
* @return the type ahead delay
*/
public int getTypeAheadDelay() {
return typeAheadDelay;
}
 
/**
* Returns the value field name.
*
* @return the value field name
*/
public String getValueField() {
return valueField;
}
 
 
 
/**
* Returns <code>true</code> if the panel is expanded.
*
* @return the expand state
*/
public boolean isExpanded() {
return expanded;
}
 
/**
* Returns true if lazy rendering is enabled.
*
* @return true of lazy rendering
*/
public boolean isLazyRender() {
return lazyRender;
}
 
/**
* Returns true if type ahead is enabled.
*
* @return the type ahead state
*/
public boolean isTypeAhead() {
return typeAhead;
}
 
/**
* Returns the state if the query cache is used or not.
*
* @return the useQueryCache state
*/
public boolean isUseQueryCache() {
return useQueryCache;
}
 
public void removeSelectionListener(SelectionChangedListener<D> listener) {
removeListener(Events.SelectionChange, listener);
}
 
@Override
public void reset() {
getStore().clearFilters();
boolean f = forceSelection;
forceSelection = false;
super.reset();
forceSelection = f;
}
 
public void select(D sel) {
if (listView != null && sel != null) {
int index = store.indexOf(sel);
selectedItem = sel;
if (index < listView.getElements().size()) {
listView.getSelectionModel().select(sel, false);
fly(listView.getElement(index)).scrollIntoView(listView.getElement(), false);
}
}
}
 
/**
* Select an item in the dropdown list by its numeric index in the list. This
* function does NOT cause the select event to fire. The list must expanded
* for this function to work, otherwise use #setValue.
*
* @param index the index of the item to select
*/
public void select(int index) {
select(store.getAt(index));
}
 
/**
* The text query to send to the server to return all records for the list
* with no filtering (defaults to '').
*
* @param allQuery the all query
*/
public void setAllQuery(String allQuery) {
this.allQuery = allQuery;
}
 
/**
* The underlying data field name to bind to this ComboBox (defaults to
* 'text').
*
* @param displayField the display field
*/
public void setDisplayField(String displayField) {
getPropertyEditor().setDisplayProperty(displayField);
}
 
/**
* Sets the panel's expand state.
*
* @param expand <code>true<code> true to expand
*/
public void setExpanded(boolean expand) {
this.expanded = expand;
if (isRendered()) {
if (expand) {
expand();
} else {
collapse();
}
}
}
 
/**
* Sets whether the combo's value is restricted to one of the values in the
* list, false to allow the user to set arbitrary text into the field
* (defaults to false).
*
* @param forceSelection true to force selection
*/
public void setForceSelection(boolean forceSelection) {
this.forceSelection = forceSelection;
}
 
/**
* This setting is required if a custom XTemplate has been specified.
*
* @param itemSelector the item selector
*/
public void setItemSelector(String itemSelector) {
this.itemSelector = itemSelector;
}
 
/**
* True to lazily render the combo's drop down list (default to true,
* pre-render).
*
* @param lazyRender true to lazy render the drop down list
*/
public void setLazyRender(boolean lazyRender) {
this.lazyRender = lazyRender;
}
 
/**
* Sets a valid anchor position value. See {@link El#alignTo} for details on
* supported anchor positions (defaults to 'tl-bl?').
*
* @param listAlign the new list align value
*/
public void setListAlign(String listAlign) {
this.listAlign = listAlign;
}
 
/**
* Sets the style for the drop down list (defaults to 'x-combo-list');
*
* @param listStyle the list style
*/
public void setListStyle(String listStyle) {
this.listStyle = listStyle;
}
 
/**
* Sets the loading text.
*
* @param loadingText the loading text
*/
public void setLoadingText(String loadingText) {
getMessages().setLoadingText(loadingText);
}
 
/**
* Sets the maximum height in pixels of the dropdown list before scrollbars
* are shown (defaults to 300).
*
* @param maxHeight the max hieght
*/
public void setMaxHeight(int maxHeight) {
this.maxHeight = maxHeight;
}
 
/**
* Sets the minimum number of characters the user must type before
* autocomplete and typeahead active (defaults to 4 if remote, or 0 if local).
*
* @param minChars
*/
public void setMinChars(int minChars) {
this.minChars = minChars;
}
 
/**
* Sets the minimum width of the dropdown list in pixels (defaults to 70, will
* be ignored if listWidth has a higher value).
*
* @param minListWidth the min width
*/
public void setMinListWidth(int minListWidth) {
this.minListWidth = minListWidth;
}
 
/**
* Sets the page size. Only applies when using a paging toolbar.
*
* @param pageSize the page size
*/
public void setPageSize(int pageSize) {
assertPreRender();
this.pageSize = pageSize;
if (pageSize > 0) {
if (pageTb != null) {
pageTb.setPageSize(pageSize);
} else {
pageTb = new PagingToolBar(pageSize);
}
} else {
pageTb = null;
}
}
 
@Override
public void setPropertyEditor(PropertyEditor<D> propertyEditor) {
assert propertyEditor instanceof ListModelPropertyEditor<?> : "PropertyEditor must be a ListModelPropertyEditor instance";
super.setPropertyEditor(propertyEditor);
}
 
/**
* The length of time in milliseconds to delay between the start of typing and
* sending the query to filter the dropdown list.
*
* @param queryDelay the query delay
*/
public void setQueryDelay(int queryDelay) {
this.queryDelay = queryDelay;
}
 
@Override
public void setRawValue(String text) {
if (rendered) {
if (text == null) {
String msg = getMessages().getValueNoutFoundText();
text = msg != null ? msg : "";
}
getInputEl().setValue(text);
}
}
 
/**
* Sets the CSS style name to apply to the selected item in the dropdown list
* (defaults to 'x-combo-selected').
*
* @param selectedStyle the selected style
*/
public void setSelectedStyle(String selectedStyle) {
this.selectedStyle = selectedStyle;
}
 
/**
* Sets the template fragment to be used for the text of each combo list item.
*
* <pre>
*
* &lt;code&gt; combo.setSimpleTemplate(&quot;{abbr} {name}&quot;); &lt;/code&gt;
*
* </pre>
*
* @param html the html used only for the text of each item in the list
*/
public void setSimpleTemplate(String html) {
assertPreRender();
html = "<tpl for=\".\"><div class=x-combo-list-item>" + html + "</div></tpl>";
template = XTemplate.create(html);
}
 
/**
* Sets the combo's store.
*
* @param store the store
*/
public void setStore(ListStore<D> store) {
this.store = store;
}
 
/**
* Sets the custom template used to render the combo's drop down list.Use this
* to create custom UI layouts for items in the list.
* <p>
* If you wish to preserve the default visual look of list items, add the CSS
* class name 'x-combo-list-item' to the template's container element.
*
* @param html the html
*/
public void setTemplate(String html) {
assertPreRender();
template = XTemplate.create(html);
}
 
/**
* Sets the custom template used to render the combo's drop down list.
*
* @param template the template
*/
public void setTemplate(XTemplate template) {
assertPreRender();
this.template = template;
}
 
/**
* The action to execute when the trigger field is activated. Use
* {@link TriggerAction#ALL} to run the query specified by the allQuery config
* option (defaults to {@link TriggerAction#QUERY}).
*
* @param triggerAction the trigger action
*/
public void setTriggerAction(TriggerAction triggerAction) {
this.triggerAction = triggerAction;
}
 
/**
* True to populate and autoselect the remainder of the text being typed after
* a configurable delay ({@link #typeAheadDelay}) if it matches a known value
* (defaults to false)
*
* @param typeAhead
*/
public void setTypeAhead(boolean typeAhead) {
this.typeAhead = typeAhead;
if (rendered) {
if (typeAhead && taTask == null) {
taTask = new DelayedTask(new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
onTypeAhead();
}
});
} else if (!typeAhead && taTask != null) {
taTask.cancel();
taTask = null;
}
}
}
 
/**
* The length of time in milliseconds to wait until the typeahead text is
* displayed if typeAhead = true (defaults to 250).
*
* @param typeAheadDelay the type ahead delay
*/
public void setTypeAheadDelay(int typeAheadDelay) {
this.typeAheadDelay = typeAheadDelay;
}
 
/**
* Set this to false to disable the last query cache (defaults to true).
*
* When set to false the store gets queried on each expand for the data that
* should get displayed in the list. If you use a loader, than each time the
* ComboBox gets expanded, the server gets asked for the data.
*
* You want to do this for example, if you filter the content of this ComboBox
* against some selection in another field.
*
* @param useQueryCache the useQueryCache to set
*/
public void setUseQueryCache(boolean useQueryCache) {
this.useQueryCache = useQueryCache;
}
 
/**
* Sets the model field used to retrieve the "value" from the model. If
* specified, a hidden form field will contain the value. The hidden form
* field name will be the combo's field name plus "-hidden".
*
* @param valueField the value field name
*/
public void setValueField(String valueField) {
this.valueField = valueField;
}
 
protected void collapseIf(PreviewEvent pe) {
if (!list.el().isOrHasChild(pe.getTarget()) && !el().isOrHasChild(pe.getTarget())) {
collapse();
}
}
 
protected D findModel(String property, String value) {
if (value == null) return null;
for (D model : store.getModels()) {
if (value.equals(getPropertyEditor().getStringValue(model))) {
return model;
}
}
return null;
}
 
protected void fireKey(FieldEvent fe) {
if (fe.isNavKeyPress() && !isExpanded() && !delayedCheck) {
fireEvent(Events.SpecialKey, fe);
}
}
 
@Override
protected El getFocusEl() {
return input;
}
 
protected PagingLoadConfig getParams(String query) {
BasePagingLoadConfig config = new BasePagingLoadConfig();
config.setLimit(pageSize);
config.setOffset(0);
config.set("query", query);
return config;
}
 
protected boolean hasFocus() {
return hasFocus || expanded;
}
 
@SuppressWarnings("unchecked")
protected void initComponent() {
storeListener = new StoreListener<D>() {
 
@Override
public void storeBeforeDataChanged(StoreEvent<D> se) {
onBeforeLoad(se);
}
 
@Override
public void storeDataChanged(StoreEvent<D> se) {
onLoad(se);
}
 
};
 
eventPreview = new BaseEventPreview() {
@Override
protected boolean onPreview(PreviewEvent pe) {
switch (pe.getType().getEventCode()) {
case Event.ONSCROLL:
case Event.ONMOUSEWHEEL:
case Event.ONMOUSEDOWN:
collapseIf(pe);
}
return true;
}
};
eventPreview.setAutoHide(false);
 
new KeyNav(this) {
public void onDown(ComponentEvent ce) {
ce.cancelBubble();
if (!isExpanded()) {
onTriggerClick(ce);
} else {
selectNext();
}
}
 
@Override
public void onEnter(ComponentEvent ce) {
if (expanded) {
ce.cancelBubble();
onViewClick(ce, false);
delayedCheck = true;
unsetDelayCheck();
}
}
 
@Override
public void onEsc(ComponentEvent ce) {
if (expanded) {
ce.cancelBubble();
collapse();
}
}
 
@Override
public void onTab(ComponentEvent ce) {
if (expanded) {
onViewClick(ce, false);
}
}
 
@Override
public void onUp(ComponentEvent ce) {
if (expanded) {
ce.cancelBubble();
selectPrev();
}
}
 
};
}
 
protected void onBeforeLoad(StoreEvent<D> se) {
if (!hasFocus()) {
return;
}
if (expanded) {
restrict();
}
}
 
@Override
protected void onDetach() {
collapse();
super.onDetach();
if (eventPreview != null) {
eventPreview.remove();
}
}
 
protected void onEmptyResults() {
collapse();
}
 
@Override
protected void onKeyDown(FieldEvent fe) {
if (fe.getKeyCode() == KeyCodes.KEY_TAB) {
if (expanded) {
onViewClick(fe, false);
}
}
super.onKeyDown(fe);
}
 
@Override
protected void onKeyUp(FieldEvent fe) {
super.onKeyUp(fe);
if (isEditable() && (!fe.isSpecialKey() || fe.getKeyCode() == KeyCodes.KEY_BACKSPACE || fe.getKeyCode() == 46)) {
// last key
dqTask.delay(queryDelay);
}
}
 
protected void onLoad(StoreEvent<D> se) {
if (!isAttached() || !hasFocus()) {
return;
}
if (store.getCount() > 0) {
if (expanded) {
restrict();
} else {
expand();
}
 
if (lastQuery != null && lastQuery.equals(allQuery)) {
if (isEditable()) {
selectAll();
}
} else {
if (typeAhead) {
taTask.delay(typeAheadDelay);
}
}
if (!selectByValue(getRawValue())) {
select(0);
}
} else {
onEmptyResults();
}
}
 
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
initList();
 
if (!autoComplete) {
getInputEl().dom.setAttribute("autocomplete", "off");
}
 
if (mode.equals("local")) {
minChars = 0;
}
 
dqTask = new DelayedTask(new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
initQuery();
}
});
 
if (valueField != null) {
hiddenInput = Document.get().createHiddenInputElement().cast();
hiddenInput.setName(getName() + "-hidden");
getElement().appendChild(hiddenInput);
}
 
if (typeAhead) {
taTask = new DelayedTask(new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
onTypeAhead();
}
});
}
eventPreview.getIgnoreList().add(getElement());
}
 
protected void onSelect(D model, int index) {
FieldEvent fe = new FieldEvent(this);
if (fireEvent(Events.BeforeSelect, fe)) {
setValue(model);
collapse();
fireEvent(Events.Select, fe);
}
}
 
protected void onTriggerClick(ComponentEvent ce) {
super.onTriggerClick(ce);
if (expanded) {
collapse();
} else {
onFocus(null);
if (triggerAction == TriggerAction.ALL) {
doQuery(allQuery, true);
} else {
doQuery(getRawValue(), true);
}
 
}
getInputEl().focus();
}
 
protected void onTypeAhead() {
if (store.getCount() > 0) {
D m = store.getAt(0);
String newValue = propertyEditor.getStringValue(m);
int len = newValue.length();
int selStart = getRawValue().length();
if (selStart != len) {
setRawValue(newValue);
select(selStart, newValue.length());
}
}
}
 
protected void onViewClick(DomEvent de, boolean focus) {
int idx = -1;
// when testing in selenium the items will not be selected as the mouse
// is not moved during the test
Element elem = listView.findElement(de.getTarget());
if (elem != null) {
idx = listView.indexOf(elem);
} else {
D sel = listView.getSelectionModel().getSelectedItem();
if (sel != null) {
idx = store.indexOf(sel);
}
}
if (idx != -1) {
D sel = store.getAt(idx);
onSelect(sel, idx);
}
 
if (focus) {
DeferredCommand.addCommand(new Command() {
public void execute() {
focus();
}
});
}
}
 
protected void onWindowResize(int width, int height) {
collapse();
}
 
@Override
protected void triggerBlur(ComponentEvent ce) {
doForce();
super.triggerBlur(ce);
}
 
protected void unsetDelayCheck() {
DeferredCommand.addCommand(new Command() {
public void execute() {
delayedCheck = false;
}
});
}
 
@Override
protected boolean validateBlur(DomEvent e, Element target) {
return list == null || (list != null && !list.isVisible() && !list.getElement().isOrHasChild(target));
}
 
@Override
protected boolean validateValue(String value) {
if (forceSelection) {
boolean f = forceSelection;
forceSelection = false;
if (getValue() == null) {
forceSelection = f;
String rv = getRawValue();
if (getAllowBlank() && (rv == null || rv.equals(""))) {
return true;
}
markInvalid(getMessages().getBlankText());
return false;
}
forceSelection = f;
}
return super.validateValue(value);
}
 
private void createList(boolean remove) {
RootPanel.get().add(list);
initialized = true;
if (remove) {
RootPanel.get().remove(list);
}
}
 
private void initQuery() {
doQuery(getRawValue(), false);
}
 
private void restrict() {
list.el().setVisibility(false);
listView.setHeight("auto");
list.setHeight("auto");
int w = Math.max(getWidth(), minListWidth);
 
int fh = footer != null ? footer.getHeight() : 0;
int fw = list.el().getFrameWidth("tb") + fh;
 
int h = listView.getHeight() + fw;
 
h = Math.min(h, maxHeight - fw);
list.setSize(w, h);
list.el().makePositionable(true);
list.el().alignTo(getElement(), listAlign, null);
 
h -= fh;
 
int width = w - list.el().getFrameWidth("lr");
listView.syncSize();
listView.setSize(width, h - list.el().getFrameWidth("tb"));
 
if (pageTb != null) {
pageTb.setWidth(width);
}
 
int y = list.el().getY();
int b = y + h;
int vh = XDOM.getViewportSize().height + XDOM.getBodyScrollTop();
if (b > vh) {
y = y - (b - vh) - 5;
list.el().setTop(y);
}
list.el().setVisibility(true);
}
 
private boolean selectByValue(String value) {
D r = findModel(getDisplayField(), value);
if (r != null) {
select(r);
return true;
}
return false;
}
 
private void selectNext() {
int count = store.getCount();
if (count > 0) {
int selectedIndex = store.indexOf(selectedItem);
if (selectedIndex == -1) {
select(0);
} else if (selectedIndex < count - 1) {
select(selectedIndex + 1);
}
}
}
 
private void selectPrev() {
int count = store.getCount();
if (count > 0) {
int selectedIndex = store.indexOf(selectedItem);
if (selectedIndex == -1) {
select(0);
} else if (selectedIndex != 0) {
select(selectedIndex - 1);
}
}
}
 
//+--------------------------------------------------------------------------------------------------------------------+
// Méthode modifiées
@Override
public D getValue() {
return (D) new BaseModelData();
}
 
@Override
public void setValue(D value) {
}
public List<D> getSelection() {
List<D> sel = new ArrayList<D>();
if (listeInitiale != null && initialisation == false) {
sel = listeInitiale;
if (listView.isRendered()) {
initialisation = true;
}
} else if (listView.isRendered()) {
sel = listView.getChecked();
}
return sel;
}
public void setSelection(List<D> selection) {
nettoyerListeDeCasesACocher();
for (D d : selection) {
listView.setChecked(d, true);
}
}
 
/**
* Returns the combo's list view.
*
* @return the view
*/
public CheckBoxListView<D> getListView() {
return listView;
}
/**
* Returns the combo's list view.
*
* @return the view
*/
public CheckBoxListView<D> getView() {
return listView;
}
/**
* Sets the combo's view.
*
* @param view the view
*/
public void setView(CheckBoxListView<D> view) {
this.listView = view;
}
public String getRawSeparator() {
return rawSeparator;
}
public void setRawSeparator(String rawSeparator) {
this.rawSeparator = rawSeparator;
}
public void setValueFieldSeparator(String valueFieldSeparator) {
this.valueFieldSeparator = valueFieldSeparator;
}
public String getValueFieldSeparator() {
return valueFieldSeparator;
}
/**
* Hides the dropdown list if it is currently expanded. Fires the
* <i>Collapse</i> event on completion.
*/
public void collapse() {
if (!expanded) {
return;
}
eventPreview.remove();
expanded = false;
list.hide();
RootPanel.get().remove(list);
fireEvent(Events.Collapse, new FieldEvent(this));
mettreAJour("collapse");
}
/**
* Expands the dropdown list if it is currently hidden. Fires the
* <i>expand</i> event on completion.
*/
public void expand() {
if (expanded || !hasFocus) {
return;
}
expanded = true;
if (!initialized) {
createList(false);
} else {
RootPanel.get().add(list);
}
list.show();
list.layout();
list.el().updateZIndex(0);
restrict();
 
eventPreview.add();
 
fireEvent(Events.Expand, new FieldEvent(this));
if (premierAppel) {
premierAppel = false;
collapse();
expand();
}
}
 
protected void initList() {
if (listView == null) {
setView(new CheckBoxListView<D>());
}
 
String style = getListStyle();
listView.setStyleAttribute("overflowX", "hidden");
listView.setStyleName(style + "-inner");
listView.setStyleAttribute("padding", "0px");
listView.setSelectOnOver(true);
listView.setBorders(false);
listView.setStyleAttribute("backgroundColor", "white");
listView.setSelectStyle(getSelectedStyle());
listView.setLoadingText(getLoadingText());
if (getTemplate() == null) {
listView.setDisplayProperty(getDisplayField());
} else {
listView.setTemplate(getTemplate());
}
setMaxHeight(0);
 
list = new LayoutContainer() {
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
eventPreview.getIgnoreList().add(getElement());
}
};
list.setScrollMode(Scroll.NONE);
list.setShim(true);
list.setShadow(true);
list.setBorders(true);
list.setStyleName(style);
list.hide();
assert store != null : "ComboBox needs a store";
 
list.add(listView);
listView.show();
if (!lazyRender) {
createList(true);
}
bindStore(store, true);
};
protected void doForce() {}
private void bindStore(ListStore<D> store, boolean initial) {
if (this.store != null && !initial) {
this.store.removeStoreListener(storeListener);
if (store == null) {
this.store = null;
if (listView != null) {
listView.setStore(null);
}
}
}
if (store != null) {
this.store = store;
if (store.getLoader() == null) {
mode = "local";
}
if (listView != null) {
listView.setStore(store);
}
store.addStoreListener(storeListener);
}
}
private void updateHiddenValue() {
if (hiddenInput != null) {
hiddenInput.setValue(collecterIdentifiants());
}
}
 
private void mettreAJour(String origine) {
setSelection(getSelection());
setRawValue(collecterTexte());
updateHiddenValue();
}
private void nettoyerListeDeCasesACocher() {
if (listView.isRendered()) {
List<D> listeADecocher = listView.getChecked();
for (D d : listeADecocher) {
listView.setChecked(d, false);
}
}
}
public void peupler(String identifiants) {
peuplerAvecIdentifiant(identifiants);
}
public void peuplerAvecIdentifiant(String identifiants) {
List<D> liste = parserChaine(identifiants, valueFieldSeparator, getValueField());
executerPeuplement(liste);
}
public void peuplerAvecTexte(String texte) {
List<D> liste = parserChaine(texte, rawSeparator, getDisplayField());
executerPeuplement(liste);
}
private void executerPeuplement(List<D> liste) {
listeInitiale = liste;
initialisation = false;
mettreAJour("executerPeuplement");
}
public String collecter() {
return collecterIdentifiants();
}
public String collecterIdentifiants() {
return executerCollecte(getSelection(), getValueField(), valueFieldSeparator);
}
public String collecterTexte() {
return executerCollecte(getSelection(), getDisplayField(), rawSeparator);
}
private String executerCollecte(List<D> selection, String champCle, String separateur) {
String chaineDeSortie = "";
Iterator<D> it = selection.iterator();
while (it.hasNext()) {
D d = it.next();
chaineDeSortie += d.get(champCle);
if (it.hasNext()) {
chaineDeSortie += separateur;
}
}
return chaineDeSortie;
}
private List<D> parserChaine(String chaineAAnalyser, String separateur, String champCle) {
ArrayList<D> liste = new ArrayList<D>();
chaineAAnalyser = chaineAAnalyser.trim();
if (!UtilString.isEmpty(chaineAAnalyser)) {
String[] valeurs = chaineAAnalyser.split(separateur);
int nbreValeurs = valeurs.length;
if (nbreValeurs > 0 && getStore() != null) {
for (int i = 0; i < nbreValeurs; i++) {
String valeur = valeurs[i];
D d = getStore().findModel(champCle, valeur);
liste.add(d);
}
}
}
return liste;
}
public String formaterTexteEnIdentifiants(String texte) {
List<D> liste = parserChaine(texte, rawSeparator, getDisplayField());
return executerCollecte(liste, getValueField(), valueFieldSeparator);
}
public String formaterIdentifiantsEnTexte(String identifiants) {
List<D> liste = parserChaine(identifiants, valueFieldSeparator, getValueField());
return executerCollecte(liste, getDisplayField(), rawSeparator);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/ChampComboBoxMultiSelect.java:r1136-1367
Merged /trunk/src/org/tela_botanica/client/composants/ChampComboBoxMultiSelect.java:r11-1028,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/ChampComboBoxMultiSelect.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/AproposFenetre.java
New file
0,0 → 1,201
package org.tela_botanica.client.composants;
 
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.images.Images;
 
import com.extjs.gxt.ui.client.GXT;
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.util.Params;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.HtmlContainer;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.layout.FitData;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.google.gwt.core.client.GWT;
 
public class AproposFenetre extends Window {
private Constantes i18nC = null;
private String aproposTpl = null;
private Params aproposParams = null;
private String contributeurTpl = null;
private Params contributeurParams = null;
private String licenceTpl = null;
private Params licenceParams = null;
public AproposFenetre() {
i18nC = Mediateur.i18nC;
setSize(600, 500);
setPlain(true);
setHeadingHtml(i18nC.aproposTitre());
setIcon(Images.ICONES.information());
setLayout(new FitLayout());
initialiserSquelettes();
initialiserParams();
HtmlContainer aproposConteneurDuHtml = formaterSquelette(aproposTpl, aproposParams);
HtmlContainer contributeurConteneurDuHtml = formaterSquelette(contributeurTpl, contributeurParams);
HtmlContainer licenceConteneurDuHtml = formaterSquelette(licenceTpl, licenceParams);
TabPanel aproposOnglets = new TabPanel();
TabItem aproposOnglet = new TabItem(i18nC.aproposTitre());
aproposOnglet.add(aproposConteneurDuHtml);
aproposOnglet.setBorders(false);
aproposOnglet.setScrollMode(Scroll.AUTO);
aproposOnglets.add(aproposOnglet);
TabItem contributeurOnglet = new TabItem(i18nC.aproposTitreContributeur());
contributeurOnglet.add(contributeurConteneurDuHtml);
contributeurOnglet.setBorders(false);
contributeurOnglet.setScrollMode(Scroll.AUTO);
aproposOnglets.add(contributeurOnglet);
TabItem licenceOnglet = new TabItem(i18nC.aproposTitreLicence());
licenceOnglet.add(licenceConteneurDuHtml);
licenceOnglet.setBorders(false);
licenceOnglet.setScrollMode(Scroll.AUTO);
aproposOnglets.add(licenceOnglet);
add(aproposOnglets, new FitData(4));
}
private HtmlContainer formaterSquelette(String squelette, Params parametres) {
ajouterParametreParDefaut(parametres);
String html = Format.substitute(squelette, parametres);
HtmlContainer conteneurDuHtml = new HtmlContainer(html);
return conteneurDuHtml;
}
private void ajouterParametreParDefaut(Params parametres) {
parametres.set("css_label", ComposantClass.LABEL);
parametres.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
parametres.set("label_separateur", " :");
}
private void initialiserSquelettes() {
initialiserSqueletteApropos();
initialiserSqueletteContributeur();
initialiserSqueletteLicence();
}
private void initialiserSqueletteApropos() {
aproposTpl =
"<div class='{css_corps}'>"+
" <h2>{appli_nom}</h2>"+
" <p>"+
" <span class='{css_label}'>{i18n_code}{label_separateur}</span> {code}<br />"+
" <span class='{css_label}'>{i18n_version}{label_separateur}</span> {version}<br />"+
" <span class='{css_label}'>{i18n_version_nom}{label_separateur}</span> {version_nom}<br />"+
" <span class='{css_label}'>{i18n_revision}{label_separateur}</span> {revision}<br />"+
" <span class='{css_label}'>{i18n_revision_services}{label_separateur}</span> {revision_services}<br />"+
" <span class='{css_label}'>{i18n_licence}{label_separateur}</span> {licence}"+
" </p>"+
" <hr />"+
" <h2>{i18n_titre_compilation}</h2>"+
" <p>"+
" <span class='{css_label}'>{i18n_compilation_date}{label_separateur}</span> {compilation_date}<br />"+
" <span class='{css_label}'>{i18n_version_java}{label_separateur}</span> {version_java}"+
" </p>"+
" <hr />"+
" <h2>{i18n_titre_framework}</h2>"+
" <p>"+
" <span class='{css_label}'>{i18n_gwt}{label_separateur}</span> {gwt}<br />"+
" <span class='{css_label}'>{i18n_gxt}{label_separateur}</span> {gxt}"+
" </p>"+
" <hr />"+
" <h2>{i18n_titre_navigateur}</h2>"+
" <p>"+
" <span class='{css_label}'>{i18n_navigateur}{label_separateur}</span> {navigateur}<br />"+
" </p>"+
"</div>";
}
private void initialiserSqueletteContributeur() {
contributeurTpl =
"<div class='{css_corps}'>"+
" <h2>{i18n_titre_contributeur}</h2>"+
" <p>"+
" <span class='{css_label}'>{i18n_developpeur}{label_separateur}</span> {developpeur}<br />"+
" <span class='{css_label}'>{i18n_traducteur}{label_separateur}</span> {traducteur}<br />"+
" <span class='{css_label}'>{i18n_testeur}{label_separateur}</span> {testeur}"+
" </p>"+
"</div>";
}
private void initialiserSqueletteLicence() {
licenceTpl =
"<div class='{css_corps}'>"+
" <h2>{i18n_titre_licence}</h2>"+
" <div>{licence}</div>"+
"</div>";
}
private void initialiserParams() {
initialiserParamApropos();
initialiserParamContributeur();
initialiserParamLicence();
}
private void initialiserParamApropos() {
aproposParams = new Params();
aproposParams.set("i18n_code", i18nC.aproposCode());
aproposParams.set("i18n_version", i18nC.aproposVersion());
aproposParams.set("i18n_version_nom", i18nC.aproposVersionNom());
aproposParams.set("i18n_revision", i18nC.aproposRevision());
aproposParams.set("i18n_revision_services", i18nC.aproposRevisionServices());
aproposParams.set("i18n_licence", i18nC.aproposLicence());
aproposParams.set("i18n_titre_compilation", i18nC.aproposTitreCompilation());
aproposParams.set("i18n_compilation_date", i18nC.aproposCompilationDate());
aproposParams.set("i18n_version_java", i18nC.aproposVersionJava());
aproposParams.set("i18n_titre_framework", i18nC.aproposTitreFramework());
aproposParams.set("i18n_gwt", i18nC.aproposGwt());
aproposParams.set("i18n_gxt", i18nC.aproposGxt());
aproposParams.set("i18n_titre_navigateur", i18nC.aproposTitreNavigateur());
aproposParams.set("i18n_navigateur", i18nC.aproposNavigateur());
aproposParams.set("appli_nom", (String) Registry.get(RegistreId.APPLI_NOM));
aproposParams.set("code", (String) Registry.get(RegistreId.APPLI_CODE));
aproposParams.set("version", (String) Registry.get(RegistreId.APPLI_VERSION));
aproposParams.set("version_nom", (String) Registry.get(RegistreId.APPLI_VERSION_NOM));
aproposParams.set("revision", (String) Registry.get(RegistreId.APPLI_REVISION));
aproposParams.set("revision_services", (String) Registry.get(RegistreId.SERVICES_REVISION));
aproposParams.set("licence", (String) Registry.get(RegistreId.APPLI_LICENCE));
aproposParams.set("compilation_date", (String) Registry.get(RegistreId.APPLI_COMPILATION_DATE_HEURE));
aproposParams.set("version_java", (String) Registry.get(RegistreId.APPLI_COMPILATION_JAVA_VERSION));
aproposParams.set("gwt", GWT.getVersion());
aproposParams.set("gxt", GXT.getVersion().getRelease());
aproposParams.set("navigateur", GXT.getUserAgent());
}
private void initialiserParamContributeur() {
contributeurParams = new Params();
contributeurParams.set("i18n_titre_contributeur", i18nC.aproposTitreContributeur());
contributeurParams.set("i18n_developpeur", i18nC.aproposDeveloppeur());
contributeurParams.set("i18n_traducteur", i18nC.aproposTraducteur());
contributeurParams.set("i18n_testeur", i18nC.aproposTesteur());
contributeurParams.set("developpeur", (String) Registry.get(RegistreId.APPLI_DEVELOPPEURS));
contributeurParams.set("traducteur", (String) Registry.get(RegistreId.APPLI_TRADUCTEURS));
contributeurParams.set("testeur", (String) Registry.get(RegistreId.APPLI_TESTEURS));
}
private void initialiserParamLicence() {
licenceParams = new Params();
licenceParams.set("i18n_titre_licence", i18nC.aproposTitreLicence());
licenceParams.set("licence", i18nC.licence());
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/AproposFenetre.java:r1136-1367
Merged /trunk/src/org/tela_botanica/client/composants/AproposFenetre.java:r11-1022,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/AproposFenetre.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/GrilleParametrable.java
New file
0,0 → 1,7
package org.tela_botanica.client.composants;
 
public interface GrilleParametrable<D> {
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/IdentificationFenetre.java
New file
0,0 → 1,189
package org.tela_botanica.client.composants;
 
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.KeyListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.util.Params;
import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.HtmlContainer;
import com.extjs.gxt.ui.client.widget.Status;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
import com.google.gwt.event.dom.client.KeyCodes;
 
public class IdentificationFenetre extends Dialog implements Rafraichissable {
private Mediateur mediateur = null;
private Constantes i18nC = null;
protected TextField<String> login = null;
protected TextField<String> motDePasse = null;
protected Button validerBouton = null;
private Button annulerBouton = null;
protected Status status = null;
private String zoneInfoTpl = null;
private HtmlContainer zoneInfoHtml = null;
 
public IdentificationFenetre(Mediateur mediateurCourrant) {
mediateur = mediateurCourrant;
i18nC = Mediateur.i18nC;
initialiserSquelettes();
FormLayout layout = new FormLayout();
layout.setLabelWidth(110);
layout.setDefaultWidth(220);
setLayout(layout);
 
setButtonAlign(HorizontalAlignment.RIGHT);
setButtons("");
setIcon(Images.ICONES.utilisateur());
setHeadingHtml(Registry.get(RegistreId.APPLI_NOM)+" - "+i18nC.identificationTitre());
setModal(true);
setBodyBorder(true);
setBodyStyle("padding: 10px;background: none");
setWidth(450);
setResizable(false);
setAutoWidth(false);
KeyListener keyListener = new KeyListener() {
public void componentKeyUp(ComponentEvent event) {
valider();
}
@SuppressWarnings("unchecked")
public void componentKeyPress(ComponentEvent evenement) {
if (evenement.getKeyCode() == KeyCodes.KEY_ENTER) {
TextField<String> champ = (TextField<String>) evenement.getSource();
if (champ.getFieldLabel().equals(i18nC.motDePasse())) {
validerBouton.fireEvent(Events.Select);
}
}
}
};
 
zoneInfoHtml = new HtmlContainer();
zoneInfoHtml.hide();
add(zoneInfoHtml);
login = new TextField<String>();
login.setMinLength(4);
login.setFieldLabel(i18nC.login());
login.addKeyListener(keyListener);
add(login);
 
motDePasse = new TextField<String>();
motDePasse.setMinLength(4);
motDePasse.setPassword(true);
motDePasse.setFieldLabel(i18nC.motDePasse());
motDePasse.addKeyListener(keyListener);
add(motDePasse);
 
setFocusWidget(login);
}
private void initialiserSquelettes() {
zoneInfoTpl = "<div id='"+ComposantId.DIV_IDENTIFICATION_MSG+"'>{0}</div>";
}
@Override
protected void createButtons() {
super.createButtons();
// FIXME : l'instanciation dans le constructeur ne marche pas pour cette méthode...
i18nC = Mediateur.i18nC;
status = new Status();
status.setBusy(i18nC.identificationVerification());
status.hide();
status.setAutoWidth(true);
getButtonBar().add(status);
getButtonBar().add(new FillToolItem());
validerBouton = new Button(i18nC.valider());
validerBouton.disable(); // Par défaut : dois être en mode disable
validerBouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
onSubmit();
}
});
annulerBouton = new Button(i18nC.annuler());
annulerBouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
hide();
}
});
addButton(annulerBouton);
addButton(validerBouton);
}
 
protected void onSubmit() {
status.show();
getButtonBar().disable();
mediateur.connecterUtilisateur(login.getValue(), motDePasse.getValue());
}
 
protected boolean avoirValeur(TextField<String> field) {
return field.getValue() != null && field.getValue().length() > 0;
}
 
protected void valider() {
validerBouton.setEnabled(avoirValeur(login) && avoirValeur(motDePasse) && motDePasse.getValue().length() > 3);
}
 
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("maj_utilisateur")) {
Utilisateur utilisateurCourant = mediateur.getUtilisateur();
if (!utilisateurCourant.isIdentifie() || !utilisateurCourant.avoirLicenceAcceptee()) {
// Licence n'a jamais été acceptée
if (utilisateurCourant.getLicence().equals("")) {
afficherErreur(i18nC.identificationMauvaise());
// NON à la licence
} else if (utilisateurCourant.getLicence().equals("0")){
afficherErreur(i18nC.licenceAccepter());
mediateur.afficherFenetreLicence(this);
// Cas inconnu
} else {
hide();
}
} else {
hide();
}
}
} else {
Debug.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()));
}
}
public void afficherErreur(String erreur) {
status.hide();
getButtonBar().enable();
valider();
zoneInfoHtml.setHtml(Format.substitute(zoneInfoTpl, (new Params()).add(erreur)));
zoneInfoHtml.show();
layout();
}
 
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/IdentificationFenetre.java:r1136-1367
Merged /trunk/src/org/tela_botanica/client/composants/IdentificationFenetre.java:r11-59,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/IdentificationFenetre.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/ChampMultiValeursMultiTypes.java
New file
0,0 → 1,175
package org.tela_botanica.client.composants;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.vues.Formulaire;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
 
public class ChampMultiValeursMultiTypes extends ChampMultiValeurs implements Rafraichissable {
 
private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
private String idListeType = null;
private String idListeCombo = null;
public ChampMultiValeursMultiTypes() {
super(false, true, null, 0, 0);
}
public ChampMultiValeursMultiTypes(String label) {
super(false, true, label, 0, 0);
}
public ChampMultiValeursMultiTypes(String label, int largeurTotale, int largeurType) {
super(false, true, label, largeurTotale, largeurType);
}
public ChampMultiValeursMultiTypes(String label, int largeurTotale, boolean combobox) {
super(true, true, label, largeurTotale, largeurTotale);
}
public ChampMultiValeursMultiTypes(String label, int largeurTotale, int largeurType, boolean combobox) {
super(true, true, label, largeurTotale, largeurType);
}
public void initialiserType(String idListe) {
initialiserType(idListe, null);
}
public void initialiserType(String idListe, Sequenceur sequenceur) {
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
idListeType = idListe;
mediateur.obtenirListeValeurEtRafraichir(this, idListeType, sequenceur);
}
public void initialiserCombobox(String idListe) {
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
this.idListeCombo = idListe;
mediateur.obtenirListeValeurEtRafraichir(this, idListeCombo, null);
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
if (listeValeurs.getId().equals(config.getListeId(idListeType))) {
Formulaire.rafraichirComboBox(listeValeurs, types);
} else if (listeValeurs.getId().equals(config.getListeId(idListeCombo))) {
Formulaire.rafraichirComboBox(listeValeurs, champValeurCombo, "id_valeur");
}
}
}
public void ajouterValeur(final String texte, final String type, final String id) {
LayoutContainer colonneConteneur = new LayoutContainer();
colonneConteneur.setLayout(new ColumnLayout());
valeurs.put(id + aDonnee.SEPARATEUR_TYPE_VALEUR + texte, colonneConteneur);
Text champType = new Text();
champType.setText(type + " : ");
champType.setWidth(largeurType);
colonneConteneur.add(champType, new ColumnData(largeurType));
// on recupere le nom de la valeur à partir de son id
 
String texteValeur = texte;
if (estComboBox) {
ListStore<Valeur> valeursStore = champValeurCombo.getStore();
Valeur objetValeur = valeursStore.findModel("id_valeur", texte);
if (objetValeur != null) {
texteValeur = objetValeur.getNom();
}
}
Text champValeur = new Text();
champValeur.setText(texteValeur);
champValeur.setWidth(largeurChamp);
colonneConteneur.add(champValeur, new ColumnData(largeurChamp));
Button supprimerBouton = new Button();
supprimerBouton.setIcon(Images.ICONES.supprimer());
supprimerBouton.setText(boutonSupprimerLabel);
supprimerBouton.setData("valeur", id + aDonnee.SEPARATEUR_TYPE_VALEUR + texte);
supprimerBouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
String valeur = ce.getComponent().getData("valeur");
LayoutContainer valeurLayout = valeurs.get(valeur);
principalLayout.remove(valeurLayout);
valeurs.remove(valeur);
supprimerValeurDuRecapitulatif(valeur);
actualiserLayoutGlobal();
}
});
colonneConteneur.add(supprimerBouton, new ColumnData(largeurBouton));
// Ajout du layout de la valeur au layout principal
principalLayout.add(colonneConteneur);
// Ajout de la valeur au champ récapitulatif des valeurs ajoutées
if (estComboBox && champValeurCombo.getValue() != null) {
ajouterValeurAuRecapitulatif(champValeurCombo.getValue().getId(), id);
} else {
ajouterValeurAuRecapitulatif(texte, id);
}
reinitialiserChamp();
actualiserLayoutGlobal();
}
public void ajouterValeurAuRecapitulatif(String texte, String id) {
String texteRecapitulatif = "";
if (champRecapitulatif.getValue() != null) {
texteRecapitulatif = champRecapitulatif.getValue();
}
texteRecapitulatif += id + aDonnee.SEPARATEUR_TYPE_VALEUR + texte + aDonnee.SEPARATEUR_VALEURS;
champRecapitulatif.setValue(texteRecapitulatif);
}
public void peupler(String chaineExistante) {
 
if (valeurs.size() > 0) {
reinitialiser();
}
if (chaineExistante != null && !chaineExistante.trim().equals("")) {
String[] valeurs = chaineExistante.split(aDonnee.SEPARATEUR_VALEURS);
for (int i = 0; i < valeurs.length; i++) {
String[] idEtValeur = valeurs[i].split(aDonnee.SEPARATEUR_TYPE_VALEUR);
if (idEtValeur.length == 2) {
String idType = idEtValeur[0];
String idValeur = idEtValeur[1];
ListStore<Valeur> typeStore = types.getStore();
Valeur objetType = typeStore.findModel("id_valeur", idType);
String texteType = "";
if (objetType != null) {
texteType = objetType.getNom();
} else {
texteType = idType;
}
 
ajouterValeur(idValeur, texteType, idType);
} else {
InfoLogger.display("ChampMultiValeursMultiTypes > méthode peupler", "Erreur dans le split d'une valeur, chaine="+chaineExistante, true);
}
}
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/ChampMultiValeursMultiTypes.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/ChampMultiValeursMultiTypes.java:r1136-1367
Merged /trunk/src/org/tela_botanica/client/composants/ChampMultiValeursMultiTypes.java:r11-720,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/ChampMultiValeurs.java
New file
0,0 → 1,414
package org.tela_botanica.client.composants;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.FieldEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.HiddenField;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
 
public class ChampMultiValeurs extends LayoutContainer {
//TODO : changer le champRecapitulatif par une hashMap
//TODO : autoriser la modification des champs saisis
 
String idChampCache = null;
String nomLabelChampTxt = "";
String titreErreur = null;
String valeurVideMsg = null;
String valeurIdentiqueMsg = null;
String valeurNonValideMsg = null;
String valeurParDefaut = "";
String validationMasque = null;
String exempleValidation = null;
String boutonSupprimerLabel = "";
LayoutContainer principalLayout = null;
Field<String> champValeurTxt = null;
ComboBox<Valeur> champValeurCombo = null;
HiddenField<String> champRecapitulatif = null;
HashMap<String, LayoutContainer> valeurs = null;
ComboBox<Valeur> types = null;
int largeurTotale = 420;
int largeurBouton = 20;
int largeurChamp = 0;
int largeurType = 0;
boolean estMultiType = false;
boolean estComboBox = false;
public ChampMultiValeurs() {
initialiserChampMultiValeur(null, 0);
}
public ChampMultiValeurs(String label) {
initialiserChampMultiValeur(label, 0);
}
public ChampMultiValeurs(String label, int largeurTotale) {
initialiserChampMultiValeur(label, largeurTotale);
}
public ChampMultiValeurs(boolean estMultiType, String label, int largeurTotale, int largeurType) {
this.estMultiType = estMultiType;
initialiserChampMultiValeur(label, largeurTotale);
}
public ChampMultiValeurs(boolean estCombobox, boolean estMultiType, String label, int largeurTotale, int largeurType) {
this.estMultiType = estMultiType;
this.estComboBox = estCombobox;
setLargeurType(largeurType);
initialiserChampMultiValeur(label, largeurTotale);
}
public ComboBox<Valeur> getTypes() {
return this.types;
}
public void setLabel(String label) {
if (label == null) {
label = "";
}
nomLabelChampTxt = label;
}
public void setLargeurChamp(int largeurMax) {
if (largeurMax != 0 && largeurMax > 20) {
largeurTotale = largeurMax;
}
largeurChamp = largeurTotale - largeurBouton;
}
public void setLargeurType(int largeur) {
largeurType = largeur;
}
public void setValidation (String validation, String exempleValidation) {
this.validationMasque = validation;
this.exempleValidation = exempleValidation;
this.valeurNonValideMsg = Mediateur.i18nM.valeurNonValideMsg(exempleValidation);
}
public void setValeurParDefaut(String valeur) {
this.valeurParDefaut = valeur;
champValeurTxt.setValue(valeur);
}
public void setValeurBoutonSupprimer(String valeur) {
this.boutonSupprimerLabel = valeur;
}
private void initialiserChampMultiValeur(String label, int largeur) {
setLabel(label);
setLargeurChamp(largeur);
titreErreur = Mediateur.i18nC.erreurSaisieTitre();
valeurVideMsg = Mediateur.i18nC.demanderValeur();
valeurIdentiqueMsg = Mediateur.i18nC.valeurDejaPresente();
valeurs = new HashMap<String, LayoutContainer>();
champRecapitulatif = new HiddenField<String>();
champRecapitulatif.setValue("");
setLayout(new FormLayout());
creerChampMultiValeurs();
}
private void creerChampMultiValeurs() {
principalLayout = new LayoutContainer();
principalLayout.setLayout(new RowLayout());
LabelField label = new LabelField(nomLabelChampTxt + ":");
label.setWidth("95%");
principalLayout.add(label);
LayoutContainer colonneConteneur = new LayoutContainer();
colonneConteneur.setLayout(new ColumnLayout());
if (estMultiType == true) {
types = new ComboBox<Valeur>();
types.setDisplayField("nom");
types.setEmptyText("Choisissez:");
types.setStore(new ListStore<Valeur>());
types.setTypeAhead(true);
types.setTriggerAction(TriggerAction.ALL);
types.addListener(Events.Select, new Listener<FieldEvent>() {
public void handleEvent(FieldEvent fe) {
 
}
});
colonneConteneur.add(types, new ColumnData(largeurType));
}
if (estComboBox) {
champValeurCombo = new ComboBox<Valeur>();
champValeurCombo.setDisplayField("nom");
champValeurCombo.setStore(new ListStore<Valeur>());
colonneConteneur.add(champValeurCombo, new ColumnData(largeurChamp));
} else {
champValeurTxt = new TextField<String>();
colonneConteneur.add(champValeurTxt, new ColumnData(largeurChamp));
}
Button ajouterBouton = new Button();
ajouterBouton.setIcon(Images.ICONES.ajouter());
ajouterBouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
surAjoutValeur(true);
}
});
colonneConteneur.add(ajouterBouton, new ColumnData(largeurBouton));
principalLayout.add(champRecapitulatif);
principalLayout.add(colonneConteneur);
add(principalLayout);
}
private void surAjoutValeur(boolean validerChamp) {
String valeurChamp = "";
if (estComboBox) {
if (champValeurCombo.getValue() != null) {
valeurChamp = champValeurCombo.getValue().getId();
}
} else {
valeurChamp = champValeurTxt.getValue();
}
if ((valeurChamp == null) || valeurChamp.trim().equals("") || valeurChamp.trim().equals(valeurParDefaut)) {
if(validerChamp) {
MessageBox.alert(titreErreur, valeurVideMsg, null);
}
} else if (valeurs.get(valeurChamp) != null) {
if(validerChamp) {
MessageBox.alert(titreErreur, valeurIdentiqueMsg, null);
}
} else {
if (validationMasque != null && !valeurChamp.matches(validationMasque)) {
if(validerChamp) {
MessageBox.alert(titreErreur, valeurNonValideMsg, null);
}
} else {
if (estMultiType) {
String type = "";
String id = "";
Valeur valeur = types.getValue();
if (valeur != null) {
type = valeur.getNom();
id = valeur.getId();
} else {
type = types.getRawValue();
id = type;
}
if (type.trim().equals("")) {
MessageBox.alert(Mediateur.i18nM.titreErreurSaisie(), Mediateur.i18nM.typeChampMulti(), null);
} else {
ajouterValeur(valeurChamp, type, id);
}
} else {
ajouterValeur(valeurChamp);
}
}
}
}
//TODO: la fonction est valide et la fonction surAjoutValeur ont beaucoup en commun
// voir si on peut les factoriser (ou déplacer les alertes dans les classes appelantes)
public boolean estValide(boolean autoriserVide) {
boolean valide = true;
String valeurChamp = "";
if (estComboBox) {
if (champValeurCombo.getValue() != null) {
valeurChamp = champValeurCombo.getValue().getId();
}
} else {
valeurChamp = champValeurTxt.getValue();
}
if ((valeurChamp == null) || valeurChamp.trim().equals("") || valeurChamp.trim().equals(valeurParDefaut)) {
if(!autoriserVide) {
valide = false;
}
} else if (valeurs.get(valeurChamp) != null) {
if(!autoriserVide) {
valide = false;
}
} else {
if (validationMasque != null && !valeurChamp.matches(validationMasque)) {
valide = false;
} else {
if (estMultiType) {
String type = "";
String id = "";
Valeur valeur = types.getValue();
if (valeur != null) {
type = valeur.getNom();
id = valeur.getId();
} else {
type = types.getRawValue();
id = type;
}
if (type.trim().equals("")) {
valide = false;
}
}
}
}
return valide;
}
public void ajouterValeur(final String texte, final String strValeur, final String id) {
//Implémenté dans classe inférieure
}
public void ajouterValeur(final String texte) {
LayoutContainer colonneLayout = new LayoutContainer();
colonneLayout.setLayout(new ColumnLayout());
valeurs.put(texte, colonneLayout);
Text champTxt = new Text();
champTxt.setText(texte);
colonneLayout.add(champTxt, new ColumnData(largeurChamp));
Button supprimerBouton = new Button();
supprimerBouton.setIcon(Images.ICONES.supprimer());
supprimerBouton.setText(boutonSupprimerLabel);
supprimerBouton.setData("valeur", texte);
supprimerBouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
String valeur = ce.getComponent().getData("valeur");
LayoutContainer valeurLayout = valeurs.get(valeur);
principalLayout.remove(valeurLayout);
valeurs.remove(valeur);
 
supprimerValeurDuRecapitulatif(valeur);
actualiserLayoutGlobal();
}
});
colonneLayout.add(supprimerBouton, new ColumnData(largeurBouton));
// Ajout du layout de la valeur au layout principal
principalLayout.add(colonneLayout);
// Ajout de la valeur au champ récapitulatif des valeurs ajoutées
ajouterValeurAuRecapitulatif(texte);
reinitialiserChamp();
actualiserLayoutGlobal();
}
public void reinitialiserChamp() {
if (estComboBox) {
champValeurCombo.setValue(champValeurCombo.getStore().findModel("id_valeur", valeurParDefaut));
} else {
champValeurTxt.setValue(valeurParDefaut);
}
if (estMultiType) {
types.reset();
}
}
public void actualiserLayoutGlobal() {
layout();
}
public void ajouterValeurAuRecapitulatif(String texte) {
String texteRecapitulatif = "";
if (champRecapitulatif.getValue() != null) {
texteRecapitulatif = champRecapitulatif.getValue();
}
texteRecapitulatif += texte + aDonnee.SEPARATEUR_VALEURS;
champRecapitulatif.setValue(texteRecapitulatif);
}
public void supprimerValeurDuRecapitulatif(String texte) {
 
if (champRecapitulatif.getValue() != null) {
String texteValeur = "";
if (estComboBox) {
// comme c'est le nom de la valeur qui est passée en paramètre,
// on doit récupérer son id
ListStore<Valeur> valeurs = champValeurCombo.getStore();
Valeur objetValeur = valeurs.findModel("nom", texte);
if (objetValeur != null) {
texteValeur = objetValeur.getId();
} else {
texteValeur = texte;
}
} else {
texteValeur = texte;
}
String texteRecapitulatif = champRecapitulatif.getValue();
texteRecapitulatif = texteRecapitulatif.replace(texteValeur + aDonnee.SEPARATEUR_VALEURS, "");
champRecapitulatif.setValue(texteRecapitulatif);
}
}
public String getValeurs() {
// permet de s'assurer qu'une valeur saisie dans le champ mais non ajoutée par le
// clic sur le + soit bien prise en compte
surAjoutValeur(false);
String texteRecapitulatif = "";
if (champRecapitulatif.getValue() != null) {
texteRecapitulatif = champRecapitulatif.getValue();
texteRecapitulatif = texteRecapitulatif.replaceAll("(.*)"+aDonnee.SEPARATEUR_VALEURS+"$", "$1");
}
return texteRecapitulatif;
}
public void peupler(String chaineExistante) {
if (valeurs.size()>0) {
reinitialiser();
}
if (chaineExistante != null && !chaineExistante.trim().equals("")) {
String[] valeurs = chaineExistante.split(aDonnee.SEPARATEUR_VALEURS);
for (int i = 0; i < valeurs.length; i++) {
ajouterValeur(valeurs[i]);
}
}
}
public void reinitialiser() {
//TODO : pourrait etre mieux fait si les valeurs étaient enregistrées dans un
// layout particulier. Il suffirait alors d'enlever les valeurs de ce layout.
principalLayout.removeAll();
initialiserChampMultiValeur(nomLabelChampTxt, largeurTotale);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/ChampMultiValeurs.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/ChampMultiValeurs.java:r1136-1367
Merged /trunk/src/org/tela_botanica/client/composants/ChampMultiValeurs.java:r11-664,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/ChampFiltreRecherche.java
New file
0,0 → 1,102
package org.tela_botanica.client.composants;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.ListePaginable;
 
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.KeyListener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.toolbar.FillToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.event.dom.client.KeyCodes;
 
public class ChampFiltreRecherche {
private ListePaginable listePaginable;
private Mediateur mediateur;
private ToolBar parent;
private TextField<String> filtre;
private Button annulerFiltre;
private boolean filtreActive = false;
private String termeRecherche = "";
private Text labelFiltre;
 
public ChampFiltreRecherche(Mediateur mediateur, ToolBar parent, ListePaginable listePaginable) {
//Séparation
this.mediateur = mediateur;
this.parent = parent;
this.listePaginable = listePaginable;
parent.add(new SeparatorToolItem());
labelFiltre = new Text("Recherche : ");
labelFiltre.setStyleAttribute("padding-right", "5px");
parent.add(labelFiltre);
filtre = new TextField<String>();
filtre.setWidth(150);
parent.add(filtre);
annulerFiltre = new Button();
annulerFiltre.setIcon(Images.ICONES.annuler());
annulerFiltre.setVisible(false);
parent.add(annulerFiltre);
parent.add(new FillToolItem());
ajouterListeners();
}
private void ajouterListeners() {
annulerFiltre.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
filtre.setValue("");
termeRecherche = "";
filtreActive = false;
listePaginable.filtrerParNom("");
labelFiltre.setStyleAttribute("font-weight", "normal");
changerEtat();
}
});
filtre.addKeyListener(new KeyListener(){
public void componentKeyUp(ComponentEvent ce) {
if (ce.getKeyCode() == KeyCodes.KEY_ENTER) {
termeRecherche = filtre.getValue();
if (termeRecherche == null || termeRecherche.equals("")) {
filtreActive = false;
labelFiltre.setStyleAttribute("font-weight", "normal");
termeRecherche= "";
listePaginable.filtrerParNom("");
changerEtat();
} else {
listePaginable.filtrerParNom(termeRecherche);
labelFiltre.setStyleAttribute("font-weight", "bold");
filtreActive = true;
changerEtat();
}
}
}
});
}
private void changerEtat() {
if (filtreActive == true) {
annulerFiltre.setVisible(true);
} else {
annulerFiltre.setVisible(false);
}
}
public void setListePaginable(ListePaginable listePaginable) {
this.listePaginable = listePaginable;
}
 
public String getFiltreValue() {
return filtre.getValue();
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/ChampMultiValeursImage.java
New file
0,0 → 1,88
package org.tela_botanica.client.composants;
 
import org.tela_botanica.client.images.Images;
 
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.google.gwt.user.client.ui.Image;
 
public class ChampMultiValeursImage extends ChampMultiValeurs {
private String height, width;
private LayoutContainer sousContenu = null;
public ChampMultiValeursImage() {
super(null, 0);
initialiserSousContenu();
}
public ChampMultiValeursImage(String label) {
super(label, 0);
initialiserSousContenu();
}
public ChampMultiValeursImage(String label, int largeurTotale) {
super(label, largeurTotale);
initialiserSousContenu();
}
public void initialiserSousContenu() {
sousContenu = new LayoutContainer(new ColumnLayout());
principalLayout.add(sousContenu);
}
public void setImageHeight(String height) {
this.height = height;
}
public void setImageWidth(String width) {
this.width = width;
}
public void ajouterValeur(final String strUrl) {
LayoutContainer lcUrl = new LayoutContainer();
lcUrl.setLayout(new RowLayout());
valeurs.put(strUrl, lcUrl);
Image logo = new Image(strUrl);
logo.setTitle(strUrl);
if (height != null) {
logo.setHeight(height);
}
if (width != null) {
logo.setWidth(width);
}
lcUrl.add(logo);
Button supprimerBouton = new Button();
supprimerBouton.setIcon(Images.ICONES.supprimer());
supprimerBouton.setData("valeur", strUrl);
supprimerBouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
String valeur = ce.getComponent().getData("valeur");
LayoutContainer valeurLayout = valeurs.get(valeur);
sousContenu.remove(valeurLayout);
valeurs.remove(valeur);
supprimerValeurDuRecapitulatif(valeur);
actualiserLayoutGlobal();
}
});
lcUrl.add(supprimerBouton);
// Ajout du layout de la valeur au layout principal
sousContenu.add(lcUrl);
// Ajout de la valeur au champ récapitulatif des valeurs ajoutées
ajouterValeurAuRecapitulatif(strUrl);
reinitialiserChamp();
actualiserLayoutGlobal();
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/composants/ChampMultiValeursImage.java:r11-699,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/ChampMultiValeursImage.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/ChampMultiValeursImage.java:r1136-1367
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/ChampMultiValeursMultiTypesPaginable.java
New file
0,0 → 1,265
package org.tela_botanica.client.composants;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.pagination.Proxy;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.aDonnee;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.FieldEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
 
public class ChampMultiValeursMultiTypesPaginable extends ChampMultiValeursPaginable implements Rafraichissable {
 
//-------------//
// ATTRIBUTS //
//-------------//
// Elements pour le champ 'types'
ColumnData colonneChampTypes = null;
ChampComboBoxRechercheTempsReelPaginable champTypesComboBox = null;
int largeurChampTypes = 200;
String displayNameChampTypes = "nom";
// Elements pour gérer le type de valeurs que contient le champ
Proxy proxyChampTypes = null;
ModelType modeltypeChampTypes = null;
 
// Variables de traitement
HashMap<Integer, String> tempMapValeurs = null;
//-------------//
// METHODES //
//-------------//
 
/*--------------
Constructeur
--------------*/
public ChampMultiValeursMultiTypesPaginable(String label, int largeurTotale, boolean estCombobox, ModelType modeltypeChampValeur, Proxy proxyChampValeur, String displayNameChampValeur, ModelType modeltypeChampTypes, Proxy proxyChampTypes, String displayNameChampTypes) {
super(label, largeurTotale, estCombobox, modeltypeChampValeur, proxyChampValeur, displayNameChampValeur);
this.proxyChampTypes = proxyChampTypes;
this.modeltypeChampTypes = modeltypeChampTypes;
this.displayNameChampTypes = displayNameChampTypes;
initialiserChampMultiValeursMultiTypesPaginable(label);
}
 
/*------------
Accesseurs
------------*/
//------------//
// Get //------------------------------------------------------------
public ChampComboBoxRechercheTempsReelPaginable getChampTypesComboBox() {
return this.champTypesComboBox;
}
//------------//
// Set //------------------------------------------------------------
@Override
public void setLargeurTotale(int largeurTotale) {
this.largeurTotale = largeurTotale;
largeurChampValeur = largeurTotale - largeurBouton - largeurChampTypes;
}
/*-------------------------------------------
Méthodes protégées et méthodes publiques
--------------------------------------------*/
@Override
public void rafraichir(Object nouvellesDonnees) {
super.rafraichir(nouvellesDonnees);
if (nouvellesDonnees instanceof ValeurListe) {
Valeur v = ((ValeurListe)nouvellesDonnees).toList().get(0);
ajouterValeur(tempMapValeurs.get(Integer.parseInt(v.getId())), v.getNom(), v.getId());
}
}
@Override
protected void ajouterValeur(final String texte, final String type, final String idType) {
LayoutContainer colonneConteneur = new LayoutContainer();
colonneConteneur.setLayout(new ColumnLayout());
valeurs.put(idType + aDonnee.SEPARATEUR_TYPE_VALEUR + texte, colonneConteneur);
Text champType = new Text();
champType.setText(type + " : ");
champType.setWidth(largeurChampTypes);
colonneConteneur.add(champType, new ColumnData(largeurChampTypes));
Text champValeur = new Text();
champValeur.setText(texte);
champValeur.setWidth(largeurChampTypes);
colonneConteneur.add(champValeur, new ColumnData(largeurChampTypes));
Button supprimerBouton = new Button();
supprimerBouton.setIcon(Images.ICONES.supprimer());
supprimerBouton.setText(boutonSupprimerLabel);
supprimerBouton.setData("valeur", idType + aDonnee.SEPARATEUR_TYPE_VALEUR + texte);
supprimerBouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
String valeur = ce.getComponent().getData("valeur");
LayoutContainer valeurLayout = valeurs.get(valeur);
principalLayout.remove(valeurLayout);
valeurs.remove(valeur);
supprimerValeurDuRecapitulatif(valeur);
actualiserLayoutGlobal();
}
});
colonneConteneur.add(supprimerBouton, new ColumnData(largeurBouton));
// Ajout du layout de la valeur au layout principal
principalLayout.add(colonneConteneur);
// Ajout de la valeur au champ récapitulatif des valeurs ajoutées
ajouterValeurAuRecapitulatif(texte, idType);
reinitialiserChamp();
actualiserLayoutGlobal();
}
 
@Override
public void peupler(String chaineExistante) {
if (valeurs.size() > 0) {
reinitialiser();
}
if (chaineExistante != null && !chaineExistante.trim().equals("")) {
String[] valeurs = chaineExistante.split(aDonnee.SEPARATEUR_VALEURS);
for (int i = 0; i < valeurs.length; i++) {
String[] idEtValeur = valeurs[i].split(aDonnee.SEPARATEUR_TYPE_VALEUR);
if (idEtValeur.length == 2) {
String idType = idEtValeur[0];
String idValeur = idEtValeur[1];
// Champ Valeur
if (idType.matches("[0-9]+")) {
tempMapValeurs.put(Integer.parseInt(idType), idValeur);
} else {
tempMapValeurs.put(((Configuration)(Registry.get(RegistreId.CONFIG))).getListeId(idType), idValeur);
}
// Champ Types
mediateur.obtenirValeurEtRafraichir(this,"*", idType, null);
} else {
InfoLogger.display("Erreur", "ChampMultiValeursMultiTypesPaginable. Erreur dans le split de "+chaineExistante, true);
}
}
}
}
 
/*------------------
Méthodes privées
------------------*/
private void initialiserChampMultiValeursMultiTypesPaginable(String label) {
setLargeurTotale(largeurTotale);
tempMapValeurs = new HashMap<Integer,String>();
creerChampMultiValeursMultiTypes();
}
 
private void creerChampMultiValeursMultiTypes() {
/* Creation du champ Types */
champTypesComboBox = new ChampComboBoxRechercheTempsReelPaginable(proxyChampTypes, modeltypeChampTypes, displayNameChampTypes);
champTypesComboBox.setWidth(largeurChampTypes);
champTypesComboBox.getCombo().setEmptyText("Type...");
champTypesComboBox.addListener(Events.Select, new Listener<FieldEvent>() {
public void handleEvent(FieldEvent fe) {
 
}
});
 
/* Placement des éléments dans le conteneur */
// le champ "types" doit être graphiquement placé avant les autres champs,
// on doit donc retirer ces derniers avant d'insérer le champ "types"
colonneConteneur.removeAll();
colonneConteneur.setWidth(largeurTotale);
colonneChampTypes = new ColumnData(largeurChampTypes);
colonneChampTypes.setWidth(largeurChampTypes);
colonneConteneur.add(champTypesComboBox, colonneChampTypes);
if (champValeurEstComboBox) {
champValeurComboBox.setWidth(largeurChampValeur);
colonneChampValeur.setWidth(largeurChampValeur);
colonneConteneur.add(champValeurComboBox, colonneChampValeur);
} else {
champValeurTxt.setWidth(largeurChampValeur);
colonneChampValeur.setWidth(largeurChampValeur);
colonneConteneur.add(champValeurTxt, colonneChampValeur);
}
ajouterBouton.setWidth(largeurBouton);
colonneBoutonAjouter.setWidth(largeurBouton);
colonneConteneur.add(ajouterBouton, colonneBoutonAjouter);
 
/* Modification de l'écouteur du bouton Ajouter */
ajouterBouton.removeAllListeners();
ajouterBouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
// récupération de la valeur du champ "Valeur"
String valeurChamp = "";
if (champValeurEstComboBox) {
if (champValeurComboBox.getValeur() != null) {
Valeur val = new Valeur(champValeurComboBox.getValeur());
valeurChamp = val.getNom();
}
} else {
valeurChamp = champValeurTxt.getValue();
}
// validation de la valeur avant ajout
if ((valeurChamp == null) || valeurChamp.trim().equals("") || valeurChamp.trim().equals(valeurParDefaut)) {
MessageBox.alert(titreErreur, valeurVideMsg, null);
} else if (valeurs.get(valeurChamp) != null){
MessageBox.alert(titreErreur, valeurIdentiqueMsg, null);
} else {
if (validationMasque != null && !valeurChamp.matches(validationMasque)) {
MessageBox.alert(titreErreur, valeurNonValideMsg, null);
} else { // VALIDATION OK
Valeur type = new Valeur(champTypesComboBox.getValeur());
String typeNomStr = type.getNom();
String typeIdStr = type.getId();
 
if (typeIdStr.trim().equals("")) {
MessageBox.alert(Mediateur.i18nM.titreErreurSaisie(), Mediateur.i18nM.typeChampMulti(), null);
} else {
ajouterValeur(valeurChamp, typeNomStr, typeIdStr);
}
}
}
}
});
}
private void ajouterValeurAuRecapitulatif(String texte, String id) {
String texteRecapitulatif = "";
if (champRecapitulatif.getValue() != null) {
texteRecapitulatif = champRecapitulatif.getValue();
}
texteRecapitulatif += id + aDonnee.SEPARATEUR_TYPE_VALEUR + texte + aDonnee.SEPARATEUR_VALEURS;
champRecapitulatif.setValue(texteRecapitulatif);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/ChampMultiValeursMultiTypesPaginable.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/ChampMultiValeursMultiTypesPaginable.java:r1136-1208,1292-1367
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/ChampMultiValeursPaginable.java
New file
0,0 → 1,347
package org.tela_botanica.client.composants;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.composants.pagination.Proxy;
import org.tela_botanica.client.composants.pagination.ProxyValeur;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.FieldEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.HiddenField;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.ComboBox.TriggerAction;
import com.extjs.gxt.ui.client.widget.layout.ColumnData;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
 
public class ChampMultiValeursPaginable extends LayoutContainer implements Rafraichissable {
//TODO : changer le champRecapitulatif par une hashMap
//TODO : autoriser la modification des champs saisis
 
//-------------//
// ATTRIBUTS //
//-------------//
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
String idChampCache = null;
String titreErreur = null;
String valeurVideMsg = null;
String valeurIdentiqueMsg = null;
String valeurNonValideMsg = null;
String valeurParDefaut = "";
String validationMasque = null;
String exempleValidation = null;
boolean champValeurEstComboBox = false;
 
// Elements pour le champ 'valeurs'
Field<String> champValeurTxt = null;
ChampComboBoxRechercheTempsReelPaginable champValeurComboBox = null;
HiddenField<String> champRecapitulatif = null;
HashMap<String, LayoutContainer> valeurs = null;
// Elements pour gérer le type de valeurs que contient le champ
Proxy proxyChampValeur = null;
ModelType modeltypeChampValeur = null;
String displayNameChampValeur = "nom";
// Elements pour l'UI
LayoutContainer principalLayout = null;
LayoutContainer colonneConteneur = null;
ColumnData colonneChampValeur = null;
ColumnData colonneBoutonAjouter = null;
Button ajouterBouton = null;
int largeurTotale = 500;
int largeurBouton = 20;
int largeurChampValeur = 200;
String boutonSupprimerLabel = "";
String nomLabelChampTxt = "";
 
 
//-------------//
// METHODES //
//-------------//
 
/*--------------
Constructeur
--------------*/
// Usage : Si champValeurEstComboBox est FAUX alors modeltype, proxy et displayName doivent être à Null.
// Sinon ils doivent impérativement être non nuls.
public ChampMultiValeursPaginable(String label, int largeurTotale, boolean champValeurEstComboBox, ModelType modeltype, Proxy proxy, String displayName) {
this.champValeurEstComboBox = champValeurEstComboBox;
if (champValeurEstComboBox) {
if ((proxy == null) || (modeltype == null) || (displayName == null)) {
MessageBox.alert("[ERREUR]","Constructeur de ChampMultiValeursPaginable - paramètre Null",null);
}
else {
this.proxyChampValeur = proxy;
this.modeltypeChampValeur = modeltype;
this.displayNameChampValeur = displayName;
}
}
initialiserChampMultiValeursPaginable(label, largeurTotale);
}
 
/*------------
Accesseurs
------------*/
//------------//
// Get //------------------------------------------------------------
public ChampComboBoxRechercheTempsReelPaginable getChampValeurComboBox() {
if (champValeurEstComboBox) return this.champValeurComboBox;
else return null;
}
 
public Field getChampValeurTxt() {
if (!champValeurEstComboBox) return this.champValeurTxt;
else return null;
}
public String getLabel() {
return this.nomLabelChampTxt;
}
public String getValeurs() {
String texteRecapitulatif = "";
if (champRecapitulatif.getValue() != null) {
texteRecapitulatif = champRecapitulatif.getValue();
texteRecapitulatif = texteRecapitulatif.replaceAll("(.*)"+aDonnee.SEPARATEUR_VALEURS+"$", "$1");
}
return texteRecapitulatif;
}
//------------//
// Set //------------------------------------------------------------
public void setLabel(String label) {
if (label == null) {
label = "";
}
nomLabelChampTxt = label;
}
public void setLargeurTotale(int largeur) {
this.largeurTotale = largeur;
largeurChampValeur = largeurTotale - largeurBouton;
}
public void setValidation (String validation, String exempleValidation) {
this.validationMasque = validation;
this.exempleValidation = exempleValidation;
this.valeurNonValideMsg = Mediateur.i18nM.valeurNonValideMsg(exempleValidation);
}
public void setValeurParDefaut(String valeur) {
this.valeurParDefaut = valeur;
champValeurTxt.setValue(valeur);
}
public void setValeurBoutonSupprimer(String valeur) {
this.boutonSupprimerLabel = valeur;
}
/*------------------
Méthodes publiques
-------------------*/
public void peupler(String chaineExistante) {
if (valeurs.size()>0) {
reinitialiser();
}
if (chaineExistante != null && !chaineExistante.trim().equals("")) {
String[] valeurs = chaineExistante.split(aDonnee.SEPARATEUR_VALEURS);
for (int i = 0; i < valeurs.length; i++) {
ajouterValeur(valeurs[i]);
}
}
}
public void rafraichir(Object nouvellesDonnees) {
}
/*-------------------
Méthodes protégées
--------------------*/
protected void ajouterValeur(final String texte, final String strValeur, final String id) {
//Implémenté dans classe inférieure
}
protected void ajouterValeur(final String texte) {
LayoutContainer colonneLayout = new LayoutContainer();
colonneLayout.setLayout(new ColumnLayout());
valeurs.put(texte, colonneLayout);
Text champTxt = new Text();
champTxt.setText(texte);
colonneLayout.add(champTxt, new ColumnData(largeurChampValeur));
Button supprimerBouton = new Button();
supprimerBouton.setIcon(Images.ICONES.supprimer());
supprimerBouton.setText(boutonSupprimerLabel);
supprimerBouton.setData("valeur", texte);
supprimerBouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
String valeur = ce.getComponent().getData("valeur");
LayoutContainer valeurLayout = valeurs.get(valeur);
principalLayout.remove(valeurLayout);
valeurs.remove(valeur);
supprimerValeurDuRecapitulatif(valeur);
actualiserLayoutGlobal();
}
});
colonneLayout.add(supprimerBouton, new ColumnData(largeurBouton));
// Ajout du layout de la valeur au layout principal
principalLayout.add(colonneLayout);
// Ajout de la valeur au champ récapitulatif des valeurs ajoutées
ajouterValeurAuRecapitulatif(texte);
reinitialiserChamp();
actualiserLayoutGlobal();
}
protected void reinitialiserChamp() {
if (champValeurEstComboBox) {
champValeurComboBox.getCombo().clear();
} else {
champValeurTxt.setValue(valeurParDefaut);
}
}
protected void actualiserLayoutGlobal() {
layout();
}
protected void ajouterValeurAuRecapitulatif(String texte) {
String texteRecapitulatif = "";
if (champRecapitulatif.getValue() != null) {
texteRecapitulatif = champRecapitulatif.getValue();
}
texteRecapitulatif += texte + aDonnee.SEPARATEUR_VALEURS;
champRecapitulatif.setValue(texteRecapitulatif);
}
protected void supprimerValeurDuRecapitulatif(String texte) {
if (champRecapitulatif.getValue() != null) {
String texteRecapitulatif = champRecapitulatif.getValue();
texteRecapitulatif = texteRecapitulatif.replace(texte + aDonnee.SEPARATEUR_VALEURS, "");
champRecapitulatif.setValue(texteRecapitulatif);
}
}
protected void reinitialiser() {
//TODO : pourrait etre mieux fait si les valeurs étaient enregistrées dans un
// layout particulier. Il suffirait alors d'enlever les valeurs de ce layout.
principalLayout.removeAll();
initialiserChampMultiValeursPaginable(nomLabelChampTxt, largeurTotale);
}
/*------------------
Méthodes privées
-------------------*/
private void initialiserChampMultiValeursPaginable(String label, int largeurTotale) {
setLabel(label);
setLargeurTotale(largeurTotale);
titreErreur = Mediateur.i18nC.erreurSaisieTitre();
valeurVideMsg = Mediateur.i18nC.demanderValeur();
valeurIdentiqueMsg = Mediateur.i18nC.valeurDejaPresente();
valeurs = new HashMap<String, LayoutContainer>();
champRecapitulatif = new HiddenField<String>();
champRecapitulatif.setValue("");
setLayout(new FormLayout());
creerChampMultiValeurs();
}
 
private void creerChampMultiValeurs() {
principalLayout = new LayoutContainer();
principalLayout.setLayout(new RowLayout());
/* Creation du champ Valeur */
LabelField label = new LabelField(nomLabelChampTxt + ":");
label.setWidth("95%");
principalLayout.add(label);
colonneConteneur = new LayoutContainer();
colonneConteneur.setLayout(new ColumnLayout());
colonneChampValeur = new ColumnData(largeurChampValeur);
if (champValeurEstComboBox) {
champValeurComboBox = new ChampComboBoxRechercheTempsReelPaginable(proxyChampValeur, modeltypeChampValeur, displayNameChampValeur);
champValeurComboBox.setWidth(largeurChampValeur);
champValeurComboBox.getCombo().setEmptyText("Valeur...");
colonneConteneur.add(champValeurComboBox, colonneChampValeur);
} else {
champValeurTxt = new TextField<String>();
champValeurTxt.setWidth(largeurChampValeur);
champValeurTxt.setEmptyText("Valeur...");
colonneConteneur.add(champValeurTxt, colonneChampValeur);
}
 
/* Creation du bouton Ajouter */
ajouterBouton = new Button();
ajouterBouton.setWidth(largeurBouton);
ajouterBouton.setIcon(Images.ICONES.ajouter());
ajouterBouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
// récupération de la valeur du champ "Valeur"
String valeurChamp = "";
if (champValeurEstComboBox) {
if (champValeurComboBox.getValeur() != null) {
valeurChamp = (new Valeur(champValeurComboBox.getValeur())).getNom();
}
} else {
valeurChamp = champValeurTxt.getValue();
}
// validation de la valeur avant ajout
if ((valeurChamp == null) || valeurChamp.trim().equals("") || valeurChamp.trim().equals(valeurParDefaut)) {
MessageBox.alert(titreErreur, valeurVideMsg, null);
} else if (valeurs.get(valeurChamp) != null) {
MessageBox.alert(titreErreur, valeurIdentiqueMsg, null);
} else {
if (validationMasque != null && !valeurChamp.matches(validationMasque)) {
MessageBox.alert(titreErreur, valeurNonValideMsg, null);
} else {
ajouterValeur(valeurChamp);
}
}
}
});
colonneBoutonAjouter = new ColumnData(largeurBouton);
colonneConteneur.add(ajouterBouton, colonneBoutonAjouter);
 
principalLayout.add(champRecapitulatif);
principalLayout.add(colonneConteneur);
add(principalLayout);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/ChampMultiValeursPaginable.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/ChampMultiValeursPaginable.java:r1136-1208,1292-1367
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/ProxyStructures.java
New file
0,0 → 1,68
package org.tela_botanica.client.composants.pagination;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoadResult;
import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.MemoryProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public class ProxyStructures<D> extends Proxy {
public ProxyStructures(Sequenceur sequenceur) {
super(sequenceur);
}
@Override
public void load(TransformateurJSONaModelData reader, Object loadConfig, AsyncCallback callback, String recherche) {
this.reader = reader;
this.callback = callback;
this.loadConfig = loadConfig;
 
String nom = (recherche == null) ? "%" : "%" + recherche + "%";
 
BasePagingLoadConfig lc = (BasePagingLoadConfig) loadConfig;
if (UtilString.isNumber(recherche, false)) {
mediateur.selectionnerStructureAvecPaginationProgressive(this, nom, null, "array", lc.getOffset(), lc.getLimit(), sequenceur, false);
} else {
mediateur.selectionnerStructure(this, nom, lc.getOffset(), lc.getLimit(), sequenceur, false);
}
}
 
@Override
@SuppressWarnings("unchecked")
public void rafraichir(Object nouvellesDonnees) {
try {
data = nouvellesDonnees;
Debug.log("Dans ProxyStructure:"+data.toString());
D d = null;
if (reader != null) {
d = (D) reader.read(loadConfig, data);
} else {
d = (D) data;
if (d instanceof List) {
d = (D) new ArrayList((List) d);
}
}
callback.onSuccess(d);
} catch (Exception e){
callback.onFailure(e);
}
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/ProxyCollectionAPersonne.java
New file
0,0 → 1,83
package org.tela_botanica.client.composants.pagination;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoadResult;
import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.MemoryProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public class ProxyCollectionAPersonne<D> extends Proxy {
String collectionId = null;
String roleId = null;
public ProxyCollectionAPersonne(Sequenceur sequenceur, String collectionId, String roleId) {
super(sequenceur);
this.collectionId = collectionId;
this.roleId = roleId;
}
@Override
public void load(TransformateurJSONaModelData reader, Object loadConfig, AsyncCallback callback, String recherche) {
this.reader = reader;
this.callback = callback;
this.loadConfig = loadConfig;
BasePagingLoadConfig lc = (BasePagingLoadConfig)loadConfig;
if (this.collectionId != null && !UtilString.isEmpty(this.collectionId)) {
mediateur.selectionnerCollectionAPersonne(this, this.collectionId, this.roleId, recherche, lc.getOffset(), lc.getLimit(), sequenceur);
} else {
this.rafraichir(null);
}
}
 
@Override
@SuppressWarnings("unchecked")
public void rafraichir(Object nouvellesDonnees) {
try
{
data = nouvellesDonnees;
D d = null;
 
if (reader != null)
{
d = (D) reader.read(loadConfig, data);
}
else
{
d = (D) data;
if (d instanceof List)
{
d = (D) new ArrayList((List) d);
}
}
 
callback.onSuccess(d);
}
catch (Exception e)
{
callback.onFailure(e);
}
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/ProxyCollectionAPublication.java
New file
0,0 → 1,82
package org.tela_botanica.client.composants.pagination;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoadResult;
import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.MemoryProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public class ProxyCollectionAPublication<D> extends Proxy {
String collectionId = null;
public ProxyCollectionAPublication(Sequenceur sequenceur, String collectionId) {
super(sequenceur);
this.collectionId = collectionId;
}
@Override
public void load(TransformateurJSONaModelData reader, Object loadConfig, AsyncCallback callback, String recherche) {
this.reader = reader;
this.callback = callback;
this.loadConfig = loadConfig;
 
BasePagingLoadConfig lc = (BasePagingLoadConfig)loadConfig;
if (this.collectionId != null && !UtilString.isEmpty(this.collectionId)) {
mediateur.selectionnerCollectionAPublication(this, this.collectionId, recherche, lc.getOffset(), lc.getLimit(), sequenceur);
} else {
this.rafraichir(null);
}
}
 
@Override
@SuppressWarnings("unchecked")
public void rafraichir(Object nouvellesDonnees) {
try
{
D donneesRetour = null;
if (nouvellesDonnees!=null) {
data = nouvellesDonnees;
if (reader != null)
{
donneesRetour = (D) reader.read(loadConfig, data);
}
else
{
donneesRetour = (D) data;
if (donneesRetour instanceof List)
{
donneesRetour = (D) new ArrayList((List) donneesRetour);
}
}
}
callback.onSuccess(donneesRetour);
}
catch (Exception e)
{
callback.onFailure(e);
}
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/ProxyCommentaires.java
New file
0,0 → 1,75
package org.tela_botanica.client.composants.pagination;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoadResult;
import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.MemoryProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public class ProxyCommentaires<D> extends Proxy {
public ProxyCommentaires(Sequenceur sequenceur) {
super(sequenceur);
}
@Override
public void load(TransformateurJSONaModelData reader, Object loadConfig, AsyncCallback callback, String recherche) {
this.reader = reader;
this.callback = callback;
this.loadConfig = loadConfig;
 
BasePagingLoadConfig lc = (BasePagingLoadConfig)loadConfig;
mediateur.selectionnerCommentaire(this, recherche, lc.getOffset(), lc.getLimit(), sequenceur);
}
@Override
@SuppressWarnings("unchecked")
public void rafraichir(Object nouvellesDonnees) {
try
{
data = nouvellesDonnees;
D d = null;
 
if (reader != null)
{
d = (D) reader.read(loadConfig, data);
}
else
{
d = (D) data;
if (d instanceof List)
{
d = (D) new ArrayList((List) d);
}
}
 
callback.onSuccess(d);
}
catch (Exception e)
{
callback.onFailure(e);
}
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/ProxyPersonnesAPublication.java
New file
0,0 → 1,63
package org.tela_botanica.client.composants.pagination;
 
import java.util.ArrayList;
import java.util.List;
 
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Log;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public class ProxyPersonnesAPublication<D> extends Proxy {
String publicationId = null;
public ProxyPersonnesAPublication(Sequenceur sequenceur, String publicationId) {
super(sequenceur);
this.publicationId = publicationId;
}
@Override
public void load(TransformateurJSONaModelData reader, Object loadConfig, AsyncCallback callback, String recherche) {
this.reader = reader;
this.callback = callback;
this.loadConfig = loadConfig;
 
BasePagingLoadConfig lc = (BasePagingLoadConfig) loadConfig;
if (!UtilString.isEmpty(this.publicationId)) {
mediateur.selectionnerPersonnesAPublication(this, this.publicationId, recherche, lc.getOffset(), lc.getLimit(), sequenceur);
} else {
this.rafraichir(null);
}
}
public void setPublicationId(String publicationId) {
this.publicationId = publicationId;
}
 
@Override
@SuppressWarnings("unchecked")
public void rafraichir(Object nouvellesDonnees) {
try {
D donneesRetour = null;
if (nouvellesDonnees != null) {
data = nouvellesDonnees;
if (reader != null) {
donneesRetour = (D) reader.read(loadConfig, data);
} else {
donneesRetour = (D) data;
if (donneesRetour instanceof List) {
donneesRetour = (D) new ArrayList((List) donneesRetour);
}
}
}
Log.debug("Dans Proxy : "+donneesRetour.toString());
callback.onSuccess(donneesRetour);
} catch (Exception e) {
callback.onFailure(e);
}
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/ProxyPublicationsAPersonne.java
New file
0,0 → 1,93
package org.tela_botanica.client.composants.pagination;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoadResult;
import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.MemoryProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public class ProxyPublicationsAPersonne<D> extends Proxy {
String personneId = null;
List<Valeur> rolesId = null;
public ProxyPublicationsAPersonne(Sequenceur sequenceur, String personneId, List<Valeur> rolesId) {
super(sequenceur);
this.personneId = personneId;
this.rolesId = rolesId;
}
@Override
public void load(TransformateurJSONaModelData reader, Object loadConfig, AsyncCallback callback, String recherche) {
this.reader = reader;
this.callback = callback;
this.loadConfig = loadConfig;
 
BasePagingLoadConfig lc = (BasePagingLoadConfig)loadConfig;
if (!UtilString.isEmpty(this.personneId)) {
mediateur.selectionnerPublicationsAPersonne(this, personneId, rolesId, recherche, lc.getOffset(), lc.getLimit(), sequenceur);
} else {
this.rafraichir(null);
}
}
public void setPersonneId(String personneId) {
this.personneId = personneId;
}
public void setRolesId(List<Valeur> rolesId) {
this.rolesId = rolesId;
}
 
@Override
@SuppressWarnings("unchecked")
public void rafraichir(Object nouvellesDonnees) {
try
{
D donneesRetour = null;
if (nouvellesDonnees!=null) {
data = nouvellesDonnees;
if (reader != null)
{
donneesRetour = (D) reader.read(loadConfig, data);
}
else
{
donneesRetour = (D) data;
if (donneesRetour instanceof List)
{
donneesRetour = (D) new ArrayList((List) donneesRetour);
}
}
}
callback.onSuccess(donneesRetour);
}
catch (Exception e)
{
callback.onFailure(e);
}
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/ProxyStructureAPersonne.java
New file
0,0 → 1,82
package org.tela_botanica.client.composants.pagination;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoadResult;
import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.MemoryProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public class ProxyStructureAPersonne<D> extends Proxy {
String structureId = null;
String roleId = null;
public ProxyStructureAPersonne(Sequenceur sequenceur, String structureId, String roleId) {
super(sequenceur);
this.structureId = structureId;
this.roleId = roleId;
}
@Override
public void load(TransformateurJSONaModelData reader, Object loadConfig, AsyncCallback callback, String recherche) {
this.reader = reader;
this.callback = callback;
this.loadConfig = loadConfig;
 
BasePagingLoadConfig lc = (BasePagingLoadConfig)loadConfig;
if (this.structureId != null && !UtilString.isEmpty(this.structureId)) {
mediateur.selectionnerStructureAPersonne(this, this.structureId, this.roleId, recherche, lc.getOffset(), lc.getLimit(), sequenceur);
} else {
this.rafraichir(null);
}
}
 
@Override
@SuppressWarnings("unchecked")
public void rafraichir(Object nouvellesDonnees) {
try
{
data = nouvellesDonnees;
D d = null;
 
if (reader != null)
{
d = (D) reader.read(loadConfig, data);
}
else
{
d = (D) data;
if (d instanceof List)
{
d = (D) new ArrayList((List) d);
}
}
 
callback.onSuccess(d);
}
catch (Exception e)
{
callback.onFailure(e);
}
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/ProxyPersonnes.java
New file
0,0 → 1,70
package org.tela_botanica.client.composants.pagination;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoadResult;
import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.MemoryProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public class ProxyPersonnes<D> extends Proxy {
public ProxyPersonnes(Sequenceur sequenceur) {
super(sequenceur);
}
@Override
public void load(TransformateurJSONaModelData reader, Object loadConfig, AsyncCallback callback, String recherche) {
this.reader = reader;
this.callback = callback;
this.loadConfig = loadConfig;
 
BasePagingLoadConfig lc = (BasePagingLoadConfig)loadConfig;
mediateur.selectionnerPersonne(this, recherche, lc.getOffset(), lc.getLimit(), sequenceur);
}
 
@Override
@SuppressWarnings("unchecked")
public void rafraichir(Object nouvellesDonnees) {
try
{
data = nouvellesDonnees;
D d = null;
 
if (reader != null)
{
d = (D) reader.read(loadConfig, data);
}
else
{
d = (D) data;
if (d instanceof List)
{
d = (D) new ArrayList((List) d);
}
}
 
callback.onSuccess(d);
}
catch (Exception e)
{
callback.onFailure(e);
}
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/ProxyPublications.java
New file
0,0 → 1,75
package org.tela_botanica.client.composants.pagination;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoadResult;
import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.MemoryProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public class ProxyPublications<D> extends Proxy {
public ProxyPublications(Sequenceur sequenceur) {
super(sequenceur);
}
@Override
public void load(TransformateurJSONaModelData reader, Object loadConfig, AsyncCallback callback, String recherche) {
this.reader = reader;
this.callback = callback;
this.loadConfig = loadConfig;
 
BasePagingLoadConfig lc = (BasePagingLoadConfig)loadConfig;
mediateur.selectionnerPublication(this, recherche, lc.getOffset(), lc.getLimit(), sequenceur);
}
@Override
@SuppressWarnings("unchecked")
public void rafraichir(Object nouvellesDonnees) {
try
{
data = nouvellesDonnees;
D d = null;
 
if (reader != null)
{
d = (D) reader.read(loadConfig, data);
}
else
{
d = (D) data;
if (d instanceof List)
{
d = (D) new ArrayList((List) d);
}
}
 
callback.onSuccess(d);
}
catch (Exception e)
{
callback.onFailure(e);
}
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/ProxyCollections.java
New file
0,0 → 1,70
package org.tela_botanica.client.composants.pagination;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoadResult;
import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.MemoryProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public class ProxyCollections<D> extends Proxy {
public ProxyCollections(Sequenceur sequenceur) {
super(sequenceur);
}
public void load(TransformateurJSONaModelData reader, Object loadConfig, AsyncCallback callback, String recherche) {
this.reader = reader;
this.callback = callback;
this.loadConfig = loadConfig;
BasePagingLoadConfig lc = (BasePagingLoadConfig)loadConfig;
mediateur.selectionnerCollection(this, recherche, lc.getOffset(), lc.getLimit(), sequenceur);
}
@Override
@SuppressWarnings("unchecked")
public void rafraichir(Object nouvellesDonnees) {
try
{
data = nouvellesDonnees;
D d = null;
 
if (reader != null)
{
d = (D) reader.read(loadConfig, data);
}
else
{
d = (D) data;
if (d instanceof List)
{
d = (D) new ArrayList((List) d);
}
}
 
callback.onSuccess(d);
}
catch (Exception e)
{
callback.onFailure(e);
}
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/ProxyValeur.java
New file
0,0 → 1,71
package org.tela_botanica.client.composants.pagination;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoadResult;
import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.MemoryProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public class ProxyValeur<D> extends Proxy {
private String nomListe = "";
public ProxyValeur(String nomListe, Sequenceur sequenceur) {
super(sequenceur);
this.nomListe = nomListe;
}
public void load(TransformateurJSONaModelData reader, Object loadConfig, AsyncCallback callback, String recherche) {
this.reader = reader;
this.callback = callback;
this.loadConfig = loadConfig;
 
BasePagingLoadConfig lc = (BasePagingLoadConfig)loadConfig;
mediateur.obtenirListeValeurEtRafraichir(this, nomListe, true, recherche, lc.getOffset(), lc.getLimit(), sequenceur);
}
 
@SuppressWarnings("unchecked")
public void rafraichir(Object nouvellesDonnees) {
try
{
data = nouvellesDonnees;
D d = null;
 
if (reader != null)
{
d = (D) reader.read(loadConfig, data);
}
else
{
d = (D) data;
if (d instanceof List)
{
d = (D) new ArrayList((List) d);
}
}
 
callback.onSuccess(d);
}
catch (Exception e)
{
callback.onFailure(e);
}
}
 
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/pagination/ProxyValeur.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/pagination/ProxyValeur.java:r1136-1208,1292-1367
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/ChargeurListe.java
New file
0,0 → 1,115
package org.tela_botanica.client.composants.pagination;
 
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.Log;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.data.BasePagingLoader;
import com.extjs.gxt.ui.client.data.LoadEvent;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public class ChargeurListe<D extends PagingLoadResult<?>> extends BasePagingLoader<D> {
 
private String recherche = "";
private Rafraichissable vueARafraichir = null;
private boolean doRafraichir = false;
 
@SuppressWarnings("unchecked")
public ChargeurListe(Proxy proxy, TransformateurJSONaModelData reader, Rafraichissable vueARafraichir) {
super(proxy, reader);
this.vueARafraichir = vueARafraichir;
}
public boolean load(Object loadConfig, String recherche, boolean doRafraichir) {
this.doRafraichir = doRafraichir;
if (fireEvent(BeforeLoad, new LoadEvent(this, loadConfig))) {
lastConfig = loadConfig;
this.recherche = recherche;
loadData(loadConfig, recherche);
return true;
} else {
return false;
}
}
public boolean load(Object loadConfig) {
if (fireEvent(BeforeLoad, new LoadEvent(this, loadConfig))) {
lastConfig = loadConfig;
loadData(loadConfig, recherche);
return true;
}
return false;
}
public void load(int offset, int limit) {
this.offset = offset;
this.limit = limit;
load();
}
public boolean load() {
Object config = (reuseConfig && lastConfig != null) ? lastConfig : newLoadConfig();
config = prepareLoadConfig(config);
return load(config);
}
@SuppressWarnings("unchecked")
protected void loadData(final Object config, String recherche) {
AsyncCallback<D> callback = new AsyncCallback<D>() {
public void onFailure(Throwable caught) {
onLoadFailure(config, caught);
if (!UtilString.isEmpty(caught.getMessage())) {
Log.error("[FAILURE] ChargeurListe : message="+caught.getMessage());
} else {
Log.error("[FAILURE] ChargeurListe : message=NULL. Peut-être le modelType est-il mal paramétré ?");
}
}
public void onSuccess(D result) {
onLoadSuccess(config, result);
/*
// SUPPRIMER LES PREFIXES
if (result instanceof BasePagingLoadResult) {
BasePagingLoadResult retourPaging = (BasePagingLoadResult)result;
List retourListe = retourPaging.getData();
for(int i=0; i< retourListe.size(); i++) {
if (retourListe.get(i) instanceof BaseModelData) {
BaseModelData model = (BaseModelData)retourListe.get(i);
Map<String, Object> a = model.getProperties();
Set<String> cles = a.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
if (a.get(cle) != null) {
String cleObjet = "";
cleObjet = cle.replaceFirst("^[A-Za-z]+_", "");
model.set(cleObjet, a.get(cle));
model.remove(cle);
}
}
}
}
}*/
// Cas où il faut rafraichir le combo manuellement
// (cela sert pour charger la valeur initiale du combo au chargement d'un formulaire)
if (doRafraichir) {
Information info = new Information("selectionnerValeurCombo");
info.setDonnee(result);
info.setMessage("");
vueARafraichir.rafraichir(info);
}
}
};
((Proxy) proxy).load((TransformateurJSONaModelData) reader, config, callback, recherche);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/pagination/ChargeurListe.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/pagination/ChargeurListe.java:r1136-1208,1292-1367
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/Proxy.java
New file
0,0 → 1,34
package org.tela_botanica.client.composants.pagination;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.synchronisation.Sequenceur;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.MemoryProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public abstract class Proxy<D extends ModelData> extends MemoryProxy<D> implements Rafraichissable {
 
protected Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
protected DataReader<D> reader = null;
protected Object loadConfig = null;
protected AsyncCallback<D> callback = null;
protected static Object data;
protected Sequenceur sequenceur = null;
public Proxy(Sequenceur sequenceur) {
super(data);
this.sequenceur = sequenceur;
}
 
public abstract void load(TransformateurJSONaModelData<D> reader, Object loadConfig, AsyncCallback<D> callback, String recherche);
 
public abstract void rafraichir(Object nouvellesDonnees);
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/pagination/Proxy.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/pagination/Proxy.java:r1136-1208,1292-1367
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/ProxyCollectionACommentaire.java
New file
0,0 → 1,80
package org.tela_botanica.client.composants.pagination;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.ValeurListeAsyncDao;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoadResult;
import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.MemoryProxy;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.user.client.rpc.AsyncCallback;
 
public class ProxyCollectionACommentaire<D> extends Proxy {
String collectionId = null;
public ProxyCollectionACommentaire(Sequenceur sequenceur, String collectionId) {
super(sequenceur);
this.collectionId = collectionId;
}
@Override
public void load(TransformateurJSONaModelData reader, Object loadConfig, AsyncCallback callback, String recherche) {
this.reader = reader;
this.callback = callback;
this.loadConfig = loadConfig;
BasePagingLoadConfig lc = (BasePagingLoadConfig)loadConfig;
if (!UtilString.isEmpty(this.collectionId)) {
mediateur.selectionnerCollectionACommentaire(this, this.collectionId, recherche, lc.getOffset(), lc.getLimit(), sequenceur);
} else {
this.rafraichir(null);
}
}
 
@Override
@SuppressWarnings("unchecked")
public void rafraichir(Object nouvellesDonnees) {
try
{
D donneesRetour = null;
if (nouvellesDonnees!=null) {
data = nouvellesDonnees;
if (reader != null)
{
donneesRetour = (D) reader.read(loadConfig, data);
}
else
{
donneesRetour = (D) data;
if (donneesRetour instanceof List)
{
donneesRetour = (D) new ArrayList((List) donneesRetour);
}
}
}
callback.onSuccess(donneesRetour);
}
catch (Exception e)
{
callback.onFailure(e);
}
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/pagination/TransformateurJSONaModelData.java
New file
0,0 → 1,158
package org.tela_botanica.client.composants.pagination;
 
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
 
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.BasePagingLoadResult;
import com.extjs.gxt.ui.client.data.DataField;
import com.extjs.gxt.ui.client.data.DataReader;
import com.extjs.gxt.ui.client.data.JsonPagingLoadResultReader;
import com.extjs.gxt.ui.client.data.JsonReader;
import com.extjs.gxt.ui.client.data.ListLoadResult;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.data.ModelType;
import com.extjs.gxt.ui.client.data.PagingLoadConfig;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
 
public class TransformateurJSONaModelData<D> extends JsonPagingLoadResultReader<D> {
 
private ModelType modelType = null;
// HashMap<'nom du champ virtuel', 'nom du champ à binder'>
private HashMap<String, String> virtualFields = null;
public TransformateurJSONaModelData(ModelType modelType, HashMap<String, String> virtualFields) {
super(modelType);
this.modelType = modelType;
this.virtualFields = virtualFields;
}
 
@SuppressWarnings("unchecked")
@Override
protected Object createReturnData(Object loadConfig, List<ModelData> records, int totalCount) {
ListLoadResult<D> result = (ListLoadResult<D>) super.createReturnData(loadConfig, records, totalCount);
 
if (result instanceof PagingLoadResult) {
PagingLoadResult<D> r = (PagingLoadResult<D>) result;
r.setTotalLength(totalCount);
 
if (loadConfig instanceof PagingLoadConfig) {
PagingLoadConfig config = (PagingLoadConfig) loadConfig;
r.setOffset(config.getOffset());
}
}
return result;
 
}
 
@Override
protected BasePagingLoadResult<ModelData> newLoadResult(Object loadConfig, List<ModelData> models) {
return new BasePagingLoadResult<ModelData>(models);
}
 
@SuppressWarnings("unchecked")
public D read(Object loadConfig, Object data) {
JSONObject jsonRoot = null;
if (data instanceof JSONObject) {
jsonRoot = (JSONObject) data;
}
JSONArray root = (JSONArray) jsonRoot.get(modelType.getRoot());
int size = root.size();
ArrayList<ModelData> models = new ArrayList<ModelData>();
for (int i = 0; i < size; i++) {
JSONObject obj = (JSONObject) root.get(i);
ModelData model = newModelInstance();
for (int j = 0; j < modelType.getFieldCount(); j++) {
DataField field = modelType.getField(j);
String name = field.getName();
Class type = field.getType();
String map = field.getMap() != null ? field.getMap() : field.getName();
JSONValue value = obj.get(map);
if (value == null) continue;
if (value.isArray() != null) {
// nothing
} else if (value.isBoolean() != null) {
model.set(name, value.isBoolean().booleanValue());
} else if (value.isNumber() != null) {
if (type != null) {
Double d = value.isNumber().doubleValue();
if (type.equals(Integer.class)) {
model.set(name, d.intValue());
} else if (type.equals(Long.class)) {
model.set(name, d.longValue());
} else if (type.equals(Float.class)) {
model.set(name, d.floatValue());
} else {
model.set(name, d);
}
} else {
model.set(name, value.isNumber().doubleValue());
}
} else if (value.isObject() != null) {
// nothing
} else if (value.isString() != null) {
String s = value.isString().stringValue();
if (type != null) {
if (type.equals(Date.class)) {
if ("timestamp".equals(field.getFormat())) {
Date d = new Date(Long.parseLong(s) * 1000);
model.set(name, d);
} else {
DateTimeFormat format = DateTimeFormat.getFormat(field.getFormat());
Date d = format.parse(s);
model.set(name, d);
}
}
} else {
model.set(name, s);
}
} else if (value.isNull() != null) {
model.set(name, null);
}
if (virtualFields != null) {
Set<String> cles = virtualFields.keySet();
Iterator<String> it = cles.iterator();
while(it.hasNext()) {
String vField = it.next();
// si il y a un champ à binder
if (virtualFields.get(vField) != null) {
model.set(vField, model.get(virtualFields.get(vField)));
}
// sinon affecter la propriété à 'chaîne vide'
else {
model.set(virtualFields.get(vField), "");
}
}
}
}
models.add(model);
}
int totalCount = models.size();
if (modelType.getTotalName() != null) {
totalCount = getTotalCount(jsonRoot);
}
return (D) createReturnData(loadConfig, models, totalCount);
}
 
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/pagination/TransformateurJSONaModelData.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/pagination/TransformateurJSONaModelData.java:r1136-1208,1292-1367
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/ChampCaseACocher.java
New file
0,0 → 1,188
package org.tela_botanica.client.composants;
 
import java.util.Iterator;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.ValeurListe;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.form.CheckBoxGroup;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.extjs.gxt.ui.client.widget.tips.ToolTipConfig;
import com.google.gwt.core.client.GWT;
 
public class ChampCaseACocher extends LayoutContainer implements Rafraichissable {
private Configuration config = null;
private Mediateur mediateur = null;
private CheckBoxGroup groupeCaseACocher = null;
private boolean avoirChampAutre = false;
private Field<String> champAutre = null;
 
private String listeValeursCode = null;
private Sequenceur sequenceur = new Sequenceur();
public ChampCaseACocher(String label, String listeCode, boolean avoirChampAutre) {
config = (Configuration) Registry.get(RegistreId.CONFIG);
mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
 
setLayout(creerFormLayout(650, LabelAlign.TOP));
groupeCaseACocher = new CheckBoxGroup();
setLabel(label);
setChampAutre(avoirChampAutre);
setListeCode(listeCode);
mediateur.obtenirListeValeurEtRafraichir(this, getListeCode(), sequenceur);
}
public String getListeCode() {
return listeValeursCode;
}
public void setListeCode(String code) {
listeValeursCode = code;
}
public void setLabel(String label) {
groupeCaseACocher.setFieldLabel(label);
}
public boolean avoirChampAutre() {
return avoirChampAutre;
}
public void setChampAutre(boolean avoirChamp) {
avoirChampAutre = avoirChamp;
if (avoirChampAutre) {
champAutre = new TextArea();
champAutre.setWidth("80%");
}
}
public String getValeur() {
String valeur = "";
List<CheckBox> liste = groupeCaseACocher.getValues();
if (liste != null) {
int taille = liste.size();
for (int i = 0; i < taille; i++) {
CheckBox cac = liste.get(i);
if (cac.isEnabled()) {
valeur += aDonnee.SEPARATEUR_VALEURS+cac.getData("id");
}
}
}
if (avoirChampAutre() && !UtilString.isEmpty(champAutre.getValue())) {
valeur += aDonnee.SEPARATEUR_VALEURS+"AUTRE"+aDonnee.SEPARATEUR_TYPE_VALEUR+champAutre.getValue();
}
if (!UtilString.isEmpty(valeur)) {
valeur = valeur.replaceFirst("^"+aDonnee.SEPARATEUR_VALEURS, "");
}
return valeur;
}
public void peupler(String donnees) {
String[] valeurs = donnees.split(aDonnee.SEPARATEUR_VALEURS);
for (int i = 0; i < valeurs.length; i++) {
if (valeurs[i].startsWith("AUTRE"+aDonnee.SEPARATEUR_TYPE_VALEUR)) {
champAutre.setValue(valeurs[i].replaceFirst("^AUTRE"+aDonnee.SEPARATEUR_TYPE_VALEUR, ""));
} else {
//TODO : check : List<CheckBox> cases = groupeCac.getAll();
List<Field<?>> cases = groupeCaseACocher.getAll();
for (int j = 0; j < cases.size(); j++) {
if (cases.get(j).getId().equals("val-"+valeurs[i])) {
((CheckBox) cases.get(j)).setValue(true);
}
}
}
}
}
private FormLayout creerFormLayout(Integer labelWidth, LabelAlign labelAlign) {
FormLayout formLayout = new FormLayout();
if (labelWidth != null) {
formLayout.setLabelWidth(labelWidth);
}
if (labelAlign != null) {
formLayout.setLabelAlign(labelAlign);
}
return formLayout;
}
private void creerChoixMultipleCac(ValeurListe listeValeurs) {
addListener(Events.Hide, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
groupeCaseACocher.reset();
if (avoirChampAutre()) {
champAutre.setValue("");
}
}
});
groupeCaseACocher.setAutoWidth(true);
groupeCaseACocher.setStyleAttribute("padding", "3px");
groupeCaseACocher.setData("liste_id", listeValeurs.getId());
for (Iterator<String> it = listeValeurs.keySet().iterator(); it.hasNext();) {
Valeur val = listeValeurs.get(it.next());
String nom = val.get("nom");
CheckBox cac = new CheckBox();
cac.setId("val-"+val.getId());
cac.setData("id", val.getId());
cac.setBoxLabel(nom);
if (! val.getDescription().equals("NULL")) {
cac.setToolTip(new ToolTipConfig(val.getNom(), val.getDescription()));
}
groupeCaseACocher.add(cac);
}
add(groupeCaseACocher);
if (avoirChampAutre()) {
// FIXME : éviter le chevauchement du texte des cases à cocher avec le label "Autre" sur les petits écrans
LayoutContainer conteneur = new LayoutContainer();
conteneur.setLayout(new FlowLayout());
conteneur.add(new LabelField("Autre : "));
champAutre.setId("autre-"+listeValeurs.getId());
champAutre.setLabelStyle("font-weight:normal;");
conteneur.add(champAutre, new FormData(500, 0));
add(conteneur);
}
layout();
}
 
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof ValeurListe) {
ValeurListe listeValeurs = (ValeurListe) nouvellesDonnees;
if (listeValeurs.getId().equals(config.getListeId(getListeCode()))) {
creerChoixMultipleCac(listeValeurs);
}
} else {
GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/composants/ChampCaseACocher.java:r11-838,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/ChampCaseACocher.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/ChampCaseACocher.java:r1136-1367
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/ConteneurMultiChamps.java
New file
0,0 → 1,49
package org.tela_botanica.client.composants;
 
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.HBoxLayout;
import com.extjs.gxt.ui.client.widget.layout.LayoutData;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.extjs.gxt.ui.client.widget.layout.HBoxLayout.HBoxLayoutAlign;
import com.google.gwt.user.client.ui.Widget;
 
public class ConteneurMultiChamps extends LayoutContainer {
 
private LayoutContainer conteneurDesChamps = null;
 
public ConteneurMultiChamps(String label) {
setLayout(new RowLayout());
LabelField etiquette = new LabelField(label+":");
add(etiquette);
 
ContentPanel panneauGeneral = new ContentPanel(new FitLayout());
panneauGeneral.setHeaderVisible(false);
panneauGeneral.setHeight(25);
HBoxLayout dispositionDesChamps = new HBoxLayout();
dispositionDesChamps.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
conteneurDesChamps = new LayoutContainer();
conteneurDesChamps.setLayout(dispositionDesChamps);
panneauGeneral.add(conteneurDesChamps);
add(panneauGeneral);
}
public void ajouterChamp(Widget widget) {
ajouterChamp(widget, null);
}
public void ajouterChamp(Widget widget, LayoutData dispositionDesDonnees) {
if (dispositionDesDonnees != null) {
conteneurDesChamps.add(widget, dispositionDesDonnees);
} else {
conteneurDesChamps.add(widget);
}
layout();
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/composants/ConteneurMultiChamps.java:r11-858,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/ConteneurMultiChamps.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/ConteneurMultiChamps.java:r1136-1367
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/LicenceFenetre.java
New file
0,0 → 1,168
package org.tela_botanica.client.composants;
 
 
import org.tela_botanica.client.Coel;
import org.tela_botanica.client.ComposantClass;
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.UtilisateurAsyncDao;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.util.Format;
import com.extjs.gxt.ui.client.util.Params;
import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Text;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.form.CheckBox;
import com.extjs.gxt.ui.client.widget.layout.ColumnLayout;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.google.gwt.user.client.ui.HTML;
 
public class LicenceFenetre extends Dialog implements Rafraichissable{
private Constantes i18nC = null;
protected Button validerBouton = null;
private Button annulerBouton = null;
private String messageErreurTpl = "<div id='" + ComposantId.DIV_IDENTIFICATION_MSG + "'>{message}</div>";
private LayoutContainer messageErreur;
private HTML texteLicence;
private String licenceTpl = "<div class='{css_corps}'>{licence}</div>";
private IdentificationFenetre fenetreIdentification;
private CheckBox accepter;
public LicenceFenetre(IdentificationFenetre vueARafraichir) {
 
fenetreIdentification = vueARafraichir;
 
setSize(500, 300);
setPlain(true);
setHeadingHtml("Licence d'utilisation");
setIcon(Images.ICONES.application());
setLayout(new RowLayout());
setButtons(Dialog.OKCANCEL);
 
messageErreur = new LayoutContainer();
messageErreur.setLayout(new FitLayout());
add(messageErreur);
 
LayoutContainer licence = new LayoutContainer();
licence.setSize("98%", "75%");
licence.setStyleAttribute("padding", "5px");
licence.setLayout(new FlowLayout());
licence.setScrollMode(Scroll.AUTO);
 
texteLicence = new HTML();
licence.add(texteLicence);
add(licence);
 
LayoutContainer cbContainer = new LayoutContainer(new ColumnLayout());
accepter = new CheckBox();
cbContainer.add(accepter);
add(cbContainer);
Text txtAccepter = new Text(Mediateur.i18nC.licenceJaccepte());
txtAccepter.setStyleAttribute("padding", "3px");
cbContainer.add(txtAccepter);
setClosable(false);
show();
initialiserComposants();
}
public void initialiserComposants() {
Params licenceParam = new Params();
licenceParam.set("message", Mediateur.i18nC.licenceAccepter());
messageErreur.el().setInnerHtml(Format.substitute(messageErreurTpl, licenceParam));
Params parametres = new Params();
String licence = Mediateur.i18nC.licence();
parametres.set("licence", licence);
parametres.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
texteLicence.setHTML(Format.substitute(licenceTpl, parametres));
}
 
@Override
protected void createButtons() {
// FIXME : l'instanciation dans le constructeur ne marche pas pour cette méthode...
i18nC = Mediateur.i18nC;
getButtonBar().removeAll();
validerBouton = new Button(i18nC.valider());
validerBouton.setItemId(OK);
validerBouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
onButtonPressed(ce.getButton());
}
});
annulerBouton = new Button(i18nC.annuler());
annulerBouton.setItemId(CANCEL);
annulerBouton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
onButtonPressed(ce.getButton());
}
});
addButton(annulerBouton);
addButton(validerBouton);
}
@Override
protected void onButtonPressed(Button button) {
if (Dialog.OK.equals(button.getItemId())) {
button.setEnabled(false);
boolean licenceAcceptee = accepter.getValue();
if (licenceAcceptee == true) {
((Mediateur) Registry.get(RegistreId.MEDIATEUR)).accepterLicence(this);
} else {
hide();
}
} else {
hide();
}
}
public void rafraichir(Object nouvellesDonnees) {
if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("maj_licence")) {
String licence = info.getDonnee(0).toString();
if (licence.equals("1")) {
if (fenetreIdentification != null && fenetreIdentification.isVisible()) {
// si on est en train de se logger depuis Coel
fenetreIdentification.onSubmit();
} else {
// si on était loggé depuis ailleurs par le SSO,
// get état utilisateur forcé pour rafraîchir l'état de l'utilisateur maitnenant
// que la licence est acceptée - on pourrait sûrement faire mieux
// (ne pas rappeler le SSO ?)
Mediateur lePutainDeMediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
UtilisateurAsyncDao uad = new UtilisateurAsyncDao(lePutainDeMediateur);
uad.getEtatUtilisateur();
}
hide();
} else {
//Licence non acceptée, on masque la fenêtre pour laisser
// affiché la fenêtre d'identification qui est en erreur.
hide();
}
}
}
}
 
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/composants/LicenceFenetre.java:r11-893,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/LicenceFenetre.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/LicenceFenetre.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/composants/AideFenetre.java
New file
0,0 → 1,345
package org.tela_botanica.client.composants;
 
import org.tela_botanica.client.ComposantId;
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.images.Images;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.Menu;
import org.tela_botanica.client.util.Pattern;
import org.tela_botanica.client.util.Print;
 
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.ButtonScale;
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.event.TreePanelEvent;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.store.TreeStore;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.HtmlContainer;
import com.extjs.gxt.ui.client.widget.Info;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.StoreFilterField;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.extjs.gxt.ui.client.widget.treepanel.TreePanel;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.Request;
import org.tela_botanica.client.http.RequestBuilderWithCredentials;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.Event;
 
public class AideFenetre extends Dialog {
 
private static final String SERVICE_NOM = "CoelAide";
private static final String PAGE_SOMMAIRE_CODE = "AideCOELSommaire";
private static final String PAGE_A_OUVRIR_CODE = "AideCOELPresentationGenerale";
private static Menu pagePrincipale = null;
private static Menu menuAOuvrirParDefaut = null;
private TreePanel<Menu> arbre = null;
private TreeStore<Menu> magazin = null;
private StoreFilterField<Menu> filtre = null;
private Menu sommaire = null;
private ContentPanel sommairePanneau = null;
private ContentPanel contenuPanneau = null;
private HtmlContainer conteneurDuHtml;
private LayoutContainer entetePanneau;
private ToolBar sommaireBarreOutils;
public AideFenetre() {
setBodyBorder(false);
setButtons(Dialog.OK);
setIcon(Images.ICONES.appPanneauListe());
setHeadingHtml("COEL - Aide");
setWidth(675);
setHeight(400);
setHideOnButtonClick(true);
setLayout(new BorderLayout());
creerPanneauEntete();
creerPanneauSommaire();
getSommaireArbreModele();
creerPanneauContenu();
}
 
private void creerPanneauEntete() {
entetePanneau = new LayoutContainer();
entetePanneau.setLayout(new FlowLayout());
BorderLayoutData enteteDisposition = new BorderLayoutData(LayoutRegion.NORTH, 30);
add(entetePanneau, enteteDisposition);
}
 
private void creerPanneauSommaire() {
inititialiserSommaireArbreFiltre();
creerSommaire();
sommairePanneau = new ContentPanel();
sommairePanneau.setScrollMode(Scroll.AUTO);
sommairePanneau.setHeight("100%");
sommairePanneau.setHeaderVisible(false);
creerBarreOutilSommaire();
BorderLayoutData sommaireDisposition = new BorderLayoutData(LayoutRegion.WEST, 230, 175, 350);
sommaireDisposition.setMargins(new Margins(0, 5, 0, 0));
sommaireDisposition.setSplit(true);
sommaireDisposition.setFloatable(true);
add(sommairePanneau, sommaireDisposition);
}
 
private void creerBarreOutilSommaire() {
sommaireBarreOutils = new ToolBar();
// FIXME : on peut utiliser l'alignement à droite car cela pose un problème de rendu dans le Hosted Mode
//sommaireBarreOutils.setAlignment(HorizontalAlignment.RIGHT);
creerBoutonPlierDeplier();
sommairePanneau.setTopComponent(sommaireBarreOutils);
}
 
private void creerBoutonPlierDeplier() {
Button plierDeplierToutBtn = new Button();
plierDeplierToutBtn.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent be) {
Button boutonPlierDeplierTout = (Button) be.getSource();
if (boutonPlierDeplierTout.getIcon().equals(Images.ICONES.deplierTout())) {
boutonPlierDeplierTout.setIcon(Images.ICONES.replierTout());
arbre.expandAll();
} else if (boutonPlierDeplierTout.getIcon().equals(Images.ICONES.replierTout())) {
boutonPlierDeplierTout.setIcon(Images.ICONES.deplierTout());
arbre.collapseAll();
}
boutonPlierDeplierTout.repaint();
}
});
plierDeplierToutBtn.setIcon(Images.ICONES.deplierTout());
plierDeplierToutBtn.setScale(ButtonScale.SMALL);
plierDeplierToutBtn.setToolTip(Mediateur.i18nC.plierDeplierToutBtn());
sommaireBarreOutils.add(plierDeplierToutBtn);
}
 
private void creerPanneauContenu() {
contenuPanneau = new ContentPanel();
contenuPanneau.setScrollMode(Scroll.AUTO);
creerBarreOutilContenu();
BorderLayoutData contenuDisposition = new BorderLayoutData(LayoutRegion.CENTER);
add(contenuPanneau, contenuDisposition);
}
private void creerBarreOutilContenu() {
Button imprimerBtn = new Button(null, new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent be) {
Print.it(conteneurDuHtml.el().getInnerHtml());
}
});
imprimerBtn.setIcon(Images.ICONES.imprimer());
contenuPanneau.getHeader().insertTool(imprimerBtn, 0);
}
 
private void etendreArbre(Menu menuAOuvrir) {
if (menuAOuvrir != null) {
arbre.setExpanded(menuAOuvrir, true);
arbre.getSelectionModel().select(menuAOuvrir, false);
}
}
private void etendreArbre(String menuCode) {
Menu menuAOuvrir = magazin.findModel("code", menuCode);
etendreArbre(menuAOuvrir);
}
 
private void creerSommaire() {
magazin = new TreeStore<Menu>();
filtre.bind(magazin);
arbre = new TreePanel<Menu>(magazin);
arbre.setAutoLoad(true);
arbre.setHeight("100%");
arbre.setDisplayProperty("nom");
arbre.getStyle().setLeafIcon(Images.ICONES.aide());
arbre.addListener(Events.OnClick, new Listener<TreePanelEvent<Menu>>(){
public void handleEvent(TreePanelEvent<Menu> tpe) {
Menu menuSelectionne = arbre.getSelectionModel().getSelectedItem();
if (menuSelectionne.get("code") != null) {
selectionSommaire((String) menuSelectionne.get("code"));
}
}
});
}
private void definirMenuAOuvrirParDefaut() {
menuAOuvrirParDefaut = magazin.findModel("code", PAGE_A_OUVRIR_CODE);
}
 
private void selectionSommaire(String page) {
String serviceUrl = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl();
String aidePageUrl = serviceUrl+SERVICE_NOM+"/"+page;
chargerPageAide(aidePageUrl);
}
private void chargerPageAide(String url) {
conteneurDuHtml = new HtmlContainer() {
public void onBrowserEvent(Event e) {
// Nous vérifions que l'évenement est un clic et qu'il a lieu sur un lien
if (e.getTypeInt() == Event.ONCLICK && e.getEventTarget().toString().startsWith("http://")) {
e.preventDefault();
String urlPageAideCible = e.getEventTarget().toString();
chargerPageAide(urlPageAideCible);
String codePageAideCible = urlPageAideCible.substring(urlPageAideCible.lastIndexOf("/")+1);
etendreArbre(codePageAideCible);
} else {
GWT.log("Event target:"+e.getEventTarget().toString()+" - type :"+e.getTypeInt()+"="+Event.ONCLICK, null);
}
}
};
conteneurDuHtml.setId(ComposantId.PANNEAU_AIDE);
conteneurDuHtml.setWidth(400);
conteneurDuHtml.sinkEvents(Event.ONCLICK);
conteneurDuHtml.setUrl(url);
conteneurDuHtml.recalculate();
contenuPanneau.removeAll();
contenuPanneau.add(conteneurDuHtml);
contenuPanneau.layout();
}
private void inititialiserSommaireArbreFiltre() {
filtre = new StoreFilterField<Menu>() {
@Override
protected boolean doSelect(Store<Menu> magazin, Menu parent, Menu enregistrement, String propriete, String filtre) {
Boolean retour = false;
// Seul les feuilles sont traitées par le filtre
String nomMenu = enregistrement.getNom();
String nomMenuMinuscule = nomMenu.toLowerCase();
String nomFiltreMinuscule = filtre.toLowerCase();
String nomFiltreMinusculeProtege = Pattern.quote(nomFiltreMinuscule);
if (nomMenuMinuscule.matches(".*"+nomFiltreMinusculeProtege+".*")) {
retour = true;
}
return retour;
}
};
filtre.setFieldLabel(Mediateur.i18nC.chercher());
filtre.setLabelStyle("font-weight:normal;");
filtre.setToolTip("Filtrer le sommaire");
filtre.setWidth(200);
FormLayout fl = new FormLayout();
fl.setLabelWidth(55);
ContentPanel fp = new ContentPanel();
fp.setHeaderVisible(false);
fp.setLayout(fl);
fp.add(filtre);
entetePanneau.add(fp);
}
public void getSommaireArbreModele() {
String serviceUrl = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl();
String sommairePageUrl = serviceUrl+SERVICE_NOM+"/"+PAGE_SOMMAIRE_CODE+"/sommaire";
RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.GET, sommairePageUrl);
try {
rb.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
// Gestion des exceptions déclenchées par l'exécution de la requête
GWT.log(Mediateur.i18nM.erreurServiceJrest(SERVICE_NOM), exception);
InfoLogger.display(Mediateur.i18nM.erreurRequeteTitre(), Mediateur.i18nM.erreurRequete(), true);
}
public void onErrorHTTP(Request request, Response reponse) {
// Gestion des erreurs HTTP renvoyé par Apache ou JRest
Information info = new Information("erreur_jrest", JSONParser.parse(reponse.getText()).isArray());
GWT.log("Erreur JREST - Code "+reponse.getStatusCode()+"\n"+info.getMessages().toString(), null);
InfoLogger.display("Erreur JREST - Code "+reponse.getStatusCode(), info.toString(), true);
}
public void onResponseReceived(Request request, Response response) {
// Si le code de réponse HTTP ne vaut pas 200 OK, on lance le mécanise d'erreur HTTP
if (response.getStatusCode() != 200) {
onErrorHTTP(request, response);
} else {
if (response.getText().length() != 0 && response.getText() != null) {
final JSONValue responseValue = JSONParser.parse(response.getText());
JSONArray jsonArray = responseValue.isArray();
if (jsonArray != null) {
sommaire = new Menu(Mediateur.i18nC.sommaire());
ajouterMenuRecursivement(sommaire, jsonArray);
 
magazin.removeAll();
magazin.add(sommaire, true);
definirMenuAOuvrirParDefaut();
sommairePanneau.add(arbre);
sommairePanneau.layout();
// Chargement de la page racine
selectionSommaire(pagePrincipale.getCode());
etendreArbre(menuAOuvrirParDefaut);
} else {
GWT.log(Mediateur.i18nM.erreurJson(responseValue.toString()), null);
}
}
}
}
});
} catch (RequestException e) {
e.printStackTrace();
}
}
private void ajouterMenuRecursivement(Menu brancheSommaire, JSONArray tableau) {
final int tailleMax = tableau.size();
 
for (int i = 0; i < tailleMax; i++) {
JSONObject pageCourante = tableau.get(i).isObject() ;
if (pageCourante != null) {
Menu menuCourrant = new Menu();
if (pageCourante.get("code") != null) {
String codeCourant = pageCourante.get("code").isString().stringValue();
menuCourrant.setCode(codeCourant);
}
if (pageCourante.get("txt") != null) {
menuCourrant.setNom(pageCourante.get("txt").isString().stringValue());
}
if (menuCourrant.getNom() == null && menuCourrant.getCode() == null) {
menuCourrant = (Menu) brancheSommaire.getChild((brancheSommaire.getChildCount() - 1));
} else {
if (brancheSommaire != null) {
brancheSommaire.add(menuCourrant);
if (pagePrincipale == null) {
pagePrincipale = menuCourrant;
}
}
}
if (pageCourante.get("liste") != null) {
ajouterMenuRecursivement(menuCourrant, pageCourante.get("liste").isArray());
}
}
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/composants/AideFenetre.java:r11-60,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/composants/AideFenetre.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/composants/AideFenetre.java:r1136-1367
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/ValeurListe.java
New file
0,0 → 1,141
package org.tela_botanica.client.modeles;
 
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.ListePaginable;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.i18n.client.Dictionary;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
 
/**
* Table de hachage composée d'informations sur les Valeurs des listes, renvoyé par un objet de type DAO
* La clé est le nom de l'entite + le nom de l'entite parente
*
* @author david delon
*
*/
public class ValeurListe extends aDonneeListe<Valeur> {
/**
* Identifiant pour sérialisé l'objet...
*/
private static final long serialVersionUID = 7784635999621813450L;
private Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
private int nbElementsTotal;
// Id de la meta-liste dans la base de données
private int id = 0;
private String abv = "";
/**
* Constructeur sans paramètres
*/
public ValeurListe() {
super();
}
/**
* Constructeur avec paramètre
* @param taille la taille de la table de hachage
*/
public ValeurListe(int taille) {
super(taille);
}
/**
* Constructeur pour une liste d'institutions
* @param dates
*/
public ValeurListe(JSONArray liste) {
super(liste.size());
this.constuireObjet(liste);
}
 
public ValeurListe(JSONString listeId, JSONArray listeValeurs) {
super(listeValeurs.size());
this.setId(Integer.parseInt(listeId.stringValue()));
this.constuireObjet(listeValeurs);
}
public ValeurListe(JSONString listeId, String abv, JSONArray listeValeurs, JSONNumber nbElements) {
super(listeValeurs.size());
this.setId(Integer.parseInt(listeId.stringValue()));
this.abv = abv;
this.setNbElementsTotal(nbElements.toString());
this.constuireObjet(listeValeurs);
}
protected void constuireObjet(JSONArray liste) {
final int taillemax = liste.size();
for (int i = 0; i < taillemax; i++) {
JSONObject listeValeur = liste.get(i).isObject();
if (listeValeur != null) {
Valeur valeur = new Valeur(listeValeur);
this.put(valeur.getId(), valeur);
}
}
}
/**
* @param id l'identifiant à définir
*/
public void setId(int id) {
this.id = id;
}
public void setNbElementsTotal(String nbElements) {
this.nbElementsTotal = Integer.parseInt(nbElements);
}
 
/**
* @return l'identifiant de la liste
*/
public Integer getId() {
return id;
}
public String getFullId() {
return (id+abv);
}
public void ajouter(Valeur val) {
this.put(val.getId(), val);
}
public ValeurListe cloner()
{
ValeurListe l = new ValeurListe();
Iterator i = this.keySet().iterator();
while (i.hasNext())
{
String clef = (String)i.next();
Valeur valeur = this.get(clef);
l.put(clef, valeur);
}
 
return l;
}
public void concatenerListe(ValeurListe lv) {
this.putAll(lv);
this.setId(lv.getId());
}
 
}
 
 
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/ValeurListe.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/ValeurListe.java:r11-68,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/ValeurListe.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/Aide.java
New file
0,0 → 1,42
package org.tela_botanica.client.modeles;
 
import com.extjs.gxt.ui.client.data.BaseTreeModel;
 
public class Aide extends BaseTreeModel {
 
private static final long serialVersionUID = 4660015084509968872L;
 
public Aide() {
}
 
public Aide(String n) {
set("nom", n);
}
 
public Aide(String nom, String code, String auteur, String groupe) {
set("nom", nom);
set("code", code);
set("auteur", auteur);
set("groupe", groupe);
}
 
public String getNom() {
return (String) get("nom");
}
public String getCode() {
return (String) get("code");
}
 
public String getAuteur() {
return (String) get("auteur");
}
 
public String getGroupe() {
return (String) get("groupe");
}
 
public String toString() {
return getNom();
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/Aide.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/Aide.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/Aide.java:r11-65,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/Menu.java
New file
0,0 → 1,50
package org.tela_botanica.client.modeles;
 
import java.io.Serializable;
 
import com.extjs.gxt.ui.client.data.BaseTreeModel;
 
public class Menu extends BaseTreeModel implements Serializable {
 
/**
* Identifiant pour sérialisé l'objet...
*/
private static final long serialVersionUID = 4;
 
public Menu() {
}
 
public Menu(String nom) {
set("nom", nom);
}
public Menu(String nom, String code) {
set("nom", nom);
set("code", code);
}
 
public Menu(String nom, BaseTreeModel[] enfant) {
this(nom);
for (int i = 0; i < enfant.length; i++) {
add(enfant[i]);
}
}
 
public String getNom() {
return get("nom");
}
public void setNom(String nom) {
set("nom", nom);
}
public String getCode() {
return get("code");
}
public void setCode(String code) {
set("code", code);
}
 
public String toString() {
return getNom()+" - Nbre enfant :"+this.getChildCount();
}
 
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/modeles/Menu.java:r11-59,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/Menu.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/Menu.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/SimpleModelData.java
New file
0,0 → 1,57
package org.tela_botanica.client.modeles;
 
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
 
import com.extjs.gxt.ui.client.data.ModelData;
 
public class SimpleModelData implements ModelData {
private Map<String, Object> modele = new HashMap<String, Object>();
public SimpleModelData(String cle, String valeur, String ordre) {
this.set("cle", cle);
this.set("valeur", valeur);
this.set("ordre", ordre);
}
public String getValeur() {
return (String)modele.get("valeur");
}
public String getCle() {
return (String)modele.get("cle");
}
public String getOrdre() {
return (String)modele.get("ordre");
}
 
@Override
public String get(String property) {
return (String)modele.get(property);
}
 
@Override
public Map<String, Object> getProperties() {
return modele;
}
 
@Override
public Collection<String> getPropertyNames() {
return modele.keySet();
}
 
@Override
public String remove(String property) {
return (String)modele.remove(property);
}
 
@Override
public <Object> Object set(String property, Object value) {
modele.put(property, value);
return value;
}
 
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/MenuApplicationId.java
New file
0,0 → 1,12
package org.tela_botanica.client.modeles;
 
public class MenuApplicationId {
public static final String ACCUEIL = "Accueil";
public static final String STRUCTURE = "Structures";
public static final String COLLECTION = "Collections";
public static final String PERSONNE = "Personnes";
public static final String PUBLICATION = "Publications";
public static final String COMMENTAIRE = "Commentaires";
public static final String STATS = "Statistiques";
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/modeles/MenuApplicationId.java:r11-325,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/MenuApplicationId.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/MenuApplicationId.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/aDonnee.java
New file
0,0 → 1,494
package org.tela_botanica.client.modeles;
 
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
 
import org.tela_botanica.client.util.UtilArray;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.core.FastMap;
import com.extjs.gxt.ui.client.data.BaseModelData;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.user.client.Window;
 
/**
* @author jpm
*
*/
public abstract class aDonnee extends BaseModelData implements Serializable {
 
private static final long serialVersionUID = 3527760464061629791L;
public static final boolean SUPPRIMER_PREFIXE = true;
public static final boolean GARDER_PREFIXE = false;
public static final boolean INTEGRER_PROPRIETES = true;
public static final String TYPE_AUTRE = "AUTRE";
public static final String TYPE_TOTAL = "TOTAL";
public static final String SEPARATEUR_TYPE_VALEUR = "##";
public static final String SEPARATEUR_VALEURS = ";;";
public static final String SEPARATEUR_DONNEES = "||";
public static final String ETAT_AJOUTE = "A";
public static final String ETAT_MODIFIE = "M";
public static final String VALEUR_NULL = "NC";
 
public HashMap<String, String> valeursInitiales = new HashMap<String, String>();
protected boolean removePrefix = true;
 
protected abstract String getPrefixe();
protected abstract String[] getChampsObligatoires();
public String getDateModification() {
return (String) renvoyerValeurCorrecte("cmhl_date_modification");
}
public String getNotes() {
return (String) renvoyerValeurCorrecte("cmhl_notes");
}
public String getIdModifierPar() {
return (String) renvoyerValeurCorrecte("cmhl_ce_modifier_par");
}
public String getIdEtat() {
return (String) renvoyerValeurCorrecte("cmhl_ce_etat");
}
public String getIp() {
return (String) renvoyerValeurCorrecte("cmhl_ip");
}
protected void initialiserModele(JSONObject jsonObjet) {
// l'objet JSON est une table de hachage
Set<String> im = jsonObjet.keySet();
valeursInitiales = new HashMap<String, String>();
// Parcourt pour chaque clé
for (Iterator<String> it = im.iterator(); it.hasNext();) {
// Si elle est associée à une valeur, nous l'ajoutons
String cle = it.next();
if (cle.startsWith(getPrefixe()+"_") ||cle.matches("^_.+_$")) {
// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
String cleObjet = cle.replaceFirst("^"+getPrefixe()+"_", "");
// Sinon, nous ajoutons la clé avec une valeur vide
String valeur = "";
if (jsonObjet.get(cle).isString() != null) {
valeur = jsonObjet.get(cle).isString().stringValue();
}
valeursInitiales.put(cleObjet, valeur);
this.set(cleObjet, valeur);
}
}
}
public void setValeurInitiale(String cleObjet, String valeur) {}
 
/**
* Pour éviter que l'on traite des valeurs nulles à l'affichage on passe par
* cette fonction qui retire les charactères nuls qui font planter
* l'affichage, il ne faut pas utiliser get directement.
* Elle ajoute aussi le préfixe au nom du champ si nécessaire.
*
* @param cle le nom du champ sans le préfixe.
* @return la valeur associée à la clé
*/
protected String renvoyerValeurCorrecte(String cle) {
String sortie = "";
cle = gererPrefixe(cle);
if (this.get(cle) != null) {
String valeur = ""+this.get(cle);
if (! valeur.equals("null")) {
char nullChar = '\u0000';
String sNull = "" + nullChar;
valeur = valeur.replaceAll(sNull, "");
sortie = valeur;
}
}
return sortie;
}
/**
* Ajoute le préfixe au nom du champ si nécessaire.
*
* @param la clé du champ
* @param la valeur associé à la clé
*/
protected void setValeurCorrecte(String cle, String valeur) {
cle = gererPrefixe(cle);
set(cle, valeur);
}
/**
* Ajoute un nouvel élément avec son type à une chaine dénormalisée.
* Champ de type "truk" contenant des valeurs séparées par ";;" qui elle même possèdent un type séparé par "##".
* Si l'élément existe déjà, il ne sera pas ajouté.
*
* @param champ le nom du champ dénormalisé
* @param type le type de la valeur à ajouter
* @param valeur la valeur à ajouter
*/
protected void ajouterChaineDenormaliseAvecType(String champ, String type, Object valeur) {
if (valeur instanceof String) {
String chaineExistante = renvoyerValeurCorrecte(champ);
if (UtilString.isEmpty(chaineExistante)) {
this.set(champ, type+SEPARATEUR_TYPE_VALEUR+valeur);
} else {
// Si la valeur à ajouter n'est pas déjà présente, nous l'ajoutons
if (!chaineExistante.matches("(^|"+SEPARATEUR_VALEURS+")"+type+SEPARATEUR_TYPE_VALEUR+valeur+"("+SEPARATEUR_VALEURS+"|$)")) {
this.set(champ, chaineExistante+";;"+type+SEPARATEUR_TYPE_VALEUR+valeur);
}
}
}
}
protected void supprimerTypeDansChaineDenormalise(String champ, String type) {
String chaineExistante = renvoyerValeurCorrecte(champ);
if (!UtilString.isEmpty(chaineExistante)) {
if (chaineExistante.matches("(?:^|.*"+SEPARATEUR_VALEURS+")"+type+SEPARATEUR_TYPE_VALEUR+".*")) {
chaineExistante = chaineExistante.replaceFirst("(^|.*"+SEPARATEUR_VALEURS+")"+type+SEPARATEUR_TYPE_VALEUR+".*?("+SEPARATEUR_VALEURS+".*|$)", "$1$2");
chaineExistante = chaineExistante.replaceAll("(.*)"+SEPARATEUR_VALEURS+SEPARATEUR_VALEURS+"(.*)", "$1"+SEPARATEUR_VALEURS+"$2");
chaineExistante = chaineExistante.replaceAll("^"+SEPARATEUR_VALEURS+"(.*)", "$1");
chaineExistante = chaineExistante.replaceAll("(.*)"+SEPARATEUR_VALEURS+"$", "$1");
this.set(champ, chaineExistante);
}
}
}
protected void remplacerTypeDansChaineDenormalise(String champ, String type, Object valeur) {
if (valeur != null && !valeur.equals("")) {
ajouterChaineDenormaliseAvecType(champ, type, valeur);
} else {
supprimerTypeDansChaineDenormalise(champ, type);
}
}
/**
* Ajoute un nouvel élément sans type à une chaine dénormalisée.
* Champ de type "truk" contenant seulement des valeurs séparées par ";;".
* Si l'élément existe déjà, il ne sera pas ajouté.
*
* @param champ le nom du champ dénormalisé
* @param valeur la valeur à ajouter
*/
protected void ajouterChaineDenormalise(String champ, Object valeur) {
if (valeur instanceof String) {
String chaineExistante = renvoyerValeurCorrecte(champ);
if (UtilString.isEmpty(chaineExistante)) {
this.set(champ, valeur);
} else {
// Si la valeur à ajouter n'est pas déjà présente, nous l'ajoutons
if (!chaineExistante.matches("(^|"+SEPARATEUR_VALEURS+")"+valeur+"("+SEPARATEUR_VALEURS+"|$)")) {
this.set(champ, chaineExistante+SEPARATEUR_VALEURS+valeur);
}
}
}
}
/**
* Permet de constuire correctement une chaine dénormalisée unique (champ de type "ce_truk").
*
* @param champ le nom du champ dénormalisé
* @param type le type de la valeur à ajouter
* @param valeur la valeur à ajouter
*/
protected void setChaineDenormaliseUnique(String champ, String type, String valeur) {
champ = gererPrefixe(champ);
if (valeur == null || UtilString.isEmpty(valeur)) {
this.set(champ, "");
} else if (valeur instanceof String) {
if (((String) valeur).matches("^[0-9]+$")) {
this.set(champ, valeur);
} else {
this.set(champ, type+SEPARATEUR_TYPE_VALEUR+valeur);
}
}
}
private String gererPrefixe(String champ) {
String champMisAJour = null;
String prefixe = getPrefixe()+"_";
if (removePrefix) {
champMisAJour = champ.replaceFirst(prefixe, "");
} else {
champMisAJour = (champ.startsWith(prefixe)) ? champ : prefixe+champ ;
}
return champMisAJour;
}
/**
* Permet de récupérer pour l'affichage une chaine dénormalisée unique (champ de type "ce_truk").
*
* @param champ le nom du champ dénormalisé
*/
protected String getChaineDenormaliseUnique(String champ) {
String valeur = renvoyerValeurCorrecte(champ);
if (!UtilString.isEmpty(valeur)) {
valeur = valeur.replaceFirst("^"+TYPE_AUTRE+SEPARATEUR_TYPE_VALEUR, "");
}
return valeur;
}
protected String getInfoDenormaliseParType(String chaineExistante, String type) {
String sortie = "";
if (!UtilString.isEmpty(chaineExistante)) {
String[] valeurs = chaineExistante.split(SEPARATEUR_VALEURS);
for (int i = 0; i < valeurs.length; i++) {
if (valeurs[i].startsWith(type+SEPARATEUR_TYPE_VALEUR)) {
sortie = valeurs[i].replaceFirst("^"+type+SEPARATEUR_TYPE_VALEUR, "");
}
}
}
return sortie;
}
/**
* Permet de récupérer une map avec toutes les valeurs de la chaine truk sous la forme clé => valeur
*
* @param champ le nom du champ dénormalisé
* @return map ou liste en fonction du type de chaine truk (list si champ;;champ;; map si type##champ;;)
*/
public Object getChaineDenormaliseAsMapOrList(String champ) {
Object retourObjet = null;
String valeurChamp = renvoyerValeurCorrecte(champ);
if ((valeurChamp!=null)&&(!valeurChamp.trim().equals(""))) {
String[] valeurs = valeurChamp.split(SEPARATEUR_VALEURS);
if (valeurs.length > 0) {
if (valeurs[0].contains(SEPARATEUR_TYPE_VALEUR)) {
// Les champs sont typés, on en fait une Map
HashMap<String,String> mapValeurs = new HashMap<String,String>();
for (int i = 0; i < valeurs.length; i++) {
String typeEtValeur[] = valeurs[i].split(SEPARATEUR_TYPE_VALEUR);
mapValeurs.put(typeEtValeur[1], typeEtValeur[0]);
}
retourObjet = mapValeurs;
}
else {
//Les champs ne sont pas typés, on en fait une Liste
LinkedList<String> listeValeurs = new LinkedList<String>();
for (int i = 0; i < valeurs.length; i++) {
if ((valeurs[i]!=null)&&(!valeurs[i].equals(""))) {
listeValeurs.add(valeurs[i]);
}
}
retourObjet = listeValeurs;
}
}
}
return retourObjet;
}
/**
* Permet de modifier correctement une chaine dénormalisée (champ de type "truk").
* Remplace par la valeur de la première instance du type indiqué dans la chaine dénormalisée.
* Si aucun type n'est trouvé, nous en ajoutons un avec la nouvelle valeur.
*
* @param champ le nom du champ dénormalisé
* @param type le type de la valeur à modifier
* @param valeur la valeur pour le type en question
*/
protected void modifierChaineDenormaliseParType(String champ, String type, Object valeur) {
if (valeur == null || valeur.equals("")) {
supprimerTypeDansChaineDenormalise(champ, type);
} else if (valeur instanceof String) {
String chaineExistante = renvoyerValeurCorrecte(champ);
if (UtilString.isEmpty(chaineExistante)) {
this.set(champ, type+SEPARATEUR_TYPE_VALEUR+valeur);
} else {
String[] valeurs = chaineExistante.split(SEPARATEUR_VALEURS);
HashMap<String,String> valeursModifiees = new HashMap<String,String>();
for (int i = 0; i < valeurs.length; i++) {
if (valeurs[i].startsWith(type+SEPARATEUR_TYPE_VALEUR)) {
valeursModifiees.put(type, type+SEPARATEUR_TYPE_VALEUR+valeur);
} else if (i == (valeurs.length -1) && !valeurs[i].startsWith(type+SEPARATEUR_TYPE_VALEUR)) {
valeursModifiees.put(valeurs[i].split(SEPARATEUR_TYPE_VALEUR)[0], valeurs[i]);
valeursModifiees.put(type, type+SEPARATEUR_TYPE_VALEUR+valeur);
} else {
valeursModifiees.put(valeurs[i].split(SEPARATEUR_TYPE_VALEUR)[0], valeurs[i]);
}
}
String[] tableauValeursModifiees = valeursModifiees.values().toArray(new String[valeursModifiees.size()]);
this.set(champ, UtilArray.implode(tableauValeursModifiees, SEPARATEUR_VALEURS));
}
}
}
protected String getInfoDenormaliseParPosition(String chaineExistante, int position) {
String sortie = "";
if (!UtilString.isEmpty(chaineExistante)) {
String[] valeurs = chaineExistante.split(SEPARATEUR_VALEURS);
if (valeurs.length >= position) {
for (int i = 0; i < valeurs.length; i++) {
if (i == (position - 1)) {
if (valeurs[i].contains(SEPARATEUR_TYPE_VALEUR)) {
sortie = valeurs[i].replaceFirst("^[^#]+"+SEPARATEUR_VALEURS, "");
} else {
sortie = valeurs[i];
}
break;
}
}
}
}
return sortie;
}
/**
* Permet de modifier correctement une chaine dénormalisée (champ de type "truk").
* Remplace par la valeur l'instance dont la position a été indiquée.
* Si la chaine dénormalisée est vide, l'élement est ajouté quelque soit la position indiquée.
* Si la position est supérieure au nombre d'élément de la chaine dénormalisé, rien n'est modifié.
*
* @param champ le nom du champ dénormalisé
* @param position le type de la valeur à modifier
* @param valeur la valeur à remplacer à la position indiquée
*/
protected void modifierChaineDenormaliseParPosition(String champ, int position, Object valeur) {
if (valeur == null || valeur.equals("")) {
supprimerChaineDenormaliseParPosition(champ, position);
} else if (valeur instanceof String) {
String chaineExistante = renvoyerValeurCorrecte(champ);
if (UtilString.isEmpty(chaineExistante)) {
this.set(champ, valeur);
} else {
String[] valeurs = chaineExistante.split(SEPARATEUR_VALEURS);
if (valeurs.length >= position) {
for (int i = 0; i < valeurs.length; i++) {
if (i == (position - 1)) {
valeurs[i] = (String) valeur;
break;
}
}
this.set(champ, UtilArray.implode(valeurs, SEPARATEUR_VALEURS));
}
}
}
}
protected void supprimerChaineDenormaliseParPosition(String champ, int position) {
String chaineExistante = renvoyerValeurCorrecte(champ);
if (!UtilString.isEmpty(chaineExistante)) {
String[] valeurs = chaineExistante.split(SEPARATEUR_VALEURS);
HashMap<String,String> valeursModifiees = new HashMap<String,String>();
if (valeurs.length >= position) {
for (int i = 0; i < valeurs.length; i++) {
if (i != (position - 1)) {
valeursModifiees.put(""+i, valeurs[i]);
}
}
String[] tableauValeursModifiees = valeursModifiees.values().toArray(new String[valeursModifiees.size()]);
this.set(champ, UtilArray.implode(tableauValeursModifiees, SEPARATEUR_VALEURS));
}
}
}
/** (non-Javadoc)
* @see java.lang.Object#toString()
*/
public String toString() {
String sortie = "";
// Champs du BaseModelData
Set<String> proprietes = this.getProperties().keySet();
TreeSet<String> proprietesTriees = new TreeSet<String>(proprietes);
for (Iterator<String> it = proprietesTriees.iterator(); it.hasNext();) {
String cle = it.next();
if (this.get(cle) != null && !this.get(cle).equals("")) {
sortie += cle+" : "+this.get(cle).toString()+"\n";
}
}
return sortie;
}
public Boolean comparer(BaseModelData objetAComparer) {
Boolean retour = true;
Map<String, Object> a = this.getProperties();
Map<String, Object> b = objetAComparer.getProperties();
if (a.size() != b.size()) {
retour = false;
} else {
Set<String> cles = a.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
if (a.get(cle) != null && !a.get(cle).equals(b.get(cle))) {
retour = false;
break;
}
}
}
return retour;
}
public Object cloner(BaseModelData nouvelleInstance) {
Map<String, Object> proprietes = this.getProperties();
Set<String> cles = proprietes.keySet();
for (Iterator<String> it = cles.iterator(); it.hasNext();) {
String cle = it.next();
nouvelleInstance.set(cle, this.get(cle));
}
return nouvelleInstance;
}
/**
* Renvoie une chaîne de caractère formatée et encodée pour POST avec toutes les propriétés du modèle
* */
public String obtenirChainePOST() {
String post = "";
FastMap<?> proprietees = (FastMap<?>) getProperties();
Collection<String> cles = proprietees.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
//Les Radio Box couplées à la fonction autobind créent des variables gxt.RadioGroup.X, qu'il ne faut pas mettre dans la requête
if (!cle.startsWith("gxt.")&&!cle.matches("^_.+_$")) {
//Si, et seulement si, la valeur diffère de la valeur initiale OU la clé est dans les champs obligatoire
if (Arrays.asList(getChampsObligatoires()).contains(getPrefixe() + "_" + cle) || ((valeursInitiales.get(cle) != null && !valeursInitiales.get(cle).equals(get(cle))) || valeursInitiales.get(cle) == null)) {
post += getPrefixe() + "_" + cle + "=" + URL.encodeQueryString(renvoyerValeurCorrecte(cle));
if (it.hasNext()) {
post += "&";
}
}
}
}
return post;
}
/**
* Met à jour l'objet this avec les données de l'objet passé en paramêtre.
*/
public void mettreAJour(aDonnee nouveau) {
Collection<String> cles = nouveau.getProperties().keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
if (!this.get(cle).equals(nouveau.get(cle))) {
this.set(cle, nouveau.get(cle));
}
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/modeles/aDonnee.java:r11-68,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/aDonnee.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/aDonnee.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/personne/Personne.java
New file
0,0 → 1,403
package org.tela_botanica.client.modeles.personne;
 
import java.util.Date;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.collection.CollectionAPublication;
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.Log;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.json.client.JSONObject;
 
public class Personne extends aDonnee {
 
private static final long serialVersionUID = -6974716696155349332L;
 
public static final String PREFIXE = "cp";
public static final String TELEPHONE_FIXE = "FIX";
public static final String TELEPHONE_GSM = "GSM";
public static final String TELEPHONE_FAX = "FAX";
public static final String ETRE_DECEDE = "30745";
public static final String ETRE_VIVANT = "30746";
public static String[] champsObligatoires = {"cp_id_personne"};
private PublicationAPersonneListe publicationsLiees= null;
public Personne() {}
 
public Personne(ModelData model) {
creerPersonne(model, false);
}
public Personne(ModelData model, boolean removePrefix) {
creerPersonne(model, removePrefix);
}
private void creerPersonne(ModelData model, boolean removePrefix) {
this.removePrefix = removePrefix;
Map<String, Object> a = model.getProperties();
 
Set<String> cles = a.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
if (a.get(cle) != null) {
String cleObjet = "";
if (removePrefix) {
cleObjet = cleObjet.replaceFirst("^"+PREFIXE+"_", "");
}
else {
cleObjet = cle;
}
this.set(cleObjet, a.get(cle));
}
}
}
public Personne(JSONObject personne) {
initialiserModele(personne);
//Ajout du champ courriel principal
this.setCourrielPrinc(this.getInfoDenormaliseParPosition(this.renvoyerValeurCorrecte("truk_courriel"), 1));
}
@Override
protected String getPrefixe() {
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
public Object obtenirValeurChamp(String nomChamp) {
return renvoyerValeurCorrecte(nomChamp);
}
public Date getDate(String nomChamp) {
String strDate = renvoyerValeurCorrecte(nomChamp);
Date dateRetour = null;
try {
if ((strDate != null) && (!strDate.equals("0000-00-00"))) {
dateRetour = DateTimeFormat.getFormat("yyyy-MM-dd").parseStrict(strDate);
}
} catch (StringIndexOutOfBoundsException e) {
GWT.log("Impossible de parser la date " + strDate, e);
}
return dateRetour;
}
public String getString(String nomChamp) {
return String.valueOf(renvoyerValeurCorrecte(nomChamp));
}
//Traitement des truks
protected void remplacerTypeDansChaineDenormalise(String champ, String type, Object valeur) {
if (valeur != null && !valeur.equals("")) {
ajouterChaineDenormaliseAvecType(champ, type, valeur);
} else {
supprimerTypeDansChaineDenormalise(champ, type);
}
}
/**
* Ajoute un nouvel élément sans type à une chaine dénormalisée.
* Champ de type "truk" contenant seulement des valeurs séparées par ";;".
* Si l'élément existe déjà, il ne sera pas ajouté.
*
* @param champ le nom du champ dénormalisé
* @param valeur la valeur à ajouter
*/
protected void ajouterChaineDenormalise(String champ, Object valeur) {
if (valeur instanceof String) {
String chaineExistante = renvoyerValeurCorrecte(champ);
if (chaineExistante.equals("")) {
this.set(champ, valeur);
} else {
// Si la valeur à ajouter n'est pas déjà présente, nous l'ajoutons
if (!chaineExistante.matches("(^|"+SEPARATEUR_VALEURS+")"+valeur+"("+SEPARATEUR_VALEURS+"|$)")) {
this.set(champ, chaineExistante+SEPARATEUR_VALEURS+valeur);
}
}
}
}
// ID PERSONNE
public String getId() {
Log.debug("Dans getId() Personne : "+this.toString());
return renvoyerValeurCorrecte("id_personne");
}
public void setId(String personneId) {
if (removePrefix) this.set("id_personne", personneId);
else this.set(PREFIXE+"_id_personne", personneId);
}
// NOM COMPLET
public String getNomComplet() {
return renvoyerValeurCorrecte("fmt_nom_complet");
}
public void setNomComplet(String nomComplet) {
this.set("fmt_nom_complet", nomComplet);
}
public void setFmtNomComplet(String prefixe, String suffixe) {
String fmtNomComplet = "";
if ((prefixe != null)&&(!prefixe.trim().equals(""))) {
fmtNomComplet += prefixe + " ";
}
if ((this.getPrenom()!=null)&&(!this.getPrenom().trim().equals(""))) {
fmtNomComplet += this.getPrenom() + " ";
}
if ((this.getNom()!=null)&&(!this.getNom().trim().equals(""))) {
fmtNomComplet += this.getNom() + " ";
}
if ((suffixe!=null)&&(!suffixe.trim().equals(""))) {
fmtNomComplet += suffixe;
}
 
setNomComplet(UtilString.ucFirst(fmtNomComplet));
}
// NOM
public String getNom() {
if (removePrefix) return renvoyerValeurCorrecte("nom");
else return renvoyerValeurCorrecte(PREFIXE+"_nom");
}
public void setNom(String nom) {
if (removePrefix) set("nom", nom);
else set(PREFIXE+"_nom", nom);
}
// PRÉNOM
public String getPrenom() {
if (removePrefix) return renvoyerValeurCorrecte("prenom");
else return renvoyerValeurCorrecte(PREFIXE+"_prenom");
}
public void setPrenom(String prenom) {
if (removePrefix) set("prenom", prenom);
else set(PREFIXE+"_prenom", prenom);
}
// TÉLÉPHONE
public String getTelephone() {
return renvoyerValeurCorrecte("truk_telephone");
}
public void setTelephone(String t) {
this.set("truk_telephone", t);
}
public void ajouterTelephone(String type, Object valeur) {
ajouterChaineDenormaliseAvecType("truk_telephone", type, valeur);
}
public String selectionnerTelephone(String type) {
return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), type);
}
// FAX
public String getFax() {
return renvoyerValeurCorrecte("truk_fax");
}
public void setFax(String f) {
this.set("truk_fax", f);
}
public void ajouterFax(Object valeur) {
ajouterChaineDenormalise("truk_fax", valeur);
}
public String selectionnerFax(int position) {
return getInfoDenormaliseParPosition(renvoyerValeurCorrecte("truk_fax"), position);
}
// COURRIEL
public String getCourriel() {
return renvoyerValeurCorrecte("truk_courriel");
}
public void setCourriel(String c) {
this.set("truk_courriel", c);
}
public void ajouterCourriel(String c) {
ajouterChaineDenormalise("truk_courriel", c);
}
public String selectionnerCourriel(int position) {
return getInfoDenormaliseParPosition(renvoyerValeurCorrecte("truk_courriel"), position);
}
// SPÉCIALITÉ
public String getSpecialite() {
return renvoyerValeurCorrecte("ce_truk_specialite");
}
public void setSpecialite(String s) {
// Pas de liste pour l'instant, donc tout passe dans "Autre".
setChaineDenormaliseUnique("ce_truk_specialite", "AUTRE", s);
}
public String afficherSpecialite() {
return getChaineDenormaliseUnique("ce_truk_specialite");
}
// NAISSANCE DATE
public String getNaissanceDate() {
String dateNaiss = "";
dateNaiss = get("naissance_date");
if (UtilString.isEmpty(dateNaiss)||dateNaiss.equals("0000-00-00")) {
dateNaiss = Mediateur.i18nC.inconnue();
}
return dateNaiss;
}
public String getDateSouple(String date) {
String valeurDate = date;
String jour = "";
String mois = "";
String annee = "";
 
// pas de date dans la BD
if (UtilString.isEmpty(valeurDate) || valeurDate.equals("0000-00-00")) {
valeurDate = "";
// YYYY
} else if (valeurDate.endsWith("00-00")) {
valeurDate = valeurDate.substring(0, 4);
if (valeurDate.matches("\\d{4}")) {
jour = "";
mois = "";
annee = valeurDate.substring(0,4);
valeurDate = annee;
}
// YYYY-MM
} else if (valeurDate.endsWith("-00")) {
valeurDate = valeurDate.substring(0, 7);
if (valeurDate.matches("\\d{4}-\\d{2}")) {
jour = "";
mois = valeurDate.substring(5,7);
annee = valeurDate.substring(0,4);
valeurDate = mois+"/"+annee;
}
}
// YYYY-MM-DD
else if (valeurDate.matches("\\d{4}-\\d{2}-\\d{2}")) {
Date objetDate = DateTimeFormat.getFormat("yyyy-MM-dd").parse(valeurDate);
DateTimeFormat fmt = DateTimeFormat.getFormat("dd/MM/yyyy");
valeurDate = fmt.format(objetDate);
}
return valeurDate;
}
public String getAnneeOuDateNaiss() {
String valeurDateNaissance = get("naissance_date");
return getDateSouple(valeurDateNaissance);
}
public void setNaissanceDate(Date naissanceDate) {
if (naissanceDate != null) {
this.set("naissance_date", naissanceDate);
} else {
this.set("naissance_date", null);
}
}
// NAISSANCE LIEU
public String getNaissanceLieu() {
return renvoyerValeurCorrecte("naissance_lieu");
}
public void setNaissanceLieu(String naissanceLieu) {
this.set("naissance_lieu", naissanceLieu);
}
// DÉCÉS
public boolean estDecedee() {
String ceDeces = getDeces();
if (ceDeces.isEmpty() || ceDeces.equals(ETRE_DECEDE)) {
return true;
} else {
return false;
}
}
public String getDeces() {
return renvoyerValeurCorrecte("ce_deces");
}
public String getAnneeOuDateDeces() {
String valeurDateDeces = get("deces_date");
return getDateSouple(valeurDateDeces);
}
public void setDeces(String deces) {
set("ce_deces", deces);
}
public void setDeces(Date decesDate, String lieuDeces) {
set("ce_deces", ETRE_DECEDE);
setDecesDate(decesDate);
setDecesLieu(lieuDeces);
}
public void setNonDecedee() {
set("ce_deces", ETRE_VIVANT);
setDecesDate(null);
setDecesLieu("");
}
// DÉCÉS DATE
public String getDecesDate() {
String dateDeces = renvoyerValeurCorrecte("deces_date");
if (UtilString.isEmpty(dateDeces) || dateDeces.equals("0000-00-00")) {
dateDeces = Mediateur.i18nC.inconnue();
}
return dateDeces;
}
public void setDecesDate(Date decesDate) {
if (decesDate != null) {
this.set("deces_date", DateTimeFormat.getFormat("yyyy-MM-dd").format(decesDate));
} else {
this.set("deces_date", "");
}
}
// DÉCÉS LIEU
public String getDecesLieu() {
return renvoyerValeurCorrecte("deces_lieu");
}
public void setDecesLieu(String decesLieu) {
this.set("deces_lieu", decesLieu);
}
// PARAMÊTRE
public String getParametre() {
return renvoyerValeurCorrecte("parametre");
}
public void setParametre(String parametre) {
this.set("parametre", parametre);
}
public void setCourrielPrinc(String courriel) {
this.set("_courriel_princ_", courriel);
}
public String getCourrielPrinc() {
return (String) this.get("_courriel_princ_");
}
// PUBLICATIONS LIÉES
public PublicationAPersonneListe getPublicationsLiees() {
return publicationsLiees;
}
public void setPublicationsLiees(PublicationAPersonneListe relationsCollectionAPublication) {
publicationsLiees = relationsCollectionAPublication;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/personne/Personne.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/personne/Personne.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/personne/Personne.java:r11-934,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/personne/PersonneListe.java
New file
0,0 → 1,146
package org.tela_botanica.client.modeles.personne;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.ListePaginable;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.aDonneeListe;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.i18n.client.Dictionary;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.user.client.Window;
 
/**
* Classe contenant les informations sur les Personnes renvoyées par un objet de type DAO.
*
* @author Grégoire DUCHÉ
*
*/
public class PersonneListe extends aDonneeListe<Personne> implements ListePaginable {
 
private static final long serialVersionUID = 2930530504922300155L;
private int currentPage = 0;
private int nbElementsPage = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
private int nbElementsTotal;
private Rafraichissable vueARafraichir;
 
/**
* Constructeur sans paramètres
*/
public PersonneListe() {
super();
}
 
/**
* Constructeur avec paramètre
*
* @param taille la taille de la table de hachage
*/
public PersonneListe(int taille) {
super(taille);
}
 
/**
* Constructeur pour une liste de personne
*
* @param dates
*/
public PersonneListe(JSONArray ListeDePersonnes) {
super(ListeDePersonnes.size());
initialiserPersonneListe(ListeDePersonnes);
}
 
public PersonneListe(JSONArray ListeDePersonnes, JSONNumber nbElements, Rafraichissable vueARafraichir) {
super(ListeDePersonnes.size());
this.nbElementsTotal = Integer.valueOf(nbElements.toString());
this.vueARafraichir = vueARafraichir;
initialiserPersonneListe(ListeDePersonnes);
}
private void initialiserPersonneListe(JSONArray ListeDePersonnes) {
final int taillemax = ListeDePersonnes.size();
for (int i = 0; i < taillemax; i++) {
JSONObject personneCourante = ListeDePersonnes.get(i).isObject();
if (personneCourante != null) {
Personne personne = new Personne(personneCourante);
this.put(personne.getId(), personne);
}
}
}
 
public int[] getPageTable() {
int[] page = new int[4];
// nombre de pages au total
page[0] = calculerNbPages();
// Page En Cours
page[1] = currentPage;
// nbElementsParPage
page[2] = nbElementsPage;
// et le dernier le nombre total d'éléments
page[3] = nbElementsTotal;
return page;
}
 
/**
* Calcule le nombre de pages nécessaires pour afficher un nombre d'élements
* donnés en fonction de la taille de page en cours
*
* @return le nombre de pages
*/
public int calculerNbPages() {
// À cause de la bétise de java pour les conversion implicite, on fait quelques conversions manuellement
// pour eviter qu'il arrondisse mal la division nombre de pages = (nombre d'element / taille de la page)
// arrondie à l'entier supérieur.
double nPage = (1.0 * nbElementsTotal) / (1.0 * nbElementsPage);
double nPageRound = Math.ceil(nPage);
Double nPageInt = new Double(nPageRound);
 
// Convertion en entier
return nPageInt.intValue();
}
 
public void changerNumeroPage(int pageCourante) {
currentPage = pageCourante;
selectionnerPersonne();
}
 
public void changerTaillePage(int nouvelleTaillePage) {
nbElementsPage = nouvelleTaillePage;
selectionnerPersonne();
}
 
public void recharger() {
selectionnerPersonne();
}
 
public void setPageCourante(int pageCourante) {
this.currentPage = pageCourante;
}
 
public void setTaillePage(int taillePage) {
this.nbElementsPage = taillePage;
}
 
public void selectionnerPersonne() {
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
// Utilisation d'une valeur nulle "typée" pour éviter un ambiguité sur l'appel de méthode et donc
// une erreur
Personne personne = new Personne();
mediateur.selectionnerPersonne(vueARafraichir, personne, currentPage, nbElementsPage, null);
}
 
public void filtrerParNom(String nom) {
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
Personne personne = new Personne();
personne.setNom("%" + nom + "%");
mediateur.selectionnerPersonne(vueARafraichir, personne, currentPage, nbElementsPage, null);
}
 
public void filtrerParNomEtPage(String nom, int pageCourante) {
currentPage = pageCourante;
filtrerParNom(nom);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/personne/PersonneListe.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/personne/PersonneListe.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/personne/PersonneListe.java:r11-934,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/personne/PersonneAsyncDao.java
New file
0,0 → 1,211
package org.tela_botanica.client.modeles.personne;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
import org.tela_botanica.client.http.JsonRestRequestCallback;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.synchronisation.Reponse;
import org.tela_botanica.client.util.UtilDAO;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.core.client.Callback;
import com.google.gwt.core.client.GWT;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
 
public class PersonneAsyncDao {
private static final String SERVICE_NOM = "CoelPersonne";
public static String tri = null;
private String utilisateurId = null;
private Rafraichissable vueARafraichir = null;
public PersonneAsyncDao(Rafraichissable vue) {
if (Mediateur.DEBUG) System.out.println("|| PersonneAsyncDao > vueARafraichir = "+vue.getClass().toString());
vueARafraichir = vue;
utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
}
/**
* @param paginationProgressive : définit le mode de consultation de la base de données
* - True : la consultation des données est progressive, ce qui signifie que la liste est chargée (paginée) au
* fur et à mesure de la consultation des données par l'utilisateur.
* - False : la consultation des données est classique : un seul appel à la base de données est effectué, le retour
* est renvoyé à l'appelant
* // FIXME : si la taille de la liste est supérieure à la limite du JREST (150), ce deuxieme mode ne fonctionne pas
*/
public void selectionner(final boolean paginationProgressive, String personneId, String nomComplet, final int start, final int nbElements, final Integer seqId) {
 
String nom = (nomComplet == null) ? "%" : "%"+nomComplet+"%";
String[] parametres = {personneId, nom};
HashMap<String, String> restrictions = new HashMap<String, String>();
if (nbElements != -1) {
restrictions.put("limit", String.valueOf(nbElements));
}
 
if(tri != null) {
restrictions.put("orderby", tri);
}
/** GESTION DE LA REQUETE dans le cas d'une liste paginée progressive **/
if (paginationProgressive) {
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start));
/** CONSTRUCTION DE LA REQUETE **/
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
 
/** ENVOI DE LA REQUETE **/
rb.envoyerRequete(null, new JsonRestRequestCallback()
{
/** RECEPTION DE LA REPONSE **/
public void surReponse(JSONValue responseValue)
{
/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
* On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- PersonneAsyncDao > Liste paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(responseValue, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
if (Mediateur.DEBUG) System.out.println("<-- PersonneAsyncDao > Liste paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(responseValue);
}
}
});
}
/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
else {
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start*nbElements));
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue != null) {
JSONObject reponseObject = responseValue.isObject();
if (reponseObject.get("personnes").isArray() != null) {
JSONArray reponse = responseValue.isArray();
// Transformation du tableau JSON réponse en ListePersonne
Information info = new Information("liste_personne");
PersonneListe personnes;
personnes = new PersonneListe(reponseObject.get("personnes").isArray(), reponseObject.get("nbElements").isNumber(), vueARafraichir);
personnes.setTaillePage(nbElements);
personnes.setPageCourante(start);
info.setDonnee(0, personnes);
// et on met à jour le demandeur des données
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- PersonneAsyncDao > Liste non paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(info, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
if (Mediateur.DEBUG) System.out.println("<-- PersonneAsyncDao > Liste non paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(info);
}
}
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un tableau JSON et vaut : "+responseValue.toString(), null);
}
}
});
}
}
public void testerExistencePersonne(String nomComplet, final Callback<JSONObject, String> cb) {
String[] parametres = {null, nomComplet};
/** CONSTRUCTION DE LA REQUETE **/
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres);
 
/** ENVOI DE LA REQUETE **/
rb.envoyerRequete(null, new JsonRestRequestCallback()
{
/** RECEPTION DE LA REPONSE **/
public void surReponse(JSONValue responseValue)
{
if (responseValue.isObject() != null) {
cb.onSuccess(responseValue.isObject());
}
}
});
}
public void ajouter(Personne personne) {
String postDonneesEncodees = personne.obtenirChainePOST();
postDonneesEncodees += "&cmhl_ce_modifier_par=" + utilisateurId;
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue.isString() != null) {
Information info = new Information("ajout_personne");
String structureIdOuMessage = responseValue.isString().stringValue();
if (structureIdOuMessage.matches("^[0-9]+$")) {
info.setDonnee(structureIdOuMessage);
} else {
info.setMessage(structureIdOuMessage);
}
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
public void modifier(Personne personne) {
String postDonneesEncodees = personne.obtenirChainePOST();
postDonneesEncodees += "&cmhl_ce_modifier_par=" + utilisateurId;
GWT.log(postDonneesEncodees, null);
String[] parametres = {personne.getId()};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
// Si la requête est un succès, reception d'une chaine
if (responseValue.isString() != null) {
Information info = new Information("modification_personne");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
 
public void supprimer(String personnesId) {
String[] parametres = {utilisateurId, personnesId};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue.isString() != null) {
Information info = new Information("suppression_personne");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/modeles/personne/PersonneAsyncDao.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/personne/PersonneAsyncDao.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/personne/PersonneAsyncDao.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/aDonneeListe.java
New file
0,0 → 1,28
package org.tela_botanica.client.modeles;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
 
abstract public class aDonneeListe<T> extends HashMap<String,T> {
private static final long serialVersionUID = -8567158151109232877L;
 
public aDonneeListe() {
super();
}
public aDonneeListe(int taille) {
super(taille);
}
public List<T> toList() {
List<T> listeACreer = new ArrayList<T>();
Iterator<String> it = keySet().iterator();
while (it.hasNext()) {
listeACreer.add((T) get(it.next()));
}
return listeACreer;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/aDonneeListe.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/aDonneeListe.java:r11-362,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/aDonneeListe.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/Utilisateur.java
New file
0,0 → 1,203
package org.tela_botanica.client.modeles;
 
import java.util.Iterator;
import java.util.Set;
 
import com.google.gwt.json.client.JSONObject;
 
public class Utilisateur extends aDonnee {
 
private static final long serialVersionUID = -4016615552202089985L;
 
// Jeton encodé en base64 passé de manière automatique aux services dans un header
private static String jeton = "";
// Durée de vie du jeton en secondes (sert au rafraîchissement automatique)
private static int duree = 0;
public static final String PREFIXE = "cp";
public static String[] champsObligatoires = {"cp_id_personne"};
public Utilisateur() {
initialiserUtilisateur(null, false);
}
 
public Utilisateur(String id, boolean identifie) {
initialiserUtilisateur(id, identifie);
}
public Utilisateur(JSONObject utilisateur) {
// l'objet JSON est une table de hachage
Set<String> im = utilisateur.keySet();
 
// Parcourt pour chaque clé
for (Iterator<String> it = im.iterator(); it.hasNext();) {
// Si elle est associée à une valeur, nous l'ajoutons
String cle = it.next();
// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
// Valeur est vide par défaut
String valeur = "";
if (utilisateur.get(cle).isString() != null) {
valeur = utilisateur.get(cle).isString().stringValue();
this.set(cleObjet, valeur);
} else {
this.set(cleObjet, valeur);
}
}
}
@Override
protected String getPrefixe() {
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
 
private void initialiserUtilisateur(String id, boolean etreIdentifie) {
setId(id);
setIdentification(etreIdentifie);
}
// ID
/**
* Retourne l'id de l'utilisateur ou l'identifiant de session si la personne n'est pas identifiée.
* @return String id de l'utilisateur
*/
public String getId() {
return renvoyerValeurCorrecte("id_personne");
}
public void setId(String id) {
set("id_personne", id);
}
// NOM COMPLET
/**
* Retourne le nom complet et formaté de l'utilisateur
* @return String nom complet
*/
public String getNomComplet() {
return renvoyerValeurCorrecte("fmt_nom_complet");
}
public void setNomComplet(String nom_complet) {
set("fmt_nom_complet", nom_complet);
}
 
// PRÉNOM
/**
* Retourne le prénom de l'utilisateur
* @return String prénom
*/
public String getPrenom() {
return renvoyerValeurCorrecte("prenom");
}
public void setPrenom(String prenom) {
set("prenom", prenom);
}
// NOM
/**
* Retourne le nom de l'utilisateur
* @return String nom
*/
public String getNom() {
return renvoyerValeurCorrecte("nom");
}
public void setNom(String nom) {
set("nom", nom);
}
// LOGIN
/**
* Retourne le login de l'utilisateur ou l'identifiant de session si la personne n'est pas identifiée.
* @return String login
*/
public String getLogin() {
return renvoyerValeurCorrecte("login");
}
public void setLogin(String l) {
set("login", l);
}
// MOT DE PASSE
/**
* Retourne le mot de passe de l'utilisateur
* @return String mot de passe
*/
public String getMotDePasse() {
return renvoyerValeurCorrecte("mot_de_passe");
}
public void setMotDePasse(String mdp) {
set("mot_de_passe", mdp);
}
// PARAMÈTRE
public String getParametre() {
String xml = renvoyerValeurCorrecte("parametre");
if (xml.equals("")) {
xml = "<?xml version='1.0' encoding='UTF-8'?>\n<parametres>\n</parametres>";
}
return xml;
}
public void setParametre(String param) {
set("parametre", param);
}
 
public static String getJeton() {
return Utilisateur.jeton;
}
 
public static void setJeton(String jeton) {
Utilisateur.jeton = jeton;
}
 
public static int getDureeJeton() {
return Utilisateur.duree;
}
 
public static void setDureeJeton(int duree) {
Utilisateur.duree = duree;
}
// +---------------------------------------------------------------------------------------------------------------+
// IDENTIFIÉ
/**
* Retourne vrai si utilisateur est identifié.
* @return boolean
*/
public boolean isIdentifie() {
if (get("identifie").equals(true)) {
return true;
} else {
return false;
}
}
public void setIdentification(Boolean bool) {
set("identifie", bool);
}
public boolean avoirLicenceAcceptee() {
if (getLicence().equals("1")) {
return true;
} else {
return false;
}
}
 
// LICENCE ACCEPTÉE
public void setLicence(String licence) {
this.set("licenceAcceptee", licence);
}
public String getLicence() {
if (this.get("licenceAcceptee") != null) {
return this.get("licenceAcceptee");
} else {
return "";
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/Utilisateur.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/Utilisateur.java:r11-60,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/Utilisateur.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionAStructure.java
New file
0,0 → 1,35
package org.tela_botanica.client.modeles.collection;
 
import org.tela_botanica.client.modeles.aDonnee;
 
import com.google.gwt.json.client.JSONObject;
 
public class CollectionAStructure extends aDonnee {
private static final long serialVersionUID = -8891776931124681678L;
public static final String PREFIXE = "cc";
public static String[] champsObligatoires = {"cc_id_collection","cc_nom"};
 
public CollectionAStructure(JSONObject collectionAStructure){
initialiserModele(collectionAStructure);
}
@Override
protected String getPrefixe() {
return PREFIXE;
}
 
@Override
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
 
public String getNom() {
return renvoyerValeurCorrecte("nom");
}
public String getIdCollection() {
return renvoyerValeurCorrecte("id_collection");
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionAsyncDao.java
New file
0,0 → 1,232
package org.tela_botanica.client.modeles.collection;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
import org.tela_botanica.client.http.JsonRestRequestCallback;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.synchronisation.Reponse;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilDAO;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.Window;
 
public class CollectionAsyncDao {
public static final String SERVICE_NOM = "CoelCollection";
public static String tri = null;
private String utilisateurId = null;
private Rafraichissable vueARafraichir = null;
public CollectionAsyncDao(Rafraichissable vueARafraichirCourrante) {
//if (Mediateur.DEBUG) System.out.println("|| CollectionAsyncDao > vueARafraichir = "+vueARafraichirCourrante.getClass().toString());
vueARafraichir = vueARafraichirCourrante;
utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
}
/**
*
* @param paginationProgressive : définit le mode de consultation de la base de données
* - True : la consultation des données est progressive, ce qui signifie que la liste est chargée (paginée) au
* fur et à mesure de la consultation des données par l'utilisateur.
* - False : la consultation des données est classique : un seul appel à la base de données est effectué, le retour
* est renvoyé à l'appelant
* // FIXME : si la taille de la liste est supérieure à la limite du JREST (150), ce deuxieme mode ne fonctionne pas
*/
public void selectionner(final boolean paginationProgressive, final String collectionId, final String nomCollection, final int start, final int nbElements, final Integer seqId) {
 
// Ajout des paramètres et données à selectionner dans l'URL
String nom = (nomCollection == null) ? "%" : nomCollection+"%";
String[] parametres = {collectionId, nom};
HashMap<String, String> restrictions = new HashMap<String, String>();
if (nbElements != -1) {
restrictions.put("limit", String.valueOf(nbElements));
}
 
if(tri != null) {
restrictions.put("orderby", tri);
}
 
/** GESTION DE LA REQUETE dans le cas d'une liste paginée progressive **/
if (paginationProgressive) {
 
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start));
/** CONSTRUCTION DE LA REQUETE **/
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
 
/** ENVOI DE LA REQUETE **/
rb.envoyerRequete(null, new JsonRestRequestCallback()
{
/** RECEPTION DE LA REPONSE **/
public void surReponse(JSONValue responseValue)
{
/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
* On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- CollectionAsyncDao > Liste paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(responseValue, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
if (Mediateur.DEBUG) System.out.println("<-- CollectionAsyncDao > Liste paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(responseValue);
}
}
});
}
/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
else {
 
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start*nbElements));
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue != null) {
 
JSONObject responseObject = responseValue.isObject();
 
if (responseObject != null) {
// Si la réponse est un tableau, alors c'est une liste de collections qui a été retournée
if (responseObject.get("collections").isArray() != null) {
final JSONArray reponse = responseObject.get("collections").isArray();
CollectionListe collections = new CollectionListe(reponse, responseObject.get("nbElements").isNumber(), vueARafraichir);
collections.setTaillePage(nbElements);
collections.setPageCourante(start);
vueARafraichir.rafraichir(collections);
// Si la réponse est un objet, alors c'est une unique collection qui a été retournée
} else if (responseObject.get("collections").isObject() != null) {
final JSONObject reponse = responseObject.get("collections").isObject();
Collection collection = new Collection(reponse);
CollectionBotanique collectionBotanique = new CollectionBotanique(reponse);
collection.setBotanique(collectionBotanique);
Information info = new Information("selection_collection");
info.setDonnee(0, collection);
// et on met à jour le demandeur des données
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- CollectionAsyncDao > Liste non paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(info, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
if (Mediateur.DEBUG) System.out.println("<-- CollectionAsyncDao > Liste non paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(info);
}
}
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un objet ou un talbeau JSON et vaut : "+responseValue.toString(), null);
}
} else {
// Dans le cas, où nous demandons toutes les institutions et qu'il n'y en a pas, nous retournons un objet vide
if (collectionId == null) {
CollectionListe collections = new CollectionListe(0);
vueARafraichir.rafraichir(collections);
}
}
}
});
}
}
public void ajouter(Collection collection) {
String postDonneesEncodees = construirePost(null, collection);
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue.isString() != null) {
Information info = new Information("ajout_collection");
String structureIdOuMessage = responseValue.isString().stringValue();
if (structureIdOuMessage.matches("^[0-9]+$")) {
info.setDonnee(structureIdOuMessage);
} else {
info.setMessage(structureIdOuMessage);
}
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
public void modifier(Collection collection) {
String postDonneesEncodees = construirePost(collection.getId(), collection);
String[] parametres = {collection.getId()};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
// Si la requête est un succès, reception d'une chaine
if (responseValue.isString() != null) {
Information info = new Information("modif_collection");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
public void supprimer(String collectionsId) {
String[] parametres = {utilisateurId, collectionsId};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue.isString() != null) {
Information info = new Information("suppression_collection");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
private String construirePost(String collectionId, Collection collection) {
String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId);
if (collection != null) {
if (collectionId != null) {
postDonnees += "&cc_id_collection=" + URL.encodeComponent(collectionId);
}
 
postDonnees += "&" + collection.obtenirChainePOST();
if (collection.getBotanique() != null) {
if (collectionId != null) {
postDonnees += "&ccb_id_collection=" + URL.encodeComponent(collectionId);
}
CollectionBotanique collectionBotanique = collection.getBotanique();
postDonnees += "&" + collectionBotanique.obtenirChainePOST();
}
}
return postDonnees;
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/modeles/collection/CollectionAsyncDao.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/CollectionAsyncDao.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/CollectionAsyncDao.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionAStructureListe.java
New file
0,0 → 1,33
package org.tela_botanica.client.modeles.collection;
 
import org.tela_botanica.client.modeles.aDonneeListe;
 
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.user.client.Window;
 
public class CollectionAStructureListe extends aDonneeListe<CollectionAStructure> {
 
private static final long serialVersionUID = -660181428725095350L;
public CollectionAStructureListe() {
super();
}
public CollectionAStructureListe(int taille) {
super(taille);
}
public CollectionAStructureListe(JSONArray collectionAStructureListe) {
super(collectionAStructureListe.size()) ;
final int taillemax = collectionAStructureListe.size();
for (int i = 0; i < taillemax; i++) {
JSONObject collectionAStructureCourante = collectionAStructureListe.get(i).isObject() ;
if (collectionAStructureCourante != null) {
CollectionAStructure collectionAStructure = new CollectionAStructure(collectionAStructureCourante);
this.put(collectionAStructure.getIdCollection(), collectionAStructure);
}
}
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/UniteBase.java
New file
0,0 → 1,112
package org.tela_botanica.client.modeles.collection;
 
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.data.BaseModelData;
 
public class UniteBase extends BaseModelData {
private static final long serialVersionUID = 394843761854792528L;
public static final String COMPTE_EXACT = "E";
public static final String COMPTE_APPROXIMATIF = "A";
public UniteBase() {
}
public UniteBase(String id, String type, int nombre, String precision, String format, int nombreParts, String precisionPart, int nombreSp, String precisionSp) {
setId(id);
setType(type);
setNombre(nombre);
setPrecision(precision);
setFormat(format);
setTypeAutre(false);
}
public String getId() {
return renvoyerValeurCorrecte((String) get("id"));
}
public void setId(String id) {
set("id", id);
}
public String getType() {
return renvoyerValeurCorrecte((String) get("type"));
}
public void setType(String type) {
set("type", type);
}
 
public double getNombre() {
if (get("nombre") == null) {
return new Double(0);
}
return get("nombre");
}
public void setNombre(double nombre) {
set("nombre", nombre);
}
public String getPrecision() {
return renvoyerValeurCorrecte((String) get("precision"));
}
public void setPrecision(String precision) {
set("precision", precision);
}
public String getFormat() {
return renvoyerValeurCorrecte((String) get("format"));
}
public void setFormat(String format) {
set("format", format);
}
public double getNombrePart() {
if (get("nombre_part") == null) {
return new Double(0);
}
return get("nombre_part");
}
public void setNombrePart(double nombre) {
set("nombre_part", nombre);
}
public String getPrecisionPart() {
return renvoyerValeurCorrecte((String) get("precision_part"));
}
public void setPrecisionPart(String precision) {
set("precision_part", precision);
}
public double getNombreSp() {
if (get("nombre_sp") == null) {
return new Double(0);
}
return get("nombre_sp");
}
public void setNombreSp(double nombre) {
set("nombre_sp", nombre);
}
public String getPrecisionSp() {
return renvoyerValeurCorrecte((String) get("precision_sp"));
}
public void setPrecisionSp(String precision) {
set("precision_sp", precision);
}
public boolean getTypeAutre() {
return get("type_autre");
}
public void setTypeAutre(boolean bool) {
set("type_autre", bool);
}
private String renvoyerValeurCorrecte(String valeur) {
String valeurCorrecte = "";
if (!UtilString.isEmpty(valeur)) {
valeurCorrecte = valeur;
}
return valeurCorrecte;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/UniteBase.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/collection/UniteBase.java:r11-948,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/UniteBase.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionACommentaire.java
New file
0,0 → 1,146
package org.tela_botanica.client.modeles.collection;
 
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
 
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.commentaire.Commentaire;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.publication.Publication;
 
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
 
public class CollectionACommentaire extends aDonnee {
private static final long serialVersionUID = 8751553802444398035L;
public static final String PREFIXE = "ccac";
private boolean removePrefix = true;
private Commentaire commentaireLiee = null;
public static String[] champsObligatoires = {"cc_id_collection", "ccac_id_commentaire"};
public CollectionACommentaire() {
initialiser(new JSONObject(), false);
}
public CollectionACommentaire(JSONObject collectionACommentaireListe) {
initialiser(collectionACommentaireListe, true);
}
public CollectionACommentaire(JSONObject collectionACommentaireListe, boolean chargerCommentaire) {
initialiser(collectionACommentaireListe, chargerCommentaire);
}
public CollectionACommentaire(ModelData model, boolean removePrefix)
{
this.removePrefix = removePrefix;
Map<String, Object> a = model.getProperties();
Set<String> cles = a.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
if (a.get(cle) != null) {
String cleObjet = "";
if (removePrefix) {
cleObjet = cle.replaceFirst("^"+CollectionACommentaire.PREFIXE+"_", "");
cleObjet = cleObjet.replaceFirst("^"+Commentaire.PREFIXE+"_", "");
}
else {
cleObjet = cle;
}
this.set(cleObjet, a.get(cle));
}
}
 
setCommentaire(new Commentaire(model));
this.set("_etat_", a.get("_etat_"));
this.set("_type_", a.get("_type_"));
}
@Override
protected String getPrefixe() {
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
private void initialiser(JSONObject collectionACommentaireListe, boolean chargerCommentaire) {
if (chargerCommentaire) {
setCommentaire(new Commentaire(collectionACommentaireListe, false));
} else {
setCommentaire(new Commentaire());
}
initialiserModele(collectionACommentaireListe);
initialiserChampsPourGrille();
}
// COMMENTAIRE
public Commentaire getCommentaire() {
return commentaireLiee;
}
public void setCommentaire(Commentaire commentaire) {
commentaireLiee = commentaire;
initialiserChampsPourGrille();
if (commentaire != null) {
setIdCommentaire(commentaire.getId());
}
}
private void initialiserChampsPourGrille() {
set("_type_", getType());
set("_titre_", getCommentaire().getTitre());
set("_texte_", getCommentaire().getTexte());
set("_ponderation_", getCommentaire().getPonderation());
set("_public_", getCommentaire().getPublic());
set("_etat_", "");
}
// ID
/** Génère un identifiant de CollectionACommentaire.
*
* C'est une concaténation des clés primaires de la table coel_collection_a_commentaire séparées par un tiret "-".
*
* @return identifiant unique d'une relation "collection à commentaire".
*/
public String getId() {
String idCollection = getIdCollection();
String idCommentaire = getIdCommentaire();
if (idCollection.equals("") && idCommentaire.equals("")) {
return null;
} else {
return (idCollection+"-"+idCommentaire);
}
}
//+---------------------------------------------------------------------------------------------------------------+
// CHAMPS PROVENANT de la TABLE COEL_COLLECTION_A_COMMENTAIRE
// ID COLLECTION
public String getIdCollection() {
return renvoyerValeurCorrecte("id_collection");
}
public void setIdCollection(String idCollection) {
set("id_collection", idCollection);
}
// ID COMENTAIRE
public String getIdCommentaire() {
return renvoyerValeurCorrecte("id_commentaire");
}
public void setIdCommentaire(String ic) {
set("id_commentaire", ic);
}
// TRUCK TYPE
public String getType() {
return renvoyerValeurCorrecte("truk_type");
}
public void setType(String type) {
set("truk_type", type);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/CollectionACommentaire.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/collection/CollectionACommentaire.java:r11-984,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/CollectionACommentaire.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionACommentaireListe.java
New file
0,0 → 1,34
package org.tela_botanica.client.modeles.collection;
 
import org.tela_botanica.client.modeles.aDonneeListe;
 
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
 
public class CollectionACommentaireListe extends aDonneeListe<CollectionACommentaire> {
 
private static final long serialVersionUID = 1L;
 
public CollectionACommentaireListe() {
super();
}
public CollectionACommentaireListe(int taille) {
super(taille);
}
public CollectionACommentaireListe(JSONArray collectionACommentaires) {
super(collectionACommentaires.size()) ;
final int taillemax = collectionACommentaires.size();
for (int i = 0; i < taillemax; i++) {
JSONObject collectionACommentaireCourant = collectionACommentaires.get(i).isObject() ;
if (collectionACommentaireCourant != null) {
CollectionACommentaire collectionACommentaire = new CollectionACommentaire(collectionACommentaireCourant);
this.put(collectionACommentaire.getId(), collectionACommentaire);
}
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/CollectionACommentaireListe.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/collection/CollectionACommentaireListe.java:r11-984,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/CollectionACommentaireListe.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/UniteRangement.java
New file
0,0 → 1,78
package org.tela_botanica.client.modeles.collection;
 
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.data.BaseModelData;
 
public class UniteRangement extends BaseModelData {
private static final long serialVersionUID = 394843761854792528L;
public static final String COMPTE_EXACT = "E";
public static final String COMPTE_APPROXIMATIF = "A";
public UniteRangement() {
}
public UniteRangement(String id, String type, int nombre, String precision, String format) {
setId(id);
setType(type);
setNombre(nombre);
setPrecision(precision);
setFormat(format);
setTypeAutre(false);
}
public String getId() {
return renvoyerValeurCorrecte((String) get("id"));
}
public void setId(String id) {
set("id", id);
}
public String getType() {
return renvoyerValeurCorrecte((String) get("type"));
}
public void setType(String type) {
set("type", type);
}
 
public double getNombre() {
if (get("nombre") == null) {
return new Double(0);
}
return get("nombre");
}
public void setNombre(double nombre) {
set("nombre", nombre);
}
public String getPrecision() {
return renvoyerValeurCorrecte((String) get("precision"));
}
public void setPrecision(String precision) {
set("precision", precision);
}
public String getFormat() {
return renvoyerValeurCorrecte((String) get("format"));
}
public void setFormat(String format) {
set("format", format);
}
public boolean getTypeAutre() {
return get("type_autre");
}
public void setTypeAutre(boolean bool) {
set("type_autre", bool);
}
private String renvoyerValeurCorrecte(String valeur) {
String valeurCorrecte = "";
if (!UtilString.isEmpty(valeur)) {
valeurCorrecte = valeur;
}
return valeurCorrecte;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/UniteRangement.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/collection/UniteRangement.java:r11-948,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/UniteRangement.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionAPublication.java
New file
0,0 → 1,172
package org.tela_botanica.client.modeles.collection;
 
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
 
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.publication.Publication;
 
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
 
public class CollectionAPublication extends aDonnee {
private static final long serialVersionUID = 1L;
public static final String PREFIXE = "ccapu";
private Publication publicationLiee = null;
public static String[] champsObligatoires = {"ccapu_id_collection", "ccapu_id_publication"};
public CollectionAPublication() {
initialiser(new JSONObject());
}
public CollectionAPublication(boolean removePrefix) {
this.removePrefix = removePrefix;
initialiser(new JSONObject());
}
public CollectionAPublication(JSONObject collectionAPublicationListe) {
initialiser(collectionAPublicationListe);
}
public CollectionAPublication(ModelData model, boolean removePrefix)
{
this.removePrefix = removePrefix;
Map<String, Object> a = model.getProperties();
Set<String> cles = a.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
if (a.get(cle) != null) {
String cleObjet = "";
if (removePrefix) {
cleObjet = cle.replaceFirst("^"+Publication.PREFIXE+"_", "");
cleObjet = cle.replaceFirst("^"+Personne.PREFIXE+"_", "");
cleObjet = cleObjet.replaceFirst("^"+PREFIXE+"_", "");
}
else {
cleObjet = cle;
}
this.set(cleObjet, a.get(cle));
}
}
 
setPublication(new Publication(model, removePrefix));
this.set("_etat_", a.get("_etat_"));
}
@Override
protected String getPrefixe() {
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
private void initialiser(JSONObject collectionAPublicationListe) {
setPublication(new Publication(collectionAPublicationListe));
initialiserChampsPourGrille();
initialiserModele(collectionAPublicationListe);
}
// PUBLICATION
public Publication getPublication() {
return publicationLiee;
}
public void setPublication(Publication publication) {
publicationLiee = publication;
initialiserChampsPourGrille();
if (publication != null) {
setIdPublication(publication.getId());
}
}
private void initialiserChampsPourGrille() {
if (removePrefix) {
set("fmt_auteur", getPublication().getAuteur());
set("titre", getPublication().getTitre());
set("collection", getPublication().getCollection());
set("_editeur_", "");
set("_annee_", "");
set("indication_nvt", getPublication().getIndicationNvt());
set("fascicule", getPublication().getFascicule());
set("truk_pages", getPublication().getPages());
set("_etat_", "");
} else {
set(Publication.PREFIXE+"_fmt_auteur", getPublication().getAuteur());
set(Publication.PREFIXE+"_titre", getPublication().getTitre());
set(Publication.PREFIXE+"_collection", getPublication().getCollection());
set("_editeur_", "");
set("_annee_", "");
set(Publication.PREFIXE+"_indication_nvt", getPublication().getIndicationNvt());
set(Publication.PREFIXE+"_fascicule", getPublication().getFascicule());
set(Publication.PREFIXE+"_truk_pages", getPublication().getPages());
set("_etat_", "");
}
}
// ID
/** Génère un identifiant de CollectionAPersonne.
*
* C'est une concaténation des clés primaires de la table coel_collection_a_personne séparées par un tiret "-".
*
* @return identifiant unique d'une relation "collection à personne".
*/
public String getId() {
String idCollection = getIdCollection();
String idPublication = getIdPublication();
if (idCollection.equals("") && idPublication.equals("")) {
return null;
} else {
return (idCollection+"-"+idPublication);
}
}
//+---------------------------------------------------------------------------------------------------------------+
// CHAMPS PROVENANT de la TABLE COEL_COLLECTION_A_PERSONNE
// ID COLLECTION
public String getIdCollection() {
if (removePrefix) return renvoyerValeurCorrecte("id_collection");
else return renvoyerValeurCorrecte(PREFIXE+"_id_collection");
}
public void setIdCollection(String idCollection) {
if (removePrefix) set("id_collection", idCollection);
else set(PREFIXE+"_id_collection", idCollection);
}
// ID PUBLICATION
public String getIdPublication() {
String idPublication;
if (removePrefix) {
idPublication = renvoyerValeurCorrecte("id_publication");
} else {
idPublication = renvoyerValeurCorrecte(PREFIXE+"_id_publication");
}
return idPublication;
}
public void setIdPublication(String ip) {
if (removePrefix) {
set("id_publication", ip);
} else {
set(PREFIXE+"_id_publication", ip);
}
}
// SOURCE
public String getSource() {
if (removePrefix) return renvoyerValeurCorrecte("source");
else return renvoyerValeurCorrecte(PREFIXE+"_source");
}
public void setSource(String source) {
if (removePrefix) set("source", source);
else set(PREFIXE+"_source", source);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/CollectionAPublication.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/collection/CollectionAPublication.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/CollectionAPublication.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionAPublicationListe.java
New file
0,0 → 1,41
package org.tela_botanica.client.modeles.collection;
 
import org.tela_botanica.client.modeles.aDonneeListe;
 
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
 
/**
* Table de hachage composée d'informations sur les Structures et les Personnes, renvoyé par un objet de type DAO
* La clé est une concaténation des clés primaires de la table coel_structure_a_personne séparées par un tiret "-".
*
* @author david delon
*
*/
public class CollectionAPublicationListe extends aDonneeListe<CollectionAPublication> {
 
private static final long serialVersionUID = 1L;
 
public CollectionAPublicationListe() {
super();
}
public CollectionAPublicationListe(int taille) {
super(taille);
}
public CollectionAPublicationListe(JSONArray publications) {
super(publications.size()) ;
final int taillemax = publications.size();
for (int i = 0; i < taillemax; i++) {
JSONObject collectionAPublicationCourante = publications.get(i).isObject() ;
if (collectionAPublicationCourante != null) {
CollectionAPublication collectionAPublication = new CollectionAPublication(collectionAPublicationCourante);
this.put(collectionAPublication.getId(), collectionAPublication);
}
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/CollectionAPublicationListe.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/CollectionAPublicationListe.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/collection/CollectionAPublicationListe.java:r11-934,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionAPersonneAsyncDao.java
New file
0,0 → 1,189
package org.tela_botanica.client.modeles.collection;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
import org.tela_botanica.client.http.JsonRestRequestCallback;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.synchronisation.Reponse;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilDAO;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
 
public class CollectionAPersonneAsyncDao {
private static final String SERVICE_NOM = "CoelCollectionAPersonne";
 
private String utilisateurId = null;
private Rafraichissable vueARafraichir = null;
 
public CollectionAPersonneAsyncDao(Rafraichissable vueARafraichirCourrante) {
if (Mediateur.DEBUG) System.out.println("|| CollectionAPersonneAsyncDao > vueARafraichir = "+vueARafraichirCourrante.getClass().toString());
vueARafraichir = vueARafraichirCourrante;
utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
}
public void selectionner(final boolean paginationProgressive, final String collectionId, final String roleId, final String recherche, final int start, final int nbElements, final Integer seqId) {
 
String[] parametres = {collectionId, roleId};
HashMap<String, String> restrictions = new HashMap<String, String>();
if (nbElements != -1) {
restrictions.put("limit", String.valueOf(nbElements));
}
restrictions.put("orderby", "cp_nom");
 
/** GESTION DE LA REQUETE dans le cas d'une liste paginée progressive **/
if (paginationProgressive) {
 
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start));
/** CONSTRUCTION DE LA REQUETE **/
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
/** ENVOI DE LA REQUETE **/
rb.envoyerRequete(null, new JsonRestRequestCallback()
{
/** RECEPTION DE LA REPONSE **/
public void surReponse(JSONValue responseValue)
{
/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
* On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- CollectionAPersonneAsyncDao > Liste paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(responseValue, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
if (Mediateur.DEBUG) System.out.println("<-- CollectionAPersonneAsyncDao > Liste paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(responseValue);
}
}
});
}
/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
else {
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start*nbElements));
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue != null) {
 
JSONObject responseObject = responseValue.isObject();
Information info = new Information("liste_collection_a_personne");
 
if (responseObject != null) {
// Si la réponse est un tableau, alors c'est une liste de collections qui a été retournée
if (responseObject.get("collectionsAPersonne").isArray() != null) {
final JSONArray reponse = responseObject.get("collectionsAPersonne").isArray();
// Transformation du tableau JSON réponse en ListeInstitution
CollectionAPersonneListe personnes = new CollectionAPersonneListe(reponse);
info.setDonnee(0, personnes);
// et on met à jour le demandeur des données
if (seqId != null) {
Reponse reponseRequete = new Reponse(info, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
vueARafraichir.rafraichir(info);
}
// Si la réponse est un objet, alors c'est une unique collection qui a été retournée
} else if (responseObject.get("collectionsAPersonne").isObject() != null) {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un tableau JSON et vaut : "+responseValue.toString(), null);
}
}
} else {
// Dans le cas, où nous demandons toutes les institutions et qu'il n'y en a pas, nous retournons un objet vide
if (collectionId == null) {
// Dans le cas, où nous demandons toutes les relations Collection à Personne et qu'il n'y en a pas, nous retournons un message d'information
Information info = new Information("liste_collection_a_personne");
info.setMessage("Aucune relations entre la collection et les personnes");
vueARafraichir.rafraichir(info);
}
}
}
});
}
}
 
public void ajouter(String collectionId, CollectionAPersonne personnes) {
String postDonneesEncodees = construirePost(collectionId, personnes);
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
// Si la requête est un succès, reception d'une chaine
if (responseValue.isString() != null) {
Information info = new Information("ajout_collection_a_personne");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
public void modifier(CollectionAPersonne personnes) {
String[] parametres = {personnes.getIdCollection(), personnes.getIdPersonne(), personnes.getIdRole()};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
String postDonneesEncodees = construirePost(personnes.getIdCollection(), personnes);
 
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
Information info = new Information("modif_collection_a_personne");
// Si la requête est un succès, reception d'une chaine
if (responseValue.isString() != null) {
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
public void supprimer(String idCollectionAPersonne) {
String[] parametres = {utilisateurId, idCollectionAPersonne};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue.isString() != null) {
Information info = new Information("suppression_collection_a_personne");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
private String construirePost(String collectionId, CollectionAPersonne personne) {
String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId) +
"&ccap_id_collection=" + URL.encodeComponent(collectionId) +
"&ccap_id_personne=" + URL.encodeComponent(personne.getIdPersonne()) +
"&ccap_id_role=" + URL.encodeComponent(personne.getIdRole());
return postDonnees;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/CollectionAPersonneAsyncDao.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/CollectionAPersonneAsyncDao.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/collection/CollectionAPersonneAsyncDao.java:r11-934,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/Collection.java
New file
0,0 → 1,418
package org.tela_botanica.client.modeles.collection;
 
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
 
import org.tela_botanica.client.Coel;
import org.tela_botanica.client.modeles.aDonnee;
 
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
 
public class Collection extends aDonnee {
private static final long serialVersionUID = 3295310312337145716L;
public static final String PREFIXE = "cc";
private CollectionBotanique botanique = null;
private CollectionAPersonneListe personnesLiees = null;
private CollectionAPublicationListe publicationsLiees = null;
private CollectionACommentaireListe commentairesLiees = null;
public static String[] champsObligatoires = {"cc_id_collection","cc_ce_type"};
public Collection() {
}
public Collection(ModelData model)
{
Map<String, Object> a = model.getProperties();
 
Set<String> cles = a.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
if (a.get(cle) != null) {
String cleObjet = cle.replaceFirst("^"+getPrefixe()+"_", "");
this.set(cleObjet, a.get(cle));
}
}
}
public Collection(JSONObject collection){
initialiserModele(collection);
}
 
@Override
protected String getPrefixe(){
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
// BOTANIQUE
public CollectionBotanique getBotanique() {
if (botanique == null) {
botanique = new CollectionBotanique();
}
return botanique;
}
public void setBotanique(CollectionBotanique botaniqueAStocker) {
botanique = botaniqueAStocker;
}
// PERSONNES LIÉES
public CollectionAPersonneListe getPersonnesLiees() {
if (personnesLiees == null) {
personnesLiees = new CollectionAPersonneListe();
}
return personnesLiees;
}
public void setPersonnesLiees(CollectionAPersonneListe relationsCollectionAPersonne) {
personnesLiees = relationsCollectionAPersonne;
}
// PUBLICATIONS LIÉES
public CollectionAPublicationListe getPublicationsLiees() {
if (publicationsLiees == null) {
publicationsLiees = new CollectionAPublicationListe();
}
return publicationsLiees;
}
public void setPublicationsLiees(CollectionAPublicationListe relationsCollectionAPublication) {
publicationsLiees = relationsCollectionAPublication;
}
// COMMENTAIRES LIÉS
public CollectionACommentaireListe getCommentairesLiees() {
if (commentairesLiees == null) {
commentairesLiees = new CollectionACommentaireListe();
}
return commentairesLiees;
}
public void setCommentairesLiees(CollectionACommentaireListe relationsCollectionACommentaire) {
commentairesLiees = relationsCollectionACommentaire;
}
// ID
public String getId() {
return renvoyerValeurCorrecte("id_collection");
}
public void setId(String idCollection) {
this.set("id_collection", idCollection);
}
// COLLECTION MERE ID
public String getCollectionMereId() {
return renvoyerValeurCorrecte("ce_mere");
}
public void setCollectionMereId(String collectionMereId) {
this.set("ce_mere", collectionMereId);
}
// COLLECTION MERE NOM
public String getCollectionMereNom() {
return renvoyerValeurCorrecte("_collection_mere_nom_");
}
public void setCollectionMereNom(String collectionMereNom) {
this.set("_collection_mere_nom_", collectionMereNom);
}
// CE STRUCTURE
public String getIdStructure() {
return renvoyerValeurCorrecte("ce_structure");
}
public void setIdStructure(String idStructure) {
this.set("ce_structure", idStructure);
}
 
// GUID
public String getGuid() {
return renvoyerValeurCorrecte("guid");
}
public void setGuid(String guid) {
this.set("guid", guid);
}
// CODE
public String getCode() {
return renvoyerValeurCorrecte("truk_code");
}
public void setCode(String code) {
this.set("truk_code", code);
}
// NOM
public String getNom() {
return renvoyerValeurCorrecte("nom");
}
public void setNom(String nom) {
this.set("nom", nom);
}
// NOM ALTERNATIF
public String getNomAlternatif() {
return renvoyerValeurCorrecte("truk_nom_alternatif");
}
public void setNomAlternatif(String nomAlter) {
this.set("truk_nom_alternatif", nomAlter);
}
// DESCRIPTION
public String getDescription() {
return renvoyerValeurCorrecte("description");
}
public void setDescription(String description) {
this.set("description", description);
}
// HISTORIQUE
public String getHistorique() {
return renvoyerValeurCorrecte("historique");
}
public void setHistorique(String historique) {
this.set("historique", historique);
}
 
// URL
public String getUrls() {
return renvoyerValeurCorrecte("truk_url");
}
public void setUrls(String urls) {
this.set("truk_url", urls);
}
// TYPE NCD
public String getTypeNcd() {
return renvoyerValeurCorrecte("ce_type");
}
public void setTypeNcd(String typeNcd) {
this.set("ce_type", typeNcd);
}
// TYPE DEPOT
public String getTypeDepot() {
return renvoyerValeurCorrecte("ce_type_depot");
}
public void setTypeDepot(String typeDepot) {
this.set("ce_type_depot", typeDepot);
}
// COTE
public String getCote() {
return renvoyerValeurCorrecte("cote");
}
public void setCote(String cote) {
this.set("cote", cote);
}
// DIMENSSION
public String getDimenssion() {
return renvoyerValeurCorrecte("dimenssion");
}
public void setDimenssion(String dimenssion) {
this.set("dimenssion", dimenssion);
}
// CONDITION ACCÉS
public String getConditionAcces() {
return renvoyerValeurCorrecte("condition_acces");
}
public void setConditionAcces(String conditionAcces) {
this.set("condition_acces", conditionAcces);
}
// CONDITION USAGE
public String getConditionUsage() {
return renvoyerValeurCorrecte("condition_usage");
}
public void setConditionUsage(String conditionUsage) {
this.set("condition_usage", conditionUsage);
}
// COUVERTURE VERNACULAIRE
public String getCouvertureVernaculaire() {
return renvoyerValeurCorrecte("truk_couverture_vernaculaire");
}
public void setCouvertureVernaculaire(String couvertureVernaculaire) {
this.set("truk_couverture_vernaculaire", couvertureVernaculaire);
}
// COUVERTURE TAXONOMIQUE
public String getCouvertureTaxonomique() {
return renvoyerValeurCorrecte("truk_couverture_taxonomique");
}
public void setCouvertureTaxonomique(String couvertureTaxonomique) {
this.set("truk_couverture_taxonomique", couvertureTaxonomique);
}
// COUVERTURE REGNE
public String getCouvertureRegne() {
return renvoyerValeurCorrecte("truk_couverture_regne");
}
public void setCouvertureRegne(String couvertureRegne) {
this.set("truk_couverture_regne", couvertureRegne);
}
// COUVERTURE TEMPORELLE
public String getCouvertureTemporelle() {
return renvoyerValeurCorrecte("truk_couverture_temporelle");
}
public void setCouvertureTemporelle(String couvertureTemporelle) {
this.set("truk_couverture_temporelle", couvertureTemporelle);
}
// COUVERTURE VIE
public String getCouvertureVie() {
return renvoyerValeurCorrecte("truk_couverture_vie");
}
public void setCouvertureVie(String couvertureVie) {
this.set("truk_couverture_Vie", couvertureVie);
}
// CONSERVATION STATUT
public String getConservationStatut() {
return renvoyerValeurCorrecte("truk_conservation_statut");
}
public void setConservationStatut(String conservationStatut) {
this.set("truk_conservation_statut", conservationStatut);
}
// PRESERVATION
public String getPreservation() {
return renvoyerValeurCorrecte("truk_preservation");
}
public void setPreservation(String preservation) {
this.set("truk_preservation", preservation);
}
// DEVELOPPEMENT
public String getDeveloppement() {
return renvoyerValeurCorrecte("ce_developpement");
}
public void setDeveloppement(String developpement) {
this.set("ce_developpement", developpement);
}
// PERIODE CONSTITUTION
public String getPeriodeConstitutionDebut() {
return renvoyerValeurCorrecte("periode_constitution_debut");
}
public void setPeriodeConstitutionDebut(String periodeConstitution) {
if (periodeConstitution == null || periodeConstitution.equals("Année")) {
periodeConstitution = "";
}
this.set("periode_constitution_debut", periodeConstitution);
}
public String getPeriodeConstitutionFin() {
return renvoyerValeurCorrecte("periode_constitution_fin");
}
public void setPeriodeConstitutionFin(String periodeConstitution) {
if (periodeConstitution == null || periodeConstitution.equals("Année")) {
periodeConstitution = "";
}
this.set("periode_constitution_fin", periodeConstitution);
}
// COUVERTURE LIEU
public String getCouvertureLieu() {
return renvoyerValeurCorrecte("truk_couverture_lieu");
}
public void setCouvertureLieu(String couvertureLieu) {
this.set("truk_couverture_lieu", couvertureLieu);
}
// COORDONNÉE
public String getCoordonnee() {
return renvoyerValeurCorrecte("truk_coordonnee");
}
public void setCoordonnee(String coordonnee) {
this.set("truk_coordonnee", coordonnee);
}
// SPECIMEN TYPE
public String getSpecimenType() {
return renvoyerValeurCorrecte("ce_specimen_type");
}
public void setSpecimenType(String specimenType) {
this.set("ce_specimen_type", specimenType);
}
// SPECIMEN TYPE NOMBRE
public String getSpecimenTypeNbre() {
return renvoyerValeurCorrecte("specimen_type_nbre");
}
public void setSpecimenTypeNbre(String specimenTypeNbre) {
this.set("specimen_type_nbre", specimenTypeNbre);
}
// SPECIMEN TYPE NOMBRE PRECISION
public String getSpecimenTypeNbrePrecision() {
return renvoyerValeurCorrecte("ce_specimen_type_nbre_precision");
}
public void setSpecimenTypeNbrePrecision(String specimenTypeNbrePrecision) {
this.set("ce_specimen_type_nbre_precision", specimenTypeNbrePrecision);
}
// SPECIMEN TYPE CLASSEMENT
public String getSpecimenTypeClassement() {
return renvoyerValeurCorrecte("ce_specimen_type_classement");
}
public void setSpecimenTypeClassement(String specimenTypeClassement) {
this.set("ce_specimen_type_classement", specimenTypeClassement);
}
// EXPEDITION NOM
public String getExpeditionNom() {
return renvoyerValeurCorrecte("expedition_nom");
}
public void setExpeditionNom(String expeditionNom) {
this.set("expedition_nom", expeditionNom);
}
// DIGITAL MEDIUM
public String getDigitalMedium() {
return renvoyerValeurCorrecte("truk_digital_medium");
}
public void setDigitalMedium(String digitalMedium) {
this.set("truk_digital_medium", digitalMedium);
}
// DIGITAL FORMAT
public String getDigitalFormat() {
return renvoyerValeurCorrecte("truk_digital_format");
}
public void setDigitalFormat(String digitalFormat) {
this.set("truk_digital_format", digitalFormat);
}
// PUBLIC
public boolean etrePublic() {
String publicMark = getPublic();
boolean estPublic = true;
if (publicMark.equals("0")) {
estPublic = false;
}
return estPublic;
}
public String getPublic() {
return renvoyerValeurCorrecte("mark_public");
}
public void setBoolPublic(String publicBool) {
this.set("mark_public", publicBool);
}
// +--------------------------------------------------------------------------------------------------------------+
// STRUCTURE NOM
public String getStructureNom() {
return renvoyerValeurCorrecte("_structure_nom_");
}
// STRUCTURE VILLE
public String getStructureVille() {
return renvoyerValeurCorrecte("_structure_ville_");
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/modeles/collection/Collection.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/Collection.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/Collection.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionListe.java
New file
0,0 → 1,130
package org.tela_botanica.client.modeles.collection;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.ListePaginable;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.aDonneeListe;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.i18n.client.Dictionary;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONObject;
 
/**
* Classe contenant les informations sur les Collections renvoyées par un objet de type DAO.
*
* @author Jean-Pascal MILCENT
*
*/
public class CollectionListe extends aDonneeListe<Collection> implements ListePaginable {
private static final long serialVersionUID = 8024454926649039456L;
private int currentPage = 0;
private int nbElementsPage = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
private int nbElementsTotal;
private Rafraichissable vueARafraichir;
public CollectionListe() {
super();
}
public CollectionListe(int taille) {
super(taille);
}
public CollectionListe(JSONArray ListeDeCollections) {
super(ListeDeCollections.size());
initialiserCollectionListe(ListeDeCollections);
}
public CollectionListe(JSONArray ListeDeCollections, JSONNumber nbElements, Rafraichissable vueARafraichir) {
super(ListeDeCollections.size());
this.nbElementsTotal = Integer.valueOf(nbElements.toString());
this.vueARafraichir = vueARafraichir;
initialiserCollectionListe(ListeDeCollections);
}
private void initialiserCollectionListe(JSONArray ListeDeCollections) {
final int taillemax = ListeDeCollections.size();
for (int i = 0; i < taillemax; i++) {
JSONObject collectionCourante = ListeDeCollections.get(i).isObject() ;
if (collectionCourante != null) {
Collection collection = new Collection(collectionCourante);
CollectionBotanique botanique = new CollectionBotanique(collectionCourante);
collection.setBotanique(botanique);
this.put(collection.getId(), collection);
}
}
}
 
public void changerNumeroPage(int pageCourante) {
currentPage = pageCourante;
selectionnerCollection();
}
 
public void changerTaillePage(int nouvelleTaillePage) {
nbElementsPage = nouvelleTaillePage;
selectionnerCollection();
}
public void recharger() {
selectionnerCollection();
}
public void setPageCourante(int pageCourante) {
this.currentPage = pageCourante;
}
 
public void setTaillePage(int taillePage) {
this.nbElementsPage = taillePage;
}
public int[] getPageTable() {
int[] page = new int[4];
// Nombre de pages au total
page[0] = calculerNbPages();
// Page En Cours
page[1] = currentPage;
// nbElementsParPage
page[2] = nbElementsPage;
// et le dernier le nombre total d'éléments
page[3] = nbElementsTotal;
return page;
}
/**
* Calcule le nombre de pages nécessaires pour afficher un nombre d'élements
* donnés en fonction de la taille de page en cours
*
* @return le nombre de pages
*/
public int calculerNbPages() {
// À cause de la bétise de java pour les conversion implicite, on fait quelques conversions manuellement
// pour eviter qu'il arrondisse mal la division nombre de pages = (nombre d'element / taille de la page)
// arrondie à l'entier supérieur.
double nPage = (1.0 * nbElementsTotal) / (1.0 * nbElementsPage);
double nPageRound = Math.ceil(nPage);
Double nPageInt = new Double(nPageRound);
 
// Convertion en entier
return nPageInt.intValue();
}
public void selectionnerCollection() {
Mediateur mediateur =(Mediateur) Registry.get(RegistreId.MEDIATEUR);
mediateur.selectionnerCollection(vueARafraichir, null, null, currentPage, nbElementsPage, null);
}
public void filtrerParNom(String nom) {
Mediateur mediateur =(Mediateur) Registry.get(RegistreId.MEDIATEUR);
mediateur.selectionnerCollection(vueARafraichir, null, "%" + nom + "%", 0, nbElementsPage, null);
}
 
public void filtrerParNomEtPage(String nom, int pageCourante) {
currentPage = pageCourante;
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
mediateur.selectionnerCollection(vueARafraichir, null, "%" + nom + "%", currentPage, nbElementsPage, null);
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/modeles/collection/CollectionListe.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/CollectionListe.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/CollectionListe.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionAStructureAsyncDao.java
New file
0,0 → 1,78
package org.tela_botanica.client.modeles.collection;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
import org.tela_botanica.client.http.JsonRestRequestCallback;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.synchronisation.Reponse;
import org.tela_botanica.client.util.UtilDAO;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
 
public class CollectionAStructureAsyncDao {
private static final String SERVICE_NOM = "CoelCollection";
public static final String PAR_STRUCTURE = "ParIdStructure";
 
private Rafraichissable vueARafraichir = null;
 
public CollectionAStructureAsyncDao(Rafraichissable vueARafraichirCourrante) {
if (Mediateur.DEBUG) System.out.println("|| CollectionAStructureAsyncDao > vueARafraichir = "+vueARafraichirCourrante.getClass().toString());
vueARafraichir = vueARafraichirCourrante;
}
public void selectionner(final String structureId, final int start, final int nbElements, final Integer seqId) {
String[] parametres = {structureId};
HashMap<String, String> restrictions = new HashMap<String, String>();
if (nbElements != -1) {
restrictions.put("limit", String.valueOf(nbElements));
}
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start*nbElements));
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM+'/'+PAR_STRUCTURE, parametres, restrictions);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
 
Information info = new Information("liste_collection_a_structure");
 
if (responseValue != null) {
final JSONArray reponse = responseValue.isArray();
// Si la réponse est un tableau, alors c'est une liste de collections qui a été retournée
if (responseValue.isArray() != null) {
// Transformation du tableau JSON réponse en CollectionAStructureListe
CollectionAStructureListe collections = new CollectionAStructureListe(reponse);
info.setDonnee(0, collections);
// et on met à jour le demandeur des données
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- CollectionAStructureAsyncDao > Liste non paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(info, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
if (Mediateur.DEBUG) System.out.println("<-- CollectionAStructureAsyncDao > Liste non paginée, retour au sequenceur");
vueARafraichir.rafraichir(info);
}
// Si la réponse est un objet, alors c'est une unique collection qui a été retournée
} else if (responseValue.isArray() != null) {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un tableau JSON et vaut : "+responseValue.toString(), null);
}
}
}
});
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionACommentaireAsyncDao.java
New file
0,0 → 1,192
package org.tela_botanica.client.modeles.collection;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
import org.tela_botanica.client.http.JsonRestRequestCallback;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.synchronisation.Reponse;
import org.tela_botanica.client.util.UtilDAO;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
 
public class CollectionACommentaireAsyncDao {
private static final String SERVICE_NOM = "CoelCollectionACommentaire";
public static final String SUPPRESSION_PAR_COLLECTION = "SuppressionParCollection";
public static final String SUPPRESSION_PAR_COMMENTAIRE = "SuppressionParCommentaire";
private String utilisateurId = null;
private Rafraichissable vueARafraichir = null;
 
public CollectionACommentaireAsyncDao(Rafraichissable vueARafraichirCourrante) {
if (Mediateur.DEBUG) System.out.println("|| CollectionACommentaireAsyncDao > vueARafraichir = "+vueARafraichirCourrante.getClass().toString());
vueARafraichir = vueARafraichirCourrante;
utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
}
public void selectionner(final boolean paginationProgressive, final String collectionId, final String recherche, final int start, final int nbElements, final Integer seqId) {
String[] parametres = {collectionId};
HashMap<String, String> restrictions = new HashMap<String, String>();
if (nbElements != -1) {
restrictions.put("limit", String.valueOf(nbElements));
}
 
/** GESTION DE LA REQUETE dans le cas d'une liste paginée progressive **/
if (paginationProgressive) {
 
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start));
/** CONSTRUCTION DE LA REQUETE **/
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
/** ENVOI DE LA REQUETE **/
rb.envoyerRequete(null, new JsonRestRequestCallback()
{
/** RECEPTION DE LA REPONSE **/
public void surReponse(JSONValue responseValue)
{
/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
* On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- CollectionACommentaireAsyncDao > Liste paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(responseValue, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
if (Mediateur.DEBUG) System.out.println("<-- CollectionACommentaireAsyncDao > Liste paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(responseValue);
}
}
});
}
/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
else {
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start*nbElements));
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
Information info = new Information("liste_collection_a_commentaire");
 
if (responseValue != null) {
 
JSONObject responseObject = responseValue.isObject();
if (responseObject != null) {
// Si la réponse est un tableau, alors c'est une liste de collections qui a été retournée
if (responseObject.get("collectionsACommentaire").isArray() != null) {
 
final JSONArray reponse = responseObject.get("collectionsACommentaire").isArray();
// Transformation du tableau JSON réponse en ListeInstitution
CollectionACommentaireListe publications = new CollectionACommentaireListe(reponse);
info.setDonnee(0, publications);
// et on met à jour le demandeur des données
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- CollectionACommentaireAsyncDao > Liste non paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(info, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
if (Mediateur.DEBUG) System.out.println("<-- CollectionACommentaireAsyncDao > Liste non paginée, retour au sequenceur");
vueARafraichir.rafraichir(info);
}
// Si la réponse est un objet, alors c'est une unique collection qui a été retournée
} else if (responseObject.get("collectionsACommentaire").isObject() != null) {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un tableau JSON et vaut : "+responseValue.toString(), null);
}
}
} else {
// Dans le cas, où nous demandons toutes les institutions et qu'il n'y en a pas, nous retournons un objet vide
if (collectionId == null) {
info.setMessage("Aucune relations entre la collection et les commentaires");
vueARafraichir.rafraichir(info);
}
}
}
});
}
}
public void ajouter(String collectionId, CollectionACommentaire commentaires) {
String postDonneesEncodees = construirePost(collectionId, commentaires);
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
// Si la requête est un succès, reception d'une chaine
if (responseValue.isString() != null) {
Information info = new Information("ajout_collection_a_commentaire");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
public void modifier(CollectionACommentaire commentaires) {
String[] parametres = {commentaires.getIdCollection(), commentaires.getIdCommentaire()};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
String postDonneesEncodees = construirePost(commentaires.getIdCollection(), commentaires);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
Information info = new Information("modif_collection_a_commentaire");
// Si la requête est un succès, reception d'une chaine
if (responseValue.isString() != null) {
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
public void supprimer(String idCollectionACommentaire, String mode) {
String[] parametres = {utilisateurId, idCollectionACommentaire, mode};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue.isString() != null) {
Information info = new Information("suppression_collection_a_commentaire");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
private String construirePost(String collectionId, CollectionACommentaire commentaire) {
String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId) +
"&ccac_id_collection=" + URL.encodeComponent(collectionId) +
"&ccac_id_commentaire=" + URL.encodeComponent(commentaire.getIdCommentaire()) +
"&ccac_truk_type=" + URL.encodeComponent(commentaire.getType());
return postDonnees;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/CollectionACommentaireAsyncDao.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/collection/CollectionACommentaireAsyncDao.java:r11-988,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/CollectionACommentaireAsyncDao.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionBotanique.java
New file
0,0 → 1,420
package org.tela_botanica.client.modeles.collection;
 
import java.util.Iterator;
import java.util.Set;
 
import org.tela_botanica.client.modeles.aDonnee;
 
import com.google.gwt.json.client.JSONObject;
 
public class CollectionBotanique extends aDonnee {
 
private static final long serialVersionUID = -6659148189825855729L;
public static final String PREFIXE = "ccb";
public static String[] champsObligatoires = {"ccb_id_collection"};
public CollectionBotanique() {
}
public CollectionBotanique(JSONObject botanique) {
// l'objet JSON est une table de hachage
Set<String> im = botanique.keySet();
 
// Parcourt pour chaque clé
for (Iterator<String> it = im.iterator(); it.hasNext();) {
// Si elle est associée à une valeur, nous l'ajoutons
String cle = it.next();
if (cle.startsWith(PREFIXE+"_")) {
// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
// Sinon, nous ajoutons la clé avec une valeur vide
String valeur = "";
if (botanique.get(cle).isString() != null) {
valeur = botanique.get(cle).isString().stringValue();
}
this.set(cleObjet, valeur);
}
}
}
@Override
protected String getPrefixe() {
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
// ID
public String getId() {
return renvoyerValeurCorrecte("id_collection");
}
public void setId(String idCollection) {
this.set("id_collection", idCollection);
}
// NBRE ECHANTILLON
public String getNbreEchantillon() {
return renvoyerValeurCorrecte("nbre_echantillon");
}
public void setNbreEchantillon(String type) {
this.set("nbre_echantillon", type);
}
// TYPE
public String getType() {
return renvoyerValeurCorrecte("ce_truk_type");
}
public void setType(String type) {
this.set("ce_truk_type", type);
}
// UNITÉ RANGEMENT
public String getNbLiasses() {
return renvoyerValeurCorrecte("nb_liasses");
}
public void setNbLiasses(String nbLiasses) {
this.set("nb_liasses", nbLiasses);
}
public String getFormatLiasses() {
return renvoyerValeurCorrecte("format_liasses");
}
public void setFormatLiasses(String formatLiasses) {
this.set("format_liasses", formatLiasses);
}
public String getNbCartonsHerbiers() {
return renvoyerValeurCorrecte("nb_cartons_herbier");
}
public void setNbCartonsHerbiers(String nbCartonsHerbiers) {
this.set("nb_cartons_herbier", nbCartonsHerbiers);
}
public String getFormatCartonsHerbiers() {
return renvoyerValeurCorrecte("format_cartons_herbier");
}
public void setFormatCartonsHerbiers(String formatCartonsHerbiers) {
this.set("format_cartons_herbier", formatCartonsHerbiers);
}
public String getAutresUnitesRangement() {
return renvoyerValeurCorrecte("autres_unites_rangement");
}
public void setAutresUnitesRangement(String autresUnitesRangement) {
this.set("autres_unites_rangement", autresUnitesRangement);
}
// UNITÉ RANGEMENT ÉTAT
public String getUniteRangementEtat() {
return renvoyerValeurCorrecte("ce_unite_rangement_etat");
}
public void setUniteRangementEtat(String uniteRangementEtat) {
this.set("ce_unite_rangement_etat", uniteRangementEtat);
}
// NB PLANCHES HERBIER
public String getNbPlanchesHerbiers() {
return renvoyerValeurCorrecte("nb_planches_herbiers");
}
public void setNbPlanchesHerbiers(String nbPlanchesHerbiers) {
this.set("nb_planches_herbiers", nbPlanchesHerbiers);
}
// NB ESPECES
public String getNbEspeces() {
return renvoyerValeurCorrecte("nb_especes");
}
public void setNbEspeces(String nbEspeces) {
this.set("nb_especes", nbEspeces);
}
// CONSERVATION PAPIER TYPE
public String getConservationPapierType() {
return renvoyerValeurCorrecte("truk_conservation_papier_type");
}
public void setConservationPapierType(String typePapierConservation) {
this.set("truk_conservation_papier_type", typePapierConservation);
}
// CONSERVATION MÉTHODE
public String getConservationMethode() {
return renvoyerValeurCorrecte("truk_conservation_methode");
}
public void setConservationMethode(String methodeConservation) {
this.set("truk_conservation_methode", methodeConservation);
}
// ÉTIQUETTE FIXATION POURCENT
public String getEtiquetteFixationPourcent() {
return renvoyerValeurCorrecte("etiquette_fixation_pourcent");
}
public void setEtiquetteFixationPourcent(String etiquetteFixationPourcent) {
this.set("etiquette_fixation_pourcent", etiquetteFixationPourcent);
}
// SPÉCIMEN FIXATION POURCENT
public String getSpecimenFixationPourcent() {
return renvoyerValeurCorrecte("specimen_fixation_pourcent");
}
public void setSpecimenFixationPourcent(String specimenFixationPourcent) {
this.set("specimen_fixation_pourcent", specimenFixationPourcent);
}
// SPÉCIMEN FIXATION MÉTHODE
public String getSpecimenFixationMethode() {
return renvoyerValeurCorrecte("truk_specimen_fixation_methode");
}
public void setSpecimenFixationMethode(String specimenFixationMethode) {
this.set("truk_specimen_fixation_methode", specimenFixationMethode);
}
// ÉTIQUETTE FIXATION SUPPORT
public String getEtiquetteFixationSupport() {
return renvoyerValeurCorrecte("truk_etiquette_fixation_support");
}
public void setEtiquetteFixationSupport(String etiquetteFixationSupport) {
this.set("truk_etiquette_fixation_support", etiquetteFixationSupport);
}
// ÉTIQUETTE FIXATION SPECIMEN
public String getEtiquetteFixationSpecimen() {
return renvoyerValeurCorrecte("truk_etiquette_fixation_specimen");
}
public void setEtiquetteFixationSpecimen(String etiquetteFixationSpecimen) {
this.set("truk_etiquette_fixation_specimen", etiquetteFixationSpecimen);
}
// ÉTIQUETTE ÉCRITURE
public String getEtiquetteEcriture() {
return renvoyerValeurCorrecte("truk_etiquette_ecriture");
}
public void setEtiquetteEcriture(String etiquetteEcriture) {
this.set("truk_etiquette_ecriture", etiquetteEcriture);
}
// TRAITEMENT
public String getTraitement() {
return renvoyerValeurCorrecte("ce_traitement");
}
public void setTraitement(String traitement) {
this.set("ce_traitement", traitement);
}
// TRAITEMENT POISON
public String getTraitementPoison() {
return renvoyerValeurCorrecte("truk_traitement_poison");
}
public void setTraitementPoison(String traitementPoison) {
this.set("truk_traitement_poison", traitementPoison);
}
// TRAITEMENT INSECTE
public String getTraitementInsecte() {
return renvoyerValeurCorrecte("truk_traitement_insecte");
}
public void setTraitementInsecte(String traitementInsecte) {
this.set("truk_traitement_insecte", traitementInsecte);
}
// ÉTAT GÉNÉRAL
public String getEtatGeneral() {
return renvoyerValeurCorrecte("ce_etat_general");
}
public void setEtatGeneral(String etatGeneral) {
this.set("ce_etat_general", etatGeneral);
}
// DÉGRADATION SPECIMEN
public String getDegradationSpecimen() {
return renvoyerValeurCorrecte("truk_degradation_specimen");
}
public void setDegradationSpecimen(String degradationSpecimen) {
this.set("truk_degradation_specimen", degradationSpecimen);
}
// DÉGRADATION PRÉSENTATION
public String getDegradationPresentation() {
return renvoyerValeurCorrecte("truk_degradation_presentation");
}
public void setDegradationPresentation(String degradationPresentation) {
this.set("truk_degradation_presentation", degradationPresentation);
}
// DÉTERMINATION
public String getDetermination() {
return renvoyerValeurCorrecte("ce_determination");
}
public void setDetermination(String determination) {
this.set("ce_determination", determination);
}
// NATURE
public String getNature() {
return renvoyerValeurCorrecte("truk_nature");
}
public void setNature(String nature) {
this.set("truk_nature", nature);
}
// SPÉCIALITÉ
public String getSpecialite() {
return renvoyerValeurCorrecte("specialite");
}
public void setSpecialite(String specialite) {
this.set("specialite", specialite);
}
// RÉCOLTE DATE DÉBUT
public String getRecolteDateDebut() {
return renvoyerValeurCorrecte("recolte_date_debut");
}
public void setRecolteDateDebut(String dateDebut) {
this.set("recolte_date_debut", dateDebut);
}
// RÉCOLTE DATE DÉBUT TYPE
public String getRecolteDateDebutType() {
return renvoyerValeurCorrecte("ce_recolte_date_debut_type");
}
public void setRecolteDateDebutType(String dateDebutType) {
this.set("ce_recolte_date_debut_type", dateDebutType);
}
// RÉCOLTE DATE FIN
public String getRecolteDateFin() {
return renvoyerValeurCorrecte("recolte_date_fin");
}
public void setRecolteDateFin(String dateFin) {
this.set("recolte_date_fin", dateFin);
}
// RÉCOLTE DATE DÉBUT TYPE
public String getRecolteDateFinType() {
return renvoyerValeurCorrecte("ce_recolte_date_fin_type");
}
public void setRecolteDateFinType(String dateFinType) {
this.set("ce_recolte_date_fin_type", dateFinType);
}
// CLASSEMENT ANNOTATION
public String getClassementAnnotation() {
return renvoyerValeurCorrecte("annotation_classement");
}
public void setClassementAnnotation(String annotation) {
this.set("annotation_classement", annotation);
}
// CLASSEMENT ÉTAT
public String getClassementEtat() {
return renvoyerValeurCorrecte("ce_classement_etat");
}
public void setClassementEtat(String classementEtat) {
this.set("ce_classement_etat", classementEtat);
}
// ÉTIQUETTE RENSEIGNEMENT
public String getEtiquetteRenseignement() {
return renvoyerValeurCorrecte("truk_etiquette_renseignement");
}
public void setEtiquetteRenseignement(String etiquetteRenseignement) {
this.set("truk_etiquette_renseignement", etiquetteRenseignement);
}
// PRÉCISION LOCALITÉ
public String getPrecisionLocalite() {
return renvoyerValeurCorrecte("ce_precision_localite");
}
public void setPrecisionLocalite(String precisionLocalite) {
this.set("ce_precision_localite", precisionLocalite);
}
// PRÉCISION DATE
public String getPrecisionDate() {
return renvoyerValeurCorrecte("ce_precision_date");
}
public void setPrecisionDate(String precisionDate) {
this.set("ce_precision_date", precisionDate);
}
// ANNOTATIONS DIVERSES
public String getAnnotationsDiverses() {
return renvoyerValeurCorrecte("annotation_diverse");
}
public void setAnnotationsDiverses(String annotation) {
this.set("annotation_diverse", annotation);
}
// COLLECTION INTÉGRÉ
public String getCollectionIntegre() {
return renvoyerValeurCorrecte("ce_collection_integre");
}
public void setCollectionIntegre(String collectionIntegre) {
this.set("ce_collection_integre", collectionIntegre);
}
// COLLECTION INTÉGRÉ INFO
public String getCollectionIntegreInfo() {
return renvoyerValeurCorrecte("ce_collection_integre_info");
}
public void setCollectionIntegreInfo(String collectionIntegreInfo) {
this.set("ce_collection_integre_info", collectionIntegreInfo);
}
// INVENTAIRE
public String getInventaire() {
return renvoyerValeurCorrecte("ce_inventaire");
}
public void setInventaire(String inventaire) {
this.set("ce_inventaire", inventaire);
}
// INVENTAIRE AUTEUR
public String getInventaireAuteur() {
return renvoyerValeurCorrecte("ce_inventaire_auteur");
}
public void setInventaireAuteur(String inventaireAuteur) {
this.set("ce_inventaire_auteur", inventaireAuteur);
}
// INVENTAIRE FORME
public String getInventaireForme() {
return renvoyerValeurCorrecte("ce_inventaire_forme");
}
public void setInventaireForme(String inventaireForme) {
this.set("ce_inventaire_forme", inventaireForme);
}
// INVENTAIRE INFO
public String getInventaireInfo() {
return renvoyerValeurCorrecte("inventaire_info");
}
public void setInventaireInfo(String inventaireInfo) {
this.set("inventaire_info", inventaireInfo);
}
// INVENTAIRE DIGITAL
public String getInventaireDigital() {
return renvoyerValeurCorrecte("ce_truk_inventaire_digital");
}
public void setInventaireDigital(String inventaireDigital) {
this.set("ce_truk_inventaire_digital", inventaireDigital);
}
// INVENTAIRE DIGITAL POURCENT
public String getInventaireDigitalPourcent() {
return renvoyerValeurCorrecte("inventaire_digital_pourcent");
}
public void setInventaireDigitalPourcent(String inventaireDigitalPourcent) {
this.set("inventaire_digital_pourcent", inventaireDigitalPourcent);
}
// INVENTAIRE ETAT
public String getInventaireEtat() {
return renvoyerValeurCorrecte("ce_inventaire_etat");
}
public void setInventaireEtat(String inventaireEtat) {
this.set("ce_inventaire_etat", inventaireEtat);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/CollectionBotanique.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/collection/CollectionBotanique.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/CollectionBotanique.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionAPersonne.java
New file
0,0 → 1,163
package org.tela_botanica.client.modeles.collection;
 
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
 
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.data.BaseModelData;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
 
public class CollectionAPersonne extends aDonnee {
private static final long serialVersionUID = 1L;
public static final String PREFIXE = "ccap";
private Personne personneLiee = null;
public static String[] champsObligatoires = {"ccap_id_collection", "ccap_id_personne", "ccap_id_role"};
public CollectionAPersonne() {
initialiser(new JSONObject());
}
public CollectionAPersonne(JSONObject collectionAPersonneListe) {
initialiser(collectionAPersonneListe);
}
public CollectionAPersonne(ModelData model)
{
Map<String, Object> a = model.getProperties();
Set<String> cles = a.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
if (a.get(cle) != null) {
String cleObjet = "";
cleObjet = cle.replaceFirst("^"+CollectionAPersonne.PREFIXE+"_", "");
cleObjet = cleObjet.replaceFirst("^"+Personne.PREFIXE+"_", "");
this.set(cleObjet, a.get(cle));
}
}
 
setPersonne(new Personne(model));
this.set("_etat_", a.get("_etat_"));
}
@Override
protected String getPrefixe() {
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
private void initialiser(JSONObject collectionAPersonneListe) {
setPersonne(new Personne(collectionAPersonneListe));
initialiserModele(collectionAPersonneListe);
initialiserChampsPourGrille();
}
// PERSONNE
public Personne getPersonne() {
return personneLiee;
}
public void setPersonne(Personne personne) {
personneLiee = personne;
initialiserChampsPourGrille();
if (personne != null) {
if (personne.getId() != null && !UtilString.isEmpty(personne.getId())) setIdPersonne(personne.getId());
}
}
public void setPersonnePourGrillePaginable(Personne personne) {
personneLiee = personne;
initialiserChampsPourGrillePaginable();
if (personne != null) {
if (personne.getId() != null && !UtilString.isEmpty(personne.getId())) setIdPersonne(personne.getId());
}
}
private void initialiserChampsPourGrille() {
set("_role_", getIdRole());
set("fmt_nom_complet", getPersonne().getNomComplet());
set("nom", getPersonne().getNom());
set("prenom", getPersonne().getPrenom());
set("naissance_date", getPersonne().getNaissanceDate());
set("naissance_lieu", getPersonne().getNaissanceLieu());
set("_deces_", getPersonne().getDeces());
set("deces_date", getPersonne().getDecesDate());
set("deces_lieu", getPersonne().getDecesLieu());
set("_etat_", "");
}
public void initialiserChampsPourGrillePaginable() {
set("ccap_id_role", getIdRole());
set("_role_", getIdRole());
set("cp_fmt_nom_complet", getPersonne().getNomComplet());
set("cp_nom", getPersonne().getNom());
set("cp_prenom", getPersonne().getPrenom());
set("cp_naissance_date", getPersonne().getNaissanceDate());
set("cp_naissance_lieu", getPersonne().getNaissanceLieu());
set("_deces_", getPersonne().getDeces());
set("cp_deces", getPersonne().getDeces());
set("cp_deces_date", getPersonne().getDecesDate());
set("cp_deces_lieu", getPersonne().getDecesLieu());
}
// ID
/** Génère un identifiant de CollectionAPersonne.
*
* C'est une concaténation des clés primaires de la table coel_collection_a_personne séparées par un tiret "-".
*
* @return identifiant unique d'une relation "collection à personne".
*/
public String getId() {
String idCollection = getIdCollection();
String idPersonne = getIdPersonne();
String idRole = getIdRole();
if (idCollection.equals("") && idPersonne.equals("") && idRole.equals("")) {
return null;
} else {
return (idCollection+"-"+idPersonne+"-"+idRole);
}
}
//+---------------------------------------------------------------------------------------------------------------+
// CHAMPS PROVENANT de la TABLE COEL_COLLECTION_A_PERSONNE
// ID COLLECTION
public String getIdCollection() {
return renvoyerValeurCorrecte("id_collection");
}
public void setIdCollection(String idCollection) {
set("id_collection", idCollection);
}
// ID PERSONNE
public String getIdPersonne() {
return renvoyerValeurCorrecte("id_personne");
}
public void setIdPersonne(String ip) {
set("id_personne", ip);
}
// ID RôLE
public String getIdRole() {
String role = renvoyerValeurCorrecte("id_role");
return role;
/*
if (role != null && !UtilString.isEmpty(role)) return role;
else return renvoyerValeurCorrecte("_role_");*/
}
public void setIdRole(String ir) {
set("id_role", ir);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/CollectionAPersonne.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/collection/CollectionAPersonne.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/CollectionAPersonne.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionAPersonneListe.java
New file
0,0 → 1,41
package org.tela_botanica.client.modeles.collection;
 
import org.tela_botanica.client.modeles.aDonneeListe;
 
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
 
/**
* Table de hachage composée d'informations sur les Structures et les Personnes, renvoyé par un objet de type DAO
* La clé est une concaténation des clés primaires de la table coel_structure_a_personne séparées par un tiret "-".
*
* @author david delon
*
*/
public class CollectionAPersonneListe extends aDonneeListe<CollectionAPersonne> {
 
private static final long serialVersionUID = 1L;
 
public CollectionAPersonneListe() {
super();
}
public CollectionAPersonneListe(int taille) {
super(taille);
}
public CollectionAPersonneListe(JSONArray structures) {
super(structures.size()) ;
final int taillemax = structures.size();
for (int i = 0; i < taillemax; i++) {
JSONObject collectionAPersonneCourante = structures.get(i).isObject() ;
if (collectionAPersonneCourante != null) {
CollectionAPersonne collectionAPersonne = new CollectionAPersonne(collectionAPersonneCourante);
this.put(collectionAPersonne.getId(), collectionAPersonne);
}
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/CollectionAPersonneListe.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/CollectionAPersonneListe.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/collection/CollectionAPersonneListe.java:r11-934,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/collection/CollectionAPublicationAsyncDao.java
New file
0,0 → 1,193
package org.tela_botanica.client.modeles.collection;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
import org.tela_botanica.client.http.JsonRestRequestCallback;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.synchronisation.Reponse;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilDAO;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
 
public class CollectionAPublicationAsyncDao {
private static final String SERVICE_NOM = "CoelCollectionAPublication";
 
private String utilisateurId = null;
private Rafraichissable vueARafraichir = null;
 
public CollectionAPublicationAsyncDao(Rafraichissable vueARafraichirCourrante) {
if (Mediateur.DEBUG) System.out.println("|| CollectionAPublicationAsyncDao > vueARafraichir = "+vueARafraichirCourrante.getClass().toString());
vueARafraichir = vueARafraichirCourrante;
utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
}
public void selectionner(final boolean paginationProgressive, final String collectionId, final String recherche, final int start, final int nbElements, final Integer seqId) {
 
String[] parametres = {collectionId};
HashMap<String, String> restrictions = new HashMap<String, String>();
if (nbElements != -1) {
restrictions.put("limit", String.valueOf(nbElements));
}
restrictions.put("orderby", "cpu_fmt_auteur");
 
/** GESTION DE LA REQUETE dans le cas d'une liste paginée progressive **/
if (paginationProgressive) {
 
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start));
/** CONSTRUCTION DE LA REQUETE **/
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
/** ENVOI DE LA REQUETE **/
rb.envoyerRequete(null, new JsonRestRequestCallback()
{
/** RECEPTION DE LA REPONSE **/
public void surReponse(JSONValue responseValue)
{
/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
* On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- CollectionAPublicationAsyncDao > Liste paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(responseValue, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
if (Mediateur.DEBUG) System.out.println("<-- CollectionAPublicationAsyncDao > Liste paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(responseValue);
}
}
});
}
/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
else {
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start*nbElements));
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
Information info = new Information("liste_collection_a_publication");
 
if (responseValue != null) {
 
JSONObject responseObject = responseValue.isObject();
if (responseObject != null) {
// Si la réponse est un tableau, alors c'est une liste de collections qui a été retournée
if (responseObject.get("collectionsAPublication").isArray() != null) {
 
final JSONArray reponse = responseObject.get("collectionsAPublication").isArray();
// Transformation du tableau JSON réponse en ListeInstitution
CollectionAPublicationListe publications = new CollectionAPublicationListe(reponse);
info.setDonnee(0, publications);
// et on met à jour le demandeur des données
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- CollectionAPublicationAsyncDao > Liste non paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(info, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
if (Mediateur.DEBUG) System.out.println("<-- CollectionAPublicationAsyncDao > Liste non paginée, retour au sequenceur");
vueARafraichir.rafraichir(info);
}
// Si la réponse est un objet, alors c'est une unique collection qui a été retournée
} else if (responseObject.get("collectionsAPublication").isObject() != null) {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un tableau JSON et vaut : "+responseValue.toString(), null);
}
}
} else {
// Dans le cas, où nous demandons toutes les institutions et qu'il n'y en a pas, nous retournons un objet vide
if (collectionId == null) {
info.setMessage("Aucune relations entre la collection et les publications");
vueARafraichir.rafraichir(info);
}
}
}
});
}
}
 
public void ajouter(String collectionId, CollectionAPublication publications) {
String postDonneesEncodees = construirePost(collectionId, publications);
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
// Si la requête est un succès, reception d'une chaine
if (responseValue.isString() != null) {
Information info = new Information("ajout_collection_a_publication");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
public void modifier(CollectionAPublication publications) {
String[] parametres = {publications.getIdCollection(), publications.getIdPublication()};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
String postDonneesEncodees = construirePost(publications.getIdCollection(), publications);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
Information info = new Information("modif_collection_a_publication");
// Si la requête est un succès, reception d'une chaine
if (responseValue.isString() != null) {
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
public void supprimer(String idCollectionAPublication) {
String[] parametres = {utilisateurId, idCollectionAPublication};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue.isString() != null) {
Information info = new Information("suppression_collection_a_publication");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
private String construirePost(String collectionId, CollectionAPublication publication) {
String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId) +
"&ccapu_id_collection=" + URL.encodeComponent(collectionId) +
"&ccapu_id_publication=" + URL.encodeComponent(publication.getIdPublication()) +
"&ccapu_source=" + URL.encodeComponent(publication.getSource());
return postDonnees;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/collection/CollectionAPublicationAsyncDao.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/collection/CollectionAPublicationAsyncDao.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/collection/CollectionAPublicationAsyncDao.java:r11-934,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/AuthInfo.java
New file
0,0 → 1,30
package org.tela_botanica.client.modeles;
 
/**
* Une mini classe pour stocker facilement le retour d'un appel aux services
* annuaire:auth (connexion, deconnexion, identite)
*
* @author mathias
*/
public class AuthInfo {
 
public String token;
public boolean session;
public String tokenId;
public int duration;
public Integer lastModif; // Integer pour pouvoir mettre null dedans
public String error;
 
public AuthInfo(String token, boolean session, String tokenId, int duration, Integer lastModif, String error) {
this.token = token;
this.session = session;
this.tokenId = tokenId;
this.duration = duration;
this.lastModif = lastModif;
this.error = error;
}
 
public AuthInfo() {
this(null, false, null, 0, null, null);
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/structure/StructureAPersonne.java
New file
0,0 → 1,345
package org.tela_botanica.client.modeles.structure;
 
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
 
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.personne.Personne;
 
import com.google.gwt.json.client.JSONObject;
 
public class StructureAPersonne extends aDonnee {
 
private static final long serialVersionUID = -7265602594281982891L;
 
public static final String PREFIXE = "csap";
public static final String FONCTION_DIRECTEUR = "2028";
public static final String FONCTION_CONSERVATEUR = "2029";
public static final String FONCTION_TECHNICIEN = "2030";
public static final String ROLE_ADMIN = "2026";
public static final String ROLE_EQUIPE = "2027";
public static final String ETAT_AJOUTE = "A";
public static String[] champsObligatoires = {"csap_id_personne", "csap_id_structure", "csap_id_role", "cp_id_personne"};
public StructureAPersonne() {
// Définition des valeurs par défaut de variables obligatoires vis à vis de l'utilisation de l'objet
set("contact", false);
set("fonction", "");
set("statut", "");
set("travail", 0);
}
public StructureAPersonne(JSONObject personnel) {
// Définition des valeurs par défaut de variables obligatoires vis à vis de l'utilisation de l'objet
set("contact", false);
set("fonction", "");
set("statut", "");
set("travail", 0);
// L'objet JSON est une table de hachage
Set<String> im = personnel.keySet();
 
// Parcourt pour chaque clé
for (Iterator<String> it = im.iterator(); it.hasNext();) {
// Si elle est associée à une valeur, nous l'ajoutons
String cle = it.next();
if (cle.startsWith(PREFIXE+"_")) {
// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
// Sinon, nous ajoutons la clé avec une valeur vide
String valeur = "";
if (personnel.get(cle).isString() != null) {
valeur = personnel.get(cle).isString().stringValue();
}
set(cleObjet, valeur);
if (cle.equals("mark_contact")) {
set("contact", (valeur.equals("1") ? true : false));
} else if (cle.equals("bota_travail_hebdo_tps")) {
set("travail", Integer.parseInt(valeur));
}
}
if (cle.startsWith(Personne.PREFIXE+"_")) {
// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
String cleObjet = cle.replaceFirst("^"+Personne.PREFIXE+"_", "");
// Sinon, nous ajoutons la clé avec une valeur vide
String valeur = "";
if (personnel.get(cle).isString() != null) {
valeur = personnel.get(cle).isString().stringValue();
}
if (cleObjet.equals("truk_telephone")) {
set("telephone", valeur);
set("tel_fix", getInfoDenormaliseParType(valeur, Personne.TELEPHONE_FIXE));
set("tel_fax", getInfoDenormaliseParType(valeur, Personne.TELEPHONE_FAX));
} else if (cleObjet.equals("truk_courriel")) {
set("courriel", getInfoDenormaliseParPosition(valeur, 1));
} else if (cleObjet.equals("ce_truk_specialite")) {
set("specialite", getInfoDenormaliseParPosition(valeur, 1));
} else {
set(cleObjet, valeur);
}
}
}
}
public StructureAPersonne(Personne personne, String fonction, String roleId, String codeEtat) {
Map<String, Object> a = personne.getProperties();
Set<String> cles = a.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
String cleObjet = cle.replaceFirst("^"+Personne.PREFIXE+"_", "");
String valeur = (String)a.get(cle);
if (a.get(cle) != null) {
if (cle.equals("truk_telephone")) {
set("telephone", a.get(cle));
set("tel_fix", getInfoDenormaliseParType(valeur, Personne.TELEPHONE_FIXE));
set("tel_fax", getInfoDenormaliseParType(valeur, Personne.TELEPHONE_FAX));
} else if (cleObjet.equals("truk_courriel")) {
set("courriel", getInfoDenormaliseParPosition(valeur, 1));
} else if (cleObjet.equals("ce_truk_specialite")) {
set("specialite", getInfoDenormaliseParPosition(valeur, 1));
} else {
this.set(cleObjet, a.get(cle));
}
}
}
setFonction(fonction);
setIdRole(roleId);
// Définition des valeurs par défaut de variables obligatoires vis à vis de l'utilisation de l'objet
set("contact", false);
set("fonction", fonction);
set("statut", "");
set("travail", 0);
set("etat", codeEtat);
}
 
/**
* Constructeur avec la fonction à passer en paramètre
*
* @param fonction fonction de la personne dans la structure.
* @param role identifiant du rôle de la personne vis à vis de la structure.
*/
public StructureAPersonne(String fonction, String roleId) {
setFonction(fonction);
setIdRole(roleId);
// Définition des valeurs par défaut de variables obligatoires vis à vis de l'utilisation de l'objet
set("contact", false);
set("fonction", fonction);
set("statut", "");
set("travail", 0);
}
/**
* Constructeur avec la fonction à passer en paramètre
*
* @param fonction fonction de la personne dans la structure.
* @param role identifiant du rôle de la personne vis à vis de la structure.
*/
public StructureAPersonne(String fonction, String roleId, String codeEtat) {
setFonction(fonction);
setIdRole(roleId);
// Définition des valeurs par défaut de variables obligatoires vis à vis de l'utilisation de l'objet
set("contact", false);
set("fonction", fonction);
set("statut", "");
set("travail", 0);
set("etat", codeEtat);
}
@Override
protected String getPrefixe() {
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
// ID
/** Génère un identifiant de StructureAPersonne.
*
* C'est une concaténation des clés primaires de la table coel_structure_a_personne séparées par un tiret "-".
*
* @return identifiant unique d'une relation "structure à personne".
*/
public String getId() {
String idStructure = renvoyerValeurCorrecte("id_structure");
String idPersonne = renvoyerValeurCorrecte("id_personne");
String idRole = renvoyerValeurCorrecte("id_role");
if (idStructure.equals("") && idPersonne.equals("") && idRole.equals("")) {
return null;
} else {
return (idStructure+"-"+idPersonne+"-"+idRole);
}
}
//+---------------------------------------------------------------------------------------------------------------+
// CHAMPS PROVENANT de la TABLE COEL_STRUCTURE_A_PERSONNE
// ID STRUCTURE
public String getIdStructure() {
return renvoyerValeurCorrecte("id_structure");
}
public void setIdStructure(String is) {
set("id_structure", is);
}
// ID PERSONNE
public String getIdPersonne() {
return renvoyerValeurCorrecte("id_personne");
}
public void setIdPersonne(String ip) {
set("id_personne", ip);
}
// ID RôLE
public String getIdRole() {
return renvoyerValeurCorrecte("id_role");
}
public void setIdRole(String ir) {
set("id_role", ir);
}
// FONCTION
public String getFonction() {
return renvoyerValeurCorrecte("ce_truk_fonction");
}
public void setFonction(String ctf) {
set("ce_truk_fonction", ctf);
}
public void setFonction(String type, String valeur) {
setChaineDenormaliseUnique("ce_truk_fonction", type, valeur);
}
// SERVICE
public String getService() {
return renvoyerValeurCorrecte("service");
}
public void setService(String s) {
set("service", s);
}
// STATUT
public String getStatut() {
return renvoyerValeurCorrecte("ce_truk_statut");
}
public void setStatut(String cts) {
set("ce_truk_statut", cts);
}
public void setStatut(String type, String valeur) {
setChaineDenormaliseUnique("ce_truk_statut", type, valeur);
}
// CONTACT
public String getContact() {
return renvoyerValeurCorrecte("mark_contact");
}
public void setContact(String c) {
//set("contact", (c.equals("1") ? true : false));
set("mark_contact", c);
}
public void setContact(Boolean c) {
setContact((c.equals(Boolean.TRUE) ? "1" : "0"));
}
// BOTA TRAVAIL HEBDO TPS
public String getBotaTravailHebdoTps() {
return renvoyerValeurCorrecte("bota_travail_hebdo_tps");
}
public void setBotaTravailHebdoTps(String btht) {
set("bota_travail_hebdo_tps", btht);
}
//+---------------------------------------------------------------------------------------------------------------+
// CHAMPS PROVENANT de la TABLE COEL_PERSONNE
// PRÉNOM
public String getPrenom() {
return renvoyerValeurCorrecte("prenom");
}
public void setPrenom(String prenom) {
set("prenom", prenom);
}
// NOM
public String getNom() {
return renvoyerValeurCorrecte("nom");
}
public void setNom(String nom) {
set("nom", nom);
}
// NOM COMPLET
public String getNomComplet() {
return renvoyerValeurCorrecte("fmt_nom_complet");
}
public void setNomComplet(String nomComplet) {
set("fmt_nom_complet", nomComplet);
}
// TÉLÉPHONE
public String getTelephone() {
return renvoyerValeurCorrecte("telephone");
}
public void setTelephone(String tel) {
set("telephone", tel);
}
// TÉLÉPHONE FIXE
public String getTelephoneFixe() {
return getInfoDenormaliseParType(renvoyerValeurCorrecte("telephone"), Personne.TELEPHONE_FIXE);
}
public void setTelephoneFixe(String fixe) {
// Nous remplaçons le premier numéro de Téléphone FIXE de la personne
modifierChaineDenormaliseParType("telephone", Personne.TELEPHONE_FIXE, fixe);
}
// TÉLÉPHONE FAX
public String getFax() {
return getInfoDenormaliseParType(renvoyerValeurCorrecte("telephone"), Personne.TELEPHONE_FAX);
}
public void setFax(String fax) {
// Nous remplaçons le premier numéro de FAX de la personne
modifierChaineDenormaliseParType("telephone", Personne.TELEPHONE_FAX, fax);
}
// COURRIEL
public String getCourriel() {
return renvoyerValeurCorrecte("courriel");
}
public void setCourriel(String courriel) {
// Nous remplaçons le courriel en position 1 (principal)
this.modifierChaineDenormaliseParPosition("courriel", 1, courriel);
}
public String selectionnerCourriel(int position) {
return getInfoDenormaliseParPosition(renvoyerValeurCorrecte("courriel"), position);
}
// SPÉCIALITÉ
public String getSpecialite() {
return renvoyerValeurCorrecte("specialite");
}
public void setSpecialite(String specialite) {
setChaineDenormaliseUnique("specialite", "AUTRE", specialite);
}
public String afficherSpecialite() {
return getChaineDenormaliseUnique("specialite");
}
public String getDeces() {
return renvoyerValeurCorrecte("ce_deces");
}
public void setDeces(String etat) {
set("ce_deces", etat);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/structure/StructureAPersonne.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/structure/StructureAPersonne.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/structure/StructureAPersonne.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/structure/StructureConservation.java
New file
0,0 → 1,260
package org.tela_botanica.client.modeles.structure;
 
import java.util.Iterator;
import java.util.Set;
 
import org.tela_botanica.client.modeles.aDonnee;
 
import com.google.gwt.json.client.JSONObject;
 
public class StructureConservation extends aDonnee {
private static final long serialVersionUID = -4556005804101933910L;
 
public static final String PREFIXE = "csc";
public static String[] champsObligatoires = {"csc_id_structure"};
public StructureConservation() {
}
public StructureConservation(JSONObject conservation) {
// L'objet JSON est une table de hachage
Set<String> im = conservation.keySet();
 
// Parcourt pour chaque clé
for (Iterator<String> it = im.iterator(); it.hasNext();) {
// Si elle est associée à une valeur, nous l'ajoutons
String cle = it.next();
if (cle.startsWith(PREFIXE+"_")) {
// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
// Sinon, nous ajoutons la clé avec une valeur vide
String valeur = "";
if (conservation.get(cle).isString() != null) {
valeur = conservation.get(cle).isString().stringValue();
}
this.set(cleObjet, valeur);
}
}
}
 
@Override
protected String getPrefixe() {
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
// FORMATION
public Integer getFormation() {
if (renvoyerValeurCorrecte("mark_formation").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_formation"));
}
public void setFormation(String f) {
this.set("mark_formation", f != null ? Integer.parseInt(f) : null);
}
// FORMATION INFO
public String getFormationInfo() {
return renvoyerValeurCorrecte("formation");
}
public void setFormationInfo(String f) {
this.set("formation", f);
}
// FORMATION INTÉRÊT
public Integer getFormationInteret() {
if (renvoyerValeurCorrecte("mark_formation_interet").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_formation_interet"));
}
public void setFormationInteret(String f) {
this.set("mark_formation_interet", f != null ? Integer.parseInt(f) : null);
}
// STOCKAGE LOCAL
public String getStockageLocal() {
return renvoyerValeurCorrecte("truk_stockage_local");
}
public void setStockageLocal(String sl) {
this.set("truk_stockage_local", sl);
}
public void setStockageLocal(String type, Object valeur) {
remplacerTypeDansChaineDenormalise("truk_stockage_local", type, valeur);
}
// STOCKAGE MEUBLE
public String getStockageMeuble() {
return renvoyerValeurCorrecte("truk_stockage_meuble");
}
public void setStockageMeuble(String sm) {
this.set("truk_stockage_meuble", sm);
}
public void setStockageMeuble(String type, Object valeur) {
remplacerTypeDansChaineDenormalise("truk_stockage_meuble", type, valeur);
}
// STOCKAGE PARAMÊTRE
public String getStockageParametre() {
return renvoyerValeurCorrecte("truk_stockage_parametre");
}
public void setStockageParametre(String sl) {
this.set("truk_stockage_parametre", sl);
}
public void setStockageParametre(String type, Object valeur) {
remplacerTypeDansChaineDenormalise("truk_stockage_parametre", type, valeur);
}
// COLLECTION COMMUNE
public Integer getCollectionCommune() {
if (renvoyerValeurCorrecte("mark_collection_commune").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_collection_commune"));
}
public void setCollectionCommune(String ccm) {
this.set("mark_collection_commune", ccm != null ? Integer.parseInt(ccm) : null);
}
// COLLECTION AUTRE
public String getCollectionAutre() {
return renvoyerValeurCorrecte("truk_collection_autre");
}
public void setCollectionAutre(String ca) {
this.set("truk_collection_autre", ca);
}
public void setCollectionAutre(String type, Object valeur) {
remplacerTypeDansChaineDenormalise("truk_collection_autre", type, valeur);
}
// ACCÈS CONTROLÉ
public Integer getAccesControle() {
if (renvoyerValeurCorrecte("mark_acces_controle").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_acces_controle"));
}
public void setAccesControle(String ac) {
this.set("mark_acces_controle", ac != null ? Integer.parseInt(ac) : null);
}
// RESTAURATION
public Integer getRestauration() {
if (renvoyerValeurCorrecte("mark_restauration").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_restauration"));
}
public void setRestauration(String ccm) {
this.set("mark_restauration", ccm != null ? Integer.parseInt(ccm) : null);
}
// RESTAURATION OPÉRATION
public String getRestaurationOperation() {
return renvoyerValeurCorrecte("truk_restauration_operation");
}
public void setRestaurationOperation(String ro) {
this.set("truk_restauration_operation", ro);
}
public void setRestaurationOperation(String type, Object valeur) {
ajouterChaineDenormaliseAvecType("truk_restauration_operation", type, valeur);
}
// MATERIEL CONSERVATION
public String getMaterielConservation() {
return renvoyerValeurCorrecte("ce_materiel_conservation");
}
public void setMaterielConservation(String mc) {
this.set("ce_materiel_conservation", mc);
}
// MATERIEL AUTRE
public String getMaterielAutre() {
return renvoyerValeurCorrecte("truk_materiel_autre");
}
public void setMaterielAutre(String ma) {
this.set("truk_materiel_autre", ma);
}
public void setMaterielAutre(String type, Object valeur) {
ajouterChaineDenormaliseAvecType("truk_materiel_autre", type, valeur);
}
// TRAITEMENT
public Integer getTraitement() {
if (renvoyerValeurCorrecte("mark_traitement").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_traitement"));
}
public void setTraitement(String t) {
this.set("mark_traitement", t != null ? Integer.parseInt(t) : null);
}
// TRAITEMENTS
public String getTraitements() {
return renvoyerValeurCorrecte("truk_traitement");
}
public void setTraitements(String t) {
this.set("truk_traitement", t);
}
public void setTraitements(String type, Object valeur) {
ajouterChaineDenormaliseAvecType("truk_traitement", type, valeur);
}
// ACQUISITION COLLECTION
public Integer getAcquisitionCollection() {
if (renvoyerValeurCorrecte("mark_acquisition_collection").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_acquisition_collection"));
}
public void setAcquisitionCollection(String ac) {
this.set("mark_acquisition_collection", ac != null ? Integer.parseInt(ac) : null);
}
// ACQUISITION ECHANTILLON
public Integer getAcquisitionEchantillon() {
if (renvoyerValeurCorrecte("mark_acquisition_echantillon").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_acquisition_echantillon"));
}
public void setAcquisitionEchantillon(String ae) {
this.set("mark_acquisition_echantillon", ae != null ? Integer.parseInt(ae) : null);
}
// ACQUISITION TRAITEMENT
public String getAcquisitionTraitement() {
return renvoyerValeurCorrecte("mark_acquisition_traitement");
}
public void setAcquisitionTraitement(String at) {
this.set("mark_acquisition_traitement", at);
}
// ACQUISITION TRAITEMENT POISON
public String getAcquisitionTraitementPoison() {
return renvoyerValeurCorrecte("truk_acquisition_traitement_poison");
}
public void setAcquisitionTraitementPoison(String atp) {
this.set("truk_acquisition_traitement_poison", atp);
}
public void setAcquisitionTraitementPoison(String type, Object valeur) {
ajouterChaineDenormaliseAvecType("truk_acquisition_traitement_poison", type, valeur);
}
// ACQUISITION TRAITEMENT INSECTE
public String getAcquisitionTraitementInsecte() {
return renvoyerValeurCorrecte("truk_acquisition_traitement_insecte");
}
public void setAcquisitionTraitementInsecte(String ati) {
this.set("truk_acquisition_traitement_insecte", ati);
}
public void setAcquisitionTraitementInsecte(String type, Object valeur) {
ajouterChaineDenormaliseAvecType("truk_acquisition_traitement_insecte", type, valeur);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/structure/StructureConservation.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/structure/StructureConservation.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/structure/StructureConservation.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/structure/StructureValorisation.java
New file
0,0 → 1,185
package org.tela_botanica.client.modeles.structure;
 
import java.util.Iterator;
import java.util.Set;
 
import org.tela_botanica.client.modeles.aDonnee;
 
import com.google.gwt.json.client.JSONObject;
 
public class StructureValorisation extends aDonnee {
private static final long serialVersionUID = 8906713360999774621L;
 
public static final String PREFIXE = "csv";
public static String[] champsObligatoires = {"csv_id_structure"};
 
public StructureValorisation() {
}
public StructureValorisation(JSONObject valorisation) {
// L'objet JSON est une table de hachage
Set<String> im = valorisation.keySet();
 
// Parcourt pour chaque clé
for (Iterator<String> it = im.iterator(); it.hasNext();) {
// Si elle est associée à une valeur, nous l'ajoutons
String cle = it.next();
if (cle.startsWith(PREFIXE+"_")) {
// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
// Sinon, nous ajoutons la clé avec une valeur vide
String valeur = "";
if (valorisation.get(cle).isString() != null) {
valeur = valorisation.get(cle).isString().stringValue();
}
this.set(cleObjet, valeur);
}
}
}
@Override
protected String getPrefixe() {
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
// ACTION
public Integer getAction() {
if (renvoyerValeurCorrecte("mark_action").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_action"));
}
public void setAction(String a) {
this.set("mark_action", a != null ? Integer.parseInt(a) : null);
}
// ACTION INFO
public String getActionInfo() {
return renvoyerValeurCorrecte("truk_action");
}
public void setActionInfo(String a) {
this.set("truk_action", a);
}
public void setActionInfo(String type, Object valeur) {
remplacerTypeDansChaineDenormalise("truk_action", type, valeur);
}
// PUBLICATION
public String getPublication() {
return renvoyerValeurCorrecte("publication");
}
public void setPublication(String p) {
this.set("publication", p);
}
// COLLECTION AUTRE
public String getCollectionAutre() {
return renvoyerValeurCorrecte("collection_autre");
}
public void setCollectionAutre(String ca) {
this.set("collection_autre", ca);
}
public void setCollectionAutre(String type, Object valeur) {
remplacerTypeDansChaineDenormalise("collection_autre", type, valeur);
}
// ACTION FUTURE
public Integer getActionFuture() {
if (renvoyerValeurCorrecte("mark_action_future").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_action_future"));
}
public void setActionFuture(String af) {
this.set("mark_action_future", af != null ? Integer.parseInt(af) : null);
}
// ACTION FUTURE INFO
public String getActionFutureInfo() {
return renvoyerValeurCorrecte("action_future");
}
public void setActionFutureInfo(String af) {
this.set("action_future", af);
}
 
// RECHERCHE
public Integer getRecherche() {
if (renvoyerValeurCorrecte("mark_recherche").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_recherche"));
 
}
public void setRecherche(String r) {
this.set("mark_recherche", r != null ? Integer.parseInt(r) : null);
}
// RECHERCHE PROVENANCE
public String getRechercheProvenance() {
return renvoyerValeurCorrecte("truk_recherche_provenance");
}
public void setRechercheProvenance(String rp) {
this.set("truk_recherche_provenance", rp);
}
public void setRechercheProvenance(String type, Object valeur) {
remplacerTypeDansChaineDenormalise("truk_recherche_provenance", type, valeur);
}
// RECHERCHE TYPE
public String getRechercheType() {
return renvoyerValeurCorrecte("truk_recherche_type");
}
public void setRechercheType(String rt) {
this.set("truk_recherche_type", rt);
}
public void setRechercheType(String type, Object valeur) {
remplacerTypeDansChaineDenormalise("truk_recherche_type", type, valeur);
}
// ACCES SANS MOTIF
public Integer getAccesSansMotif() {
if (renvoyerValeurCorrecte("mark_acces_ss_motif").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_acces_ss_motif"));
 
}
public void setAccesSansMotif(String asm) {
this.set("mark_acces_ss_motif", asm != null ? Integer.parseInt(asm) : null);
}
// ACCES SANS MOTIF INFO
public String getAccesSansMotifInfo() {
return renvoyerValeurCorrecte("acces_ss_motif");
}
public void setAccesSansMotifInfo(String asm) {
this.set("acces_ss_motif", asm);
}
// VISITE AVEC MOTIF
public Integer getVisiteAvecMotif() {
if (renvoyerValeurCorrecte("mark_visite_avec_motif").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("mark_visite_avec_motif"));
 
}
public void setVisiteAvecMotif(String vam) {
this.set("mark_visite_avec_motif", vam != null ? Integer.parseInt(vam) : null);
}
// VISITE AVEC MOTIF INFO
public String getVisiteAvecMotifInfo() {
return renvoyerValeurCorrecte("visite_avec_motif");
}
public void setVisiteAvecMotifInfo(String vam) {
this.set("visite_avec_motif", vam);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/structure/StructureValorisation.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/structure/StructureValorisation.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/structure/StructureValorisation.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/structure/StructureAPersonneListe.java
New file
0,0 → 1,41
package org.tela_botanica.client.modeles.structure;
 
import org.tela_botanica.client.modeles.aDonneeListe;
 
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
 
/**
* Table de hachage composée d'informations sur les Structures et les Personnes, renvoyé par un objet de type DAO
* La clé est une concaténation des clés primaires de la table coel_structure_a_personne séparées par un tiret "-".
*
* @author david delon
*
*/
public class StructureAPersonneListe extends aDonneeListe<StructureAPersonne> {
private static final long serialVersionUID = -2000442795474013672L;
 
public StructureAPersonneListe() {
super();
}
public StructureAPersonneListe(int taille) {
super(taille);
}
public StructureAPersonneListe(JSONArray structures) {
super(structures.size()) ;
final int taillemax = structures.size();
for (int i = 0; i < taillemax; i++) {
JSONObject structureAPersonneCourante = structures.get(i).isObject() ;
if (structureAPersonneCourante != null) {
StructureAPersonne structureAPersonne = new StructureAPersonne(structureAPersonneCourante);
this.put(structureAPersonne.getId(), structureAPersonne);
}
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/structure/StructureAPersonneListe.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/structure/StructureAPersonneListe.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/structure/StructureAPersonneListe.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/structure/StructureAPersonneAsyncDao.java
New file
0,0 → 1,210
package org.tela_botanica.client.modeles.structure;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
import org.tela_botanica.client.http.JsonRestRequestCallback;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.synchronisation.Reponse;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilDAO;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
 
public class StructureAPersonneAsyncDao {
private static final String SERVICE_NOM = "CoelStructureAPersonne";
 
private String utilisateurId = null;
private Rafraichissable vueARafraichir = null;
 
public StructureAPersonneAsyncDao(Rafraichissable vueARafraichirCourrante) {
if (Mediateur.DEBUG) System.out.println("|| StructureAPersonneAsyncDao > vueARafraichir = "+vueARafraichirCourrante.getClass().toString());
vueARafraichir = vueARafraichirCourrante;
utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
}
 
public void selectionner(final boolean paginationProgressive, final String structureId, final String roleId, final String recherche, final int start, final int nbElements, final Integer seqId) {
 
String[] parametres = {structureId, roleId};
HashMap<String, String> restrictions = new HashMap<String, String>();
if (nbElements != -1) {
restrictions.put("limit", String.valueOf(nbElements));
}
restrictions.put("orderby", "cp_nom");
 
/** GESTION DE LA REQUETE dans le cas d'une liste paginée progressive **/
if (paginationProgressive) {
 
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start));
/** CONSTRUCTION DE LA REQUETE **/
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
 
/** ENVOI DE LA REQUETE **/
rb.envoyerRequete(null, new JsonRestRequestCallback()
{
/** RECEPTION DE LA REPONSE **/
public void surReponse(JSONValue responseValue)
{
/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
* On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- StructureAPersonneAsyncDao > Liste paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(responseValue, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
if (Mediateur.DEBUG) System.out.println("<-- StructureAPersonneAsyncDao > Liste paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(responseValue);
}
}
});
}
/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
else {
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start*nbElements));
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
 
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
Information info = new Information("liste_structure_a_personne");
 
if (responseValue != null) {
 
JSONObject responseObject = responseValue.isObject();
 
if (responseObject != null) {
 
// Si la réponse est un tableau, alors c'est une liste de Structures qui a été retournée
if (responseObject.get("structuresAPersonne").isArray() != null) {
 
final JSONArray reponse = responseObject.get("structuresAPersonne").isArray();
// Transformation du tableau JSON réponse en ListeInstitution
StructureAPersonneListe personnes = new StructureAPersonneListe(reponse);
info.setDonnee(0, personnes);
// et on met à jour le demandeur des données
if (seqId != null) {
Reponse reponseRequete = new Reponse(info, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
vueARafraichir.rafraichir(info);
}
// Si la réponse est un objet, alors c'est une unique Structure qui a été retournée
} else if (responseObject.get("structuresAPersonne").isObject() != null) {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un tableau JSON et vaut : "+responseValue.toString(), null);
}
}
} else {
// Dans le cas, où nous demandons toutes les institutions et qu'il n'y en a pas, nous retournons un objet vide
if (structureId == null) {
// Dans le cas, où nous demandons toutes les relations Structure à Personne et qu'il n'y en a pas, nous retournons un message d'information
info.setMessage("Aucun personnel");
vueARafraichir.rafraichir(info);
}
}
}
});
}
}
 
 
public void ajouter(String structureId, StructureAPersonne personnel) {
String postDonneesEncodees = construirePost(structureId, personnel);
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
// Si la requête est un succès, reception d'une chaine
if (responseValue.isString() != null) {
Information info = new Information("ajout_structure_a_personne");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
public void modifier(StructureAPersonne personnel) {
String[] parametres = {personnel.getIdStructure(), personnel.getIdPersonne(), personnel.getIdRole()};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
String postDonneesEncodees = construirePost(personnel.getIdStructure(), personnel);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
Information info = new Information("modif_structure_a_personne");
// Si la requête est un succès, reception d'une chaine
if (responseValue.isString() != null) {
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
public void supprimer(String idStrAPer) {
String[] parametres = {utilisateurId, idStrAPer};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue.isString() != null) {
Information info = new Information("suppression_structure_a_personne");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
private String construirePost(String structureId, StructureAPersonne personnel) {
String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId);
if (!personnel.getIdPersonne().equals("")) {
postDonnees += "&csap_id_personne=" + URL.encodeComponent(personnel.getIdPersonne()) +
"&cp_id_personne=" + URL.encodeComponent(personnel.getIdPersonne());
}
postDonnees += "&csap_id_structure=" + URL.encodeComponent(structureId) +
"&csap_id_role=" + URL.encodeComponent(personnel.getIdRole()) +
"&csap_ce_truk_fonction=" + URL.encodeComponent(personnel.getFonction()) +
"&csap_service=" + URL.encodeComponent(personnel.getService()) +
"&csap_ce_truk_statut=" + URL.encodeComponent(personnel.getStatut()) +
"&csap_mark_contact=" + URL.encodeComponent(personnel.getContact()) +
"&csap_bota_travail_hebdo_tps=" + URL.encodeComponent(personnel.getBotaTravailHebdoTps()) +
"&cp_prenom=" + URL.encodeComponent(personnel.getPrenom()) +
"&cp_nom=" + URL.encodeComponent(personnel.getNom()) +
"&cp_fmt_nom_complet=" + URL.encodeComponent(personnel.getNomComplet()) +
"&cp_truk_telephone=" + URL.encodeComponent(personnel.getTelephone()) +
"&cp_truk_courriel=" + URL.encodeComponent(personnel.getCourriel()) +
"&cp_ce_truk_specialite=" + URL.encodeComponent(personnel.getSpecialite()) +
"&cp_ce_deces=" + URL.encodeComponent(personnel.getDeces()) +
"";
return postDonnees;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/structure/StructureAPersonneAsyncDao.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/structure/StructureAPersonneAsyncDao.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/structure/StructureAPersonneAsyncDao.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/structure/Structure.java
New file
0,0 → 1,423
package org.tela_botanica.client.modeles.structure;
 
import java.util.Date;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
 
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.data.BaseModelData;
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.json.client.JSONObject;
 
public class Structure extends aDonnee {
private static final long serialVersionUID = -5623886668593288218L;
 
public static final String PREFIXE = "cs";
public static final String URL_SITE = "WEB";
public static final String URL_LOGO = "LOGO";
private BaseModelData urls = null;
private StructureAPersonneListe personnel = null;
private StructureValorisation valorisation = null;
private StructureConservation conservation = null;
public static String[] champsObligatoires = {"cs_id_structure", "csc_id_structure", "csv_id_structure"};
public Structure() {
// Constructions du tableau des urls interne
urls = new BaseModelData();
}
public Structure(ModelData model)
{
Map<String, Object> a = model.getProperties();
 
Set<String> cles = a.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
if (a.get(cle) != null) {
String cleObjet = cle.replaceFirst("^"+getPrefixe()+"_", "");
this.set(cleObjet, a.get(cle));
}
}
}
public Structure(JSONObject institution) {
// Constructions du tableau des urls interne
urls = new BaseModelData();
 
// l'objet JSON est une table de hachage
Set<String> im = institution.keySet();
 
// Parcourt pour chaque clé
for (Iterator<String> it = im.iterator(); it.hasNext();) {
// Si elle est associée à une valeur, nous l'ajoutons
String cle = it.next();
if (cle.startsWith(PREFIXE+"_")) {
// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
// Sinon, nous ajoutons la clé avec une valeur vide
String valeur = "";
if (institution.get(cle).isString() != null) {
valeur = institution.get(cle).isString().stringValue();
}
if (cleObjet.equals("truk_url")) {
this.setUrl(valeur);
} else {
this.set(cleObjet, valeur);
}
}
}
}
@Override
protected String getPrefixe() {
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
public String getId() {
return renvoyerValeurCorrecte("id_structure");
}
public void setId(String idStructure) {
this.set("id_structure", idStructure);
}
public String getIdMere() {
return renvoyerValeurCorrecte("ce_mere");
}
public void setIdMere(String idMere) {
this.set("ce_mere", idMere);
}
public String getGuid() {
return renvoyerValeurCorrecte("guid");
}
public void setGuid(String guid) {
this.set("guid", guid);
}
public String getIdAlternatif() {
return renvoyerValeurCorrecte("truk_identifiant_alternatif");
}
public void setIdAlternatif(String idAlter) {
this.set("truk_identifiant_alternatif", idAlter);
}
public String getNom() {
return renvoyerValeurCorrecte("nom");
}
public void setNom(String nom) {
this.set("nom", nom);
}
public String getNomAlternatif() {
return renvoyerValeurCorrecte("truk_nom_alternatif");
}
public String getDescription() {
return renvoyerValeurCorrecte("description");
}
public void setDescription(String description) {
this.set("description", description);
}
public String getType() {
return renvoyerValeurCorrecte("ce_type");
}
public void setType(String type) {
this.set("ce_type", type);
}
public String getTypePrive() {
return renvoyerValeurCorrecte("ce_truk_type_prive");
}
public void setTypePrive(String typePrive) {
this.set("ce_truk_type_prive", typePrive);
}
public String getTypePublic() {
return renvoyerValeurCorrecte("ce_truk_type_public");
}
public void setTypePublic(String typePublic) {
this.set("ce_truk_type_public", typePublic);
}
public String getAdresse() {
return (String) renvoyerValeurCorrecte("adresse_01");
}
public void setAdresse(String adr) {
this.set("adresse_01", adr);
}
 
public String getDateFondationFormatMysql() {
return renvoyerValeurCorrecte("date_fondation");
}
public String getDateFondationFormatLong() {
String dateFormatee = "";
Date dateFondation = getDateFondation();
if (dateFondation != null) {
dateFormatee = DateTimeFormat.getLongDateFormat().format(dateFondation);
}
return dateFormatee;
}
public String getAnneOuDateFondationFormatLong() {
String dateFormatee = "";
String dateFondation = renvoyerValeurCorrecte("date_fondation");
if (!dateFondation.equals("")) {
if (dateFondation.endsWith("00-00")) {
dateFormatee = dateFondation.substring(0, 4);
} else {
Date date = DateTimeFormat.getFormat("yyyy-MM-dd").parse(dateFondation);
dateFormatee = DateTimeFormat.getLongDateFormat().format(date);
}
}
return dateFormatee;
}
public Date getDateFondation() {
Date fondationDate = null;
String fondationChaine = renvoyerValeurCorrecte("date_fondation");
if (!fondationChaine.isEmpty() && !fondationChaine.equals("0000-00-00")) {
fondationDate = DateTimeFormat.getFormat("yyyy-MM-dd").parseStrict(fondationChaine);
}
return fondationDate;
}
public String getAnneeOuDateFondation() {
String valeurDateFondation = get("date_fondation");
return getDateSouple(valeurDateFondation);
}
public String getDateSouple(String date) {
String valeurDate = date;
String jour = "";
String mois = "";
String annee = "";
 
// pas de date dans la BD
if (UtilString.isEmpty(valeurDate) || valeurDate.equals("0000-00-00")) {
valeurDate = "";
// YYYY
} else if (valeurDate.endsWith("00-00")) {
valeurDate = valeurDate.substring(0, 4);
if (valeurDate.matches("\\d{4}")) {
jour = "";
mois = "";
annee = valeurDate.substring(0,4);
valeurDate = annee;
}
// YYYY-MM
} else if (valeurDate.endsWith("-00")) {
valeurDate = valeurDate.substring(0, 7);
if (valeurDate.matches("\\d{4}-\\d{2}")) {
jour = "";
mois = valeurDate.substring(5,7);
annee = valeurDate.substring(0,4);
valeurDate = mois+"/"+annee;
}
}
// YYYY-MM-DD
else if (valeurDate.matches("\\d{4}-\\d{2}-\\d{2}")) {
Date objetDate = DateTimeFormat.getFormat("yyyy-MM-dd").parse(valeurDate);
DateTimeFormat fmt = DateTimeFormat.getFormat("dd/MM/yyyy");
valeurDate = fmt.format(objetDate);
}
return valeurDate;
}
public void setDateFondation(Date dateFondation) {
if (dateFondation != null) {
this.set("date_fondation", DateTimeFormat.getFormat("yyyy-MM-dd").format(dateFondation));
}
}
public void setDateFondation(String dateFondation) {
if (dateFondation != null) {
this.set("date_fondation", dateFondation);
}
}
public String getCodePostal() {
return renvoyerValeurCorrecte("code_postal");
}
public void setCodePostal(String codePostal) {
this.set("code_postal", codePostal);
}
public String getVille() {
return renvoyerValeurCorrecte("ville");
}
public void setVille(String ville) {
this.set("ville", ville);
}
public String getPays() {
return getChaineDenormaliseUnique("ce_truk_pays");
}
public void setPays(String pays) {
this.set("ce_truk_pays", pays);
}
public String getLatitude() {
return renvoyerValeurCorrecte("latitude");
}
public void setLatitude(String latitude) {
if (latitude != null) {
latitude = latitude.replace(".", ",");
}
this.set("latitude", latitude);
}
 
public String getLongitude() {
return renvoyerValeurCorrecte("longitude");
}
public void setLongitude(String longitude) {
if (longitude != null) {
longitude = longitude.replace(".", ",");
}
this.set("longitude", longitude);
}
// TELEPHONE
public String getTelephone() {
return renvoyerValeurCorrecte("truk_telephone");
}
public void setTelephone(String tel) {
this.set("truk_telephone", tel);
}
 
// TELEPHONE FIXE
public String getTelephoneFixe() {
return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FIXE);
}
public void setTelephoneFixe(String fixe) {
modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FIXE, fixe);
}
//TELEPHONE FAX
public String getFax() {
return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FAX);
}
public void setFax(String fax) {
modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FAX, fax);
}
// COURRIEL
public String getCourriel() {
return renvoyerValeurCorrecte("courriel");
}
public void setCourriel(String courriel) {
this.set("courriel", courriel);
}
// URL
public String getUrl(String type) {
return urls.get(type);
}
public String getUrl() {
String urlsDenormalise = "";
Set<String> proprietes = urls.getProperties().keySet();
for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
String cle = it.next();
urlsDenormalise += cle+"##"+urls.get(cle)+";;";
}
urlsDenormalise = urlsDenormalise.replaceFirst(";;$", "");
return urlsDenormalise;
}
public void setUrl(String urlsDenormalise) {
if (urlsDenormalise != null && !urlsDenormalise.equals("")) {
//GWT.log(urlsDenormalise, null);
String[] tableauUrls = urlsDenormalise.split(";;");
for (int i = 0; i < tableauUrls.length; i++) {
String url = tableauUrls[i];
//GWT.log("\t"+url, null);
String[] tableauUrl = url.split("##");
if (tableauUrl.length == 2) {
//GWT.log("\t\t"+tableauUrl[0]+"-"+tableauUrl[1], null);
urls.set(tableauUrl[0], tableauUrl[1]);
}
}
}
}
public void setUrl(String type, String url) {
if (url != null) {
urls.set(type, url);
}
}
 
public Integer getNbrePersonne() {
if (renvoyerValeurCorrecte("nbre_personne").equals("")) {
return null;
}
return Integer.parseInt(renvoyerValeurCorrecte("nbre_personne"));
}
public void setNbrePersonne(Number nbrePersonne) {
this.set("nbre_personne", nbrePersonne != null ? nbrePersonne.intValue() : null);
}
public String getConditionAcces() {
return renvoyerValeurCorrecte("condition_acces");
}
public void setConditionAcces(String acces) {
this.set("condition_acces", acces);
}
 
public String getConditionUsage() {
return renvoyerValeurCorrecte("condition_usage");
}
public void setConditionUsage(String usage) {
this.set("condition_usage", usage);
}
public StructureAPersonneListe getPersonnel() {
return personnel;
}
public void setPersonnel(StructureAPersonneListe personnelAStocker) {
personnel = personnelAStocker;
}
public StructureValorisation getValorisation() {
return valorisation;
}
public void setValorisation(StructureValorisation valorisationAStocker) {
valorisation = valorisationAStocker;
}
public StructureConservation getConservation() {
return conservation;
}
public void setConservation(StructureConservation conservationAStocker) {
conservation = conservationAStocker;
}
public String toString() {
String sortie = "";
// Champs du BaseModelData
Set<String> proprietes = this.getProperties().keySet();
for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
String cle = it.next();
sortie += cle+" : "+this.get(cle)+"\n";
}
// Champs spéciaux
sortie += getUrl();
return sortie;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/structure/Structure.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/structure/Structure.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/structure/Structure.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/structure/StructureListe.java
New file
0,0 → 1,133
package org.tela_botanica.client.modeles.structure;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.ListePaginable;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.aDonneeListe;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.i18n.client.Dictionary;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONObject;
 
/**
* Classe contenant les informations sur les Structures renvoyées par un objet de type DAO.
*
* @author Jean-Pascal MILCENT
*
*/
public class StructureListe extends aDonneeListe<Structure> implements ListePaginable {
private static final long serialVersionUID = 7384579567038300856L;
private int currentPage = 0;
private int nbElementsPage = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
private int nbElementsTotal;
private Rafraichissable vueARafraichir;
public StructureListe() {
super();
}
public StructureListe(int taille) {
super(taille);
}
public StructureListe(JSONArray ListeDeStructures) {
super(ListeDeStructures.size()) ;
initialiserStructureListe(ListeDeStructures);
}
public StructureListe(JSONArray ListeDeStructures, JSONNumber nbElements, Rafraichissable vueARafraichir) {
super(ListeDeStructures.size());
this.nbElementsTotal = Integer.valueOf(nbElements.toString());
this.vueARafraichir = vueARafraichir;
initialiserStructureListe(ListeDeStructures);
}
private void initialiserStructureListe(JSONArray ListeDeStructures) {
final int taillemax = ListeDeStructures.size();
for (int i = 0; i < taillemax; i++) {
JSONObject structureCourante = ListeDeStructures.get(i).isObject();
if (structureCourante != null) {
Structure structure = new Structure(structureCourante);
StructureValorisation valorisation = new StructureValorisation(structureCourante);
structure.setValorisation(valorisation);
StructureConservation conservation = new StructureConservation(structureCourante);
structure.setConservation(conservation);
this.put(structure.getId(), structure);
}
}
}
public void changerNumeroPage(int pageCourante) {
currentPage = pageCourante;
selectionnerStructure();
}
 
public void changerTaillePage(int nouvelleTaillePage) {
nbElementsPage = nouvelleTaillePage;
selectionnerStructure();
}
public void recharger() {
selectionnerStructure();
}
public void setPageCourante(int pageCourante) {
this.currentPage = pageCourante;
}
 
public void setTaillePage(int taillePage) {
this.nbElementsPage = taillePage;
}
public int[] getPageTable() {
int[] page = new int[4];
// Nombre de pages au total
page[0] = calculerNbPages();
// Page En Cours
page[1] = currentPage;
// nbElementsParPage
page[2] = nbElementsPage;
// et le dernier le nombre total d'éléments
page[3] = nbElementsTotal;
return page;
}
/**
* Calcule le nombre de pages nécessaires pour afficher un nombre d'élements
* donnés en fonction de la taille de page en cours
*
* @return le nombre de pages
*/
public int calculerNbPages() {
// À cause de la bétise de java pour les conversion implicite, on fait quelques conversions manuellement
// pour eviter qu'il arrondisse mal la division nombre de pages = (nombre d'element / taille de la page)
// arrondie à l'entier supérieur.
double nPage = (1.0 * nbElementsTotal) / (1.0 * nbElementsPage);
double nPageRound = Math.ceil(nPage);
Double nPageInt = new Double(nPageRound);
 
// Convertion en entier
return nPageInt.intValue();
}
public void selectionnerStructure() {
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
mediateur.selectionnerStructure(vueARafraichir, null, null, currentPage, nbElementsPage, null, true);
}
public void filtrerParNom(String nom) {
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
mediateur.selectionnerStructure(vueARafraichir, null, "%" + nom + "%", 0, nbElementsPage, null, true);
}
 
public void filtrerParNomEtPage(String nom, int pageCourante) {
currentPage = pageCourante;
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
mediateur.selectionnerStructure(vueARafraichir, null, "%" + nom + "%", currentPage, nbElementsPage, null, true);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/structure/StructureListe.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/structure/StructureListe.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/structure/StructureListe.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/structure/StructureAsyncDao.java
New file
0,0 → 1,315
package org.tela_botanica.client.modeles.structure;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
import org.tela_botanica.client.http.JsonRestRequestCallback;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.personne.PersonneListe;
import org.tela_botanica.client.synchronisation.Reponse;
import org.tela_botanica.client.util.UtilDAO;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.Window;
 
public class StructureAsyncDao {
private static final String SERVICE_NOM = "CoelStructure";
public static String tri = null;
private String utilisateurId = null;
private Rafraichissable vueARafraichir = null;
public StructureAsyncDao(Rafraichissable vue) {
if (Mediateur.DEBUG) System.out.println("|| StructureAsyncDao > vueARafraichir = "+vue.getClass().toString());
vueARafraichir = vue;
utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
}
 
/**
*
* @param paginationProgressive : définit le mode de consultation de la base de données
* - True : la consultation des données est progressive, ce qui signifie que la liste est chargée (paginée) au
* fur et à mesure de la consultation des données par l'utilisateur.
* - False : la consultation des données est classique : un seul appel à la base de données est effectué, le retour
* est renvoyé à l'appelant
* // FIXME : si la taille de la liste est supérieure à la limite du JREST (150), ce deuxieme mode ne fonctionne pas
*/
public void selectionner(final boolean paginationProgressive, final String structureId, final String nomStructure, final String formatRetour, final int start, final int nbElements, final Integer seqId, final boolean searchCity) {
String[] parametres = {structureId, nomStructure};
 
HashMap<String, String> restrictions = new HashMap<String, String>();
 
if (nbElements != -1) {
restrictions.put("limit", String.valueOf(nbElements));
}
restrictions.put("searchCity", String.valueOf(searchCity));
 
if(tri != null) {
restrictions.put("orderby", tri);
}
if ((formatRetour != null) && (formatRetour != "")) {
restrictions.put("formatRetour", formatRetour);
}
/** GESTION DE LA REQUETE dans le cas d'une liste paginée progressive **/
if (paginationProgressive) {
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start));
/** CONSTRUCTION DE LA REQUETE **/
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
 
/** ENVOI DE LA REQUETE **/
rb.envoyerRequete(null, new JsonRestRequestCallback()
{
/** RECEPTION DE LA REPONSE **/
public void surReponse(JSONValue responseValue)
{
if (seqId != null) {
Reponse reponseRequete = new Reponse(responseValue, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
* On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
else vueARafraichir.rafraichir(responseValue);
}
});
}
/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
else {
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start*nbElements));
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
 
public void surReponse(JSONValue responseValue) {
if (responseValue != null) {
Information info = new Information("selection_structure");
JSONObject responseObject = responseValue.isObject();
if (responseObject != null) {
// Si la réponse est un tableau, alors c'est une liste de structure qui a été retournée
if (responseObject.get("structures").isArray() != null) {
JSONObject reponse = responseObject;
StructureListe structures;
structures = new StructureListe(reponse.get("structures").isArray(), reponse.get("nbElements").isNumber(), vueARafraichir);
structures.setTaillePage(nbElements);
structures.setPageCourante(start);
info.setDonnee(0, structures);
if (seqId != null) {
Reponse reponseRequete = new Reponse(info, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else vueARafraichir.rafraichir(structures);
// Si la réponse est un objet, alors c'est une unique structure qui a été retournée
} else if (responseObject.get("structures").isObject() != null) {
JSONObject reponse = responseObject.get("structures").isObject();
Structure structure = new Structure(reponse);
StructureConservation structureConservation = new StructureConservation(reponse);
StructureValorisation structureValorisation = new StructureValorisation(reponse);
info.setDonnee(0, structure);
info.setDonnee(1, structureConservation);
info.setDonnee(2, structureValorisation);
if (seqId != null) {
Reponse reponseRequete = new Reponse(info, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else vueARafraichir.rafraichir(info);
}
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un objet ou un talbeau JSON et vaut : "+responseValue.toString(), null);
}
} else {
if (structureId == null) {
// Dans le cas, où nous demandons toutes les institutions et qu'il n'y en a pas, nous retournons un objet vide
StructureListe structures = new StructureListe(0);
vueARafraichir.rafraichir(structures);
}
}
}
});
}
}
 
public void ajouter(final Structure str, StructureConservation conservation, StructureValorisation valorisation) {
String postDonneesEncodees = construirePost(null, str, conservation, valorisation);
 
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
// Si la requête a impliquées des valeurs autogénérées, l'objet modifié est retourné
JSONObject obj;
if ((obj = responseValue.isObject()) != null) {
if (obj.get("structures").isObject() != null) {
Information info = new Information("ajout_structure");
Structure structure = new Structure(obj.get("structures").isObject());
info.setDonnee(structure);
vueARafraichir.rafraichir(info);
}
}
else if (responseValue.isString() != null) {
Information info = new Information("ajout_structure");
String structureIdOuMessage = responseValue.isString().stringValue();
if (structureIdOuMessage.matches("^[0-9]+$")) {
info.setDonnee(structureIdOuMessage);
} else {
info.setMessage(structureIdOuMessage);
}
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
 
public void modifier(String structureId, Structure str, StructureConservation conservation, StructureValorisation valorisation) {
String postDonneesEncodees = construirePost(structureId, str, conservation, valorisation);
String[] parametres = {structureId};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
// Si la requête a impliquées des valeurs autogénérées, l'objet modifié est retourné
JSONObject obj;
if ((obj = responseValue.isObject()) != null) {
if (obj.get("structures").isObject() != null) {
Structure structure = new Structure(obj.get("structures").isObject());
Information info = new Information("modif_structure");
info.setDonnee(structure);
vueARafraichir.rafraichir(info);
}
}
// Si la requête est un succès, reception d'une chaine
else if (responseValue.isString() != null) {
Information info = new Information("modif_structure");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
public void supprimer(String structuresId) {
String[] parametres = {utilisateurId, structuresId};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue.isString() != null) {
Information info = new Information("suppression_structure");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.", null);
}
}
});
}
private String construirePost(String structureId, Structure str, StructureConservation conservation, StructureValorisation valorisation) {
String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId);
if (str != null) {
if (structureId != null) {
postDonnees += "&cs_id_structure=" + URL.encodeComponent(structureId);
}
postDonnees += "&cs_ce_mere=" + URL.encodeComponent(str.getIdMere()) +
"&cs_guid=" + URL.encodeComponent(str.getGuid()) +
"&cs_truk_identifiant_alternatif=" + URL.encodeComponent(str.getIdAlternatif()) +
"&cs_nom=" + URL.encodeComponent(str.getNom()) +
"&cs_truk_nom_alternatif=" + URL.encodeComponent(str.getNomAlternatif()) +
"&cs_description=" + URL.encodeComponent(str.getDescription()) +
"&cs_ce_type=" + URL.encodeComponent(str.getType()) +
"&cs_ce_truk_type_prive=" + URL.encodeComponent(str.getTypePrive()) +
"&cs_ce_truk_type_public=" + URL.encodeComponent(str.getTypePublic()) +
"&cs_adresse_01=" + URL.encodeComponent(str.getAdresse()) +
"&cs_date_fondation=" + URL.encodeComponent(str.getDateFondationFormatMysql()) +
"&cs_code_postal=" + URL.encodeComponent(str.getCodePostal()) +
"&cs_ville=" + URL.encodeComponent(str.getVille()) +
"&cs_ce_truk_pays=" + URL.encodeComponent(str.getPays()) +
"&cs_latitude=" + URL.encodeComponent(str.getLatitude()) +
"&cs_longitude=" + URL.encodeComponent(str.getLongitude()) +
"&cs_truk_telephone=" + URL.encodeComponent(str.getTelephone()) +
"&cs_truk_url=" + URL.encodeComponent(str.getUrl()) +
"&cs_nbre_personne=" + (str.getNbrePersonne() != null ? str.getNbrePersonne() : "") +
"&cs_condition_acces=" + URL.encodeComponent(str.getConditionAcces())+
"&cs_condition_usage=" + URL.encodeComponent(str.getConditionUsage())+
"&cs_courriel=" + URL.encodeComponent(str.getCourriel());
}
if (conservation != null) {
if (structureId != null) {
postDonnees += "&csc_id_structure=" + URL.encodeComponent(structureId);
}
postDonnees += "&csc_mark_formation=" + (conservation.getFormation() != null ? conservation.getFormation() : "") +
"&csc_formation=" + URL.encodeComponent(conservation.getFormationInfo()) +
"&csc_mark_formation_interet=" + (conservation.getFormationInteret() != null ? conservation.getFormationInteret() : "") +
"&csc_truk_stockage_local=" + URL.encodeComponent(conservation.getStockageLocal()) +
"&csc_truk_stockage_meuble=" + URL.encodeComponent(conservation.getStockageMeuble()) +
"&csc_truk_stockage_parametre=" + URL.encodeComponent(conservation.getStockageParametre()) +
"&csc_mark_collection_commune=" + (conservation.getCollectionCommune() != null ? conservation.getCollectionCommune() : "") +
"&csc_truk_collection_autre=" + URL.encodeComponent(conservation.getCollectionAutre()) +
"&csc_mark_acces_controle=" + (conservation.getAccesControle() != null ? conservation.getAccesControle() : "") +
"&csc_mark_restauration=" + (conservation.getRestauration() != null ? conservation.getRestauration() : "") +
"&csc_truk_restauration_operation=" + URL.encodeComponent(conservation.getRestaurationOperation()) +
"&csc_ce_materiel_conservation=" + URL.encodeComponent(conservation.getMaterielConservation()) +
"&csc_truk_materiel_autre=" + URL.encodeComponent(conservation.getMaterielAutre()) +
"&csc_mark_traitement=" + (conservation.getTraitement() != null ? conservation.getTraitement() : "") +
"&csc_truk_traitement=" + URL.encodeComponent(conservation.getTraitements()) +
"&csc_mark_acquisition_collection=" + (conservation.getAcquisitionCollection() != null ? conservation.getAcquisitionCollection() : "") +
"&csc_mark_acquisition_echantillon=" + (conservation.getAcquisitionEchantillon() != null ? conservation.getAcquisitionEchantillon() : "") +
"&csc_mark_acquisition_traitement=" + URL.encodeComponent(conservation.getAcquisitionTraitement()) +
"&csc_truk_acquisition_traitement_poison=" + URL.encodeComponent(conservation.getAcquisitionTraitementPoison()) +
"&csc_truk_acquisition_traitement_insecte=" + URL.encodeComponent(conservation.getAcquisitionTraitementInsecte());
}
if (valorisation != null) {
if (structureId != null) {
postDonnees += "&csv_id_structure=" + URL.encodeComponent(structureId);
}
postDonnees += "&csv_mark_action=" + (valorisation.getAction() != null ? valorisation.getAction() : "") +
"&csv_truk_action=" + URL.encodeComponent(valorisation.getActionInfo()) +
"&csv_publication=" + URL.encodeComponent(valorisation.getPublication()) +
"&csv_collection_autre=" + URL.encodeComponent(valorisation.getCollectionAutre()) +
"&csv_mark_action_future=" + (valorisation.getActionFuture() != null ? valorisation.getActionFuture() : "") +
"&csv_action_future=" + URL.encodeComponent(valorisation.getActionFutureInfo()) +
"&csv_mark_recherche=" + (valorisation.getRecherche() != null ? valorisation.getRecherche() : "") +
"&csv_truk_recherche_provenance=" + URL.encodeComponent(valorisation.getRechercheProvenance()) +
"&csv_truk_recherche_type=" + URL.encodeComponent(valorisation.getRechercheType()) +
"&csv_mark_acces_ss_motif=" + (valorisation.getAccesSansMotif() != null ? valorisation.getAccesSansMotif() : "") +
"&csv_acces_ss_motif=" + URL.encodeComponent(valorisation.getAccesSansMotifInfo()) +
"&csv_mark_visite_avec_motif=" + (valorisation.getVisiteAvecMotif() != null ? valorisation.getVisiteAvecMotif() : "") +
"&csv_visite_avec_motif=" + URL.encodeComponent(valorisation.getVisiteAvecMotifInfo());
}
return postDonnees;
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/structure/StructureAsyncDao.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/structure/StructureAsyncDao.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/structure/StructureAsyncDao.java:r11-934,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/ValeurListeAsyncDao.java
New file
0,0 → 1,298
package org.tela_botanica.client.modeles;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
import org.tela_botanica.client.http.JsonRestRequestCallback;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.synchronisation.Reponse;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.UtilDAO;
 
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONBoolean;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
 
public class ValeurListeAsyncDao {
private static HashMap<String, Object> ontologieCache = new HashMap<String, Object>();
private static final String SERVICE_NOM = "CoelValeurListe";
private Rafraichissable vueARafraichir = null;
private int cptPage = 0;
// FIXME : limiteJREST devrait être récupéré depuis un registre/dictionnaire
private int limiteJREST = 150;
 
public ValeurListeAsyncDao(Rafraichissable vueCourante) {
vueARafraichir = vueCourante;
if (Mediateur.DEBUG) System.out.println("|| ValeurListeAsyncDao > vueARafraichir = "+vueARafraichir.getClass().toString());
}
public static HashMap<String, Object> getOntologieCache() {
return ontologieCache;
}
public void obtenirListe(Integer cle, Integer seqId) {
selectionner("id", cle, null, null, false, null, -1, -1, seqId);
}
public void obtenirListe(String type, String identifiantValeur, Integer seqId) {
selectionner(type, null, null, identifiantValeur, false, null, -1, -1, seqId);
}
public void obtenirListe(Integer cle, boolean pagination, String recherche, int start, int limit, Integer seqId) {
selectionner("nom", cle, null, null, pagination, recherche, start, limit, seqId);
}
public void selectionner(String type, Integer cle, String abv, String idValeur, Integer seqId) {
selectionner(type, cle, abv, idValeur, false, null, -1, -1, seqId);
}
 
/****************************************************************************************************
** selectionner(final String type, final Integer cle, final String abv, final String idValeur, final boolean pagination, final String recherche, final int start, final int limit)
/****************************************************************************************************
* Action :
* --------
* Récupère un nombre défini de Valeurs en s'aidant du nom partiel ou complet d'une valeur.
* Cette méthode gère deux types de sélection de données :
* - la sélection en cache (ontologieCache) --> pagination = FALSE
* - la sélection "au fur et à mesure" --> pagination = TRUE
*
* Gestion du cache :
* ------------------
* - Le cache est utilisé si et seulement si 'pagination' est à FAUX car dans le cas où PAGINATION est
* à VRAI, les enregistrements sont chargés au fur et à mesure de la consultation des pages par
* l'utilisateur.
* - Si la taille de la liste chargée est supérieure au nombre maximum d'enregistrements retourné
* par le service JREST, alors on charge des blocs de valeurs jusqu'à ce que la totalité de la
* liste soit chargée.
*
* Description des paramètres :
* ----------------------------
* @param 'type' est un paramètre directement destiné au service JREST. Il permet de définir le type
* de requête SQL à exécuter.
* @param 'cle' est l'identifiant de la liste de valeurs à récupérer (cas d'un noeud dans l'arbre).
* @param 'abv' sert pour la liste des régions. Il représente l'abréviation du nom d'un pays. Ce
* paramètre est concaténé à la clé pour former une clé particulière dont on se sert pour
* stocker la liste en cache.
* @param 'idValeur' est l'identifiant de la valeur à récupérer (cas d'une feuille dans l'arbre).
* @param 'pagination' est un booléen qui définit si la requête doit être paginée ou non.
* @param 'recherche' est une chaîne de caractères représentant tout ou partie du nom d'un projet.
* Si la chaîne est vide, alors tous les projets sont recherchés.
* (la notion de projet a été supprimée)
* //TODO: pertinence de ce paramètre
* @param 'start' et 'limit' sont les paramètres indispensables à la pagination. 'start'
* est le paramètre qui décrit le numéro du tuple de départ et 'limit' le nombre
* d'éléments à collecter.
*
*****************************************************************************************************/
public void selectionner(final String type, final Integer cle, final String abv, final String idValeur, final boolean pagination, final String recherche, final int start, final int limit, final Integer seqId) {
/**
* La cleParent en Integer est insuffisante pour les liste valeurs comme Région qui on plusieurs
* sections sur leur liste (ex : on ne sélectionne que les régions FR.__ puis les régions ES.__ sur la liste 1078 ....
**/
final String cleParentPourCache = cle + (abv == null ? "" : abv);
final String cleParent = cle+"";
/** GESTION DU PARAMETRE 'recherche' **/
String nom = "";
if ( (recherche == null) || (recherche.equals("")) ) nom = "";
else {
nom = recherche+"%";
}
 
/** GESTION DU PARAMETRE 'abréviation' **/
String abreviation = "";
String paramAbv = "";
if (type.equals("ab") || type.equals("abv")) {
int positionPoint = abv.indexOf(".");
if (positionPoint != -1) abreviation = abv.substring(0, positionPoint)+"%";
else abreviation=abv+"%";
}
paramAbv = abreviation;
 
/** GESTION DES PARAMETRES à transmettre au JREST **/
String[] parametres = {type, cleParent, paramAbv, idValeur, nom};
HashMap<String, String> restrictions = new HashMap<String, String>();
 
/** GESTION DE LA REQUETE dans le cas d'une liste paginée **/
if (pagination) {
 
restrictions.put("limit", String.valueOf(limit));
restrictions.put("start", String.valueOf(start));
restrictions.put("orderby", "cmlv_nom");
/** CONSTRUCTION DE LA REQUETE **/
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
/** ENVOI DE LA REQUETE **/
rb.envoyerRequete(null, new JsonRestRequestCallback()
{
/** RECEPTION DE LA REPONSE **/
public void surReponse(JSONValue responseValue)
{
if (vueARafraichir instanceof Sequenceur) {
if (Mediateur.DEBUG) System.out.println("<-- ValeurListeAsyncDao > Liste paginée, retour au sequenceur");
Reponse reponse = new Reponse(responseValue, seqId);
vueARafraichir.rafraichir(reponse);
/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
* On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
} else {
if (Mediateur.DEBUG) System.out.println("<-- ValeurListeAsyncDao > Liste paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(responseValue);
}
}
});
}
/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée **/
else
{
/** si start est supérieur à zéro, alors cela signifie que l'on doit charger une nouvelle page **/
boolean nextPage = (start > 0);
/** définition des contraintes sur la requête SQL **/
if (nextPage) {
restrictions.put("start", String.valueOf(start));
restrictions.put("limit", String.valueOf(limit));
restrictions.put("orderby", "cmlv_nom");
}
else {
restrictions.put("orderby", "cmlv_nom");
}
/** Si l'on est pas dans un processus de récupération d'une liste, alors si le cache contient déjà la liste recherchée **/
if (!nextPage && ontologieCache.containsKey(cleParentPourCache)) {
/** on retourne à la vue la liste contenue dans le cache **/
if (vueARafraichir instanceof Sequenceur) {
if (Mediateur.DEBUG) System.out.println("<-- ValeurListeAsyncDao > Liste en cache, retour au sequenceur");
vueARafraichir = (Sequenceur) vueARafraichir;
Reponse reponse = new Reponse(ontologieCache.get(cleParentPourCache), seqId);
vueARafraichir.rafraichir(reponse);
} else {
if (Mediateur.DEBUG) System.out.println("<-- ValeurListeAsyncDao > Liste en cache, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(ontologieCache.get(cleParentPourCache));
}
}
/** Si l'on est en train de récupérer une liste (c-a-d que l'on est en train de charger des blocs de données afin de récupérer totalement une liste) **/
else {
/** CONSTRUCTION DE LA REQUETE **/
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
/** ENVOI DE LA REQUETE **/
rb.envoyerRequete(null, new JsonRestRequestCallback() {
/** RECEPTION DE LA REPONSE **/
public void surReponse(JSONValue responseValue) {
/** Si la réponse n'est pas vide **/
if (responseValue.isObject() != null) {
/** Récupération des différents paramètres de la réponse JSON **/
final JSONObject reponse = responseValue.isObject();
JSONString listeId = reponse.get("id").isString();
JSONArray listeValeurs = reponse.get("valeurs").isArray();
JSONNumber nbElements = reponse.get("nbElements").isNumber();
JSONBoolean getNextPage = reponse.get("getNextPage").isBoolean();
/** Gestion de l'abreviation (pour la liste des régions) **/
String abreviationStr = "";
if (reponse.get("abreviation") != null) {
abreviationStr = reponse.get("abreviation").isString().stringValue();
int a = abreviationStr.indexOf("%", 1);
abreviationStr = abreviationStr.substring(1, a);
}
else {
abreviationStr = "";
}
 
/** Si l'on a bien reçu une liste de valeurs **/
if (listeId != null)
{
/** Transformation du tableau JSON réponse en ValeurListe **/
String id = listeId.stringValue();
ValeurListe liste = new ValeurListe(new JSONString(id), abreviationStr, listeValeurs, nbElements);
 
/** Si la liste existe deja en cache **/
String identifiantCache = (abreviationStr=="") ? id : (id+abreviationStr);
if (ontologieCache.get(id) != null)
{
/** Alors on concatène la liste existante avec celle qu'on vient de recevoir **/
((ValeurListe)ontologieCache.get(identifiantCache)).concatenerListe(liste);
}
/** Sinon on l'insère simplement dans le cache **/
else {
ontologieCache.put(identifiantCache,liste);
}
 
/** Appel à la méthode qui gère le retour à l'appelant ou la suite du chargement **/
chargerListe(getNextPage.booleanValue(), type, liste.getId(), abv, idValeur, pagination, recherche, start, limit, seqId);
}
}
}
});
}
}
}
/********************************************************************************************************
* Action :
* --------
* Clotûre le chargement d'une liste de valeurs si le chargement est terminé, ou lance le chargement
* du prochain bloc de données si la liste n'est pas chargée en totalité.
*
* Paramètres :
* ------------
* @param nextPage : est VRAI s'il faut faut continuer de charger la liste car elle n'est pas entièrement chargée et FAUX sinon
* @param Tous les autres paramètres sont les mêmes que pour la méthode 'selectionner'
*
*********************************************************************************************************/
public void chargerListe(boolean nextPage, String type, Integer cle, String abv, String idValeur, boolean pagination, String recherche, int start, int nbElements, final Integer seqId) {
/** Si nextpage est VRAI, alors cela signifie que l'on doit relancer une requete pour obtenir
la page suivante **/
if (nextPage) {
cptPage++;
selectionner(type, cle, abv, idValeur, pagination, recherche, cptPage*limiteJREST, limiteJREST, seqId);
}
/** Sinon cela signifie que le chargement de la liste est terminé et on peut
la mettre en cache et retourner la réponse au demandeur **/
else {
// recupération de l'idenfiant de la liste
String id = String.valueOf(cle);
// gestion de l'abréviation pour la liste des régions
String abreviationStr = "";
if (abv != null) {
abreviationStr = abv;
int indexPoint = abreviationStr.indexOf(".", 0);
abreviationStr = abreviationStr.substring(0, indexPoint);
id = id+abreviationStr;
}
 
/** On retourne la liste à la vue **/
if (ontologieCache.get(id) != null) {
if (vueARafraichir instanceof Sequenceur) {
if (Mediateur.DEBUG) System.out.println("<-- ValeurListeAsyncDao > Liste en cache, retour au sequenceur (cptPage="+cptPage+")");
vueARafraichir = (Sequenceur) vueARafraichir;
Reponse reponse = new Reponse(ontologieCache.get(id), seqId);
vueARafraichir.rafraichir(reponse);
} else {
if (Mediateur.DEBUG) System.out.println("<-- ValeurListeAsyncDao > Liste en cache, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(ontologieCache.get(id));
}
}
// réinitialisation du compteur
cptPage = 0;
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/ValeurListeAsyncDao.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/ValeurListeAsyncDao.java:r11-68,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/ValeurListeAsyncDao.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/commentaire/Commentaire.java
New file
0,0 → 1,154
package org.tela_botanica.client.modeles.commentaire;
 
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionACommentaire;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
 
public class Commentaire extends aDonnee {
 
private static final long serialVersionUID = 7216356814682582569L;
public static final String PREFIXE = "ccm";
private Collection collection = null;
private CollectionACommentaire collectionACommentaire = null;
public static String[] champsObligatoires = {"ccm_id_commentaire"};
public Commentaire() {
}
public Commentaire(JSONObject commentaire) {
initialiserCommentaire(commentaire, false);
}
 
public Commentaire(JSONObject commentaire, boolean chargerCollectionACommentaire) {
initialiserCommentaire(commentaire, chargerCollectionACommentaire);
}
public Commentaire(ModelData model)
{
Map<String, Object> a = model.getProperties();
 
Set<String> cles = a.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
if (a.get(cle) != null) {
String cleObjet = cle.replaceFirst("^"+getPrefixe()+"_", "");
this.set(cleObjet, a.get(cle));
}
}
}
public void initialiserCommentaire(JSONObject commentaire, boolean chargerCollectionACommentaire) {
initialiserModele(commentaire);
collection = new Collection(commentaire);
if (chargerCollectionACommentaire) {
collectionACommentaire = new CollectionACommentaire(commentaire);
} else {
collectionACommentaire = new CollectionACommentaire();
}
initialiserChampsPourGrille();
}
@Override
protected String getPrefixe() {
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
private void initialiserChampsPourGrille() {
set("_collection_nom_", getCollection().getNom());
set("_type_", getCollectionACommentaire().getType());
set("_titre_", getTitre());
set("_texte_", getTexteResume());
set("_ponderation_", getPonderation());
set("_public_", getPublic());
set("_etat_", "");
}
public Collection getCollection() {
if (collection == null) {
collection = new Collection();
}
return collection;
}
public void setCollection(Collection collectionAStocker) {
collection = collectionAStocker;
}
public CollectionACommentaire getCollectionACommentaire() {
if (collectionACommentaire == null) {
collectionACommentaire = new CollectionACommentaire();
}
return collectionACommentaire;
}
public void setCollectionACommentaire(CollectionACommentaire collectionACommentaireAStocker) {
collectionACommentaire = collectionACommentaireAStocker;
}
public String getId() {
return renvoyerValeurCorrecte("id_commentaire");
}
public void setId(String idCommentaire) {
this.set("id_commentaire", idCommentaire);
}
public String getCommentairePereId() {
return renvoyerValeurCorrecte("ce_pere");
}
public void setCommentairePereId(String idPere) {
this.set("ce_pere", idPere);
}
public String getTitre() {
return renvoyerValeurCorrecte("titre");
}
public void setTitre(String titre) {
this.set("titre", titre);
}
public String getTexteResume() {
String resume = getTexte();
if (getTexte().length() > 100) {
resume = getTexte().substring(0, 100);
}
return resume;
}
public String getTexte() {
return renvoyerValeurCorrecte("texte");
}
public void setTexte(String texte) {
this.set("texte", texte);
}
public String getPonderation() {
return renvoyerValeurCorrecte("ponderation");
}
public void setPonderation(String ponderation) {
this.set("ponderation", ponderation);
}
public boolean etrePublic() {
return (getPublic().equals("1") ? true : false);
}
public String getPublic() {
return renvoyerValeurCorrecte("mark_public");
}
public void setPublic(String publique) {
this.set("mark_public", publique);
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/modeles/commentaire/Commentaire.java:r11-984,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/commentaire/Commentaire.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/commentaire/Commentaire.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/commentaire/CommentaireListe.java
New file
0,0 → 1,141
package org.tela_botanica.client.modeles.commentaire;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.ListePaginable;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.aDonneeListe;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.i18n.client.Dictionary;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONObject;
 
/**
* Classe contenant les informations sur les Commentaires renvoyées par un objet de type DAO.
*
* @author Jean-Pascal MILCENT
*
*/
public class CommentaireListe extends aDonneeListe<Commentaire> implements ListePaginable {
 
private static final long serialVersionUID = 2600314321196345072L;
private int currentPage = 0;
private int nbElementsPage = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
private int nbElementsTotal;
private Rafraichissable vueARafraichir;
public CommentaireListe() {
super();
}
public CommentaireListe(int taille) {
super(taille);
}
/**
* Constructeur pour une liste de commentaires
* @param dates
*/
public CommentaireListe(JSONArray ListeDeCommentaires) {
super(ListeDeCommentaires.size());
initialiserCommentaireListe(ListeDeCommentaires);
}
public CommentaireListe(JSONArray ListeDeCommentaires, JSONNumber nbElements, Rafraichissable vueARafraichir) {
super(ListeDeCommentaires.size());
this.nbElementsTotal = Integer.valueOf(nbElements.toString());
this.vueARafraichir = vueARafraichir;
initialiserCommentaireListe(ListeDeCommentaires);
}
private void initialiserCommentaireListe(JSONArray ListeDeCommentaires) {
boolean chargerCollectionACommentaire = true;
final int taillemax = ListeDeCommentaires.size();
for (int i = 0; i < taillemax; i++) {
JSONObject commentaireCourant = ListeDeCommentaires.get(i).isObject() ;
if (commentaireCourant != null) {
Commentaire commentaire = new Commentaire(commentaireCourant, chargerCollectionACommentaire);
if (!UtilString.isEmpty(commentaire.getCollectionACommentaire().getId())) {
this.put(commentaire.getCollectionACommentaire().getId(), commentaire);
}
else {
this.put(commentaire.getId(), commentaire);
}
}
}
}
public void changerNumeroPage(int pageCourante) {
currentPage = pageCourante;
selectionnerCommentaire();
}
 
public void changerTaillePage(int nouvelleTaillePage) {
nbElementsPage = nouvelleTaillePage;
selectionnerCommentaire();
}
public void recharger() {
selectionnerCommentaire();
}
public void setPageCourante(int pageCourante) {
this.currentPage = pageCourante;
}
 
public void setTaillePage(int taillePage) {
this.nbElementsPage = taillePage;
}
public int[] getPageTable() {
int[] page = new int[4];
// nombre de pages au total
page[0] = calculerNbPages();
// Page En Cours
page[1] = currentPage;
// nbElementsParPage
page[2] = nbElementsPage;
// et le dernier le nombre total d'éléments
page[3] = nbElementsTotal;
return page;
}
/**
* Calcule le nombre de pages nécessaires pour afficher un nombre d'élements
* donnés en fonction de la taille de page en cours
*
* @return le nombre de pages
*/
public int calculerNbPages() {
// À cause de la bétise de java pour les conversion implicite, on fait quelques conversions manuellement
// pour eviter qu'il arrondisse mal la division nombre de pages = (nombre d'element / taille de la page)
// arrondie à l'entier supérieur.
double nPage = (1.0 * nbElementsTotal) / (1.0 * nbElementsPage);
double nPageRound = Math.ceil(nPage);
Double nPageInt = new Double(nPageRound);
 
// Convertion en entier
return nPageInt.intValue();
}
public void selectionnerCommentaire() {
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
mediateur.selectionnerCommentaire(vueARafraichir, null, null, currentPage, nbElementsPage, null);
}
public void filtrerParNom(String nom) {
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
mediateur.selectionnerCommentaireParTitre(vueARafraichir, "%" + nom + "%", null);
}
 
public void filtrerParNomEtPage(String nom, int pageCourante) {
currentPage = pageCourante;
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
mediateur.selectionnerCommentaire(vueARafraichir, null, "%" + nom + "%", currentPage, nbElementsPage, null);
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/modeles/commentaire/CommentaireListe.java:r11-984,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/commentaire/CommentaireListe.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/commentaire/CommentaireListe.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/commentaire/CommentaireAsyncDao.java
New file
0,0 → 1,210
package org.tela_botanica.client.modeles.commentaire;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
import org.tela_botanica.client.http.JsonRestRequestCallback;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.synchronisation.Reponse;
import org.tela_botanica.client.util.UtilDAO;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.core.client.GWT;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
 
public class CommentaireAsyncDao {
private static final String SERVICE_NOM = "CoelCommentaire";
public static String tri = null;
private String utilisateurId = null;
private Rafraichissable vueARafraichir = null;
public CommentaireAsyncDao(Rafraichissable vueARafraichirCourrante) {
if (Mediateur.DEBUG) System.out.println("|| CommentaireAsyncDao > vueARafraichir = "+vueARafraichirCourrante.getClass().toString());
vueARafraichir = vueARafraichirCourrante ;
utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
}
 
/**
*
* @param paginationProgressive : définit le mode de consultation de la base de données
* - True : la consultation des données est progressive, ce qui signifie que la liste est chargée (paginée) au
* fur et à mesure de la consultation des données par l'utilisateur.
* - False : la consultation des données est classique : un seul appel à la base de données est effectué, le retour
* est renvoyé à l'appelant
* // FIXME : si la taille de la liste est supérieure à la limite du JREST (150), ce deuxieme mode ne fonctionne pas
*/
public void selectionner(final boolean paginationProgressive, final String commentaireId, final String titre, final int start, final int nbElements, final Integer seqId) {
 
// Ajout des paramètres et données à selectionner dans l'URL
String nom = (titre == null) ? "%" : titre+"%";
String[] parametres = {commentaireId, nom};
HashMap<String, String> restrictions = new HashMap<String, String>();
if (nbElements != -1) {
restrictions.put("limit", String.valueOf(nbElements));
}
 
if(tri != null) {
restrictions.put("orderby", tri);
} else {
restrictions.put("orderby", "ccm_titre ASC");
}
 
/** GESTION DE LA REQUETE dans le cas d'une liste paginée progressive **/
if (paginationProgressive) {
 
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start));
/** CONSTRUCTION DE LA REQUETE **/
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
 
/** ENVOI DE LA REQUETE **/
rb.envoyerRequete(null, new JsonRestRequestCallback()
{
/** RECEPTION DE LA REPONSE **/
public void surReponse(JSONValue responseValue)
{
/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
* On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- CommentairesASyncDao > Liste paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(responseValue, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
if (Mediateur.DEBUG) System.out.println("<-- CommentairesASyncDao > Liste paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(responseValue);
}
}
});
}
/** GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive **/
else {
 
/** DEFINITION DU TUPLE DE DEPART **/
restrictions.put("start", String.valueOf(start*nbElements));
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue != null) {
 
JSONObject responseObject = responseValue.isObject();
 
if (responseObject != null) {
// Si la réponse est un tableau, alors c'est une liste de commentaires qui a été retournée
if (responseObject.get("commentaires").isArray() != null) {
final JSONArray reponse = responseObject.get("commentaires").isArray();
 
CommentaireListe commentaires = new CommentaireListe(reponse, responseObject.get("nbElements").isNumber(), vueARafraichir);
commentaires.setTaillePage(nbElements);
commentaires.setPageCourante(start);
vueARafraichir.rafraichir(commentaires);
 
// Si la réponse est un objet, alors c'est un unique commentaire qui a été retournée
} else if (responseObject.get("commentaires").isObject() != null) {
 
final JSONObject reponse = responseObject.get("commentaires").isObject();
Commentaire commentaire = new Commentaire(reponse);
// et on met à jour le demandeur des données
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- CommentairesASyncDao > Liste non paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(commentaire, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
if (Mediateur.DEBUG) System.out.println("<-- CommentairesASyncDao > Liste non paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(commentaire);
}
}
} else {
GWT.log(rb.getUrl()+"\n\tLa réponse n'est pas un objet ou un talbeau JSON et vaut : "+responseValue.toString(), null);
}
} else {
// Dans le cas, où nous demandons toutes les institutions et qu'il n'y en a pas, nous retournons un objet vide
if (commentaireId == null) {
CommentaireListe commentaires = new CommentaireListe(0);
if (seqId != null) {
Reponse reponseRequete = new Reponse(commentaires, seqId);
vueARafraichir.rafraichir(reponseRequete);
}
else {
vueARafraichir.rafraichir(commentaires);
}
}
}
}
});
}
}
 
public void ajouter(Commentaire commentaire) {
String postDonneesEncodees = commentaire.obtenirChainePOST()+"&cmhl_ce_modifier_par="+utilisateurId;
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue reponseValeur) {
traiterReponse(reponseValeur, "ajout_commentaire");
}
}) ;
}
public void modifier(Commentaire commentaire) {
String[] parametres = {commentaire.getId()};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
String postDonneesEncodees = commentaire.obtenirChainePOST()+"&cmhl_ce_modifier_par="+utilisateurId;
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue reponseValeur) {
traiterReponse(reponseValeur, "modif_commentaire");
}
});
}
 
public void supprimer(String commentairesId) {
String[] parametres = {utilisateurId, commentairesId};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue reponseValeur) {
traiterReponse(reponseValeur, "suppression_commentaire");
}
});
}
private void traiterReponse(JSONValue reponseValeur, String type) {
Information info = new Information(type);
// Si la requête est un succès, réception d'une chaîne
if (reponseValeur.isString() != null) {
String idOuMessage = reponseValeur.isString().stringValue();
if (idOuMessage.matches("^[0-9]+$")) {
info.setDonnee(idOuMessage);
} else {
info.setMessage(idOuMessage);
}
} else {
info.setDeboguage("La réponse n'est pas une chaine JSON.");
}
vueARafraichir.rafraichir(info);
}
 
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/modeles/commentaire/CommentaireAsyncDao.java:r11-984,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/commentaire/CommentaireAsyncDao.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/commentaire/CommentaireAsyncDao.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/InterneValeur.java
New file
0,0 → 1,32
package org.tela_botanica.client.modeles;
 
import com.extjs.gxt.ui.client.data.BaseModelData;
 
public class InterneValeur extends BaseModelData {
private static final long serialVersionUID = 8587069259740389877L;
 
public InterneValeur() {
}
public InterneValeur(String abr, String nom) {
setAbr(abr);
setNom(nom);
}
public String getNom() {
return get("nom");
}
public void setNom(String nom) {
set("nom", nom);
}
 
public String getAbr() {
return get("abr");
}
 
public void setAbr(String abr) {
set("abr", abr);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/InterneValeur.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/InterneValeur.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/InterneValeur.java:r11-100,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/InterneValeurListe.java
New file
0,0 → 1,39
package org.tela_botanica.client.modeles;
 
import java.util.ArrayList;
import java.util.List;
 
public class InterneValeurListe {
 
public static List<InterneValeur> getTypeAcronyme() {
List<InterneValeur> acronymes = new ArrayList<InterneValeur>();
acronymes.add(new InterneValeur("", "Aucun"));
acronymes.add(getTypeAcronymeIH());
acronymes.add(getTypeAcronymeMNHN());
return acronymes;
}
public static List<InterneValeur> getTypeStructure() {
List<InterneValeur> types = new ArrayList<InterneValeur>();
types.add(new InterneValeur("", "Aucun"));
types.add(getTypePublique());
types.add(getTypePrivee());
return types;
}
public static InterneValeur getTypePublique() {
return new InterneValeur("stpu", "Publique");
}
public static InterneValeur getTypePrivee() {
return new InterneValeur("stpr", "Privée");
}
public static InterneValeur getTypeAcronymeIH() {
return new InterneValeur("IH", "Index Herbariorum");
}
public static InterneValeur getTypeAcronymeMNHN() {
return new InterneValeur("MNHN", "Muséum National d'Histoire Naturelle de Paris");
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/modeles/InterneValeurListe.java:r11-100,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/InterneValeurListe.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/InterneValeurListe.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/Information.java
New file
0,0 → 1,119
package org.tela_botanica.client.modeles;
 
import java.util.ArrayList;
 
import com.google.gwt.json.client.JSONArray;
 
public class Information {
private String type = null;
private ArrayList<String> messages = null;
private ArrayList<String> deboguages = null;
private ArrayList<Object> donnees = null;
public Information() {
donnees = new ArrayList<Object>();
messages = new ArrayList<String>();
deboguages = new ArrayList<String>();
}
 
public Information(String t) {
donnees = new ArrayList<Object>();
messages = new ArrayList<String>();
deboguages = new ArrayList<String>();
type = t;
}
public Information(String t, String m) {
donnees = new ArrayList<Object>();
messages = new ArrayList<String>();
messages.add(m);
deboguages = new ArrayList<String>();
type = t;
}
public Information(String t, JSONArray jsonArray) {
donnees = new ArrayList<Object>();
messages = new ArrayList<String>();
for(int i = 0 ; i < jsonArray.size() ; i++) {
if (jsonArray.get(i).isString() != null) {
messages.add(jsonArray.get(i).isString().stringValue());
}
}
deboguages = new ArrayList<String>();
type = t;
}
 
public Information(String t, Object o) {
donnees = new ArrayList<Object>();
donnees.add(o);
messages = new ArrayList<String>();
deboguages = new ArrayList<String>();
type = t;
}
 
public void setType(String t) {
type = t;
}
public String getType() {
return type;
}
public void setMessage(String message) {
messages.add(message);
}
public String getMessage(int index) {
return messages.get(index);
}
public ArrayList<String> getMessages() {
return messages;
}
public void setDeboguage(String messageDeboguage) {
deboguages.add(messageDeboguage);
}
public void setDeboguages(JSONArray jsonArray) {
for(int i = 0 ; i < jsonArray.size() ; i++) {
if (jsonArray.get(i).isString() != null) {
deboguages.add(jsonArray.get(i).isString().stringValue());
}
}
}
public String getDeboguage(int index) {
return deboguages.get(index);
}
public ArrayList<String> getDeboguages() {
return deboguages;
}
public void setDonnee(Object objet) {
donnees.add(objet);
}
public void setDonnee(int index, Object objet) {
if (objet != null) {
donnees.add(index, objet);
}
}
public Object getDonnee(int index) {
try {
return donnees.get(index);
} catch (Exception e) {
return null;
}
}
public ArrayList<Object> getDonnees() {
return donnees;
}
 
public String toString() {
String chaine = new String();
if (messages != null) {
for (int i = 0 ; i < messages.size() ; i++) {
// GXT ne prend pas en compte /n ou /r/n...
chaine += getMessage(i)+"\n";
}
}
return chaine;
}
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/modeles/Information.java:r11-132,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/Information.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/Information.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/OntologiesLocales.java
New file
0,0 → 1,66
package org.tela_botanica.client.modeles;
 
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.store.ListStore;
 
public class OntologiesLocales {
 
public static Map<String,String[]> listeOuiNonPeutEtre;
public static Map<String,String[]> listeBonMauvaisEtat;
// TODO: mapper ça vers l'i18n
public static Map<String, String[]> getListeOuiNonPeutEtre() {
if(listeOuiNonPeutEtre == null) {
Constantes i18n = Mediateur.i18nC;
listeOuiNonPeutEtre = new HashMap<String, String[]>();
listeOuiNonPeutEtre.put("neSaitPas",new String[] {UtilString.mettrePremiereLettreEnMajuscule(i18n.neSaitPas()), "0"});
listeOuiNonPeutEtre.put("oui", new String[] {UtilString.mettrePremiereLettreEnMajuscule(i18n.oui()), "1"});
listeOuiNonPeutEtre.put("non", new String[] {UtilString.mettrePremiereLettreEnMajuscule(i18n.non()), "2"});
listeOuiNonPeutEtre.put("peutEtre", new String[] {UtilString.mettrePremiereLettreEnMajuscule(i18n.peutEtre()), "3"});
}
return listeOuiNonPeutEtre;
}
// TODO: mapper ça vers l'i18n
public static Map<String, String[]> getListeBonMauvaisEtat() {
if(listeBonMauvaisEtat == null) {
//Constantes i18n = Mediateur.i18nC;
listeBonMauvaisEtat = new HashMap<String, String[]>();
listeBonMauvaisEtat.put("1",new String[] {UtilString.mettrePremiereLettreEnMajuscule("très mauvais état"), "1"});
listeBonMauvaisEtat.put("2", new String[] {UtilString.mettrePremiereLettreEnMajuscule("mauvais état"), "2"});
listeBonMauvaisEtat.put("3", new String[] {UtilString.mettrePremiereLettreEnMajuscule("état moyen"), "3"});
listeBonMauvaisEtat.put("4", new String[] {UtilString.mettrePremiereLettreEnMajuscule("bon état"), "4"});
listeBonMauvaisEtat.put("5", new String[] {UtilString.mettrePremiereLettreEnMajuscule("très bon état"), "5"});
}
return listeBonMauvaisEtat;
}
public static String getValeurOntologie(Map<String, String[]> ontologie, String cle) {
String retour = "";
if(ontologie.containsKey(cle)) {
retour = ontologie.get(cle)[0];
}
return retour;
}
public static ListStore<SimpleModelData> convertirVersListeStore(Map<String, String[]> aConvertir) {
ListStore<SimpleModelData> listeConvertie = new ListStore<SimpleModelData>();
Iterator<String> it = aConvertir.keySet().iterator();
while (it.hasNext()) {
String cle = it.next();
String[] valeurs = aConvertir.get(cle);
listeConvertie.add(new SimpleModelData(cle, valeurs[0], valeurs[1]));
}
return listeConvertie;
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/publication/PublicationAPersonneListe.java
New file
0,0 → 1,32
package org.tela_botanica.client.modeles.publication;
 
import org.tela_botanica.client.modeles.aDonneeListe;
 
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
 
public class PublicationAPersonneListe extends aDonneeListe<PublicationAPersonne> {
 
private static final long serialVersionUID = -5950583940829919577L;
 
public PublicationAPersonneListe() {
super();
}
public PublicationAPersonneListe(int i) {
super(i);
}
public PublicationAPersonneListe(JSONArray auteurs) {
super(auteurs.size()) ;
final int taillemax = auteurs.size();
for (int i = 0; i < taillemax; i++) {
JSONObject publicationAPersonneCourante = auteurs.get(i).isObject() ;
if (publicationAPersonneCourante != null) {
PublicationAPersonne publicationAPersonne = new PublicationAPersonne(publicationAPersonneCourante);
this.put(publicationAPersonne.getId(), publicationAPersonne);
}
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/publication/PublicationAPersonneListe.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/publication/PublicationAPersonneListe.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/publication/PublicationAPersonneListe.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/publication/PublicationAPersonneAsyncDao.java
New file
0,0 → 1,195
package org.tela_botanica.client.modeles.publication;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
import org.tela_botanica.client.http.JsonRestRequestCallback;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.synchronisation.Reponse;
import org.tela_botanica.client.util.Log;
import org.tela_botanica.client.util.UtilDAO;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
 
public class PublicationAPersonneAsyncDao {
 
private static final String SERVICE_NOM = "CoelPublicationAPersonne";
private String utilisateurId = null;
private Rafraichissable vueARafraichir = null;
public PublicationAPersonneAsyncDao(Rafraichissable vueARafraichirCourrante) {
Log.trace("|| PublicationAPersonneAsyncDao > vueARafraichir = "+vueARafraichirCourrante.getClass().toString());
vueARafraichir = vueARafraichirCourrante;
utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
}
public void selectionner(final boolean paginationProgressive, String publicationId, String personnesId, String roleId, final String recherche, final int start, final int nbElements, final Integer seqId) {
 
String[] parametres = {publicationId, personnesId, roleId};
HashMap<String, String> restrictions = new HashMap<String, String>();
if (nbElements != -1) {
restrictions.put("limit", String.valueOf(nbElements));
}
restrictions.put("orderby", "cpuap_ordre");
 
if (paginationProgressive) {// GESTION DE LA REQUETE dans le cas d'une liste paginée progressive
restrictions.put("start", String.valueOf(start));// DEFINITION DU TUPLE DE DEPART
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
/** RECEPTION DE LA REPONSE **/
public void surReponse(JSONValue responseValue) {
/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
* On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
if (seqId != null) {
Log.trace("<-- PublicationAPersonneAsyncDao > Liste paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(responseValue, seqId);
vueARafraichir.rafraichir(reponseRequete);
} else {
Log.trace("<-- PublicationAPersonneAsyncDao > Liste paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(responseValue);
}
}
});
} else { // GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive
restrictions.put("start", String.valueOf(start*nbElements));
 
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres, restrictions);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue != null) {
JSONObject responseObject = responseValue.isObject();
if (responseObject != null) {
// Si la réponse est un tableau, alors c'est une liste de collections qui a été retournée
if (responseObject.get("publicationsAPersonne").isArray() != null) {
final JSONArray reponse = responseObject.get("publicationsAPersonne").isArray();
// Transformation du tableau JSON réponse en ListeInstitution
PublicationAPersonneListe publicationsAPersonneListe = new PublicationAPersonneListe(reponse);
// et on met à jour le demandeur des données
if (seqId != null) {
Log.trace("<-- PublicationAPersonneAsyncDao > Liste non paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(publicationsAPersonneListe, seqId);
vueARafraichir.rafraichir(reponseRequete);
} else {
Log.trace("<-- PublicationAPersonneAsyncDao > Liste non paginée, retour au sequenceur");
vueARafraichir.rafraichir(publicationsAPersonneListe);
}
} else if (responseObject.get("publicationsAPersonne").isObject() != null) {
// Si la réponse est un objet, alors c'est une unique collection qui a été retournée
final JSONObject reponse = responseObject.get("publicationsAPersonne").isObject();
// Transformation du tableau JSON réponse en ListeInstitution
PublicationAPersonne publicationAPersonne = new PublicationAPersonne(reponse);
// et on met à jour le demandeur des données
if (seqId!=null) {
Reponse reponseRequete = new Reponse(publicationAPersonne, seqId);
vueARafraichir.rafraichir(reponseRequete);
} else {
vueARafraichir.rafraichir(publicationAPersonne);
}
} else {
Log.warn("La réponse n'est pas un objet ou un tableau JSON et vaut : "+responseValue.toString());
}
}
} else {
// Dans le cas, où nous demandons toutes les publication et qu'il n'y en a pas, nous retournons un objet vide
PublicationAPersonneListe publicationAPersonneListe = new PublicationAPersonneListe(0);
if (seqId!=null) {
Reponse reponseRequete = new Reponse(publicationAPersonneListe, seqId);
vueARafraichir.rafraichir(reponseRequete);
} else {
vueARafraichir.rafraichir(publicationAPersonneListe);
}
}
}
});
}
}
public void ajouter(String publicationId, String personnesId, String ordreAuteurs, String roleId, final Integer seqId) {
String postDonneesEncodees = "cpuap_id_publication="+URL.encodeQueryString(publicationId)
+"&cpuap_id_auteur="+URL.encodeQueryString(personnesId)
+"&cpuap_ordre="+URL.encodeQueryString(ordreAuteurs)
+"&cpuap_id_role="+URL.encodeQueryString(roleId)
+"&cmhl_ce_modifier_par="+utilisateurId;
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue reponseValeur) {
traiterReponse(reponseValeur, "ajout_publication_a_personne", seqId);
}
});
}
 
public void modifier(String publicationId, String personnesId, String ordreAuteurs, String roleId, final Integer seqId) {
String[] parametres = {publicationId, personnesId, roleId};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
String postDonneesEncodees = "cpuap_id_publication="+URL.encodeQueryString(publicationId)
+"&cpuap_id_auteur="+URL.encodeQueryString(personnesId)
+"&cpuap_id_role="+URL.encodeQueryString(roleId)
+"&cpuap_ordre="+URL.encodeQueryString(ordreAuteurs)
+"&cmhl_ce_modifier_par="+utilisateurId;
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue reponseValeur) {
traiterReponse(reponseValeur, "modif_publication_a_personne", seqId);
}
});
}
public void supprimer(String idPublicationAPersonne) {
String[] parametres = {utilisateurId, idPublicationAPersonne};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
if (responseValue.isString() != null) {
Information info = new Information("suppression_publication_a_personne");
info.setMessage(responseValue.isString().stringValue());
vueARafraichir.rafraichir(info);
} else {
Log.warn(rb.getUrl()+"\n\tLa réponse n'est pas une chaine JSON.");
}
}
});
}
private void traiterReponse(JSONValue reponseValeur, String type, Integer seqId) {
Information info = new Information(type);
// Si la requête est un succès, réception d'une chaîne
if (reponseValeur.isBoolean() != null) {
info.setDonnee(reponseValeur.isBoolean().booleanValue());
} else if (reponseValeur.isString() != null) {
info.setDonnee(reponseValeur.isString().stringValue());
} else {
info.setDeboguage("La réponse n'est pas une chaine JSON.");
}
if (seqId != null) {
Reponse retourRequete = new Reponse(info, seqId);
vueARafraichir.rafraichir(retourRequete);
} else {
vueARafraichir.rafraichir(info);
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/publication/PublicationAPersonneAsyncDao.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/publication/PublicationAPersonneAsyncDao.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/publication/PublicationAPersonneAsyncDao.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/publication/Publication.java
New file
0,0 → 1,240
package org.tela_botanica.client.modeles.publication;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
 
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.util.UtilNombre;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
 
public class Publication extends aDonnee {
 
private static final long serialVersionUID = 4142843068041690126L;
public static final String PREFIXE = "cpu";
public static String[] champsObligatoires = {"cpu_id_publication"};
// Cache de valeurs pour contourner des bugs très compliqué d'affichage
public static Map<String, String> editeurs = new HashMap<String, String>();
public static Map<String, Publication> publisSaisiesModifieesCache = new HashMap<String, Publication>();
 
private Structure editeur = null;
public ArrayList<String> cles = null;
public Publication() {}
public Publication(boolean removePrefix) {
this.removePrefix = removePrefix;
cles = new ArrayList<String>();
cles.add("id_publication");
}
public Publication(JSONObject publication) {
initialiserModele(publication);
editeur = new Structure(publication);
cles = new ArrayList<String>();
cles.add("id_publication");
}
public Publication(ModelData model, boolean removePrefix) {
this.removePrefix = removePrefix;
editeur = new Structure(model);
cles = new ArrayList<String>();
cles.add("id_publication");
Map<String, Object> a = model.getProperties();
 
Set<String> cles = a.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
if (a.get(cle) != null) {
String cleObjet = "";
if (removePrefix) {
cleObjet = cle.replaceFirst("^"+getPrefixe()+"_", "");
}
else {
cleObjet = cle;
String valeur = "";
if (a.get(cle) instanceof Integer) {
valeur = String.valueOf(a.get(cle));
} else if (a.get(cle) instanceof String) {
valeur = (String) a.get(cle);
}
traiterClesEtrangeres(cle, valeur);
}
this.set(cleObjet, a.get(cle));
}
}
}
// Action
//--------
// cette méthode sert dans le cas suivant : le contructeur reçoit un object ModelData
// qui contient cpuap_id_publication mais pas cpu_id_publication ou id_publication. Sans
// la méthode ci-dessous, on aurait des problèmes. Celle-ci affecte à id_publication la
// valeur des clés étrangères rencontrées (cpuap_id_publication, cpuac_id_publication, etc.)
private void traiterClesEtrangeres(String cle, String valeur) {
// on recupere le nom de la clé de la propriété (sans son prefixe)
String nomSansPrefixe = cle.replaceFirst("^[a-zA-Z]+_", "");
// on regarde si cette clé est une clé primaire de la table Publication
if (cles.contains(nomSansPrefixe)) {
// si c'est le cas et que la valeur est non nulle
if (valeur != null && !UtilString.isEmpty(valeur)) {
// on affecte la valeur de la clés étrangère à la clé primaire
if (removePrefix) {
this.set(nomSansPrefixe, valeur);
} else {
this.set(getPrefixe()+"_"+nomSansPrefixe, valeur);
}
}
}
}
protected String getPrefixe() {
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
public void setStructureEditeur(Structure structure) {
editeur = structure;
}
public String getId() {
return renvoyerValeurCorrecte("id_publication");
}
public void setId(String idPublication) {
setValeurCorrecte("id_publication", idPublication);
}
public String getNomComplet() {
return renvoyerValeurCorrecte("fmt_nom_complet");
}
public void setNomComplet(String nomComplet) {
setValeurCorrecte("fmt_nom_complet", nomComplet);
}
public String getURI() {
return renvoyerValeurCorrecte("uri");
}
public void setUri(String uri) {
setValeurCorrecte("uri", uri);
}
 
public String getAuteur() {
return renvoyerValeurCorrecte("fmt_auteur");
}
public void setAuteur(String auteurFormate) {
setValeurCorrecte("fmt_auteur", auteurFormate);
}
 
public String getCollection() {
return renvoyerValeurCorrecte("collection");
}
public void setCollection(String collection) {
setValeurCorrecte("collection", collection);
}
public String getTitre() {
return renvoyerValeurCorrecte("titre");
}
public void setTitre(String titre) {
setValeurCorrecte("titre", UtilString.ucFirst(titre));
}
 
public String getNomEditeur() {
// Pour éviter de planter l'application
// on tente de prendre l'éditeur où il est disponible
String editeurNom = getEditeur();
if (UtilNombre.estUnNombre(editeurNom) || editeurNom.isEmpty()) {
if(editeur != null && !editeur.getNom().isEmpty()) {
editeurs.put(editeurNom, editeur.getNom());
editeurNom = editeur.getNom();
} else {
editeurNom = editeurs.get(editeurNom) != null ? editeurs.get(editeurNom) : "";
}
}
return editeurNom;
}
public String getEditeur() {
return getChaineDenormaliseUnique("ce_truk_editeur");
}
public void setEditeur(String editeur) {
setChaineDenormaliseUnique("ce_truk_editeur", "AUTRE", editeur);
}
 
public String getAnneeParution() {
String annee = "";
String dateParution = this.getDateParution();
if (dateParution.matches("^[0-2][0-9]{3}(-[0-9]{2}){2}$")) {// AAAA-MM-JJ
annee = dateParution.split("-")[0];
} else if (dateParution.matches("^[0-2][0-9]{3}-[0-2][0-9]{3}$")) {// AAAA-AAAA
annee = dateParution;
} else if (dateParution.matches("^[0-2][0-9]{3}$")) {// AAAA
annee = dateParution;
} else {
annee = "";
}
return annee;
}
public void setAnneeParution(String annee) {
if (annee.matches("^[0-2][0-9]{3}(-[0-9]{2}){2}$")) {// AAAA-MM-JJ
this.setDateParution(annee);
} else if (annee.matches("^[0-2][0-9]{3}-[0-2][0-9]{3}$")) {// AAAA-AAAA
this.setDateParution(annee);
} else if (annee.matches("^[0-2][0-9]{3}$")) {// AAAA
this.setDateParution(annee);
} else {
this.setDateParution("");
}
}
public static boolean etreAnneeParutionValide(String annee) {
boolean valide = false;
if (annee.matches("^[0-2][0-9]{3}$")) {// AAAA
valide = true;
} else if (annee.matches("^[0-2][0-9]{3}-[0-2][0-9]{3}$")) {// AAAA-AAAA
valide = true;
}
return valide;
}
public String getDateParution() {
return renvoyerValeurCorrecte("date_parution");
}
public void setDateParution(String date) {
setValeurCorrecte("date_parution", date);
}
 
public String getIndicationNvt() {
return renvoyerValeurCorrecte("indication_nvt");
}
public void setIndicationNvt(String nvt) {
setValeurCorrecte("indication_nvt", nvt);
}
public String getFascicule() {
return renvoyerValeurCorrecte("fascicule");
}
public void setFascicule(String fascicule) {
setValeurCorrecte("fascicule", fascicule);
}
public String getPages() {
return renvoyerValeurCorrecte("truk_pages");
}
public void setPages(String pages) {
setValeurCorrecte("truk_pages", pages);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/publication/Publication.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/publication/Publication.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/publication/Publication.java:r11-934,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/publication/PublicationListe.java
New file
0,0 → 1,129
package org.tela_botanica.client.modeles.publication;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import com.google.gwt.i18n.client.Dictionary;
import org.tela_botanica.client.interfaces.ListePaginable;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.aDonneeListe;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONObject;
 
/**
* Classe contenant les informations sur les Publications renvoyées par un objet de type DAO.
*
* @author Aurélien PERONNET
*
*/
public class PublicationListe extends aDonneeListe<Publication> implements ListePaginable {
 
private static final long serialVersionUID = 2600314321196345072L;
private int currentPage = 0;
private int nbElementsPage = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
private int nbElementsTotal;
private Rafraichissable vueARafraichir;
public PublicationListe() {
super();
}
public PublicationListe(int taille) {
super(taille);
}
public PublicationListe(JSONArray ListeDePublications) {
super(ListeDePublications.size());
initialiserPublicationListe(ListeDePublications);
}
public PublicationListe(JSONArray ListeDePublications, JSONNumber nbElements, Rafraichissable vueARafraichir) {
super(ListeDePublications.size());
this.nbElementsTotal = Integer.valueOf(nbElements.toString());
this.vueARafraichir = vueARafraichir;
initialiserPublicationListe(ListeDePublications);
}
 
private void initialiserPublicationListe(JSONArray ListeDePublications) {
int taille = ListeDePublications.size();
for (int i = 0; i < taille; i++) {
JSONObject publicationCourante = ListeDePublications.get(i).isObject() ;
if (publicationCourante != null) {
Publication publication = new Publication(publicationCourante);
this.put(publication.getId(), publication);
}
}
}
public void changerNumeroPage(int pageCourante) {
currentPage = pageCourante;
selectionnerPublication();
}
 
public void changerTaillePage(int nouvelleTaillePage) {
nbElementsPage = nouvelleTaillePage;
selectionnerPublication();
}
public void recharger() {
selectionnerPublication();
}
public void setPageCourante(int pageCourante) {
this.currentPage = pageCourante;
}
 
public void setTaillePage(int taillePage) {
this.nbElementsPage = taillePage;
}
public int[] getPageTable() {
int[] page = new int[4];
// nombre de pages au total
page[0] = calculerNbPages();
// Page En Cours
page[1] = currentPage;
// nbElementsParPage
page[2] = nbElementsPage;
// et le dernier le nombre total d'éléments
page[3] = nbElementsTotal;
return page;
}
/**
* Calcule le nombre de pages nécessaires pour afficher un nombre d'élements
* donnés en fonction de la taille de page en cours
*
* @return le nombre de pages
*/
public int calculerNbPages() {
// À cause de la bétise de java pour les conversion implicite, on fait quelques conversions manuellement
// pour eviter qu'il arrondisse mal la division nombre de pages = (nombre d'element / taille de la page)
// arrondie à l'entier supérieur.
double nPage = (1.0 * nbElementsTotal) / (1.0 * nbElementsPage);
double nPageRound = Math.ceil(nPage);
Double nPageInt = new Double(nPageRound);
 
// Convertion en entier
return nPageInt.intValue();
}
public void selectionnerPublication() {
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
mediateur.selectionnerPublication(vueARafraichir, null, null, currentPage, nbElementsPage, null);
}
public void filtrerParNom(String nom) {
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
mediateur.selectionnerPublicationParNomComplet(vueARafraichir, "%" + nom + "%");
}
 
public void filtrerParNomEtPage(String nom, int pageCourante) {
currentPage = pageCourante;
Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
mediateur.selectionnerPublication(vueARafraichir, null, "%" + nom + "%", currentPage, nbElementsPage, null);
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/publication/PublicationListe.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/publication/PublicationListe.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/publication/PublicationListe.java:r11-934,1209-1382
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/publication/PublicationAsyncDao.java
New file
0,0 → 1,244
package org.tela_botanica.client.modeles.publication;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
import org.tela_botanica.client.http.JsonRestRequestCallback;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.synchronisation.Reponse;
import org.tela_botanica.client.util.Log;
import org.tela_botanica.client.util.UtilDAO;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.core.client.Callback;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONValue;
 
public class PublicationAsyncDao {
private static final String SERVICE_NOM = "CoelPublication";
private static final String SERVICE_IMPORT = "CoelImport";
public static String tri = null;
private String utilisateurId = null;
private Rafraichissable vueARafraichir = null;
public PublicationAsyncDao(Rafraichissable vueARafraichirCourrante) {
Log.trace("|| PublicationAsyncDao > vueARafraichir = "+vueARafraichirCourrante.getClass().toString());
vueARafraichir = vueARafraichirCourrante ;
utilisateurId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getUtilisateurId();
}
/**
* @param paginationProgressive : définit le mode de consultation de la base de données
* - True : la consultation des données est progressive, ce qui signifie que la liste est chargée (paginée) au
* fur et à mesure de la consultation des données par l'utilisateur.
* - False : la consultation des données est classique : un seul appel à la base de données est effectué, le retour
* est renvoyé à l'appelant
* // FIXME : si la taille de la liste est supérieure à la limite du JREST (150), ce deuxieme mode ne fonctionne pas efficacement (on ne voit pas les enregistrement suivants)
*/
public void selectionner(final boolean paginationProgressive, final String publicationId, String nomComplet, final int start, final int nbElements, final Integer seqId) {
String nom = (nomComplet == null) ? "%" : nomComplet+"%";
String[] param = {publicationId, nom};
HashMap<String, String> restrictions = new HashMap<String, String>();
if (nbElements != -1) {
restrictions.put("limit", String.valueOf(nbElements));
}
 
if(tri != null) {
restrictions.put("orderby", tri);
} else {
restrictions.put("orderby", "cpu_fmt_nom_complet");
}
if (paginationProgressive) {
// GESTION DE LA REQUETE dans le cas d'une liste paginée progressive
restrictions.put("start", String.valueOf(start));
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, param, restrictions);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
/** RECEPTION DE LA REPONSE **/
public void surReponse(JSONValue responseValue) {
/** Dans le cas d'une liste paginée, vueARafraichir est un objet Proxy.
* On retourne l'objet JSON au proxy afin que ce soit lui qui le traite **/
if (seqId != null) {
Log.trace("<-- PublicationAsyncDao > Liste paginée, retour au sequenceur");
Reponse reponseRequete = new Reponse(responseValue, seqId);
vueARafraichir.rafraichir(reponseRequete);
} else {
Log.trace("<-- PublicationAsyncDao > Liste paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(responseValue);
}
}
});
} else {
// GESTION DE LA REQUETE dans le cas d'une liste NON paginée progressive
restrictions.put("start", String.valueOf(start*nbElements));
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, param, restrictions);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
public void surReponse(JSONValue responseValue) {
if (responseValue != null) {
JSONObject responseObject = responseValue.isObject();
if (responseObject != null) {
// Si la réponse est un tableau, alors c'est une liste de publications qui a été retournée
if (responseObject.get("publications").isArray() != null) {
JSONArray reponse = responseObject.get("publications").isArray();
PublicationListe publications;
publications = new PublicationListe(reponse, responseObject.get("nbElements").isNumber(), vueARafraichir);
publications.setTaillePage(nbElements);
publications.setPageCourante(start);
 
if (seqId != null) {
if (Mediateur.DEBUG) System.out.println("<-- PublicationAsyncDao > Liste non paginée, retour au sequenceur");
Reponse retourRequete = new Reponse(publications, seqId);
vueARafraichir.rafraichir(retourRequete);
} else {
if (Mediateur.DEBUG) System.out.println("<-- PublicationAsyncDao > Liste non paginée, retour à "+vueARafraichir.getClass().toString());
vueARafraichir.rafraichir(publications);
}
// Si la réponse est un objet, alors c'est une unique publication qui a été retournée
} else if (responseObject.get("publications").isObject() != null) {
JSONObject reponse = responseObject.get("publications").isObject();
// Transformation du tableau JSON réponse en ListeInstitution
Publication publication = new Publication(reponse);
// et on met à jour le demandeur des données
if (seqId!=null) {
Reponse reponseRequete = new Reponse(publication, seqId);
vueARafraichir.rafraichir(reponseRequete);
} else {
vueARafraichir.rafraichir(publication);
}
}
} else {
Log.warn(rb.getUrl()+"\n\tLa réponse n'est pas un objet ou un tableau JSON et vaut : "+responseValue.toString());
}
} else {
if (publicationId == null) {
PublicationListe publications = new PublicationListe(0);
vueARafraichir.rafraichir(publications);
}
}
}
});
}
}
 
public void ajouter(Publication publication, final Integer seqId) {
String postDonneesEncodees = publication.obtenirChainePOST()+"&cmhl_ce_modifier_par="+utilisateurId;
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);
 
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue reponseValeur) {
traiterReponse(reponseValeur, "ajout_publication", seqId);
}
}) ;
}
public void modifier(Publication publication, final Integer seqId) {
String[] parametres = {publication.getId()};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
String postDonneesEncodees = publication.obtenirChainePOST()+"&cmhl_ce_modifier_par="+utilisateurId;
rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue reponseValeur) {
traiterReponse(reponseValeur, "modif_publication", seqId);
}
});
}
 
public void supprimer(String publicationsId) {
String[] parametres = {utilisateurId, publicationsId};
final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue reponseValeur) {
traiterReponse(reponseValeur, "suppression_publication", null);
}
});
}
private void traiterReponse(JSONValue reponseValeur, String type, Integer seqId) {
Information info = new Information(type);
 
// Si la requête est un succès, réception d'une chaîne
if (reponseValeur.isString() != null) {
String idOuMessage = reponseValeur.isString().stringValue();
if (idOuMessage.matches("^[0-9]+$")) {
info.setDonnee(idOuMessage);
} else {
info.setMessage(idOuMessage);
}
} else {
info.setDeboguage("La réponse n'est pas une chaine JSON.");
}
if (seqId != null) {
Reponse retourRequete = new Reponse(info, seqId);
vueARafraichir.rafraichir(retourRequete);
} else {
vueARafraichir.rafraichir(info);
}
}
public static void demanderStatistiquesDernierImport(final Callback<JSONValue, String> callBack) {
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_IMPORT);
rb.envoyerRequeteSuppression(new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue reponseValeur) {
callBack.onSuccess(reponseValeur);
}
});
}
public static boolean importEstUnSucces(JSONValue responseValue) {
boolean succesImportBool = false;
if(responseValue != null) {
JSONObject objetReponse = responseValue.isObject();
String succesImport = objetReponse.get("succes_import").isString().stringValue();
succesImportBool = succesImport.equals("1");
}
return succesImportBool;
}
public static String getErreursImport(JSONValue responseValue) {
// Normalement cette fonction est appelée par le médiateur uniquement
// si l'import à renvoyé un objet valide
JSONObject objetReponse = responseValue.isObject();
JSONArray erreurs = objetReponse.get("erreurs").isArray();
String erreurStr = "\n";
for (int i = 0; i < erreurs.size(); i++) {
erreurStr += "- "+erreurs.get(i).isString().stringValue()+"\n";
}
return erreurStr;
}
public static String getNbPublisImportees(JSONValue responseValue) {
// Normalement cette fonction est appelée par le médiateur uniquement
// si l'import à renvoyé un objet valide
JSONObject objetReponse = responseValue.isObject();
String nbPubliImportees = objetReponse.get("nb_elements_importes").isString().stringValue();
return nbPubliImportees;
}
public static String getUrlImport() {
return UtilDAO.getUrlService(SERVICE_IMPORT);
}
 
}
Property changes:
Added: svn:mergeinfo
Merged /trunk/src/org/tela_botanica/client/modeles/publication/PublicationAsyncDao.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/publication/PublicationAsyncDao.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/publication/PublicationAsyncDao.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/publication/PublicationAPersonne.java
New file
0,0 → 1,248
package org.tela_botanica.client.modeles.publication;
 
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
 
import org.tela_botanica.client.modeles.aDonnee;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.util.Log;
import org.tela_botanica.client.util.UtilString;
 
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
 
public class PublicationAPersonne extends aDonnee {
 
private static final long serialVersionUID = 7769105365939978129L;
public static final String PREFIXE = "cpuap";
public static final String ROLE_AUTEUR = "2360";
//FIXME: insérer en base de données une valeur cohérente pour l'identifiant ci-dessous
public static final String ROLE_SUJET = "30762";
private Personne personneLiee = null;
private Publication publicationLiee = null;
public static String[] champsObligatoires = {"cpuap_id_personne", "cpuap_id_publication", "cpuap_id_role"};
public PublicationAPersonne() {
new PublicationAPersonne(new JSONObject());
}
public PublicationAPersonne(boolean removePrefix) {
this.removePrefix = removePrefix;
new PublicationAPersonne(new JSONObject());
}
public PublicationAPersonne(JSONObject pubAPersListe) {
Personne personne = new Personne(pubAPersListe);
setPersonne(personne);
publicationLiee = new Publication(pubAPersListe);
// l'objet JSON est une table de hachage
Set<String> im = pubAPersListe.keySet();
 
// Parcourt pour chaque clé
for (Iterator<String> it = im.iterator(); it.hasNext();) {
// Si elle est associée à une valeur, nous l'ajoutons
String cle = it.next();
String cleObjet = "";
if (removePrefix) {
cleObjet = cle.replaceFirst("^"+getPrefixe()+"_", "");
} else {
cleObjet = cle;
}
// Valeur vide par défaut
String valeur = "";
if (pubAPersListe.get(cle).isString() != null) {
valeur = pubAPersListe.get(cle).isString().stringValue();
}
this.set(cleObjet, valeur);
}
initialiserChampsPourGrille();
}
public PublicationAPersonne(ModelData modele, boolean removePrefix) {
this.removePrefix = removePrefix;
if (modele != null) {
Map<String, Object> modeleProprietes = modele.getProperties();
Set<String> cles = modeleProprietes.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
Object valeur = modeleProprietes.get(cle);
if (modeleProprietes.get(cle) != null) {
String cleObjet = "";
if (removePrefix) {
cleObjet = cleObjet.replaceFirst("^"+getPrefixe()+"_", "");
} else {
cleObjet = cle;
}
this.set(cleObjet, valeur);
}
}
setPersonne(new Personne(modele, removePrefix));
setPublicationLiee(new Publication(modele, removePrefix));
initialiserChampsPourGrille();
this.set("_role_", modeleProprietes.get("_role_"));
this.set("_etat_", modeleProprietes.get("_etat_"));
} else {
Log.debug("Le modèle passé en paramètre ne doit pas être vide");
}
}
private void initialiserChampsPourGrille() {
if (removePrefix) {
set("fmt_auteur", publicationLiee.getAuteur());
set("titre", publicationLiee.getTitre());
set("collection", publicationLiee.getCollection());
set("_editeur_", "");
set("_annee_", "");
set("indication_nvt", publicationLiee.getIndicationNvt());
set("fascicule", publicationLiee.getFascicule());
set("truk_pages", publicationLiee.getPages());
set("_etat_", "");
set("_role_", this.getIdRole());
} else {
set("cpu_fmt_auteur", publicationLiee.getAuteur());
set("cpu_titre", publicationLiee.getTitre());
set("cpu_collection", publicationLiee.getCollection());
set("_editeur_", "");
set("_annee_", "");
set("cpu_indication_nvt", publicationLiee.getIndicationNvt());
set("cpu_fascicule", publicationLiee.getFascicule());
set("cpu_truk_pages", publicationLiee.getPages());
set("_etat_", "");
set("_role_", this.getIdRole());
}
}
@Override
protected String getPrefixe() {
return PREFIXE;
}
 
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
public Personne getPersonne() {
return personneLiee;
}
public void setPersonne(Personne personne) {
setPersonne(personne, false);
}
public void setPersonne(Personne personne, boolean integrerProprietes) {
personneLiee = personne;
if (personne != null) {
Log.debug("Tentative ajout id personne : "+personne.getId());
setIdPersonne(personne.getId());
}
if (integrerProprietes) {
Map<String, Object> a = personne.getProperties();
Set<String> cles = a.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
if (a.get(cle) != null) {
String cleObjet = "";
if (removePrefix) {
cleObjet = cle.replaceFirst("^"+Personne.PREFIXE+"_", "");
} else {
cleObjet = cle;
}
this.set(cleObjet, a.get(cle));
}
}
}
}
// ID
public String getId() {
String idPublication = getIdPublication();
String idPersonne = getIdPersonne();
String idRole = getIdRole();
if (idPublication.equals("") && idPersonne.equals("") && idRole.equals("")) {
return null;
} else {
return (idPublication+"-"+idPersonne+"-"+idRole);
}
}
// ID PUBLICATION
public String getIdPublication() {
String valeur = renvoyerValeurCorrecte("id_publication");
return UtilString.isEmpty(valeur) ? "0" : valeur;
}
public void setIdPublication(String id) {
setValeurCorrecte("id_publication", id);
}
// PUBLICATION LIEE
public Publication getPublicationLiee() {
return this.publicationLiee;
}
// LIER PUBLICATION
public void setPublicationLiee(Publication publication) {
this.publicationLiee = publication;
initialiserChampsPourGrille();
}
// ID PERSONNE
public String getIdPersonne() {
String valeur = renvoyerValeurCorrecte("id_personne");
return UtilString.isEmpty(valeur) ? "0" : valeur;
}
public void setIdPersonne(String id) {
setValeurCorrecte("id_personne", id);
}
// ID RôLE
public String getIdRole() {
String valeur = renvoyerValeurCorrecte("id_role");
return UtilString.isEmpty(valeur) ? "0" : valeur;
}
public void setIdRole(String id) {
setValeurCorrecte("id_role", id);
this.set("_role_", id);
}
// ROLE
public String getRole() {
String role = this.get("_role_");
if (role != null) {
return role;
} else {
return "";
}
}
// TYPE
public String getType() {
return renvoyerValeurCorrecte("ce_truk_type");
}
public void setType(String type) {
setValeurCorrecte("ce_truk_type", type);
}
public void setFonction(String type, String valeur) {
setChaineDenormaliseUnique("ce_truk_type", type, valeur);
}
// ORDRE DES AUTEURS
public String getOrdreAuteurs() {
return renvoyerValeurCorrecte("ordre");
}
public void setOrdreAuteurs(String ordre) {
if (ordre.matches("[0-9]+")) {
setValeurCorrecte("ordre", ordre);
this.set("_ordre_", ordre);
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/publication/PublicationAPersonne.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/publication/PublicationAPersonne.java:r11-934,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/publication/PublicationAPersonne.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/UtilisateurAsyncDao.java
New file
0,0 → 1,322
package org.tela_botanica.client.modeles;
 
import java.util.HashMap;
 
import org.tela_botanica.client.Coel;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.http.JsonRestRequestBuilder;
import org.tela_botanica.client.http.JsonRestRequestCallback;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.util.UtilDAO;
 
import com.extjs.gxt.ui.client.Registry;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONBoolean;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.Timer;
 
/**
* Modele DAO, specifique, permettant la validation, l'acces aux donnees distantes et la présentation des donnees en retour
*
*/
public class UtilisateurAsyncDao {
private static final String SERVICE_NOM = "CoelUtilisateur";
private Utilisateur utilisateur = null;
private Rafraichissable vueARafraichir = null;
 
private static Timer rafraichisseurJeton = null;
/**
* Constructeur
* @param retour : méthode appellée en retour d'appel.
*/
public UtilisateurAsyncDao(Rafraichissable vueARafraichirCourrante) {
vueARafraichir = vueARafraichirCourrante;
utilisateur = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
}
 
/**
* Recupere des informations d'authentification à partir du JSON renvoyé par les
* services Auth de l'annuaire (SSO)
*
* @param valeurJson
* @return AuthInfo
*/
public static AuthInfo parserAuthJson(JSONValue valeurJson) {
AuthInfo authInfo = new AuthInfo();
JSONObject authJson = valeurJson.isObject();
 
JSONValue erreurJSON = authJson.get("error");
// test si erreur
if (erreurJSON != null) {
JSONString erreur = erreurJSON.isString();
if (erreur != null) {
authInfo.error = erreur.stringValue();
} else {
authInfo.error = "erreur d'authentification";
}
} else {
boolean session = authJson.get("session").isBoolean().booleanValue();
authInfo.session = session;
// test si session ouverte
if (session) {
JSONValue tokenJson = authJson.get("token");
String token = null;
// protection paranoïaque
if (tokenJson != null) {
JSONString tokenString = tokenJson.isString();
if (tokenString != null) {
token = tokenString.stringValue();
}
}
String tokenId = authJson.get("token_id").isString().stringValue();
int duration = (int) authJson.get("duration").isNumber().doubleValue();
JSONValue lastModifJson = authJson.get("last_modif");
 
authInfo.token = token;
authInfo.tokenId = tokenId;
authInfo.duration = duration;
// test si lastModif est null
if (lastModifJson != null) {
JSONNumber lastModif = lastModifJson.isNumber();
if (lastModif != null) {
authInfo.lastModif = (int) lastModif.doubleValue();
}
}
}
}
return authInfo;
}
 
/**
* Enregistre le jeton (potentiellement NULL), sa durée de vie; appelle le service Coel pour
* obtenir les données de l'utilisateur relatives à l'application; lorsque le jeton
* n'est pas nul et que sa durée de vie est spécifiée, déclenche un rafraîchissement
* périodique du jeton
*
* @param objetRetour le retour de l'appel au service annuaire:auth (connexion, deconnexion ou identite)
*/
protected void gererRetourAuthInfo(AuthInfo objetRetour) {
// Stockage du jeton rafraîchi et de sa durée (pourrait avoir changé)
Utilisateur.setJeton(objetRetour.token);
Utilisateur.setDureeJeton(objetRetour.duration);
 
// Rafraîchissement automatique du jeton - s'annule lorsque le jeton devient nul
if (Utilisateur.getJeton() != null && Utilisateur.getDureeJeton() > 0) {
if (rafraichisseurJeton == null) { // on sait jamais
// 3/4 de la durée de vie du jeton, en millisecondes (ça laisse de la marge)
int delaiRepetition = (Utilisateur.getDureeJeton() * 1000) * 3 / 4;
//delaiRepetition = 10000; // debug
rafraichisseurJeton = new Timer() {
@Override
public void run() {
//Coel.LogVersFirebug("rafraichir utilisateur");
// Appel de l'annuaire pour rafraîchir le jeton (cb nul pour l'instant)
getEtatUtilisateur();
}
};
rafraichisseurJeton.scheduleRepeating(delaiRepetition);
}
} else {
if (rafraichisseurJeton != null) { // on sait jamais non plus
rafraichisseurJeton.cancel();
rafraichisseurJeton = null;
}
}
 
// Obtention de l'utilisateur final d'après le service de préférences
//Coel.LogVersFirebug("va chercher utilisateur Coel");
getEtatUtilisateurSansAnnuaire();
}
 
/**
* Méthode déconnectant un utilisateur de l'application.
* @param identifiant de l'utilisateur à déconnecter.
*/
public void deconnecterUtilisateur() {
//Coel.LogVersFirebug("deconnexion");
final JsonRestRequestBuilder rb = UtilDAO.construireRequeteAuth("deconnexion", null);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
//Coel.LogVersFirebug(responseValue.toString());
AuthInfo info = parserAuthJson(responseValue);
gererRetourAuthInfo(info);
}
});
}
/**
* Méthode connectant un utilisateur à l'application
*/
public void connecterUtilisateur() {
HashMap<String, String> parametres = new HashMap<String, String>();
parametres.put("login", utilisateur.getLogin());
parametres.put("password", utilisateur.getMotDePasse());
//Coel.LogVersFirebug("connexion");
final JsonRestRequestBuilder rb = UtilDAO.construireRequeteAuth("connexion", parametres);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
AuthInfo info = parserAuthJson(responseValue);
gererRetourAuthInfo(info);
}
@Override
public void onErrorHTTP(Request request, Response reponse) {
// Si on a été déconnecté, on va chercher un profil utilisateur "anonyme" et
// on avertit l'interface
//Coel.LogVersFirebug("j'ai une erreur mais je suis content");
gererRetourAuthInfo(new AuthInfo());
}
});
}
 
/**
* Va chercher les infos de l'utilisateur en vérifiant d'abord l'identité auprès de l'annuaire
*/
public void getEtatUtilisateur() {
getEtatUtilisateur(false);
}
 
/**
* Va chercher les infos de l'utilisateur; si ignorerAnnuaire est false, vérifiera d'abord
* l'identité auprès de l'annuaire (service annuaire:auth/identite)
*/
public void getEtatUtilisateur(boolean ignorerAnnuaire) {
// par défaut, on appelle d'abord le service auth/identite de l'annuaire, afin de connaître
// le statut de l'utilisateur vis à vis du SSO (connecté ou non) et rafraîchir le jeton
if (! ignorerAnnuaire) {
//Coel.LogVersFirebug("get état");
// sans header Authorization, sinon une déconnexion depuis une autre appli ne sera pas
// prise en compte et le jeton sera rafraîchi indéfiniment
final JsonRestRequestBuilder rb = UtilDAO.construireRequeteAuth("identite", null, false);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
AuthInfo info = parserAuthJson(responseValue);
gererRetourAuthInfo(info);
}
@Override
public void onErrorHTTP(Request request, Response reponse) {
// Si on a été déconnecté, on va chercher un profil utilisateur "anonyme" et
// on avertit l'interface
gererRetourAuthInfo(new AuthInfo());
}
});
} else { // sinon on optimise, quand on vient de se (de)connecter, pas la peine de rappeler l'annuaire
getEtatUtilisateurSansAnnuaire();
}
}
 
/**
* Va chercher les infos de l'utilisateur Coel sans vérifier l'identité auprès de l'annuaire;
* transmet un jeton SSO à chaque fois pour que le service se base dessus
*/
public void getEtatUtilisateurSansAnnuaire() {
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
//Coel.LogVersFirebug("réponse reçue");
JSONArray reponse = responseValue.isArray();
if (reponse != null) {
// Identifiant utilisateur ou identifiant de session si non identifié
String login = ((JSONString) reponse.get(1)).stringValue();
 
// Drapeau leve si utilisateur deja identifié
boolean identifie = ((JSONBoolean) reponse.get(2)).booleanValue();
 
utilisateur.setIdentification(identifie);
utilisateur.setLogin(login);
 
//Ajout des informations licence
if (reponse.get(0).isString() != null) {
//Coel.LogVersFirebug("1 : set licence [" + reponse.get(0).isString().stringValue() + "]");
utilisateur.setLicence(reponse.get(0).isString().stringValue());
} else {
//Coel.LogVersFirebug("2 : set licence vide");
utilisateur.setLicence("");
}
 
//Coel.LogVersFirebug("Utilisateur CoeL chargé !!");
//Coel.LogVersFirebug("id: " + identifie + ", login: " + login + ", licence: " + utilisateur.getLicence());
//Coel.LogVersFirebug("Taille réponse:" + reponse.size());
 
// Utilisateur connecté (non anonyme)
if (reponse.size() > 3) {
//Coel.LogVersFirebug("Utilisateur identifié, on charge plus de trucs !");
// Identifiant de l'utilisateur ou identifiant de session si non identifié
String idUtilisateur = ((JSONString) reponse.get(1)).stringValue();
//Coel.LogVersFirebug("ID utilisateur: " + idUtilisateur);
utilisateur.setId(idUtilisateur);
 
// Nom complet de l'utilisateur
if (reponse.get(3).isString() != null) {
String nomComplet = ((JSONString) reponse.get(3)).stringValue();
//Coel.LogVersFirebug("Nom complet: " + nomComplet);
utilisateur.setNomComplet(nomComplet);
}
// Prénom de l'utilisateur
if (reponse.get(4).isString() != null) {
String prenom = ((JSONString) reponse.get(4)).stringValue();
utilisateur.setPrenom(prenom);
//Coel.LogVersFirebug("Prénom: " + prenom);
}
// Nom de l'utilisateur
if (reponse.get(5).isString() != null) {
String nom = ((JSONString) reponse.get(5)).stringValue();
utilisateur.setNom(nom);
//Coel.LogVersFirebug("Nom: " + nom);
}
// Paramètre => was ist das ?
if (reponse.get(6).isString() != null) {
String parametre = ((JSONString) reponse.get(6)).stringValue();
utilisateur.setParametre(parametre);
//Coel.LogVersFirebug("Paramètre: " + parametre);
}
}
 
//Coel.LogVersFirebug("Rafraîchissement vue");
vueARafraichir.rafraichir(utilisateur);
}
}
});
}
 
/**
* Envoie une info au service utilisateur de Coel comme quoi le mec a accepté la licence
*/
public void accepterLicence() {
//Coel.LogVersFirebug("accepter licence: " + utilisateur.getLogin());
String[] parametres = {
"setLicence",
utilisateur.getLogin()
};
final JsonRestRequestBuilder rb = UtilDAO.construireRequete(SERVICE_NOM, parametres);
rb.envoyerRequete(null, new JsonRestRequestCallback() {
@Override
public void surReponse(JSONValue responseValue) {
//Coel.LogVersFirebug("sur réponse setLicence");
if (responseValue.isArray() != null) {
final JSONArray reponse = responseValue.isArray();
if (reponse.get(0).isString() != null) {
String licenceAcceptee = reponse.get(0).isString().stringValue();
Information info = new Information("maj_licence");
info.setDonnee(0, licenceAcceptee);
//Coel.LogVersFirebug("licence acceptée : " + licenceAcceptee);
vueARafraichir.rafraichir(info);
}
}
}
});
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/UtilisateurAsyncDao.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/UtilisateurAsyncDao.java:r11-68,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/UtilisateurAsyncDao.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles/Valeur.java
New file
0,0 → 1,116
package org.tela_botanica.client.modeles;
 
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
 
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.data.ModelData;
import com.google.gwt.json.client.JSONObject;
 
public class Valeur extends aDonnee {
private static final long serialVersionUID = 2278245640718653819L;
 
public static final String PREFIXE = "cmlv";
public static final String COLLECTION_NCD_HERBIER = "2157";
public static String[] champsObligatoires = {"cmlv_id_valeur"};
public Valeur() {
}
public Valeur(JSONObject liste) {
// l'objet JSON est une table de hachage
Set<String> im = liste.keySet();
 
// Parcourt pour chaque clé
for (Iterator<String> it = im.iterator(); it.hasNext();) {
// Si elle est associée à une valeur, nous l'ajoutons
String cle = it.next();
// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
if (liste.get(cle).isString() != null) {
String valeur = liste.get(cle).isString().stringValue();
this.set(cleObjet, valeur);
} else {
// Sinon, nous ajoutons la clé avec une valeur vide
String valeur = " ";
this.set(cleObjet, valeur);
}
}
}
public Valeur(String id, String nom, String abr, String description) {
this.set("id_valeur", id);
this.set("nom", nom);
this.set("abreviation", abr);
this.set("description", description);
}
 
public Valeur(ModelData model)
{
Map<String, Object> a = model.getProperties();
 
Set<String> cles = a.keySet();
Iterator<String> it = cles.iterator();
while (it.hasNext()) {
String cle = it.next();
if (a.get(cle) != null) {
String cleObjet = cle.replaceFirst("^"+getPrefixe()+"_", "");
this.set(cleObjet, a.get(cle));
}
}
}
@Override
protected String getPrefixe() {
return PREFIXE;
}
protected String[] getChampsObligatoires() {
return champsObligatoires;
}
/** Accesseur à l'identifiant de la valeur.
*
* @return String l'identifiant de la valeur.
*/
public String getId() {
return (String) renvoyerValeurCorrecte("id_valeur");
}
/** Accesseur au nom de la valeur.
*
* @return String le nom de la valeur.
*/
public String getNom() {
return (String) renvoyerValeurCorrecte("nom");
}
/** Accesseur à l'abréviation de la valeur.
*
* @return String l'abréviation de la valeur.
*/
public String getAbreviation() {
return (String) renvoyerValeurCorrecte("abreviation");
}
/** Accesseur à la description de la valeur.
*
* @return String la description de la valeur.
*/
public String getDescription() {
return (String) renvoyerValeurCorrecte("description");
}
/** Accesseur à l'identifiant parent de la valeur.
*
* @return String l'identifiant de la valeur.
*/
public String getParentId() {
return (String) renvoyerValeurCorrecte("ce_parent");
}
 
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles/Valeur.java:r1136-1368
Merged /trunk/src/org/tela_botanica/client/modeles/Valeur.java:r11-68,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles/Valeur.java:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/modeles
New file
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/modeles:r1136-1328
Merged /trunk/src/org/tela_botanica/client/modeles:r11-50,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/modeles:r1383-1511
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/synchronisation/Requete.java
New file
0,0 → 1,48
package org.tela_botanica.client.synchronisation;
 
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.synchronisation.Reponse;
 
public class Requete implements Rafraichissable{
private Rafraichissable vueARafraichir;
private Reponse reponse;
private int numeroSequence;
public Requete(Rafraichissable vueARafraichir, int numeroSequence) {
this.vueARafraichir = vueARafraichir;
this.numeroSequence = numeroSequence;
}
public Rafraichissable getVueARafraichir() {
return this.vueARafraichir;
}
public boolean hasResponse() {
return (reponse!=null);
}
public void setRetour(Reponse reponse) {
this.reponse = reponse;
}
public Reponse obtenirReponse() {
return this.reponse;
}
public int obtenirNumeroSequence() {
return numeroSequence;
}
public void rafraichir() {
vueARafraichir.rafraichir(reponse.obtenirRetour());
}
public void rafraichir(Object nouvellesDonnees) {
vueARafraichir.rafraichir(nouvellesDonnees);
}
public String toString() {
return vueARafraichir.getClass().getName() +"= " +numeroSequence;
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/synchronisation/Reponse.java
New file
0,0 → 1,24
package org.tela_botanica.client.synchronisation;
 
public class Reponse {
private Object retourRequete;
private int seqId;
public Reponse(Object retour, int seqId) {
retourRequete = retour;
this.seqId = seqId;
}
public Object obtenirRetour() {
return this.retourRequete;
}
public void setSeqId(int numeroSequence) {
this.seqId = numeroSequence;
}
public int obtenirNumeroSequence() {
return this.seqId;
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/synchronisation/Sequenceur.java
New file
0,0 → 1,109
package org.tela_botanica.client.synchronisation;
 
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
 
import org.tela_botanica.client.Mediateur;
import org.tela_botanica.client.RegistreId;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.util.Debug;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.widget.Info;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class Sequenceur implements Rafraichissable{
 
private HashMap<Integer, Requete> requetes;
private int numeroSequence;
private int marqueurRetour = 1;
private Mediateur mediateur = (Mediateur) Registry.get(RegistreId.MEDIATEUR);
public Sequenceur() {
requetes = new HashMap<Integer, Requete>();
numeroSequence = 0;
}
// Retourne le numéro du séquenceur
public int lancerRequeteSynchrone(Rafraichissable vueARafraichir) {
if (Mediateur.DEBUG_CHARGEMENT) System.out.println("[CHARGEMENT] lancerRequeteSynchrone("+vueARafraichir.getClass().getName()+")");
//if (numeroSequence == 0) {
mediateur.activerChargement(this, "Chargement en cours... Veuillez patienter");
//}
numeroSequence++;
if (Mediateur.DEBUG) System.out.println("==> Sequenceur : Envoi requete n°" + numeroSequence);
Requete requete = new Requete(vueARafraichir, numeroSequence);
requetes.put(numeroSequence, requete);
return numeroSequence;
}
//Offrir la possibilité d'enfiler (=mettre à la fin d'une file d'attente) un rafraichissement dont on a déjà le retour
public int enfilerRafraichissement(Rafraichissable vueARafraichir, Object nouvellesDonnees) {
//if (numeroSequence == 0) {
mediateur.activerChargement(this, "Chargement en cours... Veuillez patienter");
//}
numeroSequence++;
if (Mediateur.DEBUG) System.out.println("|| Sequenceur : Empiler n°" + numeroSequence);
Requete requete = new Requete(vueARafraichir, numeroSequence);
Reponse reponse = new Reponse(nouvellesDonnees, numeroSequence);
requetes.put(numeroSequence, requete);
rafraichir(reponse);
mediateur.desactiverChargement(this);
return numeroSequence;
}
public void rafraichir(Object nouvellesDonnees) {
 
try {
Reponse reponse = (Reponse) nouvellesDonnees;
if (Mediateur.DEBUG) System.out.println("<== Sequenceur : Réception d'une réponse, n°" + reponse.obtenirNumeroSequence() + ", marqueur retour " + marqueurRetour);
 
if (reponse.obtenirNumeroSequence() == marqueurRetour) {
// Si le numéro de séquence du retour correspond au marqueur, on rafraichit
Requete requete = requetes.get(marqueurRetour);
if (Mediateur.DEBUG) System.out.println("<|-- Sequenceur : Retourne paquet n°"+reponse.obtenirNumeroSequence()+" à "+requete.getVueARafraichir().getClass().toString());
mediateur.desactiverChargement(this);
requete.rafraichir(reponse.obtenirRetour());
requetes.remove(marqueurRetour);
marqueurRetour++;
avancerSequence();
} else {
// Sinon, on enregistre le retour
requetes.get(reponse.obtenirNumeroSequence()).setRetour(reponse);
}
} catch (ClassCastException e) {
if (Mediateur.DEBUG) {
System.out.println("<== Sequenceur : Réception d'une réponse incorrecte");
System.out.println(" Le séquenceur ne peut recevoir que des Reponse");
System.out.println(" > nouvellesDonnees = "+nouvellesDonnees.getClass().toString());
}
mediateur.desactiverChargement(this);
}
}
public int obtenirNumeroSequence() {
return this.numeroSequence;
}
public void avancerSequence() {
if (requetes.size()>0) {
// on récupère la première requete dans la file
Requete premiereRequete = requetes.get(marqueurRetour);
if (premiereRequete!=null && premiereRequete.hasResponse()) {
if (Mediateur.DEBUG) System.out.println("<|-- Sequenceur : Retourne paquet n°"+premiereRequete.obtenirReponse().obtenirNumeroSequence()+" à "+premiereRequete.getVueARafraichir().getClass().toString());
premiereRequete.rafraichir();
mediateur.desactiverChargement(this);
requetes.remove(marqueurRetour);
marqueurRetour++;
avancerSequence();
}
}
}
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/Mediateur.java
New file
0,0 → 1,1828
package org.tela_botanica.client;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
 
import org.mortbay.util.ajax.JSON;
import org.tela_botanica.client.composants.AideFenetre;
import org.tela_botanica.client.composants.IdentificationFenetre;
import org.tela_botanica.client.composants.InfoLogger;
import org.tela_botanica.client.composants.LicenceFenetre;
import org.tela_botanica.client.composants.AproposFenetre;
import org.tela_botanica.client.configuration.APropos;
import org.tela_botanica.client.configuration.Configuration;
import org.tela_botanica.client.i18n.Constantes;
import org.tela_botanica.client.i18n.ErrorMessages;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.modeles.Information;
import org.tela_botanica.client.modeles.MenuApplicationId;
import org.tela_botanica.client.modeles.Utilisateur;
import org.tela_botanica.client.modeles.Valeur;
import org.tela_botanica.client.modeles.collection.Collection;
import org.tela_botanica.client.modeles.collection.CollectionACommentaire;
import org.tela_botanica.client.modeles.collection.CollectionACommentaireAsyncDao;
import org.tela_botanica.client.modeles.collection.CollectionACommentaireListe;
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
import org.tela_botanica.client.modeles.collection.CollectionAPersonneListe;
import org.tela_botanica.client.modeles.collection.CollectionAPublication;
import org.tela_botanica.client.modeles.collection.CollectionAPublicationListe;
import org.tela_botanica.client.modeles.collection.CollectionListe;
import org.tela_botanica.client.modeles.commentaire.Commentaire;
import org.tela_botanica.client.modeles.commentaire.CommentaireListe;
import org.tela_botanica.client.modeles.personne.Personne;
import org.tela_botanica.client.modeles.personne.PersonneListe;
import org.tela_botanica.client.modeles.publication.Publication;
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
import org.tela_botanica.client.modeles.publication.PublicationAPersonneAsyncDao;
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
import org.tela_botanica.client.modeles.publication.PublicationAsyncDao;
import org.tela_botanica.client.modeles.publication.PublicationListe;
import org.tela_botanica.client.modeles.structure.Structure;
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
import org.tela_botanica.client.modeles.structure.StructureConservation;
import org.tela_botanica.client.modeles.structure.StructureListe;
import org.tela_botanica.client.modeles.structure.StructureValorisation;
import org.tela_botanica.client.synchronisation.Sequenceur;
import org.tela_botanica.client.util.Analytics;
import org.tela_botanica.client.util.Debug;
import org.tela_botanica.client.util.Log;
import org.tela_botanica.client.util.UtilArray;
import org.tela_botanica.client.vues.ContenuVue;
import org.tela_botanica.client.vues.EnteteVue;
import org.tela_botanica.client.vues.FenetreForm;
import org.tela_botanica.client.vues.Formulaire;
import org.tela_botanica.client.vues.FenetreJournal;
import org.tela_botanica.client.vues.MenuHorizontalVue;
import org.tela_botanica.client.vues.PopupChargement;
import org.tela_botanica.client.vues.StatutVue;
import org.tela_botanica.client.vues.accueil.AccueilVue;
import org.tela_botanica.client.vues.accueil.StatistiquesVue;
import org.tela_botanica.client.vues.collection.CollectionForm;
import org.tela_botanica.client.vues.collection.CollectionListeVue;
import org.tela_botanica.client.vues.collection.CollectionVue;
import org.tela_botanica.client.vues.commentaire.CommentaireForm;
import org.tela_botanica.client.vues.commentaire.CommentaireVue;
import org.tela_botanica.client.vues.personne.PersonneForm;
import org.tela_botanica.client.vues.personne.PersonneVue;
import org.tela_botanica.client.vues.publication.PublicationForm;
import org.tela_botanica.client.vues.publication.PublicationImportForm;
import org.tela_botanica.client.vues.publication.PublicationListeVue;
import org.tela_botanica.client.vues.publication.PublicationVue;
import org.tela_botanica.client.vues.structure.StructureForm;
import org.tela_botanica.client.vues.structure.StructureVue;
 
import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.Style.Orientation;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.extjs.gxt.ui.client.widget.layout.LayoutData;
import com.extjs.gxt.ui.client.widget.layout.RowData;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dev.jjs.ast.js.JsonArray;
import com.google.gwt.dev.json.JsonObject;
import com.google.gwt.dev.json.JsonValue;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.http.client.URL;
import com.google.gwt.i18n.client.Dictionary;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent;
import com.google.gwt.user.client.ui.FormPanel.SubmitEvent;
 
public class Mediateur implements Rafraichissable, ValueChangeHandler<String> {
private Viewport viewport;
private Modele modele = null;
public static final Constantes i18nC = getI18nConstante();
public static final ErrorMessages i18nM = getI18nMessage();
public static final boolean DEBUG = false;
public static final boolean DEBUG_CHARGEMENT = false;
private String requeteUrl = null;
private EnteteVue panneauNord = null;
private ContenuVue panneauCentre = null;
private StatutVue panneauSud = null;
private FenetreJournal fenetreJournal = null;
private MenuHorizontalVue panneauNavigation = null;
private HashMap<Object, Integer> fileDAttenteChargement = null;
private IdentificationFenetre fenetreIdentification = null;
private int nbElements = Integer.valueOf(((Dictionary) Dictionary.getDictionary("configuration")).get("nbElementsPage"));
private Sequenceur sequenceur = null;
//private boolean premierChargement = true;
protected String codeMenuPrecedent = null;
public Mediateur() {
// Enregistrement du Médiateur dans le Registre
Registry.register(RegistreId.MEDIATEUR, this);
 
//Initialisation du Registre
initialiserRegistre();
// Création du Modèle qui s'enregistre lui même dans le Registre
modele = new Modele();
// Séquenceur (local au médiateur)
sequenceur = new Sequenceur();
 
// Création du Viewport qui contient la disposition globale de l'application
viewport = new Viewport();
viewport.setLayout(new BorderLayout());
panneauNavigation = new MenuHorizontalVue(this);
 
// Création des différents panneaux
creerPanneauNord();
creerPanneauCentral();
creerPanneauSud();
fenetreJournal = new FenetreJournal(this);
// Connexion de l'utilisateur
getEtatUtilisateur();
 
// Creer la table qui gère le panneau de chargement/déchargement
fileDAttenteChargement = new HashMap<Object, Integer>();
// Gestion de l'historique du navigateur
History.addValueChangeHandler(this);// Ajout du médiateur comme écouteur des changements de l'historique
if ("".equals(History.getToken())) {
History.newItem(MenuApplicationId.ACCUEIL);
} else {
History.fireCurrentHistoryState();
}
// Retour à GWT du Viewport une fois constuit
RootPanel.get().add(viewport);
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de l'I18N et du REGISTRE
//+----------------------------------------------------------------------------------------------------------------+
protected static Constantes getI18nConstante() {
return GWT.create(Constantes.class);
}
protected static ErrorMessages getI18nMessage() {
return GWT.create(ErrorMessages.class);
}
protected void initialiserRegistre() {
APropos apropos = new APropos();
Registry.register(RegistreId.APPLI_NOM, apropos.getAppliNom());
Registry.register(RegistreId.APPLI_CODE, apropos.getAppliCode());
Registry.register(RegistreId.APPLI_VERSION, apropos.getAppliVersionCode());
Registry.register(RegistreId.APPLI_VERSION_NOM, apropos.getAppliVersionNom());
Registry.register(RegistreId.APPLI_DEVELOPPEURS, apropos.getDeveloppeurs());
Registry.register(RegistreId.APPLI_TRADUCTEURS, apropos.getTraducteurs());
Registry.register(RegistreId.APPLI_TESTEURS, apropos.getTesteurs());
Registry.register(RegistreId.APPLI_LICENCE, apropos.getLicence());
Registry.register(RegistreId.APPLI_REVISION, apropos.getRevisionGlobale());
Registry.register(RegistreId.SERVICES_REVISION, apropos.getRevisionGlobaleServices());
Registry.register(RegistreId.APPLI_COMPILATION_JAVA_VERSION, apropos.getVersionJavaCompilation());
Registry.register(RegistreId.APPLI_COMPILATION_DATE_HEURE, apropos.getDateHeureCompilation());
 
Registry.register(RegistreId.CONFIG, new Configuration());
Registry.register(RegistreId.POPUP_CHARGEMENT, new PopupChargement(this));
Registry.register(RegistreId.UTILISATEUR_COURANT, new Utilisateur());
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION des PANNEAUX PRINCIPAUX
//+----------------------------------------------------------------------------------------------------------------+
private void creerPanneauNord() {
panneauNord = new EnteteVue(this);
BorderLayoutData regionNord = new BorderLayoutData(LayoutRegion.NORTH, 100);
regionNord.setCollapsible(true);
regionNord.setFloatable(true);
regionNord.setSplit(false);
regionNord.setMargins(new Margins(5, 5, 0, 5));
viewport.add(panneauNord, regionNord);
}
 
private void creerPanneauCentral() {
ContentPanel panneauIntermediaire = new ContentPanel();
panneauIntermediaire.setLayout(new RowLayout(Orientation.VERTICAL));
panneauIntermediaire.setHeaderVisible(false);
panneauCentre = new ContenuVue(this);
 
BorderLayoutData regionCentre = new BorderLayoutData(LayoutRegion.CENTER);
regionCentre.setMargins(new Margins(5, 5, 5, 0));
panneauNavigation.setHeight(28);
panneauNavigation.setBodyBorder(false);
panneauNavigation.setBorders(false);
panneauIntermediaire.add(panneauNavigation, new RowData(1, -1, new Margins(0)));
panneauIntermediaire.add(panneauCentre, new RowData(1, 1, new Margins(0)));
 
viewport.add(panneauIntermediaire, regionCentre);
}
private void creerPanneauSud() {
panneauSud = new StatutVue();
BorderLayoutData regionSud = new BorderLayoutData(LayoutRegion.SOUTH, 20);
regionSud.setCollapsible(true);
regionSud.setFloatable(true);
regionSud.setSplit(false);
regionSud.setMargins(new Margins(0));
viewport.add(panneauSud, regionSud);
}
 
public void actualiserPanneauCentral() {
panneauCentre.layout();
}
public Rafraichissable obtenirFenetreJournal() {
return this.fenetreJournal;
}
public void ouvrirFenetreJournal() {
fenetreJournal.show();
}
public StatutVue obtenirPanneauSud() {
return this.panneauSud;
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION du MENU
//+----------------------------------------------------------------------------------------------------------------+
 
public void clicMenu(String codeMenuClique) {
boolean codeOk = true;
if (codeMenuClique.equals(MenuApplicationId.ACCUEIL)) {
afficherAccueil();
} else if (codeMenuClique.equals(MenuApplicationId.STRUCTURE)) {
selectionnerStructure(panneauCentre, null, null, false);
} else if (codeMenuClique.equals(MenuApplicationId.COLLECTION)) {
selectionnerCollection(panneauCentre, null, null, null);
} else if (codeMenuClique.equals(MenuApplicationId.PERSONNE)) {
selectionnerPersonne(panneauCentre, null, null);
} else if (codeMenuClique.equals(MenuApplicationId.PUBLICATION)) {
selectionnerPublication(panneauCentre, null, null);
} else if (codeMenuClique.equals(MenuApplicationId.COMMENTAIRE)) {
selectionnerCommentaire(panneauCentre, null, null);
} else if (codeMenuClique.equals(MenuApplicationId.STATS)) {
// l'affichage des statistiques ne nécessite pas de chargement
afficherStats();
} else {
Log.debug(i18nM.nonImplemente(codeMenuClique));
codeOk = false;
}
// Le code menu est valide
if (codeOk == true) {
// Sélection du menu
panneauNavigation.selectionMenu(codeMenuClique);
// Gestion de l'historique
//Coel.LogVersFirebug("CC: [" + codeMenuClique + "], CP: [" + codeMenuPrecedent + "]");
if (codeMenuPrecedent != codeMenuClique) {
//Coel.LogVersFirebug("Création d'historique!");
History.newItem(codeMenuClique);
codeMenuPrecedent = codeMenuClique;
}
// Ajout des stats Google Analytics
Analytics.pageVisitee(codeMenuClique);
// Rafraichissement du panneau central
panneauCentre.layout();
viewport.layout();
}
}
public void activerChargement(Object caller, String message) {
if (fileDAttenteChargement.get(caller) == null) fileDAttenteChargement.put(caller, 1);
else fileDAttenteChargement.put(caller, fileDAttenteChargement.get(caller)+1);
activerChargement(message);
}
private void activerChargement(String message) {
if (DEBUG_CHARGEMENT) System.out.println("[CHARGEMENT] ActiverChargement");
if (DEBUG_CHARGEMENT) debugFileAttente();
afficherPopinChargement();
panneauCentre.disable();
panneauSud.showBusy(i18nC.chargement()+" "+message);
}
public void desactiverChargement(Object caller) {
if (fileDAttenteChargement.get(caller) == null) {
if (DEBUG_CHARGEMENT) System.out.println("[CHARGEMENT] Problème : l'objet "+caller+" essaie de désactiver le chargement alors qu'il ne l'a pas initié.");
}
else fileDAttenteChargement.put(caller, fileDAttenteChargement.get(caller)-1);
if (!chargementsEnCours()) desactiverChargement();
else if (DEBUG_CHARGEMENT) {
System.out.println("[CHARGEMENT] Patienter, il y a encore un chargement en cours.");
debugFileAttente();
}
}
private void desactiverChargement() {
if (DEBUG_CHARGEMENT) System.out.println("[CHARGEMENT] Désactiver Chargement");
if (DEBUG_CHARGEMENT) debugFileAttente();
masquerPopinChargement();
panneauCentre.enable();
panneauSud.clear();
}
private boolean chargementsEnCours() {
boolean chargementEnCours = false;
Iterator<Object> it = fileDAttenteChargement.keySet().iterator();
while (it.hasNext() && !chargementEnCours) {
chargementEnCours = (fileDAttenteChargement.get(it.next()) > 0);
}
return chargementEnCours;
}
private void debugFileAttente() {
System.out.println("[CHARGEMENT]--< StackTrace >------------------------------------------------------");
if (fileDAttenteChargement.size() == 0) System.out.println("(Empty)");
Iterator<Object> it = fileDAttenteChargement.keySet().iterator();
while (it.hasNext()) {
Object o = it.next();
System.out.println(" ["+o+"] = "+fileDAttenteChargement.get(o));
}
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES FENÊTRES
//+----------------------------------------------------------------------------------------------------------------+
 
public void ouvrirAide() {
AideFenetre aideFenetre = new AideFenetre();
aideFenetre.show();
// FIXME : apparament le fade In/Fade Out pose problème sur les navigateurs...
//aideFenetre.el().fadeIn(FxConfig.NONE);
}
 
public void ouvrirParametres() {
AproposFenetre parametresFenetre = new AproposFenetre();
parametresFenetre.show();
}
 
public void ouvrirIdentification() {
fenetreIdentification = new IdentificationFenetre(this);
fenetreIdentification.show();
}
 
public void ouvrirUrlExterne(String id) {
if (id.equals(ComposantId.MENU_CEL)) {
Window.open(((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("cel"), "Carnet en ligne", "");
} else if (id.equals(ComposantId.MENU_CONTACT)) {
String urlWidgetRemarques = ((Configuration) Registry.get(RegistreId.CONFIG)).getUrl("remarques")
+ "?service=coel&pageSource=" + URL.encodeQueryString(Window.Location.getHref());
Window.open(urlWidgetRemarques, "Remarques", "");
}
}
 
public void afficherFenetreLicence(IdentificationFenetre vue) {
new LicenceFenetre(vue);
}
public void accepterLicence(Rafraichissable vue) {
modele.accepterLicence(vue);
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de l'UTILISATEUR et de l'IDENTIFICATION
//+----------------------------------------------------------------------------------------------------------------+
/**
* Retourne l'identifiant de l'utilisateur courrant de l'application.
*/
public String getUtilisateurId() {
String id = null;
Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
if (!utilisateurCourant.getId().equals("")) {
id = utilisateurCourant.getId();
}
return id;
}
public Utilisateur getUtilisateur() {
Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
return utilisateurCourant;
}
public void connecterUtilisateur(String login, String mdp) {
modele.connecterUtilisateur(this, login, mdp);
}
public void deconnecterUtilisateur() {
modele.deconnecterUtilisateur(this);
}
 
public void getEtatUtilisateur() {
modele.getEtatUtilisateur(this);
}
public void repandreEtatIdentification(Utilisateur utilisateur) {
// Mise à jour du registre
Registry.register(RegistreId.UTILISATEUR_COURANT, utilisateur);
// Propagation de l'information de mise à jour de l'utilisateur
repandreInfoMiseAJourUtilisateur();
}
public void repandreInfoMiseAJourUtilisateur() {
// Création de l'information de mise à jour de l'utilisateur
Information info = new Information("maj_utilisateur");
 
// Rafraichissement de la fenêtre d'Identification
if (fenetreIdentification != null && fenetreIdentification.isVisible()) {
fenetreIdentification.rafraichir(info);
}
// Rafraichissement du panneau Nord
panneauNord.rafraichir(info);
// Rafraichissement du panneau Centre
if (panneauCentre != null) {
panneauCentre.rafraichir(info);
}
}
 
public void modifierUtilisateur() {
Utilisateur utilisateurCourant = (Utilisateur) Registry.get(RegistreId.UTILISATEUR_COURANT);
panneauNord.rafraichir(utilisateurCourant);
modele.modifierUtilisateur(this, utilisateurCourant);
}
 
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES VALEURS ET LISTES
//+----------------------------------------------------------------------------------------------------------------+
 
/** Cette méthode est un "wrapper" **/
public void obtenirListeValeurEtRafraichir(Rafraichissable vueARafraichir, String listeId, Sequenceur sequenceur) {
obtenirListeValeurEtRafraichir(vueARafraichir, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId), sequenceur);
}
 
public void obtenirListeValeurEtRafraichir(Rafraichissable vueARafraichir, int listeId, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner ValeurListe");
Integer numeroSequence = null;
if (sequenceur != null) {
numeroSequence = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.obtenirListeValeurs(vueARafraichir, listeId, numeroSequence);
}
 
public void obtenirListeValeurEtRafraichir(Rafraichissable vueARafraichir, String nomListe, boolean pagination, String recherche, int start, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner ValeurListe");
Integer numeroSequence = null;
if (sequenceur != null) {
numeroSequence = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.obtenirListeValeurs(vueARafraichir, ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(nomListe), pagination, recherche, start, nbElements, numeroSequence);
}
 
public void obtenirValeurEtRafraichir(Rafraichissable vueARafraichir, String listeId, String identifiantValeur, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner ValeurListe");
Integer numeroSequence = null;
if (sequenceur != null) {
numeroSequence = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.obtenirValeur(vueARafraichir, "identifiant", ((Configuration) Registry.get(RegistreId.CONFIG)).getListeId(listeId), identifiantValeur, numeroSequence);
}
 
//+----------------------------------------------------------------------------------------------------------------+
// GESTION des APPLETS de l'ACCUEIL
//+----------------------------------------------------------------------------------------------------------------+
public void afficherAccueil() {
if (!(panneauCentre.getContenu() instanceof AccueilVue)) {
panneauCentre.removeAll();
panneauCentre.add(new AccueilVue(this));
}
else {
desactiverChargement();
}
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES STRUCTURES
//+----------------------------------------------------------------------------------------------------------------+
 
public void afficherListeStructures(StructureListe structuresACharger) {
if (!(panneauCentre.getContenu() instanceof StructureVue)) {
panneauCentre.removeAll();
panneauCentre.add(new StructureVue(this));
}
panneauCentre.getContenu().rafraichir(structuresACharger);
}
public void afficherFormStructure(String structureId) {
String mode = Formulaire.MODE_AJOUTER;
if (structureId != null) {
mode = Formulaire.MODE_MODIFIER;
}
final FenetreForm fenetre = new FenetreForm("");
Sequenceur sequenceur = new Sequenceur();
StructureForm structureForm = new StructureForm(this, mode, sequenceur) {
@Override
public void surFermetureFormulaire() {
fenetre.hide();
}
};
structureForm.vueExterneARafraichirApresValidation = panneauCentre.getContenu();
fenetre.add(structureForm);
fenetre.show();
if (mode.equals(Formulaire.MODE_MODIFIER)) {
selectionnerStructure(structureForm, structureId, sequenceur, false);
selectionnerStructureAPersonne(structureForm, structureId, StructureAPersonne.ROLE_EQUIPE, sequenceur);
}
panneauCentre.layout();
}
public void clicListeStructure(Structure structure) {
panneauCentre.getContenu().rafraichir(structure);
if (structure != null && structure.getPersonnel() == null) {
selectionnerStructureAPersonne(panneauCentre.getContenu(), structure.getId(), StructureAPersonne.ROLE_EQUIPE, null);
selectionnerCollectionAStructure(panneauCentre.getContenu(), structure.getId());
}
}
 
public void clicAjouterStructure() {
afficherFormStructure(null);
}
public void clicModifierStructure(List<Structure> structureSelection) {
if (structureSelection.size() == 0) {
InfoLogger.display("Information", "Veuillez sélectionner une structure.");
} else if (structureSelection.size() > 1) {
InfoLogger.display("Information", "Veuillez sélectionner une seule structure à la fois.");
} else if (structureSelection.size() == 1) {
afficherFormStructure(structureSelection.get(0).getId());
} else {
InfoLogger.display("Erreur", "Une erreur est survenue dans la méthode clicModifierStructure() du Médiateur.");
}
}
public void clicSupprimerStructure(final Rafraichissable vue, final List<Structure> structureSelection) {
if (structureSelection.size() == 0) {
InfoLogger.display("Information", "Veuillez sélectionner une structure.");
} else if(structureSelection.size() > 0) {
String titre = "Supprimer des structures";
String message = "Êtes vous sur de vouloir supprimer les structures sélectionnées ?";
if (structureSelection.size() == 1) {
titre = "Supprimer une structure";
message = "Êtes vous sur de vouloir supprimer la structure sélectionnée ?";
}
final Listener<MessageBoxEvent> suppressionEcouteur = new Listener<MessageBoxEvent>() {
public void handleEvent(MessageBoxEvent ce) {
Dialog dialog = (Dialog) ce.getComponent();
Button btn = ce.getButtonClicked();
 
if (btn.getHtml().equals(dialog.yesText)) {
String idStr = "" ;
for(int i = 0 ; i < structureSelection.size() ; i++) {
idStr += structureSelection.get(i).getId()+",";
}
supprimerStructure(vue, idStr);
}
}
};
MessageBox.confirm(titre, message, suppressionEcouteur);
} else {
InfoLogger.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerStructure() du Médiateur.");
}
}
 
/** selectionnerStructure(Rafraichissable vueARafraichir, String recherche, int start, int nbElements)
* Action :
* --------
* - Récupère un nombre défini de structures en s'aidant du nom partiel ou complet de la structure.
*
* Description des paramètres :
* ----------------------------
* - 'vueARafraichir' référence l'objet à mettre à jour après réception des données.
* - 'recherche' est une chaîne de caractères représentant tout ou partie du nom d'une structure.
* Si la chaîne est vide, alors toutes les structures sont recherchées.
* - 'start' et 'nbElements' sont les paramètres indispensables à la pagination. 'start'
* est le paramètre qui décrit le numéro du tuple de départ et 'nbElements' le nombre
* d'éléments à collecter.
*
* Préconditions :
* ---------------
* - 'vueARafraichir' doit être non NULL et référencer un objet implémentant l'interface
* 'Rafraichissable'
* - 'recherche' doit être non NULL.
* - 'start' doit être supérieur ou égal à zéro. 'nbElements' doit être supérieur à zéro.
*
*/
public void selectionnerStructure(Rafraichissable vueARafraichir, String recherche, int start, int nbElements, Sequenceur sequenceur, boolean searchCity) {
if (Mediateur.DEBUG) {
System.out.println("MEDIATEUR - selectionner Structure");
}
Integer seqId = null;
if (sequenceur != null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerStructure(vueARafraichir, recherche, start, nbElements, seqId, searchCity);
}
public void selectionnerStructure(Rafraichissable vueARafraichir, String structureId, Sequenceur sequenceur, boolean searchCity) {
if (Mediateur.DEBUG) {
System.out.println("MEDIATEUR - selectionner Structure");
}
Integer seqId = null;
if (sequenceur != null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
 
modele.selectionnerStructure(vueARafraichir, structureId, null, 0, nbElements, seqId, searchCity);
}
public void selectionnerStructure(Rafraichissable vueARafraichir, String structureId, String nom, int start, int nbElements, Sequenceur sequenceur, boolean searchCity) {
if (Mediateur.DEBUG) {
System.out.println("MEDIATEUR - selectionner Structure");
}
Integer seqId = null;
if (sequenceur != null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerStructure(vueARafraichir, structureId, nom, start, nbElements, seqId, searchCity);
}
public void selectionnerStructureAvecPaginationProgressive(Rafraichissable vueARafraichir, String structureId, String nom, String formatRetour, int start, int nbElements, Sequenceur sequenceur, boolean searchCity) {
if (Mediateur.DEBUG) {
System.out.println("MEDIATEUR - selectionner Structure");
}
Integer seqId = null;
if (sequenceur != null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerStructureAvecPaginationProgressive(vueARafraichir, structureId, nom, formatRetour, start, nbElements, seqId, searchCity);
}
 
private void selectionnerCollectionAStructure(Rafraichissable vueARafraichir, String structureId) {
if (Mediateur.DEBUG) {
System.out.println("MEDIATEUR - selectionner Collection à structure");
}
Integer seqId = null;
if (sequenceur != null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerCollectionAStructure(vueARafraichir, structureId, 0, 10, seqId);
}
/** AJOUTER **/
public void ajouterStructure(Rafraichissable vueARafraichir, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
modele.ajouterStructure(vueARafraichir, structure, conservation, valorisation);
}
/** MODIFIER **/
public void modifierStructure(Rafraichissable vueARafraichir, String structureId, Structure structure, StructureConservation conservation, StructureValorisation valorisation) {
modele.modifierStructure(vueARafraichir, structureId, structure, conservation, valorisation);
}
/** SUPPRIMER **/
public void supprimerStructure(Rafraichissable vueARafraichir, String IdentifiantsStructureSepareParVirgule) {
modele.supprimerStructure(vueARafraichir, IdentifiantsStructureSepareParVirgule);
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de la relation STRUCTURE A PERSONNE
 
public void selectionnerStructureAPersonne(Rafraichissable vueARafraichir, String structureId, String roleId, String nom, int start, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner StructureAPersonne");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerStructureAPersonne(vueARafraichir, structureId, roleId, nom, start, nbElements, seqId);
}
public void selectionnerStructureAPersonne(Rafraichissable vueARafraichir, String structureId, String roleId, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner StructureAPersonne");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerStructureAPersonne(vueARafraichir, structureId, roleId, seqId);
}
/** AJOUTER **/
public void ajouterStructureAPersonne(Rafraichissable vueARafraichir, String structureId, StructureAPersonneListe personnelAjoute) {
if (personnelAjoute != null && personnelAjoute.size() > 0) {
for (Iterator<String> it = personnelAjoute.keySet().iterator(); it.hasNext();) {
modele.ajouterStructureAPersonne(vueARafraichir, structureId, (StructureAPersonne) personnelAjoute.get(it.next()));
}
}
}
/** MODIFIER **/
public void modifierStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelModifie) {
if (personnelModifie != null && personnelModifie.size() > 0) {
for (Iterator<String> it = personnelModifie.keySet().iterator(); it.hasNext();) {
modele.modifierStructureAPersonne(vueARafraichir, (StructureAPersonne) personnelModifie.get(it.next()));
}
}
}
/** SUPPRIMER **/
public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, StructureAPersonneListe personnelSupprime) {
if (personnelSupprime != null && personnelSupprime.size() > 0) {
String idStructureAPersonneSepareParVirgule = "" ;
Iterator<String> it = personnelSupprime.keySet().iterator();
while (it.hasNext()) {
idStructureAPersonneSepareParVirgule += personnelSupprime.get(it.next()).getId();
idStructureAPersonneSepareParVirgule += (it.hasNext()) ? "," : "";
}
supprimerStructureAPersonne(vueARafraichir, idStructureAPersonneSepareParVirgule);
}
}
public void supprimerStructureAPersonne(Rafraichissable vueARafraichir, String idStructureAPersonneSeparesParVirgule) {
modele.supprimerStructureAPersonne(vueARafraichir, idStructureAPersonneSeparesParVirgule);
}
public void supprimerStructureAPersonne(final Rafraichissable vueARafraichir, final List<Structure> structuresListe) {
if (structuresListe.size() != 0) {
String idStructureSepareParVirgule = "" ;
Iterator<Structure> it = structuresListe.iterator();
while (it.hasNext()) {
Structure structure = it.next();
idStructureSepareParVirgule += structure.getId();
idStructureSepareParVirgule += it.hasNext() ? "," : "";
}
supprimerStructureAPersonne(vueARafraichir, idStructureSepareParVirgule);
}
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION des COLLECTIONS
//+----------------------------------------------------------------------------------------------------------------+
public void afficherListeCollections(CollectionListe collectionsACharger) {
if (!(panneauCentre.getContenu() instanceof CollectionVue)) {
panneauCentre.removeAll();
panneauCentre.add(new CollectionVue(this));
}
panneauCentre.getContenu().rafraichir(collectionsACharger);
}
public void afficherFormCollection(String collectionId) {
final FenetreForm fenetre = new FenetreForm("");
CollectionForm collectionForm = new CollectionForm(this, collectionId) {
@Override
public void surFermetureFormulaire() {
fenetre.hide();
}
};
collectionForm.vueExterneARafraichirApresValidation = panneauCentre.getContenu();
fenetre.add(collectionForm);
fenetre.show();
}
public void clicListeCollection(Collection collectionCliquee) {
panneauCentre.getContenu().rafraichir(collectionCliquee);
if (collectionCliquee != null) {
selectionnerCollectionAPersonne(panneauCentre.getContenu(), collectionCliquee.getId(), null, sequenceur);
selectionnerCollectionAPublication(panneauCentre.getContenu(), collectionCliquee.getId(), sequenceur);
selectionnerCollectionACommentaire(panneauCentre.getContenu(), collectionCliquee.getId(), sequenceur);
}
}
public void clicAjouterCollection() {
afficherFormCollection(null);
}
 
public void clicModifierCollection(List<Collection> selection) {
if (selection.size() == 0) {
InfoLogger.display("Information", "Veuillez sélectionner une collection.");
} else if (selection.size() > 1) {
InfoLogger.display("Information", "Veuillez sélectionner une seule collection à la fois.");
} else if (selection.size() == 1) {
afficherFormCollection(selection.get(0).getId());
} else {
InfoLogger.display("Erreur", "Une erreur est survenue dans la méthode clicModifierCollection() du Médiateur.");
}
}
 
public void clicSupprimerCollection(CollectionListeVue collectionListeVue, final List<Collection> collectionsASupprimer) {
if (collectionsASupprimer.size() <= 0) {
MessageBox.alert("Attention", "Vous devez sélectionner au moins une collection", null);
} else {
String message = "Voulez-vous vraiment supprimer ces collections ?";
if (collectionsASupprimer.size() == 1) {
message = "Voulez-vous vraiment supprimer cette collection ?";
}
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
public void handleEvent(MessageBoxEvent ce) {
Dialog dialog = (Dialog) ce.getComponent();
Button btn = ce.getButtonClicked();
if (btn.getHtml().equals(dialog.yesText)) {
supprimerCollection(panneauCentre.getContenu(), collectionsASupprimer);
}
}
};
MessageBox.confirm("Supprimer une collection", message, listenerSuppression);
}
}
 
/** Cette méthode est un "wrapper" **/
public void selectionnerCollection(Rafraichissable vueARafraichir, String collectionId, String nom, Sequenceur sequenceur) {
selectionnerCollection(vueARafraichir, collectionId, nom, 0, nbElements, sequenceur);
}
public void selectionnerCollection(Rafraichissable vueARafraichir, String collectionId, String nom, int start, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner Collection");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerCollection(vueARafraichir, collectionId, nom, start, nbElements, seqId);
}
/****************************************************************************************************
/** selectionnerCollection(Rafraichissable vueARafraichir, String recherche, int start, int nbElements)
/****************************************************************************************************
* Action :
* --------
* - Récupère un nombre défini de collections en s'aidant du nom partiel ou complet de la collection.
*
* Description des paramètres :
* ----------------------------
* - 'vueARafraichir' référence l'objet à mettre à jour après réception des données.
* - 'recherche' est une chaîne de caractères représentant tout ou partie du nom d'une collection.
* Si la chaîne est vide, alors toutes les collections sont recherchées.
* - 'start' et 'nbElements' sont les paramètres indispensables à la pagination. 'start'
* est le paramètre qui décrit le numéro du tuple de départ et 'nbElements' le nombre
* d'éléments à collecter.
*
* Préconditions :
* ---------------
* - 'vueARafraichir' doit être non NULL et référencer un objet implémentant l'interface
* 'Rafraichissable'
* - 'recherche' doit être non NULL.
* - 'start' doit être supérieur ou égal à zéro. 'nbElements' doit être supérieur à zéro.
*
*****************************************************************************************************/
public void selectionnerCollection(Rafraichissable vueARafraichir, String recherche, int start, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner Collection");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerCollection(vueARafraichir, recherche, start, nbElements, seqId);
}
/** AJOUTER **/
public void ajouterCollection(Rafraichissable vueARafraichir, Collection collection) {
modele.ajouterCollection(vueARafraichir, collection);
}
/** MODIFIER **/
public void modifierCollection(Rafraichissable vueARafraichir, Collection collection) {
modele.modifierCollection(vueARafraichir, collection);
}
/** SUPPRIMER **/
public void supprimerCollection(Rafraichissable vueARafraichir, List<Collection> collectionsListe) {
if (collectionsListe != null && collectionsListe.size() > 0) {
String idCollectionSeparesParVirgule = "" ;
Iterator<Collection> it = collectionsListe.iterator();
while (it.hasNext()) {
idCollectionSeparesParVirgule += it.next().getId();
if (it.hasNext()) {
idCollectionSeparesParVirgule += ",";
}
}
modele.supprimerCollection(vueARafraichir, idCollectionSeparesParVirgule);
modele.supprimerCollectionAPersonne(vueARafraichir, idCollectionSeparesParVirgule);
modele.supprimerCollectionAPublication(vueARafraichir, idCollectionSeparesParVirgule);
//modele.supprimerCollectionACommentaire(vueARafraichir, idCollectionSeparesParVirgule);
}
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de la relation COLLECTION A PERSONNE
public void selectionnerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, String roleId, String recherche, int start, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner CollectionAPersonne");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerCollectionAPersonne(vueARafraichir, collectionId, roleId, recherche, start, nbElements, seqId);
}
public void selectionnerCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, String roleId, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner CollectionAPersonne");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerCollectionAPersonne(vueARafraichir, collectionId, roleId, seqId);
}
/** AJOUTER **/
public void ajouterCollectionAPersonne(Rafraichissable vueARafraichir, String collectionId, CollectionAPersonneListe personnesAjoutees) {
if (personnesAjoutees != null && personnesAjoutees.size() > 0) {
for (Iterator<String> it = personnesAjoutees.keySet().iterator(); it.hasNext();) {
modele.ajouterCollectionAPersonne(vueARafraichir, collectionId, (CollectionAPersonne) personnesAjoutees.get(it.next()));
}
}
}
/** MODIFIER **/
public void modifierCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonneListe personnesModifiees) {
if (personnesModifiees != null && personnesModifiees.size() > 0) {
for (Iterator<String> it = personnesModifiees.keySet().iterator(); it.hasNext();) {
modele.modifierCollectionAPersonne(vueARafraichir, (CollectionAPersonne) personnesModifiees.get(it.next()));
}
}
}
/** SUPPRIMER **/
public void supprimerCollectionAPersonne(Rafraichissable vueARafraichir, CollectionAPersonneListe personnesSupprimees) {
if (personnesSupprimees != null && personnesSupprimees.size() > 0) {
String idCollectionAPersonneSeparesParVirgule = "" ;
for (Iterator<String> it = personnesSupprimees.keySet().iterator(); it.hasNext();) {
idCollectionAPersonneSeparesParVirgule += personnesSupprimees.get(it.next()).getId();
if (it.hasNext()) {
idCollectionAPersonneSeparesParVirgule += ",";
}
}
modele.supprimerCollectionAPersonne(vueARafraichir, idCollectionAPersonneSeparesParVirgule);
}
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de la relation COLLECTION A PUBLICATION
public void selectionnerCollectionAPublication(Rafraichissable vueARafraichir, String collectionId, String recherche, int start, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner CollectionAPublication");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerCollectionAPublication(vueARafraichir, collectionId, recherche, start, nbElements, seqId);
}
public void selectionnerCollectionAPublication(Rafraichissable vueARafraichir, String collectionId, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner CollectionAPublication");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerCollectionAPublication(vueARafraichir, collectionId, seqId);
}
public void ajouterCollectionAPublication(Rafraichissable vueARafraichir, String collectionId, CollectionAPublicationListe publicationsAjoutees) {
if (publicationsAjoutees != null && publicationsAjoutees.size() > 0) {
for (Iterator<String> it = publicationsAjoutees.keySet().iterator(); it.hasNext();) {
modele.ajouterCollectionAPublication(vueARafraichir, collectionId, (CollectionAPublication) publicationsAjoutees.get(it.next()));
}
}
}
public void modifierCollectionAPublication(Rafraichissable vueARafraichir, CollectionAPublicationListe publicationsModifiees) {
if (publicationsModifiees != null && publicationsModifiees.size() > 0) {
for (Iterator<String> it = publicationsModifiees.keySet().iterator(); it.hasNext();) {
modele.modifierCollectionAPublication(vueARafraichir, (CollectionAPublication) publicationsModifiees.get(it.next()));
}
}
}
public void supprimerCollectionAPublication(Rafraichissable vueARafraichir, CollectionAPublicationListe publicationsSupprimees) {
if (publicationsSupprimees != null && publicationsSupprimees.size() > 0) {
String idCollectionAPublicationSeparesParVirgule = "" ;
for (Iterator<String> it = publicationsSupprimees.keySet().iterator(); it.hasNext();) {
idCollectionAPublicationSeparesParVirgule += publicationsSupprimees.get(it.next()).getId();
if (it.hasNext()) {
idCollectionAPublicationSeparesParVirgule += ",";
}
}
modele.supprimerCollectionAPublication(vueARafraichir, idCollectionAPublicationSeparesParVirgule);
}
}
 
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de la relation COLLECTION A COMMENTAIRE
public void selectionnerCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner CollectionACommentaire");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerCollectionACommentaire(vueARafraichir, collectionId, seqId);
}
public void selectionnerCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId, String recherche, int pageCourante, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner CollectionACommentaire");
Integer seqId = null;
if (sequenceur != null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerCollectionACommentaire(vueARafraichir, collectionId, recherche, pageCourante, nbElements, seqId);
}
/** AJOUTER **/
public void ajouterCollectionACommentaire(Rafraichissable vueARafraichir, String collectionId, CollectionACommentaireListe commentairesAjoutees) {
if (commentairesAjoutees != null && commentairesAjoutees.size() > 0) {
for (Iterator<String> it = commentairesAjoutees.keySet().iterator(); it.hasNext();) {
modele.ajouterCollectionACommentaire(vueARafraichir, collectionId, (CollectionACommentaire) commentairesAjoutees.get(it.next()));
}
}
}
/** MODIFIER **/
public void modifierCollectionACommentaire(Rafraichissable vueARafraichir, CollectionACommentaireListe commentairesModifiees) {
if (commentairesModifiees != null && commentairesModifiees.size() > 0) {
for (Iterator<String> it = commentairesModifiees.keySet().iterator(); it.hasNext();) {
modele.modifierCollectionACommentaire(vueARafraichir, (CollectionACommentaire) commentairesModifiees.get(it.next()));
}
}
}
/** SUPPRIMER **/
public void supprimerCollectionACommentaire(Rafraichissable vueARafraichir, CollectionACommentaireListe commentairesSupprimees) {
if (commentairesSupprimees != null && commentairesSupprimees.size() > 0) {
String idCollectionACommentaireSeparesParVirgule = "" ;
for (Iterator<String> it = commentairesSupprimees.keySet().iterator(); it.hasNext();) {
idCollectionACommentaireSeparesParVirgule += commentairesSupprimees.get(it.next()).getId();
if (it.hasNext()) {
idCollectionACommentaireSeparesParVirgule += ",";
}
}
modele.supprimerCollectionACommentaire(vueARafraichir, idCollectionACommentaireSeparesParVirgule, CollectionACommentaireAsyncDao.SUPPRESSION_PAR_COLLECTION);
}
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES PERSONNES
//+----------------------------------------------------------------------------------------------------------------+
 
public void afficherListePersonnes(PersonneListe personnesACharger) {
if (!(panneauCentre.getContenu() instanceof PersonneVue)) {
panneauCentre.removeAll();
panneauCentre.add(new PersonneVue(this));
panneauCentre.setId(ComposantId.PANNEAU_PERSONNE_LISTES);
}
panneauCentre.getContenu().rafraichir(personnesACharger);
}
public void afficherFormPersonne(String personneId) {
final FenetreForm fenetre = new FenetreForm("");
PersonneForm personneForm = new PersonneForm(this, personneId) {
@Override
public void surFermetureFormulaire() {
fenetre.hide();
}
};
personneForm.vueExterneARafraichirApresValidation = panneauCentre.getContenu();
fenetre.add(personneForm);
fenetre.show();
}
 
public void clicListePersonne(Personne personne) {
panneauCentre.getContenu().rafraichir(personne);
}
 
public void clicAjouterPersonne() {
afficherFormPersonne(null);
}
public void clicModifierPersonne(List<Personne> selection) {
if (selection.size() == 0) {
InfoLogger.display("Information", "Veuillez sélectionner une personne.");
} else if (selection.size() > 1) {
InfoLogger.display("Information", "Veuillez sélectionner une seule personne à la fois.");
} else if (selection.size() == 1) {
afficherFormPersonne(selection.get(0).getId());
} else {
InfoLogger.display("Erreur", "Une erreur est survenue dans la méthode clicModifierPersonne() du Médiateur.");
}
}
public void clicSupprimerPersonne(final Rafraichissable vue, final List<Personne> personneSelection) {
//Empecher suppression utilisateur
for (int i=0; i < personneSelection.size(); i++) {
Personne courante = personneSelection.get(i);
if (courante.getId().equals(getUtilisateurId())) {
InfoLogger.display("Information", "Vous ne pouvez pas supprimer votre compte");
personneSelection.remove(courante);
}
}
if (personneSelection.size() == 0) {
InfoLogger.display("Information", "Veuillez sélectionner une personne.");
} else if(personneSelection.size() > 0) {
String message = "Êtes vous sur de vouloir supprimer les personnes sélectionnées ?";
if (personneSelection.size() == 1) {
message = "Êtes vous sur de vouloir supprimer la personne sélectionnée ?";
}
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
public void handleEvent(MessageBoxEvent ce) {
Dialog dialog = (Dialog) ce.getComponent();
Button btn = ce.getButtonClicked();
 
if (btn.getHtml().equals(dialog.yesText)) {
String idPersonneSepareParVirgule = "" ;
Iterator<Personne> itPersonne = personneSelection.iterator();
while (itPersonne.hasNext()) {
Personne personneCourante = itPersonne.next();
idPersonneSepareParVirgule += personneCourante.getId();
idPersonneSepareParVirgule +=",";
}
modele.supprimerPersonne(vue, idPersonneSepareParVirgule);
}
}
};
MessageBox.confirm("Supprimer une personne", message, listenerSuppression);
} else {
InfoLogger.display("Erreur", "Une erreur est survenue dans la méthode clicSupprimerPersonne() du Médiateur.");
}
}
 
/****************************************************************************************************
/** selectionnerPersonne(Rafraichissable vueARafraichir, String recherche, int start, int nbElements)
/****************************************************************************************************
* Action :
* --------
* - Récupère un nombre défini de personnes en s'aidant du nom partiel ou complet de la personne.
*
* Description des paramètres :
* ----------------------------
* - 'vueARafraichir' référence l'objet à mettre à jour après réception des données.
* - 'recherche' est une chaîne de caractères représentant tout ou partie du nom d'une personne.
* Si la chaîne est vide, alors toutes les personnes sont recherchées.
* - 'start' et 'nbElements' sont les paramètres indispensables à la pagination. 'start'
* est le paramètre qui décrit le numéro du tuple de départ et 'nbElements' le nombre
* d'éléments à collecter.
*
* Préconditions :
* ---------------
* - 'vueARafraichir' doit être non NULL et référencer un objet implémentant l'interface
* 'Rafraichissable'
* - 'recherche' doit être non NULL.
* - 'start' doit être supérieur ou égal à zéro. 'nbElements' doit être supérieur à zéro.
*
*****************************************************************************************************/
public void selectionnerPersonne(Rafraichissable vueARafraichir, String recherche, int start, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner Personne");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerPersonne(vueARafraichir, recherche, start, nbElements, seqId);
}
public void selectionnerPersonne(Rafraichissable vueARafraichir, Personne personne, int start, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner Personne");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
String personneId = null;
String personneNom = null;
if (personne != null) {
personneId = personne.getId();
personneNom = personne.getNom();
}
modele.selectionnerPersonne(vueARafraichir, personneId, personneNom, start, nbElements, seqId);
}
public void selectionnerPersonne(Rafraichissable vueARafraichir, String idPersonne, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner Personne");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerPersonne(vueARafraichir, idPersonne, null, 0, nbElements, seqId);
}
public void selectionnerPersonneParNomComplet(Rafraichissable vueARafraichir, String nomComplet, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner Personne");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerPersonne(vueARafraichir, null, nomComplet, 0, -1, seqId);
}
/** ENREGISTRER **/
public void enregistrerPersonne(Rafraichissable vue, Personne personne){
if (personne.getId() != null && !personne.getId().trim().equals("")) {
modele.modifierPersonne(vue, personne);
} else {
modele.ajouterPersonne(vue, personne);
}
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES PUBLICATIONS
//+----------------------------------------------------------------------------------------------------------------+
 
public void afficherListePublication(PublicationListe nouvelleDonnees) {
if (!(panneauCentre.getContenu() instanceof PublicationVue)) {
panneauCentre.removeAll();
panneauCentre.add(new PublicationVue(this));
}
panneauCentre.getContenu().rafraichir(nouvelleDonnees);
}
public void afficherFormPublication(String publicationId) {
final FenetreForm fenetre = new FenetreForm("");
PublicationForm publicationForm = new PublicationForm(this, publicationId) {
@Override
public void surFermetureFormulaire() {
fenetre.hide();
}
};
publicationForm.vueExterneARafraichirApresValidation = panneauCentre.getContenu();
fenetre.add(publicationForm);
fenetre.show();
}
public void clicListePublication(Publication publication) {
if (publication != null) {
panneauCentre.getContenu().rafraichir(publication);
}
}
 
public void clicAjouterPublication() {
afficherFormPublication(null);
}
public void clicModifierPublication(List<Publication> selection) {
if (selection.size() == 0) {
InfoLogger.display("Information", "Veuillez sélectionner une publication.");
} else if (selection.size() > 1) {
InfoLogger.display("Information", "Veuillez sélectionner une seule publication à la fois.");
} else if (selection.size() == 1) {
afficherFormPublication(selection.get(0).getId());
} else {
InfoLogger.display("Erreur", "Une erreur est survenue dans la méthode clicModifierPublication() du Médiateur.");
}
}
public void clicSupprimerPublication(final List<Publication> publicationListe) {
if (publicationListe.size() <= 0) {
MessageBox.alert("Attention", "Vous devez sélectionner une publication", null);
} else {
String messageComplement = "(ceci supprimera également les liens avec leurs auteurs et leurs collections)";
String message = "Voulez-vous vraiment supprimer ces publications "+messageComplement+" ?";
if (publicationListe.size() == 1) {
message = "Voulez-vous vraiment supprimer cette publication "+messageComplement+" ?";
}
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
public void handleEvent(MessageBoxEvent ce) {
Dialog dialog = (Dialog) ce.getComponent();
Button btn = ce.getButtonClicked();
if (btn.getHtml().equals(dialog.yesText)) {
supprimerPublication(panneauCentre.getContenu(), publicationListe);
}
}
};
MessageBox.confirm("Supprimer une publication", message, listenerSuppression);
}
}
/** Cette méthode est un "wrapper" */
public void selectionnerPublication(Rafraichissable vueARafraichir, String publicationId, Sequenceur sequenceur) {
selectionnerPublication(vueARafraichir, publicationId, null, 0, nbElements, sequenceur);
}
/** Cette méthode est un "wrapper" */
public void selectionnerPublicationParNomComplet(Rafraichissable vueARafraichir, String nomComplet) {
selectionnerPublication(vueARafraichir, null, nomComplet, 0, nbElements, null);
}
public void selectionnerPublication(Rafraichissable vueARafraichir, String publicationId, String nomComplet, int pageCourante, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner Publication");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerPublication(vueARafraichir, publicationId, nomComplet, pageCourante, nbElements, seqId);
}
public void selectionnerPublication(Rafraichissable vueARafraichir, String recherche, int start, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner Publication");
Integer seqId = null;
if (sequenceur!=null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerPublication(vueARafraichir, recherche, start, nbElements, seqId);
}
/** AJOUTER **/
public void ajouterPublication(Rafraichissable vueARafraichir, Publication publication, Integer seqId) {
modele.ajouterPublication(vueARafraichir, publication, seqId);
}
/** MODIFIER **/
public void modifierPublication(Rafraichissable vueARafraichir, Publication publication, Integer seqId) {
modele.modifierPublication(vueARafraichir, publication, seqId);
}
/** SUPPRIMER **/
public void supprimerPublication(Rafraichissable vueARafraichir, List<Publication> publicationsListe) {
if (publicationsListe != null && publicationsListe.size() > 0) {
String idPublicationSeparesParVirgule = "" ;
Iterator<Publication> it = publicationsListe.iterator();
while (it.hasNext()) {
idPublicationSeparesParVirgule += it.next().getId();
if (it.hasNext()) {
idPublicationSeparesParVirgule += ",";
}
}
modele.supprimerPublication(vueARafraichir, idPublicationSeparesParVirgule);
}
}
public void clicImporterPublication(final PublicationListeVue publiListeVue) {
final FenetreForm fenetre = new FenetreForm(Mediateur.i18nC.importDePubli());
fenetre.add(new PublicationImportForm(this) {
@Override
public void surSoumissionFormulaire(SubmitEvent event) {
afficherPopinChargement();
}
@Override
public void surFormulaireEnvoye(JSONValue responseValue) {
traiterRetourImportFormulaire(responseValue);
publiListeVue.afficherDernierePage();
fenetre.hide();
}
@Override
public void surClicAnnuler() {
fenetre.hide();
}
});
fenetre.setTailleFenetre(75, 300);
fenetre.show();
}
private void traiterRetourImportFormulaire(JSONValue responseValue) {
String message = "";
if(PublicationAsyncDao.importEstUnSucces(responseValue)) {
String nbPubliImportee = PublicationAsyncDao.getNbPublisImportees(responseValue);
int nbPublint = Integer.parseInt(nbPubliImportee);
message = (nbPublint == 1) ? i18nM.retourSuccesImportPublication(nbPubliImportee) :
i18nM.retourSuccesImportPublicationPluriel(nbPubliImportee);
// Tri artificiel par id de publications pour voir apparaître ce qui vient d'être importé
PublicationAsyncDao.tri = "cpu_id_publication";
} else {
message = i18nM.retourEchecImportPublication(PublicationAsyncDao.getErreursImport(responseValue));
}
Window.alert(message);
masquerPopinChargement();
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de la relation PUBLICATION A PERSONNE
 
public void selectionnerPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, String roleId, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner PublicationAPersonne");
Integer seqId = null;
if (sequenceur != null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionPublicationAPersonne(vueARafraichir, publicationId, personnesId, roleId, seqId);
}
public void selectionnerPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, String personnesId, List<Valeur> roleId, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner PublicationAPersonne");
Integer seqId = null;
if (sequenceur != null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
String roleIds = "";
Iterator<Valeur> itRole = roleId.iterator();
while (itRole.hasNext()) {
roleIds+= itRole.next().getId();
if (itRole.hasNext()) {
roleIds+=",";
}
}
modele.selectionPublicationAPersonne(vueARafraichir, publicationId, personnesId, roleIds, seqId);
}
public void selectionnerPublicationsAPersonne(Rafraichissable vueARafraichir, String personneId, List<Valeur> roleId, String recherche, int pageCourante, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner PublicationAPersonne");
Integer seqId = null;
if (sequenceur != null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
String roleIds = "";
Iterator<Valeur> itRole = roleId.iterator();
while (itRole.hasNext()) {
roleIds+= itRole.next().getId();
if (itRole.hasNext()) {
roleIds+=",";
}
}
modele.selectionPublicationsAPersonne(vueARafraichir, personneId, roleIds, recherche, pageCourante, nbElements, seqId);
}
public void selectionnerPersonnesAPublication(Rafraichissable vueARafraichir, String publicationId, String recherche, int pageCourante, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner PublicationAPersonne");
Integer seqId = null;
if (sequenceur != null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionPersonnesAPublication(vueARafraichir, publicationId, recherche, pageCourante, nbElements, seqId);
}
 
/** AJOUTER **/
// Lier une publication à plusieurs personnes
public void ajouterPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, PublicationAPersonneListe personnesAjoutees, String roleId, Integer seqId) {
if (personnesAjoutees != null && personnesAjoutees.size() > 0) {
String idPublicationAPersonneSepareParVirgule = "" ;
String ordreAuteursSepareParVirgule = "";
for (Iterator<String> it = personnesAjoutees.keySet().iterator(); it.hasNext();) {
PublicationAPersonne publi = personnesAjoutees.get(it.next());
idPublicationAPersonneSepareParVirgule += publi.getIdPersonne();
ordreAuteursSepareParVirgule += publi.getOrdreAuteurs();
if (it.hasNext()) {
idPublicationAPersonneSepareParVirgule += ",";
ordreAuteursSepareParVirgule += ",";
}
}
modele.ajouterPublicationAPersonne(vueARafraichir, publicationId, idPublicationAPersonneSepareParVirgule, ordreAuteursSepareParVirgule, roleId, seqId);
}
}
// Lier plusieurs publication à une personne
public void ajouterPublicationAPersonne(Rafraichissable vueARafraichir, PublicationAPersonneListe listePublications, String personneId, String roleId, Integer seqId) {
if (listePublications != null && listePublications.size() > 0) {
String idsPubli = "";
String rolesIds = "";
String ordreAuteurs = "";
for (Iterator<String> it = listePublications.keySet().iterator(); it.hasNext();) {
PublicationAPersonne publiAPersonne = listePublications.get(it.next());
idsPubli += publiAPersonne.getIdPublication();
rolesIds += publiAPersonne.getRole();
ordreAuteurs += publiAPersonne.getOrdreAuteurs();
if (it.hasNext()) {
idsPubli += ",";
rolesIds += ",";
ordreAuteurs += ",";
}
}
modele.ajouterPublicationAPersonne(vueARafraichir, idsPubli, personneId, ordreAuteurs, rolesIds, seqId);
}
}
 
/** MODIFIER **/
public void modifierPublicationAPersonne(Rafraichissable vueARafraichir, String publicationId, PublicationAPersonneListe personnesModifiees, String roleId, Integer seqId) {
if (personnesModifiees != null && personnesModifiees.size() > 0) {
String idPublicationAPersonneSepareParVirgule = "" ;
String ordreAuteursSepareParVirgule = "";
for (Iterator<String> it = personnesModifiees.keySet().iterator(); it.hasNext();) {
PublicationAPersonne publi = personnesModifiees.get(it.next());
idPublicationAPersonneSepareParVirgule += publi.getIdPersonne();
ordreAuteursSepareParVirgule += publi.getOrdreAuteurs();
if (it.hasNext()) {
idPublicationAPersonneSepareParVirgule += ",";
ordreAuteursSepareParVirgule += ",";
}
}
modele.modifierPublicationAPersonne(vueARafraichir, publicationId, idPublicationAPersonneSepareParVirgule, ordreAuteursSepareParVirgule, roleId, seqId);
}
}
/** SUPPRIMER **/
public void supprimerPublicationAPersonne(Rafraichissable vueARafraichir, PublicationAPersonneListe personnesSupprimees) {
if (personnesSupprimees != null && personnesSupprimees.size() > 0) {
String idPublicationAPersonneSepareParVirgule = "" ;
for (Iterator<String> it = personnesSupprimees.keySet().iterator(); it.hasNext();) {
idPublicationAPersonneSepareParVirgule += personnesSupprimees.get(it.next()).getId();
if (it.hasNext()) {
idPublicationAPersonneSepareParVirgule += ",";
}
}
modele.supprimerPublicationAPersonne(vueARafraichir, idPublicationAPersonneSepareParVirgule);
}
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES COMMENTAIRES
//+----------------------------------------------------------------------------------------------------------------+
 
public void afficherListeCommentaire(CommentaireListe nouvelleDonnees) {
if (!(panneauCentre.getContenu() instanceof CommentaireVue)) {
panneauCentre.removeAll();
panneauCentre.add(new CommentaireVue(this));
}
panneauCentre.getContenu().rafraichir(nouvelleDonnees);
}
public void afficherFormCommentaire(String commentaireId) {
final FenetreForm fenetre = new FenetreForm("");
CommentaireForm commentaireForm = new CommentaireForm(this, commentaireId) {
@Override
public void surFermetureFormulaire() {
fenetre.hide();
}
};
commentaireForm.vueExterneARafraichirApresValidation = panneauCentre.getContenu();
fenetre.add(commentaireForm);
fenetre.show();
}
public void clicListeCommentaire(Commentaire commentaire) {
if (commentaire != null) {
panneauCentre.getContenu().rafraichir(commentaire);
}
}
 
public void clicAjouterCommentaire() {
afficherFormCommentaire(null);
}
public void clicModifierCommentaire(List<Commentaire> selection) {
if (selection.size() == 0) {
InfoLogger.display("Information", "Veuillez sélectionner un commentaire.");
} else if (selection.size() > 1) {
InfoLogger.display("Information", "Veuillez sélectionner un seul commentaire à la fois.");
} else if (selection.size() == 1) {
afficherFormCommentaire(selection.get(0).getId());
} else {
InfoLogger.display("Erreur", "Une erreur est survenue dans la méthode clicModifierCommentaire() du Médiateur.");
}
}
public void clicSupprimerCommentaire(final List<Commentaire> commentaireListe) {
if (commentaireListe.size() <= 0) {
MessageBox.alert("Attention", "Vous devez sélectionner un commentaire", null);
} else {
String message = "Voulez-vous vraiment supprimer ces commentaires ?";
if (commentaireListe.size() == 1) {
message = "Voulez-vous vraiment supprimer ce commentaire ?";
}
final Listener<MessageBoxEvent> listenerSuppression = new Listener<MessageBoxEvent>() {
public void handleEvent(MessageBoxEvent ce) {
Dialog dialog = (Dialog) ce.getComponent();
Button btn = ce.getButtonClicked();
if (btn.getHtml().equals(dialog.yesText)) {
supprimerCommentaire(panneauCentre.getContenu(), commentaireListe);
}
}
};
MessageBox.confirm("Supprimer un commentaire", message, listenerSuppression);
}
}
/** Cette méthode est un wrapper **/
public void selectionnerCommentaire(Rafraichissable vueARafraichir, String commentaireId, Sequenceur sequenceur) {
selectionnerCommentaire(vueARafraichir, commentaireId, null, 0, nbElements, sequenceur);
}
public void selectionnerCommentaire(Rafraichissable vueARafraichir, String commentaireId, String titre, int pageCourante, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner Commentaire");
Integer seqId = null;
if (sequenceur != null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerCommentaire(vueARafraichir, commentaireId, titre, pageCourante, nbElements, seqId);
}
public void selectionnerCommentaire(Rafraichissable vueARafraichir, String recherche, int pageCourante, int nbElements, Sequenceur sequenceur) {
if (Mediateur.DEBUG) System.out.println("MEDIATEUR - selectionner Commentaire");
Integer seqId = null;
if (sequenceur != null) {
seqId = sequenceur.lancerRequeteSynchrone(vueARafraichir);
vueARafraichir = sequenceur;
}
modele.selectionnerCommentaire(vueARafraichir, recherche, pageCourante, nbElements, seqId);
}
/** Cette méthode est un wrapper **/
public void selectionnerCommentaireParTitre(Rafraichissable vueARafraichir, String titre, Sequenceur sequenceur) {
selectionnerCommentaire(vueARafraichir, null, titre, 0, nbElements, sequenceur);
}
/** AJOUTER **/
public void ajouterCommentaire(Rafraichissable vueARafraichir, Commentaire commentaire) {
modele.ajouterCommentaire(vueARafraichir, commentaire);
}
/** MODIFIER **/
public void modifierCommentaire(Rafraichissable vueARafraichir, Commentaire commentaire) {
modele.modifierCommentaire(vueARafraichir, commentaire);
}
/** SUPPRIMER **/
public void supprimerCommentaire(Rafraichissable vueARafraichir, List<Commentaire> commentairesListe) {
if (commentairesListe != null && commentairesListe.size() > 0) {
String idCommentaireSeparesParVirgule = "" ;
Iterator<Commentaire> it = commentairesListe.iterator();
while (it.hasNext()) {
idCommentaireSeparesParVirgule += it.next().getId();
if (it.hasNext()) {
idCommentaireSeparesParVirgule += ",";
}
}
modele.supprimerCommentaire(vueARafraichir, idCommentaireSeparesParVirgule);
modele.supprimerCollectionACommentaire(vueARafraichir, idCommentaireSeparesParVirgule, CollectionACommentaireAsyncDao.SUPPRESSION_PAR_COMMENTAIRE);
}
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION DES STATS
//+----------------------------------------------------------------------------------------------------------------+
public void afficherStats() {
if (!(panneauCentre.getContenu() instanceof StatistiquesVue)) {
panneauCentre.removeAll();
panneauCentre.add(new StatistiquesVue(this));
}
}
//+----------------------------------------------------------------------------------------------------------------+
// RAFRAICHISSEMENT
//+----------------------------------------------------------------------------------------------------------------+
public void rafraichir(Object nouvellesDonnees) {
//Coel.LogVersFirebug("rafraichit mediateur");
if (nouvellesDonnees instanceof Utilisateur) {
Utilisateur infoUtil = (Utilisateur) nouvellesDonnees;
//Coel.LogVersFirebug("Licence dans util : " + infoUtil.avoirLicenceAcceptee());
//Coel.LogVersFirebug("Licence dans util : " + infoUtil.getLicence());
if (infoUtil.getLicence().equals("0")) {
this.afficherFenetreLicence(this.fenetreIdentification);
} else {
repandreEtatIdentification(infoUtil);
}
} else if (nouvellesDonnees instanceof Information) {
Information info = (Information) nouvellesDonnees;
if (info.getType().equals("modification_personne")) {
repandreInfoMiseAJourUtilisateur();
}
} else {
GWT.log(i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
}
}
//+----------------------------------------------------------------------------------------------------------------+
// GESTION du STATUT
//+----------------------------------------------------------------------------------------------------------------+
public void afficherPopinChargement() {
((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).center();
}
public void masquerPopinChargement() {
((PopupChargement) Registry.get(RegistreId.POPUP_CHARGEMENT)).hide();
}
public String obtenirClasseContenu() {
String classeContenu = null;
if (panneauCentre.getContenu() != null) {
classeContenu = panneauCentre.getContenu().getClass().toString();
}
return classeContenu;
}
 
//+----------------------------------------------------------------------------------------------------------------+
// GESTION de l'HISTORIQUE du navigateur
//+----------------------------------------------------------------------------------------------------------------+
/**
* Encore une bonne bouse sidérale codée avec les pieds dans le plâtre
* @param event
*/
@Override
public void onValueChange(ValueChangeEvent<String> event) {
String token = event.getValue();
//Coel.LogVersFirebug("--changement d'URL; token : [" + token + "]");
if (token != null) {
// QUI met des "?" après des "#" ?? Méfions-nous tout de même, si ça
// y était, y a probablement une raison (mode naïf)
if (token.lastIndexOf("?") != -1) {
token = token.substring(0, token.lastIndexOf("?"));
//Coel.LogVersFirebug("token sans le ? : [" + token + "]");
}
// "chemin" : #TypeEntité/ID_Entité/action
String[] rondelles = token.split("/");
//Coel.LogVersFirebug(rondelles);
// type d'entité mentionné ?
if (rondelles != null && rondelles.length > 0) {
String typeEntite = rondelles[0];
// @TODO vérifier la validité du type, et par défaut ne rien faire
//Coel.LogVersFirebug("=> on va dans [" + typeEntite + "]");
codeMenuPrecedent = typeEntite;
// Si on a un ID d'entité à pointer
if (rondelles.length > 1) {
String idEntite = rondelles[1];
//Coel.LogVersFirebug("=> on sélectionne [" + idEntite + "]");
// On sélectionne l'entité demandée, si elle existe
this.clicMenu(typeEntite);
} else {
// On se rend juste dans le menu du type d'entité demandé
this.clicMenu(typeEntite);
}
}
if (rondelles != null && rondelles.length > 2) {
String action = rondelles[2];
//Coel.LogVersFirebug("=> on exécute l'action [" + action + "]");
// On se rend dans le menu du type d'entité demandé
// -- bonjour l'angoisse pour faire ça (2/2)
// => attendre le callback des WS pour le faire :'(
}
this.requeteUrl = null; // à quoi sert ce truc ?
}
}
private void analyseRequeteURL() {
String[] params = requeteUrl.split("&");
for (int i = 0; i < params.length; i++) {
if (params[i].startsWith("logLevel=")) {
String logLevel = params[i].replaceFirst("^logLevel=", "");
Log.setNiveau(logLevel);
}
}
}
}
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.6-muscardin/src/org/tela_botanica/client/Mediateur.java:r1816-1817
Merged /trunk/src/org/tela_botanica/client/Mediateur.java:r11-59,1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client/Mediateur.java:r1383-1511
Merged /branches/v1.0-syrah/src/org/tela_botanica/client/Mediateur.java:r1136-1368
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/ComposantId.java
New file
0,0 → 1,34
package org.tela_botanica.client;
 
public final class ComposantId {
public static final String BTN_PARAMETRES = "coel-id-btn-parametres";
public static final String BTN_CONNEXION = "coel-id-btn-connexion";
public static final String BTN_DECONNEXION = "coel-id-btn-deconnexion";
public static final String BTN_AIDE = "coel-id-btn-aide";
public static final String MENU_DOC = "coel-id-menu-doc";
public static final String MENU_APROPOS = "coel-id-menu-apropos";
public static final String BTN_FEEDBACK = "coel-id-menu-feedback";
public static final String MENU_BOGUE = "coel-id-menu-bogue";
public static final String MENU_COMMENTAIRE = "coel-id-menu-commentaire";
public static final String MENU_CONTACT = "coel-id-menu-contact";
public static final String BTN_APPLIS = "coel-id-btn-applis";
public static final String MENU_CEL = "coel-id-menu-cel";
public static final String PANNEAU_AIDE = "coel-id-panneau-aide";
public static final String PANNEAU_FORM_PUBLICATION = "coel-id_panneau-form-publication";
public static final String PANNEAU_ENTETE = "coel-entete";
public static final String PANNEAU_CENTRE = "coel-panneau-centre";
public static final String DIV_TITRE = "coel-titre";
public static final String DIV_IDENTIFICATION = "coel-identification";
public static final String DIV_IDENTIFICATION_MSG = "coel-identification-zone-msg";
public static final String PANNEAU_STATUT = "coel-statut";
public static final String ZONE_DETAIL_ENTETE = "coel-detail-entete";
public static final String ZONE_DETAIL_CORPS = "coel-detail-corps";
public static final String PANNEAU_PUBLICATION_LISTE = "coel-id_panneau-liste-publication";
public static final String PANNEAU_PERSONNE_LISTES = "coel-id_panneau-liste-personne";
public static final String PANNEAU_TUTORIEL = "coel-id-panneau-tutoriel";
public static final String MENU_STATS = "coel-panneau-onglets-statistiques";
public static final String PANNEAU_STATS = "coel-id-panneau-statistiques";
public static final String PANNEAU_NAVIGATION = "coel-panneau-onglets-navigation";
}
/tags/v1.11-okuzgozu/src/org/tela_botanica/client/Coel.java
New file
0,0 → 1,103
package org.tela_botanica.client;
 
import com.extjs.gxt.ui.client.GXT;
import com.extjs.gxt.ui.client.state.StateManager;
import com.extjs.gxt.ui.client.state.Provider;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
 
public class Coel implements EntryPoint {
 
public void onModuleLoad() {
// A décommenter + compiler en detailed dans le cas d'une erreur
// survernant uniquement sur le serveur
/*GWT.setUncaughtExceptionHandler(null);
GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
@Override
public void onUncaughtException(Throwable e) {
Window.alert("uncaught: " + e.getMessage());
String s = buildStackTrace(e, "RuntimeException:\n");
Window.alert(s);
e.printStackTrace();
}
});*/
// Fermeture du panneau de chargement de l'appli
GXT.hideLoadingPanel("loading");
// Création du médiateur
new Mediateur();
 
// Gestionnaire d'état : remplacement du CookieProvider qui pose 400 000 000 de cookies
// moisis jusqu'à dépasser la taille max de l'entête HTTP - encore un truc inventé par
// un génie - par un faux provider qui ne fait rien
Provider jAimeBienLesCourgettes = new Provider() {
@Override
protected void setValue(String name, String value) {
Coel.LogVersFirebug("miam");
}
@Override
protected String getValue(String name) {
Coel.LogVersFirebug("burp");
return null;
}
@Override
protected void clearKey(String name) {
Coel.LogVersFirebug("prout");
}
};
StateManager.get().setProvider(jAimeBienLesCourgettes);
// Si activation du mode débug
if (Mediateur.DEBUG) {
System.out.println("");
System.out.println("-------------------------------------------------------------------");
System.out.println("");
}
}
/*private String buildStackTrace(Throwable t, String log) {
if (t != null) {
log += t.getClass().toString();
log += t.getMessage();
//
StackTraceElement[] stackTrace = t.getStackTrace();
if (stackTrace != null) {
StringBuffer trace = new StringBuffer();
for (int i = 0; i < stackTrace.length; i++) {
trace.append(stackTrace[i].getClassName() + "." + stackTrace[i].getMethodName() + "("
+ stackTrace[i].getFileName() + ":" + stackTrace[i].getLineNumber());
}
log += trace.toString();
}
//
Throwable cause = t.getCause();
if (cause != null && cause != t) {
log += buildStackTrace(cause, "CausedBy:\n");
}
}
return log;
}*/
 
public static native void LogVersFirebug(Object o) /*-{
if (!!($wnd.console && $wnd.console.log)) {
console.log(o);
}
}-*/;
 
/**
* Envoie la trace de pile d'une exception dans FeuInsecte histoire de savoir un peu ce
* qui se passe sans avoir besoin d'installer un plugin tout fané qui existe même plus
*/
public static void traceDePile(Exception e) {
String cacaDePoulet = "";
for (StackTraceElement element : e.getStackTrace()) {
cacaDePoulet += " " + element + "\n";
}
Coel.LogVersFirebug(cacaDePoulet);
}
}
Property changes:
Added: svn:keywords
+Revision GlobalRev
\ No newline at end of property
/tags/v1.11-okuzgozu/src/org/tela_botanica/client
New file
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.6-muscardin/src/org/tela_botanica/client:r1816-1817
Merged /trunk/src/org/tela_botanica/client:r1209-1382
Merged /branches/v1.1-aramon/src/org/tela_botanica/client:r1383-1511
Merged /branches/v1.9-nebbiolo/src/org/tela_botanica/client:r1904
Merged /branches/v1.0-syrah/src/org/tela_botanica/client:r1136-1208
Merged /branches/v1.8-narince/src/org/tela_botanica/client:r1891-1892
/tags/v1.11-okuzgozu/src/org/tela_botanica/public/gxt
New file
0,0 → 1,0
link /home/mathias/src/gwt/gxt/gxt-2.2.5/resources
Property changes:
Added: svn:special
+*
\ No newline at end of property
/tags/v1.11-okuzgozu/src
New file
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.9-nebbiolo/src:r1904
Merged /branches/v1.0-syrah/src:r1136-1208
Merged /branches/v1.8-narince/src:r1891-1892
Merged /branches/v1.6-muscardin/src:r1816-1817
Merged /trunk/src:r1209-1382
Merged /branches/v1.1-aramon/src:r1383-1416
/tags/v1.11-okuzgozu/war/documents/import_publications.csv
New file
0,0 → 1,0
editeur;intitule_revue;serie_tome;fascicule;annee;pages;titre;auteur;mots_cles
/tags/v1.11-okuzgozu/war/info.php
New file
0,0 → 1,0
<?php phpinfo();?>
/tags/v1.11-okuzgozu/war/Coel.html
New file
0,0 → 1,65
<!doctype html>
<!-- Garder la déclaration HTML 4.01 Transitional DOCTYPE car la standard peut engendrer des différences d'affichage. -->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 
<!-- OpenGraph pour Facebook, Pinterest, Google+ -->
<meta property="og:type" content="website" />
<meta property="og:title" content="Collections en Ligne" />
<meta property="og:site_name" content="Tela Botanica" />
<meta property="og:description" content="Recensement interactif des herbiers" />
<meta property="og:image" content="http://resources.tela-botanica.org/tb/img/256x256/carre_englobant.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="256" />
<meta property="og:image:height" content="256" />
<meta property="og:locale" content="fr_FR" />
 
<meta name="gwt:property" content="locale=fr">
 
<title>Coel</title>
<!-- Fichier CSS spécifique à GXT -->
<link rel="stylesheet" type="text/css" href="gxt/css/gxt-all.css" />
<!-- Fichier CSS spécifique à l'application -->
<link rel="stylesheet" type="text/css" href="Coel.css" />
 
<!-- Fichier JS de configuration spécifique à l'application -->
<script type="text/javascript" language="javascript" src="config/config.js"></script>
<script type="text/javascript" language="javascript" src="config/apropos.js"></script>
 
<!-- Le script ci-dessous charger vos modules compilés. Ajoutez les méta-tags GWT avant cette ligne. -->
<script type="text/javascript" language="javascript" src="coel/coel.nocache.js"></script>
 
<!-- Grogle Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-57885-3', 'auto');
ga('send', 'pageview');
</script>
</head>
 
<!-- Le corps peut contenir du HTML ou peut rester vide si vous voulez créer une UI complêtement dynamique -->
<body>
<div id="loading">
<div class="loading-indicator">
<img src="images/large-loading.gif" width="32" height="32" style="margin-right:8px;float:left;vertical-align:top;"/>
<script type="text/javascript" language="javascript">document.write(apropos.appliCode+' v'+apropos.appliVersionCode+' - '+apropos.appliVersionNom);</script><br />
<span id="loading-msg">Chargement de l'application <script type="text/javascript" language="javascript">document.write(apropos.appliNom);</script>...</span>
<noscript>
<p>
<span class="attention">ATTENTION : </span>
il semblerait que le Javascript ne soit pas activé sur votre navigateur.
Veuillez l'activer pour utiliser cette application.
</p>
</noscript>
</div>
</div>
<!-- OPTIONAL: inclure la ligne ci-dessous si vous utilisez le supprot de l'historique du navigateur -->
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
<!-- OPTIONEL: inclure la ligne ci-dessous si vous utilisez la classe org.tela_botanica.coel.util.print -->
<iframe id="__printingFrame" style="width:0;height:0;border:0"></iframe>
</body>
</html>
/tags/v1.11-okuzgozu/war/config/apropos.js.m4
New file
0,0 → 1,26
dnl /* eg: m4 -D _JREST_SERVICES_PATH_=../../jrest/services -D _SUFFIX_=" - beta" < apropos.js.m4 */
ifdef(`_JREST_SERVICES_PATH_', `', `define(`_JREST_SERVICES_PATH_', `../../jrest/services')')dnl
ifdef(`_SUFFIX_', `', `define(`_SUFFIX_')')dnl
define(`_NAME_', `Collections En Ligne'_SUFFIX_)dnl
define(`_DATE_', `esyscmd(date|tr -d "\n")')dnl
define(`_JAVA_VERSION_', esyscmd(java -version 2>&1|sed -e 's/\"//g' -e :a -e '/$/N; s/\n/ - /; ta'|tr -d "\n"))dnl
define(`_SVN_REV_', esyscmd(svnversion -n))dnl
define(`_SVN_VERSION_NAME_', esyscmd(svn info|sed -nr '/^URL.*\/branches\//s;.*/branches/([^/]+)$;\1;p'|tr -d "\n"))dnl
define(`_SVN_VERSION_', patsubst(_SVN_VERSION_NAME_, `^v\(.*\)-.*', `\1'))dnl
define(`_SVN_NAME_', patsubst(_SVN_VERSION_NAME_, `^.*-\(.*\)', `\1'))dnl
define(`_SVN_SERVICES_REV_', esyscmd(`svnversion -n '_JREST_SERVICES_PATH_))dnl
ifdef(`_SVN_VERSION_NAME_', `', `define(`_SVN_NAME_', trunk)')dnl
var apropos = {
appliNom:"_NAME_",
appliCode:"COEL",
appliVersionCode:"_SVN_VERSION_",
appliVersionNom:"_SVN_NAME_",
developpeurs:"Jean-Pascal MILCENT, Grégoire DUCHÉ, Aurélien PERONNET, Raphaël Droz",
traducteurs:"",
testeurs:"Louise BOULANGEAT, Andrine FAURE, Véronique SCHÄFER, Danièle DOMEYNE",
licence:"GPL v3 et CECILL v2",
dateHeureCompilation:"_DATE_",
revisionGlobale:"_SVN_REV_",
revisionGlobaleServices:"_SVN_SERVICES_REV_",
versionJavaCompilation:"_JAVA_VERSION_"
};
/tags/v1.11-okuzgozu/war/config/config.defaut.js
New file
0,0 → 1,130
var configuration = {
serviceBaseUrl:"http://www.tela-botanica.org/eflore/coel/jrest/",
serviceAuthBaseUrl:"https://www.tela-botanica.org/service:annuaire:auth/",
bogueUrl:"http://www.tela-botanica.net/suivi/index.php?project=31",
commentaireUrl:"http://www.tela-botanica.org/wikini/eflore/wakka.php?wiki=AideCoelCommentaire",
celUrl:"http://www.tela-botanica.org/appli:cel",
remarquesUrl:"http://www.tela-botanica.org/widget:reseau:remarques",
consultationCollectionsLieesStructuresUrl:"http://localhost/coel-consultation/urn:lsid:tela-botanica.org:coel:str{str_id}#col-str-collection",
consultationCollectionsUrl: "http://localhost/coel-consultation/urn:lsid:tela-botanica.org:coel:col{col_id}",
// liste 09 : Liste des fonctions d'une personne au sein d'une structure
listeFonction:1012,
// liste 10 : Liste des statuts d'une personne au sein d'une structure
listeStatut:1013,
// liste 12 : Liste des types de structure privé
listeStpr:1015,
// liste 13 : Liste des types de structure public
listeStpu:1016,
// liste 14 : Liste des identifiants alternatifs de structures à vocation botanique
listeAcronymeBota:1017,
// liste 15 : Liste des types de local de stockage de collections
listeStockageLocal:1018,
// liste 16 : Liste des types de mobilier de stockage de collections
listeStockageMeuble:1019,
// liste 17 : Liste des paramètres de contrôle environnemental d'un local
listeStockageParametre:1020,
// liste 18 : Liste des types de collection non botanique
listeCollectionAutre:1021,
// liste 19 : Liste des types d'opération de restauration pour les collections botaniques
listeRestaurationOperation:1022,
// liste 20 : Liste oui/non/en partie
listeONEP:1023,
// liste 21 : Liste du matériel dit de nom conservation des parts d'herbier
listeMaterielAutre:1024,
// liste 22 : Liste de traitement anti-insecte pour les collections botaniques
listeDesinsectisation:1025,
// liste 23 : Liste des poisons utilisés pour les collections botaniques
listeEmpoisonnement:1026,
// liste 24 : Liste des actions de valorisation des collections
listeValorisationAction:1027,
// liste 25 : Liste des continents habités incluant aussi le pays France
listeContinentEtFr:1028,
// liste 26 : Liste des types de recherche nécessitant la consultation de collection botanique
listeRechercheType:1029,
// liste 27 : Liste des relations entre une collection et une personne
listeRelationPersonneCollection:1030,
// liste 29 : Liste des types de collection dans le standard NCD
listeTypeCollectionNcd:1032,
// liste 30 : Liste des types de dépôt de collection
listeTypeDepot:1033,
// liste 31 : Liste des principes de groupement d'une collection dans le standard NCD
listeGroupementPrincipe:1034,
// liste 32 : Liste des buts de réalisation d'une collection dans le standard NCD
listeRealisationBut:1035,
// liste 37 : Liste des siècles pour les collections naturalistes
listeSiecleNaturaliste:1040,
// liste 38 : Liste indéterminé/peut-être/oui/non
listeONPI:1041,
// liste 39 : Liste des types de classement des spécimens types dans une collection
listeTypeClassement:1042,
// liste 40 : Liste des natures végétales
listeNatureVegetale:1043,
// liste 41 : Liste des types d'unité de rangement pour les collections botaniques
listeTypeUniteRangement:1044,
// liste 42 : Liste des états
listeEtat:1045,
// liste 43 : Liste des types de support pour les spécimens des collections botaniques
listeTypeUniteBase:1046,
// liste 44 : Liste des types de papier de support pour les spécimens des collections botaniques
listeTypePapier:1047,
// liste 45 : Liste des méthodes de rangement des supports pour les spécimens des collections botaniques
listeMethodeRangement:1048,
// liste 46 : Liste des méthodes de fixation sur le support pour les collections botaniques
listeMethodeFixation:1049,
// liste 47 : Liste des méthodes de fixation des étiquettes sur les spécimens pour les collections botaniques
listeMethodeFixationSurSpecimen:1050,
// liste 48 : Liste des types d'écriture d'étiquette
listeTypeEcriture:1051,
// liste 49 : Liste des origines des dégradations des spécimens de collections botaniques
listeSpecimenDegradation:1052,
// liste 50 : Liste des origines des dégradations des supports de collections botaniques
listeSupportDegradation:1053,
// liste 51 : Liste des niveaux de détermination des spécimens de collections botaniques
listeNiveauDetermination:1054,
// liste 52 : Liste des types de date de début
listeDateDebut:1055,
// liste 53 : Liste des types de date de fin
listeDateFin:1056,
// liste 54 : Liste des états de classement
listeEtatClassement:1057,
// liste 57 : Liste indéterminé/parfois/oui/non
listeONP:1060,
// liste 58 : Liste des formes d'inventaire
listeInventaireForme:1061,
// liste 59 : Liste des types de logiciel pour les inventaires informatiques
listeInventaireLogiciel:1062,
// liste 60 : Liste des états d'inventaire
listeInventaireEtat:1063,
// liste 65 : Liste des types de commentaires associés à une collection
listeTypeCommentaireCollection:1068,
// liste 71 : Liste des pays du standard ISO-3166-1
listePays:1074,
// liste 77 : Liste indéterminé/oui/non
listeION:1080,
// liste 78 : Liste des niveaux d'importance
listeNiveauImportance:1081,
// liste 79 : Liste exact/approximatif
listeEA:1082,
// liste 80 : Liste des types de collection botanique
listeTypeCollectionBota:1083,
// Liste des préfixes
listePrefixes:1004,
// Liste des suffixes
listeSuffixes:1005,
// Liste sexe:
listeSexe:1067,
// Liste tel:
listeTel:1007,
// Liste régions
listeRegions:1078,
// Liste des langues
listeLangues:1071,
// Liste des durées d'indexation
listeDureesIndexation:1072,
// Liste des fréquences d'indexation
listeFrequencesIndexation:1073,
// Liste des types de publication vis à vis d'une personne
relationPersonnePublication:1065,
//Nombre d'éléments par page
nbElementsPage:50
};
/tags/v1.11-okuzgozu/war/config
New file
Property changes:
Added: svn:ignore
+apropos.js
+config.js
/tags/v1.11-okuzgozu/war/images/bg/hd-bg.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/war/images/bg/hd-bg.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/war/images/large-loading.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/tags/v1.11-okuzgozu/war/images/large-loading.gif
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/tags/v1.11-okuzgozu/war/images/icones/avertissement.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/war/images/icones/avertissement.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/war/images/icones/lien_externe.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
/tags/v1.11-okuzgozu/war/images/icones/lien_externe.png
New file
Property changes:
Added: svn:mime-type
+image/png
\ No newline at end of property
/tags/v1.11-okuzgozu/war/WEB-INF/lib
New file
Property changes:
Added: svn:ignore
+gwt-servlet.jar
/tags/v1.11-okuzgozu/war/WEB-INF/web.xml
New file
0,0 → 1,9
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
 
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>Coel.html</welcome-file>
</welcome-file-list>
 
</web-app>
/tags/v1.11-okuzgozu/war/WEB-INF
New file
Property changes:
Added: svn:ignore
+classes
+deploy
/tags/v1.11-okuzgozu/war/Coel.css
New file
0,0 → 1,284
/** Les CSS de l'application COEL */
*{
margin:0;
padding:0;}
/* #------------------------------------------------------------------------------------------------------# */
/* CHARGEMENT APPLICATION */
/* #------------------------------------------------------------------------------------------------------# */
#loading{
position:absolute;
left:45%;
top:40%;
margin-left:-45px;
padding:2px;
z-index:20001;
height:auto;
border:1px solid #ccc;
width:400px;}
#loading a{
color:#225588;}
#loading .loading-indicator{
background:white;
color:#444;
font:bold 13px tahoma, arial, helvetica;
padding:10px;
margin:0;
height:auto;}
#loading .loading-indicator img{
margin-right:8px;
float:left;
vertical-align:top;}
#loading-msg{
font:normal 10px arial, tahoma, sans-serif;}
/* #------------------------------------------------------------------------------------------------------# */
/* GÉNÉRAL */
/* #------------------------------------------------------------------------------------------------------# */
.attention{
font:bold 14px;
color:red;}
.coel-label{
font-weight:bold;
line-height:18px;}
.coel-fieldset{
float:left;
padding:5px;
width:45%;}
.coel-clear{
clear:both;
line-height:0;
border:none;
width:0;/*Pour IE*/}
.coel-meta{
font-size:10px;
font-weight:normal;}
.coel-indentation{
padding-left:15px;}
a.coel-lien-externe:after{
content:" " url(images/icones/lien_externe.png);}
#coel-panneau-onglets-navigation ul {
width: 100%;
}
 
#ListeOngletsNavigation__Statistiques {
float: right;
margin-right: 3px;
}
 
#ListeOngletsNavigation > div {
width: 100% !important;
}
 
.coel-detail-corps-contenu th.coel-largeur-colonne-id {
width: 5%;
}
 
.coel-indication-titre-petit {
font-size : 0.8em;
}
 
/* #------------------------------------------------------------------------------------------------------# */
/* ENTÊTE */
/* #------------------------------------------------------------------------------------------------------# */
#coel-entete{
color:white;
height:100px;
background:#1E4176 url(images/bg/hd-bg.png) repeat-x scroll 0pt;
border:0pt none;
padding-left:3px;}
#coel-titre{
font-family:tahoma, arial, sans-serif;
font-size:16px;
font-size-adjust:none;
font-stretch:normal;
font-style:normal;
font-variant:normal;
font-weight:normal;
line-height:normal;
padding:0 0 8 6px;}
#coel-identification{
color:white;
float:right;
margin:2 5 0 0px}
/* #------------------------------------------------------------------------------------------------------# */
/* AIDE */
/* #------------------------------------------------------------------------------------------------------# */
#coel-id-panneau-aide{
font-size:11px;
margin:5px;}
#coel-id-panneau-aide ul{
list-style-type:disc;
padding-left:15px;}
#coel-id-panneau-aide ol{
list-style-type:decimal;
padding-left:15px;}
/* #------------------------------------------------------------------------------------------------------# */
/* CONNEXION/DECONNEXION */
/* #------------------------------------------------------------------------------------------------------# */
#coel-identification-zone-msg{
text-align:center;
background-color:#F8B9B9;
border:1px solid red;
margin:5px 0;}
/* #------------------------------------------------------------------------------------------------------# */
/* PANNEAU DÉTAIL */
/* #------------------------------------------------------------------------------------------------------# */
#coel-detail-entete{
height:45px;
background-color:#ddd;
border-bottom:1px solid silver;}
 
#coel-detail-entete h1{
font-weight:bold;
font-size:12px;
padding:5 0 2 5px;}
#coel-detail-entete h2{
font-size:11px;
font-weight:normal;
padding:0 5 0 5px;}
#coel-detail-entete .coel-meta{
position:absolute;
top:0;
right:0;
padding:5px;}
 
.coel-detail-corps-contenu{
padding:0 12px;
background-color:white;}
.coel-detail-corps-contenu h2{
font-size:14px;
color:#1C3C78;
padding:12px 0 5px 0;}
.coel-detail-corps-contenu h3{
font-style:italic;
padding:12px 0 5px 0;}
.coel-detail-corps-contenu table{
border:1px solid #1C3C78;
border-collapse:collapse;
width:100% !important;width:95%;/*Pour IE*/
margin:auto;}
.coel-detail-corps-contenu thead, .coel-detail-corps-contenu tfoot{
background-color:#D0E3FA;
background-image:url(sky.jpg);
border:1px solid #1C3C78;}
.coel-detail-corps-contenu tbody{
background-color:#FFFFFF;
border:1px solid #1C3C78;}
.coel-detail-corps-contenu th{
font-family:monospace;
border:1px dotted #1C3C78;
padding:5px;
background-color:#EFF6FF;
width:25%;}
.coel-detail-corps-contenu td{
font-family:sans-serif;
font-size:80%;
border:1px solid #1C3C78;
padding:5px;
text-align:left;}
.coel-detail-corps-contenu caption{
font-family:sans-serif;}
 
.coel-detail-corps-contenu ul{
list-style-type:disc;}
.coel-detail-corps-contenu li{
margin-left:25px;
padding:2px;}
 
#personne-logo-div {
position:absolute;
right:0;
width:30%;
text-align:right;
}
 
#personne-logo-div img {
height:40px;
}
/* #------------------------------------------------------------------------------------------------------# */
/* ÎCONES */
/* #------------------------------------------------------------------------------------------------------# */
.no-icone{
padding:0;}
/* #------------------------------------------------------------------------------------------------------#*/
/* IMAGES */
/* #------------------------------------------------------------------------------------------------------#*/
.conteneur-image-centre{
text-align:center;}
.logo-personne{
max-height:250px;}
/* #----------------------------------------------------------------------------------------------------------#*/
/* PANNEAU PUBLICATION */
/* #----------------------------------------------------------------------------------------------------------#*/
 
.x-formulaire-auteur{
padding-left:100px;}
.x-formulaire-auteur-label{
padding:3px 0 !important;
text-align:left;
clear:left;
display:block;
float:left;
padding:3px 3px 3px 0;
position:relative;
width:100px;
z-index:2;
font-weight:bold;
font-family:tahoma,arial,helvetica,sans-serif;
font-size:12px;
font-size-adjust:none;
font-style:normal;
font-variant:normal;
line-height:normal;}
#indication_import_csv {
font-size: 1.1em;
margin: 1px 3px 3px 5px;
}
 
#infos-auteurs-non-presents {
background-image: url("images/icones/avertissement.png");
background-repeat: no-repeat;
background-position: 5px 10px;
padding-left: 30px;
}
 
#label-auteurs-non-presents {
font-weight: bold;
}
 
/* #----------------------------------------------------------------------------------------------------------#*/
/* AUTRES */
/* #----------------------------------------------------------------------------------------------------------#*/
#main-button button{
font-weight:bold;
text-decoration:underline;}
.champNombreFormat {
margin-right: 5px;
margin-bottom: 5px;
}
 
.labelChampNombreFormat {
font: 12px tahoma,arial,helvetica,sans-serif;
display: inline-block;
margin-top: 2px;
width: 255px;
}
 
.labelChampNombreFormat::after {
content: ":";
}
 
.textAreaAutreUniteRangement textarea {
width: 400px !important;
}
 
/* #----------------------------------------------------------------------------------------------------------#*/
/* FORMULAIRE */
/* #----------------------------------------------------------------------------------------------------------#*/
.coel-obligatoire, .coel-obligatoire input, .coel-obligatoire textarea{
background:#FAA391;}
.coel-obligatoire-ok, .coel-obligatoire-ok input, .coel-obligatoire-ok textarea {
background:#B7DAAA;}
/tags/v1.11-okuzgozu/war/index.html
New file
0,0 → 1,8
<html>
<head>
<title>Redirection en htm</title>
<meta http-equiv="refresh" content="0;url=Coel.html" />
</head>
<body>
</body>
</html>
/tags/v1.11-okuzgozu/war/.htaccess
New file
0,0 → 1,10
#AddHandler x-httpd-php5 .php
AddDefaultCharset UTF-8
 
# Gestion du cache pour les fichiers GWT
<Files *.nocache.*>
ExpiresDefault "access"
</Files>
<Files *.cache.*>
ExpiresDefault "now plus 1 year"
</Files>
/tags/v1.11-okuzgozu/war
New file
Property changes:
Added: svn:ignore
+coel
+coel-test
+apropos.js
+gxt
+config.js
/tags/v1.11-okuzgozu
New file
Property changes:
Added: svn:mergeinfo
Merged /branches/v1.2-mourvedre:r1740
Merged /branches/v1.6-muscardin:r1816-1817,1836,1838
Merged /trunk:r1209-1382
Merged /branches/v1.1-aramon:r1383-1416
Merged /branches/v1.10-negrette:r1931,1933
Merged /branches/v1.4-muscadelle:r1777
Merged /branches/v1.9-nebbiolo:r1904
Merged /branches/v1.7-muscat:r1848
Merged /branches/v1.0-syrah:r1136-1179
Merged /branches/v1.8-narince:r1891-1892,1894
Added: svn:ignore
+tomcat
+bin
+www-test
+.gwt-tmp
+.gwt
+.settings
+.classpath
+.project
+gwt-unitCache
+buildMathias.xml
+.buildpath