Feed components configuration
The feed components are configured in
/modules/rssaggregator/templates/components
.
-
combinedFeedsParagraph
: Combines all feeds in a channel and displays them sequentially. Editors can set the number, sort order and character limit of the entries. Use with standard or planet feeds.
-
feedListParagraph
: Displays a defined number of entries for each feed in the channel. The external feed title is used if no internal title is set. Editors can set the number, sort order and character limit of the entries. Use with standard or planet feeds. -
planetFeeds
: Displays the entries of all feeds in a channel with the latest appearing first. Uses the HTML of the source entry. This means that images and links are preserved and displayed. Allows pagination. Use with planet feeds only. -
feedSyndication
: Uses planet statistics data to display a list of authors with feed subscription icons and links to the external website. Author list is ordered by post frequency with top contributors appearing first. Editors can set a title and subtitle, define the number of authors to include, and whether links and the post count should be included. Use with planet feeds only. -
feedStatistics
: Displays Atom and RSS subscription icons and links that allow users to subscribe to the feed on your site. Editors can add a title and select a planet feed. Use with planet feeds only.
Creating a custom component
The model class and template script are the important properties that
determine content in the different components. All RSS model classes
extend info.magnolia.module.rssaggregator.templates.components.AbstractFeedModel,
which provides the business logic to retrieve a defined feed and its
data from the rss
workspace and supports:
-
Entry sorting by title or publication data.
-
Ascending and descending entry sorting.
-
Maximum results property. Default is `20`.
-
Search capabilities
Any custom model class should extend AbstractFeedModel
.
Adding components to templates
You can add the feed components to any template.
Example: Template definition with all feed components in main
area.
/my-module/templates/pages/myTemplate.yaml
templateScript: /my-module/templates/pages/my-script.ftl
renderType: freemarker
visible: true
title: My template
areas:
main:
availableComponents:
combinedFeeds:
id: rssaggregator:components/combinedFeedsParagraph
feedList:
id: rssaggregator:components/feedListParagraph
planetFeeds:
id: rssaggregator:components/planetFeeds
feedStatistics:
id: rssaggregator:components/feedStatistics
feedSyndication:
id: rssaggregator:components/feedSyndication
Configuring automated reports
Setting automated imports for all feeds
You can schedule automated imports for all feeds in the Configuration app. The global settings can be overridden for single feeds.
-
Periodic import:
-
Disabled: Automated imports are disabled by default. You can switch off them off at any time.
-
Import every: Quick option to set imports for a specified number of minutes, hours or days.
-
Use cron time/date defintion: Define a Quartz Cron Pattern to create a suitable import schedule.
For example, the pattern
0 0 6 * * *
imports data daily at 6 a.m. See Cron Maker for help.
-
-
Fetcher: Substitute the default feed fetcher class if necessary.
See Properties table below for options.
The imports are stored in /modules/rssaggregator/config
.
Property | Description |
---|---|
|
required Module configuration node. |
|
required, default is Enables and disables automated imports. |
|
required The cron pattern for scheduled imports. |
|
required info.magnolia.module.rssaggregator.importhandler.FastRSSFeedFetcher retrieves RSS feed content over HTTP. Fetches all feed channels defined in an aggregate feed. You can use info.magnolia.module.rssaggregator.importhandler.SimpleRSSFeedFetcher as an alternative. This is a simple, single-threaded fetcher that reduces server load and is suitable when you don’t have many feed channels and you don’t import often. |
|
required Utility used to build the cron expression. |
Setting automated imports for single feeds
You can configure automated import settings for each feed in the Import Settings tab of the edit dialog.
These setting override the global settings. |
-
Periodic import:
-
Select This feed has different import settings to override the global settings.
-
Disabled: Stops any scheduled automated imports for the individual feed and the global settings take over.
-
Import every: Quick option to set imports for a specified number of minutes, hours or days.
-
Use cron time/date defintion: Define a Quartz Cron Pattern to create a suitable import schedule.
For example, the pattern
0 0 6 * * *
imports data daily at 6 a.m. See Cron Maker for help.
-
-
Fetcher: Substitute the default feed fetcher class if necessary.
See Properties table above for options.
Feed data storage
Feed data is stored in the rss
workspace.
- Structure
Name | Description |
---|---|
|
|
|
Data retrieved from the Internet. The content of this folder is that same for standard and planet feeds.
This content is used for standard feed components
|
|
A channel is created for each RSS feed. |
|
One entry in the feed such as one blog post. |
|
|
|
|
|
|
…. |
|
|
Feed properties retrieved from the internet. |
|
|
…. |
|
|
Internal feed properties. |
|
|
…. |
Generating planet data
Planet commands
The module includes two custom commands to generate planet data.
The commands are configured in
/modules/rssaggregator/commands/planet/
.
Property | Description |
---|---|
|
required Planet commands node. |
|
required Generate planet data command node. |
|
required info.magnolia.module.rssaggregator.generator.PlanetDataGenerator:
|
|
required Collect planet statistics command node. |
|
required info.magnolia.module.rssaggregator.generator.CollectStatisticsCommand:
|
Scheduling planet updates
Use the Scheduler module to execute the planet commands to generate planet data and schedule regular updates.
Two jobs are preconfigured in /modules/scheduler/config/jobs
:
Property | Description |
---|---|
|
required Node for scheduled jobs |
|
required Name of job. |
|
required/optional Parameters passed to the command. |
|
required Workspace where the content item resides. |
|
required Enables and disables the job. Set to |
|
required Name of the catalog where the command resides |
|
required Name of the command. |
|
required CRON expression that
sets the scheduled execution time. You can use the pattern
|
|
optional Description of the job. |
Planet data storage
Planet data is used in planet components. The data is
stored in the planetData
folder in the rss
workspace. View the data
in your custom JCR.
Structure:
<aggregator name> |
|
---|---|
|
The |
|
All posts from all feeds. First all entries from the first feed, newest entry first. Then all posts from the second feed, and so on. |
|
One entry in the feed such as one blog post. |
|
|
|
|
|
|
|
The module uses
checksums to handle duplicate
entries. Because feed data is deleted and recreated on every run, there
is a high probability that a subsequent run will include entries that
were contained in a previous run. Some entries may only have changed
slightly, for example a different publication date. To avoid duplicates,
the |
|
|
|
|
|
|
|
|
|
|
|
Planet statistics storage
Planet statistics are generated from planet
data and stored in the statistics
folder in the rss
workspace. View
the data in your custom JCR.
Structure:
<aggregator name> |
|
---|---|
|
The |
|
All authors from all feeds. |
|
Each author is allocated a number. |
|
Each child node is a reference to a post in the feed. |
|
|
…. |
|
|
|
|
|
|
|
|
Number of posts by this author in the aggregate feed. |
Configuring how long to keep planet data
Planet data is generated and stored for the last 3 months by default.
You can configure the time period for which the data is retained in
/modules/rssaggregator/config/planetOptions
.
Property | Description |
---|---|
|
required Planet options |
|
required, default is `3` Number of months. |
Feed generators
Feed generators generate RSS feeds from Magnolia content and imported
content stored in the rss
workspace.
Four feed generators are registered in
/modules/rssaggregator/config/feedGenerators
.
Property | Description | ||
---|---|---|---|
|
required Feed generators node. |
||
|
required Generator name. |
||
|
required Generator class:
|
Feed syndication servlet
The feed syndication servlet writes an XML feed to the response.
The servlet is registered in
/server/filters/servlets/FeedSyndicationServlet
.
Property | Description |
---|---|
|
required Feed syndication servlet node. |
|
required
info.magnolia.module.rssaggregator.servlet.FeedSyndicationServlet
writes an XML feed to the response. Based on the request parameters, the
|
Virtual URI mapping
Syndication components use virtual URI mappings to redirect generated feeds. The mappings use regular expressions and are called by the feed generator classes to render appropriate content in the XML feed.
Mappings are configured in /modules/rssaggregator/virtualURIMappings
.
Property | Description |
---|---|
|
required Virtual URI mapping node |
|
required Name of mapping. |
|
required info.magnolia.cms.beans.config.RegexpVirtualURIMapping allows you to specify a regular expression pattern that matches a sequence of characters. |
|
required Pattern to match in the requested URI. |
|
required Concrete URI where the request is mapped to. |
Security
Public users
The anonymous
role does not have permissions to the rss
workspace on the author or public instance. Public users cannot see the feed content by default.
The RSS Aggregator module installs the rss-aggregator-base
role that
provides read permissions to the rss
workspace.
Workspace |
Permission |
Scope |
Path |
Rss |
Read only |
Selected and sub nodes |
/ |
To provide public access to feed content, assign the
rss-aggregator-base
role to the anonymous
systems user on the public
instance.
App access
By default only superuser
can access the Feeds app and work with feeds
because the superuser
role includes read/write permissions to the
rss
and config
workspaces.
Here’s how to grant permissions for various feed tasks:.
-
App launcher access: The Feeds app is in the Setup group and editors typically cannot access this group. Move the app to the Edit group to grant access in the app launcher. See App launcher layout for more. This allows the user to open the app but not view the content.
-
Read only access: Assign the
rss-aggregator-base
role to give read only access to feed content. This allows the user to view the list of feeds in the app, select feeds in components and view feed content on pages. -
Read/write access: Create a new role granting read/write access to the
rss
workspace and assign it to the user. This allows the user to create new feeds in the Feeds app, but they cannot access the Configuration subapp. -
Configuration app access: Create a new role granting read/write access in the
config
workspace to/modules/rssaggregator
to allow the user to schedule automated feed imports in the Configuration subapp.