| 82 | |
| 83 | === Source Submission === |
| 84 | |
| 85 | There are multiple ways to submit source files: |
| 86 | |
| 87 | ==== Files on the Server ==== |
| 88 | |
| 89 | A source file in the server file system can be specified using the ''filename'' URL variable: |
| 90 | {{{ |
| 91 | PUT http://<server>/<resource>?filename=<path> |
| 92 | }}} |
| 93 | |
| 94 | Multiple files can be specified as list of comma-separated pathnames: |
| 95 | {{{ |
| 96 | PUT http://<server>/<resource>?filename=<path>,<path>,<path> |
| 97 | }}} |
| 98 | |
| 99 | ==== URLs ==== |
| 100 | |
| 101 | A source file can be specified by its URL using the ''fetchurl'' URL variable: |
| 102 | |
| 103 | {{{ |
| 104 | PUT http://<server>/<resource>?fetchurl=<url> |
| 105 | }}} |
| 106 | |
| 107 | Multiple files can be specified as list of comma-separated pathnames: |
| 108 | {{{ |
| 109 | PUT http://<server>/<resource>?fetchurl=<url>,<url>,<url> |
| 110 | }}} |
| 111 | |
| 112 | Supported URL protocols are http, ftp and file, where file is interpreted in the server file system context. URLs of different protocols can be mixed. |
| 113 | |
| 114 | The specified URLs must be accessible either without authentication, or (if you specify credentials in the URLs) they must support unsolicited HTTP basic authentication - HTTP 403 retries are not handled by the interface. The URLs must be properly [http://www.w3schools.com/tags/ref_urlencode.asp quoted], and must not contain commas. |
| 115 | |
| 116 | ==== Request Attachments ==== |
| 117 | |
| 118 | Source files can also be attached to a multipart-request. In this case the file extension of the source file must match the request URL file extension. Multiple files can be attached. |
| 119 | |
| 120 | ==== Multiple Sources ==== |
| 121 | |
| 122 | Where multiple sources are specified or attached, they are first converted and transformed one-by-one and then combined into a single element tree before import. |
| 123 | |
| 124 | ==== Duplicate Resolution ==== |
| 125 | |
| 126 | In the current S3 implementation, the interface does not handle duplicates within the same request. This is because the order of elements in the resulting element tree is not defined, and the last update time attribute is optional in source elements. Records must not be fractionated, but submitted in one element. Fractions of records will not be merged by the interface, and which of the fractions finally would be imported is not predictable. |
| 127 | |
| 128 | Source elements using unique keys are automatically matched with existing records. Where matches are ambiguous (e.g. a set of keys matching multiple existing records), the import element will be rejected as invalid. For certain resources, the server may have additional duplicate finders and resolvers configured. How duplicates are handled by these resolvers, can differ from resource to resource. |
| 129 | |
| 130 | The default behavior for duplicate resolution in standard import mode is to update the exiting records with the values from the source record. In synchronization mode, though, the default is to accept the newest data. |