Linkmapper Shared Database module
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
<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.
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
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.
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.
Link Mapper app
All Links
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. |
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.
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 |
---|---|
|
Name of the Link shown in the table. |
|
Options:
|
|
Options:
|
|
Original name from first reload. |
|
URL which was causing the |
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. |