// Copyright 2015 Perforce Software Inc. #ifndef __HELIX_WEB_SERVICES_H___ #define __HELIX_WEB_SERVICES_H___ #include "hws/Client.h" /*! \mainpage Helix Web Services Client SDK for Qt \section usage Basic usage The primary interface for Helix Web Services involves the hws::Client. The hws::Client interacts with the server via several remote calls. Subsequently, using this API usually starts by attaching slots up to several signals. Then you setup a signal \code{.cpp} #include <hws.h> hws::Client client; // Each client should be tied to a particular Perforce Web Services instance. client.setUrl("http://p4_web_services.mycompany.com"); connect(client, &hws::Client::logInDone, myObj, &MyObj::logInDone); connect(client, &hws::Client::executeMethodDone, myObj, &MyObj::executeMethodDone); client.logIn("myuser", "mypassword"); // Some possible 'callback' handlers void MyObj::logInDone(RequestErrorPtr err, SessionPtr session) { // You should probably check for errors, and probably cache the session // here so you don't have to re-log in // Load all projects just for a fun starting point client.fetchProjects(); } void MyObj::executeMethodDone(RequestErrorPtr err, const QString & method, const QString & path, const QSharedPointer<hws::Client::QVariantMapList> data) { // given the method and path, probably reformat and dispatch the // data to your application's handlers } \endcode Each hws::Client instance requires a Session. A session can be created by calling the `logIn` method, which will then store the session locally. (That Session instance can be stored locally and then, instead of calling `logIn`, you call `setSession`.) This session will be valid as long as the underlying Perforce server ticket allows. If you start to receive authentication errors, your client will have to log in again, and restore a new session. Authentication errors are returned with the code `RequestError::AUTHENTICATION_ERROR` of any `RequestError` returned by pretty much any server call. */; namespace hws { // Semantic versioning information for the project. // Changes to the major version should indicate a breaking change to the API #define HELIX_WEB_SERVICES_MAJOR_VERSION 1 // Changes to the minor version indicate most likely a feature addition, // but shouldn't break any existing code. #define HELIX_WEB_SERVICES_MINOR_VERSION 0 // Patch versions shouldn't have any API change at all, just bug fixes. #define HELIX_WEB_SERVICES_PATCH_VERSION 0 // If non-null, this is not an official release, and this string indicates // more information, like "main-[CHANGELIST]" that can be #define HELIX_WEB_SERVICES_PRERELEASE_VERSION "main-15600" } #endif // __HELIX_WEB_SERVICES_H__
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15741 | ptomiak | Branch HWS for my use. | ||
//guest/perforce_software/helix-web-services/main/build/helix_web_services_client_qt/hws.h | |||||
#7 | 15601 | tjuricek | validateSessionFinished should not emit a signal if an error occurred on the request | ||
#6 | 15578 | tjuricek |
Removing QSettings* usage from hws::Client. The way QSettings was being used only is relevant for one connection at a time, and, it didn't seem to work on windows nicely anyway. |
||
#5 | 15521 | tjuricek | Call client.ignoreSslErrors(true) to bypass self-signed cert problems. | ||
#4 | 15448 | tjuricek |
Qt SDK revision: remove higher-level objects from the SDK. It's likely we could add higher-level objects that adapt the executeMethodDone and convert the variant maps to something, well, typed and easier to use. That's not in my current scope of work, however. |
||
#3 | 14102 | tjuricek |
Set the default prefix to "/hws" for now. This is very likely to become a real convention. The "primary" UI will be hosted on the root, with the Web Services instance hosted "under" /hws. |
||
#2 | 14055 | tjuricek | Updating helix_web_services_client build for new 'my' vs 'all' projects feature | ||
#1 | 14050 | tjuricek | Prep versioned release directory for inclusion into Helix Sync app. |