webCOMAND

XML

XML files can store repository content types, content and data. XML is a useful format for repository content because it is open and can be read and written by people and software. However, it is not efficient with regard to files size or read and query performance.

In addition to being used for the standard file system storage engine format, XML files can also be used for backups and to transfer content from one repository to another.

COMAND XML files follow some basic rules.

  • The top-level node is always named "comand" and must have a version attribute. It may also have a source attribute to indicate how to locate the repository that produced the file, and last-modified attribute to indicate when the file was originally produced.
  • Nodes under the contents node alternate between object and fields down the node hierarchy.
  • Objects are enclosed by tags named after their content type identifier.
  • Object nodes may define OID or UUID attribute that references object nodes defined in the XML with the same OID or UUID.
  • Object nodes may define an OID or UUID attribute that reference objects not defined in the XML. If an object with the specified OID is not contain in the file, the source repository must have been specified, so that it may be queried for the object with the OID. If a UUID is specified and a source repository isn't, or it is not available, other repositories may be searched for an object with the same UUID.
  • Fields are enclosed by tags named after the field identifier.
  • Field nodes that represent a data type field value may either enclose a text value or reference a file that contains the field value with a file attribute. The file may be referenced by a relative or fully qualified URL. The contents of the file referenced will be interpretted as text or binary data based on the field type.
  • Field nodes that represent a content type field object may enclose zero or more object nodes.

Example

<?xml version="1.0" encoding="UTF-8" ?>
<comand version="1.0" source="https://comandsystems.com/comand"
    time="2013-10-16 15:39:25 +0400">
	<title>Contacts</title>
	<description>Some contacts with photos.</description>
	<contents>
		<Contact>
			<ID>13</ID>
			<OID>2458</OID>
			<UUID>550e8400-e29b-41d4-a716-446655440013</UUID>
			<Type uuid="550e8400-e29b-41d4-a716-446655440123" />
			<Name>Mary Smith</Name>
			<EmergencyContact oid="2460" />
			<PhotoFilename>profile.jpg</Filename>
			<Photo file="files/1.jpg" />
			<Phones>
				<Phone>
					<ID>1</ID>
					<OID>2478</OID>
					<UUID>550e8400-e29b-41d4-a716-446655442323</UUID>
					<Type uuid="550e8400-e29b-41d4-a716-446655441122" />
					<Number>555-555-5555</Number>
					<Description>Mobile</Description>
				</Phone>
			</Phones>
		</Contact>
		<Contact>
			<ID>15</ID>
			<OID>2460</OID>
			<UUID>550e8400-e29b-41d4-a716-446655440015</UUID>
			<Type uuid="550e8400-e29b-41d4-a716-446655440123" />
			<Name>John Smith</Name>
			<EmergencyContact oid="2458" />
			<PhotoFilename>mug.jpg</Filename>
			<Photo file="files/2.jpg" />
		</Contact>
	</contents>
</comand>

Need to formally document XML format in full detail.