Attica::Provider

#include <provider.h>

Public Types

enum  SortMode { Newest, Alphabetical, Rating, Downloads }
 

Public Member Functions

 Provider (const Provider &other)
 
QString achievementServiceVersion () const
 
QString activityServiceVersion () const
 
QString additionalAgentInformation () const
 
ItemPostJob< Achievement > * addNewAchievement (const QString &id, const Achievement &newAchievement)
 
ItemPostJob< Comment > * addNewComment (const Comment::Type commentType, const QString &id, const QString &id2, const QString &parentId, const QString &subject, const QString &message)
 
ItemPostJob< Content > * addNewContent (const Category &category, const Content &newContent)
 
PostJob * approveFriendship (const QString &to)
 
QUrl baseUrl () const
 
PostJob * becomeFan (const QString &contentId)
 
PostJob * cancelBuildServiceJob (const BuildServiceJob &job)
 
PostJob * cancelFriendship (const QString &to)
 
PostJob * checkLogin (const QString &user, const QString &password)
 
QString commentServiceVersion () const
 
QString contentServiceVersion () const
 
PostJob * createBuildServiceJob (const BuildServiceJob &job)
 
PostJob * createProject (const Project &project)
 
PostJob * createRemoteAccount (const RemoteAccount &account)
 
PostJob * declineFriendship (const QString &to)
 
DeleteJob * deleteAchievement (const QString &contentId, const QString &achievementId)
 
PostJob * deleteContent (const QString &contentId)
 
PostJob * deleteDownloadFile (const QString &contentId)
 
PostJob * deletePreviewImage (const QString &contentId, const QString &previewId)
 
PostJob * deleteProject (const Project &project)
 
PostJob * deleteRemoteAccount (const QString &id)
 
ItemJob< DownloadItem > * downloadLink (const QString &contentId, const QString &itemId=QStringLiteral("1"))
 
PutJob * editAchievement (const QString &contentId, const QString &achievementId, const Achievement &achievement)
 
ItemPostJob< Content > * editContent (const Category &updatedCategory, const QString &contentId, const Content &updatedContent)
 
PostJob * editProject (const Project &project)
 
PostJob * editRemoteAccount (const RemoteAccount &account)
 
QString fanServiceVersion () const
 
QString forumServiceVersion () const
 
QString friendServiceVersion () const
 
const QStringgetRegisterAccountUrl () const
 
bool hasAchievementService () const
 
bool hasActivityService () const
 
bool hasCommentService () const
 
bool hasContentService () const
 
bool hasCredentials () const
 
bool hasCredentials ()
 
bool hasFanService () const
 
bool hasForumService () const
 
bool hasFriendService () const
 
bool hasKnowledgebaseService () const
 
bool hasMessageService () const
 
bool hasPersonService () const
 
PostJob * inviteFriend (const QString &to, const QString &message)
 
bool isEnabled () const
 
bool isValid () const
 
QString knowledgebaseServiceVersion () const
 
bool loadCredentials (QString &user, QString &password)
 
QString messageServiceVersion () const
 
QString name () const
 
Provideroperator= (const Provider &other)
 
QString personServiceVersion () const
 
PostJob * postActivity (const QString &message)
 
PostJob * postFriendInvitation (const QString &to, const QString &message)
 
PostJob * postLocation (qreal latitude, qreal longitude, const QString &city=QString(), const QString &country=QString())
 
PostJob * postMessage (const Message &message)
 
PostJob * postTopic (const QString &forumId, const QString &subject, const QString &content)
 
PostJob * publishBuildJob (const BuildServiceJob &buildjob, const Publisher &publisher)
 
PostJob * registerAccount (const QString &id, const QString &password, const QString &mail, const QString &firstName, const QString &lastName)
 
ItemJob< AccountBalance > * requestAccountBalance ()
 
ListJob< Achievement > * requestAchievements (const QString &contentId, const QString &achievementId, const QString &userId)
 
ListJob< Activity > * requestActivities ()
 
ItemJob< BuildService > * requestBuildService (const QString &id)
 
ItemJob< BuildServiceJob > * requestBuildServiceJob (const QString &id)
 
ItemJob< BuildServiceJobOutput > * requestBuildServiceJobOutput (const QString &id)
 
ListJob< BuildServiceJob > * requestBuildServiceJobs (const Project &project)
 
ListJob< BuildService > * requestBuildServices ()
 
ListJob< Category > * requestCategories ()
 
ListJob< Comment > * requestComments (const Comment::Type commentType, const QString &id, const QString &id2, int page, int pageSize)
 
ItemJob< Config > * requestConfig ()
 
ItemJob< Content > * requestContent (const QString &contentId)
 
ListJob< Distribution > * requestDistributions ()
 
ItemJob< Event > * requestEvent (const QString &id)
 
ListJob< Event > * requestEvent (const QString &country, const QString &search, const QDate &startAt, SortMode mode, int page, int pageSize)
 
ListJob< Person > * requestFans (const QString &contentId, uint page=0, uint pageSize=10)
 
ListJob< Folder > * requestFolders ()
 
ListJob< Forum > * requestForums (uint page=0, uint pageSize=10)
 
ListJob< Person > * requestFriends (const QString &id, int page=0, int pageSize=20)
 
ListJob< HomePageType > * requestHomePageTypes ()
 
ItemJob< KnowledgeBaseEntry > * requestKnowledgeBaseEntry (const QString &id)
 
ListJob< License > * requestLicenses ()
 
ItemJob< Message > * requestMessage (const Folder &folder, const QString &id)
 
ListJob< Message > * requestMessages (const Folder &folder)
 
ListJob< Message > * requestMessages (const Folder &folder, Message::Status status)
 
ItemJob< Person > * requestPerson (const QString &id)
 
ListJob< Person > * requestPersonSearchByLocation (qreal latitude, qreal longitude, qreal distance=0.0, int page=0, int pageSize=20)
 
ListJob< Person > * requestPersonSearchByName (const QString &name)
 
ItemJob< Person > * requestPersonSelf ()
 
ItemJob< PrivateData > * requestPrivateData (const QString &app, const QString &key=QString())
 
ItemJob< PrivateData > * requestPrivateData ()
 
ItemJob< Project > * requestProject (const QString &id)
 
ListJob< Project > * requestProjects ()
 
ItemJob< Publisher > * requestPublisher (const QString &id)
 
ListJob< Publisher > * requestPublishers ()
 
ListJob< Person > * requestReceivedInvitations (int page=0, int pageSize=20)
 
ItemJob< RemoteAccount > * requestRemoteAccount (const QString &id)
 
ListJob< RemoteAccount > * requestRemoteAccounts ()
 
ListJob< Person > * requestSentInvitations (int page=0, int pageSize=20)
 
ListJob< Topic > * requestTopics (const QString &forum, const QString &search, const QString &description, SortMode mode, int page, int pageSize)
 
DeleteJob * resetAchievementProgress (const QString &id)
 
bool saveCredentials (const QString &user, const QString &password)
 
PostJob * savePublisherField (const Project &project, const PublisherField &field)
 
ListJob< Content > * searchContents (const Category::List &categories, const QString &search=QString(), SortMode mode=Rating, uint page=0, uint pageSize=10)
 
ListJob< Content > * searchContents (const Category::List &categories, const QString &person, const Distribution::List &distributions, const License::List &licenses, const QString &search=QString(), SortMode sortMode=Rating, uint page=0, uint pageSize=10)
 
ListJob< Content > * searchContentsByPerson (const Category::List &categories, const QString &person, const QString &search=QString(), SortMode mode=Rating, uint page=0, uint pageSize=10)
 
ListJob< KnowledgeBaseEntry > * searchKnowledgeBase (const Content &content, const QString &search, SortMode, int page, int pageSize)
 
PostJob * setAchievementProgress (const QString &id, const QVariant &progress, const QDateTime &timestamp)
 
void setAdditionalAgentInformation (const QString &additionalInformation)
 
PostJob * setDownloadFile (const QString &contentId, const QString &fileName, QIODevice *payload)
 
PostJob * setDownloadFile (const QString &contentId, const QString &fileName, const QByteArray &payload)
 
void setEnabled (bool enabled)
 
PostJob * setPreviewImage (const QString &contentId, const QString &previewId, const QString &fileName, const QByteArray &image)
 
PostJob * setPrivateData (const QString &app, const QString &key, const QString &value)
 
Attica::PostJob * uploadTarballToBuildService (const QString &projectId, const QString &fileName, const QByteArray &payload)
 
PostJob * voteForComment (const QString &id, uint rating)
 
PostJob * voteForContent (const QString &contentId, bool positiveVote)
 
PostJob * voteForContent (const QString &contentId, uint rating)
 

Protected Member Functions

QNetworkRequest createRequest (const QUrl &url)
 
QNetworkRequest createRequest (const QString &path)
 
QUrl createUrl (const QString &path)
 
ItemJob< AccountBalance > * doRequestAccountBalance (const QUrl &url)
 
ListJob< Achievement > * doRequestAchievementList (const QUrl &url)
 
ListJob< Activity > * doRequestActivityList (const QUrl &url)
 
ItemJob< Config > * doRequestConfig (const QUrl &url)
 
ListJob< Folder > * doRequestFolderList (const QUrl &url)
 
ListJob< Forum > * doRequestForumList (const QUrl &url)
 
ListJob< Message > * doRequestMessageList (const QUrl &url)
 
ItemJob< Person > * doRequestPerson (const QUrl &url)
 
ListJob< Person > * doRequestPersonList (const QUrl &url)
 
ListJob< Topic > * doRequestTopicList (const QUrl &url)
 

Detailed Description

The Provider class represents one Open Collaboration Service provider.

Use the ProviderManager to instantiate a Provider.

Accessing functions of the Provider returns a Job class that takes care of accessing the server and parsing the result.

Provider files are xml of the form:

 <provider>
 <id>opendesktop</id>
 <location>https://api.opendesktop.org/v1/</location>
 <name>openDesktop.org</name>
 <icon></icon>
 <termsofuse>https://opendesktop.org/terms/</termsofuse>
 <register>https://opendesktop.org/usermanager/new.php</register>
 <services>
   <person ocsversion="1.3">
   <friend ocsversion="1.3">
   <message ocsversion="1.3">
   <activity ocsversion="1.3">
   <content ocsversion="1.3">
   <fan ocsversion="1.3">
   <knowledgebase ocsversion="1.3">
   <event ocsversion="1.3">
   <comment ocsversion="1.2">
 </services>
</provider>
 

The server provides the services specified in the services section, not necessarily all of them.

Definition at line 95 of file provider.h.

Member Function Documentation

QString Provider::achievementServiceVersion ( ) const

Version of the achievement part of the API.

Definition at line 1689 of file provider.cpp.

QString Provider::activityServiceVersion ( ) const

Version of the activity part of the API.

Definition at line 1694 of file provider.cpp.

QString Provider::additionalAgentInformation ( ) const

The custom identifier sent along with requests.

Returns
The custom identifier
See also
setAdditionalAgentInformation(const QString&)
Since
5.66

Definition at line 256 of file provider.cpp.

ItemPostJob< Achievement > * Provider::addNewAchievement ( const QString id,
const Achievement &  newAchievement 
)

Add a new achievement.

Parameters
idid of the achievement entry
achievementThe new Achievement added
Returns
item post job for adding the new achievement

Definition at line 475 of file provider.cpp.

ItemPostJob< Comment > * Provider::addNewComment ( const Comment::Type  commentType,
const QString id,
const QString id2,
const QString parentId,
const QString subject,
const QString message 
)

Add a new comment.

Parameters
commentTypetype of the comment
See also
CommentType (content / forum / knowledgebase / event)
Parameters
idid of the content entry where you want to get the comments is from
id2id of the sub content entry where you want to get the comments is from
parentIdthe id of the parent comment if the new comment is a reply
subjecttitle of the comment
messagetext of the comment
Returns
item post job for adding the new comment

Definition at line 1544 of file provider.cpp.

QUrl Provider::baseUrl ( ) const

A url that identifies this provider.

This should be used as identifier when referring to this provider but you don't want to use the full provider object.

Definition at line 224 of file provider.cpp.

PostJob * Provider::cancelBuildServiceJob ( const BuildServiceJob &  job)

Cancel a job.

Setting the ID on the build service parameter is enough for it to work.

Parameters
jobBuildservicejob to cancel on the server, needs at least id set.

Definition at line 777 of file provider.cpp.

PostJob * Provider::checkLogin ( const QString user,
const QString password 
)

Test if the server accepts the login/password.

This function does not actually set the credentials. Use saveCredentials for that purpose.

Parameters
userthe user (login) name
passwordthe password
Returns
the job that will contain the success of the login as metadata

Definition at line 308 of file provider.cpp.

QString Provider::commentServiceVersion ( ) const

Version of the comments part of the API.

Definition at line 1698 of file provider.cpp.

QString Provider::contentServiceVersion ( ) const

Version of the content part of the API.

Definition at line 1702 of file provider.cpp.

PostJob * Provider::createBuildServiceJob ( const BuildServiceJob &  job)

Create a new job for a given project on a given buildservice for a given target.

Those three items are mandatory for the job to succeed.

Parameters
jobBuildservicejob to create on the server

Definition at line 790 of file provider.cpp.

PostJob * Provider::createProject ( const Project &  project)

Post modifications to a Project on the server.

The resulting project ID can be found in the Attica::MetaData of the finished() PostJob. You can retrieve it using Attica::MetaData::resultingProjectId().

Parameters
projectProject to create on the server

Definition at line 650 of file provider.cpp.

PostJob * Provider::createRemoteAccount ( const RemoteAccount &  account)

Create a new remote account, an account for a build service instance which is stored in the OCS service in order to authenticate with the build service instance.

Type, Type ID, login and password are mandatory.

Parameters
accountRemoteAccount to create on the server

Definition at line 852 of file provider.cpp.

DeleteJob * Provider::deleteAchievement ( const QString contentId,
const QString achievementId 
)

Deletes an achievement on the server.

The achievement passed as an argument doesn't need complete information as just the id() is used.

Parameters
achievementAchievement to delete on the server.

Definition at line 541 of file provider.cpp.

PostJob * Provider::deleteProject ( const Project &  project)

Deletes a project on the server.

The project passed as an argument doesn't need complete information as just the id() is used.

Parameters
projectProject to delete on the server.

Definition at line 671 of file provider.cpp.

PostJob * Provider::deleteRemoteAccount ( const QString id)

Deletes a remote account stored on the OCS server.

Parameters
idThe ID of the remote account on the OCS instance.

Definition at line 903 of file provider.cpp.

PutJob * Provider::editAchievement ( const QString contentId,
const QString achievementId,
const Achievement &  achievement 
)

Post modifications to an Achievement on the server.

Parameters
achievementAchievement to update on the server

Definition at line 506 of file provider.cpp.

PostJob * Provider::editProject ( const Project &  project)

Post modifications to a Project on the server.

Parameters
projectProject to update on the server

Definition at line 660 of file provider.cpp.

PostJob * Provider::editRemoteAccount ( const RemoteAccount &  account)

Edit an existing remote account.

Parameters
accountRemoteAccount to create on the server

Definition at line 872 of file provider.cpp.

QString Provider::fanServiceVersion ( ) const

Version of the fan part of the API.

Definition at line 1706 of file provider.cpp.

QString Provider::forumServiceVersion ( ) const

Version of the forum part of the API.

Definition at line 1710 of file provider.cpp.

QString Provider::friendServiceVersion ( ) const

Version of the friend part of the API.

Definition at line 1714 of file provider.cpp.

bool Provider::hasAchievementService ( ) const

Test if the server supports the achievement part of the API.

Definition at line 1731 of file provider.cpp.

bool Provider::hasActivityService ( ) const

Test if the server supports the activity part of the API.

Definition at line 1736 of file provider.cpp.

bool Provider::hasCommentService ( ) const

Test if the server supports the comments part of the API.

Definition at line 1740 of file provider.cpp.

bool Provider::hasContentService ( ) const

Test if the server supports the content part of the API.

Definition at line 1744 of file provider.cpp.

bool Provider::hasCredentials ( ) const

Test if the provider has user name/password available.

This does not yet open kwallet in case the KDE plugin is used.

Returns
true if the provider has login information

Definition at line 274 of file provider.cpp.

bool Provider::hasFanService ( ) const

Test if the server supports the fan part of the API.

Definition at line 1748 of file provider.cpp.

bool Provider::hasForumService ( ) const

Test if the server supports the forum part of the API.

Definition at line 1752 of file provider.cpp.

bool Provider::hasFriendService ( ) const

Test if the server supports the friend part of the API.

Definition at line 1756 of file provider.cpp.

bool Provider::hasKnowledgebaseService ( ) const

Test if the server supports the knowledgebase part of the API.

Definition at line 1760 of file provider.cpp.

bool Provider::hasMessageService ( ) const

Test if the server supports the message part of the API.

Definition at line 1764 of file provider.cpp.

bool Provider::hasPersonService ( ) const

Test if the server supports the person part of the API.

Definition at line 1768 of file provider.cpp.

bool Provider::isEnabled ( ) const

Test if the provider is enabled by the settings.

The application can choose to ignore this, but the user settings should be respected.

Definition at line 234 of file provider.cpp.

bool Provider::isValid ( ) const

Returns true if the provider has been set up and can be used.

Definition at line 229 of file provider.cpp.

QString Provider::knowledgebaseServiceVersion ( ) const

Version of the knowledgebase part of the API.

Definition at line 1718 of file provider.cpp.

bool Provider::loadCredentials ( QString user,
QString password 
)

Load user name and password from the store.

Attica will remember the loaded values and use them from this point on.

Parameters
userreference that returns the user name
passwordreference that returns the password
Returns
if credentials could be loaded

Definition at line 283 of file provider.cpp.

QString Provider::messageServiceVersion ( ) const

Version of the message part of the API.

Definition at line 1722 of file provider.cpp.

QString Provider::name ( ) const

A name for the provider that can be displayed to the user.

Definition at line 260 of file provider.cpp.

QString Provider::personServiceVersion ( ) const

Version of the person part of the API.

Definition at line 1726 of file provider.cpp.

PostJob * Provider::publishBuildJob ( const BuildServiceJob &  buildjob,
const Publisher publisher 
)

Publish the result of a completed build job to a publisher.

Returns
ItemJob receiving data

Definition at line 719 of file provider.cpp.

ListJob< Achievement > * Provider::requestAchievements ( const QString contentId,
const QString achievementId,
const QString userId 
)

Get a list of achievements.

Returns
ListJob listing Achievements

Definition at line 462 of file provider.cpp.

ItemJob< BuildService > * Provider::requestBuildService ( const QString id)

Get the information for a specific build service instance.

Returns
ItemJob receiving data

Definition at line 682 of file provider.cpp.

ItemJob< BuildServiceJob > * Provider::requestBuildServiceJob ( const QString id)

Get the information for a specific build service job, such as status and progress.

Returns
ItemJob receiving and containing the data

Definition at line 746 of file provider.cpp.

ItemJob< BuildServiceJobOutput > * Provider::requestBuildServiceJobOutput ( const QString id)

Get the build output for a specific build service job.

Returns
ItemJob receiving and containing the output data

Definition at line 735 of file provider.cpp.

ListJob< BuildServiceJob > * Provider::requestBuildServiceJobs ( const Project &  project)

Get a list of build service projects.

Returns
ListJob listing BuildServiceJobs

Definition at line 830 of file provider.cpp.

ListJob< BuildService > * Provider::requestBuildServices ( )

Get a list of build service build services.

Returns
ListJob listing BuildServices

Definition at line 808 of file provider.cpp.

ListJob< Category > * Provider::requestCategories ( )

Get a list of categories (such as wallpaper)

Returns
the categories of the server

Definition at line 1046 of file provider.cpp.

ListJob< Comment > * Provider::requestComments ( const Comment::Type  commentType,
const QString id,
const QString id2,
int  page,
int  pageSize 
)

Request a list of comments for a content / forum / knowledgebase / event.

Parameters
comment::Typetype of the comment
See also
Comment::Type (content / forum / knowledgebase / event)
Parameters
idid of the content entry where you want to get the comments is from
id2id of the content entry where you want to get the comments is from
pagerequest nth page in the list of results
pageSizerequested size of pages when calculating the list of results
Returns
list job for the comments results

Definition at line 1521 of file provider.cpp.

ItemJob< Config > * Provider::requestConfig ( )

Fetches server config.

Returns
The job responsible for fetching data

Definition at line 322 of file provider.cpp.

ItemJob< Content > * Provider::requestContent ( const QString contentId)

Retrieve a single content.

Parameters
contentIdthe id of the content
Returns
job that retrieves the content object

Definition at line 1160 of file provider.cpp.

ListJob< Distribution > * Provider::requestDistributions ( )

Get a list of distributions (such as Ark, Debian)

Returns
the licenses available from the server

Definition at line 1068 of file provider.cpp.

ListJob< HomePageType > * Provider::requestHomePageTypes ( )

Get a list of home page types (such as blog, Facebook)

Returns
the licenses available from the server

Definition at line 1079 of file provider.cpp.

ListJob< License > * Provider::requestLicenses ( )

Get a list of licenses (such as GPL)

Returns
the licenses available from the server

Definition at line 1057 of file provider.cpp.

ItemJob< PrivateData > * Provider::requestPrivateData ( const QString app,
const QString key = QString() 
)

Fetches the a given attribute from an OCS-compliant server.

Parameters
appThe application name
keyThe key of the attribute to fetch (optional)
Returns
The job that is responsible for fetching the data

Definition at line 1595 of file provider.cpp.

ItemJob<PrivateData>* Attica::Provider::requestPrivateData ( )
inline

Fetches all stored private data.

Returns
The job responsible for fetching data

Definition at line 318 of file provider.h.

ItemJob< Project > * Provider::requestProject ( const QString id)

Get a Project's data.

Returns
ItemJob receiving data

Definition at line 603 of file provider.cpp.

ListJob< Project > * Provider::requestProjects ( )

Get a list of build service projects.

Returns
ListJob listing Projects

Definition at line 592 of file provider.cpp.

ItemJob< Publisher > * Provider::requestPublisher ( const QString id)

Get the information for a specific publisher.

Returns
ItemJob receiving data

Definition at line 692 of file provider.cpp.

ListJob< Publisher > * Provider::requestPublishers ( )

Get a list of publishers.

Returns
ListJob listing Publishers

Definition at line 819 of file provider.cpp.

ItemJob< RemoteAccount > * Provider::requestRemoteAccount ( const QString id)

Get a remote account by its ID.

Parameters
idThe ID of the remote account

Definition at line 892 of file provider.cpp.

ListJob< RemoteAccount > * Provider::requestRemoteAccounts ( )

Get a list of remote accounts, account for a build service instance which is stored in the OCS service in order to authenticate with the build service instance.

Returns
ListJob listing RemoteAccounts

Definition at line 841 of file provider.cpp.

bool Provider::saveCredentials ( const QString user,
const QString password 
)

Sets (and remembers) user name and password for this provider.

To remove the data an empty username should be passed.

Parameters
userthe user (login) name
passwordthe password
Returns
if credentials could be saved

Definition at line 297 of file provider.cpp.

PostJob * Provider::savePublisherField ( const Project &  project,
const PublisherField &  field 
)

Save the value of a single publishing field.

Returns
PostJob*

Definition at line 703 of file provider.cpp.

ListJob< Content > * Provider::searchContents ( const Category::List categories,
const QString search = QString(),
SortMode  mode = Rating,
uint  page = 0,
uint  pageSize = 10 
)

Request a list of Contents.

Note that categories is not optional. If left empty, no results will be returned. An empty search string search returns the top n items.

Parameters
categoriescategories to search in
searchoptional search string (in name/description of the content)
modesorting mode
pagerequest nth page in the list of results
pageSizerequested size of pages when calculating the list of results
Returns
list job for the search results

Definition at line 1090 of file provider.cpp.

ListJob< Content > * Provider::searchContents ( const Category::List categories,
const QString person,
const Distribution::List distributions,
const License::List licenses,
const QString search = QString(),
SortMode  sortMode = Rating,
uint  page = 0,
uint  pageSize = 10 
)

Request a list of Contents.

More complete version. Note that categories is not optional. If left empty, no results will be returned. An empty search string search returns the top n items.

Parameters
categoriescategories to search in
personthe person-id that created the contents
distributionslist of distributions to filter by, if empty no filtering by distribution is done
licenseslist of licenses to filter by, if empty no filtering by license is done
searchoptional search string (in name/description of the content)
modesorting mode
pagerequest nth page in the list of results
pageSizerequested size of pages when calculating the list of results
Returns
list job for the search results

Definition at line 1100 of file provider.cpp.

ListJob< Content > * Provider::searchContentsByPerson ( const Category::List categories,
const QString person,
const QString search = QString(),
SortMode  mode = Rating,
uint  page = 0,
uint  pageSize = 10 
)

Request a list of Contents.

Like

See also
searchContents, but only contents created by one person.
Parameters
personthe person-id that created the contents.

Definition at line 1095 of file provider.cpp.

void Provider::setAdditionalAgentInformation ( const QString additionalInformation)

Set a custom identifier for your application (sent along with the requests as the http agent header in addition to the applicaiton name and version).

For example, you might have an application named SomeApplication, version 23, and wish to send along the data "lookandfeel.knsrc". Call this function, and the resulting agent header would be:

SomeApplication/23 (+lookandfeel.knsrc)

If you do not set this (or set it to an empty string), the agent string becomes

SomeApplication/23

Parameters
additionalAgentInformationThe extra string
Since
5.66

Definition at line 252 of file provider.cpp.

PostJob * Provider::setPreviewImage ( const QString contentId,
const QString previewId,
const QString fileName,
const QByteArray image 
)

Upload an image file as preview for the content.

Parameters
contentId
previewIdeach content can have previews with the id 1,2 or 3
payloadthe image file

Definition at line 1256 of file provider.cpp.

PostJob * Provider::setPrivateData ( const QString app,
const QString key,
const QString value 
)

Sets the value of an attribute.

Parameters
appThe application name
keyThe key of the attribute
valueThe new value of the attribute
Returns
The job responsible for setting data

Definition at line 1581 of file provider.cpp.

PostJob * Provider::uploadTarballToBuildService ( const QString projectId,
const QString fileName,
const QByteArray payload 
)

Upload a tarball to the buildservice.

Parameters
projectIdThe ID of the project this source file belongs to
payloadA reference tothe complete file data
Returns
A postjob to keep keep track of the upload

Definition at line 915 of file provider.cpp.

PostJob * Provider::voteForComment ( const QString id,
uint  rating 
)

Vote a comment item.

Parameters
idthe comment id which this voting is for
ratingthe rating, must be between 0 (bad) and 100 (good)
Returns
the post job for this voting

Definition at line 1568 of file provider.cpp.

PostJob * Provider::voteForContent ( const QString contentId,
bool  positiveVote 
)

Vote for a content item This version is for the old OCS API < 1.6.

Parameters
contentIdthe content which this voting is for
positiveVotewhether the voting is positive or negative
Returns
the post job for this voting
Deprecated:
Since 0.2, use voteForContent(const QString &, uint)

Definition at line 1287 of file provider.cpp.

PostJob * Provider::voteForContent ( const QString contentId,
uint  rating 
)

Vote for a content item.

Parameters
contentIdthe content which this voting is for
rating- the rating, must be between 0 (bad) and 100 (good)
Returns
the post job for this voting

Definition at line 1300 of file provider.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 23 2020 23:02:04 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.