| | 1 | [[TOC]] |
| | 2 | = !BluePrint: Record Merger = |
| | 3 | |
| | 4 | == Introduction == |
| | 5 | |
| | 6 | There are several occasions where records need to be merged manually, e.g.: |
| | 7 | |
| | 8 | - De-duplication |
| | 9 | - Synchronization conflict resolution |
| | 10 | |
| | 11 | == Description == |
| | 12 | |
| | 13 | The idea is to implement a generic {{{merge}}} method for the [wiki:S3XRC/RESTfulAPI RESTful API], which responds to URLs like: |
| | 14 | |
| | 15 | {{{ |
| | 16 | /xxx/yyyyyy/25/merge?with=27 |
| | 17 | }}} |
| | 18 | |
| | 19 | - merge record 27 into record 25 |
| | 20 | |
| | 21 | Additionally, the low-level API could also accept a {{{Storage}}} of fields from the caller instead of another record. |
| | 22 | |
| | 23 | == Requirements == |
| | 24 | |
| | 25 | - GET {{{merge}}} returns a form like above: |
| | 26 | - the {{{merge}}} form behaves basically like a normal {{{update}}} form: |
| | 27 | - the user can edit the original record |
| | 28 | - the user can click on {{{<<copy}}} to copy values from the merge source |
| | 29 | |
| | 30 | - POST {{{merge}}} does: |
| | 31 | - update the original record with the data of the form |
| | 32 | - update all links to the merge source into links to the original record |
| | 33 | - mark the merge source deleted (or delete it, if no deletion status) |
| | 34 | - audit {{{update}}} |
| | 35 | |
| | 36 | - PUT {{{merge}}} does: |
| | 37 | - respond with "invalid method" (HTTP/405) |
| | 38 | |
| | 39 | - DELETE {{{merge}}} does: |
| | 40 | - respond with "invalid method" (HTTP/405) |
| | 41 | |
| | 42 | - Errors: |
| | 43 | - original record does not exist => HTTP/404 Not Found |
| | 44 | - merge source does not exist => HTTP/404 Not Found (or redirect to update?) |
| | 45 | |
| | 46 | |
| | 47 | == Use-Cases == |
| | 48 | |
| | 49 | - Main actor: |
| | 50 | - admin user |
| | 51 | |
| | 52 | - Merging of duplicate records in the de-duplicator |
| | 53 | - Merging of conflicting remote records in the synchronization conflict resolution UI |
| | 54 | |
| | 55 | == Design == |
| | 56 | |
| | 57 | - Implement {{{merge}}} as a method in S3Resource, which: |
| | 58 | - generates the {{{merge}}} form from either another record in the same resource or a Storage of fields |
| | 59 | - processes the form upon POST |
| | 60 | - Implement {{{merge}}} as a method in S3CRUDHandler, which: |
| | 61 | - parses the URL query variable {{{with}}} |
| | 62 | - calls the S3Resource.merge method appropriately |
| | 63 | |
| | 64 | == Implementation == |
| | 65 | |
| | 66 | - not yet implemented, scheduled for [wiki:S3XRC/FeatureRoadmap S3XRC 2.3] |
| | 67 | |
| | 68 | ---- |
| | 69 | BluePrints |