|
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 concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-0CBD2728-DB7E-55FF-929A-E5BF279A1B66" xml:lang="en"><title>BIOMessageMgr: |
|
13 BIO Message manager using the message server</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <p>The BIO Message manager example comprises two projects <filepath>BIOMessage.exe</filepath> and <filepath>BIOParser.dll</filepath>. |
|
15 The <filepath>BIOMessage.exe</filepath> example connects to the message server, |
|
16 creates a BIO message and sends the registered parser DLL and message entry |
|
17 to <filepath>BIOParser.dll</filepath>. </p> |
|
18 <section id="GUID-BBF66472-C97E-5C14-85BB-30AD56703E83"><title>Download</title> <p>Click |
|
19 on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-34a2835d-797c-4d05-8919-03fc43821825.zip" scope="external">Biomsgexample.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-34a2835d-797c-4d05-8919-03fc43821825.html" scope="peer"> browse</xref> to view the example code. </p> </section> |
|
20 <section id="GUID-3CD32BF4-F354-4281-9C9A-1FD5ED4761C7"><title>BIOMessage: BIO messaging using the message server</title> <p><b>Description</b> </p> <p>This |
|
21 example code demonstrates BIO messaging using <xref href="GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3.dita"><apiname>RSendAs</apiname></xref> and <xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita"><apiname>RSendAsMessage</apiname></xref> and |
|
22 other supporting classes as mentioned in the <xref href="GUID-0CBD2728-DB7E-55FF-929A-E5BF279A1B66.dita#GUID-0CBD2728-DB7E-55FF-929A-E5BF279A1B66/GUID-5048F691-DBA0-52DC-BBBA-922EE5DDE8D5">Class |
|
23 Summary</xref> below. </p> <p>The <filepath>BIOMessage</filepath> example |
|
24 code provides the following functionality: </p> <p><b>Creating a session </b> </p> <codeblock id="GUID-822DA39D-0568-54D9-A8EA-D49ABAB6D4D5" xml:space="preserve">void CBioMessage::Connect();</codeblock> <p>Creates |
|
25 a session with the message server using <xref href="GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3.dita"><apiname>RSendAs</apiname></xref>. </p> <p>The |
|
26 generated console output looks like this: </p> <fig id="GUID-3F7EFDA7-7103-58F2-819B-F50A564F67F9"> |
|
27 <image href="GUID-13F10D4C-BA0C-5B46-804D-191A70C36324_d0e290946_href.png" placement="inline"/> |
|
28 </fig> <p><b>Creating a BIO message </b> </p> <codeblock id="GUID-898B2AF1-6B24-516A-A8CF-CE210D9136EC" xml:space="preserve">void CBioMessage::Create(RSendAsMessage& aMessage);</codeblock> <p>This function does the following: </p> <ul> |
|
29 <li id="GUID-3B28353D-8885-56A2-9000-B2B481045A4A"><p>creates a BIO message |
|
30 of VCard type </p> </li> |
|
31 <li id="GUID-B8FE7FB1-D904-5520-9762-A0BAE0D53833"><p>sets the message body |
|
32 text </p> </li> |
|
33 <li id="GUID-AE681720-90EE-5AEE-9D98-54C41DD19E49"><p>adds the message recipients |
|
34 for the message to be sent. </p> </li> |
|
35 </ul> <p>The generated console output looks like this: </p> <fig id="GUID-7E3F4DA5-BFC3-5393-A04A-FDE944A89815"> |
|
36 <image href="GUID-7DDC1BC6-A100-5B50-ABFE-B4AA466716A6_d0e290983_href.png" placement="inline"/> |
|
37 </fig> <p><b>Sending the BIO message </b> </p> <codeblock id="GUID-AA6C86D7-1657-5E3D-A025-43EB77FD3D31" xml:space="preserve">void CBioMessage::Send(RSendAsMessage& aMessage);</codeblock> <p>Sends the message to the recipients. </p> <p>The generated console output |
|
38 looks like this: </p> <fig id="GUID-75B51188-D5AA-5BBD-90CA-3C33D2CF3744"> |
|
39 <image href="GUID-3239641A-2D13-56D7-B18D-6E65B6B24886_d0e291002_href.png" placement="inline"/> |
|
40 </fig> <p><b>Creating the parser </b> </p> <codeblock id="GUID-0E38D4C7-B9D8-5F6E-A0AB-315447101C1D" xml:space="preserve">CBioParser::NewL(CMsvEntry* aEntry);</codeblock> <p>Creates a <codeph>CBioParser</codeph> object based on the message entry. </p> <p><b>Parsing |
|
41 the BIO message </b> </p> <codeblock id="GUID-BF605939-E297-5131-AFFA-DFED793492DF" xml:space="preserve">CBioParser::ParserL();</codeblock> <p>This |
|
42 function does the following: </p> <ul> |
|
43 <li id="GUID-A05F6576-7677-5D92-A9C4-1697D64CBAF3"><p>calls <codeph>ExtractMessageBodyL()</codeph> to |
|
44 extract the message body text from <xref href="GUID-8CB90FA2-A6CF-3FA2-81FF-7D22EFD9C2CE.dita"><apiname>CMsvStore</apiname></xref>, the message |
|
45 store </p> </li> |
|
46 <li id="GUID-ADAB322E-2354-52C5-9B7C-A4335E84B6EF"><p>finds, loads and maintains |
|
47 a reference count of client processes for a BIO parser DLL </p> </li> |
|
48 <li id="GUID-5F5D6BE4-EECE-5E70-82C6-2EB92133A2AF"><p>parses the message body |
|
49 text. </p> </li> |
|
50 </ul> <p>The generated console output looks like this: </p> <fig id="GUID-2E3907F9-E810-5B1F-A6A0-60484FE004DF"> |
|
51 <image href="GUID-DCCA3BD3-582A-5C71-A104-D922FFE3C680_d0e291060_href.png" placement="inline"/> |
|
52 </fig><p><b>Class Summary</b></p><p><xref href="GUID-E1699CAB-423D-3AFA-BE77-3AFF38886EA3.dita"><apiname>RSendAs</apiname></xref></p><p> <xref href="GUID-4499491F-FA1A-38E1-BB13-1AB184A31DA6.dita"><apiname>RSendAsMessage</apiname></xref></p><p> <xref href="GUID-CB2BB982-F91D-3E06-8D66-56731AA60EB8.dita"><apiname>CSendAsMessageTypes</apiname></xref></p><p> <xref href="GUID-90C4FDEE-3E4D-32B3-85E1-52C157AC4AC4.dita"><apiname>CSendAsAccounts</apiname></xref></p><p> <xref href="GUID-49738A1E-D452-30F3-9044-6528CABBD5D4.dita"><apiname>CRegisteredParserDll</apiname></xref></p><p> <xref href="GUID-115327CD-43D1-324B-84D7-8DFB6226C42A.dita"><apiname>CBIODatabase</apiname></xref></p><p> <xref href="GUID-8CB90FA2-A6CF-3FA2-81FF-7D22EFD9C2CE.dita"><apiname>CMsvStore</apiname></xref></p> </section> |
|
53 <section id="GUID-A61C8676-A44E-4F4B-96F3-D4836FD47370"><title>BIOParser: BIO message parsing</title> <p><b>Description</b> </p> <p>This |
|
54 example code demonstrates the parsing of the message. <codeph>CBIOExampleParser</codeph> is |
|
55 the wrapper class which uses <xref href="GUID-7A187B0D-79D6-3EAD-8181-FE2EBB9043DC.dita"><apiname>CBaseScriptParser2</apiname></xref> and other |
|
56 supporting classes mentioned in the <xref href="GUID-0CBD2728-DB7E-55FF-929A-E5BF279A1B66.dita#GUID-0CBD2728-DB7E-55FF-929A-E5BF279A1B66/GUID-E9472DA3-DA7B-5F4B-ACBF-770D3DE81580">Class |
|
57 Summary</xref> below. </p> <p>The <filepath>BIOParser</filepath> example code |
|
58 provides the following functionality: </p> <p><b>Creating the parser </b> </p> <codeblock id="GUID-C4ED1683-524A-55DA-88CB-D321C2AA59C2" xml:space="preserve">CBIOExampleParser* CBIOExampleParser::NewL(CRegisteredParserDll& aRegisteredParserDll, CMsvEntry& aEntry, RFs& aFs);</codeblock> <p>Creates a <codeph>CBIOExampleParser</codeph> object based on the registered |
|
59 parser DLL and the message entry. </p> <p><b>Parsing the BIO message </b> </p> <codeblock id="GUID-6F493EBE-BD8C-5982-B1AB-B592A3BAD1F4" xml:space="preserve">void CBIOExampleParser::ParseL();</codeblock> <p>Parses |
|
60 the BIO message. </p> <p><b>Processing the BIO message </b> </p> <codeblock id="GUID-106E21B6-CDFE-51AB-9C91-C263033B60AE" xml:space="preserve">CBIOExampleParser::ProcessL();</codeblock> <p>Processes |
|
61 the parsed data. </p> <p id="GUID-E9472DA3-DA7B-5F4B-ACBF-770D3DE81580"><b>Class |
|
62 Summary</b> </p><p><xref href="GUID-7A187B0D-79D6-3EAD-8181-FE2EBB9043DC.dita"><apiname>CBaseScriptParser2</apiname></xref></p> </section> |
|
63 <section id="GUID-15A5B370-1546-4A27-8F3D-8BE336AE32FD"><title>Build</title> <p>The <filepath>BIOMessageMgr</filepath> example |
|
64 code includes the following project files for building the application: <filepath>BIOParser.mmp</filepath>, <filepath>BIOMessage.mmp</filepath> and <filepath>bld.inf</filepath>. </p> <p>The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian |
|
65 build process</xref> describes how to build this application. </p> <p>In CodeWarrior: |
|
66 firstly, 'make' the <filepath>BIOParser.mcp</filepath> which creates <filepath>BIOParser.dll</filepath> and <filepath>BIOParser.lib</filepath> in <filepath>\epoc32\release\winscw\</filepath> <i><build_variant></i>, then secondly, |
|
67 make <filepath>BIOMessage.exe</filepath> in the same directory. Run <filepath>BIOMessage.mcp</filepath>, |
|
68 which runs <filepath>BIOMessage.exe</filepath> thus launching the emulator. </p> </section> |
|
69 <section id="GUID-E5C238CE-1321-4F18-9E37-C2CFE6D3995E"><title>Usage</title> <p>Launch the target. For emulator targets, |
|
70 run: <filepath>\epoc32\release\<wins or winscw>\<urel or udeb>\BIOMessage.exe</filepath>. |
|
71 If TechView emulator is used, to run the application go to System menu and |
|
72 click on Open files / programs window. Start the "BIO Messaging Example" application. </p> <p>Step |
|
73 through each phase of the example by pressing the space bar or by tapping |
|
74 on the window drawn by the example. </p> </section> |
|
75 </conbody></concept> |