Changes between Version 4 and Version 5 of DeveloperGuidelines/Synchronization


Ignore:
Timestamp:
10/04/13 10:03:38 (11 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/Synchronization

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