Setting up a custom Publish Channel in Inception
Apart from the default Publish channels provided by WoodWing for publishing Stories to, custom Publish channels can also be added.
This article describes how to set up a custom channel using an example written in PHP.
How it works
Every custom channel is configured with an endpoint that Inception sends messages to upon a publish action.
These messages are sent through the Amazon Simple Notification System, which means the endpoint needs to be able to accept messages in this format.
Every endpoint will receive 2 types of messages:
- SubscriptionConfirmation. This message is sent upon creating the custom channel in the Inception client. It confirms that the endpoint is valid and can be used. This allows the endpoint to receive further messages.
- Notification. This message is sent each time an article is published to the custom channel. It contains the id, name and an URL to the article, which in this example is downloaded and put into a folder. In theory an endpoint can do anything it wants to with an article.
Note: Since November 2016, Inception contains a additional output file, based on Prism. This file, with the extension .psv, contains the structure, properties, content, design and related files of the Story. For more information, see the documentation on idealliance.org.
Users can add properties to a Story which can be used by the custom channel to correctly process and categorize the Story.
How to use it
The following process is used to receive messages on this example:
inception-channel-2.0.0-b5.zip (526KB, October 2016)
Info: Using this sample project requires PHP version 5.5.0 or higher (needed by the AWS PHP SDK).
Step 1. Place the example project on a Web server or any other place where it can be hosted and accessed publicly.
Note: Set the public folder as your document root. When simply copying & pasting the project to your document root, all endpoints have to be prepended with '/public'.
IMPORTANT: A directory named '/public/stories' is needed where articles can be downloaded to and read from by this example; the code will not work when this directory cannot be read or written to.
Step 2. Run './composer.phar install' and resolve any missing dependencies.
Step 3. In Inception, go to the Publish channels page by clicking your Avatar and choosing Configuration.
Step 4. In the menu on the left, click Custom Channels and click Add Channel.
Step 5. Fill out the details.
Note: Your changes are automatically saved.
- Name: The name you want to give this channel. This name will appear in the list of Publish channels that the user can choose from.
- Target name: The name of the type of target you want to publish to. The user interface will group channels with the same Target name in the Publish dialog.
- Endpoint URL: The URL that SNS messages will be posted to. This needs to link to the /story/add endpoint located on the public host mentioned in step 1.
- Maximum Image Size. Set the maximum width and height (in pixels) for images in a Story. All images that exceed these sizes will be down-sized in the published Story to these maximum settings (this option needs to be manually enabled when publishing a Story). Down-sizing images results in lower file sizes and therefore shorter download times for the user.
Step 6. Click outside any of the fields to have the channel automatically created.
Step 7. Open a Story and publish it by clicking the Publish button in the toolbar and following the steps.
Step 8. When clicking Publish, the Story is sent to the endpoint where the controller processes it.
Step 9. Go to the /story endpoint on your public host and view the article that has been added.
- 4 April 2017: Renamed 'metadata' to 'properties'.
- 18 October 2016: New sample project (version 2.0.0-b5) added. It contains an example for handling the bulk announce message.