Files and Formats

Competition Files

For maximum compatability between web and local deployments, all competition files are stored in the browser’s LocalStorage. Competition files can otherwise be exported and imported as .meet files from within the application.

Local File Storage

Local installations store all files in the user’s Documents folder, in a subfolder called Tempus.

  • Documents

    • Tempus

      • BrowserCache/

      • ServerCache/

      • settings.json

BrowserCache/

Local cache used by the browser loaded into the client application. This includes the LocalStorage used to store the competition files.

ServerCache/

Offline cache of data normally retrieved from the server.

settings.json

Default settings for all new competitions. (see also)

JSON file headers

Every JSON file used by Tempus should use a standard header to identify the file and the data within.

{
    "Type": "Settings",
    "Version": 1,
    "Revision": "ed565fd9-59b4-4da1-9585-1871b7d16676",
    "Content": {}
}   
  1. Type: A string identifying the data in the file

  2. Version: The schema version of the file, to be used by the deserialization process

  3. Revision: A GUID generated on the save to detect concurrent writes

  4. Content: The JSON Content of the file.

Server File Storage

Files that are centrally managed are considered Server Files, or files that are stored and managed on a server. Server files are cached locally in the ServerCache/ folder. Server files will be updated frequently - changes to these files must not break loading older competition files. If files are time-sensitive, they must be part of the competition file.

Organizations

The organizations file is a list of organizations, such as regional clubs and governing bodies. If an organization goes defunct, it must still be included in this file as not to break loading older competitions. Defunt organizations should be marked as inactive via the Active flag in the file.

Skaters

This is a list of all current skaters as well as their seed times. This file is only used for initially loading skaters into a competition with their seed times. Both the skater and their seed times are then stored in the competition file.

Competition File Serialization

The competition files are stored in JSON format. Files are written in the JSON format for the sake of debugging serialization errors and emergency manual modification - not interoperability.

Backwards Compatability

Tempus should be able to read older file versions by means of the Version property in the serializer. In the current state of development, however, massive changes to the schema are expected and thus backwards-compatabilty is not strictly enforced.

Instance References & Interoperability

The JSON files represent memory graphs of the internal memory structure, and can thus contain circular references. If any object instance in the JSON file is duplicated, the duplicated reference is replaced by a reference pointer property called __backreference. Every new object that is serialized is stored in a backreference table. When an object is encountered that has already been serialized, the object’s data is replaced by a __backreference property with a pointer to the index of the previously serialized object. This will likely prohibit any application other than Tempus from reading the file.

Development Support

Any class that requires serialization must implement the ISerializable interface.

Because of instance backreferences, the properties must be deserialized in the same order in which they are serialized.