The DNR maintains several license agreements that are important when we provide or consume information from our users. The General Data & Software License Agreement should be used when users download data or software for their own use (e.g. GPS data). Our Community Guidelines should be used when data are collected from users for DNR use (e.g. photo uploads).
We have developed a very simple license tool to make it easy to add "click-though" license acceptance functionality to a web page. Here's an example.
Forcing license acceptance before following a link. Often you would like to have a license "click-through" as part of a standard HTML link (e.g a link to a download page). The license tool API allows this by just altering the link to the page. For example:
<a href="https://www.dnr.state.mn.us/">download</a> becomes
The showLicense() function takes 3 arguments:
- License type [string]: only 'gds' (general data software) is currently supported, others are forthcoming.
- (optional) Link [string]: URL to send the user to upon acceptance.
- (optional) Target [string]: Window name to open the URL in. Default target is the current window. Use 'new' to create a new browser window or tab.
Overriding default callbacks. Sometimes you'll want to use the license tool programatically. You do this by overriding the default callback functions defined by the API. They are called acceptLicense() and declineLicense(). The example on this page does just this. Instead of forwarding you to a link, it displays an alert and then hides the license. View the document source for an example.
Adding License Types
Adding a license types is straightforward but will require help from the webteam. Basically there are 3 steps:
- Create a stripped-down license file with just basic HTML. The page must use the 'ajax' page template. To do this just replace the default template of content_menu with ajax.(example)
- Register the new license with the license API. This involves a small edit to the license.js file and can only be made by the webteam.