| | 205 | |
| | 206 | Document Tree: |
| | 207 | {{{ |
| | 208 | <s3xml> |
| | 209 | <resource> <!-- primary resource element --> |
| | 210 | <data> <!-- field data --> |
| | 211 | <data> |
| | 212 | ... |
| | 213 | <resource> <!-- component resource inside the primary resource --> |
| | 214 | <data> |
| | 215 | <data> |
| | 216 | <reference/> <!-- reference --> |
| | 217 | ... |
| | 218 | </resource> |
| | 219 | <reference/> <!-- reference --> |
| | 220 | <reference> <!-- reference with embedded resource element --> |
| | 221 | <resource> |
| | 222 | <data> |
| | 223 | ... |
| | 224 | </resource> |
| | 225 | </reference> |
| | 226 | </resource> |
| | 227 | </s3xml> |
| | 228 | }}} |
| | 229 | |
| | 230 | ==== Components ==== |
| | 231 | |
| | 232 | Component resources are <resource> elements inside of their primary <resource> element. Component records will be automatically imported. Upon import, the required key references will be automatically added (=no explicit reference-element required). |
| | 233 | |
| | 234 | Foreign key references of component records to their primary record will not be exported, and where they appear in import sources, they will be ignored. |
| | 235 | |
| | 236 | Components of components are not allowed (maximum depth 1), and where they appear in import sources, they will be ignored. |
| | 237 | |
| | 238 | ==== References ==== |
| | 239 | |
| | 240 | Foreign key references (except those linking components to their primary record) are represented by <reference> elements. |
| | 241 | |
| | 242 | Foreign keys can be importable UIDs (''uuid''-attribute, which will be both imported and used to find and/or link to existing records in the DB) or temporary UIDs (''tuid''-attribute, which will not be imported but only used to find records within the current tree), If a <resource> element with a matching UID key attribute is found in the same tree, it will be automatically imported. |
| | 243 | |
| | 244 | References inside referenced elements will be resolved (unlimited depth) and also be imported. Circular references will be detected and properly resolved. |
| | 245 | |
| | 246 | Multi-references (list:reference type in web2py) use a list of UID keys separated by vertical dashes like {{{uuid=|uid1|uid2|uid3|}}}. The leading and trailing vertical dashes must be present. |
| | 247 | |
| | 248 | If a <resource> element is embedded inside the <reference>, either or both of the UID keys can be omitted. Where both keys are however used, they must match. Multiple embedded <resource> elements are allowed for multi-references. |