Linkmapper Shared Database module

Edition

Incubator (services)

Issues

TBD

Git

Git

Latest

1.0

Compatible with Magnolia 6.2.32+.

The Linkmapper Shared Database module lets you save broken links in an external SQL database and using the associated app, lets you to browse and manage those links.

This module is at the INCUBATOR level.

Installing with Maven

Maven is the easiest way to install the module. Add the following to your bundle:

  • Linkmapper core (configuration)

  • Linkmapper app (usage)

<dependency>
  <groupId>info.magnolia.linkmapper</groupId>
  <artifactId>magnolia-linkmapper-db-core</artifactId>
  <version>1.0</version>
</dependency>
<dependency>
  <groupId>info.magnolia.linkmapper</groupId>
  <artifactId>magnolia-linkmapper-db-app</artifactId>
  <version>1.0</version>
</dependency>

Configuration

To function properly, this module requires some configuration. This can be done in the JCR config node or in the config.yaml file.

We need to pass database connection info to the module. This is minimum configuration that needs to be passed to the module so it can connect to a database instance.

This module does not create a database. The database must already exist and database users must have CREATE/DROP/ALTER rights on the desired database.

Format

This format is for the config.yaml file.

databaseName: [db_name]
datasource:
  username: [db_user]
  password: [db_assword]
  url: [db_url]
  driver: [db_driver]
  migration:
    path: linkmapper-shared-db-core/dbmigration/[db_type]
    run: [true/false]

Examples

These examples would be in the config.yaml file.

  • MySQL

  • PostgresSQL

databaseName: linkmapper
datasource:
  username: user
  password: password
  url: jdbc:mysql://127.0.0.1:3306/linkmapper
  driver: com.mysql.cj.jdbc.Driver
  migration:
    path: linkmapper-shared-db-core/dbmigration/mysql
    run: true
databaseName: linkmapper
datasource:
  username: user
  password: password
  url: jdbc:postgresql://127.0.0.1:5432/linkmapper
  driver: org.postgresql.Driver
  migration:
    path: linkmapper-shared-db-core/dbmigration/pg
    run: true
Ebean note

All properties that are prefixed with "linkmapper." are passed to ebean server. This way, we can easily tune the ebean ORM framework.

For more on Ebean, see their docs.

Important considerations

If the database structure needs to be updated, it has to be done through ebean dbmigration as a manual database update is not allowed by ebean (as there is a checksum verification). This can be done by simply updating domain beans (new or removed fields), and running the main method from GenerateDbMigration class (pathToResource might have to be adapted there) which then generates new files in the corresponding path.

For the database connection to work, we need appropriate database driver to be available on the classpath. For example, if we are using the mysql database with a tomcat server we need to place "mysql-connector-j-8.0.31.jar" in the tomcat lib folder.

clientIdentifier configuration

Please remember to update the value found at linkmapper-shared-db-core/config/ to get data from the correct client.

clientIdentifier config

Usage

The Link Mapper App module lets you browse and manage broken links from Magnolia’s Link Mapper Application. This module is dependent on Link Mapper Core module.

From the author instance, editors can use the Link Mapper app to view the data collected on the public instances by the broken links filter. Data is collected from the server using the Reload action. Broken links are displayed along with the corresponding site name and access count. Results can be filtered and sorted in a variety of different ways.

Each entry can be published to the public instances. Use the well known Publish action to trigger the publication. With the Archive Action, it is possible to move the link to the Archive Tab. If the link is accessed further the node will be automatically get unarchived after the next Reload.

The publication of a node is only available after setting the Target and Redirect Type.
There is also an action available from the browser view to quickly blacklist an item.

Linkapp allLinks

Archive

The archive list is there to ensure clarity in the main list even with longer use. The same search and filter functions are available. To edit a link, however, it is necessary to unarchive it. If an archived link is accessed again, it is automatically unarchived with the next Reload.

Linkapp archive

Dialog

The edit dialog offers the possibility to define a redirect type and a redirect target. It is also possible to evaluate a list of referers and query parameters.

Property Description

Link name

Name of the Link shown in the table.

Target

Options:

  • Page - Choose a page from the pages app

  • Internal link - Enter an internal link (e.g. /travel)

  • External link - Enter an external link (e.g. http://myexternalsite.com)

  • Blacklist - Do not redirect to any page. Returns HTTP status code 410 instead. (_Choose this option in combination with the redirect type `410`_)

Redirect type

Options:

  • 200: keep URL - Target will be served on the original URI, which may look like a page duplicate.

  • 301: permanent - Use in case the original URI will never exist again (default).

  • 302: temporary - Use in case the original URI will exist again in the future.

  • 410: blacklist - Announce that this page is permanently gone and not likely to ever appear again.

Original Name

Original name from first reload.

Original URI

URL which was causing the 404 error.

When editing an item you can see referrers and query parameters of the request that led to the 404. This is sometimes helpful to fight broken links coming from within the system.
  • Link

  • Referrers

  • Query parameters

Link example

Link example referrers

Link example queryParameters

Changelog

Version Notes

1.0

Initial release.

Feedback

Incubators

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the Linkmapper Shared Database module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules