Version 30 (modified by James O'Neill, 11 years ago) ( diff )


Allow person entities (people, groups, organisations) to save a search and be notified when the results change.


In an event of disaster, this functionality would help a lot in terms of providing information (take the example of dissemination of information related to availability of food, shelter, hospitals etc.). The project's essential capability is to disseminate information about various aspects through various means such as email/twitter/sms. Integrating this service into a Sahana Eden system will add to the platforms' capability of tackling various issues faced in emergency/disaster management.


A single model for holding information about the search query and the parameters that are saved by the user. This will be in /modules/eden/ as a component of pr_entity.

Saved Search

Name of the saved search as specified by the user.
The person entity to be notified when the search results change. Defaults to the pe_id record associated with the current user account.
The query string for the search.
Format for the notification, either a list (default), map, report, graph (this is a report).
Subscription mode, e.g., email (default), Twitter, SMS.
How often the search is checked for changes, e.g., never (default), every 15 minutes (not hourly?), daily, weekly and monthly.
The date and time the search was last executed by the subscription method. Set to match modified_on when record is first created.

Public Saved Searches

The saved search to make public.


Each search page will have a widget the user can activate to save the current search. They will be directed to a new page where they can type a name for the search.

Saved Search List

Each person entity has a component for saved searches. This page will list all searches saved for this person entity, displaying the name of the search (as defined by the user when it was saved) and the query parameters.

(The any/all option will require special extraction)

Query parameters will be displayed as human-readable definition lists, e.g.:

Search Organisations (?)
search strings
Any of
  • Red Cross / Red Crescent
Any of
  • DRR
  • Food Security
Home Country
Any of
  • New Zealand

The user will have three options for each search record:

  • run executes the search
  • edit allows the user to edit the saved search record
  • delete deletes the saved search record

Saved Search Edit

A page to edit a saved search. The name, pe_id, notification_format, notification_method and notification_frequency can be changed here.


  1. User executes search
  2. Activate Save Search widget
  3. Redirected to Save Search add form
  4. Name search
  5. Request is sent to /msg/search_notifications/, with the first query string argument specifying what period this applies to, e.g., daily, monthly, etc.
  6. Records with a modified_on value greater than last_executed are returned.
  7. last_executed field updated to when the request was made.
  8. If the pr_entity is a group, fetch the appropriate contact details from each member. Recursively?
  9. Format the response for special media, e.g., Twitter, SMS.


  • Implement model
  • Implement representation functions for query string
  • Implement or update controllers
  • Extend OAuth implementation for Twitter and Facebook to allow posting to users account.


  • Save a search without any filters.
  • Save a search after performing a search with filters.
  • Attempt to save a search with empty name; must fail.
  • Edit and save a saved search.
  • Executing a search from the saved search list page.
  • Sending the notification email

Attachments (4)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.