Configuring Author and Publish in AEM Screens configuring-author-and-publish-in-aem-screens
This page highlights the following topics:
- Configuring Author and Publish Instances
- Setting Up Publish Topology
- Managing Publication: Delivering Content Updates from Author to Publish to Device
Prerequisites prerequisites
Before getting started with author and publish servers, you should have prior knowledge of:
- AEM Topology
- Creating and Managing AEM Screens Project
- Device Registration Process
Configuring Author and Publish instances configuring-author-and-publish-instances
The following section explains how to setup replication agents on author and publish topology.
You can set up a simple example, where you host an author and two publish instances:
- Author –> localhost:4502
- Publish 1 (pub1) –> localhost:4503
- Publish 2 (pub2) –> localhost:4504
Setting up Replication Agents on Author setting-replication-agents
To create replication agents, you must learn how to create a standard replication agent.
There are 3 replication agents that are needed for Screens:
- Default Replication Agent (specified as Standard Replication Agent)
- Screens Replication Agent
- Reverse Replication Agent
Step 1: Creating a Default Replication Agent step-creating-a-default-replication-agent
Follow the steps below to create a default replication agent:
-
Navigate to your AEM instance –> hammer icon –> Operations –> Configuration.
-
Select the Replication from the left navigation tree.
-
Select the Agents on author from the Replication folder and click New to create a new standard replication agent.
-
Enter the Title and Name to create the replication agent and click Create.
-
Right click the replication agent and click Open to edit the settings.
-
Click Edit to open the Agent Settings dialog box to enter the details.
note note NOTE User needs to check Enabled to enable replication agent. You must check this option on Default, Screens and Reverse Replication Agents. -
Navigate to the Transport tab and enter the URI, User and Password.
note note NOTE You can also copy and rename an existing default replication agent.
Creating Standard Replication Agents creating-standard-replication-agents
- Create standard replication agent for pub1 (out-of-the-box default agent should already be configured) (for example, https://<hostname>:4503/bin/receive?sling:authRequestLogin=1)
- Create standard replication agent for pub2. You can copy s replication agent for pub1 and update the transport to be used for pub2 by changing the port in the transport configuration. (for example, https://<hostname>:4504/bin/receive?sling:authRequestLogin=1)
Creating Screens Replication Agents creating-screens-replication-agents
-
Create a screens replication agent for pub1. Out-of-the-box, there is one named Screens Replication Agent that points to port 4503. This needs to be enabled.
-
Create a screens replication agent for pub2. Copy the Screens Replication Agent for pub1 and change the port to point to 4504 for pub2.
note note NOTE To learn how to configure Screens Replication Agents, see Configuring Screens Replication Agent.
Creating Screens Reverse Replication Agents creating-screens-reverse-replication-agents
- Create a reverse replication agent for pub1.
- Create a reverse replication agent for pub2. You can copy reverse replication agent for pub1 and update the transport to be used for pub2 by changing the port in the transport configuration.
Setting up Publish Topology setting-up-publish-topology
Step 1: Configure Apache Sling Oak-Based Discovery step-configure-apache-sling-oak-based-discovery
Set up Apache Sling Oak-Based Discovery for all Publish instances in the topology
For each publish instance:
-
Navigate to
https://<host>:<port>/system/console/configMgr
-
Select Apache Sling Oak-Based Discovery Service Configuration.
-
Update Topology connector URLs: add URLs of all partaking publish instances that is:
https://publish:4503/libs/sling/topology/connector
https://publish:4504/libs/sling/topology/connector
-
Topology connector Whitelist List: Adapt to IPs or subnets covering all publish instances. Ensure you whitelist the IP/hostname of all publish instances without the port number.
-
Enable Auto-Stop Local-Loops
The configuration should be identical for each publish instance and the auto-stop Local-loop prevents an infinite loop.
Step 2: Verify Publish Topology step-verify-publish-topology
For any of the publish instances navigate to https://:/system/console/topology
. You should see each publish instances represented in the topology under Outgoing topology connectors.
Step 3: Setup ActiveMQ Artemis Cluster step-setup-activemq-artemis-cluster
This step allows you to create encrypted password for ActiveMQ Artemis cluster.
The cluster user and password of all publish instances in the topology needs to be identical. The password of the ActiveMQ Artemis configuration needs to be encrypted. Since each instance has its own encryption key it is necessary to use Crypto Support to create an encrypted password string. Then encrypted password will be used in the OSGi config for ActiveMQ.
On each Publish Instance:
- In the OSGi Console navigate to MAIN –> Crypto Support (
https://<host>:<port>/system/console/crypto
). - Type in the desired plain text password (same for all instances) in Plain Text
- Click Protect.
- Copy the value Protected Text to notepad or text editor. This value will be used in the OSGi config for ActiveMQ.
Since each publish instance by default has unique crypto keys you need to perform this step on each pub instance and save the unique key for the next configuration.
{1ec346330f1c26b5c48255084c3b7272a5e85260322edd59119828d1fa0a610e}
Step 4: Activate ActiveMQ Artemis Cluster step-activate-activemq-artemis-cluster
On each publish instance:
-
Navigate to the OSGi Config manager
https://<host>:<port>/system/console/configMgr
-
Select Apache ActiveMQ Artemis JMS Provider Configuration
-
Update the following:
- Cluster Password: use encrypted value from previous step per respective instance
- Topics:
{name: 'commands', address: 'com.adobe.cq.screens.commands', maxConsumers: 50}
Verify ActiveMQ Artemis Cluster verify-activemq-artemis-cluster
Follow the steps below on each Publish instance:
-
Navigate to the OSGi Console -> Main > ActiveMQ Artemis
https://localhost:4505/system/console/mq
. -
Verify and check to view the ports of other instances under Cluster Information > Topology > nodes=2, members=2.
-
Send a Test Message (top of the screen under Broker Information)
-
Enter the following changes in fields:
- Destination: /com.adobe.cq.screens/devTestTopic
- Text: Hello World
- View the error.log of each instance to see that the message was sent and received across the cluster
As an example, the following image displays on successful configuration of ActiveMQ Artemis Server.
If you do not see the following configuration from /system/console/mq, then navigate to /system/console/mq and click Restart to restart the broker.
Remove referrer header requirement remove-referrer-header-requirement
Follow the steps on each Publish instance:
- Navigate to the OSGi Console > Configuration Manager
- Select Apache Sling Referrer Filter
- Update config and check Allow Empty
Configuring Author and Publish Instance configuring-author-and-publish-instance
Once you have set up the publish topology, you need to configure the author and publish instances, to view the practical results of implementation:
Step 1: Starting an AEM Screens Player (device) step-starting-an-aem-screens-player-device
- Launch a separate browser window.
- Go to Screens player using the web browser, that is,
https://localhost:4502/content/mobileapps/cq-screens-player/firmware.html
or launch the AEM Screens app. When you open the device you will notice the device’s state as unregistered.
Step 2: Registering a Device on Author step-registering-a-device-on-author
- Go to
https://localhost:4502/screens.html/content/screens/we-retail
or select your project and navigate to Devices > Device Manager. - Select Register Device.
- Click Device Registration to view the device.
- Select the device you want to register and click Register Device.
- Verify the registration code and click Validate.
- Enter a title for your device and click Register.
Step 3: Assigning the Device to Display step-assigning-the-device-to-display
- Click Assign Display from the dialog box from the preceding step.
- Select the display path for your channel from the Locations folder.
- Click Assign.
- Click Finish to complete the process, and now the device is assigned.
Check your player and you will see the content that you added in your channel.
Step 4: Publishing Device Configuration to Publish Instances step-publishing-device-configuration-to-publish-instances
Verifying the Device
Follow the steps below to replicate the device user:
- Navigate to the user admin page (e.g:
https://localhost:4502/useradmin
- Search for the screens-devices-master group
- Right click on the group, and click Activate
You can also activate the device from the Device Management Console. Follow the steps below:
- Navigate to your Screens project –> Devices.
- Click Device Manager from the action bar.
- Select the device and click Activate from the action bar, as in shown in the figure below.
Publishing Check list publishing-check-list
The following points summarizes the Publishing Check list:
-
Screens Device User - This is stored as an AEM user and be activated from Tools > Security > Users. The user will be prefixed with “screens” with a long serialized string.
-
Project - The AEM Screens project.
-
Location - Location that device is connected to.
-
Channel(s) - one or more channels that are being displayed at the location
-
Schedule - if using a schedule ensure this is published
-
Location, Schedules, and Channel Folder - if the corresponding resources are inside a folder.
Follow the steps below to verify the author/publish behavior:
- Update some channel content on author instance
- Perform Manage Publication to publish new changes to all publish instances
- Press Activate to activate the device from Device Manager
- Edit URL from author instance URL to one of the publish instances URL
- Verify the updated channel content displays on the AEM Screens player
- Repeat these steps using a different publish instance
Step 5: Pointing the Device to Publish Instance in the Admin Panel step-pointing-the-device-to-publish-instance-in-the-admin-panel
- View the admin UI from the Screens player, long press on the top left corner to open the Admin menu, on your touch enabled AEM Screens player, or by using a mouse.
- Click the Configuration option from the side panel.
- Change author instance to publish instance in Server.
View the changes in your AEM Screens player.
Alternatively, you can also update/edit the server URL from the device management console using the following steps:
- Navigate to your AEM Screens project and select the Devices folder.
- Click Device Manager from the action bar.
- Select the device and click Edit server URL from the action bar, as shown in the figure below and your changes will be propagated to the AEM Screens player.
The Manage Publication feature allows you to deliver content updates from author to publish to device. You can publish/un-publish content for your entire AEM Screens project or only for one of your channel, location, device, application, or a schedule. To learn more about this feature, refer to On-Demand Content Update.
Troubleshooting Tips troubleshoot-tips
Follow the section below to get answers to frequently asked questions related to author/publish setup.
How to add a Redirect from https to http after initial registration and assignment? add-redirect
Solution
Set Enable Proxy/Load Balancer Connection in the Jetty configuration
to true
.
How to Update offline content and player download issues with assets outside /content/dam/projects/<project>
? update-offline-content
Solution
Give read permissions for bulk-offline-update-screens-service user and screens-devices-master group for all /content/dam
or the specific assets you want to use, if you want to be more restrictive.
How to resolve Screens Replication Agent errors? replication-agent
Solution
Make sure you have not checked Use for reverse replication option in the agent configuration. Screens Replication Agent cannot be used as a reverse replication agent and the scope of this feature is to forward device commands from author to publish.