Changes between Initial Version and Version 1 of DeveloperGuidelines/Synchronization

10/22/10 11:16:57 (12 years ago)
Dominic König



  • DeveloperGuidelines/Synchronization

    v1 v1  
     2= S3XRC - Data Synchronisation =
     4  - [wiki:S3XRC]
     6== Introduction ==
     8  - ''tbw''
     10== msince ==
     12msince parameter allows selecting of records since a specific time. This needs to be ISO8601, i.e.
     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.
     20== Strategy ==
     22vector.strategy contains the allowed import strategies as a list, which allows
     23you to control the import behavior:
     25If this list is empty (or None), then the importer skips this records (and all
     26related components).
     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).
     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).
     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.
     40== Resolution ==
     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:
     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:
     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
     54vector.resolution falls back to vector.default_resolution.
     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.