You can run production
synchronizations by customizing their behavior by creating a PFF file. You then use the PFF as a command line parameter for DataViewer.exe (the associated filename of this utility). For example, suppose you've named your Sync PFF
Download Data.pff; you can then run the synchronization by invoking this file from the command line:
"C:\Program Files (x86)\CSPro 8.0\DataViewer.exe" "Download Data.pff"
This assumes that CSPro was installed in the default directory. PFF files always have a .pff extension. Note that you can only sync .csdb(e) files—data files stored as text cannot be synced.
You can create a PFF file in one of two ways: either [1] create one with a text editor (such as Notepad or Wordpad), or [2] let it be generated automatically for you by downloading a data file from a
CSWeb server,
Dropbox, or another sync platform. You can also manipulate PFF files in logic by using the
Pff object.
The following section shows the options available to you in a synchronization PFF file. A PFF file is not case sensitive, so you can use any combination of upper and lower case text.
[Run Information]
Version=CSPro 8.0
AppType=Sync
[ExternalFiles]
MY_DICT=.\MyData.dat
[Parameters]
SyncType=CSWeb
SyncDirection=Get
SyncUrl=https://www.myserver.org/api
Silent=Yes
The [Run Information] block is required and must appear exactly as shown in the example above.
The [ExternalFiles] block is required. It relates the dictionary name to the data file that will be synced. If the data file does not exist, it will be created. A copy of the dictionary must exist on the server (which it automatically will if using CSWeb).
The [Parameters] block is required and includes information about the server to be used during the synchronization.
- SyncType= specifies the type of server to be used during the synchronization. Possible options include: CSWeb, Dropbox, LocalDropbox, FTP, and LocalFiles.
- SyncDirection= specifies the direction of the synchronization. The three options, Get, Put, Both, are detailed in the help documentation for the syncdata function.
- SyncUrl= specifies the URL of the server. This is not required if syncing with Dropbox.
- Silent= determines whether or not to close Data Viewer automatically after the synchronization completes. The value can be Yes or No; it will default to No if this parameter is not listed.