@@ -139,6 +139,20 @@ Custom stylesheets will generally be able to resolve ``textgrid:`` URIs using fu
- *ID* might be an ``xml:id``. If this is passed, your stylesheet should *only* render the XML fragment with the given ID.
Embedded mode — HTML rendering at textgridrep.de
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
textgridrep.de uses the aggregator to render TEI files as HTML. It will activate ``embedded=true``, and it will embed resulting XHTML fragment into its own HTML. If you use your own XSLT, this means, in addition to the notes for custom XSLT above:
* Your stylesheet must return valid XHTML.
* Embedded ``<style>`` elements from the HTML header will be moved to the body and converted to a `scoped style element <https://davidwalsh.name/scoped-css>`_.
* The ``<body>`` element will be converted to a ``<div class="body">`` and returned to be embedded into the container HTML. Everything else your XSLT delivers, especially the HTML ``<head>``, is thrown away. Thus, if you load any JavaScript, make sure to load it from ``<script>`` tags in the body.
You will of course need to pay attention to the usual web development issues, e.g., make sure that any resource you load from within the HTML can be loaded from within pages that are served at <https://textgridrep.de/>.
You can use the simulate mode to partially simulate embedding; it will run the same embed code, but instead of returning just an XHTML fragment it embeds the fragment into a full HTML frame that resembles the TextGridRep.de design. This method can also be used even for unpublished data from within the TextGridLab using the TextGridRep Preview tool that is available from the Marketplace.
value="The Aggregator is a service to export and convert TextGrid documents. It is able to recursively process collections, editions, and other TextGrid aggregations.")
@CrossOriginResourceSharing(allowAllOrigins=true)
...
...
@@ -76,6 +75,7 @@ public Response getCorpus(
@Description("If true, no intermediate TEI corpus documents will be generated for intermediate aggregations, hierarchical structure will be lost")@QueryParam("flat")@DefaultValue("false")finalbooleanflat,
@Description("Title for the container if multiple root objects are given")@QueryParam("title")finalStringtitleArgument,
@Description("Session id for accessing restricted resources")@QueryParam("sid")finalStringsid,
@Description("The TextGrid URIs of the TEI document(s) or aggregation(s) to transform, separated by commas")@PathParam("object")finalStringuriList,
@Description("If given, an alternative XSLT stylesheet to use. Must be a textgrid URI.")@QueryParam("stylesheet")finalURIxsluri,
@Description("If true, check for an <?xsl-stylesheet?> processing instruction in the document to render. Only textgrid: URIs will be resolved.")@QueryParam("pi")finalbooleanpi,
@Description("If true, check for an <?xsl-stylesheet?> processing instruction in the document to render. Only textgrid: URIs will be resolved.")@QueryParam("pi")@DefaultValue("true")finalbooleanpi,
@Description("If true and a stylesheet has been given, force reloading the stylesheet, do not cache")@QueryParam("refreshStylesheet")finalbooleanrefreshStylesheet,
@Description("Session ID to access protected resources")@QueryParam("sid")finalStringsid,
@Description("If true, an HTML fragment consisting of a <div class='body'> element containing the contents of the HTML <body> will be returned, ready to be embedded in an existing HTML page")@QueryParam("embedded")finalbooleanembedded,
...
...
@@ -131,6 +134,7 @@ public Response getHTML(
@Description("An XML ID. If given, only this element will be transformed.")@QueryParam("id")finalStringid,
@Description("If true, a full webpage that looks similar to textgridrep.de's browse view will be returned")@QueryParam("simulate")@DefaultValue("false")finalbooleansimulate,
@Description("If given, generate a table of contents instead of a full HTML document")@QueryParam("toc")finalStringtoc,