Before migrating Ametys ODF , you need to migrate Ametys CMS 4 .2.x to 4.3.x
This guide covers graphical migration from Ametys ODF 4.1.x to 4.3.0.
See also the technical migration guide and the data guide.
For courses and ELP, contacts (managers + administrative contacts) have been merged into a single contact repeater.
Look for the use of "metadata/personInCharge" and "metadata/contact" in the overloaded rendering of training courses, itineraries or ELP.
The rendering of contacts (HTML or PDF) needs to be revised to take account of the fact that all contacts are now in a single "contacts" repeater.
Here is an example of XML input for contacts:
<contacts entrycount="2"> <entry name="1"> <role id="content://32162f5e-565a-4bed-ad94-7bfa3b366a53" name="personrole-txt-responsable-formation-continue" title="Responsable Formation continue" createdat="2018-02-16T10:34:13.864+01:00" creator="admin" lastmodifiedat="2018-02-16T10:34:13.864+01:00"></role> <persons id="personContent://a51310d2-7122-4a2b-ae1a-da8fa0df31c0" name="person-2015" title="Sophie Gamelin" language="fr" createdat="2014-07-23T10:29:39.536+02:00" creator="Anonymous" lastmodifiedat="2014-07-23T10:29:39.581+02:00"></persons> <persons id="personContent://1116f0f0-ecd1-4fdf-835c-f8dcb3aab3b9" name="person-3000" title="Rouleau Guillaume" language="fr" createdat="2014-07-23T10:29:25.677+02:00" creator="Anonymous" lastmodifiedat="2019-10-10T14:53:31.699+02:00"></persons> </entry> <entry name="2"> <role id="content://85a849ca-fb08-4118-bbd7-82062537bbe8" name="contact-administratif" title="Contact administratif" createdat="2019-10-09T15:23:09.828+02:00" creator="admin" lastmodifiedat="2019-10-09T15:23:09.829+02:00"></role> <persons id="personContent://1116f0f0-ecd1-4fdf-835c-f8dcb3aab3b9" name="person-3000" title="Rouleau Guillaume" language="fr" createdat="2014-07-23T10:29:25.677+02:00" creator="Anonymous" lastmodifiedat="2019-10-10T14:53:31.699+02:00"></persons> </entry> </contacts>
The testimonials repeater contains a new role field.
You can modify the testimonial rendering to display this new field.
The Person content type now contains an "avatar" (illustration) field.
you can modify your contacts' rendering to display this illustration.
The Campus and Locations reference tables have a new "geocode" field for geolocation.
You can use this new field to display the training location on a map, for example.
Pour télécharger le PDF d'une fiche formation, vous ajoutez un lien de téléchargement de la forme <urlServeur>/plugins/odf-web/<site>/_content/<content-name>.pdf
Ex: http://localhost:8080/plugins/odf-web/www/_content/program-fruai3182988bprh6yqnsb9.pdf
The name of the file to download is "program-fruai3182988bprh6yqnsb9.pdf".
Pour avoir des noms de fichier plus lisibles, vous pouvez maintenant utiliser un lien de la forme <urlServeur>/plugins/odf-web/<site>/_content/<content-name>/<title>.pdf
<title> est le nom que vous souhaitez donner à votre PDF, c'est un champ libre mais attention il doit être encodé en utilisant le helper org.ametys.core.util.URLEncoder.encodePath(String)
Here is an example of using the course title as the file name PDF :
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:url="org.ametys.core.util.URLEncoder"> <xsl:template name="download-pdf"> <xsl:variable name="pdfUrl" select="concat($uri-prefix, '/plugins/odf-web/', $site, '/_content/', /view/content/@name, '/', url:encodePath(/view/content/@title), '.pdf')"/> <a href="{$pdfUrl}">Télécharger</a> </xsl:template> </xsl:stylesheets>
Please note that the old URL still works.
This migration is not mandatory.
Recently, state-controlled training courses have been required to bear a label.
The list of existing labels is imposed by the Ministry of Education: https://www.enseignementsup-recherche.gouv.fr/cid141235/labels-des-formations-controlees-par-l-etat. html
To this end, each type of diploma can be associated with a label (certificationLabel), and a new field can be used to designate a course or training program as "state-controlled" (certified).
To display the visual corresponding to the training label, you must :
A helper is available at XSL to retrieve the label associated with a course according to its rules.
Here's an example of use in the demo chart:
<xsl:template name="main-banner-label"> <xsl:variable name="label" select="odf:getCertificationLabel(@id)"/> <xsl:if test="$label != ''"> <div class="ametys-main-banner-label"> <div class="ametys-main-banner-label-inner"> <xsl:variable name="labelImgPath" select="concat('templates/common/img/labels/', $label, '.svg')"/> <img class="ametys-main-banner-label__img" src="{ametys:skinURL($labelImgPath)}" alt="" /> </div> </div> </xsl:if> </xsl:template>
In this template XSL, the helper gives the label code associated with this training or course. If it's not empty, we display the SVG image of the same name, located in a directory of the charter.
The new competency-based approach has resulted in the following changes to the model:
Look for the use of these fields in the overloaded rendering of training courses, itineraries or ELP.
The rendering of skills (HTML or PDF) must be revised to take these changes into account.
Please refer to the ODF core chart.
A savoir également si vous utilisez la charte ODF noyau !
Dans le rendu d'une fiche formation, les compétences acquises - qui sont la concaténation des compétences acquises des ELPs - sont affichées dans la 1ere lame de présentation. Par ailleurs un lien "Voir le tableau d'acquisition des compétences" permet de visualiser la distribution des compétences par année / semestre / UE dans une popup.
Le rendu des compétences est assuré par la XSL stylesheets/content/program/zone/skills.xsl.
L'appel au rendu des compétences se trouve au niveau du template XSL <xsl:template match="fieldset[@role='tab']" mode="display-first"> dans program-main.xsl
This migration only concerns applications using the ODF kernel charter.
On a training sheet, by default, in the "Program" table, clicking on a ELP opens a popup with some of theELP fields, as in the example below:
If you don't want to display these popups, but access theELP page directly on click, you need to override the rendering of the courses and ELPs in your own charter (stylesheets\content\program\program-main.xsl and stylesheets\content\course\course-main.xsl and override the usePopupForCourses variable as follows:
<xsl:variable name="usePopupForCourses" select="false()"/>
This migration concerns applications that do not use the ODF 4.3 charter or an overloaded version of this charter.
The XML input data for the PDF training export contains additional data.
In 4.1.x, the input XML was :
<view> <content> <!-- données du contenu exporté --> </content> </view>
In 4.3, the input XML is :
<view> <content> <!-- données du contenu exporté --> </content> <contentType> <!-- description du modèle --> </contentType> <structure> <!-- Structure (maquette) de la formation --> </structure> </view>
If you've overloaded the PDF rendering in your charter, and in particular overloaded the common2pdf.xsl file, it's highly likely that you'll find the :
<xsl:apply-templates />
Replace this instruction with :
<xsl:apply-templates select="/view/content"/>
En effet, vos XSL d'export ne prévoient pas de traiter les informations supplémentaire contenus dans les balises <contentType> et <structure>. Il en résulte que le format de sortie n'est plus un format XSL-FO valide.
Another way of doing this is to add the following XSL templates to ignore the additional XML data:
<xsl:template match="contentType"/> <xsl:template match="structure"/>