Attica 5.109.0
Public Types | Public Member Functions | Protected Member Functions | List of all members
Attica::Provider

The Provider class represents one Open Collaboration Service provider. More...

#include <Attica/Provider>

Public Types

enum  SortMode { Newest , Alphabetical , Rating , Downloads }
 

Public Member Functions

 Provider (const Provider &other)
 
QString achievementServiceVersion () const
 Version of the achievement part of the API.
 
QString activityServiceVersion () const
 Version of the activity part of the API.
 
QString additionalAgentInformation () const
 The custom identifier sent along with requests.
 
ItemPostJob< Achievement > * addNewAchievement (const QString &id, const Achievement &newAchievement)
 Add a new achievement.
 
ItemPostJob< Comment > * addNewComment (const Comment::Type commentType, const QString &id, const QString &id2, const QString &parentId, const QString &subject, const QString &message)
 Add a new comment.
 
ItemPostJob< Content > * addNewContent (const Category &category, const Content &newContent)
 
PostJobapproveFriendship (const QString &to)
 
QUrl baseUrl () const
 A url that identifies this provider.
 
PostJobbecomeFan (const QString &contentId)
 
PostJobcancelBuildServiceJob (const BuildServiceJob &job)
 Cancel a job.
 
PostJobcancelFriendship (const QString &to)
 
PostJobcheckLogin (const QString &user, const QString &password)
 Test if the server accepts the login/password.
 
QString commentServiceVersion () const
 Version of the comments part of the API.
 
QString contentServiceVersion () const
 Version of the content part of the API.
 
PostJobcreateBuildServiceJob (const BuildServiceJob &job)
 Create a new job for a given project on a given buildservice for a given target.
 
PostJobcreateProject (const Project &project)
 Post modifications to a Project on the server.
 
PostJobcreateRemoteAccount (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.
 
PostJobdeclineFriendship (const QString &to)
 
DeleteJobdeleteAchievement (const QString &contentId, const QString &achievementId)
 Deletes an achievement on the server.
 
PostJobdeleteContent (const QString &contentId)
 
PostJobdeleteDownloadFile (const QString &contentId)
 
PostJobdeletePreviewImage (const QString &contentId, const QString &previewId)
 
PostJobdeleteProject (const Project &project)
 Deletes a project on the server.
 
PostJobdeleteRemoteAccount (const QString &id)
 Deletes a remote account stored on the OCS server.
 
ItemJob< DownloadItem > * downloadLink (const QString &contentId, const QString &itemId=QStringLiteral("1"))
 
PutJobeditAchievement (const QString &contentId, const QString &achievementId, const Achievement &achievement)
 Post modifications to an Achievement on the server.
 
ItemPostJob< Content > * editContent (const Category &updatedCategory, const QString &contentId, const Content &updatedContent)
 
PostJobeditProject (const Project &project)
 Post modifications to a Project on the server.
 
PostJobeditRemoteAccount (const RemoteAccount &account)
 Edit an existing remote account.
 
QString fanServiceVersion () const
 Version of the fan part of the API.
 
QString forumServiceVersion () const
 Version of the forum part of the API.
 
QString friendServiceVersion () const
 Version of the friend part of the API.
 
const QString & getRegisterAccountUrl () const
 
bool hasAchievementService () const
 Test if the server supports the achievement part of the API.
 
bool hasActivityService () const
 Test if the server supports the activity part of the API.
 
bool hasCommentService () const
 Test if the server supports the comments part of the API.
 
bool hasContentService () const
 Test if the server supports the content part of the API.
 
bool hasCredentials ()
 
bool hasCredentials () const
 Test if the provider has user name/password available.
 
bool hasFanService () const
 Test if the server supports the fan part of the API.
 
bool hasForumService () const
 Test if the server supports the forum part of the API.
 
bool hasFriendService () const
 Test if the server supports the friend part of the API.
 
bool hasKnowledgebaseService () const
 Test if the server supports the knowledgebase part of the API.
 
bool hasMessageService () const
 Test if the server supports the message part of the API.
 
bool hasPersonService () const
 Test if the server supports the person part of the API.
 
QUrl icon () const
 An icon used to visually identify this provider.
 
PostJobinviteFriend (const QString &to, const QString &message)
 
bool isEnabled () const
 Test if the provider is enabled by the settings.
 
bool isValid () const
 Returns true if the provider has been set up and can be used.
 
QString knowledgebaseServiceVersion () const
 Version of the knowledgebase part of the API.
 
bool loadCredentials (QString &user, QString &password)
 Load user name and password from the store.
 
QString messageServiceVersion () const
 Version of the message part of the API.
 
QString name () const
 A name for the provider that can be displayed to the user.
 
Provideroperator= (const Provider &other)
 
QString personServiceVersion () const
 Version of the person part of the API.
 
PostJobpostActivity (const QString &message)
 
PostJobpostLocation (qreal latitude, qreal longitude, const QString &city=QString(), const QString &country=QString())
 
PostJobpostMessage (const Message &message)
 
PostJobpostTopic (const QString &forumId, const QString &subject, const QString &content)
 
PostJobpublishBuildJob (const BuildServiceJob &buildjob, const Publisher &publisher)
 Publish the result of a completed build job to a publisher.
 
PostJobregisterAccount (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)
 Get a list of achievements.
 
ListJob< Activity > * requestActivities ()
 
ItemJob< BuildService > * requestBuildService (const QString &id)
 Get the information for a specific build service instance.
 
ItemJob< BuildServiceJob > * requestBuildServiceJob (const QString &id)
 Get the information for a specific build service job, such as status and progress.
 
ItemJob< BuildServiceJobOutput > * requestBuildServiceJobOutput (const QString &id)
 Get the build output for a specific build service job.
 
ListJob< BuildServiceJob > * requestBuildServiceJobs (const Project &project)
 Get a list of build service projects.
 
ListJob< BuildService > * requestBuildServices ()
 Get a list of build service build services.
 
ListJob< Category > * requestCategories ()
 Get a list of categories (such as wallpaper)
 
ListJob< Comment > * 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.
 
ItemJob< Config > * requestConfig ()
 Fetches server config.
 
ItemJob< Content > * requestContent (const QString &contentId)
 Retrieve a single content.
 
ListJob< Distribution > * requestDistributions ()
 Get a list of distributions (such as Ark, Debian)
 
ListJob< Event > * requestEvent (const QString &country, const QString &search, const QDate &startAt, SortMode mode, int page, int pageSize)
 
ItemJob< Event > * requestEvent (const QString &id)
 
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 ()
 Get a list of home page types (such as blog, Facebook)
 
ItemJob< KnowledgeBaseEntry > * requestKnowledgeBaseEntry (const QString &id)
 
ListJob< License > * requestLicenses ()
 Get a list of licenses (such as GPL)
 
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 ()
 Fetches all stored private data.
 
ItemJob< PrivateData > * requestPrivateData (const QString &app, const QString &key=QString())
 Fetches the a given attribute from an OCS-compliant server.
 
ItemJob< Project > * requestProject (const QString &id)
 Get a Project's data.
 
ListJob< Project > * requestProjects ()
 Get a list of build service projects.
 
ItemJob< Publisher > * requestPublisher (const QString &id)
 Get the information for a specific publisher.
 
ListJob< Publisher > * requestPublishers ()
 Get a list of publishers.
 
ListJob< Person > * requestReceivedInvitations (int page=0, int pageSize=20)
 
ItemJob< RemoteAccount > * requestRemoteAccount (const QString &id)
 Get a remote account by its ID.
 
ListJob< RemoteAccount > * 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.
 
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)
 
DeleteJobresetAchievementProgress (const QString &id)
 
bool saveCredentials (const QString &user, const QString &password)
 Sets (and remembers) user name and password for this provider.
 
PostJobsavePublisherField (const Project &project, const PublisherField &field)
 Save the value of a single publishing field.
 
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)
 Request a list of Contents.
 
ListJob< Content > * searchContents (const Category::List &categories, const QString &search=QString(), SortMode mode=Rating, uint page=0, uint pageSize=10)
 Request a list of Contents.
 
ListJob< Content > * 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.
 
ListJob< KnowledgeBaseEntry > * searchKnowledgeBase (const Content &content, const QString &search, SortMode, int page, int pageSize)
 
PostJobsetAchievementProgress (const QString &id, const QVariant &progress, const QDateTime &timestamp)
 
void 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 application name and version).
 
PostJobsetDownloadFile (const QString &contentId, const QString &fileName, const QByteArray &payload)
 
PostJobsetDownloadFile (const QString &contentId, const QString &fileName, QIODevice *payload)
 
void setEnabled (bool enabled)
 
PostJobsetPreviewImage (const QString &contentId, const QString &previewId, const QString &fileName, const QByteArray &image)
 Upload an image file as preview for the content.
 
PostJobsetPrivateData (const QString &app, const QString &key, const QString &value)
 Sets the value of an attribute.
 
Attica::PostJobuploadTarballToBuildService (const QString &projectId, const QString &fileName, const QByteArray &payload)
 Upload a tarball to the buildservice.
 
PostJobvoteForComment (const QString &id, uint rating)
 Vote a comment item.
 
PostJobvoteForContent (const QString &contentId, uint rating)
 Vote for a content item.
 

Protected Member Functions

QNetworkRequest createRequest (const QString &path)
 
QNetworkRequest createRequest (const QUrl &url)
 
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.

Member Function Documentation

◆ achievementServiceVersion()

QString Attica::Provider::achievementServiceVersion ( ) const

Version of the achievement part of the API.

◆ activityServiceVersion()

QString Attica::Provider::activityServiceVersion ( ) const

Version of the activity part of the API.

◆ additionalAgentInformation()

QString Attica::Provider::additionalAgentInformation ( ) const

The custom identifier sent along with requests.

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

◆ addNewAchievement()

ItemPostJob< Achievement > * Attica::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

◆ addNewComment()

ItemPostJob< Comment > * Attica::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

◆ baseUrl()

QUrl Attica::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.

◆ cancelBuildServiceJob()

PostJob * Attica::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.

◆ checkLogin()

PostJob * Attica::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

◆ commentServiceVersion()

QString Attica::Provider::commentServiceVersion ( ) const

Version of the comments part of the API.

◆ contentServiceVersion()

QString Attica::Provider::contentServiceVersion ( ) const

Version of the content part of the API.

◆ createBuildServiceJob()

PostJob * Attica::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

◆ createProject()

PostJob * Attica::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

◆ createRemoteAccount()

PostJob * Attica::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

◆ deleteAchievement()

DeleteJob * Attica::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.

◆ deleteProject()

PostJob * Attica::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.

◆ deleteRemoteAccount()

PostJob * Attica::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.

◆ editAchievement()

PutJob * Attica::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

◆ editProject()

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

Post modifications to a Project on the server.

Parameters
projectProject to update on the server

◆ editRemoteAccount()

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

Edit an existing remote account.

Parameters
accountRemoteAccount to create on the server

◆ fanServiceVersion()

QString Attica::Provider::fanServiceVersion ( ) const

Version of the fan part of the API.

◆ forumServiceVersion()

QString Attica::Provider::forumServiceVersion ( ) const

Version of the forum part of the API.

◆ friendServiceVersion()

QString Attica::Provider::friendServiceVersion ( ) const

Version of the friend part of the API.

◆ hasAchievementService()

bool Attica::Provider::hasAchievementService ( ) const

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

◆ hasActivityService()

bool Attica::Provider::hasActivityService ( ) const

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

◆ hasCommentService()

bool Attica::Provider::hasCommentService ( ) const

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

◆ hasContentService()

bool Attica::Provider::hasContentService ( ) const

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

◆ hasCredentials()

bool Attica::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

◆ hasFanService()

bool Attica::Provider::hasFanService ( ) const

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

◆ hasForumService()

bool Attica::Provider::hasForumService ( ) const

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

◆ hasFriendService()

bool Attica::Provider::hasFriendService ( ) const

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

◆ hasKnowledgebaseService()

bool Attica::Provider::hasKnowledgebaseService ( ) const

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

◆ hasMessageService()

bool Attica::Provider::hasMessageService ( ) const

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

◆ hasPersonService()

bool Attica::Provider::hasPersonService ( ) const

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

◆ icon()

QUrl Attica::Provider::icon ( ) const

An icon used to visually identify this provider.

Returns
A URL for an icon image (or an invalid URL if one was not defined by the provider)
Since
5.85

◆ isEnabled()

bool Attica::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.

◆ isValid()

bool Attica::Provider::isValid ( ) const

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

◆ knowledgebaseServiceVersion()

QString Attica::Provider::knowledgebaseServiceVersion ( ) const

Version of the knowledgebase part of the API.

◆ loadCredentials()

bool Attica::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

◆ messageServiceVersion()

QString Attica::Provider::messageServiceVersion ( ) const

Version of the message part of the API.

◆ name()

QString Attica::Provider::name ( ) const

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

◆ personServiceVersion()

QString Attica::Provider::personServiceVersion ( ) const

Version of the person part of the API.

◆ publishBuildJob()

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

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

Returns
ItemJob receiving data

◆ requestAchievements()

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

Get a list of achievements.

Returns
ListJob listing Achievements

◆ requestBuildService()

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

Get the information for a specific build service instance.

Returns
ItemJob receiving data

◆ requestBuildServiceJob()

ItemJob< BuildServiceJob > * Attica::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

◆ requestBuildServiceJobOutput()

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

Get the build output for a specific build service job.

Returns
ItemJob receiving and containing the output data

◆ requestBuildServiceJobs()

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

Get a list of build service projects.

Returns
ListJob listing BuildServiceJobs

◆ requestBuildServices()

ListJob< BuildService > * Attica::Provider::requestBuildServices ( )

Get a list of build service build services.

Returns
ListJob listing BuildServices

◆ requestCategories()

ListJob< Category > * Attica::Provider::requestCategories ( )

Get a list of categories (such as wallpaper)

Returns
the categories of the server

◆ requestComments()

ListJob< Comment > * Attica::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

◆ requestConfig()

ItemJob< Config > * Attica::Provider::requestConfig ( )

Fetches server config.

Returns
The job responsible for fetching data

◆ requestContent()

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

Retrieve a single content.

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

◆ requestDistributions()

ListJob< Distribution > * Attica::Provider::requestDistributions ( )

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

Returns
the licenses available from the server

◆ requestHomePageTypes()

ListJob< HomePageType > * Attica::Provider::requestHomePageTypes ( )

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

Returns
the licenses available from the server

◆ requestLicenses()

ListJob< License > * Attica::Provider::requestLicenses ( )

Get a list of licenses (such as GPL)

Returns
the licenses available from the server

◆ requestPrivateData() [1/2]

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

Fetches all stored private data.

Returns
The job responsible for fetching data

◆ requestPrivateData() [2/2]

ItemJob< PrivateData > * Attica::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

◆ requestProject()

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

Get a Project's data.

Returns
ItemJob receiving data

◆ requestProjects()

ListJob< Project > * Attica::Provider::requestProjects ( )

Get a list of build service projects.

Returns
ListJob listing Projects

◆ requestPublisher()

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

Get the information for a specific publisher.

Returns
ItemJob receiving data

◆ requestPublishers()

ListJob< Publisher > * Attica::Provider::requestPublishers ( )

Get a list of publishers.

Returns
ListJob listing Publishers

◆ requestRemoteAccount()

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

Get a remote account by its ID.

Parameters
idThe ID of the remote account

◆ requestRemoteAccounts()

ListJob< RemoteAccount > * Attica::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

◆ saveCredentials()

bool Attica::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

◆ savePublisherField()

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

Save the value of a single publishing field.

Returns
PostJob*

◆ searchContents() [1/2]

ListJob< Content > * Attica::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

◆ searchContents() [2/2]

ListJob< Content > * Attica::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

◆ searchContentsByPerson()

ListJob< Content > * Attica::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.

◆ setAdditionalAgentInformation()

void Attica::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 application 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

◆ setPreviewImage()

PostJob * Attica::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

◆ setPrivateData()

PostJob * Attica::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

◆ uploadTarballToBuildService()

Attica::PostJob * Attica::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 to the complete file data
Returns
A postjob to keep keep track of the upload

◆ voteForComment()

PostJob * Attica::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

◆ voteForContent()

PostJob * Attica::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