This article explains how User, Managers and Channels all fit into the Jomres Channel Management Framework.
Target readership : Developers who want to connect to Jomres installations using the CMF.
I understand that the majority of developers who will read the documentation for the CMF will probably not be experienced users of Jomres, therefore this article is designed to give them a very brief overview of how everything fits together.
Jomres is a CMS agnostic plugin, which currently works on either Wordpress or Joomla. These are the host CMSs.
These host CMSs are responsible for user management and authentication. Once a user exists in the CMS, then they can be made a property manager in the Jomres plugin. There are two different ways that a user in the CMS can become a manager of properties in Jomres itself, depending on the server's configuration. Either they will have created their own properties (if the system is configured to allow them to) or an administrator will have assigned them to one or more existing properties.
The Jomres CMF is designed, from the ground up, to allow multiple different channels to connect to an installation of Jomres, and each connection is tightly bound to individual property managers. The purpose of this is to allow multiple Channel Managers to connect to a single Jomres installation and for the manager to import properties/availability etc. from those channel managers into the installation.
Let's use an example to illustrate this.
Manager A has an account on a Jomres installation. This manager wants to use two channels, Channel X and Channel Y. The manager has accounts and properties on both channels and wants to import properties from those channels into a Jomres installation.
1. To do that, for each channel the manager needs to create a REST API key pair in Jomres using the App Key Management page in the Jomres installation.
2. The manager gives the key pair and the Redirect URI to Channel X. Channel X now uses that key pair to get a token from the Redirect URI.
3. Now that Channel X has a token, they can Announce themselves.
4. What Announcing does is it creates a "channel" record in Jomres that is bound to that property manager. Every communication afterwards will use the token and send the "X-JOMRES-channel-name" in the header. This allows the system to identify both the user and the channel. All of the endpoints (except for Announce endpoints) will use this header to ensure that this channel has rights to make changes to only those properties that they are linked to.
The manager would repeat the process for Channel Y. Channel Y would go through the same steps to get their own token, and they are only able to administer the properties that they have rights/are linked to.
Typically this is done by importing those properties into the Jomres installation, however there are administrator level endpoints that a user with access to the "system" secret can also use to assign individual properties to a given channel. Normally Channel X and Channel Y wouldn't have access to that information and they are limited to importing properties only, not assigning them.
Once a channel manager (or any other system that wants to talk to the Jomres installation) has a connection established then they can use the CMF REST API to perform tasks.