<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.9.1"/> <title>Helix Web Services Client: Helix Web Services Client SDK for Qt</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Helix Web Services Client  <span id="projectnumber">1</span> </div> <div id="projectbrief">Helix Web Services Client SDK for Qt Applications</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.9.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li class="current"><a href="index.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">Helix Web Services Client SDK for Qt </div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><h1><a class="anchor" id="usage"></a> Basic usage</h1> <p>The primary interface for Helix Web Services involves the <a class="el" href="classhws_1_1_client.html" title="Front end to making requests against the Phoenix web services API. ">hws::Client</a>. The <a class="el" href="classhws_1_1_client.html" title="Front end to making requests against the Phoenix web services API. ">hws::Client</a> 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</p> <div class="fragment"><div class="line"><span class="preprocessor">#include <hws.h></span></div> <div class="line"></div> <div class="line"><a class="code" href="classhws_1_1_client.html">hws::Client</a> client;</div> <div class="line"></div> <div class="line"><span class="comment">// Each client should be tied to a particular Perforce Web Services instance.</span></div> <div class="line">client.<a class="code" href="classhws_1_1_client.html#a457086d9086e7ffe12e8250f40531725">setUrl</a>(<span class="stringliteral">"http://p4_web_services.mycompany.com"</span>);</div> <div class="line"></div> <div class="line">connect(client, &<a class="code" href="classhws_1_1_client.html#a8020be14b02290e325e2addb4cd205ad">hws::Client::logInDone</a>,</div> <div class="line"> myObj, &MyObj::logInDone);</div> <div class="line"></div> <div class="line">connect(client, &<a class="code" href="classhws_1_1_client.html#a80c0f9f416a31e17fe3280016397e96b">hws::Client::executeMethodDone</a>,</div> <div class="line"> myObj, &MyObj::executeMethodDone);</div> <div class="line"></div> <div class="line">client.<a class="code" href="classhws_1_1_client.html#ac87a65bae065cbd0b1e1f6abc2c06242">logIn</a>(<span class="stringliteral">"myuser"</span>, <span class="stringliteral">"mypassword"</span>);</div> <div class="line"></div> <div class="line"><span class="comment">// Some possible 'callback' handlers</span></div> <div class="line"></div> <div class="line"><span class="keywordtype">void</span> MyObj::logInDone(RequestErrorPtr err, SessionPtr session)</div> <div class="line">{</div> <div class="line"> <span class="comment">// You should probably check for errors, and probably cache the session</span></div> <div class="line"> <span class="comment">// here so you don't have to re-log in</span></div> <div class="line"></div> <div class="line"> <span class="comment">// Load all projects just for a fun starting point</span></div> <div class="line"> client.fetchProjects();</div> <div class="line">}</div> <div class="line"></div> <div class="line"><span class="keywordtype">void</span> MyObj::executeMethodDone(RequestErrorPtr err,</div> <div class="line"> <span class="keyword">const</span> QString & method,</div> <div class="line"> <span class="keyword">const</span> QString & path,</div> <div class="line"> <span class="keyword">const</span> QSharedPointer<hws::Client::QVariantMapList> data)</div> <div class="line">{</div> <div class="line"> <span class="comment">// given the method and path, probably reformat and dispatch the</span></div> <div class="line"> <span class="comment">// data to your application's handlers</span></div> <div class="line">}</div> </div><!-- fragment --><p>Each <a class="el" href="classhws_1_1_client.html" title="Front end to making requests against the Phoenix web services API. ">hws::Client</a> instance requires a Session. A session can be created by calling the <code>logIn</code> method, which will then store the session locally. (That Session instance can be stored locally and then, instead of calling <code>logIn</code>, you call <code>setSession</code>.) 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.</p> <p>Authentication errors are returned with the code <code>RequestError::AUTHENTICATION_ERROR</code> of any <code>RequestError</code> returned by pretty much any server call. </p> </div></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Mon Aug 31 2015 09:11:40 for Helix Web Services Client by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.9.1 </small></address> </body> </html>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15741 | ptomiak | Branch HWS for my use. | ||
//guest/perforce_software/helix-web-services/main/build/doc/helix_web_services_client_qt/html/index.html | |||||
#8 | 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. |
||
#7 | 15544 | tjuricek | Explain that the QSettings handle for hws::Client should only be used on connections you don't specify a P4PORT for. | ||
#6 | 15447 | tjuricek |
Add simple Example application to list "projects" in a HVE instance. Qt's a little weird to follow, so I may have to find a different kind of example to write. It does work, however. |
||
#5 | 15423 | tjuricek |
Revised HWS Qt API. This is a major revision of the API, which removes most of the "typed" data, replacing it with a more generic "executeMethodDone" callback. The main benefit here is to allow the API to interop with different versions of p4d, and not restrict the methods it can call. We may add more helpers in the future. |
||
#4 | 14054 | tjuricek |
Allowing the Qt client to select 'all' vs 'my' projects. Right now, it should default to using "my" projects as a rule. |
||
#3 | 14049 | tjuricek |
Add methods to generate client workspaces for a user. The Qt SDK was updated based on immediate need. Also, add Ruby client SDK documentation to the docs site. Everything is early, but there's *some* reference available at least. |
||
#2 | 14026 | tjuricek | Revise example code on main page of Qt SDK | ||
#1 | 14025 | tjuricek |
Revise Qt SDK to a single 'helix_web_services_client' project. Most references to "Phoenix" have now been removed. Additionally, this is more similar to the other platform client SDKs in Ruby and JavaScript. Documentation via Doxygen is now available, and will be how much of the SDK reference should occur. |