1 | | SOPHIE 2.0 RESOURCE FORMAT |
2 | | The R3 format is used for persistence of a sophie 2.0 resources. It is simply the archive of the root directory of the resource. It contains: |
3 | | • _resource.xml file - xml description of all properties of the persisted resource |
4 | | • _data folder - incorporates all embedded files like images, videos, large texts, etc. |
5 | | • _cache folder- containing all cached remote resources for offline usage |
6 | | • children directories – There is sub-directory for all child resources of the persisted one that have the same structure as the parent one. The names of those directories do not start with underscore and match the names of the child resources (not their titles!). |
7 | | At the end of this page you can find a sample book. You can download it and open it with any file compression software (WinZip, WinRar, 7-zip, File Roller, etc) to gain a better understanding of the described structure. |
8 | | Basically every resource could be persisted on its own so there are different file extensions for the different resources: ‘.page’, ‘.book’, ‘.frame’, etc. All of those are further extended by the generalized extension ‘.s2’. So if you were saving a page and you decided to name the file “Page A” the complete name of the file would be “Page A.page.s2”. |
9 | | The key part of every resource directory is its _resource.xml. It is different for the different kinds of resources but there are some common things: |
10 | | * It begins with a standard <xml> tag. |
11 | | * The root tag is named ‘resource’. |
12 | | * It has a mandatory attribute ‘kind’ that specifies the kind of the persisted resource (book, page…). |
13 | | * There is also mandatory attribute ‘format-version’ whose value is the id of the persistence format. For now this it is always "r3" but in future there could be different formats. ) |
14 | | * There is a common child ‘title’. This is the name of the resource that is used in all user controls – the resource palette, links\timelines hud, bottom flap, etc. Its value is string: |
| 1 | SOPHIE 2.0 RESOURCE FORMAT [[BR]] [[BR]] |
| 2 | The R3 format is used for persistence of a sophie 2.0 resources. It is simply the archive of the root directory of the resource. It contains: [[BR]] |
| 3 | • _resource.xml file - xml description of all properties of the persisted resource [[BR]] [[BR]] |
| 4 | • _data folder - incorporates all embedded files like images, videos, large texts, etc. [[BR]] [[BR]] |
| 5 | • _cache folder- containing all cached remote resources for offline usage [[BR]] [[BR]] |
| 6 | • children directories – There is sub-directory for all child resources of the persisted one that have the same structure as the parent one. The names of those directories do not start with underscore and match the names of the child resources (not their titles!). [[BR]] [[BR]] |
| 7 | At the end of this page you can find a sample book. You can download it and open it with any file compression software (WinZip, WinRar, 7-zip, File Roller, etc) to gain a better understanding of the described structure. [[BR]] [[BR]] |
| 8 | Basically every resource could be persisted on its own so there are different file extensions for the different resources: ‘.page’, ‘.book’, ‘.frame’, etc. All of those are further extended by the generalized extension ‘.s2’. So if you were saving a page and you decided to name the file “Page A” the complete name of the file would be “Page A.page.s2”. [[BR]] [[BR]] |
| 9 | The key part of every resource directory is its _resource.xml. It is different for the different kinds of resources but there are some common things: [[BR]] |
| 10 | * It begins with a standard <xml> tag. [[BR]] [[BR]] |
| 11 | * The root tag is named ‘resource’. [[BR]] [[BR]] |
| 12 | * It has a mandatory attribute ‘kind’ that specifies the kind of the persisted resource (book, page…).[[BR]] [[BR]] |
| 13 | * There is also mandatory attribute ‘format-version’ whose value is the id of the persistence format. For now this it is always "r3" but in future there could be different formats. ) [[BR]] [[BR]] |
| 14 | * There is a common child ‘title’. This is the name of the resource that is used in all user controls – the resource palette, links\timelines hud, bottom flap, etc. Its value is string: [[BR]] |
25 | | }}} |
26 | | This means that the referenced resource is located in the parent directory of the current one and is called “Resource Jd88Us”. Notice that this is the actual name of the resource, not its title. |
27 | | * There is a ‘comment’ child that has a string value. |
28 | | * There is an ‘import-origin’child that has a string value. It represents the URI of the import origin of this resource. |
29 | | Those children nodes are common for all resources. They are not mandatory, though. So the ‘resource’ node could have some or all of them. When a property`s value is null there is no point in having empty tags for it. |
30 | | There are many other children nodes that could be found in a _resource.xml depending on the kind of the persisted resource. Here we are presented most of them specifying where you could see them. Basically all properties of a resource are saved in this xml file in appropriate form depending on the type of the kept value. |
31 | | When the persisted resource is a book its _resource.xml could have ‘page-size’ node that holds the size of the page- width and height: |
| 25 | }}} [[BR]] [[BR]] |
| 26 | This means that the referenced resource is located in the parent directory of the current one and is called “Resource Jd88Us”. Notice that this is the actual name of the resource, not its title. [[BR]] |
| 27 | * There could be a ‘comment’ child that has a string value. [[BR]] [[BR]] |
| 28 | * There could be an ‘import-origin’child that has a string value. It represents the URI of the import origin of this resource. [[BR]] [[BR]] |
| 29 | Those children nodes are common for all resources. Most of them are not mandatory, though. So the ‘resource’ node could have some or all of them. When a property`s value is null there is no point in having empty tags for it. [[BR]] [[BR]] |
| 30 | There are many other children nodes that could be found in a _resource.xml depending on the kind of the persisted resource. Here we are presented most of them specifying where you could see them. Basically all properties of a resource are saved in this xml file in appropriate form depending on the type of the kept value. [[BR]] [[BR]] |
| 31 | When the persisted resource is a book its _resource.xml could have ‘page-size’ node that holds the size of the page- width and height: [[BR]] |