Skip to content

Commit

Permalink
allow individual titles for morning and evening issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenHankiewicz committed Dec 10, 2024
1 parent 7cce9e7 commit a4f724e
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 53 deletions.
175 changes: 123 additions & 52 deletions install/plugin_intranda_workflow_newspaper_pages_importer.xml
Original file line number Diff line number Diff line change
@@ -1,60 +1,131 @@
<config_plugin>
<!-- which folder to use as import source -->
<importFolder>/opt/digiverso/import/sample/</importFolder>

<!-- which workflow to use -->
<workflow>Newspaper_workflow</workflow>

<!-- prefix for the process title; will be extended by '_' and the year information -->
<processtitle>mytitle_1234567</processtitle>

<!-- prefix for the page labels -->
<pageNumberPrefix>Seite </pageNumberPrefix>
<set title="Block 1">

<!-- language to use for long date formatter in issue title -->
<languageForDateFormat>de</languageForDateFormat>
<!-- which folder to use as import source -->
<importFolder>/opt/digiverso/import/sample1/</importFolder>

<!-- which workflow to use -->
<workflow>Newspaper_workflow</workflow>

<!-- prefix for the process title; will be extended by '_' and the year information -->
<processtitle>mytitle_1234567</processtitle>

<!-- prefix to use for the issue titles -->
<issueTitlePrefix>Ausgabe vom</issueTitlePrefix>
<issueTitlePrefixMorning identifier="_a_">Morgenausgabe vom</issueTitlePrefixMorning>
<issueTitlePrefixEvening identifier="_b_">Abendausgabe vom</issueTitlePrefixEvening>

<!-- prefix for the page labels -->
<pageNumberPrefix>Page </pageNumberPrefix>

<!-- language to use for long date formatter in issue title -->
<languageForDateFormat>de</languageForDateFormat>


<!-- Whether or not to delete the images from the import folder once they are imported. OPTIONAL. DEFAULT false. -->
<deleteFromSource>true</deleteFromSource>

<!-- prefix to use for the issue titles -->
<issueTitlePrefix>Ausgabe vom</issueTitlePrefix>
<!-- Configure here the metadata that shall be added to the anchor file or the volume part of the mets file. -->
<!-- This tag accepts the following attributes:
- @value: metadata value template, which may contain a variable defined by @var wrapped with _ from both sides
- @type: metadata type
- @var: variable that is ready to be used in @value. To use it, wrap it with _ from both sides and put it into the @value string. OPTIONAL.
- Options are YEAR | MONTH | DAY | DATE | DATEFINE, where cases only matters for the references in @value string.
- The only difference between DATE and DATEFINE are their representations of the date: DATE keeps the original format "yyyy-mm-dd" while DATEFINE takes a new one "dd. MMM. yyyy".
- The value of an unknown variable will be its name.
- For example,
- IF one defines a @var by "year", then it should be referenced in @value using "_year_"
- IF one defines a @var by "YEAR", then it should be referenced in @value using "_YEAR_", although YEAR and year are actually the same option
- IF one defines a @var by "unknown", then any occurrences of "_unknown_" will be replaced by "unknown"
- IF one wants to have a @value template containing "_Year_" as hard-coded, then "Year" should be avoided to be @var. If in such cases such a
variable is still needed, then one can define @var to be something like "yEaR".
- @anchor: true if this metadata is an anchor metadata, false if not. OPTIONAL. DEFAULT false.
- @volume: true if this metadata is a volume metadata, false if not. OPTIONAL. DEFAULT false.
- @person: true if this metadata is a person metadata, false if not. OPTIONAL. DEFAULT false.
-->
<metadata value="CHANGE_ME" type="TitleDocMain" anchor="true" volume="false" person="false" />
<!-- The @volume attribute is by default false. -->
<metadata value="CHANGE_ME" type="CatalogIDSource" anchor="true" person="false" />
<!-- The @person attribute is by default false. -->
<metadata value="CHANGE_ME" type="CatalogIDDigital" anchor="true" />

<metadata value="CHANGE_ME" type="CurrentNoSorting" anchor="false" volume="true" />
<!-- The @anchor attribute is by default false. -->
<metadata value="zeitungen#livb" type="SubjectTopic" volume="true" />
<metadata value="pt_zeitung" type="Publikationstyp" volume="true" />
<metadata value="zeitungsherausgeber#livb" type="Classification" volume="true" />
<metadata value="eli" type="ViewerInstance" volume="true" />

<!-- Use @var to generate the final metadata values in the run. -->
<metadata var="YEAR" value="Newspaper Volume _YEAR_" type="CatalogIDDigital" volume="true" />
<metadata var="YEAR" value="Liechtensteiner Volksblatt (_YEAR_)" type="TitleDocMain" volume="true" />
<metadata var="YEAR" value="_YEAR_" type="CurrentNo" volume="true" />
<metadata var="YEAR" value="_YEAR_" type="PublicationYear" volume="true" />
</set>

<set title="Block 2">

<!-- which folder to use as import source -->
<importFolder>/opt/digiverso/import/sample2/</importFolder>

<!-- which workflow to use -->
<workflow>Newspaper_workflow</workflow>

<!-- prefix for the process title; will be extended by '_' and the year information -->
<processtitle>mytitle_1234567</processtitle>

<!-- prefix for the page labels -->
<pageNumberPrefix>Page </pageNumberPrefix>

<!-- language to use for long date formatter in issue title -->
<languageForDateFormat>de</languageForDateFormat>

<!-- prefix to use for the issue titles -->
<issueTitlePrefix>Ausgabe vom</issueTitlePrefix>
<issueTitlePrefixMorning identifier="_a_">Morgenausgabe vom</issueTitlePrefixMorning>
<issueTitlePrefixEvening identifier="_b_">Abendausgabe vom</issueTitlePrefixEvening>

<!-- Whether or not to delete the images from the import folder once they are imported. OPTIONAL. DEFAULT false. -->
<deleteFromSource>true</deleteFromSource>

<!-- Whether or not to delete the images from the import folder once they are imported. OPTIONAL. DEFAULT false. -->
<deleteFromSource>true</deleteFromSource>

<!-- Configure here the metadata that shall be added to the anchor file or the volume part of the mets file. -->
<!-- This tag accepts the following attributes:
- @value: metadata value template, which may contain a variable defined by @var wrapped with _ from both sides
- @type: metadata type
- @var: variable that is ready to be used in @value. To use it, wrap it with _ from both sides and put it into the @value string. OPTIONAL.
- Options are YEAR | MONTH | DAY | DATE | DATEFINE, where cases only matters for the references in @value string.
- The only difference between DATE and DATEFINE are their representations of the date: DATE keeps the original format "yyyy-mm-dd" while DATEFINE takes a new one "dd. MMM. yyyy".
- The value of an unknown variable will be its name.
- For example,
- IF one defines a @var by "year", then it should be referenced in @value using "_year_"
- IF one defines a @var by "YEAR", then it should be referenced in @value using "_YEAR_", although YEAR and year are actually the same option
- IF one defines a @var by "unknown", then any occurrences of "_unknown_" will be replaced by "unknown"
- IF one wants to have a @value template containing "_Year_" as hard-coded, then "Year" should be avoided to be @var. If in such cases such a
variable is still needed, then one can define @var to be something like "yEaR".
- @anchor: true if this metadata is an anchor metadata, false if not. OPTIONAL. DEFAULT false.
- @volume: true if this metadata is a volume metadata, false if not. OPTIONAL. DEFAULT false.
- @person: true if this metadata is a person metadata, false if not. OPTIONAL. DEFAULT false.
-->
<metadata value="CHANGE_ME" type="TitleDocMain" anchor="true" volume="false" person="false" />
<!-- The @volume attribute is by default false. -->
<metadata value="CHANGE_ME" type="CatalogIDSource" anchor="true" person="false" />
<!-- The @person attribute is by default false. -->
<metadata value="CHANGE_ME" type="CatalogIDDigital" anchor="true" />

<metadata value="CHANGE_ME" type="CurrentNoSorting" anchor="false" volume="true" />
<!-- The @anchor attribute is by default false. -->
<metadata value="zeitungen#livb" type="SubjectTopic" volume="true" />
<metadata value="pt_zeitung" type="Publikationstyp" volume="true" />
<metadata value="zeitungsherausgeber#livb" type="Classification" volume="true" />
<metadata value="eli" type="ViewerInstance" volume="true" />

<!-- Use @var to generate the final metadata values in the run. -->
<metadata var="YEAR" value="Newspaper Volume _YEAR_" type="CatalogIDDigital" volume="true" />
<metadata var="YEAR" value="Liechtensteiner Volksblatt (_YEAR_)" type="TitleDocMain" volume="true" />
<metadata var="YEAR" value="_YEAR_" type="CurrentNo" volume="true" />
<metadata var="YEAR" value="_YEAR_" type="PublicationYear" volume="true" />
<!-- Configure here the metadata that shall be added to the anchor file or the volume part of the mets file. -->
<!-- This tag accepts the following attributes:
- @value: metadata value template, which may contain a variable defined by @var wrapped with _ from both sides
- @type: metadata type
- @var: variable that is ready to be used in @value. To use it, wrap it with _ from both sides and put it into the @value string. OPTIONAL.
- Options are YEAR | MONTH | DAY | DATE | DATEFINE, where cases only matters for the references in @value string.
- The only difference between DATE and DATEFINE are their representations of the date: DATE keeps the original format "yyyy-mm-dd" while DATEFINE takes a new one "dd. MMM. yyyy".
- The value of an unknown variable will be its name.
- For example,
- IF one defines a @var by "year", then it should be referenced in @value using "_year_"
- IF one defines a @var by "YEAR", then it should be referenced in @value using "_YEAR_", although YEAR and year are actually the same option
- IF one defines a @var by "unknown", then any occurrences of "_unknown_" will be replaced by "unknown"
- IF one wants to have a @value template containing "_Year_" as hard-coded, then "Year" should be avoided to be @var. If in such cases such a
variable is still needed, then one can define @var to be something like "yEaR".
- @anchor: true if this metadata is an anchor metadata, false if not. OPTIONAL. DEFAULT false.
- @volume: true if this metadata is a volume metadata, false if not. OPTIONAL. DEFAULT false.
- @person: true if this metadata is a person metadata, false if not. OPTIONAL. DEFAULT false.
-->
<metadata value="CHANGE_ME" type="TitleDocMain" anchor="true" volume="false" person="false" />
<!-- The @volume attribute is by default false. -->
<metadata value="CHANGE_ME" type="CatalogIDSource" anchor="true" person="false" />
<!-- The @person attribute is by default false. -->
<metadata value="CHANGE_ME" type="CatalogIDDigital" anchor="true" />

<metadata value="CHANGE_ME" type="CurrentNoSorting" anchor="false" volume="true" />
<!-- The @anchor attribute is by default false. -->
<metadata value="zeitungen#livb" type="SubjectTopic" volume="true" />
<metadata value="pt_zeitung" type="Publikationstyp" volume="true" />
<metadata value="zeitungsherausgeber#livb" type="Classification" volume="true" />
<metadata value="eli" type="ViewerInstance" volume="true" />

<!-- Use @var to generate the final metadata values in the run. -->
<metadata var="YEAR" value="Newspaper Volume _YEAR_" type="CatalogIDDigital" volume="true" />
<metadata var="YEAR" value="Liechtensteiner Volksblatt (_YEAR_)" type="TitleDocMain" volume="true" />
<metadata var="YEAR" value="_YEAR_" type="CurrentNo" volume="true" />
<metadata var="YEAR" value="_YEAR_" type="PublicationYear" volume="true" />
</set>

</config_plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ public class NewspaperPageImporterWorkflowPlugin implements IWorkflowPlugin, IPu
private String pageNumberPrefix;
// issue title prefix
private String issueTitlePrefix;
private String issueTitlePrefixMorning;
private String issueTitlePrefixEvening;
// identifiers to detect morning and evening issues
private String morningIssueIdentifier;
private String eveningIssueIdentifier;
// language for ate for issueTitle
private String languageForDateFormat;
// true if the images should be deleted from the import folder once they are imported, false otherwise
Expand Down Expand Up @@ -166,8 +171,13 @@ private void readConfiguration(String set) {
importFolder = config.getString("importFolder");
workflow = config.getString("workflow");
processtitle = config.getString("processtitle");
pageNumberPrefix = config.getString("pageNumberPrefix");
issueTitlePrefix = config.getString("issueTitlePrefix");
issueTitlePrefixMorning = config.getString("issueTitlePrefixMorning");
issueTitlePrefixEvening = config.getString("issueTitlePrefixEvening");
morningIssueIdentifier = config.getString("issueTitlePrefixMorning[@identifier]");
eveningIssueIdentifier = config.getString("issueTitlePrefixEvening[@identifier]");

pageNumberPrefix = config.getString("pageNumberPrefix");
languageForDateFormat = config.getString("languageForDateFormat", "de");
deleteFromSource = config.getBoolean("deleteFromSource", false);
anchorMetadataList = new ArrayList<>();
Expand Down

0 comments on commit a4f724e

Please sign in to comment.