Skip to content

Adding a new ndi_document type

Steve Van Hooser edited this page Jun 20, 2020 · 1 revision

Making a new NDI document type involves 4 steps:

  1. Examine the existing NDI document types to make sure there isn't an existing document type that meets your needs. You can compose document types and make subtypes of a document if you like. If your document depends on information that is present in another document, you can add a reference to this document's ID in the 'depends_on' fields.

  2. Decide on the field names and acceptable types of values for your new document.

  3. Open this template file in your favorite text editor. On the Mac, this might be TextEdit (make sure you choose "Make Plain Text" under the format menu). On a PC, this might be Notepad.

    1. Replace newdoctemplate with your new document name in all occurrences.
    2. Under the structure with your document name near the bottom, edit the field names to match the desired fields of your new document. Examples are given. Note that each field and value combination should look like "field": value, with a comma at the end unless you are at the last fieldname; then there should be no comma.
    3. If your document depends on other documents, then edit the "depends_on" field entries to name the dependencies. Leave the "value" field as a blank string (a program will fill in the document id of the dependent document each time a new document is created). Again, pay attention to the comma/no comma (use a comma when additional entries are necessary, no comma if not). If you don't need to use any dependent documents, you can delete this whole section.
    4. Test that your file is a valid JSON file with the following MATLAB code: j=jsondecode(textfile2char('ndi_document_yourfilename.json')) where yourfilename is the name of your file. If there are any errors, correct them.
  4. In the future, we will have instructions for creating a schema here.

  5. Send your new document to a developer (like Steve) in email.

Clone this wiki locally