Follow the given steps in the example below to sync folders containing files from the source site to the target site. The example showcases how to add folders and files for syncing in a test folder created by you.
NOTE: Ensure that you have enabled the Site Sync module before you register the snap in.
NOTE:Ensure that the class that implements the interface comprises the following members:
Each time a new item is added to the test folder, the event handler for the Created event is called, and site sync entry logs get created in the handler for each target server through the dataStore object. Corresponding properties for the log entry are also set during this process.
Creating a folder or file raises the Created event immediately after the folder is created. This results in the name of the item in the log entry to be the default one. To rename the default name of the item, you must implement the event handler for Renamed event from the FileSystemWatcher class
You may also do the following:
NOTE: In the Export transaction, you set the header for the current site sync snap in and then add the wrapper objects to the export transaction items. You can perform these steps in two ways: add all items in one transaction, or for each log entry add the items in a separate transaction.
Full code demo:
Back To Top