The Link Checker the-link-checker
Content authors should not have to concern themselves with validating every link that they include in their content pages.
The Link Checker runs automatically assist content authors with their links including:
- Validating links as they are added to content
- Showing a list of all external links in the content
- Performing link transformations
The Link Checker has a number of configuration options such as defining the validation internal, allowing certain links or link patters to be omitted from validation, and rewriting link rewriting rules.
The Link Checker validates both internal links and external links.
Internal Link Checking internal
Internal links are links to other content in your AEM repository. Internal links can be added using the path picker the RTE or using a custom component. For example:
- Your page
/content/wknd/us/en/adventures/ski-touring.html
- Contain a link to
/content/wknd/us/en/adventures/extreme-ironing.html
in a Text Component.
Internal links are validated as soon as the content author adds an internal links to a page. If the link becomes invalid:
- It is removed from the publisher. The text of the link remains, but the link itself is removed.
- It is shown as a broken link in the authoring interface.
External Link Checking external
External links are links to content outside of your AEM repository. External links can be added using the RTE or using a custom component. For example:
- Your page
/content/wknd/us/en/adventures/ski-touring.html
- Contain a link to
https://bunwarmerthermalunderwear.com
in a Text Component.
External links are validated for syntax and by checking their availability. This check is done asynchronously at a configurable internal. If the Link Checker finds an external link invalid:
- It is removed from the publisher. The text of the link remains, but the link itself is removed.
- It is shown as a broken link in the authoring interface.
In addition, the External Link Checker interface provides an overview of all external links on your content pages.
Using the External Link Checker external-link-checker
To use the External Link Checker:
- Using Navigation, select Tools, then Sites.
- Select External Link Checker and a list of all external links is displayed.
The following information is displayed:
-
Status - The validation status of the link which can be one of the following:
- Valid - The external link is reachable by the Link Checker
- Pending - The external link was added to site content, but has not yet been validated by the Link Checker
- Invalid - The external link is not reach able by the Link Checker
-
URL - The external link
-
Referrer - The content page that contains the external link
- This is only populated if configured.
-
Last Checked - The last time the Link Checker validated the external link
- How often links are checked is configurable.
-
Last Status - The last HTML status code returned when the Link Checked last checked the external link
-
Last Available - Time since the link was last available to the Link Checker
-
Last Accessed - time since the page with the external link was last accessed in the authoring interface
You can manipulate the content of the window, by using the two buttons at the top of the list of links:
- Refresh - To refresh the content of the list
- Check - To check an individual external link selected in the list
How the External Link Checker Works how-it-works
Though easy to use, the External Link Checker relies on a number of services and understanding how they work helps you understand how to configure the Link Checker to meet your needs.
- Whenever a content author saves any link to a page, an event handler is triggered.
- The event handler traverse all content under
/content
and checks for new or updated links and adds them to a cache for the Link Checker. - The Day CQ Link Checker Service then executes on a regular schedule to check the entries in the cache for valid syntax.
- The syntax-validated links then appear in the External Link Checker window. However they will be in a Pending state.
- The Day CQ Link Checker Task then executes on a regular basis to validate the links by making a GET call.
- The Day CQ Link Checker Task then updates the entries in the External Link Checker window with the results of the GET calls.
Configuring the Link Checker configuring
The Link Checker is available automatically out-of-the-box in AEM. However there are a number of OSGi configurations that can be modified to change its behavior:
- Day CQ Link Checker Info Storage Service - This service defines the size of the Link Checker cache in the repository.
- Day CQ Link Checker Service - This service performs asynchronous checking of the syntax of external links. You can define the check period and which types of links are skipped by the checker among other options.
- Day CQ Link Checker Task - This service performs the GET validation of external links. It allows separate definitions of intervals to check bad and good links among other options.
- Day CQ Link Checker Transformer - Allows for converting links based on a user-defined rule set.
See the document OSGi Configuration Settings for more details on how to change OSGi settings.
Disabling the Link Checker disabling
You may choose to disable the Link Checker entirely. To do so:
-
Open the OSGi console.
-
Edit the Day CQ Link Checker Transformer
-
Check the option(s) you wish to disable:
- Disable Checking - to disable validation of links
- Disable Rewriting - to disable link transformations