Implementation |
|
To implement this tool I worked closely
with a systems administrator named Suzanne Richer, who works out of
Porters Lake, Nova Scotia. This was a very interesting setup,
because after agreeing to work with Brad I never physically met with him
or Suzanne during the entire project. To tell the truth I've never
even spoken to Suzanne on the phone!
Suzanne does contract work for the DFO, and she assisted me with any problems that I had and also set up the atlas that my tool was to be added to. To implement my tool I needed to create four files:
stream_obs_entry_form.cfm: Once the user navigates through the atlas and finds their location of interest, he/she digitizes a "stream observation" point by selecting the "Digitize a Point" tool under "Mapping Tools". As soon as they click on the location to be digitized, a form pops up. This form is the stream_obs_entry_form.cfm ColdFusion file that I created. This form has the regular HTML that is required to make a form, but also takes in 4 variables from MapGuide. These are LAT, LON, NORTH, and EAST. It is these coordinate variables that makes the database spatial. To view the source code for stream_obs_entry_form.cfm, click here. Once the user has entered all of the required information, he/she clicks on the submit button. This takes the user to the submit_stream_obs.cfm page. submit_stream_obs.cfm: This page is a confirmation page to let the user know the information has been sent. There is also one line of code at the beginning (<CFINSERT datasource="SFU" tablename="SHIM">) that initiates the submission of the form data into the database. This is a complicated task, but ColdFusion makes it much easier in this case. To view the source code for submit_stream_obs.cfm, click here. Once the data has been submitted, the user is taken back to the atlas page and the map is automatically refreshed* so that the new data point is shown. *Automatic refreshing has not yet been implemented yet but will be completed by Monday, Nov. 26, 2001. stream_obs_report_form.cfm: Once there are points on the atlas a user can request a report by selecting a point and clicking the "View a Report" button. When the this button is clicked, MapGuide finds the primary key value (an automatic integer assigned when the point is created) and sends it to stream_obs_report_form.cfm. When this page is invoked, it takes the primary key and queries the database for the corresponding record. When the record is found, the values for the variables are extracted and presented in a report form. To view the source code for stream_obs_report_form.cfm, click here. SFU.mdb: This is a Microsoft Access Database file. This is the underlying database of the "stream observation" theme. Each time data is submitted via the entry form a record is added to the database, and the map is dynamically linked to this file and thus shows each point immediately after entry. The database contains one field for each variable, plus the extra fields for coordinates and a date stamp to record when the data was submitted.
*Not all fields shown in this picture From this picture it is evident that each variable is assigned a data type such as number or text. This helps ColdFusion decide whether or not an entry is valid or not, and if a user were to try to enter text in the DateSurveyed column an error message would be displayed. |
This site was last updated 11/24/01