The One-Way Sync Tool allows files on a Resource Server to be synchronized to the local filesystem. It only pulls changes from the Resource Server and updates the local filesystem. Changes that are made to the local filesystem will be overwritten and are not synchronized to the Resource Server.
All local changes to synchronized directories are reverted. All existing files in the local directory will be deleted (if they don’t exist in the remote folder).
Each remote folder that is being synchronized, needs to be configured. Depending on the run-mode, these properties need to be set differently. See Modes for more details.
The following properties need to be set:
Server base-path: The public address of the remote Resource Server (which hosts the resources that you want to synchronize). E.g.:
Client ID: The client-id of the user that needs to be used to download the resources from the Resource Server.
Client secret: The secret associated with the client-id as specified in
Remote idr: The URL with protocol
idrthat specifies which remote folder should be synchronized. E.g.:
Local directory: The local directory where resources are synchronized to. This directory (and any of its parent directories) is created if it doesn’t exist yet. E.g.:
The One-Way Sync Tool can run in different modes:
Embedded in the Process Server
As a standalone process
Embedded in your own java-application
Since the synchronized files are mostly templates (and their artefacts), the One-Way sync tool can run in the Process Server. This makes them available for output generation (e.g. deployed Document Flows).
In the configuration of the Process Server, you can specify which folders need to be synchronized.
<config> <server> <resources> <sync> <channel1> <server-basepath type="value">https://resource-app-eu1.scripturaengage.com</server-basepath> <client-id type="value">adO-DkNfDZF64uhG42jK</client-id> <client-secret encryption="aes" type="value">AAAAAAAAABAzQ1F6NEFmODR4SjBGMVdXjZ.../HichjFfr8J</client-secret> <remote-idr type="value">idr://inventive-designers/draft/</remote-idr> <local-directory type="value">/sync/draft</local-directory> </channel1> <channel2> ... </channel2> </sync> </resources> </server> </config>
Add a fragment for each channel (i.e. each directory that you want to synchronize).
Choose a name for the fragment-element (like
See Configuration for a description of the properties.
The One-Way Sync Tool can also run as a separate java process. Download the JAR (java archive) from the website: https://www.inventivedesigners.com/private/scriptura
Start the application
java -jar one-way-sync-standalone-release-18.04-201804301553.jar
Properties are read from
sync-properties.xml in the current directory.
If you want to use a different file, pass it as an argument.
java -jar one-way-sync-standalone-release-18.04-201804301553.jar ../myprops.xml
<sync> <channel> <server-basepath>https://resource-app-eu1.scripturaengage.com</server-basepath> <client-id>adO-DkNfDZF64uhG42jK</client-id> <client-secret>diroRqes3UT7Xycqtt1ETt_OdVeGXmahv-ms3UT7</client-secret> <remote-idr>idr://inventive-designers/draft/</remote-idr> <local-directory>/sync/draft</local-directory> </channel> <channel> ... </channel> </sync>
Add a channel-fragment for each directory that you want to synchronize. See Configuration for a description of the properties.
Type Ctrl-C to stop this process.
Place the standalone JAR (see Standalone Process) on the classpath of your application. For each folder that you want to synchronize, call:
SyncStarter.startSync( Path localDirectory, String remoteIDRPath, String serverBasePath, String clientID, String clientSecret )
SyncStarter is located in package
The function returns an instance of class
When synchronization should stop, call
The JAR file contains some libraries (like slf4j, log4j, mapdb and jackson).
If you already have these dependencies in your own application, you can choose to copy the plugin
com.id.resource.sync.oneway_4.500.0.201803121320.jar (the version number will be different) from a Scriptura Engage installation or update site.
This is not guaranteed to work, however.
The One-Way Sync tool is only tested with the shipped version of its dependencies.