Tag Archives: preview

Hidden previews

Preview configuration properties support hidden views. They will be used to generate subsequent views, but they will not appear in the UI.
To hide a view add the hide property:

"preview": [{
    "xsl": "edm2ese.xsl",
    "label": "ESE",
    "output": "xml",
    "hide": true,
    "preview": [{
        "xsl": "ese2html.xsl",
        "label": "Europeana",
        "output": "html"
    }]
}]

In this example, Europeana will be generated based on ESE, but ESE will be hidden.

Preview configuration can use Crosswalks

I added the option to use Crosswalks in preview configuration. For example, instead of specifying the lido to ese XSL file in each preview configuration (and having to update it each time it was changed) we can instead provide the target schema name in the preview. Instead of using this preview configuration:

{
    "xsl": "lido-v1.0-to-ese-v3.4-transform-v3.xsl",
    "label": "ESE",
    "output": "xml"
}

we can use this:

{
    "target": "ESE 3.4",
    "label": "ESE",
    "output": "xml"
}

The ChainTransform object that generates the preview tabs will look for a direct crosswalk from the source schema to the specified target. This should use the same crosswalk used during publication, if the publication schema and preview schema names are the same. So we should be consistent on how to name installed schemas in Mint2 installations. I suggest we use the schema name in capital letters followed by the version (without a ‘v’ prefix) i.e. LIDO 1.0, ESE 3.4.

PS 1. If you omit the label parameter the preview tab will use the target schema name as tab title.
PS 2. In order to update our mint2 installations accordingly, I added the option to rename a schema in Administration > Manage XSDs (see here).

Parameters support in schema’s preview configuration

A schema’s preview configuration now supports XSL parameters. This was implemented to support, for example, the provider parameter in LIDO to ESE XSL. Parameters are currently supported only in preview tabs that have an ‘xsl‘ field. In order to add parameters, a new JSON array called ‘parameters‘ is used in the preview configuration for the specific preview tab. This array contains parameter objects with three fields:

  • name: The parameter name.
  • value: Controls the value of the parameter in the XSL, based on the parameter type (see below)
  • type: Type of the parameter. Currently supports two options:
    • constant: Constant value parameters. The parameter will always have the value of the ‘value‘ field.
    • mint: Mint defined parameters. The parameter will have the value of the mint property specified by the ‘value‘ field.

An example of the parameter’s configuration, from lido-v1.0-proxy.xsd.conf:

{
    "xsl": "lido-v1.0-to-ese-v3.4-transform-v3.xsl",
    "parameters": [
            {
                "name": "provider",
                "type": "mint",
                "value": "mint.provider"
            }
    ], 
    "label": "ESE",
    "output": "xml"
}