|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE task |
|
11 PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
|
12 <task id="GUID-6A9E486A-6C1B-4E31-832A-FD39AF041817" xml:lang="en"><title>Publishing the SIF operation progress</title><shortdesc>Installers must publish the SIF operation progress to notify |
|
13 clients about the progress of operations (installation or uninstallation).</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> |
|
14 <prereq id="GUID-743E5646-74B5-4D97-87FD-A97F05B8DBC6"><p>The installers |
|
15 must link against <filepath>Sifnotification.dll</filepath> . It is |
|
16 the utility library that provides the APIs to publish the SIF operation |
|
17 progress. </p></prereq> |
|
18 <steps id="GUID-4DD07DEC-6017-4237-BE46-1D69E5FBD744-GENID-1-12-1-5-1-1-6-1-4-1-4-1-5-1-3-2"> |
|
19 <step id="GUID-72EBB7F4-DBCA-47B2-85D6-B96230084CB1"><cmd>Create an |
|
20 object of <xref href="GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6.dita"><apiname>CPublishSifOperationInfo</apiname></xref>.</cmd> |
|
21 <info><codeblock xml:space="preserve">CPublishSifOperationInfo* sifPublisher = CPublishSifOperationInfo::NewL();</codeblock></info> |
|
22 </step> |
|
23 <step id="GUID-F1AE134F-0EFB-4415-88A5-FFF213197B87"><cmd>Publish |
|
24 the operation start information.</cmd> |
|
25 <substeps id="GUID-043BDAD9-5001-424F-B9DF-184892A14F0D"> |
|
26 <substep id="GUID-A55F772D-79B5-4624-9AD9-926428D5282D"><cmd>Create |
|
27 a <xref href="GUID-F1D2CE7E-B5B9-3E35-B648-55F1B24E6272.dita"><apiname>CSifOperationStartData</apiname></xref> object.</cmd> |
|
28 <info><p>The parameters that need to be initialized are:<ul> |
|
29 <li><p>global component id that uniquely identifies the package across |
|
30 devices. For example, this could be the package uid in case of a native |
|
31 SIS package or the midlet name for java.</p></li> |
|
32 <li><p>name of the software component (can be the same as global component |
|
33 id)</p></li> |
|
34 <li><p>list of applications associated with the software component |
|
35 (an empty array in case of no applications)</p></li> |
|
36 <li><p> list of corresponding application icon names (without path) |
|
37 for every application (an empty array in case of no applications). </p></li> |
|
38 <li><p> total size of the component in bytes</p></li> |
|
39 <li><p>path where all application and component icons are found. All |
|
40 icon files will be checked with respect to this path.</p></li> |
|
41 <li><p>name of the component icon (without path)</p></li> |
|
42 <li><p>unique software type name of the component</p></li> |
|
43 </ul></p><codeblock xml:space="preserve">_LIT(KGlobalCompId, "12345"); |
|
44 _LIT(KComponentName, "Testcomponent"); |
|
45 RPointerArray<HBufC> appNameSet; |
|
46 RPointerArray<HBufC> appIconSet; |
|
47 TInt componentSize = 1024; |
|
48 _LIT(KIconPath, "c:\data\test"); |
|
49 _LIT(KCompIcon, "TestIcon.mbm"); |
|
50 _LIT(KSoftwareType, "native"); |
|
51 CSifOperationStartData* startdata = CSifOperationStartData::NewLC(KGlobalCompId, KComponentName, &appNameSet, &appIconSet, componentSize, KIconPath, KCompIcon, KSoftwareType); |
|
52 </codeblock></info> |
|
53 </substep> |
|
54 <substep id="GUID-D89D10DA-C76A-42DF-BE97-A80C0F41CFC4"><cmd>Invoke |
|
55 the <xref href="GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6.dita#GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6/GUID-9F99E500-1FEE-308C-82A6-39523B1DCCDB"><apiname>CPublishSifOperationInfo::PublishStartL()</apiname></xref>.</cmd> |
|
56 <info><codeblock xml:space="preserve">sifPublisher->PublishStartL(*startdata);</codeblock></info> |
|
57 </substep> |
|
58 </substeps> |
|
59 <info><xref href="GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6.dita#GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6/GUID-9F99E500-1FEE-308C-82A6-39523B1DCCDB"><apiname>CPublishSifOperationInfo::PublishStartL()</apiname></xref> can be invoked only once per operation. However, two parallel installations |
|
60 can be initiated and <xref href="GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6.dita#GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6/GUID-9F99E500-1FEE-308C-82A6-39523B1DCCDB"><apiname>CPublishSifOperationInfo::PublishStartL()</apiname></xref> can be invoked by each of the installation.</info> |
|
61 </step> |
|
62 <step id="GUID-60FC9468-9D44-4B9D-A554-2205C476D2B9"><cmd>Publish |
|
63 the operation progress information.</cmd> |
|
64 <substeps id="GUID-2D687BD2-783F-4D11-814B-E0B1270BCFC6"> |
|
65 <substep id="GUID-8C9D0A0B-551C-43E8-8D80-FDCAA70C07C3"><cmd>Create |
|
66 a <xref href="GUID-DBEB6AEF-2128-3566-93AA-3CDB5D554B1E.dita"><apiname>CSifOperationProgressData</apiname></xref> object.</cmd> |
|
67 <info>The parameters that need to be initialized are:<ul> |
|
68 <li><p>global component id that uniquely identifies the package across |
|
69 devices. For example, this could be the package uid in case of a native |
|
70 SIS package or the midlet name for java.</p></li> |
|
71 <li><p>phase of SIF operation</p></li> |
|
72 <li><p>current stage in the type of SIF operation</p></li> |
|
73 <li><p>progress of operation completed in current subphase</p></li> |
|
74 <li><p>total operation required by this subphase</p></li> |
|
75 </ul><codeblock xml:space="preserve">// A pointer to the newly allocated object is returned if creation is successful. |
|
76 TInt phase = TSifOperationPhase::ESifOperationStart; |
|
77 TInt subPhase = TSifOperationSubPhase::EOCSPCheck; |
|
78 TInt curProgress = 75; |
|
79 TInt total = 100; |
|
80 CSifOperationProgressData* progressdata = CSifOperationProgressData::NewLC(KGlobalCompId, phase, subPhase, curProgress, total); |
|
81 </codeblock></info> |
|
82 </substep> |
|
83 <substep id="GUID-C6974F25-8B7B-4439-AC00-246D68C629F2"><cmd>Invoke |
|
84 the <xref href="GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6.dita#GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6/GUID-F8F8059B-DC62-32AB-931D-6E365CB6E6CC"><apiname>CPublishSifOperationInfo::PublishProgressL()</apiname></xref>.</cmd> |
|
85 <info><codeblock xml:space="preserve">sifPublisher->PublishProgressL(*progressdata);</codeblock></info> |
|
86 </substep> |
|
87 </substeps> |
|
88 <info><p><xref href="GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6.dita#GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6/GUID-F8F8059B-DC62-32AB-931D-6E365CB6E6CC"><apiname>CPublishSifOperationInfo::PublishProgressL()</apiname></xref> can be called iteratively to show the linear progress of the operation.</p></info> |
|
89 </step> |
|
90 <step id="GUID-829FAD26-C37B-4572-AEC2-64956F5511EC"><cmd>Publish |
|
91 the operation completion information (on success or failure of operation).</cmd> |
|
92 <substeps id="GUID-E5345271-C6F8-4732-BBC9-56EA7A8864A6"> |
|
93 <substep id="GUID-DEC78AB9-E3F9-4175-8163-099FECB54646"><cmd>Create |
|
94 a <xref href="GUID-4F0E57D3-CE4C-3A41-951B-F2BB43E7BA34.dita"><apiname>CSifOperationEndData</apiname></xref> object.</cmd> |
|
95 <info><p>The parameters that need to be initialized are:<ul> |
|
96 <li><p>global component id that uniquely identifies the operation</p></li> |
|
97 <li><p>a SIF error category</p></li> |
|
98 <li><p>Installer (or runtime) specific error code</p></li> |
|
99 <li><p>Installer (or runtime) specific localized error message</p></li> |
|
100 <li><p>Installer (or runtime) specific localized error message details</p></li> |
|
101 </ul></p><codeblock xml:space="preserve">TInt errCategory = TErrorCategory::ESecurityError; |
|
102 TInt errCode = -10255; |
|
103 _LIT(KErrMsg, "Un-trusted package"); |
|
104 _LIT(KErrMsgDetails, "The package is not signed with a trusted certificate."); |
|
105 CSifOperationEndData* enddata = CSifOperationEndData::NewLC(KGlobalCompId, errCategory, errCode, KErrMsg, KErrMsgDetails); |
|
106 </codeblock></info> |
|
107 </substep> |
|
108 <substep id="GUID-F16B9612-C128-4275-9B3A-0E7561A4531C"><cmd>Invoke |
|
109 the <xref href="GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6.dita#GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6/GUID-F7299F8C-9043-31FD-9758-8E25E839D2D7"><apiname>CPublishSifOperationInfo::PublishCompletionL()</apiname></xref>.</cmd> |
|
110 <info><codeblock xml:space="preserve">sifPublisher->PublishCompletionL(*enddata);</codeblock></info> |
|
111 </substep> |
|
112 </substeps> |
|
113 <info><p><xref href="GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6.dita#GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6/GUID-F7299F8C-9043-31FD-9758-8E25E839D2D7"><apiname>CPublishSifOperationInfo::PublishCompletionL()</apiname></xref> can be called only once per operation. Every call to <xref href="GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6.dita#GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6/GUID-9F99E500-1FEE-308C-82A6-39523B1DCCDB"><apiname>CPublishSifOperationInfo::PublishStartL()</apiname></xref> by an operation must have a corresponding <xref href="GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6.dita#GUID-59E1372C-F4F8-3762-B6D9-B92BB5F53FC6/GUID-F7299F8C-9043-31FD-9758-8E25E839D2D7"><apiname>CPublishSifOperationInfo::PublishCompletionL()</apiname></xref>, else an |
|
114 progress place holder is blocked for this operation.</p></info> |
|
115 </step> |
|
116 </steps> |
|
117 </taskbody></task> |