Skip to content

uSyncBackOffice.Config

Kevin Jump edited this page Sep 6, 2015 · 2 revisions

The behavior of uSync.BackOffice is controlled via uSyncBackOffice.Config, there are some other serialization settings in uSyncCore.Config, but most settings live here.

Import

<uSyncBackOfficeSettings>
  ...
  <Import>True</Import>
  ...
</uSyncBackOfficeSettings>

When the application(site) starts reads the files from the uSync folder, and imports any settings changes into the umbraco instance. with this set to true, your site should always get the latest settings from disk.

ExportAtStartup

<uSyncBackOfficeSettings>
  ...
  <ExportAtStartup>False</ExportAtStartup>
  ...
</uSyncBackOfficeSettings>

When the application starts, takes all settings from the site and writes them out to disk. this setting isn't usally that useful, but if you want to ensure that a site always writes things out you might want to use it.

ExportOnSave

<uSyncBackOfficeSettings>
  ...
  <ExportOnSave>True</ExportOnSave>
  ...
</uSyncBackOfficeSettings>

When a user saves changes to any element inside umbraco, the changes are written to disk, this setting means that as you work in umbraco your changes are saved to disk, this is the best setting to have to ensure you're settings are always upto date on disk.

WatchForFileChanges

<uSyncBackOfficeSettings>
  ...
  <WatchForFileChanges>False</WatchForFileChanges>
  ...
</uSyncBackOfficeSettings>

When set, uSync will watch the usync folder for changes, if any .config files are written to disk, then uSync will perform an import on the folder, this way you can copy files to uSync and have it dynamically update without the need for a restart.

uSync waits around 8 seconds from a file change before doing the import, this allows for multiple file copys to occur before the import is performed.

Archive

<uSyncBackOfficeSettings>
  ...
  <ArchiveVersions>false</ArchiveVersions>
  <ArchiveFolder>~/uSync/Archive/</ArchiveFolder>
  <MaxArchiveVersionCount>0</MaxArchiveVersionCount>  
  ...
</uSyncBackOfficeSettings>

uSync can create archives of any changes, as and when they occur, if uSync is saving an item to disk and a file already exists it will create an archived version of the existing file in the folder specified. these settings are good for keeping a track of what has changed, but if you are using source control, you probably don't want this as it will just duplicate changes you already have stored in source control.

Handlers

<uSyncBackOfficeSettings>
  ...
  <Handlers>
    <HandlerConfig Name="uSync: DataTypeHandler" Enabled="true" />
    <HandlerConfig Name="uSync: TemplateHandler" Enabled="true" />
    <HandlerConfig Name="uSync: ContentTypeHanlder" Enabled="true" />
    <HandlerConfig Name="uSync: MediaTypeHandler" Enabled="true" />
    <HandlerConfig Name="uSync: LanguageHandler" Enabled="true" />
    <HandlerConfig Name="uSync: DictionaryHandler" Enabled="true" />
    <HandlerConfig Name="uSync: MacroHandler" Enabled="true" />
  </Handlers>
  ...
</uSyncBackOfficeSettings>

uSync backoffice actually runs through a series of handlers, and classes that implement the ISyncHandler interface will be called by uSync during an import/export or save setup, and will be responsible for importing or exporting any times.

by default uSync will execute any handlers it finds, you can use the config to turn off a handler. by setting enabled="false" for that handler.

if a handler isn't defined in the config it will still run the default behavior is to run the config section is here so you can disable them if needed.

Clone this wiki locally