Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/maven-publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
name: Maven Snapshot deploy

on:
workflow_dispatch:
push:
branches:
- 'main'
Expand Down
124 changes: 94 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,111 @@
# mir-navigation-plugin

Includes an extended navigation for newspapers and series. It based on a widen solr handling for
parent documents (root field).
This MIR plugin provides navigation functionality for newspapers and series.

The plugin provides the extended solr handling for series (solr-navigation.xsl). In frontend
context there is a series layout with a panel that shows the navigation.
It provides a panel for the frontend that displays the series navigation, including banner and search.
The navigation is based on a derivate that contains a `navigation.xml` file, where the navigation structure and banner
can be configured.

## Installation instructions for mir lts 2023.06 (As mir-enduser)
It leverages enhanced Solr handling for parent documents (root field) and includes extended Solr processing for series.

1. Download the project from this repository and place it on your computer
> ⚠️ Note: The plugin will overwrite `response-mir.xsl`; any custom frontend changes may be lost.

2. Unzip the downloaded file to create a development project folder location
---

3. Customize general mycore.properties(http://www.mycore.de/documentation/getting_started/mcr_properties.html) for this plugin (/mir-navigation-plugin/src/main/resources/config/mir-navigation-plugin/mycore.properties)
## Features

4. Create jar file with maven => mvn clean && mvn install
The plugin offers the following features:

5. Copy the created jar file from target (/mir-navigation-plugin/target) to mycore home lib
- Frontend Navigation Panel: Displays a series of pages or objects with banner and search.
- Banner Support: Root item can include a banner image.
- Flexible Navigation: Defined via navigation.xml with relative/absolute links and multilingual labels.
- Enhanced Solr Handling: Supports parent documents (root field) and requires schema extensions.
- Optional RSS Feed: RSS link can be displayed or disabled.

(Windows Systems C:\Users\User\AppData\Local\MyCoRe\mirapplication\lib) <br />
(Linux Systems /home/user/.mycore/mirapplication/lib)
---

6. The navigation plugin uses a widen solr handling for parent documents. For this purpose, the plugin brings its own schema extensions. It is necessary to reload the solr schema (for further information have a look on solr mycore documentation http://www.mycore.de/documentation/search/using_solr.html).
In case of a standard solr core installation (the main core is named „main“) open the mir web cli:
## Requirements

- run command „reload solr configuration main in core main“
* This command synchronizes the solr main core with the solr schema from this plugin
- Reload the mir core with solr webadmin (Core Admin - reload)
* You can do a quick check in the solr webadmin via mir schema menu item (root field should be there now)
- Reindex solr with the rules from the navigation plugin with command „rebuild solr metadata and content index in core main“
* solr entries should provide the extended handling for parent documents now (root field)
### Navigation category in `derivate_types` classification

## Requirements for mods document metadata
The standard implementation identifies derivates as series-navigation relatable if they have set categid="navigation" in derobject classification:
The plugin is based on a derivate which must be classified via `derivate_types:navigation`.
Therefore, the `derivate_types` classification must include a category `navigation`.
The category can be defined as follows:

<derobject inherited="0" xlink:type="locator" xlink:href="mir_derivate_00000001">
<order>1</order>
<maindoc>index.xml</maindoc>
<classification classid="derivate_types" categid="navigation" />
</derobject>
```xml
<category ID="navigation">
<label xml:lang="de" text="Navigation" />
<label xml:lang="en" text="Navigation" />
</category>
```

---

## Migrate series navigation in mir
For adding the series navigation panel in the right corner you have to adapt the MIR.Layout.End property (add series-banner,series-layout):
## Installation & Configuration

`MIR.Layout.End=mir-edit,series-banner,series-layout,mir-citation,mir-thumbnail,mir-epusta,mir-access-rights,mir-export,mir-admindata,mir-historydata`
### Build and provide plugin

Build the JAR file with `mvn clean install` and copy it to `~/.mycore/(dev-)mir/lib/`.

### Configure `mycore.properties`

To use the plugin, configuration in `~/.mycore/(dev-)mir/mycore.properties` is required.
The RSS feed requires a `mycoreobject-rss` stylesheet, which is not included by default.
For historical reasons, the link to the RSS feed is always displayed, but it can be disabled if needed.
All in all, configure as follows:

```text
# Add 'series-banner' and 'series-layout'.
MIR.Layout.End=mir-edit,series-banner,series-layout,mir-citation,mir-thumbnail,mir-epusta,mir-access-rights,mir-export,mir-admindata,mir-historydata

# Optional: disable RSS feed.
MIR.Metadata.Navigation.SeriesPanel.RSS.Enabled=false
```

### Reload and rebuild Solr

The plugin leverages enhanced Solr handling for parent documents.
For this purpose, the plugin brings its own schema extensions.
It is necessary to reload the Solr schema (for further information have a look on Solr
[documentation](https://www.mycore.de/documentation/search/search_solr_use/)).
In the case of a standard Solr core installation (where the main core is named `main`), run the following CLI commands:

```text
# Synchronize the solr main core with the solr schema from this plugin.
reload solr configuration main in core main
# Reindex solr with the rules.
rebuild solr metadata and content index in core main
```

As a result, Solr entries will now support the extended handling for parent documents (root field).

---

## Usage

A panel on an object page, including a banner, navigation, and search, can be integrated via a `navigation.xml` file
contained in a derivative whose _derivate type_ is set to _navigation_.
The following format is expected for the `navigation.xml` file:

```xml
<item banner="path/to/banner.png">
<item ref="path/to/page1.xml">
<label xml:lang="de">German label for page 1</label>
<label xml:lang="en">English label for page 1</label>
</item>
<item ref="path/to/page2.xml">
<label xml:lang="de">German label for page 2</label>
<label xml:lang="en">English label for page 2</label>
</item>
</item>
```

A root item is expected first. The optional `banner` attribute can be used to specify a link to an image that will be
displayed above the navigation.

Within the root item, the actual navigation points can be defined. The `ref` attribute specifies the target of a
navigation point and can contain either a relative or an absolute link.
Additionally, labels can be defined for the relevant languages.

> 💡 Tip: Using the [mir-alias-plugin](https://github.com/MyCoRe-Org/mir-alias-plugin), you can simplify the links
> for objects in the navigation.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.mycore.mir</groupId>
<artifactId>mir-parent</artifactId>
<version>2023.06.4-SNAPSHOT</version>
<version>2023.06.5-SNAPSHOT</version>
</parent>
<artifactId>mir-navigation-plugin</artifactId>
<version>2023.06-SNAPSHOT</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MCR.URIResolver.xslImports.solr-document=%MCR.URIResolver.xslImports.solr-docume
######################################################################
## RSS Feed for journals and series ##
######################################################################

MIR.Metadata.Navigation.SeriesPanel.RSS.Enabled=true
#MCR.LayoutTransformerFactory.Default.Ignore=mycoreobject-rss,%MCR.LayoutTransformerFactory.Default.Ignore%
#DuEPublico.RSS.Generator=DuEPublico\: Duisburg-Essen Publications Online, University of Duisburg-Essen, Germany

Expand Down
Loading