Handlers
In uSync a Handler manages the reading and writing of the uSync Settings from the folder of the Umbraco installation.
Handlers don't do the actual importing or exporting of items that work is done by the Serializers.
Handler Groups
In uSync v9 and v10 handlers are enabled in the default group by default generally you do not need to add handlers individually to the config:
The most common action is to Turn Content On or Off, this can be done with the ExportAtSave
option: see our guide on turning off content edition.
Disable Individual Handlers
If you want to turn individual handlers off you can add them to the list of Disabled Handlers.
"uSync" : {
"Sets" :{
"Default" : {
"DisabledHandlers" : ["DictionaryHandler"]
}
}
}
Handler Defaults
All handlers have their own settings, which you can set individually (see below). You can set default settings for all the handlers in the config.
"uSync": {
"Sets" : {
"Default" : {
"HandlerDefaults" :{
"Enabled": true,
"Actions": "All",
"UseFlatStructure": true,
"FailOnMissingParent": false,
"Group": "",
"Settings": {
// handler specific settings go here
}
}
}
}
}
Key | Default | Values | Note |
---|---|---|---|
Enabled | True | True/False | Turns a handler on or off. |
Actions | All | "All", "Import", "Export", "Report" | What actions the handlers will work for. |
UseFlatStructure | True | True/False | Saves the files in a single folder or use a folder structure to represent the layout in Umbraco. |
FailOnMissingParent | False | True/False | If set to true the import will fail if the parent item cannot be found. If set to false the import process will attempt to find the closest possible parent item and import the item into that location. |
Group | "" | "", "Settings", "Content" | Override the group the handler belongs to. |
Settings | See handler specific settings below. |
Handler settings
Handler settings allow you to have more control over the behaviour of a handler. There are a number of settings all handlers share, and some that only work for certain handlers.
"uSync": {
"Sets" : {
"Default" : {
"HandlerDefaults" :{
"Settings": {
"CreateOnly": false,
"IgnoreAliases" : "",
}
}
}
}
}
Key | Values | Note |
---|---|---|
CreateOnly | True/False | Items are created if they do not exist, but existing items are not synced. |
IgnoreAliases | String | List of aliases of items you don't want the handler to import. |
Handler Specific Settings
Some handlers have additional settings
Handler | Key | Default | Value | Note |
---|---|---|---|---|
Content/Media | Include | "" | Content Path | Path to a content item include. |
Exclude | "" | Content Path | path to a content item to exclude. | |
ImportTrashed | true | True/False | Import items that are in the Trashed state. | |
ExportTrashed | true | True/False | Export items that are in the Trashed state. | |
RulesOnExport | False | True / False | Run the rules during an export. | |
DoNotSerialize | "" | PropertyName | Names of content/media properties not to serialize as part of a sync (Added uSync 9.1+ #289) | |
IncludeContentTypes | "" | ContentTypes | List of content types to include, when this value is set ONLY these content types will be included in any sync (Added uSync 10.3+ #419)) | |
ExcludeContentTypes | "" | ContentTypes | List of content types to exclude, When using this setting all other content types are synced and any in this list are ignored. (Added uSync 10.3+ #419)) | |
DataTypes | NoConfigNames | "" | String | List of datatypes by name that you don't want to import the configuration for. |
NoConfigEditors | "" | String | List of editor aliases of items you don't want the configuration to be imported for. |
Example
These settings are often set on individual handlers for example, the configuration below would not import trashed items, and exclude any content in the the Home/Testing
content tree.
"uSync" :{
"Sets": {
"Default": {
"Handlers": {
"ContentHandler" : {
"Settings" : {
"ImportTrashed": false,
"Exclude": "Home/Testing"
}
}
}
}
}
}
uSync.Publisher - uses a diffrent content handler called PublishedContentHandler
if you want settings to apply to only that handler you need to use the diffrent name.