| <!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/html; charset=utf-8" /> |
| |
| <title>Bindings — Apache Chemistry cmislib 0.6.0 documentation</title> |
| |
| <link rel="stylesheet" href="_static/classic.css" type="text/css" /> |
| <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> |
| |
| <script type="text/javascript"> |
| var DOCUMENTATION_OPTIONS = { |
| URL_ROOT: './', |
| VERSION: '0.6.0', |
| COLLAPSE_INDEX: false, |
| FILE_SUFFIX: '.html', |
| HAS_SOURCE: true, |
| SOURCELINK_SUFFIX: '.txt' |
| }; |
| </script> |
| <script type="text/javascript" src="_static/jquery.js"></script> |
| <script type="text/javascript" src="_static/underscore.js"></script> |
| <script type="text/javascript" src="_static/doctools.js"></script> |
| <link rel="author" title="About these documents" href="about.html" /> |
| <link rel="index" title="Index" href="genindex.html" /> |
| <link rel="search" title="Search" href="search.html" /> |
| <link rel="next" title="Code" href="code.html" /> |
| <link rel="prev" title="Examples" href="examples.html" /> |
| </head> |
| <body role="document"> |
| <div class="related" role="navigation" aria-label="related navigation"> |
| <h3>Navigation</h3> |
| <ul> |
| <li class="right" style="margin-right: 10px"> |
| <a href="genindex.html" title="General Index" |
| accesskey="I">index</a></li> |
| <li class="right" > |
| <a href="py-modindex.html" title="Python Module Index" |
| >modules</a> |</li> |
| <li class="right" > |
| <a href="code.html" title="Code" |
| accesskey="N">next</a> |</li> |
| <li class="right" > |
| <a href="examples.html" title="Examples" |
| accesskey="P">previous</a> |</li> |
| <li class="nav-item nav-item-0"><a href="index.html">Apache Chemistry cmislib 0.6.0 documentation</a> »</li> |
| </ul> |
| </div> |
| |
| <div class="document"> |
| <div class="documentwrapper"> |
| <div class="bodywrapper"> |
| <div class="body" role="main"> |
| |
| <div class="section" id="bindings"> |
| <h1>Bindings<a class="headerlink" href="#bindings" title="Permalink to this headline">¶</a></h1> |
| <p>The CMIS specification supports multiple bindings. You can think of a binding as |
| a communication protocol. The specification provides for three bindings:</p> |
| <blockquote> |
| <div><ul class="simple"> |
| <li>Atom Pub</li> |
| <li>Browser (JSON)</li> |
| <li>Web Services (SOAP)</li> |
| </ul> |
| </div></blockquote> |
| <p>Although the spec supports three, cmislib supports only two of these bindings: |
| Atom Pub and Browser.</p> |
| <p>When instantiating a <code class="xref py py-class docutils literal"><span class="pre">CmisClient</span></code>, if you do not specify a binding, cmislib |
| will use the Atom Pub binding, by default.</p> |
| <p>To use a different binding, such as the Browser binding, import it, then pass it |
| to the CmisClient constructor, like this:</p> |
| <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">cmislib.browser.binding</span> <span class="k">import</span> <span class="n">BrowserBinding</span> |
| <span class="gp">>>> </span><span class="n">client</span> <span class="o">=</span> <span class="n">CmisClient</span><span class="p">(</span><span class="s1">'http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/browser'</span><span class="p">,</span> <span class="s1">'admin'</span><span class="p">,</span> <span class="s1">'admin'</span><span class="p">,</span> <span class="n">binding</span><span class="o">=</span><span class="n">BrowserBinding</span><span class="p">())</span> |
| </pre></div> |
| </div> |
| <p>Make sure you specify the appropriate service URL for the binding you’ve chosen, |
| otherwise cmislib will be unable to parse the response appropriately.</p> |
| <p>Each of the two bindings modules contain implementations of the classes defined |
| in <a class="reference internal" href="code.html#module-cmislib.domain" title="cmislib.domain"><code class="xref py py-mod docutils literal"><span class="pre">cmislib.domain</span></code></a>. So, for example, if you execute a query that returns |
| documents and you are using the Atom Pub binding, what you’ll get back are instances |
| of <code class="xref py py-class docutils literal"><span class="pre">cmislib.atompub.AtomPubDocument</span></code> which implements <a class="reference internal" href="code.html#cmislib.domain.Document" title="cmislib.domain.Document"><code class="xref py py-class docutils literal"><span class="pre">cmislib.domain.Document</span></code></a>.</p> |
| <div class="section" id="module-cmislib.atompub"> |
| <span id="the-cmislib-atompub-module"></span><h2>The <a class="reference internal" href="#module-cmislib.atompub" title="cmislib.atompub"><code class="xref py py-mod docutils literal"><span class="pre">cmislib.atompub</span></code></a> Module<a class="headerlink" href="#module-cmislib.atompub" title="Permalink to this headline">¶</a></h2> |
| <dl class="class"> |
| <dt id="cmislib.atompub.AtomPubBinding"> |
| <em class="property">class </em><code class="descclassname">cmislib.atompub.</code><code class="descname">AtomPubBinding</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.atompub.AtomPubBinding" title="Permalink to this definition">¶</a></dt> |
| <dd><p>The binding responsible for talking to the CMIS server via the AtomPub |
| Publishing Protocol.</p> |
| <dl class="method"> |
| <dt id="cmislib.atompub.AtomPubBinding.delete"> |
| <code class="descname">delete</code><span class="sig-paren">(</span><em>url</em>, <em>username</em>, <em>password</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.atompub.AtomPubBinding.delete" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Does a delete against the CMIS service. More than likely, you will not |
| need to call this method. Instead, let the other objects do it for you.</p> |
| <p>For example, to delete a folder you’d call <code class="xref py py-class docutils literal"><span class="pre">Folder.delete</span></code> and |
| to delete a document you’d call <code class="xref py py-class docutils literal"><span class="pre">Document.delete</span></code>.</p> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="cmislib.atompub.AtomPubBinding.get"> |
| <code class="descname">get</code><span class="sig-paren">(</span><em>url</em>, <em>username</em>, <em>password</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.atompub.AtomPubBinding.get" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Does a get against the CMIS service. More than likely, you will not |
| need to call this method. Instead, let the other objects do it for you.</p> |
| <p>For example, if you need to get a specific object by object id, try |
| <code class="xref py py-class docutils literal"><span class="pre">Repository.getObject</span></code>. If you have a path instead of an object |
| id, use <code class="xref py py-class docutils literal"><span class="pre">Repository.getObjectByPath</span></code>. Or, you could start with |
| the root folder (<code class="xref py py-class docutils literal"><span class="pre">Repository.getRootFolder</span></code>) and drill down from |
| there.</p> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="cmislib.atompub.AtomPubBinding.post"> |
| <code class="descname">post</code><span class="sig-paren">(</span><em>url</em>, <em>username</em>, <em>password</em>, <em>payload</em>, <em>contentType</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.atompub.AtomPubBinding.post" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Does a post against the CMIS service. More than likely, you will not |
| need to call this method. Instead, let the other objects do it for you.</p> |
| <p>For example, to update the properties on an object, you’d call |
| <code class="xref py py-class docutils literal"><span class="pre">CmisObject.updateProperties</span></code>. Or, to check in a document that’s |
| been checked out, you’d call <code class="xref py py-class docutils literal"><span class="pre">Document.checkin</span></code> on the PWC.</p> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="cmislib.atompub.AtomPubBinding.put"> |
| <code class="descname">put</code><span class="sig-paren">(</span><em>url</em>, <em>username</em>, <em>password</em>, <em>payload</em>, <em>contentType</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.atompub.AtomPubBinding.put" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Does a put against the CMIS service. More than likely, you will not |
| need to call this method. Instead, let the other objects do it for you.</p> |
| <p>For example, to update the properties on an object, you’d call |
| <code class="xref py py-class docutils literal"><span class="pre">CmisObject.updateProperties</span></code>. Or, to check in a document that’s |
| been checked out, you’d call <code class="xref py py-class docutils literal"><span class="pre">Document.checkin</span></code> on the PWC.</p> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="class"> |
| <dt id="cmislib.atompub.RepositoryService"> |
| <em class="property">class </em><code class="descclassname">cmislib.atompub.</code><code class="descname">RepositoryService</code><a class="headerlink" href="#cmislib.atompub.RepositoryService" title="Permalink to this definition">¶</a></dt> |
| <dd><p>The repository service for the AtomPub binding.</p> |
| <dl class="method"> |
| <dt id="cmislib.atompub.RepositoryService.getDefaultRepository"> |
| <code class="descname">getDefaultRepository</code><span class="sig-paren">(</span><em>client</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.atompub.RepositoryService.getDefaultRepository" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Returns the default repository for the server via the AtomPub binding.</p> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="cmislib.atompub.RepositoryService.getRepositories"> |
| <code class="descname">getRepositories</code><span class="sig-paren">(</span><em>client</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.atompub.RepositoryService.getRepositories" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Get all of the repositories provided by the server.</p> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="cmislib.atompub.RepositoryService.getRepository"> |
| <code class="descname">getRepository</code><span class="sig-paren">(</span><em>client</em>, <em>repositoryId</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.atompub.RepositoryService.getRepository" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Get the repository for the specified repositoryId.</p> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="cmislib.atompub.RepositoryService.reload"> |
| <code class="descname">reload</code><span class="sig-paren">(</span><em>obj</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.atompub.RepositoryService.reload" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Reloads the state of the repository object.</p> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| </div> |
| <div class="section" id="module-cmislib.browser"> |
| <span id="the-cmislib-browser-module"></span><h2>The <a class="reference internal" href="#module-cmislib.browser" title="cmislib.browser"><code class="xref py py-mod docutils literal"><span class="pre">cmislib.browser</span></code></a> Module<a class="headerlink" href="#module-cmislib.browser" title="Permalink to this headline">¶</a></h2> |
| <dl class="class"> |
| <dt id="cmislib.browser.BrowserBinding"> |
| <em class="property">class </em><code class="descclassname">cmislib.browser.</code><code class="descname">BrowserBinding</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.browser.BrowserBinding" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Implements the Browser Binding to communicate with the CMIS server. The |
| Browser Binding uses only GET and POST. It sends JSON and HTML forms and |
| gets back JSON.</p> |
| <dl class="method"> |
| <dt id="cmislib.browser.BrowserBinding.get"> |
| <code class="descname">get</code><span class="sig-paren">(</span><em>url</em>, <em>username</em>, <em>password</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.browser.BrowserBinding.get" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Does a get against the CMIS service. More than likely, you will not |
| need to call this method. Instead, let the other objects do it for you.</p> |
| <p>For example, if you need to get a specific object by object id, try |
| <code class="xref py py-class docutils literal"><span class="pre">Repository.getObject</span></code>. If you have a path instead of an object |
| id, use <code class="xref py py-class docutils literal"><span class="pre">Repository.getObjectByPath</span></code>. Or, you could start with |
| the root folder (<code class="xref py py-class docutils literal"><span class="pre">Repository.getRootFolder</span></code>) and drill down from |
| there.</p> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="cmislib.browser.BrowserBinding.post"> |
| <code class="descname">post</code><span class="sig-paren">(</span><em>url</em>, <em>payload</em>, <em>contentType</em>, <em>username</em>, <em>password</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.browser.BrowserBinding.post" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Does a post against the CMIS service. More than likely, you will not |
| need to call this method. Instead, let the other objects do it for you.</p> |
| <p>For example, to update the properties on an object, you’d call |
| <code class="xref py py-class docutils literal"><span class="pre">CmisObject.updateProperties</span></code>. Or, to check in a document that’s |
| been checked out, you’d call <code class="xref py py-class docutils literal"><span class="pre">Document.checkin</span></code> on the PWC.</p> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| <dl class="class"> |
| <dt id="cmislib.browser.RepositoryService"> |
| <em class="property">class </em><code class="descclassname">cmislib.browser.</code><code class="descname">RepositoryService</code><a class="headerlink" href="#cmislib.browser.RepositoryService" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Defines the repository service for the Browser Binding.</p> |
| <dl class="method"> |
| <dt id="cmislib.browser.RepositoryService.getDefaultRepository"> |
| <code class="descname">getDefaultRepository</code><span class="sig-paren">(</span><em>client</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.browser.RepositoryService.getDefaultRepository" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Gets the default repository for this server. The spec doesn’t include |
| the notion of a default, so this just returns the first one in the |
| list.</p> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="cmislib.browser.RepositoryService.getRepositories"> |
| <code class="descname">getRepositories</code><span class="sig-paren">(</span><em>client</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.browser.RepositoryService.getRepositories" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Gets all of the repositories for this client.</p> |
| </dd></dl> |
| |
| <dl class="method"> |
| <dt id="cmislib.browser.RepositoryService.getRepository"> |
| <code class="descname">getRepository</code><span class="sig-paren">(</span><em>client</em>, <em>repositoryId</em><span class="sig-paren">)</span><a class="headerlink" href="#cmislib.browser.RepositoryService.getRepository" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Gets the repository for the specified repository ID.</p> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| </div> |
| </div> |
| |
| |
| </div> |
| </div> |
| </div> |
| <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> |
| <div class="sphinxsidebarwrapper"> |
| <h3><a href="index.html">Table Of Contents</a></h3> |
| <ul> |
| <li><a class="reference internal" href="#">Bindings</a><ul> |
| <li><a class="reference internal" href="#module-cmislib.atompub">The <code class="docutils literal"><span class="pre">cmislib.atompub</span></code> Module</a></li> |
| <li><a class="reference internal" href="#module-cmislib.browser">The <code class="docutils literal"><span class="pre">cmislib.browser</span></code> Module</a></li> |
| </ul> |
| </li> |
| </ul> |
| |
| <h4>Previous topic</h4> |
| <p class="topless"><a href="examples.html" |
| title="previous chapter">Examples</a></p> |
| <h4>Next topic</h4> |
| <p class="topless"><a href="code.html" |
| title="next chapter">Code</a></p> |
| <div role="note" aria-label="source link"> |
| <h3>This Page</h3> |
| <ul class="this-page-menu"> |
| <li><a href="_sources/bindings.rst.txt" |
| rel="nofollow">Show Source</a></li> |
| </ul> |
| </div> |
| <div id="searchbox" style="display: none" role="search"> |
| <h3>Quick search</h3> |
| <form class="search" action="search.html" method="get"> |
| <div><input type="text" name="q" /></div> |
| <div><input type="submit" value="Go" /></div> |
| <input type="hidden" name="check_keywords" value="yes" /> |
| <input type="hidden" name="area" value="default" /> |
| </form> |
| </div> |
| <script type="text/javascript">$('#searchbox').show(0);</script> |
| </div> |
| </div> |
| <div class="clearer"></div> |
| </div> |
| <div class="related" role="navigation" aria-label="related navigation"> |
| <h3>Navigation</h3> |
| <ul> |
| <li class="right" style="margin-right: 10px"> |
| <a href="genindex.html" title="General Index" |
| >index</a></li> |
| <li class="right" > |
| <a href="py-modindex.html" title="Python Module Index" |
| >modules</a> |</li> |
| <li class="right" > |
| <a href="code.html" title="Code" |
| >next</a> |</li> |
| <li class="right" > |
| <a href="examples.html" title="Examples" |
| >previous</a> |</li> |
| <li class="nav-item nav-item-0"><a href="index.html">Apache Chemistry cmislib 0.6.0 documentation</a> »</li> |
| </ul> |
| </div> |
| <div class="footer" role="contentinfo"> |
| © Copyright 2017, Apache Software Foundation. |
| Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.1. |
| </div> |
| </body> |
| </html> |