Howto create a custom form

The ProteomeCommons.orgs Tags tools are flexible and can make custom forms. In order to do this you must create a webpage that includes the rules for your custom form and pass this webpage's URL to the annotation tool. Creating the rules for a new form is simple and can be down easily from programs such as Excel. The rules are listed below.

You can either browse the information below or click on the given links to warp to a particular section.

Basic Rules

Here are the basic rules. Each line specifies one rule and line must contain a name, default value, description, if the field is required, the type of validation, and if a enumeration the values of the enumeration. Each field is seperated by a comma. Here is an example.

Title,,Enter the title of your submission.,Required,Any,

The above example is for a field named "Title". No default value is used. The description is "Enter the title of your submission." The field is required. And any value can be entered. Since "Any" is used for the validation type, not "Enumeration", no values are specified after the last comma.

Conveniently the above example can be opened directly in Excel and each value appears in its own column. Try saving the above as a file with a ".csv" extension and open it in Excel. You can then add and modify information, even adding rows for new fields. When done, save the file as a ".csv" and you are set.

If you want to include a comma in your description

There is one important caveat to using the comma-seperated format. You can't directly add a comma in to you own field names or descriptions. If you do, you'll confuse the annotation tool. The work around is to use "\," instead of the normal comma character. For example, using the description "Choose and Apple, Orange, or Banana." would be written as "Choose an Apple\, Orange\, or Banana.". Here is what the rule line would look like.

Favorite Fruit,,Choose an Apple\, Orange\, or Banana.,Required,Any,

This is the general strategy for including commas in descriptions or titles.

Enumerations and other validation types

The annotation tool includes support for notifying users if they are entering invalid information. The last two values in the rule line specify this information, and there are currently three forms of validation: "Any", "Number", and "Enumeration". "Any" is the default it means any value is allowed. "Number" means that any numerical value is allowed. "Enumeration" means that one of the expected values is allowed where the expected values are specified at the end of the rule line. For an "Enumeration" example, consider the rule line in the above section that uses "Apple", "Orange", or "Banana". Above the rule uses "Any" which means the user could actually enter any value that they please. A better way to enforce one of the three expected values is to use an enumeration as specified below.

Favorite Fruit,,Choose an Apple\, Orange\, or Banana.,Required,Enumeration,Apple\,Orange\,Banana

Note that the values you want to allow are seperated by commas, but since the commas are part of the value they must be escaped using "\,".

Using your custom rules with the existing annotation tool

The final step to using your custom rules with the annotation tool is to specify the rules when you launch the tool. You can do this by making a URL that includes a link to the annotation tool and a link to your custom rules. Specify the link to your rules using the "rules" request parameters. Here is an example.

http://www.proteomecommons.org/tags/ProteomeCommons.org-Tags.jnlp?rules=http://mywebsite.com/myrules.csv

In the above example, "http://mywebsite.com/myrules.csv" is used as the URL to the rules file. Replace that URL with whatever URL contains your rules.