Ametys ODF offers several options for exporting training courses in different formats.
Select a course, then click on the "Export CDM-fr" button.
You can then open or save the file XML, named after the course identifier (e.g. H7AJB1ER.xml).
Export can be automatic as soon as a course is validated: in the application administration (for more details on this part, please consult the Administrator Area page), check the box "Enable export to disk in CDM-fr format" and enter the path to the directory containing the export files.
Please note that this path must be absolute, not relative.
The file created is named after the course identifier (e.g. H7AJB1ER.xml).
Once a course has been validated, it can be exported via Web Services to make the information accessible to another application: in the application administration (for more details on this part, please consult the Administrator Area page), check the "Enable publication on a server" box and enter the server'sURL .
Please note that server authentication is not supported.
Ametys ODF also manages an OAI warehouse containing all the CDM-fr files corresponding to validated training courses.
Cet entrepôt est accessible par n'importe quel moissonneur OAI via le protocole d'échange de données OAI-PMH (Open Archives Initiative’s Protocol for Metadata Harvesting) à l'URL <URL du serveur>/_odf/OAI
Here's an example of the "Verbs" queries that can be submitted by the OAI harvester:
Query ("verb") | URL |
---|---|
OAI service identification | <URL du serveur>/_odf/OAI?verb=Identify |
List of supported metadata formats | <URL du serveur>/_odf/OAI?verb=ListMetadataFormats |
List of identifiers and last modification dates of courses available in the database | <URL du serveur>/_odf/OAI?verb=ListIdentifiers&metadataPrefix=cdm |
List of available training packages | <URL du serveur>/_odf/OAI?verb=ListSets |
List of courses with ID, last modification date, | <URL du serveur>/_odf/OAI?verb=ListRecords&metadataPrefix=oai_dc |
List of training courses with their ID, last modification date, | <URL du serveur>/_odf/OAI?verb=ListRecords&metadataPrefix=cdm |
List of CDM-fr training courses belonging to the "licenses" package | <URL du serveur>/_odf/OAI?verb=ListRecords&metadataPrefix=cdm&set=licenses |
Collection of format-specific training CDM-fr | <URL du serveur>/_odf/OAI?verb=GetRecord&identifier=FRUAI3182988BPRH7AIW8S6&metadataPrefix=cdm |
To find out more
Ametys ODF does not provide default sets, but does provide a mechanism for defining your own sets.
Example of a "set" to retrieve all licenses:
<feature name="export.oai-pmh"> <extensions> <extension id="oai.set.licenses" point="org.ametys.odf.oai.OaiSetExtensionPoint" class="org.ametys.odf.oai.LicenseOaiSet"> <name i18n="false">Ensemble des licences</name> <description i18n="false">Liste des licences LMD</description> </extension> </extensions> </feature>
public class LicenseOaiSet extends AbstractOaiSet { public AmetysObjectIterable<Program> getRecords(Expression expression, SortCriteria sortCriteria) { Expression licenseExpr = new SynchronizeExpression(AbstractProgram.DEGREE, "XA"); AndExpression finalExpr = new AndExpression(licenseExpr, expression); String xPathQuery = QueryHelper.getXPathQuery(null, "ametys:content", finalExpr, sortCriteria); return _resolver.query(xPathQuery); } }
URL de collecte : <URL du serveur>/_odf/OAI?verb=ListRecords&metadataPrefix=cdm&set=oai.set.license
Pour télécharger le PDF d'une fiche formation, vous pouvez 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.URIUtils.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.URIUtils"> <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>
The PDF catalog export is available for versions ODF v2 .3.0 and higher.
The PDF catalog export consists of aggregating PDF training course units with a summary and cover page.
There are 2 ways to export the PDF catalog:
Il faut positionner le lien <a href="{$site-uri-prefix}/_plugins/odf/programs/[NOM_CATALOG]/{$lang}/catalog.pdf">Télécharger le catalogue des formations</a> dans votre charte graphique.
avec NOM_CATALOG = nom du catalogue ODF à générer.
Le catalogue PDF (s'il n'existe pas dans le cache du front office) sera généré à la volée.
The advantage of this method is that PDF will always be up to date with the latest validated training versions, with no manual handling required.
This solution is suitable for sites whose training catalogs are not too large, and for which PDF takes no more than 2-3 seconds to generate.
Tip
If you only have one catalog ODF, you can useurl {$site-uri-prefix}/_plugins/odf/programs/_default/{$lang}/catalog.pdf
This URL automatically generates the PDF catalog from the 1st catalog existing in the application.
If the training offer is very large, an "Export PDF catalog" button in the back-office can be used to generate the catalog asynchronously. This button is subject to the "Generate catalog" right.
A dialog box will ask you to select the ODF catalog you wish to export (the PDF will only contain training courses from this catalog).
The catalog is generated in the background. A mail is sent to the user who launched the export when the generation of PDF is complete.
The language of the generated catalog is that of the site map if the "Site Map" tool is open, otherwise it is the master language ofODF (configuration parameter)
The PDF generated in this way is deposited in WEB-INF/data/odf/catalog/[NOM_CATALOG]/[LANG]/catalog.pdf
Dans ce cas, le lien à positionner dans la charte graphique pour télécharger le catalogue est <a href="{$site-uri-prefix}/_plugins/odf/download/[NOM_CATALOG]/{$lang}/catalog.pdf">Télécharger le catalogue des formations</a>
Si vous n'avez qu'un seul catalogue, l'astuce du (1) fonctionne également: <a href="{$site-uri-prefix}/_plugins/odf/download/_default/{$lang}/catalog.pdf">
Cette méthode possède 2 (gros) inconvénients:
This export is available for versions ODF v2 .4.0 and higher.
Ametys ODF includes standard export of a training course in XML format for Adobe InDesign software
In the "Training" tab, an "Export" menu XML for InDesign allows you to :
To export a course in XML format for InDesign, you must first choose the XSLT style sheet that will transform the course into the correct XML format.
The list of files proposed for export are those existing in the WEB-INF/stylesheets/indesign directory of the Ametys ODF application.
Each file can be accompanied by a XML description file with the same name as the XSL file. Example of a description file:
<?xml version="1.0" encoding="UTF-8"?> <indesign> <label i18n="true">APPLICATION_EXPORT_PROGRAM_INDESIGN_DEFAULT_XSLT_LABEL</label> </indesign>
The format of the XML file and the template file are closely linked: the template is defined according to certain expected XML tags. Any XML export cannot be imported into any template. And conversely, a template cannot accept any format XML.
In the "Training offer" tab, the "Export InDesign catalog" button allows you to export the entire catalog to Adobe InDesign.
A dialog box opens to choose :
The list of files proposed for global export are those existing in the WEB-INF/stylesheets/indesign/catalog directory of the Ametys ODF application.
As with the unit export, they can be accompanied by a XML description file.
This export is available for versions ODF v2 .4.0 and higher.
Ametys ODF includes export of a training course's RNCP (Répertoire national des certifications professionnelles) file in .docx format.
Select a training course, then click on "Fiche RNCP".
Ametys ODF provides an RNCP export by default, but the content of the RNCP sheet can be customized.
Overloading is carried out in a WEB-INF/stylesheets/rncp/content2document file.xsl from your application
Start by importing the file plugin:odf://stylesheets/rncp/content2document.xsl and overload only what is necessary (content of frame 12, title of frame 6, etc ...).
SQL can be exported using plugin "Content-io" from 4.2 onwards.
Please note that the documentation page is currently in v3.