Changes between Initial Version and Version 1 of DeveloperGuidelines/Synchronization


Ignore:
Timestamp:
10/22/10 11:16:57 (11 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/Synchronization

    v1 v1  
     1[[TOC]]
     2= S3XRC - Data Synchronisation =
     3
     4  - [wiki:S3XRC]
     5
     6== Introduction ==
     7
     8  - ''tbw''
     9
     10== msince ==
     11
     12msince parameter allows selecting of records since a specific time. This needs to be ISO8601, i.e.
     13{{{
     14YYYY-MM-DDThh:mm:ssZ
     15}}}
     16If given, this exports only resources which have been modified since this date/time (=if either the main record or any of its component records has been
     17modified since then). Referenced resources are exported regardless of "msince", because it could always be that the reference itself has changed
     18since then.
     19
     20== Strategy ==
     21
     22vector.strategy contains the allowed import strategies as a list, which allows
     23you to control the import behavior:
     24
     25If this list is empty (or None), then the importer skips this records (and all
     26related components).
     27
     28If this list contains vector.METHOD.CREATE, then new records will be created,
     29otherwise records from the import source which don't have an instance in the
     30local database, will be skipped (together will all their components).
     31
     32If this list contains vector.METHOD.UPDATE, then vectors which already have a
     33local instance will be updated from the import source, otherwise they will be
     34ignored (together will all their components).
     35
     36The function hooked in as s3xrc.sync_resolve(vector) is expected to set
     37vector.strategy according to the policies, otherwise the fallback strategy
     38will allow both, create and update.
     39
     40== Resolution ==
     41
     42The function s3xrc.sync_resolve(vector) can issue a resolution per vector,
     43that is, you can tell the importer which fields from which record (the local
     44one or the imported one) are to be kept for the import:
     45
     46vector.resolution can contain this resolution either as a single value, or as
     47a dict of values with fieldnames as keys (per-field resolution). There are
     48three possible values for resolution:
     49
     50vector.RESOLUTION.THIS means: keep the local value
     51vector.RESOLUTION.OTHER means: keep the imported value (if any)
     52vector.RESOLUTION.NEWER means: keep the newer value
     53
     54vector.resolution falls back to vector.default_resolution.
     55
     56If you use per-field resolutions, you need to set vector.default_resolution
     57for all fields for which there is no entry in vector.resolution. The default
     58resolution falls back to vector.RESOLUTION.THIS.
     59
     60----
     61
     62DeveloperGuidelines