Skip to content
Snippets Groups Projects
Select Git revision
  • test/issue-1775
  • master default
  • rave
  • ORIGINAL_2007
4 results

UNL_Alert

user avatar
Saron Gebre authored
d6d60bab
History

PURPOSE

Proxies UNL Alerts issued from external vendor applications so they can be distributed in CAP format.

SETUP

  1. Copy configsample.inc.php to config.inc.php
  2. Configure CRON to run the scripts/exportCAPAlert.php every minute

Expectations

This application is designed to proxy an alert feed (such as an RSS feed) from a vendor alerting service and output that message in the Common Alerting Protocol (CAP). This is an XML format. It has been translated to JSON for easier integration with the UNLedu web framework.

The scripts that proxy the alert from the vendor are expected to be run at a regular basis, such as via the CRON utility. CRON does have a limitation being able to run something no more frequent than every minute. It may be desired to build some simple daemon script that fetches the content more frequently.

The UNLedu Framework is expected to regularly request the JavaScript file www/json/unlcap.js and display the alert if one exists.

Automated Testing

Run automated tests via this command pyrus run-phpt tests

Local Installation

  1. Clone and configure configure virtual host for WDN Repo
  2. Clone UNL Alert and configure virtual host to point to UNL_Alert/www
  3. Update www/json/unlcap.js to use a test alert data. For example: unlAlerts.data = {"alert":{"identifier":"cd32fb091ecd347f4d49f7b53b073b9d","sender":"police.unl.edu","sent":"2024-06-10T19:17:39+00:00","status":"Test","msgType":"Alert","scope":"Public","note":"This is only a test2","info":[{"category":"Safety","event":"UNL Alert","ugency":"Immediate","severity":"Extreme","certainty":"Observed","headline":"Mark Only Test","description":"UNL Alert: this is a test3","web":"http://www.unl.edu/"}]}};
  4. Update alertDataURL in wdn/templates_5.3/js-src/unlalert.babel.js to point to your localhost alert's unlcap.js file (e.g https://localhost.unl.edu/json/unlcap.js)
  5. Use test SHTML files like debug-clean.shtml in the WDN project you have cloned to verify that the alert banner is working
  6. If the banner is not displaying, try disabling your browser's cache.

last updated July 17, 2024