2009/dap/calendar Overview.html,1.18,1.19

Update of /sources/public/2009/dap/calendar
In directory hutz:/tmp/cvs-serv2485

Modified Files:
	Overview.html 
Log Message:
fixing where the API is exposed; remove PendingOp; make the task source work a little better

Index: Overview.html
===================================================================
RCS file: /sources/public/2009/dap/calendar/Overview.html,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- Overview.html	16 Mar 2011 06:08:54 -0000	1.18
+++ Overview.html	30 Mar 2011 16:55:10 -0000	1.19
@@ -133,29 +133,20 @@
         <p>
           The following code illustrates how to obtain calendaring information from a user&#39;s calendar:
         </p>
-<pre
- class="sh_javascript">
-function successCalendarFindEventsCallback( eventInfo ) {
-    // do something with resulting eventInfo objects
-    for (var i in eventInfo) alert(eventInfo[i].id);
-    // ...
+<pre class="sh_javascript">
+function success (events) {
+    // do something with resulting list of objects
+    for (var i in events) alert(events[i].id);
 }
 
-function generalErrorCB(error) {
+function error (err) {
     // do something with resulting errors
-    alert(error.code);
-    // ...
+    alert(err.code);
 }
 
 // Perform an calendar search. Initially filter the list to Calendar records starting 
 // before April 9, 2011 @ 5pm (UTC).
-navigator.service.calendar.findEvents( successCalendarFindEventsCallback, 
-                                 generalErrorCB,
-                                 {
-                                   filter: { startBefore: '2011-04-10T05:00:00+12:00' }
-                                 }  
-                               );
-// ..is equivalent to: navigator.service.calendar(/* parameters */)
+navigator.calendar.findEvents( success, error, { filter: { startBefore: '2011-04-10T05:00:00+12:00' } });
 </pre>
       </div>
 </section>      	
@@ -181,12 +172,7 @@
                 source</dfn> and <dfn>task queues</dfn> are defined by the HTML5 specification [[!HTML5]].
               </p>
               <p>
-                The <a>task source</a> used by this specification is the <dfn><a
-                 href="http://dev.w3.org/2009/dap/device/#the-pendingop-interface">PendingOp</a> task source</dfn>.
-              </p>
-              
-              <p class="note">
-               PendingOp needs updating in [[!CORE-DEVICE]] to show that it is a valid <a>task source</a>.
+                The <a>task source</a> used by this specification is the <dfn>device task source</dfn>.
               </p>
               <p>
                 To <dfn>dispatch a <code>success</code> event</dfn> means that an event with the name <code>success</code>, which does
@@ -224,7 +210,7 @@
 }
 
 // Perform a calendar search
-navigator.service.calendar.findEvents( 
+navigator.calendar.findEvents( 
                                         successCalendarFindEventsCallback, 
                                         generalErrorCB );</pre>
                 </div>
@@ -235,7 +221,7 @@
                     <pre class='example sh_javascript_dom'>// previous example follow-on...
 
 // Create new calendar event	
-var myEvent = navigator.service.calendar.createEvent({
+var myEvent = navigator.calendar.createEvent({
                                                           description:     'W3C weekly meeting',
                                                           summary:         'Agenda to be distributed weekly',
                                                           location:        'IRC and Conf. call #XXX',
@@ -396,25 +382,20 @@
         <section>
             <h2>API Description</h2>
 			
-			<section>
-				<h2><a>ServiceCalendar</a> interface</h2>
-		
-				<p>
-					The <a href='#servicecalendar-interface'><code>ServiceCalendar</code></a> interface is exposed on the <code>navigator.service</code> object, as defined in [[!CORE-DEVICE]]. 
-				</p>
-				
-				<div class='idl' title='Service implements ServiceCalendar'></div>
-							
-				<dl title='[NoInterfaceObject] interface ServiceCalendar' class='idl'>
-					<dt>
-						readonly attribute Calendar calendar
-					</dt>
-					<dd>
-						The root node from which the calendar functionality can be accessed.
-					</dd>
-				</dl>
-				
-            </section>
+          <section>
+            <h2><a>ServiceCalendar</a> interface</h2>
+            <p>
+              The <a href='#servicecalendar-interface'><code>ServiceCalendar</code></a> interface is 
+              exposed on the <a class="externalDFN">Navigator</a> interface [[NAVIGATOR]].
+            </p>
+            <dl title='[NoInterfaceObject] interface ServiceCalendar' class='idl'>
+              <dt>readonly attribute Calendar calendar</dt>
+              <dd>
+                The root node from which the calendar functionality can be accessed.
+              </dd>
+            </dl>
+            <div class='idl' title='Navigator implements ServiceCalendar'></div>
+          </section>
 			
             <section>
                 <h2><a>Calendar</a> interface</h2>
@@ -423,61 +404,49 @@
 				</p>
 				
                 <dl title='[NoInterfaceObject] interface Calendar' class='idl'>
-                   <dt>
-                        caller PendingOp findEvents ()
-                    </dt>
-                    <dd>
-                    	<p>Find calendar event items in the calendar based on an <a href="#calendareventfilter-interface"><code>CalendarEventFilter</code></a> object</p>
-						
-						<p>This method takes two, three or four arguments. When called, it must immediately return 
-						a <code>PendingOp</code> object, as defined in [[!CORE-DEVICE]] and then asynchronously start a <dfn>find calendar event items</dfn> process defined as follows:</p> 
-						
-                        <ol
-                         class="rule">
-                          <li>
-                            If there are any <a>tasks</a> from the <a
-                             title="PendingOp task source"><code>PendingOp</code> task source</a> in one of the <a>task queues</a>
-                            (i.e. an existing <code>findEvents()</code> operation is still pending a response), and the current method was invoked with a
-                            non-<code>null</code> <code>errorCB</code> argument, <a>dispatch an <code>error</code> event</a> with a <a
-                             href='#widl-CalendarError-PENDING_OPERATION_ERROR'><code>PENDING_OPERATION_ERROR</code></a> <code>code</code> value.
-                          </li>
-                          <li>
-                            Search for calendar event items in the calendar according to the 
-                            <a href='#calendar-item-search-processing-rules'>calendar item search processing rules</a>.
-                          </li>
-                          <li>
-                            If the attempt was successful, <a>dispatch a <code>success</code> event</a>. If the attempt fails, and the method was
-                            invoked with a non-<code>null</code> <code>errorCB</code> argument, this method must <a>dispatch an <code>error</code>
-                            event</a> with the <code>code</code> attribute set according to the type of failure that has occurred.
-                          </li>
-                        </ol>
-						
-                        <dl class='parameters'>
-                            <dt>
-                                DOMString type
-                            </dt>
-                            <dd>
-                                The type of calendaring information to be requested (e.g. <code>event</code>).
-                            </dd>
-                            <dt>
-                                CalendarEventSuccessCB successCB
-                            </dt>
-                            <dd>
-                                Function to call when the asynchronous operation completes
-                            </dd>
-                            <dt>
-                                optional CalendarErrorCB? errorCB
-                            </dt>
-                            <dd>
-                                Function to call when the asynchronous operation fails.
-                            </dd>
-                            <dt>
-                                optional CalendarFindOptions options
-                            </dt>
-                            <dd>
-                                The options to apply to the output of this method.
-                            </dd>
-                        </dl>
+                  <dt>caller void findEvents ()</dt>
+                  <dd>
+                	  <p>
+                	    Find calendar event items in the calendar based on an <a href="#calendareventfilter-interface"><code>CalendarEventFilter</code></a> object.
+                	  </p>
+                	  <p>
+                	    This method takes between one and three arguments. When called, it immediately returns,
+						          and then asynchronously start a <dfn>find calendar event items</dfn> process defined as follows:
+						        </p>
+                    <ol class="rule">
+                      <li>
+                        If there are any <a>tasks</a> from the <a>device task source</a> in one of the <a>task queues</a>
+                        (i.e. an existing <code>findEvents()</code> operation is still pending a response), and the 
+                        current method was invoked with a non-<code>null</code> <code>errorCB</code> argument, 
+                        <a>dispatch an <code>error</code> event</a> with a 
+                        <a href='#widl-CalendarError-PENDING_OPERATION_ERROR'><code>PENDING_OPERATION_ERROR</code></a>
+                        <code>code</code> value.
+                      </li>
+                      <li>
+                        Search for calendar event items in the calendar according to the 
+                        <a href='#calendar-item-search-processing-rules'>calendar item search processing rules</a>.
+                      </li>
+                      <li>
+                        If the attempt was successful, <a>dispatch a <code>success</code> event</a>. If the attempt 
+                        fails, and the method was invoked with a non-<code>null</code> <code>errorCB</code> argument, 
+                        this method must <a>dispatch an <code>error</code> event</a> with the <code>code</code> 
+                        attribute set according to the type of failure that has occurred.
+                      </li>
+                    </ol>
+                    <dl class='parameters'>
+                      <dt>CalendarEventSuccessCB successCB</dt>
+                      <dd>
+                          Function to call when the asynchronous operation completes
+                      </dd>
+                      <dt>optional CalendarErrorCB? errorCB</dt>
+                      <dd>
+                          Function to call when the asynchronous operation fails.
+                      </dd>
+                      <dt>optional CalendarFindOptions options</dt>
+                      <dd>
+                          The options to apply to the output of this method.
+                      </dd>
+                    </dl>
                     </dd>
 			   </dl>
 			</section>
@@ -1037,7 +1006,7 @@
 				</p>
 				<p>
 					For example, the following <a href="#calendareventfilter-interface"><code>CalendarEventFilter</code></a> object is supplied for Calendar Event searching: 
-					<pre class="example sh_javascript">navigator.service.calendar.findEvents(
+					<pre class="example sh_javascript">navigator.calendar.findEvents(
   function(eventItems) { },
   function(error) { },
   { filter: { 
@@ -1325,7 +1294,7 @@
                <pre class="sh_javascript">&lt;a id=&quot;vcard&quot;&gt;Update our Event in your Calendar&lt;/a&gt;
 
 &lt;script type=&quot;text/javascript&quot;&gt;
-  // Obtain a single existing Calendar Event object resulting from navigator.service.calendar.findEvents()
+  // Obtain a single existing Calendar Event object resulting from navigator.calendar.findEvents()
   var existingCalendarEventObj = ...;
   
   // Modify some parameters as required. e.g. add a new phone number

Received on Wednesday, 30 March 2011 16:55:15 UTC