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

Johan Forsman Johan.Forsman at LA.GOV
Wed Sep 30 14:32:41 EDT 2009


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






More information about the Geomoose-users mailing list