Skip to content

[#294] - Embed TEI edition and XML source in viewer tabs - #311

Open
sebhofmann wants to merge 6 commits into
milestones/17-tei-praesentationsschichtfrom
issues/294-embed-tei-in-viewer
Open

[#294] - Embed TEI edition and XML source in viewer tabs#311
sebhofmann wants to merge 6 commits into
milestones/17-tei-praesentationsschichtfrom
issues/294-embed-tei-in-viewer

Conversation

@sebhofmann

Copy link
Copy Markdown
Collaborator

Closes #294

What

The object viewer now shows one tab per readable derivate, with the tab title taken from the derivate_types classification label. What a tab renders is decided by the main file extension, not the derivate type (the type is only used for the title):

  • xml/tei main files are rendered as a TEI text edition (new XSLT 3.0 stylesheet TEI-cmoedition.xsl, executed with Saxon, loaded lazily via MCRDerivateContentTransformerServlet) and additionally get a <label> (XML) tab showing the raw source, pretty printed and syntax highlighted (TEI-cmosource.xsl).
  • everything else (pdf, images) uses the mycore image viewer as before.
  • derivates without a main file no longer produce an empty tab.

The XML source view walks the tree and emits themed <span> classes for tags, attributes, values, text and comments (colours in _tei.scss); no external JS highlighter is needed. Mixed content is kept on one line so significant whitespace is preserved.

Also included

Upload boxes: "add to an existing filespace" is now visually separated from "create a new filespace" so it is clear what an upload will do (metadataLayout.xsl, _metadata.scss, new i18n keys).

Notes

  • SCSS compiles at runtime (MCR.SASS.DeveloperMode), the cmo-module ships in the WAR.
  • New transformers TEI-cmoedition / TEI-cmosource are configured in mycore.properties (Saxon, XSLT 3.0).
  • cmo-module builds cleanly (mvn -pl cmo-module install, tests green).

Test

  • Verified TEI-cmosource.xsl against the real edition file of cmo_mods_00000602 (Saxon-HE 9.8): well-formed output, balanced spans, namespaces and mixed content correct.

The object viewer now shows one tab per readable derivate, titled by the
derivate_types classification label. The rendering is chosen by the main
file extension, not the derivate type:

- xml/tei main files are rendered as a TEI text edition (XSLT 3.0/Saxon,
  loaded lazily via MCRDerivateContentTransformerServlet) and get an extra
  "<label> (XML)" tab showing the pretty printed, syntax highlighted source.
- everything else (pdf, images) uses the mycore image viewer as before.

Derivates without a main file no longer produce an empty tab.

Also improves the upload boxes: uploading into an existing filespace is now
visually separated from creating a new filespace.
Render title/desc metadata, seriesStmt editors, witness sigla, metDecl
prosody and blockLyrics text; resolve cross-object links; add critical
apparatus with annotation popover. Move all UI labels to messages
(de/en/tr) via mcri18n and fix apparatus link spacing.
'update tei sources from directory {0}' returns one 'update tei source
from file {0}' command per XML file. The file command reads the linked
mods object from milestone[@Unit='cite']/@source and uploads the TEI file
to the object's edition_tei derivate, creating it if necessary.
@sebhofmann sebhofmann added this to the TEI Präsentationsschicht milestone Aug 11, 2026
@sebhofmann
sebhofmann changed the base branch from main to milestones/17-tei-praesentationsschicht August 11, 2026 14:18
sebhofmann added a commit that referenced this pull request Aug 11, 2026
Seed commit so the milestone integration branch can host a merge PR into
main. Milestone PRs (e.g. #311) target this branch and merge here first.
- Drop duplicated title/shelfmark from the edition header
- Mirror the printed edition in the verse block: centred lines, bold main
  text, regular terennüm, italic performance directions, even-only line
  numbers, per-line @real scansion in a popup
- Bracket <supplied> as [..] and resolve @reason/@resp, resolve editor
  @ROLE and rdg @type, split genre into music/text genre and text form
- Move all edition popups (metre, supplied, editors, catalogue, reading
  types and the annotation apparatus preview) onto Bootstrap popovers
  sharing one .cmo-tei-bs-popover theme
- Add de/en/tr messages for the new labels, roles, reasons and reading
  types taken from the editors' translation table
Popovers in the TEI edition viewer are now opened by click instead of
hover, so they stay open and links inside them remain clickable. Only
one popover is open at a time; a click outside closes it. Real links
keep their hover tooltip so the click still navigates.

Readings with a @wit attribute now get a popover listing the witness
sigla resolved from the listWit.
Drop the custom single-open tracking and outside-click handling in the
TEI viewer and rely on Bootstrap's native click toggle instead. Nested
triggers (a supplied span wrapping an annotation) now open both popovers
on one click and close again on re-click. Each click popover gets a small
close button in its top right corner.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Einbettung TEI in Viewer

1 participant