Intégrer une classification personnalisée dans un formulaire auteur, pour la 'recherche de discipline/taxonomie'.
Autrement dit, remplacer la "Classification 100 Dewey" par une "Classification personnalisée" ; et choisir un id et une entrée dans l'arborescence associée à la classification personnalisée.
Pour illustrer, nous partons de l'exemple d'un formulaire auteur LOMFR, fourni par l'Université de Rennes 2.
Nous allons remplacer dans ce formulaire, la "Classification 100 Dewey" par la classification nommée "Classification UHB".
$EDITOR-HOME = ori-oai-md-editor-svn/WEB-INF/resources/forms/ori-md-editor/
$VOCAB_HOME = ori-oai-vocabulary-svn/conf/properties/
Contenu configuré dans $EDITOR-HOME/lomfr-author-rennes-2/.
Patron de fiche configuré dans $EDITOR-HOME/lomfr-author-rennes-2/blank/lomfr-author-rennes2-blank.xml.
Nous nommerons le fichier de ce vocabulaire uhb_taxonomie.xml, par exemple.
Déposer le fichier, selon le cas (voir Implémentation standalone) :
Pour cela, mettre à jour les fichiers common_lom_clas_source.xml et common_lom_clas_taxons.xml, selon le cas (voir Implémentation standalone) :
Y ajouter les lignes suivantes :
<vdex:term> <vdex:termIdentifier>Classification UHB</vdex:termIdentifier> <vdex:caption> <vdex:langstring language="fr">Classification UHB</vdex:langstring> <vdex:langstring language="en">UHB Classification</vdex:langstring> </vdex:caption> </vdex:term> |
Il s'agit de personnaliser la boîte de dialogue proposée quand on clique sur 'Recherche de taxonomie', avec la classification choisie.
<xxforms:dialog id="search-taxonomy-dialog"> par <xxforms:dialog id="dialog-uhbTaxonomie-search"> |
<xxforms:hide ev:event="DOMActivate" dialog="search-taxonomy-dialog"/> par <xxforms:hide ev:event="DOMActivate" dialog="dialog-uhbTaxonomie-search"/> |
Dans $EDITOR-HOME/lomfr-author-rennes-2/form/form.xhtml
Remplacer toutes les chaînes 'Classification Dewey' par 'Classification UHB'.
Remplacer les lignes suivantes en commentant (ou supprimant) celles qui existaient :
<xi:include href="oxf:/forms/ori-md-editor/lomfr-author-light/form/main-model.xml" xxi:omit-xml-base="true"/> par: <xi:include href="oxf:/forms/ori-md-editor/lomfr-author-rennes-2/form/main-model.xml" xxi:omit-xml-base="true"/> |
puis
<xi:include href="oxf:/forms/ori-md-editor/lomfr-author-light/form/content-xforms.xml"/> par: <xi:include href="oxf:/forms/ori-md-editor/lomfr-author-rennes-2/form/content-xforms.xml"/> |
enfin
<xi:include href="oxf:/forms/ori-md-editor/lom-full/form/dialog-dewey-search.xml"/> par: <xi:include href="oxf:/forms/ori-md-editor/lomfr-author-rennes-2/form/dialog-uhbTaxonomie-search.xml"/> |
Dans $EDITOR-HOME/lomfr-author-rennes-2/form/content-xforms.xml
Modifier les lignes suivantes :
<xxforms:show dialog="search-taxonomy-dialog"/> par: <xxforms:show dialog="dialog-uhbTaxonomie-search"/> |
et
<!-- 9 Classifications --> <xforms:group ref="lom:classification[lom:purpose/lom:value='discipline'][lom:taxonPath/lom:source/lom:string='Classification 100 Dewey']/lom:taxonPath"> par: <xforms:group ref="lom:classification[lom:purpose/lom:value='discipline'][lom:taxonPath/lom:source/lom:string='Classification UHB']/lom:taxonPath"> |
Dans $EDITOR-HOME*/lomfr-author-rennes-2/form/main-model.xml*
Remplacer la ligne suivante :
<xforms:instance id="dewey_100" src="/fr/service/custom/ori-md-editor/oriGetVocab?vocab=mdeditor_100_dewey_taxonomie" xxforms:readonly="true" xxforms:cache="true"/> par: <xforms:instance id="uhb_taxonomie" src="/fr/service/custom/ori-md-editor/oriGetVocab?vocab=uhb_taxonomie" xxforms:readonly="true" xxforms:cache="true"/> |
Remplacer la ligne suivante :
<xforms:instance id="i18n_lom_author" src="oxf:/forms/ori-md-editor/common/i18n/mdeditor_categories_author_lomfr.xml" xxforms:readonly="true" xxforms:cache="true"/> par: <xforms:instance id="i18n_lom_author" src="oxf:/forms/ori-md-editor/lomfr-author-rennes-2/i18n/mdeditor_categories_author_lomfr.xml" xxforms:readonly="true" xxforms:cache="true"/> |
Copier $EDITOR-HOME/common/i18n/mdeditor_categories_author_lomfr.xml dans $EDITOR-HOME/lomfr-author-rennes-2/i18n
Ici, on personnalise le libellé à afficher à la place de 'Classification Dewey'.
Pour cela, modifier de la façon suivante :
<vdex:term validIndex="false"> <vdex:termIdentifier>4</vdex:termIdentifier> <vdex:caption> <vdex:langstring language="fr">Classification UHB</vdex:langstring> </vdex:caption> <vdex:description> <vdex:langstring language="fr">Cliquez sur <i>Recherche de taxonomie</i> pour sélectionner une discipline et une sous-discipline. Elle apparaît automatiquement dans le formulaire en cliquant sur le bouton <i>Sélectionner<i> de la fenêtre.<br> Si la ressource appartient à plusieurs domaines, cliquez sur <i>Ajout d'un taxon</i> pour sélectionner une ou plusieurs autres disciplines.</vdex:langstring> </vdex:description> <vdex:metadata> <orioai:alert> ;<vdex:langstring language="fr">Problème</vdex:langstring> <vdex:langstring language="en">Problem</vdex:langstring> </orioai:alert> </vdex:metadata> </vdex:term> |
Dans $EDITOR-HOME*/lomfr-author-rennes-2/blank/{}lomfr-author-rennes2-blank.xml*
Remplacer le contenu de <lom:classification> par :
<lom:classification> <lom:purpose> <lom:source>LOMv1.0</lom:source> <lom:value>discipline</lom:value> </lom:purpose> <lom:taxonPath> <lom:source> <lom:string>Classification UHB</lom:string> </lom:source> <lom:taxon> <lom:id/> <lom:entry> <lom:string language="fre"/> </lom:entry> </lom:taxon> </lom:taxonPath> </lom:classification> |
Module md-editor:
$EDITOR-HOME/common/xml-vocab-local/uhb_taxonomie.xml $EDITOR-HOME/common/xml-vocab-local/common_lom_clas_source.xml $EDITOR-HOME/common/xml-vocab-local/common_lom_clas_taxons.xml $EDITOR-HOME/lomfr-author-rennes-2/form/dialog-uhbTaxonomie-search.xml $EDITOR-HOME/lomfr-author-rennes-2/form/main-form.xhtml $EDITOR-HOME/lomfr-author-rennes-2/form/content-xforms.xml $EDITOR-HOME/lomfr-author-rennes-2/form/main-model.xml $EDITOR-HOME/lomfr-author-rennes-2/i18n/mdeditor_categories_author_lomfr.xml $EDITOR-HOME/lomfr-author-rennes-2/blank/lomfr-author-rennes2-blank.xml |
Module vocabulary:
$VOCAB_HOME /ori_vocabularies/override/uhb_taxonomie.xml $VOCAB_HOME /ori_vocabularies/override/common_lom_clas_source.xml $VOCAB_HOME /ori_vocabularies/override/common_lom_clas_taxons.xml |
Comment partager mes contribitions locales?