Déclarer ce nouveau critère dans le fichier search-engine-config.xml
Dans le fichier properties/search-engine-config-cdmfr-2012-rof-3.10Xml, ajouter le nouvel index :
<search-engine>
<folder identFolder="/CDM/program[1]/@id">
[…]
<!-- Ajout Critère de recherche = Thematique de la mention -->
<index name="thematiqueMention"
terms="/CDM/program[@mention='true']/habilitation/field/fieldName/free/text/text()"
keyword="true" />
</communs-indexes>
<languages defaultLang="fr">
<language name="fr">
[...]
<sort>
[...]
<by index="thematiqueMention" />
</sort>
</language>
<languages defaultLang="en">
<language name="en">
[...]
<sort>
[...]
<by index="thematiqueMention" />
</sort>
</language>
[...]
Alimenter la liste déroulante de la nouvelle recherche
Pour cela, alimenter le fichier initdb/constantes.xml :
On aurait pour cet exemple :
[...]
<thematiqueMention>
<data id="SAPAS" import="SAPAS">
<value lang="fr-FR">ACTIVITÉ PHYSIQUE ADAPTÉE ET SANTÉ</value>
</data>
<data id="DAENT" import="DAENT">
<value lang="fr-FR">ADMINISTRATION DES ENTREPRISES</value>
</data>
<data id="DAES" import="DAES">
<value lang="fr-FR">ADMINISTRATION ECONOMIQUE ET SOCIALE</value>
</data>
<data id="AAMEO" import="AAMEO">
<value lang="fr-FR">ADMINISTRATION, MANAGEMENT ET ECONOMIE DES ORGANISATIONS</value>
</data>
<data id="DAPUB" import="DAPUB">
<value lang="fr-FR">ADMINISTRATION PUBLIQUE</value>
</data>
<data id="AARCH" import="AARCH">
<value lang="fr-FR">ARCHEOLOGIE</value>
</data>
<data id="AARTS" import="AARTS">
<value lang="fr-FR">ARTS</value>
</data>
[...]
</thematiqueMention>
Insérer le nouveau critère dans l’écran de recherche avancée
Deux fichiers sont à modifier :
- stylesheets/commun/composants/commun/commun.xsl pour ajouter le paramètre du formulaire à récupérer :
<xsl:param name="thematiqueMention" />
- stylesheets/commun/composants/rechercheAvancee.cdmfr.xsl