Attica
provider.cpp
163 if (m_internals->hasCredentials(m_baseUrl) && m_internals->loadCredentials(m_baseUrl, user, pass)) {
404 return new PostJob(d->m_internals, createRequest(QLatin1String("person/check")), postParameters);
417 PostJob *Provider::registerAccount(const QString &id, const QString &password, const QString &mail, const QString &firstName, const QString &lastName)
482 ListJob<Person> *Provider::requestPersonSearchByLocation(qreal latitude, qreal longitude, qreal distance, int page, int pageSize)
547 ListJob<Achievement> *Provider::requestAchievements(const QString &contentId, const QString &achievementId, const QString &userId)
560 ItemPostJob<Achievement> *Provider::addNewAchievement(const QString &contentId, const Achievement &newAchievement)
577 postParameters.insert(QString::fromLatin1("dependencies[%1]").arg(QString::number(i++)), dependency);
580 postParameters.insert(QLatin1String("type"), Achievement::achievementTypeToString(newAchievement.type()));
587 postParameters.insert(QLatin1String("visibility"), Achievement::achievementVisibilityToString(newAchievement.visibility()));
589 return new ItemPostJob<Achievement>(d->m_internals, createRequest(QLatin1String("achievements/content/") + contentId), postParameters);
592 PutJob *Provider::editAchievement(const QString &contentId, const QString &achievementId, const Achievement &achievement)
613 postParameters.insert(QString::fromLatin1("dependencies[%1]").arg(QString::number(i++)), dependency);
616 postParameters.insert(QLatin1String("type"), Achievement::achievementTypeToString(achievement.type()));
623 postParameters.insert(QLatin1String("visibility"), Achievement::achievementVisibilityToString(achievement.visibility()));
625 return new ItemPutJob<Achievement>(d->m_internals, createRequest(QLatin1String("achievement/content/") + contentId + achievementId), postParameters);
638 return new ItemDeleteJob<Achievement>(d->m_internals, createRequest(QLatin1String("achievements/progress/") + contentId + achievementId));
641 PostJob *Provider::setAchievementProgress(const QString &id, const QVariant &progress, const QDateTime ×tamp)
652 return new ItemPostJob<Achievement>(d->m_internals, createRequest(QLatin1String("achievements/progress/") + id), postParameters);
665 return new ItemDeleteJob<Achievement>(d->m_internals, createRequest(QLatin1String("achievements/progress/") + id));
718 postParameters.insert(QLatin1String("developers"), project.developers().join(QLatin1Char('\n')));
729 // The specfile generator expects an empty string parameter if it is supposed to regenerate the spec file
743 return new PostJob(d->m_internals, createRequest(QLatin1String("buildservice/project/create")), projectPostParameters(project));
752 return new PostJob(d->m_internals, createRequest(QLatin1String("buildservice/project/edit/") + project.id()), projectPostParameters(project));
761 return new PostJob(d->m_internals, createRequest(QLatin1String("buildservice/project/delete/") + project.id()), projectPostParameters(project));
810 QString url = QLatin1String("buildservice/publishing/publishtargetresult/") + buildjob.id() + QLatin1Char('/') + publisher.id();
867 return new PostJob(d->m_internals, createRequest(QLatin1String("buildservice/jobs/cancel/") + job.id()), postParameters);
884 createRequest(QLatin1String("buildservice/jobs/create/") + job.projectId() + QLatin1Char('/') + job.buildServiceId() + QLatin1Char('/') + job.target()),
945 postParameters.insert(QLatin1String("typeid"), account.remoteServiceId()); // FIXME: remoteserviceid?
947 // qCDebug(ATTICA) << "Creating new Remoteaccount" << account.id() << account.login() << account.password();
948 return new PostJob(d->m_internals, createRequest(QLatin1String("buildservice/remoteaccounts/add")), postParameters);
964 postParameters.insert(QLatin1String("typeid"), account.remoteServiceId()); // FIXME: remoteserviceid?
966 // qCDebug(ATTICA) << "Creating new Remoteaccount" << account.id() << account.login() << account.password();
967 return new PostJob(d->m_internals, createRequest(QLatin1String("buildservice/remoteaccounts/edit/") + account.id()), postParameters);
988 return new PostJob(d->m_internals, createRequest(QLatin1String("buildservice/remoteaccounts/remove/") + id), postParameters);
991 PostJob *Provider::uploadTarballToBuildService(const QString &projectId, const QString &fileName, const QByteArray &payload)
1000 postRequest.addFile(fileName, payload, QLatin1String("application/octet-stream"), QLatin1String("source"));
1025 return new PostJob(d->m_internals, createRequest(QLatin1String("friend/invite/") + to), postParameters);
1055 PostJob *Provider::postLocation(qreal latitude, qreal longitude, const QString &city, const QString &country)
1066 return new PostJob(d->m_internals, createRequest(QLatin1String("person/self")), postParameters);
1106 return new ItemJob<Message>(d->m_internals, createRequest(QLatin1String("message/") + folder.id() + QLatin1Char('/') + id));
1176 ListJob<Content> *Provider::searchContents(const Category::List &categories, const QString &search, SortMode sortMode, uint page, uint pageSize)
1178 return searchContents(categories, QString(), Distribution::List(), License::List(), search, sortMode, page, pageSize);
1182 Provider::searchContentsByPerson(const Category::List &categories, const QString &person, const QString &search, SortMode sortMode, uint page, uint pageSize)
1184 return searchContents(categories, person, Distribution::List(), License::List(), search, sortMode, page, pageSize);
1282 ItemPostJob<Content> *Provider::editContent(const Category &updatedCategory, const QString &contentId, const Content &updatedContent)
1324 PostJob *Provider::setDownloadFile(const QString &contentId, const QString &fileName, const QByteArray &payload)
1350 PostJob *Provider::setPreviewImage(const QString &contentId, const QString &previewId, const QString &fileName, const QByteArray &image)
1356 QUrl url = createUrl(QLatin1String("content/uploadpreview/") + contentId + QLatin1Char('/') + previewId);
1373 QUrl url = createUrl(QLatin1String("content/deletepreview/") + contentId + QLatin1Char('/') + previewId);
1388 postParameters.insert(QLatin1String("vote"), positiveVote ? QLatin1String("good") : QLatin1String("bad"));
1390 return new PostJob(d->m_internals, createRequest(QLatin1String("content/vote/") + contentId), postParameters);
1409 return new PostJob(d->m_internals, createRequest(QLatin1String("content/vote/") + contentId), postParameters);
1456 Provider::requestTopics(const QString &forum, const QString &search, const QString &description, Provider::SortMode mode, int page, int pageSize)
1488 PostJob *Provider::postTopic(const QString &forumId, const QString &subject, const QString &content)
1498 return new PostJob(d->m_internals, createRequest(QLatin1String("forum/topic/add")), postParameters);
1507 QUrl url = createUrl(QLatin1String("content/download/") + contentId + QLatin1Char('/') + itemId);
1519 ItemJob<KnowledgeBaseEntry> *job = new ItemJob<KnowledgeBaseEntry>(d->m_internals, createRequest(url));
1523 ListJob<KnowledgeBaseEntry> *Provider::searchKnowledgeBase(const Content &content, const QString &search, Provider::SortMode sortMode, int page, int pageSize)
1560 ListJob<KnowledgeBaseEntry> *job = new ListJob<KnowledgeBaseEntry>(d->m_internals, createRequest(url));
1570 ItemJob<Event> *job = new ItemJob<Event>(d->m_internals, createRequest(QLatin1String("event/data/") + id));
1574 ListJob<Event> *Provider::requestEvent(const QString &country, const QString &search, const QDate &startAt, Provider::SortMode mode, int page, int pageSize)
1616 ListJob<Comment> *Provider::requestComments(const Comment::Type commentType, const QString &id, const QString &id2, int page, int pageSize)
1628 QUrl url = createUrl(QLatin1String("comments/data/") + commentTypeString + QLatin1Char('/') + id + QLatin1Char('/') + id2);
1665 return new ItemPostJob<Comment>(d->m_internals, createRequest(QLatin1String("comments/add")), postParameters);
1681 PostJob *Provider::setPrivateData(const QString &app, const QString &key, const QString &value)
1687 QUrl url = createUrl(QLatin1String("privatedata/setattribute/") + app + QLatin1Char('/') + key);
1702 new ItemJob<PrivateData>(d->m_internals, createRequest(QLatin1String("privatedata/getattribute/") + app + QLatin1Char('/') + key));
1715 request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/x-www-form-urlencoded"));
1719 agentHeader = QString::fromLocal8Bit("%1/%2").arg(QCoreApplication::instance()->applicationName(), QCoreApplication::instance()->applicationVersion());
1721 agentHeader = QString::fromLocal8Bit("Attica/%1").arg(QLatin1String(LIBATTICA_VERSION_STRING));
1724 agentHeader = QString::fromLocal8Bit("%1 (+%2)").arg(agentHeader, d->m_additionalAgentInformation);
1729 request.setAttribute((QNetworkRequest::Attribute)BaseJob::UserAttribute, QVariant(d->m_credentialsUserName));
1730 request.setAttribute((QNetworkRequest::Attribute)BaseJob::PasswordAttribute, QVariant(d->m_credentialsPassword));
bool hasAchievementService() const
Test if the server supports the achievement part of the API.
Definition: provider.cpp:1832
void append(const T &value)
bool hasContentService() const
Test if the server supports the content part of the API.
Definition: provider.cpp:1845
bool isNull() const const
PostJob * createBuildServiceJob(const BuildServiceJob &job)
Create a new job for a given project on a given buildservice for a given target.
Definition: provider.cpp:870
ItemJob< BuildService > * requestBuildService(const QString &id)
Get the information for a specific build service instance.
Definition: provider.cpp:764
Attribute
bool hasActivityService() const
Test if the server supports the activity part of the API.
Definition: provider.cpp:1837
QString number(int n, int base)
bool hasPersonService() const
Test if the server supports the person part of the API.
Definition: provider.cpp:1869
PostJob * setPreviewImage(const QString &contentId, const QString &previewId, const QString &fileName, const QByteArray &image)
Upload an image file as preview for the content.
Definition: provider.cpp:1350
Definition: putjob.h:29
PutJob * editAchievement(const QString &contentId, const QString &achievementId, const Achievement &achievement)
Post modifications to an Achievement on the server.
Definition: provider.cpp:592
int count(const T &value) const const
void addQueryItem(const QString &key, const QString &value)
PostJob * createProject(const Project &project)
Post modifications to a Project on the server.
Definition: provider.cpp:737
KI18NLOCALEDATA_EXPORT KCountry country(const char *ianaId)
Definition: distribution.h:26
QString activityServiceVersion() const
Version of the activity part of the API.
Definition: provider.cpp:1795
ListJob< Distribution > * requestDistributions()
Get a list of distributions (such as Ark, Debian)
Definition: provider.cpp:1154
Definition: itemjob.h:47
ItemJob< Publisher > * requestPublisher(const QString &id)
Get the information for a specific publisher.
Definition: provider.cpp:774
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Definition: publisherfield.h:23
Definition: content.h:32
ItemJob< BuildServiceJobOutput > * requestBuildServiceJobOutput(const QString &id)
Get the build output for a specific build service job.
Definition: provider.cpp:816
QString personServiceVersion() const
Version of the person part of the API.
Definition: provider.cpp:1827
PostJob * createRemoteAccount(const RemoteAccount &account)
Create a new remote account, an account for a build service instance which is stored in the OCS servi...
Definition: provider.cpp:932
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.
Definition: provider.cpp:1182
void reserve(int alloc)
PostJob * savePublisherField(const Project &project, const PublisherField &field)
Save the value of a single publishing field.
Definition: provider.cpp:785
Definition: itemjob.h:29
QMap::iterator insert(const Key &key, const T &value)
ItemPostJob< Achievement > * addNewAchievement(const QString &id, const Achievement &newAchievement)
Add a new achievement.
Definition: provider.cpp:560
Definition: itemjob.h:65
Definition: postjob.h:29
QString additionalAgentInformation() const
The custom identifier sent along with requests.
Definition: provider.cpp:335
QString name() const
A name for the provider that can be displayed to the user.
Definition: provider.cpp:340
ItemJob< Project > * requestProject(const QString &id)
Get a Project's data.
Definition: provider.cpp:690
QString fromLocal8Bit(const char *str, int size)
ListJob< RemoteAccount > * requestRemoteAccounts()
Get a list of remote accounts, account for a build service instance which is stored in the OCS servic...
Definition: provider.cpp:921
bool hasCredentials() const
Test if the provider has user name/password available.
Definition: provider.cpp:350
bool isEmpty() const const
ItemJob< PrivateData > * requestPrivateData()
Fetches all stored private data.
Definition: provider.h:326
QString contentServiceVersion() const
Version of the content part of the API.
Definition: provider.cpp:1803
ListJob< License > * requestLicenses()
Get a list of licenses (such as GPL)
Definition: provider.cpp:1143
Definition: message.h:26
bool hasForumService() const
Test if the server supports the forum part of the API.
Definition: provider.cpp:1853
PostJob * editProject(const Project &project)
Post modifications to a Project on the server.
Definition: provider.cpp:746
ListJob< HomePageType > * requestHomePageTypes()
Get a list of home page types (such as blog, Facebook)
Definition: provider.cpp:1165
Definition: provider.h:96
Definition: deletejob.h:25
bool isEmpty() const const
bool hasKnowledgebaseService() const
Test if the server supports the knowledgebase part of the API.
Definition: provider.cpp:1861
Definition: category.h:23
ListJob< Achievement > * requestAchievements(const QString &contentId, const QString &achievementId, const QString &userId)
Get a list of achievements.
Definition: provider.cpp:547
QCoreApplication * instance()
PostJob * checkLogin(const QString &user, const QString &password)
Test if the server accepts the login/password.
Definition: provider.cpp:393
Q_SCRIPTABLE CaptureState status()
Definition: folder.h:24
Definition: achievement.h:27
bool isEmpty() const const
QString toLocalFile() const const
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
DeleteJob * deleteAchievement(const QString &contentId, const QString &achievementId)
Deletes an achievement on the server.
Definition: provider.cpp:628
bool hasFanService() const
Test if the server supports the fan part of the API.
Definition: provider.cpp:1849
ListJob< BuildServiceJob > * requestBuildServiceJobs(const Project &project)
Get a list of build service projects.
Definition: provider.cpp:910
QString achievementServiceVersion() const
Version of the achievement part of the API.
Definition: provider.cpp:1790
QString join(const QString &separator) const const
Definition: buildservicejob.h:28
Definition: remoteaccount.h:29
QString friendServiceVersion() const
Version of the friend part of the API.
Definition: provider.cpp:1815
Definition: publisher.h:43
bool hasFriendService() const
Test if the server supports the friend part of the API.
Definition: provider.cpp:1857
bool loadCredentials(QString &user, QString &password)
Load user name and password from the store.
Definition: provider.cpp:368
bool hasMessageService() const
Test if the server supports the message part of the API.
Definition: provider.cpp:1865
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.
Definition: provider.cpp:1176
void setQuery(const QString &query, QUrl::ParsingMode mode)
Definition: itemjob.h:85
QString forumServiceVersion() const
Version of the forum part of the API.
Definition: provider.cpp:1811
QString messageServiceVersion() const
Version of the message part of the API.
Definition: provider.cpp:1823
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.
Definition: provider.cpp:1639
PostJob * publishBuildJob(const BuildServiceJob &buildjob, const Publisher &publisher)
Publish the result of a completed build job to a publisher.
Definition: provider.cpp:801
ListJob< Project > * requestProjects()
Get a list of build service projects.
Definition: provider.cpp:679
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
Definition: listjob.h:27
ContentTypeHeader
QString fromLatin1(const char *str, int size)
Definition: project.h:29
ItemJob< Content > * requestContent(const QString &contentId)
Retrieve a single content.
Definition: provider.cpp:1254
PostJob * deleteRemoteAccount(const QString &id)
Deletes a remote account stored on the OCS server.
Definition: provider.cpp:981
const char * name(StandardAction id)
bool hasCommentService() const
Test if the server supports the comments part of the API.
Definition: provider.cpp:1841
bool saveCredentials(const QString &user, const QString &password)
Sets (and remembers) user name and password for this provider.
Definition: provider.cpp:382
QString toString(Qt::DateFormat format) const const
PostJob * voteForComment(const QString &id, uint rating)
Vote a comment item.
Definition: provider.cpp:1668
PostJob * cancelBuildServiceJob(const BuildServiceJob &job)
Cancel a job.
Definition: provider.cpp:858
bool isValid() const
Returns true if the provider has been set up and can be used.
Definition: provider.cpp:307
PostJob * deleteProject(const Project &project)
Deletes a project on the server.
Definition: provider.cpp:755
PostJob * editRemoteAccount(const RemoteAccount &account)
Edit an existing remote account.
Definition: provider.cpp:951
Attica::PostJob * uploadTarballToBuildService(const QString &projectId, const QString &fileName, const QByteArray &payload)
Upload a tarball to the buildservice.
Definition: provider.cpp:991
QString knowledgebaseServiceVersion() const
Version of the knowledgebase part of the API.
Definition: provider.cpp:1819
QMap< QString, QString > attributes() const
Get all attributes that are not included in the basis set of attributes exposed by the Content class.
Definition: content.cpp:139
ListJob< BuildService > * requestBuildServices()
Get a list of build service build services.
Definition: provider.cpp:888
QString toString(Qt::DateFormat format) const const
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.
Definition: provider.cpp:1616
T & localData()
Definition: license.h:23
ListJob< Category > * requestCategories()
Get a list of categories (such as wallpaper)
Definition: provider.cpp:1122
QString message
ItemJob< BuildServiceJob > * requestBuildServiceJob(const QString &id)
Get the information for a specific build service job, such as status and progress.
Definition: provider.cpp:827
QString commentServiceVersion() const
Version of the comments part of the API.
Definition: provider.cpp:1799
ISODate
PostJob * voteForContent(const QString &contentId, bool positiveVote)
Vote for a content item This version is for the old OCS API < 1.6.
Definition: provider.cpp:1381
void setAdditionalAgentInformation(const QString &additionalInformation)
Set a custom identifier for your application (sent along with the requests as the http agent header i...
Definition: provider.cpp:330
PostJob * setPrivateData(const QString &app, const QString &key, const QString &value)
Sets the value of an attribute.
Definition: provider.cpp:1681
QString toString() const const
ItemJob< RemoteAccount > * requestRemoteAccount(const QString &id)
Get a remote account by its ID.
Definition: provider.cpp:970
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Dec 11 2023 04:05:13 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Dec 11 2023 04:05:13 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.