Search
Schedule Serialization

The saveToXml and loadFromXml methods of the Schedule class let you save and load complete schedules to/from XML documents. The toJson and fromJson methods let you encode or decode a schedule into/from a JSON string, which could be used to store the whole schedule in a database table field or as a part of a larger file.

The following method saves the calendar to XML:

JavaScript  Copy Code

var xmldoc;
function toXml() {

  xmldoc = calendar.schedule.toJson();
  // calendar.schedule.saveToXml("data1.xml");
}

Any of the Contact, Item, Location, Recurrence, Resource and Task classes define their own saveToXml, loadFromXml, toJson, fromJson methods, which you can use to serialize their instances.

The "Serialization" tutorial provides you with a steb-by-step guide on how to save and load the schedule to/from a json file.