SyncAdaptorModules encapsulate storage mechanisms that can be used by the SyncMechanism. Two examples are:
* The TiddlyWebAdaptor interfaces with servers compatible with TiddlyWeb's HTTP API, such as TiddlyWeb itself and TiddlyWiki5's built-in ServerMechanism.
The following properties should be exposed via the `exports` object:
|!Property |!Description |
|adaptorClass |The JavaScript class for the adaptor |
Nothing should be exported if the adaptor detects that it isn't capable of operating successfully (eg, because it only runs on either the browser or the server, or because a dependency is missing).
Adaptor modules must handle the methods described below.
!!! Error Handling
The syncadaptor must invoke the provided callback with the ''err'' parameter containing a string describing the error.
The syncer has special handling for connection errors. For backwards compatibilty reasons, the syncer identifies connection errors as the string comprised of the content of the tiddler $:/language/Error/XMLHttpRequest with the string ": 0" appended to the end. For example, in English, the string is "XMLHttpRequest error code: 0" and in Brazilian Portuguese it is "Código de erro XMLHttpRequest: 0".
Gets the supplemental information that the adaptor needs to keep track of for a particular tiddler. For example, the TiddlyWeb adaptor includes a `bag` field indicating the original bag of the tiddler.
|!Parameter |!Description |
|tiddler |Target tiddler |
Returns an object storing any additional information required by the adaptor.
Retrieves the titles of tiddlers that need to be updated from the server.
This method is optional. If an adaptor doesn't implement it then synchronisation will be unidirectional from the TiddlyWiki store to the adaptor, but not the other way.
The syncer will use the `getUpdatedTiddlers()` method in preference to the `getSkinnyTiddlers()` method.
|!Parameter |!Description |
|syncer |Reference to the syncer object making the call |
|callback |Callback function invoked with parameter `err,data` -- see below |
This method is optional. If an adaptor doesn't implement it then synchronisation will be unidirectional from the TiddlyWiki store to the adaptor, but not the other way.