Return-Path: X-Original-To: apmail-chemistry-commits-archive@www.apache.org Delivered-To: apmail-chemistry-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AF921D82D for ; Wed, 12 Dec 2012 11:27:09 +0000 (UTC) Received: (qmail 72111 invoked by uid 500); 12 Dec 2012 11:27:09 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 72059 invoked by uid 500); 12 Dec 2012 11:27:09 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 72035 invoked by uid 99); 12 Dec 2012 11:27:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2012 11:27:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2012 11:27:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 56F37238899C for ; Wed, 12 Dec 2012 11:26:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r841853 - in /websites/staging/chemistry/trunk/content: ./ objective-c/objectivecmis.html Date: Wed, 12 Dec 2012 11:26:44 -0000 To: commits@chemistry.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121212112644.56F37238899C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 -

Welcome to ObjectiveCMIS

-

Apache Chemistry ObjectiveCMIS is a CMIS client library for Objective-C.

+

Welcome to Apache ObjectiveCMIS

+

Introduction

+

Apache Chemistry ObjectiveCMIS is a CMIS client library for Objective-C language.

+

The library is primarily targeted at iOS application development and aims to provide an interoperability API to CMIS based repositories.

+

However, as the base library is built on the Foundation.framework it can be used for developing Mac OSX applications as well.

+

Where to get it from

+

TBD

+

Get ObjectiveCMIS code

+
    +
  • +

    binary distribution

    +
  • +
  • +

    source code distribution

    +
  • +
+

What the library contains

+

The ObjectiveCMIS library is distributed as a ZIP file containing

+
    +
  • +

    the library: libObjectiveCMIS.a

    +
  • +
  • +

    public header files: contained in the ObjectiveCMIS folder

    +
  • +
  • +

    documentation: provided as a docset (generated using appledocs).

    +
  • +
+

Minimum Requirements

+

The library is making use of Objective-C automated reference counting (ARC). Therefore the library is compatible with iOS SDK v5.x or later.

+

For development we recommend the latest available version of XCode and iOS/Mac OSX SDKs.

+

How to include the library on your XCode project

+

The easiest way to include the ObjectiveCMIS library into your project is to unzip the ObjectiveCMIS ZIP file.

+

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:

+
    +
  • +

    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.

    +
  • +
  • +

    The CMIS headers should be included in the 'Copy Headers' section of Build Phases for your build target.

    +
  • +
+

Getting Started

+

Block based structure

+

ObjectiveCMIS calls to CMIS repositories are asynchronous. Callback handling is facilitated utilising block 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]

+

At the Beginning - There is a CMIS Session

+

It all starts with establishing a session to the CMIS repository. The class to facilitate this is 'CMISSession'.

+

The code snippet below demonstrates how to create a session with a minimum set of parameters (used for access/authentication)

+
CMISSessionParameters *params = [[CMISSessionParameters alloc] initWithBindingType:CMISBindingTypeAtomPub];
+
+params.atomPubUrl = [NSURL URLWithString:cmisAtomPubLocation];
+
+params.username  = @"<yourusername>";
+
+params.password = @"<yourpassword>";
+
+params.repositoryId = self.repositoryId;
+
+//Connect to session
+
+[CMISSession connectWithSessionParameters:params completionBlock:^(CMISSession *session, NSError *error){
+
+   if( nil == session )
+
+   {
+
+      //do your error handling here
+
+   }
+
+   else
+
+   {
+
+      self.session = session;
+
+   }
+
+}];
+
+ + +

How to get to the repository ID

+

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.

+
__block CMISSessionParameters *params = [[CMISSessionParameters alloc] initWithBindingType:CMISBindingTypeAtomPub];
+
+params.atomPubUrl = [NSURL URLWithString:cmisAtomPubLocation];
+
+params.username  = @"<yourusername>";
+
+params.password = @"<yourpassword>";
+
+[CMISSession arrayOfRepositories:params completionBlock:^(NSArray *repos, NSError *error){
+
+   if(nil == repos)
+
+   {
+
+      // error handling
+
+   }
+
+   else
+
+   {
+
+      CMISRepositoryInfo repoInfo = [repos objectAtIndex:0];
+
+      params.repositoryId = repoInfo.identifier;
+
+      [CMISSession connectWithSessionParameters:params completionBlock:^(CMISSession *session, NSError *sessionError){
+
+         if(nil == session)
+
+         {
+
+         }
+
+         else
+
+         {
+
+            self.session = session;
+
+         }
+
+      }];
+
+   }
+
+}];
+