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);
417PostJob *Provider::registerAccount(const QString &id, const QString &password, const QString &mail, const QString &firstName, const QString &lastName)
482ListJob<Person> *Provider::requestPersonSearchByLocation(qreal latitude, qreal longitude, qreal distance, int page, int pageSize)
547ListJob<Achievement> *Provider::requestAchievements(const QString &contentId, const QString &achievementId, const QString &userId)
560ItemPostJob<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);
592PutJob *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));
641PostJob *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);
991PostJob *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);
1055PostJob *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));
1176ListJob<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);
1182Provider::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);
1282ItemPostJob<Content> *Provider::editContent(const Category &updatedCategory, const QString &contentId, const Content &updatedContent)
1324PostJob *Provider::setDownloadFile(const QString &contentId, const QString &fileName, const QByteArray &payload)
1350PostJob *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);
1395 return new PostJob(d->m_internals, createRequest(QLatin1String("content/vote/") + contentId), postParameters);
1442Provider::requestTopics(const QString &forum, const QString &search, const QString &description, Provider::SortMode mode, int page, int pageSize)
1474PostJob *Provider::postTopic(const QString &forumId, const QString &subject, const QString &content)
1484 return new PostJob(d->m_internals, createRequest(QLatin1String("forum/topic/add")), postParameters);
1493 QUrl url = createUrl(QLatin1String("content/download/") + contentId + QLatin1Char('/') + itemId);
1505 ItemJob<KnowledgeBaseEntry> *job = new ItemJob<KnowledgeBaseEntry>(d->m_internals, createRequest(url));
1509ListJob<KnowledgeBaseEntry> *Provider::searchKnowledgeBase(const Content &content, const QString &search, Provider::SortMode sortMode, int page, int pageSize)
1546 ListJob<KnowledgeBaseEntry> *job = new ListJob<KnowledgeBaseEntry>(d->m_internals, createRequest(url));
1556 ItemJob<Event> *job = new ItemJob<Event>(d->m_internals, createRequest(QLatin1String("event/data/") + id));
1560ListJob<Event> *Provider::requestEvent(const QString &country, const QString &search, const QDate &startAt, Provider::SortMode mode, int page, int pageSize)
1602ListJob<Comment> *Provider::requestComments(const Comment::Type commentType, const QString &id, const QString &id2, int page, int pageSize)
1614 QUrl url = createUrl(QLatin1String("comments/data/") + commentTypeString + QLatin1Char('/') + id + QLatin1Char('/') + id2);
1651 return new ItemPostJob<Comment>(d->m_internals, createRequest(QLatin1String("comments/add")), postParameters);
1673 QUrl url = createUrl(QLatin1String("privatedata/setattribute/") + app + QLatin1Char('/') + key);
1688 new ItemJob<PrivateData>(d->m_internals, createRequest(QLatin1String("privatedata/getattribute/") + app + QLatin1Char('/') + key));
1701 request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/x-www-form-urlencoded"));
1705 agentHeader = QString::fromLocal8Bit("%1/%2").arg(QCoreApplication::instance()->applicationName(), QCoreApplication::instance()->applicationVersion());
1707 agentHeader = QString::fromLocal8Bit("Attica/%1").arg(QLatin1String(LIBATTICA_VERSION_STRING));
1710 agentHeader = QString::fromLocal8Bit("%1 (+%2)").arg(agentHeader, d->m_additionalAgentInformation);
1715 request.setAttribute((QNetworkRequest::Attribute)BaseJob::UserAttribute, QVariant(d->m_credentialsUserName));
1716 request.setAttribute((QNetworkRequest::Attribute)BaseJob::PasswordAttribute, QVariant(d->m_credentialsPassword));
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:140
The Distribution class contains information about one distribution that the server offers.
Definition distribution.h:27
The License class contains information about one license that the server offers.
Definition license.h:24
The Provider class represents one Open Collaboration Service provider.
Definition provider.h:97
bool hasActivityService() const
Test if the server supports the activity part of the API.
Definition provider.cpp:1823
ListJob< Distribution > * requestDistributions()
Get a list of distributions (such as Ark, Debian)
Definition provider.cpp:1154
QString name() const
A name for the provider that can be displayed to the user.
Definition provider.cpp:340
PostJob * publishBuildJob(const BuildServiceJob &buildjob, const Publisher &publisher)
Publish the result of a completed build job to a publisher.
Definition provider.cpp:801
QString messageServiceVersion() const
Version of the message part of the API.
Definition provider.cpp:1809
QString contentServiceVersion() const
Version of the content part of the API.
Definition provider.cpp:1789
QString personServiceVersion() const
Version of the person part of the API.
Definition provider.cpp:1813
ListJob< Achievement > * requestAchievements(const QString &contentId, const QString &achievementId, const QString &userId)
Get a list of achievements.
Definition provider.cpp:547
PostJob * deleteRemoteAccount(const QString &id)
Deletes a remote account stored on the OCS server.
Definition provider.cpp:981
bool hasCredentials() const
Test if the provider has user name/password available.
Definition provider.cpp:359
ListJob< Category > * requestCategories()
Get a list of categories (such as wallpaper)
Definition provider.cpp:1122
QString additionalAgentInformation() const
The custom identifier sent along with requests.
Definition provider.cpp:335
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
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
ItemJob< BuildServiceJob > * requestBuildServiceJob(const QString &id)
Get the information for a specific build service job, such as status and progress.
Definition provider.cpp:827
PostJob * savePublisherField(const Project &project, const PublisherField &field)
Save the value of a single publishing field.
Definition provider.cpp:785
PostJob * voteForComment(const QString &id, uint rating)
Vote a comment item.
Definition provider.cpp:1654
PutJob * editAchievement(const QString &contentId, const QString &achievementId, const Achievement &achievement)
Post modifications to an Achievement on the server.
Definition provider.cpp:592
PostJob * deleteProject(const Project &project)
Deletes a project on the server.
Definition provider.cpp:755
bool hasForumService() const
Test if the server supports the forum part of the API.
Definition provider.cpp:1839
bool hasMessageService() const
Test if the server supports the message part of the API.
Definition provider.cpp:1851
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 saveCredentials(const QString &user, const QString &password)
Sets (and remembers) user name and password for this provider.
Definition provider.cpp:382
bool hasFriendService() const
Test if the server supports the friend part of the API.
Definition provider.cpp:1843
ItemPostJob< Achievement > * addNewAchievement(const QString &id, const Achievement &newAchievement)
Add a new achievement.
Definition provider.cpp:560
PostJob * createProject(const Project &project)
Post modifications to a Project on the server.
Definition provider.cpp:737
ListJob< BuildService > * requestBuildServices()
Get a list of build service build services.
Definition provider.cpp:888
bool hasAchievementService() const
Test if the server supports the achievement part of the API.
Definition provider.cpp:1818
PostJob * editRemoteAccount(const RemoteAccount &account)
Edit an existing remote account.
Definition provider.cpp:951
ItemJob< Project > * requestProject(const QString &id)
Get a Project's data.
Definition provider.cpp:690
bool loadCredentials(QString &user, QString &password)
Load user name and password from the store.
Definition provider.cpp:368
ItemJob< RemoteAccount > * requestRemoteAccount(const QString &id)
Get a remote account by its ID.
Definition provider.cpp:970
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:1625
ItemJob< BuildService > * requestBuildService(const QString &id)
Get the information for a specific build service instance.
Definition provider.cpp:764
QString achievementServiceVersion() const
Version of the achievement part of the API.
Definition provider.cpp:1776
ListJob< License > * requestLicenses()
Get a list of licenses (such as GPL)
Definition provider.cpp:1143
ListJob< HomePageType > * requestHomePageTypes()
Get a list of home page types (such as blog, Facebook)
Definition provider.cpp:1165
DeleteJob * deleteAchievement(const QString &contentId, const QString &achievementId)
Deletes an achievement on the server.
Definition provider.cpp:628
ItemJob< Publisher > * requestPublisher(const QString &id)
Get the information for a specific publisher.
Definition provider.cpp:774
QString knowledgebaseServiceVersion() const
Version of the knowledgebase part of the API.
Definition provider.cpp:1805
bool hasCommentService() const
Test if the server supports the comments part of the API.
Definition provider.cpp:1827
ItemJob< Content > * requestContent(const QString &contentId)
Retrieve a single content.
Definition provider.cpp:1254
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
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
QString forumServiceVersion() const
Version of the forum part of the API.
Definition provider.cpp:1797
PostJob * checkLogin(const QString &user, const QString &password)
Test if the server accepts the login/password.
Definition provider.cpp:393
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
bool hasContentService() const
Test if the server supports the content part of the API.
Definition provider.cpp:1831
ListJob< Project > * requestProjects()
Get a list of build service projects.
Definition provider.cpp:679
bool isValid() const
Returns true if the provider has been set up and can be used.
Definition provider.cpp:307
bool hasPersonService() const
Test if the server supports the person part of the API.
Definition provider.cpp:1855
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
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:1602
Attica::PostJob * uploadTarballToBuildService(const QString &projectId, const QString &fileName, const QByteArray &payload)
Upload a tarball to the buildservice.
Definition provider.cpp:991
ItemJob< PrivateData > * requestPrivateData()
Fetches all stored private data.
Definition provider.h:329
PostJob * editProject(const Project &project)
Post modifications to a Project on the server.
Definition provider.cpp:746
QString friendServiceVersion() const
Version of the friend part of the API.
Definition provider.cpp:1801
ItemJob< BuildServiceJobOutput > * requestBuildServiceJobOutput(const QString &id)
Get the build output for a specific build service job.
Definition provider.cpp:816
PostJob * setPrivateData(const QString &app, const QString &key, const QString &value)
Sets the value of an attribute.
Definition provider.cpp:1667
QString commentServiceVersion() const
Version of the comments part of the API.
Definition provider.cpp:1785
bool hasKnowledgebaseService() const
Test if the server supports the knowledgebase part of the API.
Definition provider.cpp:1847
PostJob * voteForContent(const QString &contentId, uint rating)
Vote for a content item.
Definition provider.cpp:1380
ListJob< BuildServiceJob > * requestBuildServiceJobs(const Project &project)
Get a list of build service projects.
Definition provider.cpp:910
bool hasFanService() const
Test if the server supports the fan part of the API.
Definition provider.cpp:1835
QString activityServiceVersion() const
Version of the activity part of the API.
Definition provider.cpp:1781
Q_SCRIPTABLE CaptureState status()
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
QString name(StandardAction id)
KI18NLOCALEDATA_EXPORT KCountry country(const char *ianaId)
QCoreApplication * instance()
QString toString(QStringView format, QCalendar cal) const const
QString toString(QStringView format, QCalendar cal) const const
void append(QList< T > &&value)
qsizetype count() const const
bool isEmpty() const const
void reserve(qsizetype size)
iterator insert(const Key &key, const T &value)
Attribute
ContentTypeHeader
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QString arg(Args &&... args) const const
QString fromLatin1(QByteArrayView str)
QString fromLocal8Bit(QByteArrayView str)
bool isEmpty() const const
bool isNull() const const
QString number(double n, char format, int precision)
QString join(QChar separator) const const
ISODate
T & localData()
bool isEmpty() const const
void setQuery(const QString &query, ParsingMode mode)
QString toLocalFile() const const
void addQueryItem(const QString &key, const QString &value)
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.