Module Specifications for Module: Sahnana CAP Aggregator

It is an independent module not relying on Sahana Messaging Module.

Files:

  • main.inc
  • handler_cap_msg.inc
  • lib_cap.inc
  • main_fns.inc
  • handler_cap_subcribe.inc
  • install/dbcreate.sql
  • cap.js

Module Work flow:

On clicking the menu item “CAP aggregator” on Sahana Main page, the url would be http://localhost/sahana/www/index.php?mod=capagg&act=default. Here is the screenshot of the module.

The Module has two pages, one showing recent cap alerts, and other showing list of subscribed cap servers. While recent cap alerts is updated by a timeout mechanism frequently, it shows up recent CAP alert as list with following information on the visible part, and a Map with markers showing the alert affecting area.

a. <headline> element from CAP file this would be in three colors according to the <severity> of the msg, e.g. red color for extreme and so on.

b. <updated> element from CAP file this shows the date and time when the entry was updated

c. <severity> element from CAP file this shows the severity of the msg,

d. <title> element from feed entry CAP file this shows the src of the CAP feed. e. <link> element from the CAP file This would be the permanent link to the CAP alert xml file.

* For each CAP alerts all the above information is shown.

Various filter options are available to sort the alerts,

  • Based on Server
  • Based on Severity
  • Based on Date
  • Based on Category
  • Based on Watch Window

In addition,

  • With each alert there is a icon “SMS” it allows user to share this information with other people using “sms”.
  • With each alert there is a icon “Tweet This” it allows user to share this information with other people using “twitter”.
  • With each alert there is a icon “MAP” it allows user to see this information on map.

Next, link will show the older alerts, and previous would take back the user to the previous list of alerts.

Database Schema for CAP aggregator Module

cap_agg.sql

  • Id [Auto incerment,primary key]
  • Feed_url [Varchar(100)]
  • server_name [Varchar(100)]
  • last_updated [timestamp]
  • total_entries [Int(5)]
  • server_location [varchar(100)]
  • author [varchar(100)]
  • verified [bool]
  • avg_update_time [int(3)]
  • subscription_date [timestamp ]
  • User [varchar(30)]
  • Priority [int(2)]
  • Verified [Bool]
  • Deleted [Bool]
  • Unread [Int(3)]

cap_agg_alerts.sql

  • Id [Auto incerment,primary key]
  • Title [Varchar(150)]
  • Area [varchar(200)]
  • Type [varchar(50)]
  • Area [varchar(200)]
  • Severity [Int(200)]
  • Link [varchar(200)]
  • Status [varchar(50)]
  • Updated [timestamp]and something like below would show up int the main display area of the module,
  • Category [varchar(50)]
  • Urgency [varchar(50)]
  • Certainity [varchar(50)]
  • LongLat [varchar(50)]
  • Alert_file_name [varchar(100)]
  • Feed_id [varchar(100)]

The list of subscribed servers, shows list from database, of the servers subscribed by the user.

Some important functions:

  • _shn_cap_show_alerts()
  • _shn_cap_update_alerts()
  • _shn_cap_delete()
  • _shn_cap_map_all()
  • _shn_show_top_alerts()
  • _shn_cap_cap_msg()
  • _shn_cap_cap_map()
  • convert_time()
  • discover_feed()
  • getFeedLocation()
  • getFile()
  • saveCAP()

Classes

  • parseFeedIndex
  • fetchCap

Installation and User Guide

Feeds

This section contains both CAP and RSS/GeoRSS feeds used for testing.

CAP

RSS/GeoRSS