Difference between revisions of "Developer notes"

From WormBaseWiki
Jump to navigationJump to search
Line 3: Line 3:
 
A number of elements are repeated across the AceDB schema. To make the external model easier to maintain, fetching and parsing of these elements is stored in one place and accessible to all models.  Whenever you come across one of these tags, you can use the predefined code.
 
A number of elements are repeated across the AceDB schema. To make the external model easier to maintain, fetching and parsing of these elements is stored in one place and accessible to all models.  Whenever you come across one of these tags, you can use the predefined code.
  
<table>
+
<table border="1">
 
<tr><th>Expected AceDB model tag</th><th>Object.pm method</th><th>config field</th><th>template macro</th></tr>
 
<tr><th>Expected AceDB model tag</th><th>Object.pm method</th><th>config field</th><th>template macro</th></tr>
 
<tr><td>Laboratory</td><td>laboratory()</td><td>"fields laboratory"</td><td>laboratory</td></tr>
 
<tr><td>Laboratory</td><td>laboratory()</td><td>"fields laboratory"</td><td>laboratory</td></tr>
 +
<tr><td>(indirect, returns name and ID of object</td><td>name()</td><td>"fields name"</td><td>name</td></tr>
 
<tr><td>Remarks</td><td>remarks()</td><td>"fields remarks"</td><td>remarks</td></tr>
 
<tr><td>Remarks</td><td>remarks()</td><td>"fields remarks"</td><td>remarks</td></tr>
 
<tr><td>Species</td><td>taxonomy()</td><td>"fields taxonomy"</td><td>taxonomy</td></tr>
 
<tr><td>Species</td><td>taxonomy()</td><td>"fields taxonomy"</td><td>taxonomy</td></tr>

Revision as of 16:21, 23 February 2011

Common Model Elements

A number of elements are repeated across the AceDB schema. To make the external model easier to maintain, fetching and parsing of these elements is stored in one place and accessible to all models. Whenever you come across one of these tags, you can use the predefined code.

Expected AceDB model tagObject.pm methodconfig fieldtemplate macro
Laboratorylaboratory()"fields laboratory"laboratory
(indirect, returns name and ID of objectname()"fields name"name
Remarksremarks()"fields remarks"remarks
Speciestaxonomy()"fields taxonomy"taxonomy


Here's how to use them.

1. Be certain to add the appropriate configuration to wormbase.conf (eg "fields remarks").

2. Add stub documentation in your model for the shared field. (THIS STEP SUBJECT TO CHANGE)

3. In the appropriate template, include the macro. Some macros take optional parameters.

[% remarks %]

File paths

It's important to be consistent with where we place things on the filesystem since it makes it easier to find things, and easier to handle proxy redirects. Here are some rough guidelines.

Static content

html/ - All static content (and only static content) belongs in html/. html/js - javascript files. Create subdirectories as necessary html/css - stylesheets (see below)

Temporary images and files

/tmp
/var/tmp

Temporary files should be placed outside of the document root. This includes any files that need to expire at the end of a given release cycle.

Images


CSS

Please consolidate style information into one of the existing stylesheets or creat a new one if necessary. Please try to avoid using style information inline in a document.

Constants

Constants should be defined in conf/elegans.pm.