Changes between Version 66 and Version 67 of Notifications


Ignore:
Timestamp:
Dec 18, 2009, 11:58:38 AM (14 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Notifications

    v66 v67  
    66
    77The goal is to create a way to notify users of events
    8 that either requiring their attention or are likely to interest them.
     8that require their attention or are likely to interest them.
    99Examples include:
    1010 * Conditions in the core client requiring user attention
     
    2727The 10 most recent notices will be displayed,
    2828with a button to show all notices in the last month.
     29Most recent notices are on top.
    2930Like messages, each will have a timestamp and a project.
    3031Buttons will let users filter by project and select notices.
     
    3940The screensaver will show only public messages.
    4041
    41 == Message architecture ==
     42== Notice architecture ==
    4243
    43 Notices are conveyed as time-ordered RSS feeds.
     44The client collects notices and delivers them via GUI RPC.
     45There are three general sources of notices :
    4446
    45 Scheduler replies include a list of URLs to poll for notices.
    46 The client polls these URLs and saves the results in files.
    47 The client saves scheduler messages and its own messages in files.
     47 * RSS feeds
     48 * Server notices (<message> elements in scheduler replies)
     49 * Client notices (from calls to msg_printf with priority MSG_USER_ERROR)
    4850
    49 Some of the URLs may contain the user's authenticator.
     51Whatever the source, notices have the following attributes:
     52{{{
     53struct NOTICE {
     54    int seqno;
     55    bool private;    // requires authentication
     56    char category[256];
     57    std::string description;
     58    double create_time;   // when notice was created
     59    double arrival_time;  // when notice arrived at client
     60    char url[256];
     61};
     62}}}
     63
     64The following GUI RPCs return notices :
     65{{{
     66get_notices(    // requires authentication
     67   int seqno,   // return only notices with this seqno > this
     68   vector<NOTICE>&
     69}
     70
     71get_notices_public()
     72// returns only non-private notices, doesn't require authentication
     73// screensavers use this
     74}}}
     75
     76The client stores the set of all notices in a deque, ordered by seqno.
     77
     78=== Server and client notices ===
     79
     80Server and client notices are added to the deque.
     81If 60 secs have elapsed since last write,
     82the server and client notices are written to a disk file.
     83
     84=== Notice feeds ===
     85
     86Scheduler replies include a list of RSS feeds to be used as notice sources:
     87{{{
     88<scheduler_reply>
     89   ...
     90   <notice_feeds>
     91      <notice_feed>
     92         <name>...</name>
     93         <url>...</url>
     94         <poll_interval>x</poll_interval>
     95         <append_last_guid>0|1</append_last_guid>
     96      </notice_feed>
     97      ...
     98   </notice_feeds>
     99</scheduler_reply>
     100}}}
     101
     102 * url: where to poll
     103 * poll_interval: how often to poll
     104 * append_last_guid: if true, append "&last_guid=x" to url
     105   (server will return only newer items)
     106
     107If <notice_feeds> is present in a scheduler reply,
     108the client adds and/or removes feeds from the project.
     109
     110The client periodically polls each URL.
     111If append_last_guid is set, it scans the deque for the most recent notice and passes its GUID.
     112For each item returned, it checks whether the GUID exists in the deque,
     113and if not appends it.
     114If any items were added, it writes this feed's notices to a disk file.
     115
     116Some of the URLs may contain an authenticator.
    50117In response to a scheduler RPC with a weak authenticator,
    51118the scheduler supplies only URLs for public notices,
    52119and passes the weak authenticator.
    53120
    54 GUIs (Manager and screensaver) periodically polls the client for new messages
    55 via GUI RPC.
     121=== Client startup ===
    56122
    57 RSS items have two timestamps:
    58 
    59  * source timestamp: for remote items, the source's timestamp
    60  * client timestamp: when the client first received this item
    61 
    62 RSS items may contain a GUID.
    63 
    64 The client maintains a "last source timestamp" for each feed.
    65 Each feed request can optionally containt this timestamp,
    66 and the feed returns only items with later timestamp.
    67 
    68 GUIs poll items based on client timestamp.
    69 
    70 == Implementation ==
    71 
     123On startup, the client reads the client/server notice file
     124and all the feed files into the deque.
     125It then sorts the deque by decreasing arrival_time
     126and assigns sequence numbers.
    72127
    73128=== Localization ===
    74129
    75 Strings of the form _(...) in message body are localizable.
     130Strings of the form _(...) in notice title and content are localizable.
    76131
    77 
    78 === Feed List ===
    79 
    80 Scheduler replies can include a feed list.
    81 Example:
    82 {{{
    83 <notification_feeds>
    84     <feed>
    85         <url>http://www.example.com/notify_rss.php</url>
    86         <name>Project Notifications</name>
    87         <update>86400</update>
    88     </feed>
    89     <feed>
    90         <url>http://www.example.com/science_blog_rss.php</url>
    91         <name>Science Blog</name>
    92         <update>86400</update>
    93     </feed>
    94 </notification_feeds>
    95 }}}
    96 
    97 Property table:
    98  update:: Number of seconds in between updates
    99  application_only:: Feed is used by the project application and should not be shown in BOINC Manager or the BOINC Screen saver.
    100    The contents of the feed should be written to the init_data.xml file in the slot directory before the application is launched.
    101 
    102 BOINC has several built-in community defining features and feedback mechinisms. The notification system should attempt to reuse as much of it as possible.
    103132
    104133=== Default project feed ===
     
    134163 * Client notice
    135164
    136 === Scheduler Reply ===
    137 
    138 Example:
    139 {{{
    140 <scheduler_reply>
    141     <notification_feeds>
    142         ...
    143     </notification_feeds>
    144     <channel>
    145         ...
    146     <channel>
    147 </scheduler_reply>
    148 }}}
    149165
    150166== BOINC Project Website ==
    151167
    152 A new entry in the Preferences section of the Your Account area will be created to manage all the feeds a volunteer is currently subscribed to.
     168A new entry in the Preferences section of the Your Account area will be created
     169to manage all the feeds a volunteer is currently subscribed to.
    153170
    154171This new section should allow the volunteer to change the refresh rate for any feed they want to be notified about.
    155172 It should also allow them to disable any feed.
    156 
    157 == BOINC Core Client ==
    158 
    159 
    160 === Feed Storage ===
    161 All data related to the notification system will be stored in a directory off of the main data directory.
    162 
    163 || Item || Naming convention ||
    164 || Feed directory || feeds ||
    165 || Feed list || feed_list.xml ||
    166 || Feed || "feed_" + escape_project_url(feed_url) + ".xml" ||
    167 
    168 === GUI RPCs ===
    169 
    170 ==== get_feed() ====
    171 Enumerates all the feed items for a given feed as well as provides the properties for a given feed item.
    172 
    173 Parameters:
    174 || Parameter || Type || Meaning ||
    175 || project_url || string || Specify which project should the feed metadata be returned for. ||
    176 
    177 '''Notes''':
    178  * If both project_url and feed_url are empty, the BOINC Action Feed stream is returned.
    179  * Requests for private feeds should return an error.
    180  * This RPC should not require authentication.
    181 
    182 ==== get_private_feed() ====
    183 Enumerates all the feed items for a given feed as well as provides the properties for a given feed item.
    184 
    185 Parameters:
    186 || Parameter || Type || Meaning ||
    187 || project_url || string || Specify which project should the feed metadata be returned for. ||
    188 
    189 '''Notes''':
    190  * This RPC requires authentication.
    191173
    192174