author | cgandhi |
Thu, 23 Sep 2010 17:15:03 +0530 | |
changeset 23 | 574948b60dab |
parent 17 | 106a4bfcb866 |
child 26 | 83d6a149c755 |
permissions | -rw-r--r-- |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
1 |
/** |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
2 |
* Copyright (c) 2010 Sasken Communication Technologies Ltd. |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
3 |
* All rights reserved. |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
5 |
* under the terms of the "Eclipse Public License v1.0" |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html" |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
8 |
* |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
9 |
* Initial Contributors: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
10 |
* Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
11 |
* |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
12 |
* Contributors: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
13 |
* Nalina Hariharan |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
14 |
* |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
15 |
* Description: |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
16 |
* The Plugin that fetches contacts from the logged in user's flickr account |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
17 |
* |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
18 |
*/ |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
19 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
20 |
// Include files |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
21 |
#include <QtPlugin> |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
22 |
#include <QCryptographicHash> |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
23 |
#include <QTextStream> |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
24 |
#include <QFile> |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
25 |
#include <QMap> |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
26 |
#include <QListIterator> |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
27 |
#include <QDebug> |
17 | 28 |
#include <QSettings> |
29 |
#include <smfpluginutil.h> |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
30 |
#ifdef SMF_XMLPARSING |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
31 |
#include <QXmlStreamReader> |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
32 |
#endif |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
33 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
34 |
#include "flickrcontactfetcherplugin.h" |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
35 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
36 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
37 |
* Destructor |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
38 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
39 |
FlickrContactFetcherPlugin::~FlickrContactFetcherPlugin( ) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
40 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
41 |
if(m_provider) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
42 |
delete m_provider; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
43 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
44 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
45 |
/** |
17 | 46 |
* Method to interpret the key sets obtained from credential manager |
47 |
* @param aApiKey [out] The api key |
|
48 |
* @param aApiSecret [out] The api secret |
|
49 |
* @param aAuthToken [out] The auth token provided by Flickr |
|
50 |
*/ |
|
51 |
void FlickrContactFetcherPlugin::fetchKeys( QString &aApiKey, |
|
52 |
QString &aApiSecret, |
|
53 |
QString &aAuthToken ) |
|
54 |
{ |
|
55 |
qDebug()<<"Inside FlickrContactFetcherPlugin::fetchKeys()"; |
|
56 |
||
57 |
qDebug()<<"Reg Token = "<<m_provider->m_smfRegToken; |
|
58 |
qDebug()<<"Expiry Date as int = "<<m_provider->m_validity.toTime_t(); |
|
59 |
||
60 |
SmfAuthParams keys; |
|
61 |
SmfPluginUtil util; |
|
62 |
util.getAuthKeys(keys, m_provider->m_smfRegToken, |
|
63 |
m_provider->m_validity, m_provider->m_pluginId); |
|
64 |
||
65 |
qDebug()<<"Number of key-value pairs = "<<keys.count(); |
|
66 |
||
67 |
QByteArray keyName; |
|
68 |
keyName.append("ApiKey"); |
|
69 |
aApiKey.append(keys.value(keyName)); |
|
70 |
||
71 |
keyName.clear(); |
|
72 |
keyName.append("ApiSecret"); |
|
73 |
aApiSecret.append(keys.value(keyName)); |
|
74 |
||
75 |
keyName.clear(); |
|
76 |
keyName.append("AuthToken"); |
|
77 |
aAuthToken.append(keys.value(keyName)); |
|
78 |
||
79 |
qDebug()<<"Api Key = "<<aApiKey; |
|
80 |
qDebug()<<"Api Secret = "<<aApiSecret; |
|
81 |
qDebug()<<"Auth Token = "<<aAuthToken; |
|
82 |
} |
|
83 |
||
84 |
||
85 |
/** |
|
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
86 |
* Method to get the list of friends |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
87 |
* @param aRequest [out] The request data to be sent to network |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
88 |
* @param aPageNum The page to be extracted |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
89 |
* @param aItemsPerPage Number of items per page |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
90 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
91 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
92 |
SmfPluginError FlickrContactFetcherPlugin::friends( SmfPluginRequestData &aRequest, |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
93 |
const int aPageNum, |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
94 |
const int aItemsPerPage ) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
95 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
96 |
qDebug()<<"Inside FlickrContactFetcherPlugin::friends()"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
97 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
98 |
SmfPluginError error = SmfPluginErrInvalidArguments; |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
99 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
100 |
// invalid arguments |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
101 |
if( aPageNum < 0 || aItemsPerPage < 0 ) |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
102 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
103 |
qDebug()<<"Invalid arguments"; |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
104 |
return error; |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
105 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
106 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
107 |
qDebug()<<"Valid arguments"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
108 |
|
17 | 109 |
// Get the key sets from SMF Plugin Utility class. |
110 |
QString apiKey; |
|
111 |
QString apiSecret; |
|
112 |
QString authToken; |
|
113 |
fetchKeys(apiKey, apiSecret, authToken ); |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
114 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
115 |
// Create the API signature string |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
116 |
QString baseString; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
117 |
baseString.append(apiSecret); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
118 |
baseString.append("api_key"+apiKey); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
119 |
baseString.append("auth_token"+authToken); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
120 |
baseString.append("filterfriends"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
121 |
#ifdef SMF_XMLPARSING |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
122 |
baseString.append("formatxml"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
123 |
#else |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
124 |
baseString.append("formatjson"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
125 |
#endif |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
126 |
baseString.append("methodflickr.contacts.getList"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
127 |
baseString.append("page"+QString::number(aPageNum)); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
128 |
baseString.append("per_page"+QString::number(aItemsPerPage)); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
129 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
130 |
// Create the url |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
131 |
QUrl url("http://api.flickr.com/services/rest/?"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
132 |
url.addQueryItem("api_key", apiKey); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
133 |
url.addQueryItem("auth_token", authToken); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
134 |
url.addQueryItem("filter", "friends"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
135 |
#ifdef SMF_XMLPARSING |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
136 |
url.addQueryItem("format", "x"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
137 |
#else |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
138 |
url.addQueryItem("format", "json"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
139 |
#endif |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
140 |
url.addQueryItem("method", "flickr.contacts.getList"); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
141 |
url.addQueryItem("page", QString::number(aPageNum)); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
142 |
url.addQueryItem("per_page", QString::number(aItemsPerPage)); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
143 |
url.addQueryItem("api_sig", generateSignature(baseString)); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
144 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
145 |
// Create the request, set the url |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
146 |
aRequest.iNetworkRequest.setUrl(url); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
147 |
aRequest.iRequestType = SmfContactGetFriends; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
148 |
aRequest.iPostData = NULL; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
149 |
aRequest.iHttpOperationType = QNetworkAccessManager::GetOperation; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
150 |
error = SmfPluginErrNone; |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
151 |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
152 |
qDebug()<<"Url string is : "<<aRequest.iNetworkRequest.url().toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
153 |
return error; |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
154 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
155 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
156 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
157 |
* Method called by plugins to generate a signature string from a base string |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
158 |
* @param aBaseString The base string |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
159 |
* @return The md5 hash of the base string |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
160 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
161 |
QString FlickrContactFetcherPlugin::generateSignature(const QString aBaseString) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
162 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
163 |
qDebug()<<"Inside FlickrContactFetcherPlugin::generateSignature()"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
164 |
|
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
165 |
// Create md5 hash of the signature string |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
166 |
QByteArray byteArray; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
167 |
byteArray.insert(0, aBaseString.toAscii()); |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
168 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
169 |
QByteArray md5Hash = QCryptographicHash::hash(byteArray,QCryptographicHash::Md5 ).toHex(); |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
170 |
QString returnString (md5Hash); |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
171 |
qDebug()<<"generated signature = "<<QString(returnString); |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
172 |
return returnString; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
173 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
174 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
175 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
176 |
* Method to get the list of followers |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
177 |
* @param aRequest [out] The request data to be sent to network |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
178 |
* @param aPageNum The page to be extracted |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
179 |
* @param aItemsPerPage Number of items per page |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
180 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
181 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
182 |
SmfPluginError FlickrContactFetcherPlugin::followers( SmfPluginRequestData &aRequest, |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
183 |
const int aPageNum , |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
184 |
const int aItemsPerPage ) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
185 |
{ |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
186 |
#ifndef TESTINGTHISFUNCTION |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
187 |
Q_UNUSED(aRequest) |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
188 |
Q_UNUSED(aPageNum) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
189 |
Q_UNUSED(aItemsPerPage) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
190 |
qDebug()<<"Inside FlickrContactFetcherPlugin::followers()"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
191 |
return SmfPluginErrServiceNotSupported; |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
192 |
#else |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
193 |
SmfPluginError error = SmfPluginErrInvalidArguments; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
194 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
195 |
// invalid arguments |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
196 |
if( aPageNum < 0 || aItemsPerPage < 0 ) |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
197 |
{ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
198 |
qDebug()<<"Invalid arguments"; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
199 |
return error; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
200 |
} |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
201 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
202 |
qDebug()<<"Valid arguments"; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
203 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
204 |
// Get the key sets from SMF Plugin Utility class. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
205 |
QString apiKey; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
206 |
QString apiSecret; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
207 |
QString authToken; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
208 |
fetchKeys(apiKey, apiSecret, authToken ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
209 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
210 |
// Create the API signature string |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
211 |
QString baseString; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
212 |
baseString.append(apiSecret); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
213 |
baseString.append("api_key"+apiKey); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
214 |
baseString.append("auth_token"+authToken); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
215 |
baseString.append("filterfriends"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
216 |
#ifdef SMF_XMLPARSING |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
217 |
baseString.append("formatxml"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
218 |
#else |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
219 |
baseString.append("formatjson"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
220 |
#endif |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
221 |
baseString.append("methodflickr.contacts.getList"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
222 |
baseString.append("page"+QString::number(aPageNum)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
223 |
baseString.append("per_page"+QString::number(aItemsPerPage)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
224 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
225 |
// Create the url |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
226 |
QUrl url("http://api.flickr.com/services/rest/?"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
227 |
url.addQueryItem("api_key", apiKey); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
228 |
url.addQueryItem("auth_token", authToken); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
229 |
url.addQueryItem("filter", "friends"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
230 |
#ifdef SMF_XMLPARSING |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
231 |
url.addQueryItem("format", "x"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
232 |
#else |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
233 |
url.addQueryItem("format", "json"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
234 |
#endif |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
235 |
url.addQueryItem("method", "flickr.contacts.getList"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
236 |
url.addQueryItem("page", QString::number(aPageNum)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
237 |
url.addQueryItem("per_page", QString::number(aItemsPerPage)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
238 |
url.addQueryItem("api_sig", generateSignature(baseString)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
239 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
240 |
// Create the request, set the url |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
241 |
aRequest.iNetworkRequest.setUrl(url); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
242 |
aRequest.iRequestType = SmfContactGetFollowers; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
243 |
aRequest.iPostData = NULL; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
244 |
aRequest.iHttpOperationType = QNetworkAccessManager::GetOperation; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
245 |
error = SmfPluginErrNone; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
246 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
247 |
qDebug()<<"Url string is : "<<aRequest.iNetworkRequest.url().toString(); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
248 |
return error; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
249 |
#endif |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
250 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
251 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
252 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
253 |
* Method to search for a contact |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
254 |
* @param aRequest [out] The request data to be sent to network |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
255 |
* @param aContact contact to be searched |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
256 |
* @param aPageNum The page to be extracted |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
257 |
* @param aItemsPerPage Number of items per page |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
258 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
259 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
260 |
SmfPluginError FlickrContactFetcherPlugin::search( SmfPluginRequestData &aRequest, |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
261 |
const SmfContact &aContact, |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
262 |
const int aPageNum , |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
263 |
const int aItemsPerPage ) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
264 |
{ |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
265 |
#ifndef TESTINGTHISFUNCTION |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
266 |
Q_UNUSED(aRequest) |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
267 |
Q_UNUSED(aContact) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
268 |
Q_UNUSED(aPageNum) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
269 |
Q_UNUSED(aItemsPerPage) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
270 |
qDebug()<<"Inside FlickrContactFetcherPlugin::search()"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
271 |
return SmfPluginErrServiceNotSupported; |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
272 |
#else |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
273 |
SmfPluginError error = SmfPluginErrInvalidArguments; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
274 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
275 |
// Get the key sets from SMF Plugin Utility class. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
276 |
QString apiKey; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
277 |
QString apiSecret; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
278 |
QString authToken; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
279 |
fetchKeys(apiKey, apiSecret, authToken ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
280 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
281 |
// Create the API signature string |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
282 |
QString baseString; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
283 |
baseString.append(apiSecret); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
284 |
baseString.append("api_key"+apiKey); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
285 |
baseString.append("auth_token"+authToken); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
286 |
baseString.append("formatjson"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
287 |
baseString.append("methodflickr.people.findByUsername"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
288 |
//baseString.append("page"+QString::number(aPageNum)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
289 |
//baseString.append("per_page"+QString::number(aItemsPerPage)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
290 |
baseString.append("username"+(aContact.value("Name").value<QContactName>().firstName())); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
291 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
292 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
293 |
// Create the url |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
294 |
QUrl url("http://api.flickr.com/services/rest/?"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
295 |
url.addQueryItem("api_key", apiKey); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
296 |
url.addQueryItem("auth_token", authToken); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
297 |
url.addQueryItem("format", "json"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
298 |
url.addQueryItem("method", "flickr.people.findByUsername"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
299 |
url.addQueryItem("username",aContact.value("Name").value<QContactName>().firstName()); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
300 |
//url.addQueryItem("page", QString::number(10)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
301 |
//url.addQueryItem("per_page", QString::number(10)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
302 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
303 |
url.addQueryItem("api_sig", generateSignature(baseString)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
304 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
305 |
// Create the request, set the url |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
306 |
aRequest.iNetworkRequest.setUrl(url); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
307 |
aRequest.iRequestType = SmfContactSearch; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
308 |
aRequest.iPostData = NULL; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
309 |
aRequest.iHttpOperationType = QNetworkAccessManager::GetOperation; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
310 |
error = SmfPluginErrNone; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
311 |
// writeLog("Url string is :"+aRequest.iNetworkRequest.url().toString()); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
312 |
return error; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
313 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
314 |
#endif |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
315 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
316 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
317 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
318 |
* Method to search for contacts (friends) who are near the user. |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
319 |
* Proximity defines accuracy level |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
320 |
* @param aRequest [out] The request data to be sent to network |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
321 |
* @param aLocation The location search criteria |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
322 |
* @param aProximity location search boundary |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
323 |
* @param aPageNum The page to be extracted |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
324 |
* @param aItemsPerPage Number of items per page |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
325 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
326 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
327 |
SmfPluginError FlickrContactFetcherPlugin::searchNear( SmfPluginRequestData &aRequest, |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
328 |
const SmfLocation &aLocation, |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
329 |
const SmfLocationSearchBoundary &aProximity, |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
330 |
const int aPageNum , |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
331 |
const int aItemsPerPage ) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
332 |
{ |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
333 |
#ifndef TESTINGTHISFUNCTION |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
334 |
Q_UNUSED(aRequest) |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
335 |
Q_UNUSED(aLocation) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
336 |
Q_UNUSED(aProximity) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
337 |
Q_UNUSED(aPageNum) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
338 |
Q_UNUSED(aItemsPerPage) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
339 |
qDebug()<<"Inside FlickrContactFetcherPlugin::searchNear()"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
340 |
return SmfPluginErrServiceNotSupported; |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
341 |
#else |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
342 |
SmfPluginError error = SmfPluginErrInvalidArguments; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
343 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
344 |
// invalid arguments |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
345 |
if( aPageNum < 0 || aItemsPerPage < 0 ) |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
346 |
{ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
347 |
qDebug()<<"Invalid arguments"; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
348 |
return error; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
349 |
} |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
350 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
351 |
qDebug()<<"Valid arguments"; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
352 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
353 |
// Get the key sets from SMF Plugin Utility class. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
354 |
QString apiKey; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
355 |
QString apiSecret; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
356 |
QString authToken; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
357 |
fetchKeys(apiKey, apiSecret, authToken ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
358 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
359 |
// Create the API signature string |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
360 |
QString baseString; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
361 |
baseString.append(apiSecret); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
362 |
baseString.append("api_key"+apiKey); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
363 |
baseString.append("auth_token"+authToken); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
364 |
baseString.append("filterfriends"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
365 |
#ifdef SMF_XMLPARSING |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
366 |
baseString.append("formatxml"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
367 |
#else |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
368 |
baseString.append("formatjson"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
369 |
#endif |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
370 |
baseString.append("methodflickr.contacts.getList"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
371 |
baseString.append("page"+QString::number(aPageNum)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
372 |
baseString.append("per_page"+QString::number(aItemsPerPage)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
373 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
374 |
// Create the url |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
375 |
QUrl url("http://api.flickr.com/services/rest/?"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
376 |
url.addQueryItem("api_key", apiKey); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
377 |
url.addQueryItem("auth_token", authToken); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
378 |
url.addQueryItem("filter", "friends"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
379 |
#ifdef SMF_XMLPARSING |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
380 |
url.addQueryItem("format", "x"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
381 |
#else |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
382 |
url.addQueryItem("format", "json"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
383 |
#endif |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
384 |
url.addQueryItem("method", "flickr.contacts.getList"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
385 |
url.addQueryItem("page", QString::number(aPageNum)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
386 |
url.addQueryItem("per_page", QString::number(aItemsPerPage)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
387 |
url.addQueryItem("api_sig", generateSignature(baseString)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
388 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
389 |
// Create the request, set the url |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
390 |
aRequest.iNetworkRequest.setUrl(url); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
391 |
aRequest.iRequestType = SmfContactSearchNear; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
392 |
aRequest.iPostData = NULL; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
393 |
aRequest.iHttpOperationType = QNetworkAccessManager::GetOperation; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
394 |
error = SmfPluginErrNone; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
395 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
396 |
qDebug()<<"Url string is : "<<aRequest.iNetworkRequest.url().toString(); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
397 |
return error; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
398 |
#endif |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
399 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
400 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
401 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
402 |
* Method to get the list of groups |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
403 |
* @param aRequest [out] The request data to be sent to network |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
404 |
* @param aPageNum The page to be extracted |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
405 |
* @param aItemsPerPage Number of items per page |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
406 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
407 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
408 |
SmfPluginError FlickrContactFetcherPlugin::groups( SmfPluginRequestData &aRequest, |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
409 |
const int aPageNum , |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
410 |
const int aItemsPerPage ) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
411 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
412 |
qDebug()<<"Inside FlickrContactFetcherPlugin::groups()"; |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
413 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
414 |
SmfPluginError error = SmfPluginErrInvalidArguments; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
415 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
416 |
// invalid arguments |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
417 |
/*if( aPageNum < 0 || aItemsPerPage < 0 ) |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
418 |
{ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
419 |
qDebug()<<"Invalid arguments"; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
420 |
return error; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
421 |
}*/ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
422 |
// Get the key sets from SMF Plugin Utility class. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
423 |
QString apiKey; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
424 |
QString apiSecret; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
425 |
QString authToken; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
426 |
fetchKeys(apiKey, apiSecret, authToken ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
427 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
428 |
// Create the API signature string |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
429 |
QString baseString; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
430 |
baseString.append(apiSecret); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
431 |
baseString.append("api_key"+apiKey); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
432 |
baseString.append("auth_token"+authToken); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
433 |
baseString.append("formatjson"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
434 |
baseString.append("methodflickr.groups.pools.getGroups"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
435 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
436 |
// Create the url |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
437 |
QUrl url("http://api.flickr.com/services/rest/?"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
438 |
url.addQueryItem("api_key", apiKey); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
439 |
url.addQueryItem("auth_token", authToken); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
440 |
url.addQueryItem("format", "json"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
441 |
url.addQueryItem("method","flickr.groups.pools.getGroups"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
442 |
url.addQueryItem("api_sig", generateSignature(baseString)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
443 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
444 |
// Create the request, set the url |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
445 |
aRequest.iNetworkRequest.setUrl(url); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
446 |
aRequest.iRequestType = SmfContactGetGroups; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
447 |
aRequest.iPostData = NULL; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
448 |
aRequest.iHttpOperationType = QNetworkAccessManager::GetOperation; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
449 |
error = SmfPluginErrNone; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
450 |
// writeLog("Url string is : "+aRequest.iNetworkRequest.url().toString()); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
451 |
return error; |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
452 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
453 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
454 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
455 |
* Method to search for a contact in a group |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
456 |
* @param aRequest [out] The request data to be sent to network |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
457 |
* @param aGroup the group in which to search |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
458 |
* @param aContact The contact to be searched, default (NULL) is the self contact. |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
459 |
* @param aPageNum The page to be extracted |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
460 |
* @param aItemsPerPage Number of items per page |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
461 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
462 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
463 |
SmfPluginError FlickrContactFetcherPlugin::searchInGroup( SmfPluginRequestData &aRequest, |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
464 |
const SmfGroup &aGroup, |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
465 |
SmfContact *aContact, |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
466 |
const int aPageNum , |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
467 |
const int aItemsPerPage ) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
468 |
{ |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
469 |
#ifndef TESTINGTHISFUNCTION |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
470 |
Q_UNUSED(aRequest) |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
471 |
Q_UNUSED(aGroup) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
472 |
Q_UNUSED(aPageNum) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
473 |
Q_UNUSED(aItemsPerPage) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
474 |
qDebug()<<"Inside FlickrContactFetcherPlugin::searchInGroup()"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
475 |
return SmfPluginErrServiceNotSupported; |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
476 |
#else |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
477 |
SmfPluginError error = SmfPluginErrInvalidArguments; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
478 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
479 |
// invalid arguments |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
480 |
if( aPageNum < 0 || aItemsPerPage < 0 ) |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
481 |
{ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
482 |
qDebug()<<"Invalid arguments"; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
483 |
return error; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
484 |
} |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
485 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
486 |
qDebug()<<"Valid arguments"; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
487 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
488 |
// Get the key sets from SMF Plugin Utility class. |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
489 |
QString apiKey; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
490 |
QString apiSecret; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
491 |
QString authToken; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
492 |
fetchKeys(apiKey, apiSecret, authToken ); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
493 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
494 |
// Create the API signature string |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
495 |
QString baseString; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
496 |
baseString.append(apiSecret); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
497 |
baseString.append("api_key"+apiKey); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
498 |
baseString.append("auth_token"+authToken); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
499 |
baseString.append("filterfriends"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
500 |
#ifdef SMF_XMLPARSING |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
501 |
baseString.append("formatxml"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
502 |
#else |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
503 |
baseString.append("formatjson"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
504 |
#endif |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
505 |
baseString.append("methodflickr.contacts.getList"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
506 |
baseString.append("page"+QString::number(aPageNum)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
507 |
baseString.append("per_page"+QString::number(aItemsPerPage)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
508 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
509 |
// Create the url |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
510 |
QUrl url("http://api.flickr.com/services/rest/?"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
511 |
url.addQueryItem("api_key", apiKey); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
512 |
url.addQueryItem("auth_token", authToken); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
513 |
url.addQueryItem("filter", "friends"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
514 |
#ifdef SMF_XMLPARSING |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
515 |
url.addQueryItem("format", "x"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
516 |
#else |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
517 |
url.addQueryItem("format", "json"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
518 |
#endif |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
519 |
url.addQueryItem("method", "flickr.contacts.getList"); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
520 |
url.addQueryItem("page", QString::number(aPageNum)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
521 |
url.addQueryItem("per_page", QString::number(aItemsPerPage)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
522 |
url.addQueryItem("api_sig", generateSignature(baseString)); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
523 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
524 |
// Create the request, set the url |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
525 |
aRequest.iNetworkRequest.setUrl(url); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
526 |
aRequest.iRequestType = SmfContactSearchInGroup; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
527 |
aRequest.iPostData = NULL; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
528 |
aRequest.iHttpOperationType = QNetworkAccessManager::GetOperation; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
529 |
error = SmfPluginErrNone; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
530 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
531 |
qDebug()<<"Url string is : "<<aRequest.iNetworkRequest.url().toString(); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
532 |
return error; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
533 |
#endif |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
534 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
535 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
536 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
537 |
* Customised method for SmfContactFetcherPlugin interface |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
538 |
* @param aRequest [out] The request data to be sent to network |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
539 |
* @param aOperation The operation type (should be known between |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
540 |
* the client interface and the plugin) |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
541 |
* @param aData The data required to form the request (The type |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
542 |
* of data should be known between client and the plugin) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
543 |
* @return SmfPluginError Plugin error if any, else SmfPluginErrNone |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
544 |
*/ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
545 |
SmfPluginError FlickrContactFetcherPlugin::customRequest( SmfPluginRequestData &aRequest, |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
546 |
const int &aOperation, QByteArray *aData ) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
547 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
548 |
Q_UNUSED(aRequest) |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
549 |
Q_UNUSED(aOperation) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
550 |
Q_UNUSED(aData) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
551 |
qDebug()<<"Inside FlickrContactFetcherPlugin::customRequest()"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
552 |
return SmfPluginErrServiceNotSupported; |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
553 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
554 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
555 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
556 |
* The first method to be called in the plugin that implements this interface. |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
557 |
* If this method is not called, plugin may not behave as expected. |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
558 |
*/ |
17 | 559 |
void FlickrContactFetcherPlugin::initialize( ) |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
560 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
561 |
// Create an instance of FlickrProviderBase |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
562 |
m_provider = new FlickrProviderBase; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
563 |
m_provider->initialize(); |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
564 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
565 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
566 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
567 |
* Method to get the provider information |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
568 |
* @return Instance of SmfProviderBase |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
569 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
570 |
SmfProviderBase* FlickrContactFetcherPlugin::getProviderInfo( ) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
571 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
572 |
return m_provider; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
573 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
574 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
575 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
576 |
* Method to get the result for a network request. |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
577 |
* @param aOperation The type of operation to be requested |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
578 |
* @param aTransportResult The result of transport operation |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
579 |
* @param aResponse The QByteArray instance containing the network response. |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
580 |
* The plugins should delete this instance once they have read the |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
581 |
* data from it. |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
582 |
* @param aResult [out] An output parameter to the plugin manager.If the |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
583 |
* return value is SmfSendRequestAgain, QVariant will be of type |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
584 |
* SmfPluginRequestData. |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
585 |
* For SmfGalleryPlugin: If last operation was pictures(), aResult will |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
586 |
* be of type QList<SmfPicture>. If last operation was description(), |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
587 |
* aResult will be of type QString. If last operation was upload() or |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
588 |
* postComment(), aResult will be of type bool. |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
589 |
* @param aRetType [out] SmfPluginRetType |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
590 |
* @param aPageResult [out] The SmfResultPage structure variable |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
591 |
*/ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
592 |
SmfPluginError FlickrContactFetcherPlugin::responseAvailable( |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
593 |
const SmfRequestTypeID aOperation, |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
594 |
const SmfTransportResult &aTransportResult, |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
595 |
QByteArray *aResponse, |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
596 |
QVariant* aResult, |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
597 |
SmfPluginRetType &aRetType, |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
598 |
SmfResultPage &aPageResult ) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
599 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
600 |
Q_UNUSED(aPageResult) |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
601 |
qDebug()<<"Inside FlickrContactFetcherPlugin::responseAvailable()"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
602 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
603 |
SmfPluginError error = SmfPluginErrNetworkError; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
604 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
605 |
if( !aResponse || (0 == aResponse->size()) ) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
606 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
607 |
qDebug()<<"Response is NULL or empty"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
608 |
aRetType = SmfRequestError; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
609 |
return error; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
610 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
611 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
612 |
QByteArray response(*aResponse); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
613 |
delete aResponse; |
17 | 614 |
|
615 |
QFile respFile("c://data//SmfPluginFlickrContactResponse.txt"); |
|
616 |
if(!respFile.open(QIODevice::WriteOnly)) |
|
617 |
{ |
|
618 |
qDebug()<<"File to write the response could not be opened, so writing to this file"; |
|
619 |
qDebug()<<"Flickr response = "<<QString(response); |
|
620 |
} |
|
621 |
else |
|
622 |
{ |
|
623 |
respFile.write(response); |
|
624 |
respFile.close(); |
|
625 |
qDebug()<<"Writing FB response to a file named 'SmfPluginFlickrContactResponse.txt'"; |
|
626 |
} |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
627 |
qDebug()<<"FB response size = "<<response.size(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
628 |
|
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
629 |
if(SmfTransportOpNoError == aTransportResult) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
630 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
631 |
qDebug()<<"No transport error"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
632 |
|
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
633 |
#ifndef TESTINGTHISFUNCTION |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
634 |
if(SmfContactGetFriends == aOperation) |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
635 |
#else |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
636 |
if(SmfContactGetFriends == aOperation ||aOperation == SmfContactGetFollowers||aOperation== SmfContactSearch ||aOperation ==SmfContactSearchNear||aOperation ==SmfContactSearchInGroup) |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
637 |
#endif |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
638 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
639 |
qDebug()<<"For getting friends response"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
640 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
641 |
QList<SmfContact> list; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
642 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
643 |
#ifdef SMF_XMLPARSING // Xml parsing |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
644 |
// For getting contacts from xml response |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
645 |
QXmlStreamReader xml(response); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
646 |
while (!xml.atEnd()) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
647 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
648 |
xml.readNext(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
649 |
if (xml.tokenType() == QXmlStreamReader::StartElement) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
650 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
651 |
// If the tag is contact |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
652 |
if (xml.name() == "contact") |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
653 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
654 |
qDebug()<<"Contact tag found"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
655 |
SmfContact contact; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
656 |
QStringRef str; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
657 |
QContactName contactname; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
658 |
QString username = xml.attributes().value("username").toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
659 |
qDebug()<<"Username = "<<username; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
660 |
contactname.setFirstName(username); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
661 |
contactname.setLastName(username); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
662 |
QVariant namevar1 = QVariant::fromValue(contactname); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
663 |
contact.setValue("Name",namevar1); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
664 |
list.append(contact); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
665 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
666 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
667 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
668 |
#else |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
669 |
// To remove the "jsonFlickrApi(" and also remove the last ")" from the response, |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
670 |
// as these gives a Json parsing error |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
671 |
response.remove(0, 14); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
672 |
response.chop(1); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
673 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
674 |
// For getting contacts from json response |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
675 |
bool ok; |
17 | 676 |
SmfPluginUtil util; |
677 |
QVariantMap result = util.parse(response, &ok).toMap(); |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
678 |
if (!ok) { |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
679 |
qDebug()<<"An error occurred during json parsing"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
680 |
aResult->setValue(list); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
681 |
aRetType = SmfRequestError; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
682 |
return SmfPluginErrParsingFailed; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
683 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
684 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
685 |
QVariantMap map1 = result["contacts"].toMap(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
686 |
qDebug()<<"page = "<<map1["page"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
687 |
qDebug()<<"pages = "<<map1["pages"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
688 |
qDebug()<<"per_page = "<<map1["per_page"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
689 |
qDebug()<<"perpage = "<<map1["perpage"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
690 |
qDebug()<<"total = "<<map1["perpage"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
691 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
692 |
QList<QVariant> list1 = map1["contact"].toList(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
693 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
694 |
QListIterator<QVariant> i(list1); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
695 |
while(i.hasNext()) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
696 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
697 |
SmfContact contact; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
698 |
QVariantMap map2 = i.next().toMap(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
699 |
qDebug()<<"nsid = "<<map2["nsid"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
700 |
qDebug()<<"username = "<<map2["username"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
701 |
qDebug()<<"iconserver = "<<map2["iconserver"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
702 |
qDebug()<<"iconfarm = "<<map2["iconfarm"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
703 |
qDebug()<<"ignored = "<<map2["ignored"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
704 |
qDebug()<<"realname = "<<map2["realname"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
705 |
qDebug()<<"friend = "<<map2["friend"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
706 |
qDebug()<<"family = "<<map2["family"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
707 |
qDebug()<<"path_alias = "<<map2["path_alias"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
708 |
qDebug()<<"location = "<<map2["location"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
709 |
|
17 | 710 |
// Contact Name |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
711 |
QContactName contactname; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
712 |
QString username = map2["username"].toString(); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
713 |
qDebug()<<"Username = "<<username; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
714 |
contactname.setFirstName(username); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
715 |
contactname.setLastName(username); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
716 |
QVariant nameVar = QVariant::fromValue(contactname); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
717 |
contact.setValue("Name",nameVar); |
17 | 718 |
|
719 |
// Contact's Flickr Specific ID to QContactGuid |
|
720 |
QContactGuid guid; |
|
721 |
guid.setGuid(map2["nsid"].toString()); |
|
722 |
QVariant guidVar = QVariant::fromValue(guid); |
|
723 |
contact.setValue("Guid",guidVar); |
|
724 |
||
725 |
// Contact's profile image url |
|
726 |
QUrl url; |
|
727 |
if((0 == map2["iconfarm"].toInt()) && (0 == map2["iconserver"].toInt())) |
|
728 |
url = QString("http://www.flickr.com/images/buddyicon.jpg"); |
|
729 |
else |
|
730 |
{ |
|
731 |
QString str("http://farm"); |
|
732 |
str.append(map2["iconfarm"].toString()); |
|
733 |
str.append(".static.flickr.com/"); |
|
734 |
str.append(map2["iconserver"].toString()); |
|
735 |
str.append("/buddyicons/"); |
|
736 |
str.append(map2["nsid"].toString()); |
|
737 |
str.append(".jpg"); |
|
738 |
url = str; |
|
739 |
} |
|
740 |
QContactAvatar avatar; |
|
741 |
qDebug()<<"Profile image URL = "<<url.toString(); |
|
742 |
avatar.setImageUrl(url); |
|
743 |
QVariant avatarVar = QVariant::fromValue(avatar); |
|
744 |
contact.setValue("Avatar",avatarVar); |
|
745 |
||
746 |
||
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
747 |
list.append(contact); |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
748 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
749 |
#endif |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
750 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
751 |
qDebug()<<"list count = "<<list.count(); |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
752 |
aResult->setValue(list); |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
753 |
aRetType = SmfRequestComplete; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
754 |
error = SmfPluginErrNone; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
755 |
} |
23
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
756 |
else if(aOperation==SmfContactGetGroups) |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
757 |
{ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
758 |
response.remove(0, 14); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
759 |
response.chop(1); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
760 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
761 |
bool ok; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
762 |
qDebug()<<"Before Parser--"; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
763 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
764 |
SmfPluginUtil util; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
765 |
QVariant result = util.parse(response, &ok); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
766 |
if (!ok) |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
767 |
{ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
768 |
qDebug()<<"An error occurred during json parsing"; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
769 |
aRetType = SmfRequestError; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
770 |
return SmfPluginErrParsingFailed; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
771 |
//return 0; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
772 |
} |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
773 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
774 |
QVariantMap map1 = result.toMap(); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
775 |
QList<SmfGroup> list; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
776 |
QVariantMap map2 = map1["groups"].toMap(); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
777 |
int page = map2["page"].toInt(&ok); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
778 |
qDebug()<<"PAGE = "<<map2["page"].toString(); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
779 |
QList<QVariant> list1 = map2["group"].toList(); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
780 |
QListIterator<QVariant> iter(list1); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
781 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
782 |
//Getting the group list from QJson Parser |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
783 |
while(iter.hasNext()) |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
784 |
{ |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
785 |
QVariantMap map2 = iter.next().toMap(); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
786 |
qDebug()<<"name = "<<map2["name"].toString(); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
787 |
qDebug()<<"id = "<<map2["id"].toString(); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
788 |
SmfGroup group; |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
789 |
QString id(map2["id"].toString()); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
790 |
group.setId(id); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
791 |
QString grpname(map2["name"].toString()); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
792 |
group.setName(grpname); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
793 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
794 |
list.append(group); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
795 |
|
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
796 |
}//end While |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
797 |
qDebug()<<"list count = "<<QString::number(list.count(),10); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
798 |
aResult->setValue(list); |
574948b60dab
updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents:
17
diff
changeset
|
799 |
} |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
800 |
else |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
801 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
802 |
qDebug()<<"Service unsupported, currently only SmfContactGetFriends !!!"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
803 |
aRetType = SmfRequestError; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
804 |
error = SmfPluginErrServiceNotSupported; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
805 |
} |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
806 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
807 |
|
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
808 |
else if(SmfTransportOpOperationCanceledError == aTransportResult) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
809 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
810 |
qDebug()<<"Operation Cancelled !!!"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
811 |
error = SmfPluginErrCancelComplete; |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
812 |
aRetType = SmfRequestComplete; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
813 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
814 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
815 |
else |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
816 |
{ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
817 |
qDebug()<<"Transport Error !!!"; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
818 |
error = SmfPluginErrNetworkError; |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
819 |
aRetType = SmfRequestError; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
820 |
} |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
821 |
|
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
822 |
return error; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
823 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
824 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
825 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
826 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
827 |
* Destructor |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
828 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
829 |
FlickrProviderBase::~FlickrProviderBase( ) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
830 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
831 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
832 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
833 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
834 |
* Method to get the Localisable name of the service. |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
835 |
* @return The Localisable name of the service. |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
836 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
837 |
QString FlickrProviderBase::serviceName( ) const |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
838 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
839 |
return m_serviceName; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
840 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
841 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
842 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
843 |
* Method to get the Logo of the service |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
844 |
* @return The Logo of the service |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
845 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
846 |
QImage FlickrProviderBase::serviceIcon( ) const |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
847 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
848 |
return m_serviceIcon; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
849 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
850 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
851 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
852 |
* Method to get the Readable service description |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
853 |
* @return The Readable service description |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
854 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
855 |
QString FlickrProviderBase::description( ) const |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
856 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
857 |
return m_description; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
858 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
859 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
860 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
861 |
* Method to get the Website of the service |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
862 |
* @return The Website of the service |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
863 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
864 |
QUrl FlickrProviderBase::serviceUrl( ) const |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
865 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
866 |
return m_serviceUrl; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
867 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
868 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
869 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
870 |
* Method to get the URL of the Application providing this service |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
871 |
* @return The URL of the Application providing this service |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
872 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
873 |
QUrl FlickrProviderBase::applicationUrl( ) const |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
874 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
875 |
return m_applicationUrl; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
876 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
877 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
878 |
/** |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
879 |
* Method to get the Icon of the application |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
880 |
* @return The Icon of the application |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
881 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
882 |
QImage FlickrProviderBase::applicationIcon( ) const |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
883 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
884 |
return m_applicationIcon; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
885 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
886 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
887 |
/** |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
888 |
* Method to get the list of interfaces that this provider support |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
889 |
* @return List of supported Interafces |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
890 |
*/ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
891 |
QList<QString> FlickrProviderBase::supportedInterfaces( ) const |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
892 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
893 |
return m_supportedInterfaces; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
894 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
895 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
896 |
/** |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
897 |
* Method to get the list of languages supported by this service provider |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
898 |
* @return a QStringList of languages supported by this service |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
899 |
* provider in 2 letter ISO 639-1 format. |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
900 |
*/ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
901 |
QStringList FlickrProviderBase::supportedLanguages( ) const |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
902 |
{ |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
903 |
return m_supportedLangs; |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
904 |
} |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
905 |
|
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
906 |
/** |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
907 |
* Method to get the Plugin specific ID |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
908 |
* @return The Plugin specific ID |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
909 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
910 |
QString FlickrProviderBase::pluginId( ) const |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
911 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
912 |
return m_pluginId; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
913 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
914 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
915 |
/** |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
916 |
* Method to get the ID of the authentication application |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
917 |
* for this service |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
918 |
* @param aProgram The authentication application name |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
919 |
* @param aArguments List of arguments required for authentication app |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
920 |
* @param aMode Strting mode for authentication application |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
921 |
* @return The ID of the authentication application |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
922 |
*/ |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
923 |
QString FlickrProviderBase::authenticationApp( QString &aProgram, |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
924 |
QStringList & aArguments, |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
925 |
QIODevice::OpenModeFlag aMode ) const |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
926 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
927 |
Q_UNUSED(aProgram) |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
928 |
Q_UNUSED(aArguments) |
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
929 |
Q_UNUSED(aMode) |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
930 |
return m_authAppId; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
931 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
932 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
933 |
/** |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
934 |
* Method to get the unique registration ID provided by the |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
935 |
* Smf for authorised plugins |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
936 |
* @return The unique registration ID/token provided by the Smf for |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
937 |
* authorised plugins |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
938 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
939 |
QString FlickrProviderBase::smfRegistrationId( ) const |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
940 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
941 |
return m_smfRegToken; |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
942 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
943 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
944 |
void FlickrProviderBase::initialize() |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
945 |
{ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
946 |
m_serviceName = "Flickr"; |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
947 |
m_description = "Flickr contact fetcher plugin description"; |
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
948 |
m_serviceUrl = QUrl(QString("http://api.flickr.com")); |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
949 |
m_pluginId = "flickrcontactfetcherplugin.qtplugin"; |
17 | 950 |
m_authAppId = "0xE1D8C7D7"; |
14
a469c0e6e7fb
changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents:
6
diff
changeset
|
951 |
m_supportedInterfaces.append("org.symbian.smf.plugin.contact.fetcher/v0.2"); |
17 | 952 |
QSettings iSettings; |
953 |
m_smfRegToken = iSettings.value("CMFlickrRegToken").toString(); |
|
954 |
m_validity = iSettings.value("FlckrExpiryTime").toDateTime(); |
|
6
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
955 |
} |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
956 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
957 |
|
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
958 |
/* |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
959 |
* Export Macro |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
960 |
* plugin name : flickrcontactfetcherplugin |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
961 |
* plugin class : FlickrContactFetcherPlugin |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
962 |
*/ |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
963 |
Q_EXPORT_PLUGIN2( flickrcontactfetcherplugin, FlickrContactFetcherPlugin ) |
c39a6cfd1fb9
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff
changeset
|
964 |