|
1 |
|
2 <!DOCTYPE html |
|
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
4 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="copyright" content="(C) Copyright 2009"/><meta name="DC.rights.owner" content="(C) Copyright 2009"/><meta name="DC.Type" content="mobileconcept"/><meta name="DC.Title" content="IDataSource.Add()"/><meta name="DC.Relation" scheme="URI" content="GUID-7E53CD9F-E213-42E7-8569-02AEA1198E52"/><meta name="DC.Relation" scheme="URI" content="GUID-7C69DDA4-16F1-4A8F-BDB2-4CB0015B4E81"/><meta name="DC.Relation" scheme="URI" content="GUID-65AAF569-D347-462B-B59A-9D7CA184AB9C"/><meta name="DC.Relation" scheme="URI" content="GUID-F003B7DD-E450-49AD-B447-C5132FE47D3C"/><meta name="DC.Format" content="XHTML"/><meta name="DC.Identifier" content="GUID-F146B956-77AE-41B5-BA17-20F48AF8DBA7"/><title>IDataSource.Add() </title><script type="text/javascript"> |
|
5 function initPage() {} |
|
6 </script><link href="../PRODUCT_PLUGIN/book.css" rel="stylesheet" type="text/css"/><link href="css/s60/style.css" rel="stylesheet" type="text/css" media="all"/></head><body onload="initPage();"><div class="body"><div class="contentLeft prTxt"><h1 class="pageHeading" id="GUID-F146B956-77AE-41B5-BA17-20F48AF8DBA7"><span>IDataSource.</span>Add()</h1><div> |
|
7 <p><strong>Description:</strong></p> |
|
8 <p>The <code>Add</code> method adds an event (entry) to the event |
|
9 log database.</p> |
|
10 <p>This method can be called both synchronously and asynchronously.</p> |
|
11 <p><strong>Syntax:</strong></p> |
|
12 <p>For synchronous calls:</p> |
|
13 <pre class="codeblock" id="GUID-7CD9AD3A-D065-4F76-A3FF-D524249CBF65-GENIDd0e51563">result = so.IDataSource.Add(criteria);</pre> |
|
14 |
|
15 <p>For asynchronous calls:</p> |
|
16 <pre class="codeblock" id="GUID-F1140A2E-9B60-4953-8C6E-1A6C47461241-GENIDd0e51569">result = so.IDataSource.Add(criteria, callback);</pre> |
|
17 |
|
18 <p><strong>Arguments:</strong></p> |
|
19 <ul> |
|
20 <li><p><code>criteria</code>:</p> |
|
21 |
|
22 <p>This is an object that specifies what type of device log entries are |
|
23 added to the event database and details about the entry. For more information |
|
24 about the object properties and how to define them, see section <a href="GUID-DDF5BDA7-E0DA-40EB-94E7-30824B0F4365.html#GUID-DDF5BDA7-E0DA-40EB-94E7-30824B0F4365">Criteria for adding a log entry</a>.</p> |
|
25 |
|
26 </li> |
|
27 <li><p><code>callback</code>:</p> |
|
28 |
|
29 <p>The <code>callback</code> argument is the name of the method |
|
30 that is executed when an asynchronous <code>Add</code> call has results |
|
31 or status information to return. You must define this method separately. Follow |
|
32 the instructions in section <a href="GUID-C7C3B541-8D28-4DC6-9003-ECF57F26C608.html#GUID-C7C3B541-8D28-4DC6-9003-ECF57F26C608">Defining the callback handler for an asynchronous method</a> to |
|
33 define the <code>callback</code> method.</p> |
|
34 <p>This argument is used only with an asynchronous <code>Add</code> call.</p> |
|
35 |
|
36 </li> |
|
37 </ul> |
|
38 <p><strong>Return value:</strong></p> |
|
39 <p>If synchronous, the <code>Add</code> method returns an object |
|
40 that contains a unique identifier for the log entry, an error code, and an |
|
41 error message.</p> |
|
42 <div class="tablenoborder"><a name="GUID-92F92E86-799C-4BE8-A23E-6A2BC57F0E63"><!----></a><table cellpadding="4" cellspacing="0" summary="" id="GUID-92F92E86-799C-4BE8-A23E-6A2BC57F0E63" frame="border" border="1" rules="all"><caption><strong>Table: </strong>Return value |
|
43 properties for a synchronous Add</caption> |
|
44 <thead align="left"> |
|
45 <tr class="title "><th class="cellrowborder" valign="top" id="d0e50963"> |
|
46 <p>Property</p> |
|
47 </th><th class="cellrowborder" valign="top" id="d0e50968"> |
|
48 <p>Description</p> |
|
49 </th><th class="cellrowborder" valign="top" id="d0e50973"> |
|
50 <p>Value</p> |
|
51 </th></tr> |
|
52 </thead> |
|
53 <tbody> |
|
54 <tr class=""> |
|
55 <td class="cellrowborder" valign="top" headers="d0e50963 "> |
|
56 <p><code>result.ReturnValue</code></p> |
|
57 </td> |
|
58 <td class="cellrowborder" valign="top" headers="d0e50968 "> |
|
59 <p>This is a text string that contains the unique identifier of the log |
|
60 entry that was added to the event log database.</p> |
|
61 </td> |
|
62 <td class="cellrowborder" valign="top" headers="d0e50973 "> </td> |
|
63 </tr> |
|
64 <tr class="bg "> |
|
65 <td class="cellrowborder" valign="top" headers="d0e50963 "> |
|
66 <p><code>result.ErrorCode</code></p> |
|
67 </td> |
|
68 <td class="cellrowborder" valign="top" headers="d0e50968 "> |
|
69 <p>This is a number that specifies a predefined error code.</p> |
|
70 </td> |
|
71 <td class="cellrowborder" valign="top" headers="d0e50973 "> |
|
72 <p>See <a href="GUID-0A215AF3-59F0-4158-842C-0D7B030E5EA4.html#GUID-0A215AF3-59F0-4158-842C-0D7B030E5EA4">Service API error codes</a> .</p> |
|
73 </td> |
|
74 </tr> |
|
75 <tr class=""> |
|
76 <td class="cellrowborder" valign="top" headers="d0e50963 "> |
|
77 <p><code>result.ErrorMessage</code></p> |
|
78 </td> |
|
79 <td class="cellrowborder" valign="top" headers="d0e50968 "> |
|
80 <p>This is a text string that describes the error.</p> |
|
81 </td> |
|
82 <td class="cellrowborder" valign="top" headers="d0e50973 "> |
|
83 <p>See <a href="GUID-6C3D58CA-CA4F-432B-898B-4020064E3CE6.html#GUID-6C3D58CA-CA4F-432B-898B-4020064E3CE6">Logging Service API error messages</a>.</p> |
|
84 </td> |
|
85 </tr> |
|
86 </tbody> |
|
87 </table></div> |
|
88 <p>If asynchronous, the <code>Add</code> method returns an object |
|
89 that contains the initial return value from the asynchronous call that it |
|
90 started (see the following table). The actual logging information is returned |
|
91 by the <a href="GUID-C7C3B541-8D28-4DC6-9003-ECF57F26C608.html#GUID-C7C3B541-8D28-4DC6-9003-ECF57F26C608"><code>callback</code></a> method |
|
92 in the <code>ReturnValue</code> property of its result object. The |
|
93 returned information is described in the preceding table.</p> |
|
94 <div class="tablenoborder"><a name="GUID-0FFA0367-477E-464F-8602-1BD41CBE9D4E"><!----></a><table cellpadding="4" cellspacing="0" summary="" id="GUID-0FFA0367-477E-464F-8602-1BD41CBE9D4E" frame="border" border="1" rules="all"><caption><strong>Table: </strong>Return value |
|
95 properties for an asynchronous Add</caption> |
|
96 |
|
97 <thead align="left"> |
|
98 <tr class="title "><th class="cellrowborder" valign="top" width="33.33333333333333%" id="d0e51077"> |
|
99 <p>Property</p> |
|
100 </th><th class="cellrowborder" valign="top" width="33.33333333333333%" id="d0e51082"> |
|
101 <p>Description</p> |
|
102 </th><th class="cellrowborder" valign="top" width="33.33333333333333%" id="d0e51087"> |
|
103 <p>Value</p> |
|
104 </th></tr> |
|
105 </thead> |
|
106 <tbody> |
|
107 <tr class=""> |
|
108 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e51077 "> |
|
109 <p><code>result.TransactionID</code></p> |
|
110 </td> |
|
111 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e51082 "> |
|
112 <p>This is a number used as an identification to match transactions started |
|
113 with the asynchronous <code>Add</code> call to one or more calls it |
|
114 generates to <code>callback</code>.</p> |
|
115 <p>This property is only valid for asynchronous calls.</p> |
|
116 </td> |
|
117 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e51087 "> </td> |
|
118 </tr> |
|
119 <tr class="bg "> |
|
120 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e51077 "> |
|
121 <p><code>result.ErrorCode</code></p> |
|
122 </td> |
|
123 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e51082 "> |
|
124 <p>This is a number that specifies a predefined error code.</p> |
|
125 </td> |
|
126 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e51087 "> |
|
127 <p>See <a href="GUID-0A215AF3-59F0-4158-842C-0D7B030E5EA4.html#GUID-0A215AF3-59F0-4158-842C-0D7B030E5EA4">Service API error codes</a>.</p> |
|
128 </td> |
|
129 </tr> |
|
130 <tr class=""> |
|
131 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e51077 "> |
|
132 <p><code>result.ErrorMessage</code></p> |
|
133 </td> |
|
134 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e51082 "> |
|
135 <p>This is a text string that describes the error.</p> |
|
136 </td> |
|
137 <td class="cellrowborder" valign="top" width="33.33333333333333%" headers="d0e51087 "> |
|
138 <p>See <a href="GUID-6C3D58CA-CA4F-432B-898B-4020064E3CE6.html#GUID-6C3D58CA-CA4F-432B-898B-4020064E3CE6">Logging Service API error messages</a>.</p> |
|
139 </td> |
|
140 </tr> |
|
141 </tbody> |
|
142 </table></div> |
|
143 <p><strong>Example code:</strong></p> |
|
144 <p/> |
|
145 <p>For the complete source of a sample widget |
|
146 that demonstrates how to use this Service API, see <a href="GUID-9C85B403-6CFC-4E17-A2B2-AD1AD2F7794D.html#GUID-9C85B403-6CFC-4E17-A2B2-AD1AD2F7794D">the |
|
147 full example</a>.</p> |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 </div></div></div><div class="footer"><hr/><div class="copy">© Nokia 2009.</div></div></body></html> |