Si vous avez adapté/ajouté des formulaires pour vos besoins locaux, ils ne fonctionneront pas avec la version 1.6 de l'édteur : le "moteur" a changé (utilisation de form-runner), et l'architecture du module a aussi évolué pour faciliter la personnalisation des formulaires.
La migration se fera en deux étapes :
Modifier l'arborescence
Voici un exemple de script-shell unix qui récupère les adaptations locales 1.5 ("subversionnées") pour les adapter à l'arborescence 1.6 .
Code Block |
---|
#!/bin/sh # Migration des formulaires sous form-runner # repertoire ori-oai-md-editor 1.5 s=[ORI-HOME]/ori-oai-md-editor-svn/WEB-INF/resources/apps/ori-md-editor # repertoire ori-oai-md-editor 1.6 S=[ORI-HOME]/ori-oai-md-editor-svn/WEB-INF/resources/forms/ori-md-editor mkdir -p $S; svn add --parents $S; cd $s # les prototypes for f in `ls prototypes`; do format=`basename $f | cut -d- -f1`; mkdir -p $S/$format/prototype; svn add --parents $S/$format/prototype; svn mv prototypes/$f $S/$format/prototype/$f; done; # les formulaires for d in `ls xforms|grep -v "common"`; do mkdir -p $S/$d/form; svn add --parents $S/$d/form; svn mv xforms/$d/main-form.xhtml $S/$d/form/form.xhtml; for f in `ls xforms/$d/*.xml 2>/dev/null`; do svn mv $f $S/$d/form/`basename $f`; done; done; mkdir -p $S/common/form; svn add --parents $S/common/form; svn mv xforms/common/*.xml $S/common/form; # les blank for f in `ls xml-blank`; do format=`basename $f | cut -d- -f1`; mkdir -p $S/$format/blank; svn add --parents $S/$format/blank; svn mv xml-blank/$f $S/$format/blank/$f; done; # les bundles i18n mkdir -p $S/common/i18n; svn add --parents $S/common/i18n; for f in `ls i18n/*.xml`; do svn mv $f $S/common/i18n/`basename $f`; done; # les vocabulaires locaux mkdir -p $S/common/xml-vocab-local; svn add --parents $S/common/xml-vocab-local; for f in `ls xml-vocab-local/*.xml`; do svn mv $f $S/common/xml-vocab-local/`basename $f`; done; # les xpl locaux mkdir -p $S/service; svn add --parents $S/service; svn mv xpl/*.xpl $S/service; for f in `ls xpl/*.xpl`; do svn mv $f $S/service/`basename $f`; done; # les medias locaux mkdir -p $S/media; svn add --parents $S/media; for d in `ls media`; do mkdir -p $S/media/$d; svn add --parents $S/media/$d; for f in `ls media/$d`; do svn mv media/$d/$f $S/media/$d/`basename $f`; done; done; |
Il vous reste à modifier le contenu de vos fichiers pour les rendre comptatibles avec form-runner.
Adapter les formulaires locaux à form-runner
Lire les préconisations de l'édteur :
http://www.orbeon.com/orbeon/doc/reference-xforms-extensions#xforms-classic-migration .
Voici listé ici quelques modifications non-exhauxtives :
Code Block |
---|
#!/bin/sh # modification des formulaires pour mise en conformite form-runner # # pour toutes les precisions necessaires, consultez : # http://www.orbeon.com/orbeon/doc/reference-xforms-extensions#xforms-classic-migration S=[ORI-HOME]/ori-oai-md-editor-svn/WEB-INF/resources/forms/ori-md-editor cd $S find . -name "*ml" -exec sed -i 's/main-instance/fr-form-instance/' {} \; find . -name "*ml" -exec sed -i 's/instance-model/fr-form-model/' {} \; find . -name "*ml" -exec sed -i 's/xxforms:shared=\"application\"/xxforms:cache=\"true\"/' {} \; find . -name "*ml" -exec sed -i 's/ori-md-editor\/vocab\//fr\/service\/custom\/ori-md-editor\/oriGetVocab?vocab=/' {} \; find . -name "*ml" -exec sed -i 's/apps\/ori-md-editor\/xforms\/common/forms\/ori-md-editor\/common\/form/' {} \; find . -name "*ml" -exec sed -i 's/apps\/ori-md-editor\/i18n/forms\/ori-md-editor\/common\/i18n/' {} \; find . -name "*ml" -exec sed -i 's/ori-md-editor\/service/fr\/service\/custom\/ori-md-editor/' {} \; find . -name "*ml" -exec sed -i "s/substring-before(xxforms:instance('i18n-choice')\/lang, '_')/xxforms:instance('i18n-choice')\/lang/" {} \; find . -name "*ml" -exec sed -i 's/entity\.xml/form\/entity\.xml/' {} \; find . -name "*ml" -exec sed -i 's/apps\/ori-md-editor\/schemas\/oaidc\/dc.xsd/forms\/ori-md-editor\/oaidc-full\/xsd\/dc.xsd/' {} \; for form in `ls . |grep -v "common"`; do find $form -name "*ml" -exec sed -i 's/href="case/href="oxf:\/forms\/ori-md-editor\/'$form'\/form\/case/' {} \; find $form -name "*ml" -exec sed -i 's/href="dialog/href="oxf:\/forms\/ori-md-editor\/'$form'\/form\/dialog/' {} \; find $form -name "*ml" -exec sed -i 's/apps\/ori-md-editor\/prototypes/forms\/ori-md-editor\/'$form'\/prototype/' {} \; find $form -name "*ml" -exec sed -i 's/forms\/ori-md-editor\/$form/forms\/ori-md-editor\/'$form'/' {} \; done; |