Changes between Version 35 and Version 36 of BluePrint/SaveSearch_Sub


Ignore:
Timestamp:
08/29/12 23:45:06 (9 years ago)
Author:
James O'Neill
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BluePrint/SaveSearch_Sub

    v35 v36  
    1515 name::
    1616  Name of the saved search as specified by the user.
    17  description::
    18   Description of the Saved Search
    1917 pe_id::
    2018  The person entity to be notified when the search results change. Defaults to the pe_id record associated with the current user account.
     
    3129 public::
    3230  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.
    3333
    3434=== Views ===
     
    4444
    4545{{{
    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=NZ
     46organisation.country__belongs=NZ&organisation.organisation_type_id__belongs=2&organisation.sector_id__anyof=1%2C2&parent.acronym%7Cparent.name%7Cacronym%7Cname__like=%2Ared%2A
    4747}}}
    4848
     
    5050
    5151{{{
    52 Search=red cross AND Type=Red Cross / Red Crescent AND Sector=DRR,Food Security AND Home Country=New Zealand
     52Search=red AND Type=Red Cross / Red Crescent AND Sector=DRR,Food Security AND Home Country=New Zealand
    5353}}}
    5454
     
    6363A page to edit a saved search. The `name`, `pe_id`, `notification_format`, `notification_method` and `notification_frequency` can be changed here.
    6464
    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 ====
     681. User searches a resource
     691. 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 ====
     751. 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.
     771. The controller fetches the saved searches with that frequency.
     781. The resource is created, and the filters are applied.
     791. The resource, with filters, and saved search record is passed to a notification function for the specific notification_method of each saved search.
     801. Records with a `modified_on` value greater than `last_executed` are added to the message.
     811. Format the response for special media, e.g., Twitter, SMS.
     821. The message is sent via the method specified.
    70831. `last_executed` field updated to when the request was made.
    71 1. Format the response for special media, e.g., Twitter, SMS.
    7284
    7385=== Tasks ===