chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r841853 - in /websites/staging/chemistry/trunk/content: ./ objective-c/objectivecmis.html
Date Wed, 12 Dec 2012 11:26:44 GMT
Author: buildbot
Date: Wed Dec 12 11:26:43 2012
New Revision: 841853

Log:
Staging update by buildbot for chemistry

Modified:
    websites/staging/chemistry/trunk/content/   (props changed)
    websites/staging/chemistry/trunk/content/objective-c/objectivecmis.html

Propchange: websites/staging/chemistry/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Wed Dec 12 11:26:43 2012
@@ -1 +1 @@
-1416962
+1420621

Modified: websites/staging/chemistry/trunk/content/objective-c/objectivecmis.html
==============================================================================
--- websites/staging/chemistry/trunk/content/objective-c/objectivecmis.html (original)
+++ websites/staging/chemistry/trunk/content/objective-c/objectivecmis.html Wed Dec 12 11:26:43
2012
@@ -183,8 +183,139 @@ Apache Chemistry - ObjectiveCMIS
            </td>
            <td height="100%">
              <!-- Content -->
-             <div class="wiki-content"><h1 id="welcome-to-objectivecmis">Welcome
to ObjectiveCMIS</h1>
-<p>Apache Chemistry ObjectiveCMIS is a CMIS client library for Objective-C.</p></div>
+             <div class="wiki-content"><h1 id="welcome-to-apache-objectivecmis">Welcome
to Apache ObjectiveCMIS</h1>
+<h2 id="introduction">Introduction</h2>
+<p>Apache Chemistry ObjectiveCMIS is a CMIS client library for Objective-C language.</p>
+<p>The library is primarily targeted at iOS application development and aims to provide
an interoperability API to CMIS based repositories.</p>
+<p>However, as the base library is built on the Foundation.framework it can be used
for developing Mac OSX applications as well. </p>
+<h3 id="where-to-get-it-from">Where to get it from</h3>
+<p>TBD</p>
+<h3 id="get-objectivecmis-code">Get ObjectiveCMIS code</h3>
+<ul>
+<li>
+<p>binary distribution</p>
+</li>
+<li>
+<p>source code distribution</p>
+</li>
+</ul>
+<h3 id="what-the-library-contains">What the library contains</h3>
+<p>The ObjectiveCMIS library is distributed as a ZIP file containing</p>
+<ul>
+<li>
+<p>the library:  <em>libObjectiveCMIS.a</em> </p>
+</li>
+<li>
+<p>public header files: contained in the <em>ObjectiveCMIS</em> folder</p>
+</li>
+<li>
+<p>documentation: provided as a docset (generated using appledocs).</p>
+</li>
+</ul>
+<h3 id="minimum-requirements">Minimum Requirements</h3>
+<p>The library is making use of Objective-C automated reference counting (ARC). Therefore
the library is compatible with iOS SDK v5.x or later.</p>
+<p>For development we recommend the latest available version of XCode and iOS/Mac OSX
SDKs.</p>
+<h3 id="how-to-include-the-library-on-your-xcode-project">How to include the library
on your XCode project</h3>
+<p>The easiest way to include the ObjectiveCMIS library into your project is to unzip
the ObjectiveCMIS ZIP file.</p>
+<p>Then go to the 'File' menu in XCode and select the 'Add Files to…' option.
Add the headers and library files contained in the ZIP distribution to your project:</p>
+<ul>
+<li>
+<p>Make sure that the library is included in the list of frameworks/libraries. Select
the build target and go to Build Phases. libObjectiveCMIS.a should be listed in the Link Binary
with Libraries option. </p>
+</li>
+<li>
+<p>The CMIS headers should be included in the 'Copy Headers' section of Build Phases
for your build target.</p>
+</li>
+</ul>
+<h2 id="getting-started">Getting Started</h2>
+<h3 id="block-based-structure">Block based structure</h3>
+<p>ObjectiveCMIS calls to CMIS repositories are asynchronous. Callback handling is
facilitated utilising <em>block</em> structures available in Objective-C. Further
information on the use of blocks in Objective-C can be found directly at [http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/Blocks/Articles/00_Introduction.html]</p>
+<h3 id="at-the-beginning-there-is-a-cmis-session">At the Beginning - There is a CMIS
Session</h3>
+<p>It all starts with establishing a session to the CMIS repository. The class to facilitate
this is 'CMISSession'.</p>
+<p>The code snippet below demonstrates how to create a session with a minimum set of
parameters (used for access/authentication)</p>
+<div class="codehilite"><pre><span class="n">CMISSessionParameters</span>
<span class="o">*</span><span class="n">params</span> <span class="o">=</span>
<span class="p">[[</span><span class="n">CMISSessionParameters</span>
<span class="n">alloc</span><span class="p">]</span> <span class="nl">initWithBindingType:</span><span
class="n">CMISBindingTypeAtomPub</span><span class="p">];</span>
+
+<span class="n">params</span><span class="p">.</span><span class="n">atomPubUrl</span>
<span class="o">=</span> <span class="p">[</span><span class="n">NSURL</span>
<span class="nl">URLWithString:</span><span class="n">cmisAtomPubLocation</span><span
class="p">];</span>
+
+<span class="n">params</span><span class="p">.</span><span class="n">username</span>
 <span class="o">=</span> <span class="s">@&quot;&lt;yourusername&gt;&quot;</span><span
class="p">;</span>
+
+<span class="n">params</span><span class="p">.</span><span class="n">password</span>
<span class="o">=</span> <span class="s">@&quot;&lt;yourpassword&gt;&quot;</span><span
class="p">;</span>
+
+<span class="n">params</span><span class="p">.</span><span class="n">repositoryId</span>
<span class="o">=</span> <span class="n">self</span><span class="p">.</span><span
class="n">repositoryId</span><span class="p">;</span>
+
+<span class="c1">//Connect to session</span>
+
+<span class="p">[</span><span class="n">CMISSession</span> <span
class="nl">connectWithSessionParameters:</span><span class="n">params</span>
<span class="nl">completionBlock:</span><span class="o">^</span><span
class="p">(</span><span class="n">CMISSession</span> <span class="o">*</span><span
class="n">session</span><span class="p">,</span> <span class="n">NSError</span>
<span class="o">*</span><span class="n">error</span><span class="p">){</span>
+
+   <span class="k">if</span><span class="p">(</span> <span class="nb">nil</span>
<span class="o">==</span> <span class="n">session</span> <span
class="p">)</span>
+
+   <span class="p">{</span>
+
+      <span class="c1">//do your error handling here</span>
+
+   <span class="p">}</span>
+
+   <span class="k">else</span>
+
+   <span class="p">{</span>
+
+      <span class="n">self</span><span class="p">.</span><span
class="n">session</span> <span class="o">=</span> <span class="n">session</span><span
class="p">;</span>
+
+   <span class="p">}</span>
+
+<span class="p">}];</span>
+</pre></div>
+
+
+<h4 id="how-to-get-to-the-repository-id">How to get to the repository ID</h4>
+<p>In the code above you may have noticed that we used the repository ID in the session
parameters. This is a required parameter to be passed into the 'connectWithSessionParameters:completionBlock:'
method. CMISSession provides a convenience method to retrieve the repositories. This is demonstrated
in the code snippet below. </p>
+<div class="codehilite"><pre><span class="n">__block</span> <span
class="n">CMISSessionParameters</span> <span class="o">*</span><span
class="n">params</span> <span class="o">=</span> <span class="p">[[</span><span
class="n">CMISSessionParameters</span> <span class="n">alloc</span><span
class="p">]</span> <span class="nl">initWithBindingType:</span><span
class="n">CMISBindingTypeAtomPub</span><span class="p">];</span>
+
+<span class="n">params</span><span class="p">.</span><span class="n">atomPubUrl</span>
<span class="o">=</span> <span class="p">[</span><span class="n">NSURL</span>
<span class="nl">URLWithString:</span><span class="n">cmisAtomPubLocation</span><span
class="p">];</span>
+
+<span class="n">params</span><span class="p">.</span><span class="n">username</span>
 <span class="o">=</span> <span class="s">@&quot;&lt;yourusername&gt;&quot;</span><span
class="p">;</span>
+
+<span class="n">params</span><span class="p">.</span><span class="n">password</span>
<span class="o">=</span> <span class="s">@&quot;&lt;yourpassword&gt;&quot;</span><span
class="p">;</span>
+
+<span class="p">[</span><span class="n">CMISSession</span> <span
class="nl">arrayOfRepositories:</span><span class="n">params</span> <span
class="nl">completionBlock:</span><span class="o">^</span><span class="p">(</span><span
class="n">NSArray</span> <span class="o">*</span><span class="n">repos</span><span
class="p">,</span> <span class="n">NSError</span> <span class="o">*</span><span
class="n">error</span><span class="p">){</span>
+
+   <span class="k">if</span><span class="p">(</span><span class="nb">nil</span>
<span class="o">==</span> <span class="n">repos</span><span class="p">)</span>
+
+   <span class="p">{</span>
+
+      <span class="c1">// error handling</span>
+
+   <span class="p">}</span>
+
+   <span class="k">else</span>
+
+   <span class="p">{</span>
+
+      <span class="n">CMISRepositoryInfo</span> <span class="n">repoInfo</span>
<span class="o">=</span> <span class="p">[</span><span class="n">repos</span>
<span class="nl">objectAtIndex:</span><span class="mi">0</span><span
class="p">];</span>
+
+      <span class="n">params</span><span class="p">.</span><span
class="n">repositoryId</span> <span class="o">=</span> <span class="n">repoInfo</span><span
class="p">.</span><span class="n">identifier</span><span class="p">;</span>
+
+      <span class="p">[</span><span class="n">CMISSession</span>
<span class="nl">connectWithSessionParameters:</span><span class="n">params</span>
<span class="nl">completionBlock:</span><span class="o">^</span><span
class="p">(</span><span class="n">CMISSession</span> <span class="o">*</span><span
class="n">session</span><span class="p">,</span> <span class="n">NSError</span>
<span class="o">*</span><span class="n">sessionError</span><span
class="p">){</span>
+
+         <span class="k">if</span><span class="p">(</span><span
class="nb">nil</span> <span class="o">==</span> <span class="n">session</span><span
class="p">)</span>
+
+         <span class="p">{</span>
+
+         <span class="p">}</span>
+
+         <span class="k">else</span>
+
+         <span class="p">{</span>
+
+            <span class="n">self</span><span class="p">.</span><span
class="n">session</span> <span class="o">=</span> <span class="n">session</span><span
class="p">;</span>
+
+         <span class="p">}</span>
+
+      <span class="p">}];</span>
+
+   <span class="p">}</span>
+
+<span class="p">}];</span>
+</pre></div></div>
              <!-- Content -->
            </td>
           </tr>



Mime
View raw message