kitodo-production icon indicating copy to clipboard operation
kitodo-production copied to clipboard

Add rulset metadata attribute for structure tree node label

Open thomaslow opened this issue 1 year ago • 3 comments

Fixes #5882

This pull request allows to declare what metadata keys are used as node labels in the structure tree (use="structureTreeTitle").

  • A user may choose between the options Type, Title and Type - Title in the metadata editor
  • A warning is shown in case the ruleset.xml does not contain at least one metadata key with use="structureTreeTitle"
  • The old configuration option metsEditor.titleMetadata was removed from kitodo_config.properties

Example declaration in rulset.xml:

<ruleset xmlns="http://names.kitodo.org/ruleset/v2" lang="en">
    <declaration>
        ...
        <key id="TitleDocMain" use="structureTreeTitle">
            <label>main title</label>
            <label lang="de">Haupttitel</label>
        </key>
        ...
    </declaration>
</ruleset>

Demo

https://github.com/user-attachments/assets/cac83ae2-7dfd-4d24-bfdb-165015248ae0

thomaslow avatar Oct 10 '24 17:10 thomaslow

@thomaslow : can use please extend the ruleset.xsd file for this new entry? Without this it is not possible anymore to validate the rulesets which use this new attribute value.

// edit: maybe the existing rule set files in the repository should be changed too so users have an impression how to use this attribute in the future as the configuration is used from the global configuration file to every used rule set file.

henning-gerhardt avatar Oct 11 '24 07:10 henning-gerhardt

@henning-gerhardt Yes, of course. I will adapt the ruleset.xsd and add unit/integration tests later. This pull request is still work-in-progress. I stopped halfway through the implementation, because I felt that the current solution is not ideal. My concerns and questions are mentioned in #5882.

thomaslow avatar Oct 11 '24 07:10 thomaslow

@henning-gerhardt I updated both ruleset.xsd, added the new option to the simple-book.xml example ruleset, and added or updated unit/integration/selenium tests.

thomaslow avatar Oct 30 '24 12:10 thomaslow

@thomaslow also please rebase against current master to resolve code conflicts that were introduced by merging #6255

solth avatar Nov 13 '24 09:11 solth

@BartChris I added this text to the Ruleset wiki page:

use="structureTreeTitle" Das Feld wird im Strukturbaum des Metadateneditor als Anzeigetext für die Strukturelemente verwendet, falls vom Nutzer die Anzeigeoption "Titel" ausgewählt wurde.

See wiki section.

thomaslow avatar Mar 31 '25 10:03 thomaslow