|
QtRedmine
|
Redmine connection class. More...
#include <RedmineClient.h>
Public Types | |
| using | JsonCb = std::function< void(QNetworkReply *, QJsonDocument *)> |
| Typedef for a JSON callback function. | |
Signals | |
| void | initialised () |
| Signal that the connection has been initialised. | |
| void | networkAccessibleChanged (QNetworkAccessManager::NetworkAccessibility accessible) |
| Signal that the network accessibility has changed. More... | |
| void | requestFinished (JsonCb callback, QNetworkReply *reply, QJsonDocument *json) |
| Signal that the request has finished. More... | |
Public Member Functions | |
| RedmineClient (QObject *parent=nullptr) | |
| Constructor for an unconfigured Redmine connection. More... | |
| RedmineClient (QString url, QObject *parent=nullptr) | |
| Constructor for an unconfigured Redmine connection. More... | |
| RedmineClient (QString url, QString apiKey, bool checkSsl=true, QObject *parent=nullptr) | |
| Constructor for a Redmine connection using API key authentication. More... | |
| RedmineClient (QString url, QString login, QString password, bool checkSsl=true, QObject *parent=nullptr) | |
| Constructor for a Redmine connection using basic authentication. More... | |
| void | reconnect () |
| (Re-)Connect to Redmine | |
Getters | |
| QString | getUrl () const |
| Get the Redmine base URL. More... | |
Setters | |
| void | setUrl (QString url) |
| Set the Redmine base URL. More... | |
| void | setAuthenticator (QString apiKey) |
| Set the Redmine authentification parameters. More... | |
| void | setAuthenticator (QString login, QString password) |
| Set the Redmine authentification parameters. More... | |
| void | setUserAgent (QByteArray userAgent) |
| Set the user agent for the Redmine connection. More... | |
| void | setCheckSsl (bool checkSsl) |
| Set the SSL check data (e.g. certificate validity) More... | |
Redmine data creators | |
| void | sendCustomField (const QJsonDocument &data, JsonCb callback=nullptr, int id=-1, QString parameters="") |
| Create or update custom field in Redmine. More... | |
| void | sendIssue (const QJsonDocument &data, JsonCb callback=nullptr, int id=-1, QString parameters="") |
| Create or update issue in Redmine. More... | |
| void | sendIssueCategory (const QJsonDocument &data, JsonCb callback=nullptr, int id=-1, QString parameters="") |
| Create or update issue category in Redmine. More... | |
| void | sendIssuePriority (const QJsonDocument &data, JsonCb callback=nullptr, int id=-1, QString parameters="") |
| Create or update issue priority in Redmine. More... | |
| void | sendIssueStatus (const QJsonDocument &data, JsonCb callback=nullptr, int id=-1, QString parameters="") |
| Create or update issue status in Redmine. More... | |
| void | sendProject (const QJsonDocument &data, JsonCb callback=nullptr, int id=-1, QString parameters="") |
| Create or update project in Redmine. More... | |
| void | sendTimeEntry (const QJsonDocument &data, JsonCb callback=nullptr, int id=-1, QString parameters="") |
| Create or update time entry in Redmine. More... | |
| void | sendTimeEntryActivity (const QJsonDocument &data, JsonCb callback=nullptr, int id=-1, QString parameters="") |
| Create or update time entry activity in Redmine. More... | |
| void | sendTracker (const QJsonDocument &data, JsonCb callback=nullptr, int id=-1, QString parameters="") |
| Create or update tracker in Redmine. More... | |
| void | sendUser (const QJsonDocument &data, JsonCb callback=nullptr, int id=-1, QString parameters="") |
| Create or update user in Redmine. More... | |
| void | sendVersion (const QJsonDocument &data, JsonCb callback=nullptr, int id=-1, QString parameters="") |
| Create or update version in Redmine. More... | |
Redmine data retrievers | |
| void | retrieveCustomFields (JsonCb callback, QString parameters="") |
| Retrieve custom fields from Redmine. More... | |
| void | retrieveIssue (JsonCb callback, int issueId, QString parameters="") |
| Retrieve an issue from Redmine. More... | |
| void | retrieveIssueCategories (JsonCb callback, QString parameters="") |
| Retrieve issue categories from Redmine. More... | |
| void | retrieveIssuePriorities (JsonCb callback, QString parameters="") |
| Retrieve issue priorities from Redmine. More... | |
| void | retrieveIssues (JsonCb callback, QString parameters="") |
| Retrieve issues from Redmine. More... | |
| void | retrieveIssueStatuses (JsonCb callback, QString parameters="") |
| Retrieve issue statuses from Redmine. More... | |
| void | retrieveProjects (JsonCb callback, QString parameters="") |
| Retrieve projects from Redmine. More... | |
| void | retrieveTimeEntries (JsonCb callback, QString parameters="") |
| Retrieve time entries from Redmine. More... | |
| void | retrieveTimeEntryActivities (JsonCb callback, QString parameters="") |
| Retrieve time entry activities from Redmine. More... | |
| void | retrieveTrackers (JsonCb callback, QString parameters="") |
| Retrieve trackers from Redmine. More... | |
| void | retrieveCurrentUser (JsonCb callback, QString parameters="") |
| Retrieve current user from Redmine. More... | |
| void | retrieveUsers (JsonCb callback, QString parameters="") |
| Retrieve users from Redmine. More... | |
| void | retrieveVersions (JsonCb callback, QString parameters="") |
| Retrieve versions from Redmine. More... | |
Protected Member Functions | |
| void | retrieveEnumerations (QString enumeration, JsonCb callback, QString parameters="") |
| Retrieve enumerations from Redmine. More... | |
| void | sendEnumeration (QString enumeration, const QJsonDocument &data, JsonCb callback=nullptr, int id=-1, QString parameters="") |
| Create or update enumeration in Redmine. More... | |
| QNetworkReply * | sendRequest (QString resource, JsonCb callback=nullptr, QNetworkAccessManager::Operation mode=QNetworkAccessManager::GetOperation, const QString &queryParams="", const QByteArray &postData="") |
| Send a request to Redmine. More... | |
Redmine connection class.
This class handles the connections to a Redmine instance and provides access to the Redmine REST API.
| qtredmine::RedmineClient::RedmineClient | ( | QObject * | parent = nullptr | ) |
Constructor for an unconfigured Redmine connection.
| parent | Parent QObject (default: nullptr) |
| qtredmine::RedmineClient::RedmineClient | ( | QString | url, |
| QObject * | parent = nullptr |
||
| ) |
Constructor for an unconfigured Redmine connection.
| url | Redmine base URL |
| parent | Parent QObject (default: nullptr) |
| qtredmine::RedmineClient::RedmineClient | ( | QString | url, |
| QString | apiKey, | ||
| bool | checkSsl = true, |
||
| QObject * | parent = nullptr |
||
| ) |
Constructor for a Redmine connection using API key authentication.
| url | Redmine base URL |
| apiKey | Redmine API key |
| checkSsl | Check the SSL certificate (default: true) |
| parent | Parent QObject (default: nullptr) |
| qtredmine::RedmineClient::RedmineClient | ( | QString | url, |
| QString | login, | ||
| QString | password, | ||
| bool | checkSsl = true, |
||
| QObject * | parent = nullptr |
||
| ) |
Constructor for a Redmine connection using basic authentication.
| url | Redmine base URL |
| login | Redmine login |
| password | Redmine password |
| checkSsl | Check the SSL certificate (default: true) |
| parent | Parent QObject (default: nullptr) |
| QString qtredmine::RedmineClient::getUrl | ( | ) | const |
Get the Redmine base URL.
|
signal |
Signal that the network accessibility has changed.
| accessible | Network accessibility |
|
signal |
Signal that the request has finished.
| callback | Callback function that will be called |
| reply | Reply that will be passed to the callback function |
| json | JSON data that will be passed to the callback function |
| void qtredmine::RedmineClient::retrieveCurrentUser | ( | JsonCb | callback, |
| QString | parameters = "" |
||
| ) |
Retrieve current user from Redmine.
| callback | Callback function with a QJsonDocument object |
| parameters | Additional user parameters |
| void qtredmine::RedmineClient::retrieveCustomFields | ( | JsonCb | callback, |
| QString | parameters = "" |
||
| ) |
Retrieve custom fields from Redmine.
| callback | Callback function with a QJsonDocument object |
| parameters | Additional custom field parameters |
|
protected |
Retrieve enumerations from Redmine.
| enumeration | The enumeration to load |
| callback | Callback function with a QJsonDocument object |
| parameters | Additional enumeration parameters |
| void qtredmine::RedmineClient::retrieveIssue | ( | JsonCb | callback, |
| int | issueId, | ||
| QString | parameters = "" |
||
| ) |
Retrieve an issue from Redmine.
| callback | Callback function with a QJsonDocument object |
| issueId | Issue ID |
| parameters | Additional issue parameters |
| void qtredmine::RedmineClient::retrieveIssueCategories | ( | JsonCb | callback, |
| QString | parameters = "" |
||
| ) |
Retrieve issue categories from Redmine.
| callback | Callback function with a QJsonDocument object |
| parameters | Additional issue category parameters |
| void qtredmine::RedmineClient::retrieveIssuePriorities | ( | JsonCb | callback, |
| QString | parameters = "" |
||
| ) |
Retrieve issue priorities from Redmine.
| callback | Callback function with a QJsonDocument object |
| parameters | Additional enumeration parameters |
| void qtredmine::RedmineClient::retrieveIssues | ( | JsonCb | callback, |
| QString | parameters = "" |
||
| ) |
Retrieve issues from Redmine.
| callback | Callback function with a QJsonDocument object |
| parameters | Additional issue parameters |
| void qtredmine::RedmineClient::retrieveIssueStatuses | ( | JsonCb | callback, |
| QString | parameters = "" |
||
| ) |
Retrieve issue statuses from Redmine.
| callback | Callback function with a QJsonDocument object |
| parameters | Additional issue status parameters |
| void qtredmine::RedmineClient::retrieveProjects | ( | JsonCb | callback, |
| QString | parameters = "" |
||
| ) |
Retrieve projects from Redmine.
| callback | Callback function with a QJsonDocument object |
| parameters | Additional project parameters |
| void qtredmine::RedmineClient::retrieveTimeEntries | ( | JsonCb | callback, |
| QString | parameters = "" |
||
| ) |
Retrieve time entries from Redmine.
| callback | Callback function with a QJsonDocument object |
| parameters | Additional time entry parameters |
| void qtredmine::RedmineClient::retrieveTimeEntryActivities | ( | JsonCb | callback, |
| QString | parameters = "" |
||
| ) |
Retrieve time entry activities from Redmine.
| callback | Callback function with a QJsonDocument object |
| parameters | Additional enumeration parameters |
| void qtredmine::RedmineClient::retrieveTrackers | ( | JsonCb | callback, |
| QString | parameters = "" |
||
| ) |
Retrieve trackers from Redmine.
| callback | Callback function with a QJsonDocument object |
| parameters | Additional tracker parameters |
| void qtredmine::RedmineClient::retrieveUsers | ( | JsonCb | callback, |
| QString | parameters = "" |
||
| ) |
Retrieve users from Redmine.
| callback | Callback function with a QJsonDocument object |
| parameters | Additional user parameters |
| void qtredmine::RedmineClient::retrieveVersions | ( | JsonCb | callback, |
| QString | parameters = "" |
||
| ) |
Retrieve versions from Redmine.
| callback | Callback function with a QJsonDocument object |
| parameters | Additional version parameters |
| void qtredmine::RedmineClient::sendCustomField | ( | const QJsonDocument & | data, |
| JsonCb | callback = nullptr, |
||
| int | id = -1, |
||
| QString | parameters = "" |
||
| ) |
Create or update custom field in Redmine.
| data | Data to store in Redmine |
| callback | Callback function with a QJsonDocument object |
| id | Custom field ID to update; if set to NULL_ID, create a new custom field |
| parameters | Additional custom field parameters |
|
protected |
Create or update enumeration in Redmine.
| enumeration | The enumeration to create |
| data | Data to store in Redmine |
| callback | Callback function with a QJsonDocument object |
| id | Enumeration to update; if set to NULL_ID, create a enumeration |
| parameters | Additional enumeration parameters |
| void qtredmine::RedmineClient::sendIssue | ( | const QJsonDocument & | data, |
| JsonCb | callback = nullptr, |
||
| int | id = -1, |
||
| QString | parameters = "" |
||
| ) |
Create or update issue in Redmine.
| data | Data to store in Redmine |
| callback | Callback function with a QJsonDocument object |
| id | Issue ID to update; if set to NULL_ID, create a new issue |
| parameters | Additional issue parameters |
| void qtredmine::RedmineClient::sendIssueCategory | ( | const QJsonDocument & | data, |
| JsonCb | callback = nullptr, |
||
| int | id = -1, |
||
| QString | parameters = "" |
||
| ) |
Create or update issue category in Redmine.
| data | Data to store in Redmine |
| callback | Callback function with a QJsonDocument object |
| id | Issue category ID to update; if set to NULL_ID, create a new issue category |
| parameters | Additional issue category parameters |
| void qtredmine::RedmineClient::sendIssuePriority | ( | const QJsonDocument & | data, |
| JsonCb | callback = nullptr, |
||
| int | id = -1, |
||
| QString | parameters = "" |
||
| ) |
Create or update issue priority in Redmine.
| data | Data to store in Redmine |
| callback | Callback function with a QJsonDocument object |
| id | Issue priority ID to update; if set to NULL_ID, create a new issue priority |
| parameters | Additional enumeration parameters |
| void qtredmine::RedmineClient::sendIssueStatus | ( | const QJsonDocument & | data, |
| JsonCb | callback = nullptr, |
||
| int | id = -1, |
||
| QString | parameters = "" |
||
| ) |
Create or update issue status in Redmine.
| data | Data to store in Redmine |
| callback | Callback function with a QJsonDocument object |
| id | Issue status ID to update; if set to NULL_ID, create a new issue status |
| parameters | Additional issue status parameters |
| void qtredmine::RedmineClient::sendProject | ( | const QJsonDocument & | data, |
| JsonCb | callback = nullptr, |
||
| int | id = -1, |
||
| QString | parameters = "" |
||
| ) |
Create or update project in Redmine.
| data | Data to store in Redmine |
| callback | Callback function with a QJsonDocument object |
| id | Project ID to update; if set to NULL_ID, create a new project |
| parameters | Additional project parameters |
|
protected |
Send a request to Redmine.
| resource | The resource specific part of the Redmine REST URL, e.g. For example, if the Redmine base URL is set to |
| callback | Callback function for the result of the request The callback function is required for GET operations and optional for other operations |
| mode | HTTP operation mode |
| queryParams | Query parameters that are appended to the Redmine REST URL For example, if the Redmine base URL is set to |
| postData | Data that will be sent by POST and PUT operations |
| void qtredmine::RedmineClient::sendTimeEntry | ( | const QJsonDocument & | data, |
| JsonCb | callback = nullptr, |
||
| int | id = -1, |
||
| QString | parameters = "" |
||
| ) |
Create or update time entry in Redmine.
| data | Data to store in Redmine |
| callback | Callback function with a QJsonDocument object |
| id | Time entry ID to update; if set to NULL_ID, create a new time entry |
| parameters | Additional time entry parameters |
| void qtredmine::RedmineClient::sendTimeEntryActivity | ( | const QJsonDocument & | data, |
| JsonCb | callback = nullptr, |
||
| int | id = -1, |
||
| QString | parameters = "" |
||
| ) |
Create or update time entry activity in Redmine.
| data | Data to store in Redmine |
| callback | Callback function with a QJsonDocument object |
| id | Time entry activity ID to update; if set to NULL_ID, create a new time entry activity |
| parameters | Additional enumeration parameters |
| void qtredmine::RedmineClient::sendTracker | ( | const QJsonDocument & | data, |
| JsonCb | callback = nullptr, |
||
| int | id = -1, |
||
| QString | parameters = "" |
||
| ) |
Create or update tracker in Redmine.
| data | Data to store in Redmine |
| callback | Callback function with a QJsonDocument object |
| id | Tracker ID to update; if set to NULL_ID, create a new tracker |
| parameters | Additional tracker parameters |
| void qtredmine::RedmineClient::sendUser | ( | const QJsonDocument & | data, |
| JsonCb | callback = nullptr, |
||
| int | id = -1, |
||
| QString | parameters = "" |
||
| ) |
Create or update user in Redmine.
| data | Data to store in Redmine |
| callback | Callback function with a QJsonDocument object |
| id | User ID to update; if set to NULL_ID, create a new user |
| parameters | Additional user parameters |
| void qtredmine::RedmineClient::sendVersion | ( | const QJsonDocument & | data, |
| JsonCb | callback = nullptr, |
||
| int | id = -1, |
||
| QString | parameters = "" |
||
| ) |
Create or update version in Redmine.
| data | Data to store in Redmine |
| callback | Callback function with a QJsonDocument object |
| id | Version ID to update; if set to NULL_ID, create a new version |
| parameters | Additional version parameters |
| void qtredmine::RedmineClient::setAuthenticator | ( | QString | apiKey | ) |
Set the Redmine authentification parameters.
| apiKey | Redmine API key |
| void qtredmine::RedmineClient::setAuthenticator | ( | QString | login, |
| QString | password | ||
| ) |
Set the Redmine authentification parameters.
| login | Redmine login name |
| password | Redmine login password |
| void qtredmine::RedmineClient::setCheckSsl | ( | bool | checkSsl | ) |
Set the SSL check data (e.g. certificate validity)
| checkSsl | Check SSL data |
| void qtredmine::RedmineClient::setUrl | ( | QString | url | ) |
Set the Redmine base URL.
| url | Redmine base URL |
| void qtredmine::RedmineClient::setUserAgent | ( | QByteArray | userAgent | ) |
Set the user agent for the Redmine connection.
| userAgent | User agent |
1.8.11