You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by pw...@apache.org on 2013/02/22 11:05:53 UTC

svn commit: r1448972 - in /chemistry/objectivecmis/trunk/ObjectiveCMIS: Bindings/ Bindings/AtomPub/ Client/ Utils/

Author: pweschmidt
Date: Fri Feb 22 10:05:52 2013
New Revision: 1448972

URL: http://svn.apache.org/r1448972
Log:
CMISSession class methods (connect/arrayOfRepos) are cancellable; CMISRendition is cancellable; cleanup of comments; there were some residual semi-colons at the end of some methods that had to be cleaned up

Modified:
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService+Protected.h
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService.m
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubDiscoveryService.m
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubRepositoryService.m
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubVersioningService.m
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISDiscoveryService.h
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISNavigationService.h
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISObjectService.h
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISRepositoryService.h
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISVersioningService.h
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.h
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.m
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISFolder.h
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISFolder.m
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISRendition.h
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISRendition.m
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.h
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.m
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISHttpDownloadRequest.m

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService+Protected.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService%2BProtected.h?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService+Protected.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService+Protected.h Fri Feb 22 10:05:52 2013
@@ -35,14 +35,14 @@
 /**
  fetches the repo info
  */
-- (void)fetchRepositoryInfoWithCancellableRequest:(CMISRequest *)cmisRequest
-                                  completionBlock:(void (^)(NSError *error))completionBlock;
+- (void)fetchRepositoryInfoWithCMISRequest:(CMISRequest *)cmisRequest
+                           completionBlock:(void (^)(NSError *error))completionBlock;
 
 /**
  retrieves the CMIS workspace
  */
-- (void)retrieveCMISWorkspacesWithCancellableRequest:(CMISRequest *)cmisRequest
-                                     completionBlock:(void (^)(NSArray *workspaces, NSError *error))completionBlock;
+- (void)retrieveCMISWorkspacesWithCMISRequest:(CMISRequest *)cmisRequest
+                              completionBlock:(void (^)(NSArray *workspaces, NSError *error))completionBlock;
 
 
 /** Convenience method with all the defaults for the retrieval parameters */

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService.m?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService.m Fri Feb 22 10:05:52 2013
@@ -64,7 +64,7 @@
         return;
     } else {
          // if object is nil, first populate cache
-        [self fetchRepositoryInfoWithCancellableRequest:cmisRequest completionBlock:^(NSError *error) {
+        [self fetchRepositoryInfoWithCMISRequest:cmisRequest completionBlock:^(NSError *error) {
             id object = [self.bindingSession objectForKey:cacheKey];
             if (!object && !error) {
                 // TODO: proper error initialisation
@@ -76,10 +76,10 @@
     }
 }
 
-- (void)fetchRepositoryInfoWithCancellableRequest:(CMISRequest *)cmisRequest
-                                  completionBlock:(void (^)(NSError *error))completionBlock
+- (void)fetchRepositoryInfoWithCMISRequest:(CMISRequest *)cmisRequest
+                           completionBlock:(void (^)(NSError *error))completionBlock
 {
-    [self retrieveCMISWorkspacesWithCancellableRequest:cmisRequest completionBlock:^(NSArray *cmisWorkSpaces, NSError *error) {
+    [self retrieveCMISWorkspacesWithCMISRequest:cmisRequest completionBlock:^(NSArray *cmisWorkSpaces, NSError *error) {
         if (!error) {
             BOOL repositoryFound = NO;
             for (CMISWorkspace *workspace in cmisWorkSpaces) {
@@ -118,8 +118,8 @@
     }];
 }
 
-- (void)retrieveCMISWorkspacesWithCancellableRequest:(CMISRequest *)cmisRequest
-                                     completionBlock:(void (^)(NSArray *workspaces, NSError *error))completionBlock
+- (void)retrieveCMISWorkspacesWithCMISRequest:(CMISRequest *)cmisRequest
+                              completionBlock:(void (^)(NSArray *workspaces, NSError *error))completionBlock
 {
     if ([self.bindingSession objectForKey:kCMISSessionKeyWorkspaces]) {
         completionBlock([self.bindingSession objectForKey:kCMISSessionKeyWorkspaces], nil);
@@ -153,8 +153,8 @@
 }
 
 - (void)retrieveObjectInternal:(NSString *)objectId
-                           cmisRequest:(CMISRequest *)cmisRequest
-                       completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
+                   cmisRequest:(CMISRequest *)cmisRequest
+               completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
 {
     return [self retrieveObjectInternal:objectId
                           returnVersion:NOT_PROVIDED
@@ -268,7 +268,8 @@
     }];
 }
 
-- (CMISLinkCache *)linkCache{
+- (CMISLinkCache *)linkCache
+{
     CMISLinkCache *linkCache = [self.bindingSession objectForKey:kCMISBindingSessionKeyLinkCache];
     if (linkCache == nil) {
         linkCache = [[CMISLinkCache alloc] initWithBindingSession:self.bindingSession];

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubDiscoveryService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubDiscoveryService.m?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubDiscoveryService.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubDiscoveryService.m Fri Feb 22 10:05:52 2013
@@ -27,13 +27,14 @@
 
 @implementation CMISAtomPubDiscoveryService
 
-- (CMISRequest*)query:(NSString *)statement searchAllVersions:(BOOL)searchAllVersions
-                                        relationships:(CMISIncludeRelationship)relationships
-                                      renditionFilter:(NSString *)renditionFilter
-                              includeAllowableActions:(BOOL)includeAllowableActions
-                                             maxItems:(NSNumber *)maxItems
-                                            skipCount:(NSNumber *)skipCount
-                                      completionBlock:(void (^)(CMISObjectList *objectList, NSError *error))completionBlock;
+- (CMISRequest*)query:(NSString *)statement
+    searchAllVersions:(BOOL)searchAllVersions
+        relationships:(CMISIncludeRelationship)relationships
+      renditionFilter:(NSString *)renditionFilter
+includeAllowableActions:(BOOL)includeAllowableActions
+             maxItems:(NSNumber *)maxItems
+            skipCount:(NSNumber *)skipCount
+      completionBlock:(void (^)(CMISObjectList *objectList, NSError *error))completionBlock
 {
     // Validate params
     if (statement == nil) {

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m Fri Feb 22 10:05:52 2013
@@ -86,7 +86,7 @@
                                streamId:(NSString *)streamId
                                  toFile:(NSString *)filePath
                         completionBlock:(void (^)(NSError *error))completionBlock
-                          progressBlock:(void (^)(unsigned long long bytesDownloaded, unsigned long long bytesTotal))progressBlock;
+                          progressBlock:(void (^)(unsigned long long bytesDownloaded, unsigned long long bytesTotal))progressBlock
 {
     NSOutputStream *outputStream = [NSOutputStream outputStreamToFileAtPath:filePath append:NO];
     return [self downloadContentOfObject:objectId
@@ -100,7 +100,7 @@
                                streamId:(NSString *)streamId
                          toOutputStream:(NSOutputStream *)outputStream
                         completionBlock:(void (^)(NSError *error))completionBlock
-                          progressBlock:(void (^)(unsigned long long bytesDownloaded, unsigned long long bytesTotal))progressBlock;
+                          progressBlock:(void (^)(unsigned long long bytesDownloaded, unsigned long long bytesTotal))progressBlock
 {
     CMISRequest *request = [[CMISRequest alloc] init];
     
@@ -147,8 +147,8 @@
 }
 
 - (CMISRequest*)deleteContentOfObject:(CMISStringInOutParameter *)objectIdParam
-                  changeToken:(CMISStringInOutParameter *)changeTokenParam
-              completionBlock:(void (^)(NSError *error))completionBlock
+                          changeToken:(CMISStringInOutParameter *)changeTokenParam
+                      completionBlock:(void (^)(NSError *error))completionBlock
 {
     // Validate object id param
     if (objectIdParam == nil || objectIdParam.inParameter == nil) {
@@ -478,10 +478,10 @@
 }
 
 - (CMISRequest*)deleteTree:(NSString *)folderObjectId
-        allVersion:(BOOL)allVersions
-     unfileObjects:(CMISUnfileObject)unfileObjects
- continueOnFailure:(BOOL)continueOnFailure
-   completionBlock:(void (^)(NSArray *failedObjects, NSError *error))completionBlock
+                allVersion:(BOOL)allVersions
+             unfileObjects:(CMISUnfileObject)unfileObjects
+         continueOnFailure:(BOOL)continueOnFailure
+           completionBlock:(void (^)(NSArray *failedObjects, NSError *error))completionBlock
 {
     // Validate params
     if (!folderObjectId) {

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubRepositoryService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubRepositoryService.m?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubRepositoryService.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubRepositoryService.m Fri Feb 22 10:05:52 2013
@@ -48,7 +48,8 @@
     }];
 }
 
-- (CMISRequest*)retrieveRepositoryInfoForId:(NSString *)repositoryId completionBlock:(void (^)(CMISRepositoryInfo *repositoryInfo, NSError *error))completionBlock
+- (CMISRequest*)retrieveRepositoryInfoForId:(NSString *)repositoryId
+                            completionBlock:(void (^)(CMISRepositoryInfo *repositoryInfo, NSError *error))completionBlock
 {
     return [self internalRetrieveRepositoriesWithCompletionBlock:^(NSError *error) {
         if (error) {
@@ -63,7 +64,7 @@
 {
     self.repositories = [NSMutableDictionary dictionary];
     CMISRequest *request = [[CMISRequest alloc] init];
-    [self retrieveCMISWorkspacesWithCancellableRequest:request completionBlock:^(NSArray *cmisWorkSpaces, NSError *error) {
+    [self retrieveCMISWorkspacesWithCMISRequest:request completionBlock:^(NSArray *cmisWorkSpaces, NSError *error) {
         if (cmisWorkSpaces != nil) {
             for (CMISWorkspace *workspace in cmisWorkSpaces) {
                 [self.repositories setObject:workspace.repositoryInfo forKey:workspace.repositoryInfo.identifier];
@@ -73,7 +74,8 @@
     }];
     return request;
 }
-- (CMISRequest*)retrieveTypeDefinition:(NSString *)typeId completionBlock:(void (^)(CMISTypeDefinition *typeDefinition, NSError *error))completionBlock
+- (CMISRequest*)retrieveTypeDefinition:(NSString *)typeId
+                       completionBlock:(void (^)(CMISTypeDefinition *typeDefinition, NSError *error))completionBlock
 {
     if (typeId == nil) {
         log(@"Parameter typeId is required");

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubVersioningService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubVersioningService.m?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubVersioningService.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubVersioningService.m Fri Feb 22 10:05:52 2013
@@ -28,14 +28,14 @@
 @implementation CMISAtomPubVersioningService
 
 - (CMISRequest*)retrieveObjectOfLatestVersion:(NSString *)objectId
-                                major:(BOOL)major
-                               filter:(NSString *)filter
-                        relationships:(CMISIncludeRelationship)relationships
-                     includePolicyIds:(BOOL)includePolicyIds
-                      renditionFilter:(NSString *)renditionFilter
-                           includeACL:(BOOL)includeACL
-              includeAllowableActions:(BOOL)includeAllowableActions
-                      completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
+                                        major:(BOOL)major
+                                       filter:(NSString *)filter
+                                relationships:(CMISIncludeRelationship)relationships
+                             includePolicyIds:(BOOL)includePolicyIds
+                              renditionFilter:(NSString *)renditionFilter
+                                   includeACL:(BOOL)includeACL
+                      includeAllowableActions:(BOOL)includeAllowableActions
+                              completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
 {
     CMISRequest *request = [[CMISRequest alloc] init];
     [self retrieveObjectInternal:objectId
@@ -54,9 +54,9 @@
 }
 
 - (CMISRequest*)retrieveAllVersions:(NSString *)objectId
-                     filter:(NSString *)filter
-    includeAllowableActions:(BOOL)includeAllowableActions
-            completionBlock:(void (^)(NSArray *objects, NSError *error))completionBlock
+                             filter:(NSString *)filter
+            includeAllowableActions:(BOOL)includeAllowableActions
+                    completionBlock:(void (^)(NSArray *objects, NSError *error))completionBlock
 {
     // Validate params
     if (!objectId) {

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISDiscoveryService.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISDiscoveryService.h?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISDiscoveryService.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISDiscoveryService.h Fri Feb 22 10:05:52 2013
@@ -33,6 +33,7 @@
 */
 /** launches a query on the server with the parameters specified
  * completionBlock returns the found object list or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)query:(NSString *)statement searchAllVersions:(BOOL)searchAllVersions
                                                 relationships:(CMISIncludeRelationship)relationships

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISNavigationService.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISNavigationService.h?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISNavigationService.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISNavigationService.h Fri Feb 22 10:05:52 2013
@@ -29,6 +29,7 @@
 /**
  * Retrieves the children for the given object identifier.
  * completionBlock returns object list or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveChildren:(NSString *)objectId
                  orderBy:(NSString *)orderBy
@@ -47,6 +48,7 @@
  *
  * TODO: OpenCMIS returns an ObjectParentData object .... is this necessary?
  * completionBlock returns array of parents or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveParentsForObject:(NSString *)objectId
                           filter:(NSString *)filter

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISObjectService.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISObjectService.h?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISObjectService.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISObjectService.h Fri Feb 22 10:05:52 2013
@@ -29,6 +29,7 @@
 /**
  * Retrieves the object with the given object identifier.
  * completionBlock returns objectData for object or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveObject:(NSString *)objectId
                 filter:(NSString *)filter
@@ -42,6 +43,7 @@
 /**
  * Retrieves an object using its path.
  * completionBlock returns objectData for object or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveObjectByPath:(NSString *)path
                       filter:(NSString *)filter
@@ -56,6 +58,7 @@
  * Gets the content stream for the specified Document object, or gets a rendition stream for a specified
  * rendition of a document or folder object. Downloads the content to a local file.
  * completionBlock returns objectData for object or nil if unsuccessful
+ * @return cancellable request.
  *
  */
 - (CMISRequest*)downloadContentOfObject:(NSString *)objectId
@@ -68,6 +71,7 @@
  * Gets the content stream for the specified Document object, or gets a rendition stream for a specified
  * rendition of a document or folder object. Downloads the content to an output stream.
  * completionBlock returns objectData for object or nil if unsuccessful
+ * @return cancellable request.
  *
  */
 - (CMISRequest*)downloadContentOfObject:(NSString *)objectId
@@ -85,6 +89,7 @@
  * NOTE for atom pub binding: deleteContentStream: This does not return the new object id and change token as specified by the domain model.
  * This is not possible without introducing a new HTTP header.
  * completionBlock - returns NSError nil if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)deleteContentOfObject:(CMISStringInOutParameter *)objectIdParam
                   changeToken:(CMISStringInOutParameter *)changeTokenParam
@@ -101,6 +106,7 @@
  * NOTE for atom pub binding: This does not return the new object id and change token as specified by the domain model.
  * (This is not possible without introducing a new HTTP header).
  * completionBlock - returns NSError nil if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)changeContentOfObject:(CMISStringInOutParameter *)objectIdParam
                       toContentOfFile:(NSString *)filePath
@@ -121,6 +127,7 @@
  * NOTE for atom pub binding: This does not return the new object id and change token as specified by the domain model.
  * (This is not possible without introducing a new HTTP header).
  * completionBlock - returns NSError nil if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)changeContentOfObject:(CMISStringInOutParameter *)objectId
                toContentOfInputStream:(NSInputStream *)inputStream
@@ -136,6 +143,7 @@
  * uploads the file from the given path to the given folder.
  *
  * completionBlock - returns NSError nil if successful
+ * @return cancellable request.
 */
 - (CMISRequest*)createDocumentFromFilePath:(NSString *)filePath
                                   mimeType:(NSString *)mimeType
@@ -148,6 +156,7 @@
  * uploads the file from the given input stream to the given folder.
  *
  * completionBlock - returns NSError nil if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)createDocumentFromInputStream:(NSInputStream *)inputStream
                                      mimeType:(NSString *)mimeType
@@ -162,6 +171,7 @@
  *
  * The allVersions parameter is currently ignored.
  * completionBlock returns true if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)deleteObject:(NSString *)objectId
          allVersions:(BOOL)allVersions
@@ -180,6 +190,7 @@
  *
  * Returns a list of objects which failed to be deleted.
  * completionBlock returns array of failed objects if any. NSError will be nil if successful
+ * @return cancellable request.
  *
  */
 - (CMISRequest*)deleteTree:(NSString *)folderObjectId
@@ -191,6 +202,7 @@
 /**
  * Updates the properties of the given object.
  * completionBlock returns NSError nil if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)updatePropertiesForObject:(CMISStringInOutParameter *)objectIdParam
                                properties:(CMISProperties *)properties
@@ -204,6 +216,7 @@
  * Note: the paging parameters (maxItems and skipCount) are not used in the atom pub binding.
  *       Ie. the whole set is <b>always</b> returned.
  * completionBlock returns array of associated renditions or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveRenditions:(NSString *)objectId
                    renditionFilter:(NSString *)renditionFilter

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISRepositoryService.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISRepositoryService.h?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISRepositoryService.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISRepositoryService.h Fri Feb 22 10:05:52 2013
@@ -28,12 +28,14 @@
 /**
  * Returns an array of CMISRepositoryInfo objects representing the repositories available at the endpoint.
  * completionBlock returns array of repositories or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveRepositoriesWithCompletionBlock:(void (^)(NSArray *repositories, NSError *error))completionBlock;
 
 /**
  * Returns the repository info for the repository with the given id
  * completionBlock returns repository or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveRepositoryInfoForId:(NSString *)repositoryId
                     completionBlock:(void (^)(CMISRepositoryInfo *repositoryInfo, NSError *error))completionBlock;
@@ -41,6 +43,7 @@
 /**
  * Returns the type definitions
  * completionBlock returns type definition or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveTypeDefinition:(NSString *)typeId
                completionBlock:(void (^)(CMISTypeDefinition *typeDefinition, NSError *error))completionBlock;

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISVersioningService.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISVersioningService.h?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISVersioningService.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISVersioningService.h Fri Feb 22 10:05:52 2013
@@ -38,6 +38,7 @@
  * @param includeACL
  * @param includeAllowableActions
  * @param completionBlock returns object data if found or nil otherwise
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveObjectOfLatestVersion:(NSString *)objectId
                                 major:(BOOL)major
@@ -49,12 +50,13 @@
               includeAllowableActions:(BOOL)includeAllowableActions
                       completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock;
 
-/*
+/**
  * Returns the list of all Document Object in the given version series, sorted by creationDate descending (ie youngest first)
  * @param objectId
  * @param filter
  * @param includeAllowableActions
  * @param completionBlock returns array of all versioned objects or nil otherwise
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveAllVersions:(NSString *)objectId
                              filter:(NSString *)filter

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.h?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.h Fri Feb 22 10:05:52 2013
@@ -38,24 +38,28 @@
 /**
  * Retrieves a collection of all versions of this document. 
  * The completionBlock returns collection of all documents or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveAllVersionsWithCompletionBlock:(void (^)(CMISCollection *allVersionsOfDocument, NSError *error))completionBlock;
 
 /**
  * Retrieves a collection of all versions of this document with paging options.
  * The completionBlock returns collection of all documents or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveAllVersionsWithOperationContext:(CMISOperationContext *)operationContext completionBlock:(void (^)(CMISCollection *collection, NSError *error))completionBlock;
 
 /**
  * Retrieves the lastest version of this document.
  * The completionBlock returns the CMIS document or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveObjectOfLatestVersionWithMajorVersion:(BOOL)major completionBlock:(void (^)(CMISDocument *document, NSError *error))completionBlock;
 
 /**
  * Retrieves the lastest version of this document with paging options.
  * The completionBlock returns the CMIS document or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveObjectOfLatestVersionWithMajorVersion:(BOOL)major
                                      operationContext:(CMISOperationContext *)operationContext
@@ -64,6 +68,7 @@
 /**
  * Downloads the content to a local file and returns the filepath.
  * completionBlock will return NSError nil if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)downloadContentToFile:(NSString *)filePath
                       completionBlock:(void (^)(NSError *error))completionBlock
@@ -73,6 +78,7 @@
 /**
  * Downloads the content to an outputstream and returns the handle to the http request in order to allow cancellation.
  * completionBlock will return NSError nil if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)downloadContentToOutputStream:(NSOutputStream *)outputStream
                               completionBlock:(void (^)(NSError *error))completionBlock
@@ -85,6 +91,7 @@
  * object (if any) with the input contentStream. If FALSE, then the Repository MUST only set the input
  * contentStream for the object if the object currently does not have a content-stream.
  * completionBlock will return NSError nil if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)changeContentToContentOfFile:(NSString *)filePath
                                     mimeType:(NSString *)mimeType
@@ -99,6 +106,7 @@
  * object (if any) with the input contentStream. If FALSE, then the Repository MUST only set the input
  * contentStream for the object if the object currently does not have a content-stream.
  * completionBlock will return NSError nil if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)changeContentToContentOfInputStream:(NSInputStream *)inputStream
                                       bytesExpected:(unsigned long long)bytesExpected
@@ -111,12 +119,14 @@
 /**
  * Deletes the content of this document.
  * completionBlock will return NSError nil if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)deleteContentWithCompletionBlock:(void (^)(NSError *error))completionBlock;
 
 /**
  * Deletes the document from the document store.
  * completionBlock return true if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)deleteAllVersionsWithCompletionBlock:(void (^)(BOOL documentDeleted, NSError *error))completionBlock;
 

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.m?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISDocument.m Fri Feb 22 10:05:52 2013
@@ -127,8 +127,8 @@
 }
 
 - (CMISRequest*)retrieveObjectOfLatestVersionWithMajorVersion:(BOOL)major
-                                     operationContext:(CMISOperationContext *)operationContext
-                                      completionBlock:(void (^)(CMISDocument *document, NSError *error))completionBlock
+                                             operationContext:(CMISOperationContext *)operationContext
+                                              completionBlock:(void (^)(CMISDocument *document, NSError *error))completionBlock
 {
     return [self.binding.versioningService retrieveObjectOfLatestVersion:self.identifier
                                                                    major:major filter:operationContext.filterString

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISFolder.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISFolder.h?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISFolder.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISFolder.h Fri Feb 22 10:05:52 2013
@@ -33,6 +33,7 @@
  * Retrieves the children of this folder as a paged result.
  *
  * The completionBlock will return paged results with instances of CMISObject or nil if unsuccessful.
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveChildrenWithCompletionBlock:(void (^)(CMISPagedResult *result, NSError *error))completionBlock;
 
@@ -44,6 +45,7 @@
 /**
  * Gets the parent folder object.
  * The completionBlock will return CMISFolder object or nil if unsuccessful.
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveFolderParentWithCompletionBlock:(void (^)(CMISFolder *folder, NSError *error))completionBlock;
 
@@ -51,18 +53,21 @@
  * Retrieves the children of this folder as a paged result using the provided operation context.
  *
  * The completionBlock will return paged results with instances of CMISObject or nil if unsuccessful.
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveChildrenWithOperationContext:(CMISOperationContext *)operationContext completionBlock:(void (^)(CMISPagedResult *result, NSError *error))completionBlock;
 
 /**
  * creates a folder with specified properties
  * completionBlock returns object Id of newly created folder or nil if not successful
+ * @return cancellable request.
  */
 - (CMISRequest*)createFolder:(NSDictionary *)properties completionBlock:(void (^)(NSString *objectId, NSError *error))completionBlock;
 
 /**
  * creates a document with specified properties, mime Type
  * completionBlock returns object Id of newly created document or nil if not successful
+ * @return cancellable request.
  */
 - (CMISRequest*)createDocumentFromFilePath:(NSString *)filePath
                           mimeType:(NSString *)mimeType
@@ -73,6 +78,7 @@
 /**
  * creates a document with specified properties, mime Type
  * completionBlock returns object Id of newly created document or nil if not successful
+ * @return cancellable request.
  */
 - (CMISRequest*)createDocumentFromInputStream:(NSInputStream *)inputStream
                              mimeType:(NSString *)mimeType
@@ -85,6 +91,7 @@
 /**
  * creates a document with specified properties, mime Type
  * completionBlock returns list of failed objects (if any) 
+ * @return cancellable request.
  */
 - (CMISRequest*)deleteTreeWithDeleteAllVersions:(BOOL)deleteAllversions
                           unfileObjects:(CMISUnfileObject)unfileObjects

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISFolder.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISFolder.m?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISFolder.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISFolder.m Fri Feb 22 10:05:52 2013
@@ -134,10 +134,10 @@
 }
 
 - (CMISRequest*)createDocumentFromFilePath:(NSString *)filePath
-                          mimeType:(NSString *)mimeType
-                        properties:(NSDictionary *)properties
-                   completionBlock:(void (^)(NSString *objectId, NSError *error))completionBlock
-                     progressBlock:(void (^)(unsigned long long bytesUploaded, unsigned long long bytesTotal))progressBlock
+                                  mimeType:(NSString *)mimeType
+                                properties:(NSDictionary *)properties
+                           completionBlock:(void (^)(NSString *objectId, NSError *error))completionBlock
+                             progressBlock:(void (^)(unsigned long long bytesUploaded, unsigned long long bytesTotal))progressBlock
 {
     __block CMISRequest *request = [[CMISRequest alloc] init];
     [self.session.objectConverter convertProperties:properties
@@ -161,11 +161,11 @@
 }
 
 - (CMISRequest*)createDocumentFromInputStream:(NSInputStream *)inputStream
-                             mimeType:(NSString *)mimeType
-                           properties:(NSDictionary *)properties
-                        bytesExpected:(unsigned long long)bytesExpected
-                      completionBlock:(void (^)(NSString *objectId, NSError *error))completionBlock
-                        progressBlock:(void (^)(unsigned long long bytesUploaded, unsigned long long bytesTotal))progressBlock
+                                     mimeType:(NSString *)mimeType
+                                   properties:(NSDictionary *)properties
+                                bytesExpected:(unsigned long long)bytesExpected
+                              completionBlock:(void (^)(NSString *objectId, NSError *error))completionBlock
+                                progressBlock:(void (^)(unsigned long long bytesUploaded, unsigned long long bytesTotal))progressBlock
 {
     __block CMISRequest *request = [[CMISRequest alloc] init];
     [self.session.objectConverter convertProperties:properties forObjectTypeId:kCMISPropertyObjectTypeIdValueDocument completionBlock:^(CMISProperties *convertedProperties, NSError *error){

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISRendition.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISRendition.h?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISRendition.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISRendition.h Fri Feb 22 10:05:52 2013
@@ -23,7 +23,7 @@
 @class CMISDocument;
 @class CMISOperationContext;
 @class CMISSession;
-
+@class CMISRequest;
 
 @interface CMISRendition : CMISRenditionData
 
@@ -35,29 +35,33 @@
 /**
  * retrieves the rendition, e.g. thumbnail of a document
  * completionBlock returns the rendition object as CMIS document or nil if unsuccessful
+ * @return cancellable request.
  */
-- (void)retrieveRenditionDocumentWithCompletionBlock:(void (^)(CMISDocument *document, NSError *error))completionBlock;
+- (CMISRequest*)retrieveRenditionDocumentWithCompletionBlock:(void (^)(CMISDocument *document, NSError *error))completionBlock;
 
 /**
  * retrieves the rendition, e.g. thumbnail of a document
  * completionBlock returns the rendition object as CMIS document or nil if unsuccessful
+ * @return cancellable request.
  */
-- (void)retrieveRenditionDocumentWithOperationContext:(CMISOperationContext *)operationContext
+- (CMISRequest*)retrieveRenditionDocumentWithOperationContext:(CMISOperationContext *)operationContext
                                       completionBlock:(void (^)(CMISDocument *document, NSError *error))completionBlock;
 
 /**
  * downloads the rendition of a document e.g. thumbnail of a document to a file
  * completionBlock returns the rendition object as CMIS document or nil if unsuccessful
+ * @return cancellable request.
  */
-- (void)downloadRenditionContentToFile:(NSString *)filePath
+- (CMISRequest*)downloadRenditionContentToFile:(NSString *)filePath
                        completionBlock:(void (^)(NSError *error))completionBlock
                          progressBlock:(void (^)(unsigned long long bytesDownloaded, unsigned long long bytesTotal))progressBlock;
 
 /**
  * downloads the rendition of a document e.g. thumbnail of a document to a file
  * completionBlock returns the rendition object as CMIS document or nil if unsuccessful
+ * @return cancellable request.
  */
-- (void)downloadRenditionContentToOutputStream:(NSOutputStream *)outputStream
+- (CMISRequest*)downloadRenditionContentToOutputStream:(NSOutputStream *)outputStream
                                completionBlock:(void (^)(NSError *error))completionBlock
                                  progressBlock:(void (^)(unsigned long long bytesDownloaded, unsigned long long bytesTotal))progressBlock;
 

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISRendition.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISRendition.m?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISRendition.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISRendition.m Fri Feb 22 10:05:52 2013
@@ -21,6 +21,7 @@
 #import "CMISDocument.h"
 #import "CMISOperationContext.h"
 #import "CMISSession.h"
+#import "CMISRequest.h"
 
 @interface CMISRendition ()
 
@@ -42,21 +43,21 @@
     return self;
 }
 
-- (void)retrieveRenditionDocumentWithCompletionBlock:(void (^)(CMISDocument *document, NSError *error))completionBlock
+- (CMISRequest*)retrieveRenditionDocumentWithCompletionBlock:(void (^)(CMISDocument *document, NSError *error))completionBlock
 {
-    [self retrieveRenditionDocumentWithOperationContext:[CMISOperationContext defaultOperationContext] completionBlock:completionBlock];
+    return [self retrieveRenditionDocumentWithOperationContext:[CMISOperationContext defaultOperationContext] completionBlock:completionBlock];
 }
 
-- (void)retrieveRenditionDocumentWithOperationContext:(CMISOperationContext *)operationContext
+- (CMISRequest*)retrieveRenditionDocumentWithOperationContext:(CMISOperationContext *)operationContext
                                       completionBlock:(void (^)(CMISDocument *document, NSError *error))completionBlock
 {
     if (self.renditionDocumentId == nil) {
         log(@"Cannot retrieve rendition document: no renditionDocumentId was returned by the server.");
         completionBlock(nil, nil);
-        return;
+        return nil;
     }
 
-    [self.session retrieveObject:self.renditionDocumentId operationContext:operationContext completionBlock:^(CMISObject *renditionDocument, NSError *error) {
+    return [self.session retrieveObject:self.renditionDocumentId operationContext:operationContext completionBlock:^(CMISObject *renditionDocument, NSError *error) {
         if (renditionDocument != nil && !([[renditionDocument class] isKindOfClass:[CMISDocument class]])) {
             completionBlock(nil, nil);
             return;
@@ -66,36 +67,36 @@
     }];
 }
 
-- (void)downloadRenditionContentToFile:(NSString *)filePath
+- (CMISRequest*)downloadRenditionContentToFile:(NSString *)filePath
                        completionBlock:(void (^)(NSError *error))completionBlock
                          progressBlock:(void (^)(unsigned long long bytesDownloaded, unsigned long long bytesTotal))progressBlock
 {
     if (self.objectId == nil || self.streamId == nil) {
         log(@"Object id or stream id is nil. Both are needed when fetching the content of a rendition");
-        return;
+        return nil;
     }
 
-    [self.session.binding.objectService downloadContentOfObject:self.objectId
-                                                       streamId:self.streamId
-                                                         toFile:filePath
-                                                completionBlock:completionBlock
-                                                  progressBlock:progressBlock];
+    return [self.session.binding.objectService downloadContentOfObject:self.objectId
+                                                              streamId:self.streamId
+                                                                toFile:filePath
+                                                       completionBlock:completionBlock
+                                                         progressBlock:progressBlock];
 }
 
-- (void)downloadRenditionContentToOutputStream:(NSOutputStream *)outputStream
+- (CMISRequest*)downloadRenditionContentToOutputStream:(NSOutputStream *)outputStream
                                completionBlock:(void (^)(NSError *error))completionBlock
                                  progressBlock:(void (^)(unsigned long long bytesDownloaded, unsigned long long bytesTotal))progressBlock
 {
     if (self.objectId == nil || self.streamId == nil) {
         log(@"Object id or stream id is nil. Both are needed when fetching the content of a rendition");
-        return;
+        return nil;
     }
     
-    [self.session.binding.objectService downloadContentOfObject:self.objectId
-                                                       streamId:self.streamId
-                                                         toOutputStream:outputStream
-                                                completionBlock:completionBlock
-                                                  progressBlock:progressBlock];
+    return [self.session.binding.objectService downloadContentOfObject:self.objectId
+                                                              streamId:self.streamId
+                                                        toOutputStream:outputStream
+                                                       completionBlock:completionBlock
+                                                         progressBlock:progressBlock];
 }
 
 @end
\ No newline at end of file

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.h?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.h Fri Feb 22 10:05:52 2013
@@ -50,15 +50,17 @@
 // returns an array of CMISRepositoryInfo objects representing the repositories available at the endpoint.
 /**
  * completionBlock returns a list of repositories or nil if unsuccessful
+ * @return cancellable request if CMISSession can be created successfully, or nil otherwise.
  */
-+ (void)arrayOfRepositories:(CMISSessionParameters *)sessionParameters
++ (CMISRequest*)arrayOfRepositories:(CMISSessionParameters *)sessionParameters
             completionBlock:(void (^)(NSArray *repositories, NSError *error))completionBlock;
 
 
 /**
  * completionBlock returns a CMIS session or nil if unsuccessful
+ * @return cancellable request if CMISSession can be created successfully, or nil otherwise.
  */
-+ (void)connectWithSessionParameters:(CMISSessionParameters *)sessionParameters
++ (CMISRequest*)connectWithSessionParameters:(CMISSessionParameters *)sessionParameters
                      completionBlock:(void (^)(CMISSession *session, NSError * error))completionBlock;
 
 // *** CMIS operations ***
@@ -66,12 +68,14 @@
 /**
  * Retrieves the root folder for the repository.
  * completionBlock returns the root folder of the repo or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveRootFolderWithCompletionBlock:(void (^)(CMISFolder *folder, NSError *error))completionBlock;
 
 /**
  * Retrieves the root folder for the repository using the provided operation context.
  * completionBlock returns a folder of the repo or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveFolderWithOperationContext:(CMISOperationContext *)operationContext
                            completionBlock:(void (^)(CMISFolder *folder, NSError *error))completionBlock;
@@ -79,13 +83,15 @@
 /**
  * Retrieves the object with the given identifier.
  * completionBlock returns the CMIS object or nil if unsuccessful
-  */
+ * @return cancellable request.
+ */
 - (CMISRequest*)retrieveObject:(NSString *)objectId
        completionBlock:(void (^)(CMISObject *object, NSError *error))completionBlock;
 
 /**
   * Retrieves the object with the given identifier, using the provided operation context.
   * completionBlock returns the CMIS object or nil if unsuccessful
+ * @return cancellable request.
   */
 - (CMISRequest*)retrieveObject:(NSString *)objectId
       operationContext:(CMISOperationContext *)operationContext
@@ -94,6 +100,7 @@
 /**
  * Retrieves the object for the given path.
  * completionBlock returns the CMIS object or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveObjectByPath:(NSString *)path
              completionBlock:(void (^)(CMISObject *object, NSError *error))completionBlock;
@@ -102,6 +109,7 @@
 /**
  * Retrieves the object for the given path, using the provided operation context.
  * completionBlock returns the CMIS object or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveObjectByPath:(NSString *)path
             operationContext:(CMISOperationContext *)operationContext
@@ -110,12 +118,14 @@
 /**
  * Retrieves the definition for the given type.
  * completionBlock returns the CMIS type definition or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)retrieveTypeDefinition:(NSString *)typeId 
                completionBlock:(void (^)(CMISTypeDefinition *typeDefinition, NSError *error))completionBlock;
 /**
  * Retrieves all objects matching the given cmis query.
  * completionBlock returns the search results as a paged results object or nil if unsuccessful.
+ * @return cancellable request.
  */
 - (CMISRequest*)query:(NSString *)statement searchAllVersions:(BOOL)searchAllVersion
                                       completionBlock:(void (^)(CMISPagedResult *pagedResult, NSError *error))completionBlock;
@@ -124,6 +134,7 @@
  * Retrieves all objects matching the given cmis query, as CMISQueryResult objects.
  * and using the parameters provided in the operation context.
  * completionBlock returns the search results as a paged results object or nil if unsuccessful.
+ * @return cancellable request.
  */
 - (CMISRequest*)query:(NSString *)statement searchAllVersions:(BOOL)searchAllVersion
                                      operationContext:(CMISOperationContext *)operationContext
@@ -133,6 +144,7 @@
  * Queries for a specific type of objects.
  * Returns a paged result set, containing CMISObject instances.
  * completionBlock returns the search results as a paged results object or nil if unsuccessful.
+ * @return cancellable request.
  */
 - (CMISRequest*)queryObjectsWithTypeid:(NSString *)typeId
                    whereClause:(NSString *)whereClause
@@ -144,6 +156,7 @@
 /**
  * Creates a folder in the provided folder.
  * completionBlock returns the object Id of the newly created folder or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)createFolder:(NSDictionary *)properties
             inFolder:(NSString *)folderObjectId
@@ -153,6 +166,7 @@
 /**
  * Downloads the content of object with the provided object id to the given path.
  * completionBlock NSError will be nil if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)downloadContentOfCMISObject:(NSString *)objectId
                                      toFile:(NSString *)filePath
@@ -162,6 +176,7 @@
 /**
  * Downloads the content of object with the provided object id to the given stream.
  * completionBlock NSError will be nil if successful
+ * @return cancellable request.
  */
 - (CMISRequest*)downloadContentOfCMISObject:(NSString *)objectId
                              toOutputStream:(NSOutputStream*)outputStream
@@ -171,6 +186,7 @@
 /**
  * Creates a cmis document using the content from the file path.
  * completionBlock returns object Id of newly created object or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)createDocumentFromFilePath:(NSString *)filePath
                           mimeType:(NSString *)mimeType
@@ -182,6 +198,7 @@
 /**
  * Creates a cmis document using the content from the given stream.
  * completionBlock returns object Id of newly created object or nil if unsuccessful
+ * @return cancellable request.
  */
 - (CMISRequest*)createDocumentFromInputStream:(NSInputStream *)inputStream
                              mimeType:(NSString *)mimeType

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.m?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.m Fri Feb 22 10:05:52 2013
@@ -41,7 +41,7 @@
 - (id)initWithSessionParameters:(CMISSessionParameters *)sessionParameters;
 
 // Authenticates using the CMISSessionParameters and returns if the authentication was succesful
-- (void)authenticateWithCompletionBlock:(void (^)(CMISSession *session, NSError * error))completionBlock;
+- (CMISRequest*)authenticateWithCompletionBlock:(void (^)(CMISSession *session, NSError * error))completionBlock;
 @end
 
 @interface CMISSession (PrivateMethods)
@@ -53,25 +53,26 @@
 #pragma mark -
 #pragma mark Setup
 
-+ (void)arrayOfRepositories:(CMISSessionParameters *)sessionParameters completionBlock:(void (^)(NSArray *repositories, NSError *error))completionBlock
++ (CMISRequest*)arrayOfRepositories:(CMISSessionParameters *)sessionParameters completionBlock:(void (^)(NSArray *repositories, NSError *error))completionBlock
 {
     CMISSession *session = [[CMISSession alloc] initWithSessionParameters:sessionParameters];
     
     // TODO: validate session parameters?
     
     // return list of repositories
-    [session.binding.repositoryService retrieveRepositoriesWithCompletionBlock:completionBlock];
+    return [session.binding.repositoryService retrieveRepositoriesWithCompletionBlock:completionBlock];
 }
 
-+ (void)connectWithSessionParameters:(CMISSessionParameters *)sessionParameters
++ (CMISRequest*)connectWithSessionParameters:(CMISSessionParameters *)sessionParameters
                      completionBlock:(void (^)(CMISSession *session, NSError * error))completionBlock
 {
     CMISSession *session = [[CMISSession alloc] initWithSessionParameters:sessionParameters];
     if (session) {
-        [session authenticateWithCompletionBlock:completionBlock];
+        return [session authenticateWithCompletionBlock:completionBlock];
     } else {
         completionBlock(nil, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeInvalidArgument
                                              detailedDescription:@"Not enough session parameters to connect"]);
+        return nil;
     }
 }
 
@@ -122,7 +123,7 @@
     return self;
 }
 
-- (void)authenticateWithCompletionBlock:(void (^)(CMISSession *session, NSError * error))completionBlock
+- (CMISRequest*)authenticateWithCompletionBlock:(void (^)(CMISSession *session, NSError * error))completionBlock
 {
     // TODO: validate session parameters, extract the checks below?
     
@@ -132,20 +133,20 @@
                                          detailedDescription:@"Must provide repository id"];
         log(@"Error: %@", error.description);
         completionBlock(nil, error);
-        return;
+        return nil;
     }
     
     if (self.sessionParameters.authenticationProvider == nil) {
         NSError *error = [CMISErrors createCMISErrorWithCode:kCMISErrorCodeUnauthorized detailedDescription:@"Must provide authentication provider"];
         log(@"Error: %@", error.description);
         completionBlock(nil, error);
-        return;
+        return nil;
     }
     
     // TODO: use authentication provider to make sure we have enough credentials, it may need to make another call to get a ticket or do handshake i.e. NTLM.
     
     // get repository info
-    [self.binding.repositoryService retrieveRepositoryInfoForId:self.sessionParameters.repositoryId completionBlock:^(CMISRepositoryInfo *repositoryInfo, NSError *error) {
+    return [self.binding.repositoryService retrieveRepositoryInfoForId:self.sessionParameters.repositoryId completionBlock:^(CMISRepositoryInfo *repositoryInfo, NSError *error) {
         self.repositoryInfo = repositoryInfo;
         if (self.repositoryInfo == nil) {
             if (error) {

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISHttpDownloadRequest.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISHttpDownloadRequest.m?rev=1448972&r1=1448971&r2=1448972&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISHttpDownloadRequest.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISHttpDownloadRequest.m Fri Feb 22 10:05:52 2013
@@ -40,7 +40,7 @@
                            bytesExpected:(unsigned long long)bytesExpected
                   authenticationProvider:(id<CMISAuthenticationProvider>) authenticationProvider
                          completionBlock:(void (^)(CMISHttpResponse *httpResponse, NSError *error))completionBlock
-                           progressBlock:(void (^)(unsigned long long bytesDownloaded, unsigned long long bytesTotal))progressBlock;
+                           progressBlock:(void (^)(unsigned long long bytesDownloaded, unsigned long long bytesTotal))progressBlock
 {
     CMISHttpDownloadRequest *httpRequest = [[self alloc] initWithHttpMethod:httpRequestMethod
                                                             completionBlock:completionBlock