Changes between Version 35 and Version 36 of BluePrint/SaveSearch_Sub
- Timestamp:
- 08/29/12 23:45:06 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BluePrint/SaveSearch_Sub
v35 v36 15 15 name:: 16 16 Name of the saved search as specified by the user. 17 description::18 Description of the Saved Search19 17 pe_id:: 20 18 The person entity to be notified when the search results change. Defaults to the pe_id record associated with the current user account. … … 31 29 public:: 32 30 Is this saved search viewable to everyone? This should trigger an authorisation process. Boolean, default is `False`. 31 comments:: 32 Reusable comments field for the user to write in. 33 33 34 34 === Views === … … 44 44 45 45 {{{ 46 org _search_text_advanced=red+cross&org_search_type=3&org_search_sector_filter=any&org_search_sector=3&org_search_sector=2&org_search_home_country=NZ46 organisation.country__belongs=NZ&organisation.organisation_type_id__belongs=2&organisation.sector_id__anyof=1%2C2&parent.acronym%7Cparent.name%7Cacronym%7Cname__like=%2Ared%2A 47 47 }}} 48 48 … … 50 50 51 51 {{{ 52 Search=red crossAND Type=Red Cross / Red Crescent AND Sector=DRR,Food Security AND Home Country=New Zealand52 Search=red AND Type=Red Cross / Red Crescent AND Sector=DRR,Food Security AND Home Country=New Zealand 53 53 }}} 54 54 … … 63 63 A page to edit a saved search. The `name`, `pe_id`, `notification_format`, `notification_method` and `notification_frequency` can be changed here. 64 64 65 === Workflow === 66 1. User executes search 67 1. Activate Save Search widget 68 1. Request is sent to `/msg/search_notifications/`, with the first query string argument specifying what period this applies to, e.g., daily, monthly, etc. 69 1. Records with a `modified_on` value greater than `last_executed` are returned. 65 === Process === 66 67 ==== Saving a search ==== 68 1. User searches a resource 69 1. If the search has no errors, a "Save this search" button is shown next to the submit ("Search") button in the search form. 70 * The filters, added to the current resource using add_filter(), are extracted from the resource and stored as a pickled string. 71 * This button POSTs an s3json request to a save_search REST controller. 72 * The s3json contains the prefix, resource_name, and the filters applied to the resource. 73 74 ==== Notifications ==== 75 1. Subscription notifications are sent by a cron task sending a request to `/msg/search_subscription_notifications/` 76 * The first query string argument specifies what period this applies to, e.g., daily, monthly, etc. 77 1. The controller fetches the saved searches with that frequency. 78 1. The resource is created, and the filters are applied. 79 1. The resource, with filters, and saved search record is passed to a notification function for the specific notification_method of each saved search. 80 1. Records with a `modified_on` value greater than `last_executed` are added to the message. 81 1. Format the response for special media, e.g., Twitter, SMS. 82 1. The message is sent via the method specified. 70 83 1. `last_executed` field updated to when the request was made. 71 1. Format the response for special media, e.g., Twitter, SMS.72 84 73 85 === Tasks ===