[Geomoose-users] Generate link to document based on query result?

Johan Forsman Johan.Forsman at LA.GOV
Wed Sep 30 15:04:03 EDT 2009


Gentlemen:

Many thanks to Jeremy Johnson (offline) and Brian Fischer (below)!

I have applied the suggested solutions and they work beautifully!

Since everything is great now I should probably go home before it all blows up again.

Thanks again, until next time.

/Johan.

-----Original Message-----
From: Brian Fischer [mailto:bfischer at houstoneng.com] 
Sent: Wednesday, September 30, 2009 1:54 PM
To: Johan Forsman; geomoose-users at lists.sourceforge.net
Subject: RE: Generate link to document based on query result?

Johan,
You can do this directly in the template file.  Here's an example:
<!-- MapServer Template -->
<tr bgcolor="#DEE5EB"><td colspan="2"><b><u>Watersheds</u></b></tr>
<tr>
<td colspan="2">- <a href="http://cfpub.epa.gov/surf/huc.cfm?huc_code=[HUC_8]" target="_blank">EPA Surf Your Watershed Information</a></td>
</tr>
<tr>
<td colspan="2">- <a href="http://www.esg.montana.edu/gl/huc/[HUC_8]" target="_blank">Montana State Environmental Statistics Information</a></td>
</tr>
<tr>
<td colspan="2">- <a href="http://water.usgs.gov/lookup/getwatershed?[HUC_8]" target="_blank">USGS Science in Your Watershed Information</a></td>
</tr>
<tr>
<td align="right"><b>HUC 8 #:</b></td>
<td>[HUC_8]</td>
</tr>
<tr>
<td align="right"><b>HUC 8 Name:</b></td>
<td>[HU_8_NAME]</td>
</tr>
<tr>
<td align="right"><b>HUC 10 #:</b></td>
<td>[HUC_10]</td>
</tr>
<tr>
<td align="right"><b>HUC 10 Name:</b></td>
<td>[HU_10_NAME]</td>
</tr>
<tr>
<td align="right"><b>HUC 12 #:</b></td>
<td>[HUC_12]</td>
</tr>
<tr>
<td align="right"><b>HUC 12 Name:</b></td>
<td>[HU_12_NAME]</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>

Brian Fischer, CFM  GIS Project Manager
Houston Engineering, Inc.
Phone: W: 763.493.4522 / M: 763.229.2734


-----Original Message-----
From: Johan Forsman [mailto:Johan.Forsman at LA.GOV] 
Sent: Wednesday, September 30, 2009 1:33 PM
To: geomoose-users at lists.sourceforge.net
Subject: [Geomoose-users] Generate link to document based on query result?

Hello All:

Kindly pardon the interruption. I am a new Geomoose user learning fast, but apparently not fast enough. In this case I may even have trouble formulating the question properly.

I run Geomoose2 in the MS4W iteration on a single-purpose XP Workstation, using shapefiles as data sources.

In short: I wish to insert a link to a different specific document for each result returned by the query function or the identify function.

Longer version: The query and identify functions work just fine and return the expected results when I use them. I have successfully adapted the templates that came with the parcels demo to display the data relevant to us. What I want to do is, for each record returned by either function, dynamically generate a link to a PDF file stored in a separate directory on the server. The PDF files have names that are identical to a field in the shapefiles being queried. I want this link to be clickable in the Results tab next to the other data returned by the query/identify functions, so that when the user clicks on the link it will open on their local workstation with their preferred PDF reader.

To explain further, the critical field in the shapefile is [PWSID], and this field contains strings of the form "LA1234567" where the numbers vary but the first two characters do not. For that sample PWSID there would be a PDF file named "LA1234567.pdf" stored in a directory directly under my map directory.

So, I imagine a generated URL would look something like "http://myserver/PDFdirectory/[PWSID].pdf".

Can I accomplish this directly in the template file? If so, how? I have not been able to answer this question by sifting through the MapServer documentation.

If not, what options do I have to enable this functionality? I should add I do not program in any of the involved languages. I know just enough to be dangerous and stumble my way through making modifications to existing code. The "Undo" function is my friend, as are the copies I keep of the files.

In addition, I suspect I may need some tweaking to Apache so the PDFdirectory is accessible from the document root?

Please let me know what I need to clarify.

Thanks for your patience,
Johan.

----------------------
Johan Forsman, M.Sc.
Geologist
Safe Drinking Water Program
Louisiana Department of Health and Hospitals
Office of Public Health
Telephone: 225.342.7309
Telefax: 225.342.7303



------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Geomoose-users mailing list
Geomoose-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geomoose-users




More information about the Geomoose-users mailing list