Sending Forms in D-RATS

Goal

The goal of this feature is to allow users to define commonly-used forms dynamically with XML. D-RATS will then be able to pick up these forms and present them to the user in a way that will allow them to fill out the form field-by-field, and then send it over to another user. On the other side, it can be unpacked into the GUI again for response, or saved out to text in some manner.

Overview

There are two entities in D-RATS that you must understand to use forms. First is the form template. This is an object that defines a particular type of form and includes information about the name of the form, as well as the number and type of fields. The second is the idea of an instantiated copy of that form, which is just a copy of the template with data filled out.

To get started, open the template manager in D-RATS by going to File -> Manage Form Templates. From there, you'll see a window that shows you all of your existing templates (which may be none if you haven't created any. To create one, click the "New" button, which shows you an empty form box. At a minimum, give the form a name and a unique ID (any value with no spaces or special characters in it:

http://d-rats.danplanet.com/screenshots/drats_form_builder_newform.png

Then, add a field by clicking the "Add" button. Choose the "text" type and leave the "Initial Value" blank. Hit the "OK" button and you should have something that looks like this:

http://d-rats.danplanet.com/screenshots/drats_form_builder_newfield.png

Click in the ID and Caption fields to give them meaningful values. When you're done, hit the Preview button, which shows you what the form will look like when it's filled out by a user:

http://d-rats.danplanet.com/screenshots/drats_form_builder_preview.png

Click the Close button and add some more fields. When you are done, click the Save button to go back to the template form list. Click the Close button here to go back to the main screen.

Next, click make sure Advanced mode is enabled (View menu) and click on the "Form Manager" tab at the bottom. You should see an empty list, so click the "New" button to create a new form instance. Choose the type of form you just created, and you should be presented with your form. Fill out the values and click the "Save" button. Your new form instance will show up in the list. Click in the "ID" field and give it a meaningful value, such as "memo to send to Tom". You can now send your form by highlighting it and clicking the "Send" button. Make sure someone else has clicked the "Receive" button ahead of time.

XML Format

The forms and templates are stored in XML format. Here are some examples that demonstrate the schema and possible elements.

Here is an example ICS-213-like form:

<xml>
  <form id="ics213">
    <title>ISC-213 Form</title>
    <field id="number">
      <caption>Number</caption>
      <entry type="text"/>
    </field>
    <field id="precedence">
      <caption>Precedence</caption>
      <entry type="text">TR</entry>
    </field>
    <field id="station">
      <caption>Originating station</caption>
      <entry type="text"/>
    </field>
    <field id="place">
      <caption>Originating location</caption>
      <entry type="text"/>
    </field>
    <field id="time">
      <caption>Time</caption>
      <entry type="text"/>
    </field>
    <field id="date">
      <caption>Date</caption>
      <entry type="text"/>
    </field>
    <field id="recip">
      <caption>Recipient</caption>
      <entry type="text"/>
    </field>
    <field id="sender">
      <caption>Sender</caption>
      <entry type="text"/>
    </field>
    <field id="subject">
      <caption>Subject</caption>
      <entry type="text"/>
    </field>
    <field id="message">
      <caption>Message</caption>
      <entry type="multiline"/>
    </field>
  </form>
</xml>

The above XML (currently) generates the following GUI:

http://d-rats.danplanet.com/screenshots/drats_form_ics213.png

The following XML:

<xml>
  <form id="memo">
    <title>Informal Memo Form</title>
    <field id="time">
      <caption>Time</caption>
      <entry type="time">22:13:08</entry>
    </field>
    <field id="date">
      <caption>Date</caption>
      <entry type="date">01-Jan-2008</entry>
    </field>
    <field id="recip">
      <caption>Recipient</caption>
      <entry type="text"/>
    </field>
    <field id="sender">
      <caption>Sender</caption>
      <entry type="text"/>
    </field>
    <field id="subject">
      <caption>Subject</caption>
      <entry type="text"/>
    </field>
    <field id="message">
      <caption>Message</caption>
      <entry type="multiline"/>
    </field>
  </form>
</xml>

generates the following simple informal memo GUI:

http://d-rats.danplanet.com/screenshots/drats_form_memo.png

Planned improvements to the above:

Forms (last edited 2008-03-10 15:48:24 by localhost)