Open Source Content Management Framework

mRFC 0033: Midgard Object serialization

  1. Revision history
  2. Background
  3. Namespace
  4. MidgardObject
  5. Multilingual data
  6. Parameters and attachments
  7. Minimal XML schema file:
  8. Example:
  9. References:

Revision history

  • 2006-09-22 Updated by Piotr Pokora, added fixed 'midgard_object' root element to xml schema

Background

This mRFC describes xml file format which should be used for objects' replication, and for data exchange between Midgard and other systems. It is impossible to define xml file format for every type registered in Midgard type system , however this mRFC focuses on minimal xml schema (2) file which should describe serialized Midgard object. Xml file with serialized Midgard Object should contain Midgard namespace, Midgard Object type name, optionally its guid and lang which identify object and common metadata.

Namespace

Midgard namespace should be defined as: __http://www.midgard-project.org/midgard_object/1.8__

( Optionally namespace could define Midgard version for which given xml file can be used )

MidgardObject

Midgard type should be defined as complexType identified by name of string type. Optionally 'guid' and 'lang' atributes could be used to identify Midgard Object. Guid attribute if used should be at least 28 and at most 80 characters long (1). Lang (3) attribute should be 2 letter language code name and define available languages enumeration.

For better understanding and connectivity , midgard-core should have implemented functionality to create xml schema file for any type registered in Midgard Schema. Additionally this implementation should create languages enumeration for all available languages (3) in Midgard environment. Every Midgard object's property should be defined as element type with optional attributes.

Multilingual data

If serialized object is multilingual Midgard type and more than one language is used for such object , all language content objects should be serialized and stored in one xml file. In such case deserialization implementation should return array of multilingual objects, and lang attribute's value should be mandatory set in xml file.

Parameters and attachments

Optionally , object's paramaters ( registered as standalone midgard_parameter type ) and object's attachments ( registered as standalone midgard_attachment type ) could be serialized and stored in object's xml file.

Minimal XML schema file:

<?xml version="1.0"?>


Example:

 <?xml version="1.0" encoding="UTF-8"?>
 <midgard_object xmlns="http://www.midgard-project.org/midgard_object/1.8">
   <midgard_article guid="26b621b938c4aea0e021d4baae69d6ab" lang="en">
     <metadata>
       <creator></creator>
       <created>1999-05-07 18:04:04</created>
       <revisor></revisor>
       <revised>2006-09-10 09:28:08</revised>
       <revision>1</revision>
       <locker></locker>
       <locked>1999-08-17 16:01:32</locked>
       <approver></approver>
       <approved></approved>
       <authors>f6b665f1984503790ed91f39b11b5392</authors>
       <owner></owner>
       <schedulestart></schedulestart>
       <scheduleend></scheduleend>
       <hidden>0</hidden>
       <navnoentry>0</navnoentry>
       <size>481</size>
       <published>1999-05-07 18:04:04</published>
       <score>0</score>
       <imported></imported>
       <exported>2006-09-14 12:37:40+0000</exported>
       <deleted>0</deleted>
     </metadata>
     <action></action>
     <id>2</id>
     <created>1999-05-07 18:04:04</created>
     <revisor>f6b665f1984503790ed91f39b11b5392</revisor>
     <score>0</score>
     <title>Host Administration</title>
     <abstract>Midgard host and directory management
 </abstract>
     <locker>f6b665f1984503790ed91f39b11b5392</locker>
     <caldays>0</caldays>
     <approved></approved>
     <calstart>0000-00-00</calstart>
     <content><p>
 Use the host administration tool to create and maintain the       structure and functionality of your web sites. Use the layout adminstration tool for controlling the appearance of the site and the content administration tool for the dynamic content of the site.   </content>
     <icon>0</icon>
     <type>0</type>
     <creator>f6b665f1984503790ed91f39b11b53922</creator>
     <revised></revised>
     <approver>0</approver>
     <extra1></extra1>
     <name></name>
     <author>f6b665f1984503790ed91f39b11b5392</author>
     <url></url>
     <contentauthor>1</contentauthor>
     <contentcreated>1999-05-07 18:04:04</contentcreated>
     <print>0</print>
     <extra2></extra2>
     <view>0</view>
     <extra3></extra3>
     <revision>0</revision>
     <sid>2</sid>
     <locked>1999-08-17 16:01:32</locked>
     <up>d0099a92c1018461bc6e33cd0a1c435b</up>
   </midgard_article>
 </midgard_object>

References:

  • http://www.midgard-project.org/development/mrfc/0018.html
  • http://www.w3.org/TR/xmlschema-0/
  • http://www.loc.gov/standards/iso639-2/index.html

Back

Designed by Nemein, hosted by Anykey