Synchronizing Item Comments Configuration

Release 1.3 - ...

Since the introduction of the WebToolKit, the various parts of it didn't take Outscaling scenarios into account very well. Item Comments, the Event Calendar and so forth, none of them created appropriate Outscaling events which triggers Outscaling to synchronize a particular record. And although it would have been possible to synchronize e.g. Item Comments on a scheduled bases using an Outscaling Scheduled Event and an accompanying Outscaling Datasource configuration, it would have been so much more convenient if e.g. Item Comments would've created the appropriate events for Outscaling to synchronize the records real-time.

Item Comments

Well, that's exactly what have been changed within 1.3 build 3 (as well as in 1.1 build 11 and 1.2 build 6). The Item Comments module now raises the appropriate Outscaling events when an Item Comment is added and/or modified.

This is the first WebToolKit module which have been adjusted to take Outscaling into account, others will folllow. But apart from the events that are now raised, you need additional configuration in order for Outscaling to be able to synchronize Item Comments (or records for any other "datasource").

Outscaling Datasources

Item Comments are stored within the table swtItemComments. And since this table is not one of the built-in datasources, it is required to create an Outscaling Datasource for this table (Outscaling will only synchronize records for tables which are listed as built-in datasource or for which a custom datasource have been created). Open the Outscaling Console and select the Outscaling Datasources entry within the left pane.

The example below shows an example datasource configuration.

Item Comments Datasource

Never mind the instance-id codes used here, just imagine EMPTYSIX.CMS is your intranet (internal) server and EMPTYSIX12.CMS is your internet (external) server.

Push

This example datasource configuration will enable pushing Item Comments from the selected Source Server (intranet/internal) towards the selected Target Server (internet/external).

The Datasource Name must equal the table name, the Code can be anything as long as its unique, the Direction should be set to push and the Update Mode should be set to Realtime.

The Datasource Configuration (second tab) can be left to its default value.

Pull

But usually, you also want Item Comments added on the internet/external server to be synchronized back to the intranet/internal server. And due to proxy- and/or firewall settings/restrictions it is usually not possible to configure Outscaling in such a way that the internet/external server instance pushes the records to the intranet/external server instance. So, a pulling mechanism must be used.

To accomplish that, an additional Outscaling Datasource must be configured. Make a copy of the Item Comments Datasource and switch the Source and Target Server. The direction must be set to Pull in this case. Don't forget to specify a different code (e.g. add "_PULL" as suffix) since code must be unique.

Furthermore, to enable pulling in general, the server instance itself must have pulling enabled. So, in this case the server instance with the code EMPTYSIX12.CMS (internet/external) must have pulling enabled. This setting (Use pulling) is available on the Advanced tab of the Server Instance configuration.

SmartNumbering

When records for a particular table must be synchronized to another server instance's database (in this case the internet/external server), the primary key field must be preserved. Since Outscaling doesn't use identity inserts, it is required that the identity is removed from the table (SQL Server only) and that SmartNumbering is configured on the table (both SQL Server and Oracle). If only pushing records is required, you just need to take these steps on the database of the target server instance.

When pulling records is also required, in which case source and target server are reversed, you would also need to remove the identity and/or configure SmartNumbering on the (in this case) intranet/internal server instance's database.

To configure SmartNumbering, you just need to run the stored procedure pr_ConfigSmartNumbering (SQL Server syntax):

SQL CopyCode image Copy Code
exec pr_ConfigSmartNumbering 'swtItemComments', 1, 1000000

The first parameter is the table name for which SmartNumbering must be configured. The second and third parameters are the range-start and range-end. For most tables we recommend to use 1 through 1.000.000 (1 million) as number range on the main cms server instance (intranet/internal), 1.000.001 through 2.000.000 as number range for the second cms server instance (in this case internet/external), etcetera.

Instance IDs

Since a Smartsite database can be shared by multiple site instances, Outscaling uses the InstanceID configured within the registry to look up its own Outscaling Server Instance. It also uses this same InstanceID as filter on the events registered within the Outscaling EventQueue (osEventQueue table). This means only events for which the column Originator matches the site's InstanceID will be handled by the Outscaling Background Component.

Hence, an event which is added to the Event Queue when an Item Comment has been added must use the InstanceID of the cms server instance. It is therefore imperative that the PublicationInstanceId application setting within the smartsite.config configuration file matches the Instance ID of the server instance which has been configured for the publication engine.

This server instance (for the publication engine) will have been registered as subscriber of the cms server instance, and it is through this relationship that the publication engine will be able to determine the Instance ID of the cms server instance.

Checklist

To summarize the configuration steps required to be able to synchronize Item Comments:

  • Install 1.3 build 3 (or 1.1 build 11 or 1.2 build 6).
  • Create Outscaling Datasource for the table swtItemComments with direction=push and update mode=Realtime with the appropriate source and target server.
  • Remove the identity on the Nr column of the swtItemComments table (SQL Server only) within the target server's database.
  • Configure SmartNumbering for swtItemComments on the target server's database (both SQL Server and Oracle) using the range 1.000.001 - 2.000.000.
  • Make sure the PublicationInstanceId application setting matches the appropriate server instance.

If pulling mechanism should be used, the additional steps include:

  • Create a copy of the above mentioned datasource, switch source and target servers and change direction to pull
  • Remove the identity on the Nr column of the swtItemComments table within the source server's database as well.
  • Configure SmartNumbering for swtItemComments on the source server's database (both SQL Server and Oracle) using the range 1 - 1.000.000.
  • Make sure Use pulling option is enabled for the subscribed cms server instance.

These steps are similar when configuring Outscaling for other datasources, such as, for example, Event Calendar Events. Just substitute swtItemComments for the tablename in question, and you can follow the same steps described above to configure Outscaling for (almost) any other datasource.