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/20 14:19:00 UTC
svn commit: r1448154 [1/3] - in /chemistry/objectivecmis/trunk:
ObjectiveCMIS.xcodeproj/ ObjectiveCMIS/Bindings/
ObjectiveCMIS/Bindings/AtomPub/
ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/ ObjectiveCMIS/Client/
ObjectiveCMIS/Common/ ObjectiveCMIS/Uti...
Author: pweschmidt
Date: Wed Feb 20 13:18:59 2013
New Revision: 1448154
URL: http://svn.apache.org/r1448154
Log:
continued clean-up of ObjectiveCMIS library: a.) relating to parameters (relationships instead of relationShips) and ordering of arguments in some method calls (making sure block parameters come last) b.) CMISRequest objects returned from most network request calls - i.e. all invoke methods accept a CMISRequest object as parameter and set the httpRequest property to the request that was created.
Modified:
chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.pbxproj
chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryWriter.m
chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.m
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/CMISAtomPubNavigationService.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/AtomPub/CMISObjectByIdUriBuilder.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByIdUriBuilder.m
chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByPathUriBuilder.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByPathUriBuilder.m
chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISQueryAtomEntryWriter.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISQueryAtomEntryWriter.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/CMISFileableObject.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISFileableObject.m
chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISFolder.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISFolder.m
chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISOperationContext.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISOperationContext.m
chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISRequest.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISRequest.m
chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Client/CMISSession.m
chemistry/objectivecmis/trunk/ObjectiveCMIS/Common/CMISNetworkProvider.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISBase64Encoder.m
chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISDateUtil.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISDefaultNetworkProvider.m
chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISFileUtil.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISFileUtil.m
chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISHttpDownloadRequest.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISHttpDownloadRequest.m
chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISHttpRequest.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISHttpRequest.m
chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISHttpResponse.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISHttpUploadRequest.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISHttpUploadRequest.m
chemistry/objectivecmis/trunk/ObjectiveCMISTests/ObjectiveCMISTests.m
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.pbxproj
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.pbxproj?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.pbxproj (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.pbxproj Wed Feb 20 13:18:59 2013
@@ -30,6 +30,7 @@
4E3C32A816C4EF190099B21E /* CMISAtomPubVersioningService.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E3C32A616C4EF190099B21E /* CMISAtomPubVersioningService.h */; settings = {ATTRIBUTES = (Public, ); }; };
4E3C32A916C4EF190099B21E /* CMISAtomPubVersioningService.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E3C32A716C4EF190099B21E /* CMISAtomPubVersioningService.m */; };
4E3E14B316AFFB190057CE22 /* CMISNetworkProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E3E14B116AFFB190057CE22 /* CMISNetworkProvider.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4E9CE52F16D50083004C7934 /* CMISLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E9CE52E16D50083004C7934 /* CMISLog.h */; };
4EA61BD71564F70C00C759E4 /* CMISStringInOutParameter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4EA61BD31564F70C00C759E4 /* CMISStringInOutParameter.h */; settings = {ATTRIBUTES = (Public, ); }; };
4EA61BD81564F70C00C759E4 /* CMISStringInOutParameter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EA61BD41564F70C00C759E4 /* CMISStringInOutParameter.m */; };
4EA61BD91564F70C00C759E4 /* CMISStringInOutParameter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EA61BD41564F70C00C759E4 /* CMISStringInOutParameter.m */; };
@@ -221,6 +222,7 @@
4E3C32A616C4EF190099B21E /* CMISAtomPubVersioningService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CMISAtomPubVersioningService.h; sourceTree = "<group>"; };
4E3C32A716C4EF190099B21E /* CMISAtomPubVersioningService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CMISAtomPubVersioningService.m; sourceTree = "<group>"; };
4E3E14B116AFFB190057CE22 /* CMISNetworkProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CMISNetworkProvider.h; path = Common/CMISNetworkProvider.h; sourceTree = "<group>"; };
+ 4E9CE52E16D50083004C7934 /* CMISLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CMISLog.h; path = Utils/CMISLog.h; sourceTree = "<group>"; };
4EA61BD31564F70C00C759E4 /* CMISStringInOutParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CMISStringInOutParameter.h; path = Utils/CMISStringInOutParameter.h; sourceTree = "<group>"; };
4EA61BD41564F70C00C759E4 /* CMISStringInOutParameter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CMISStringInOutParameter.m; path = Utils/CMISStringInOutParameter.m; sourceTree = "<group>"; };
4EA61BD51564F70C00C759E4 /* CMISURLUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CMISURLUtil.h; path = Utils/CMISURLUtil.h; sourceTree = "<group>"; };
@@ -614,6 +616,7 @@
828072D615153F1300EF635C /* Utils */ = {
isa = PBXGroup;
children = (
+ 4E9CE52E16D50083004C7934 /* CMISLog.h */,
8276E129155E355D00344A29 /* CMISBase64Encoder.h */,
8276E12A155E355D00344A29 /* CMISBase64Encoder.m */,
4E39DF5A163A72B400F21DE6 /* CMISDateUtil.h */,
@@ -793,6 +796,7 @@
4E10ABFF16B916B500E2287E /* CMISDefaultNetworkProvider.h in Headers */,
4E3C32A816C4EF190099B21E /* CMISAtomPubVersioningService.h in Headers */,
BD30D33D162D7DD7001FFF80 /* CMISRequest.h in Headers */,
+ 4E9CE52F16D50083004C7934 /* CMISLog.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryWriter.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryWriter.m?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryWriter.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryWriter.m Wed Feb 20 13:18:59 2013
@@ -337,7 +337,7 @@
}
}
else {
- [FileUtil appendToFileAtPath:self.internalFilePath data:[string dataUsingEncoding:NSUTF8StringEncoding]];
+ [CMISFileUtil appendToFileAtPath:self.internalFilePath data:[string dataUsingEncoding:NSUTF8StringEncoding]];
}
}
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.h?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.h Wed Feb 20 13:18:59 2013
@@ -186,3 +186,9 @@ extern NSString * const kCMISUriTemplate
extern NSString * const kCMISAtomLinkAttrHref;
extern NSString * const kCMISAtomLinkAttrType;
extern NSString * const kCMISAtomLinkAttrRel;
+
+// Constants for HTTP request headers
+extern NSString * const kCMISHTTPHeaderContentType;
+extern NSString * const kCMISHTTPHeaderContentDisposition;
+extern NSString * const kCMISHTTPHeaderContentDispositionAttachment;
+
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.m?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.m Wed Feb 20 13:18:59 2013
@@ -184,3 +184,8 @@ NSString * const kCMISUriTemplateQuery =
NSString * const kCMISAtomLinkAttrHref = @"href";
NSString * const kCMISAtomLinkAttrType = @"type";
NSString * const kCMISAtomLinkAttrRel = @"rel";
+
+// Constants for HTTP request headers
+NSString * const kCMISHTTPHeaderContentType = @"Content-Type";
+NSString * const kCMISHTTPHeaderContentDisposition = @"Content-Disposition";
+NSString * const kCMISHTTPHeaderContentDispositionAttachment = @"attachment; filename=%@";
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=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService+Protected.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService+Protected.h Wed Feb 20 13:18:59 2013
@@ -25,12 +25,30 @@
@interface CMISAtomPubBaseService (Protected)
-- (void)fetchRepositoryInfoWithCompletionBlock:(void (^)(NSError *error))completionBlock;
+/** retrieve object from cache
+ * completionBlock returns the object (as id) or nil if unsuccessul
+ */
+- (void)retrieveFromCache:(NSString *)cacheKey
+ cmisRequest:(CMISRequest *)cmisRequest
+ completionBlock:(void (^)(id object, NSError *error))completionBlock;
+
+/**
+ fetches the repo info
+ */
+- (void)fetchRepositoryInfoWithCancellableRequest:(CMISRequest *)cmisRequest
+ completionBlock:(void (^)(NSError *error))completionBlock;
+
+/**
+ retrieves the CMIS workspace
+ */
+- (void)retrieveCMISWorkspacesWithCancellableRequest:(CMISRequest *)cmisRequest
+ completionBlock:(void (^)(NSArray *workspaces, NSError *error))completionBlock;
-- (void)retrieveCMISWorkspacesWithCompletionBlock:(void (^)(NSArray *workspaces, NSError *error))completionBlock;
/** Convenience method with all the defaults for the retrieval parameters */
-- (void)retrieveObjectInternal:(NSString *)objectId completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock;
+- (void)retrieveObjectInternal:(NSString *)objectId
+ cmisRequest:(CMISRequest *)cmisRequest
+ completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock;
/** Full-blown object retrieval version
* completionBlock returns CMISObjectData instance or nil if unsuccessul
@@ -38,11 +56,12 @@
- (void)retrieveObjectInternal:(NSString *)objectId
returnVersion:(CMISReturnVersion)cmisReturnVersion
filter:(NSString *)filter
- relationShips:(CMISIncludeRelationship)includeRelationship
+ relationships:(CMISIncludeRelationship)relationships
includePolicyIds:(BOOL)includePolicyIds
renditionFilder:(NSString *)renditionFilter
includeACL:(BOOL)includeACL
includeAllowableActions:(BOOL)includeAllowableActions
+ cmisRequest:(CMISRequest *)cmisRequest
completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock;
/** retrieve object for a given path name
@@ -50,23 +69,20 @@
*/
- (void)retrieveObjectByPathInternal:(NSString *)path
filter:(NSString *)filter
- relationShips:(CMISIncludeRelationship)includeRelationship
+ relationships:(CMISIncludeRelationship)relationships
includePolicyIds:(BOOL)includePolicyIds
renditionFilder:(NSString *)renditionFilter
includeACL:(BOOL)includeACL
includeAllowableActions:(BOOL)includeAllowableActions
+ cmisRequest:(CMISRequest *)cmisRequest
completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock;
-/** retrieve object from cache
- * completionBlock returns the object (as id) or nil if unsuccessul
- */
-- (void)retrieveFromCache:(NSString *)cacheKey
- completionBlock:(void (^)(id object, NSError *error))completionBlock;
///load the link for a given object Id
///completionBlock returns the link as NSString or nil if unsuccessful
- (void)loadLinkForObjectId:(NSString *)objectId
relation:(NSString *)rel
+ cmisRequest:(CMISRequest *)cmisRequest
completionBlock:(void (^)(NSString *link, NSError *error))completionBlock;
///load the link for a given object Id
@@ -74,6 +90,7 @@
- (void)loadLinkForObjectId:(NSString *)objectId
relation:(NSString *)rel
type:(NSString *)type
+ cmisRequest:(CMISRequest *)cmisRequest
completionBlock:(void (^)(NSString *link, NSError *error))completionBlock;
@end
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService.m?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubBaseService.m Wed Feb 20 13:18:59 2013
@@ -53,15 +53,18 @@
#pragma mark -
#pragma mark Protected methods
-- (void)retrieveFromCache:(NSString *)cacheKey completionBlock:(void (^)(id object, NSError *error))completionBlock
+- (void)retrieveFromCache:(NSString *)cacheKey
+ cmisRequest:(CMISRequest *)cmisRequest
+ completionBlock:(void (^)(id object, NSError *error))completionBlock
{
id object = [self.bindingSession objectForKey:cacheKey];
if (object) {
completionBlock(object, nil);
+ return;
} else {
// if object is nil, first populate cache
- [self fetchRepositoryInfoWithCompletionBlock:^(NSError *error) {
+ [self fetchRepositoryInfoWithCancellableRequest:cmisRequest completionBlock:^(NSError *error) {
id object = [self.bindingSession objectForKey:cacheKey];
if (!object && !error) {
// TODO: proper error initialisation
@@ -69,13 +72,14 @@
log(@"Could not get object from cache with key '%@'", cacheKey);
}
completionBlock(object, error);
- }];
+ }];
}
}
-- (void)fetchRepositoryInfoWithCompletionBlock:(void (^)(NSError *error))completionBlock
+- (void)fetchRepositoryInfoWithCancellableRequest:(CMISRequest *)cmisRequest
+ completionBlock:(void (^)(NSError *error))completionBlock
{
- [self retrieveCMISWorkspacesWithCompletionBlock:^(NSArray *cmisWorkSpaces, NSError *error) {
+ [self retrieveCMISWorkspacesWithCancellableRequest:cmisRequest completionBlock:^(NSArray *cmisWorkSpaces, NSError *error) {
if (!error) {
BOOL repositoryFound = NO;
for (CMISWorkspace *workspace in cmisWorkSpaces) {
@@ -98,7 +102,7 @@
[self.bindingSession setObject:typeByIdUriBuilder forKey:kCMISBindingSessionKeyTypeByIdUriBuilder];
[self.bindingSession setObject:workspace.queryUriTemplate forKey:kCMISBindingSessionKeyQueryUri];
-
+
break;
}
}
@@ -114,78 +118,87 @@
}];
}
-- (void)retrieveCMISWorkspacesWithCompletionBlock:(void (^)(NSArray *workspaces, NSError *error))completionBlock
+- (void)retrieveCMISWorkspacesWithCancellableRequest:(CMISRequest *)cmisRequest
+ completionBlock:(void (^)(NSArray *workspaces, NSError *error))completionBlock
{
if ([self.bindingSession objectForKey:kCMISSessionKeyWorkspaces]) {
completionBlock([self.bindingSession objectForKey:kCMISSessionKeyWorkspaces], nil);
} else {
[self.bindingSession.networkProvider invokeGET:self.atomPubUrl
- session:self.bindingSession
- completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
- if (httpResponse) {
- NSData *data = httpResponse.data;
- // Uncomment to see the service document
- // NSString *dataString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- // log(@"Service document: %@", dataString);
-
- // Parse the cmis service document
- if (data) {
- CMISServiceDocumentParser *parser = [[CMISServiceDocumentParser alloc] initWithData:data];
- NSError *error = nil;
- if ([parser parseAndReturnError:&error]) {
- [self.bindingSession setObject:parser.workspaces forKey:kCMISSessionKeyWorkspaces];
- } else {
- log(@"Error while parsing service document: %@", error.description);
- }
- completionBlock(parser.workspaces, error);
- }
- } else {
- completionBlock(nil, error);
- }
- }];
+ session:self.bindingSession
+ cmisRequest:cmisRequest
+ completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
+ if (httpResponse) {
+ NSData *data = httpResponse.data;
+ // Uncomment to see the service document
+ // NSString *dataString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+ // log(@"Service document: %@", dataString);
+
+ // Parse the cmis service document
+ if (data) {
+ CMISServiceDocumentParser *parser = [[CMISServiceDocumentParser alloc] initWithData:data];
+ NSError *error = nil;
+ if ([parser parseAndReturnError:&error]) {
+ [self.bindingSession setObject:parser.workspaces forKey:kCMISSessionKeyWorkspaces];
+ } else {
+ log(@"Error while parsing service document: %@", error.description);
+ }
+ completionBlock(parser.workspaces, error);
+ }
+ } else {
+ completionBlock(nil, error);
+ }
+ }];
}
}
-- (void)retrieveObjectInternal:(NSString *)objectId completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
+- (void)retrieveObjectInternal:(NSString *)objectId
+ cmisRequest:(CMISRequest *)cmisRequest
+ completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
{
- [self retrieveObjectInternal:objectId
- returnVersion:NOT_PROVIDED
- filter:@""
- relationShips:CMISIncludeRelationshipNone
- includePolicyIds:NO
- renditionFilder:nil
- includeACL:NO
- includeAllowableActions:YES
- completionBlock:completionBlock];
+ return [self retrieveObjectInternal:objectId
+ returnVersion:NOT_PROVIDED
+ filter:@""
+ relationships:CMISIncludeRelationshipNone
+ includePolicyIds:NO
+ renditionFilder:nil
+ includeACL:NO
+ includeAllowableActions:YES
+ cmisRequest:cmisRequest
+ completionBlock:completionBlock];
}
- (void)retrieveObjectInternal:(NSString *)objectId
returnVersion:(CMISReturnVersion)returnVersion
filter:(NSString *)filter
- relationShips:(CMISIncludeRelationship)includeRelationship
+ relationships:(CMISIncludeRelationship)relationships
includePolicyIds:(BOOL)includePolicyIds
renditionFilder:(NSString *)renditionFilter
includeACL:(BOOL)includeACL
includeAllowableActions:(BOOL)includeAllowableActions
+ cmisRequest:(CMISRequest *)cmisRequest
completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
{
- [self retrieveFromCache:kCMISBindingSessionKeyObjectByIdUriBuilder completionBlock:^(id object, NSError *error) {
+ [self retrieveFromCache:kCMISBindingSessionKeyObjectByIdUriBuilder
+ cmisRequest:cmisRequest
+ completionBlock:^(id object, NSError *error) {
CMISObjectByIdUriBuilder *objectByIdUriBuilder = object;
objectByIdUriBuilder.objectId = objectId;
objectByIdUriBuilder.filter = filter;
objectByIdUriBuilder.includeACL = includeACL;
objectByIdUriBuilder.includeAllowableActions = includeAllowableActions;
objectByIdUriBuilder.includePolicyIds = includePolicyIds;
- objectByIdUriBuilder.includeRelationships = includeRelationship;
+ objectByIdUriBuilder.relationships = relationships;
objectByIdUriBuilder.renditionFilter = renditionFilter;
objectByIdUriBuilder.returnVersion = returnVersion;
NSURL *objectIdUrl = [objectByIdUriBuilder buildUrl];
// Execute actual call
[self.bindingSession.networkProvider invokeGET:objectIdUrl
- session:self.bindingSession
- completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
+ session:self.bindingSession
+ cmisRequest:cmisRequest
+ completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
if (httpResponse) {
if (httpResponse.statusCode == 200 && httpResponse.data) {
CMISObjectData *objectData = nil;
@@ -209,27 +222,31 @@
- (void)retrieveObjectByPathInternal:(NSString *)path
filter:(NSString *)filter
- relationShips:(CMISIncludeRelationship)includeRelationship
+ relationships:(CMISIncludeRelationship)relationships
includePolicyIds:(BOOL)includePolicyIds
renditionFilder:(NSString *)renditionFilter
includeACL:(BOOL)includeACL
includeAllowableActions:(BOOL)includeAllowableActions
+ cmisRequest:(CMISRequest *)cmisRequest
completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
{
- [self retrieveFromCache:kCMISBindingSessionKeyObjectByPathUriBuilder completionBlock:^(id object, NSError *error) {
+ [self retrieveFromCache:kCMISBindingSessionKeyObjectByPathUriBuilder
+ cmisRequest:cmisRequest
+ completionBlock:^(id object, NSError *error) {
CMISObjectByPathUriBuilder *objectByPathUriBuilder = object;
objectByPathUriBuilder.path = path;
objectByPathUriBuilder.filter = filter;
objectByPathUriBuilder.includeACL = includeACL;
objectByPathUriBuilder.includeAllowableActions = includeAllowableActions;
objectByPathUriBuilder.includePolicyIds = includePolicyIds;
- objectByPathUriBuilder.includeRelationships = includeRelationship;
+ objectByPathUriBuilder.relationships = relationships;
objectByPathUriBuilder.renditionFilter = renditionFilter;
// Execute actual call
[self.bindingSession.networkProvider invokeGET:[objectByPathUriBuilder buildUrl]
- session:self.bindingSession
- completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
+ session:self.bindingSession
+ cmisRequest:cmisRequest
+ completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
if (httpResponse) {
if (httpResponse.statusCode == 200 && httpResponse.data != nil) {
CMISObjectData *objectData = nil;
@@ -271,15 +288,16 @@
- (void)loadLinkForObjectId:(NSString *)objectId
relation:(NSString *)rel
+ cmisRequest:(CMISRequest *)cmisRequest
completionBlock:(void (^)(NSString *link, NSError *error))completionBlock
{
- [self loadLinkForObjectId:objectId relation:rel type:nil completionBlock:completionBlock];
+ [self loadLinkForObjectId:objectId relation:rel type:nil cmisRequest:cmisRequest completionBlock:completionBlock];
}
-
- (void)loadLinkForObjectId:(NSString *)objectId
relation:(NSString *)rel
type:(NSString *)type
+ cmisRequest:(CMISRequest *)cmisRequest
completionBlock:(void (^)(NSString *link, NSError *error))completionBlock
{
CMISLinkCache *linkCache = [self linkCache];
@@ -288,9 +306,12 @@
NSString *link = [linkCache linkForObjectId:objectId relation:rel type:type];
if (link) {
completionBlock(link, nil);
+ return;///shall we return nil here
} else {
// Fetch object, which will trigger the caching of the links
- [self retrieveObjectInternal:objectId completionBlock:^(CMISObjectData *objectData, NSError *error) {
+ [self retrieveObjectInternal:objectId
+ cmisRequest:cmisRequest
+ completionBlock:^(CMISObjectData *objectData, NSError *error) {
if (error) {
log(@"Could not retrieve object with id %@", objectId);
completionBlock(nil, [CMISErrors cmisError:error cmisErrorCode:kCMISErrorCodeObjectNotFound]);
@@ -298,7 +319,7 @@
NSString *link = [linkCache linkForObjectId:objectId relation:rel type:type];
if (link == nil) {
completionBlock(nil, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeObjectNotFound
- detailedDescription:[NSString stringWithFormat:@"Could not find link '%@' for object with id %@", rel, objectId]]);
+ detailedDescription:[NSString stringWithFormat:@"Could not find link '%@' for object with id %@", rel, objectId]]);
} else {
completionBlock(link, nil);
}
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubDiscoveryService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubDiscoveryService.m?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubDiscoveryService.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubDiscoveryService.m Wed Feb 20 13:18:59 2013
@@ -27,9 +27,8 @@
@implementation CMISAtomPubDiscoveryService
-
-- (void)query:(NSString *)statement searchAllVersions:(BOOL)searchAllVersions
- relationShips:(CMISIncludeRelationship)includeRelationships
+- (CMISRequest*)query:(NSString *)statement searchAllVersions:(BOOL)searchAllVersions
+ relationships:(CMISIncludeRelationship)relationships
renditionFilter:(NSString *)renditionFilter
includeAllowableActions:(BOOL)includeAllowableActions
maxItems:(NSNumber *)maxItems
@@ -40,7 +39,7 @@
if (statement == nil) {
log(@"Must provide 'statement' parameter when executing a cmis query");
completionBlock(nil, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeInvalidArgument detailedDescription:nil]);
- return;
+ return nil;
}
// Validate query uri
@@ -48,7 +47,7 @@
if (queryUrlString == nil) {
log(@"Unknown repository or query not supported!");
completionBlock(nil, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeObjectNotFound detailedDescription:nil]);
- return;
+ return nil;
}
NSURL *queryURL = [NSURL URLWithString:queryUrlString];
@@ -57,17 +56,19 @@
atomEntryWriter.statement = statement;
atomEntryWriter.searchAllVersions = searchAllVersions;
atomEntryWriter.includeAllowableActions = includeAllowableActions;
- atomEntryWriter.includeRelationships = includeRelationships;
+ atomEntryWriter.relationships = relationships;
atomEntryWriter.renditionFilter = renditionFilter;
atomEntryWriter.maxItems = maxItems;
atomEntryWriter.skipCount = skipCount;
+ CMISRequest *request = [[CMISRequest alloc] init];
// Execute HTTP call
[self.bindingSession.networkProvider invokePOST:queryURL
- session:self.bindingSession
- body:[[atomEntryWriter generateAtomEntryXML] dataUsingEncoding:NSUTF8StringEncoding]
- headers:[NSDictionary dictionaryWithObject:kCMISMediaTypeQuery forKey:@"Content-type"]
- completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
+ session:self.bindingSession
+ body:[[atomEntryWriter generateAtomEntryXML] dataUsingEncoding:NSUTF8StringEncoding]
+ headers:[NSDictionary dictionaryWithObject:kCMISMediaTypeQuery forKey:@"Content-type"]
+ cmisRequest:request
+ completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
if (httpResponse) {
CMISAtomFeedParser *feedParser = [[CMISAtomFeedParser alloc] initWithData:httpResponse.data];
NSError *error = nil;
@@ -85,7 +86,8 @@
} else {
completionBlock(nil, [CMISErrors cmisError:error cmisErrorCode:kCMISErrorCodeConnection]);
}
- }];
+ } ];
+ return request;
}
@end
\ No newline at end of file
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubNavigationService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubNavigationService.m?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubNavigationService.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubNavigationService.m Wed Feb 20 13:18:59 2013
@@ -28,10 +28,10 @@
@implementation CMISAtomPubNavigationService
-- (void)retrieveChildren:(NSString *)objectId
+- (CMISRequest*)retrieveChildren:(NSString *)objectId
orderBy:(NSString *)orderBy
filter:(NSString *)filter
- relationShips:(CMISIncludeRelationship)includeRelationship
+ relationships:(CMISIncludeRelationship)relationships
renditionFilter:(NSString *)renditionFilter
includeAllowableActions:(BOOL)includeAllowableActions
includePathSegment:(BOOL)includePathSegment
@@ -40,8 +40,12 @@
completionBlock:(void (^)(CMISObjectList *objectList, NSError *error))completionBlock
{
// Get Down link
- [self loadLinkForObjectId:objectId relation:kCMISLinkRelationDown
- type:kCMISMediaTypeChildren completionBlock:^(NSString *downLink, NSError *error) {
+ CMISRequest *request = [[CMISRequest alloc] init];
+ [self loadLinkForObjectId:objectId
+ relation:kCMISLinkRelationDown
+ type:kCMISMediaTypeChildren
+ cmisRequest:request
+ completionBlock:^(NSString *downLink, NSError *error) {
if (error) {
log(@"Could not retrieve down link: %@", error.description);
completionBlock(nil, error);
@@ -52,7 +56,7 @@
downLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterFilter value:filter urlString:downLink];
downLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterOrderBy value:orderBy urlString:downLink];
downLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeAllowableActions value:(includeAllowableActions ? @"true" : @"false") urlString:downLink];
- downLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeRelationships value:[CMISEnums stringForIncludeRelationShip:includeRelationship] urlString:downLink];
+ downLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeRelationships value:[CMISEnums stringForIncludeRelationShip:relationships] urlString:downLink];
downLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterRenditionFilter value:renditionFilter urlString:downLink];
downLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludePathSegment value:(includePathSegment ? @"true" : @"false") urlString:downLink];
downLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterMaxItems value:[maxItems stringValue] urlString:downLink];
@@ -61,6 +65,7 @@
// execute the request
[self.bindingSession.networkProvider invokeGET:[NSURL URLWithString:downLink]
session:self.bindingSession
+ cmisRequest:request
completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
if (httpResponse) {
if (httpResponse.data == nil) {
@@ -90,19 +95,22 @@
}
}];
}];
+ return request;
}
-- (void)retrieveParentsForObject:(NSString *)objectId
+- (CMISRequest*)retrieveParentsForObject:(NSString *)objectId
filter:(NSString *)filter
- relationships:(CMISIncludeRelationship)includeRelationship
+ relationships:(CMISIncludeRelationship)relationships
renditionFilter:(NSString *)renditionFilter
includeAllowableActions:(BOOL)includeAllowableActions
includeRelativePathSegment:(BOOL)includeRelativePathSegment
completionBlock:(void (^)(NSArray *parents, NSError *error))completionBlock
{
// Get up link
+ CMISRequest *request = [[CMISRequest alloc] init];
[self loadLinkForObjectId:objectId
relation:kCMISLinkRelationUp
+ cmisRequest:request
completionBlock:^(NSString *upLink, NSError *error) {
if (upLink == nil) {
log(@"Failing because the NSString upLink is nil");
@@ -115,7 +123,7 @@
upLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterFilter value:filter urlString:upLink];
}
upLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeAllowableActions value:(includeAllowableActions ? @"true" : @"false") urlString:upLink];
- upLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeRelationships value:[CMISEnums stringForIncludeRelationShip:includeRelationship] urlString:upLink];
+ upLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeRelationships value:[CMISEnums stringForIncludeRelationShip:relationships] urlString:upLink];
if (renditionFilter != nil) {
upLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterRenditionFilter value:renditionFilter urlString:upLink];
@@ -124,8 +132,9 @@
upLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterRelativePathSegment value:(includeRelativePathSegment ? @"true" : @"false") urlString:upLink];
[self.bindingSession.networkProvider invokeGET:[NSURL URLWithString:upLink]
- session:self.bindingSession
- completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
+ session:self.bindingSession
+ cmisRequest:request
+ completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
if (httpResponse) {
CMISAtomFeedParser *parser = [[CMISAtomFeedParser alloc] initWithData:httpResponse.data];
NSError *internalError;
@@ -142,6 +151,7 @@
}
}];
}];
+ return request;
}
@end
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m Wed Feb 20 13:18:59 2013
@@ -31,23 +31,25 @@
@implementation CMISAtomPubObjectService
-- (void)retrieveObject:(NSString *)objectId
+- (CMISRequest*)retrieveObject:(NSString *)objectId
filter:(NSString *)filter
- relationShips:(CMISIncludeRelationship)includeRelationship
+ relationships:(CMISIncludeRelationship)relationships
includePolicyIds:(BOOL)includePolicyIds
renditionFilder:(NSString *)renditionFilter
includeACL:(BOOL)includeACL
includeAllowableActions:(BOOL)includeAllowableActions
completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
{
+ CMISRequest *cmisRequest = [[CMISRequest alloc] init];
[self retrieveObjectInternal:objectId
returnVersion:NOT_PROVIDED
filter:filter
- relationShips:includeRelationship
+ relationships:relationships
includePolicyIds:includePolicyIds
renditionFilder:renditionFilter
includeACL:includeACL
includeAllowableActions:includeAllowableActions
+ cmisRequest:cmisRequest
completionBlock:^(CMISObjectData *objectData, NSError *error) {
if (error) {
completionBlock(nil, [CMISErrors cmisError:error cmisErrorCode:kCMISErrorCodeObjectNotFound]);
@@ -55,25 +57,29 @@
completionBlock(objectData, nil);
}
}];
+ return cmisRequest;
}
-- (void)retrieveObjectByPath:(NSString *)path
+- (CMISRequest*)retrieveObjectByPath:(NSString *)path
filter:(NSString *)filter
- relationShips:(CMISIncludeRelationship)includeRelationship
+ relationships:(CMISIncludeRelationship)relationships
includePolicyIds:(BOOL)includePolicyIds
renditionFilder:(NSString *)renditionFilter
includeACL:(BOOL)includeACL
includeAllowableActions:(BOOL)includeAllowableActions
completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
{
+ CMISRequest *cmisRequest = [[CMISRequest alloc] init];
[self retrieveObjectByPathInternal:path
filter:filter
- relationShips:includeRelationship
+ relationships:relationships
includePolicyIds:includePolicyIds
renditionFilder:renditionFilter
includeACL:includeACL
includeAllowableActions:includeAllowableActions
+ cmisRequest:cmisRequest
completionBlock:completionBlock];
+ return cmisRequest;
}
- (CMISRequest*)downloadContentOfObject:(NSString *)objectId
@@ -98,7 +104,9 @@
{
CMISRequest *request = [[CMISRequest alloc] init];
- [self retrieveObjectInternal:objectId completionBlock:^(CMISObjectData *objectData, NSError *error) {
+ [self retrieveObjectInternal:objectId
+ cmisRequest:request
+ completionBlock:^(CMISObjectData *objectData, NSError *error) {
if (error) {
log(@"Error while retrieving CMIS object for object id '%@' : %@", objectId, error.description);
if (completionBlock) {
@@ -120,13 +128,13 @@
session:self.bindingSession
outputStream:outputStream
bytesExpected:streamLength
+ cmisRequest:request
completionBlock:^(CMISHttpResponse *httpResponse, NSError *error)
{
if (completionBlock) {
completionBlock(error);
}
- }progressBlock:progressBlock
- requestObject:request];
+ }progressBlock:progressBlock];
} else { // it is spec-compliant to have no content stream set and in this case there is nothing to download
if (completionBlock) {
completionBlock(nil);
@@ -138,7 +146,7 @@
return request;
}
-- (void)deleteContentOfObject:(CMISStringInOutParameter *)objectIdParam
+- (CMISRequest*)deleteContentOfObject:(CMISStringInOutParameter *)objectIdParam
changeToken:(CMISStringInOutParameter *)changeTokenParam
completionBlock:(void (^)(NSError *error))completionBlock
{
@@ -146,11 +154,15 @@
if (objectIdParam == nil || objectIdParam.inParameter == nil) {
log(@"Object id is nil or inParameter of objectId is nil");
completionBlock([[NSError alloc] init]); // TODO: properly init error (CmisInvalidArgumentException)
- return;
+ return nil;
}
+ CMISRequest *request = [[CMISRequest alloc] init];
// Get edit media link
- [self loadLinkForObjectId:objectIdParam.inParameter relation:kCMISLinkEditMedia completionBlock:^(NSString *editMediaLink, NSError *error) {
+ [self loadLinkForObjectId:objectIdParam.inParameter
+ relation:kCMISLinkEditMedia
+ cmisRequest:request
+ completionBlock:^(NSString *editMediaLink, NSError *error) {
if (editMediaLink == nil){
log(@"Could not retrieve %@ link for object '%@'", kCMISLinkEditMedia, objectIdParam.inParameter);
completionBlock(error);
@@ -164,8 +176,9 @@
}
[self.bindingSession.networkProvider invokeDELETE:[NSURL URLWithString:editMediaLink]
- session:self.bindingSession
- completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
+ session:self.bindingSession
+ cmisRequest:request
+ completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
if (httpResponse) {
// Atompub DOES NOT SUPPORT returning the new object id and change token
// See http://docs.oasis-open.org/cmis/CMIS/v1.0/cs01/cmis-spec-v1.0.html#_Toc243905498
@@ -177,10 +190,12 @@
}
}];
}];
+ return request;
}
- (CMISRequest*)changeContentOfObject:(CMISStringInOutParameter *)objectIdParam
toContentOfFile:(NSString *)filePath
+ mimeType:(NSString *)mimeType
overwriteExisting:(BOOL)overwrite
changeToken:(CMISStringInOutParameter *)changeTokenParam
completionBlock:(void (^)(NSError *error))completionBlock
@@ -196,7 +211,7 @@
}
NSError *fileError = nil;
- unsigned long long fileSize = [FileUtil fileSizeForFileAtPath:filePath error:&fileError];
+ unsigned long long fileSize = [CMISFileUtil fileSizeForFileAtPath:filePath error:&fileError];
if (fileError) {
log(@"Could not determine size of file %@: %@", filePath, [fileError description]);
}
@@ -205,6 +220,7 @@
toContentOfInputStream:inputStream
bytesExpected:fileSize
filename:[filePath lastPathComponent]
+ mimeType:mimeType
overwriteExisting:overwrite
changeToken:changeTokenParam
completionBlock:completionBlock
@@ -215,11 +231,13 @@
toContentOfInputStream:(NSInputStream *)inputStream
bytesExpected:(unsigned long long)bytesExpected
filename:(NSString*)filename
+ mimeType:(NSString *)mimeType
overwriteExisting:(BOOL)overwrite
changeToken:(CMISStringInOutParameter *)changeTokenParam
completionBlock:(void (^)(NSError *error))completionBlock
progressBlock:(void (^)(unsigned long long bytesUploaded, unsigned long long bytesTotal))progressBlock
{
+ CMISRequest *request = [[CMISRequest alloc] init];
// Validate object id param
if (objectIdParam == nil || objectIdParam.inParameter == nil) {
log(@"Object id is nil or inParameter of objectId is nil");
@@ -237,14 +255,21 @@
return nil;
}
+ if (nil == mimeType)
+ {
+ mimeType = kCMISMediaTypeOctetStream;
+ }
+
// Atompub DOES NOT SUPPORT returning the new object id and change token
// See http://docs.oasis-open.org/cmis/CMIS/v1.0/cs01/cmis-spec-v1.0.html#_Toc243905498
objectIdParam.outParameter = nil;
changeTokenParam.outParameter = nil;
- CMISRequest *request = [[CMISRequest alloc] init];
// Get edit media link
- [self loadLinkForObjectId:objectIdParam.inParameter relation:kCMISLinkEditMedia completionBlock:^(NSString *editMediaLink, NSError *error) {
+ [self loadLinkForObjectId:objectIdParam.inParameter
+ relation:kCMISLinkEditMedia
+ cmisRequest:request
+ completionBlock:^(NSString *editMediaLink, NSError *error) {
if (editMediaLink == nil){
log(@"Could not retrieve %@ link for object '%@'", kCMISLinkEditMedia, objectIdParam.inParameter);
if (completionBlock) {
@@ -263,16 +288,20 @@
editMediaLink = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterOverwriteFlag
value:(overwrite ? @"true" : @"false") urlString:editMediaLink];
+
// Execute HTTP call on edit media link, passing the a stream to the file
- NSDictionary *additionalHeader = [NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"attachment; filename=%@",
- filename] forKey:@"Content-Disposition"];
+ NSArray *values = @[[NSString stringWithFormat:kCMISHTTPHeaderContentDispositionAttachment, filename], mimeType];
+ NSArray *keys = @[kCMISHTTPHeaderContentDisposition, kCMISHTTPHeaderContentType];
+ NSDictionary *headers = [NSDictionary dictionaryWithObjects:values forKeys:keys];
+
[self.bindingSession.networkProvider invoke:[NSURL URLWithString:editMediaLink]
httpMethod:HTTP_PUT
session:self.bindingSession
inputStream:inputStream
- headers:additionalHeader
+ headers:headers
bytesExpected:bytesExpected
+ cmisRequest:request
completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
// Check response status
if (httpResponse) {
@@ -288,8 +317,7 @@
completionBlock(error);
}
}
- progressBlock:progressBlock
- requestObject:request];
+ progressBlock:progressBlock];
}];
return request;
@@ -314,7 +342,7 @@
}
NSError *fileError = nil;
- unsigned long long bytesExpected = [FileUtil fileSizeForFileAtPath:filePath error:&fileError];
+ unsigned long long bytesExpected = [CMISFileUtil fileSizeForFileAtPath:filePath error:&fileError];
if (fileError) {
log(@"Could not determine size of file %@: %@", filePath, [fileError description]);
}
@@ -359,6 +387,7 @@
[self loadLinkForObjectId:folderObjectId
relation:kCMISLinkRelationDown
type:kCMISMediaTypeChildren
+ cmisRequest:request
completionBlock:^(NSString *downLink, NSError *error) {
if (error) {
log(@"Could not retrieve down link: %@", error.description);
@@ -374,57 +403,64 @@
contentInputStream:inputStream
contentMimeType:mimeType
bytesExpected:bytesExpected
+ cmisRequest:request
completionBlock:completionBlock
- progressBlock:progressBlock
- requestObject:request];
+ progressBlock:progressBlock];
}];
return request;
}
-- (void)deleteObject:(NSString *)objectId
+- (CMISRequest*)deleteObject:(NSString *)objectId
allVersions:(BOOL)allVersions
completionBlock:(void (^)(BOOL objectDeleted, NSError *error))completionBlock
{
- [self loadLinkForObjectId:objectId relation:kCMISLinkRelationSelf completionBlock:^(NSString *selfLink, NSError *error) {
+ CMISRequest *request = [[CMISRequest alloc] init];
+ [self loadLinkForObjectId:objectId
+ relation:kCMISLinkRelationSelf
+ cmisRequest:request
+ completionBlock:^(NSString *selfLink, NSError *error) {
if (!selfLink) {
completionBlock(NO, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeInvalidArgument detailedDescription:nil]);
} else {
NSURL *selfUrl = [NSURL URLWithString:selfLink];
[self.bindingSession.networkProvider invokeDELETE:selfUrl
session:self.bindingSession
+ cmisRequest:request
completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
if (httpResponse) {
completionBlock(YES, nil);
} else {
completionBlock(NO, [CMISErrors cmisError:error cmisErrorCode:kCMISErrorCodeUpdateConflict]);
}
- }];
+ } ];
}
}];
+ return request;
}
-- (void)createFolderInParentFolder:(NSString *)folderObjectId
+- (CMISRequest*)createFolderInParentFolder:(NSString *)folderObjectId
properties:(CMISProperties *)properties
completionBlock:(void (^)(NSString *, NSError *))completionBlock
{
if ([properties propertyValueForId:kCMISPropertyName] == nil || [properties propertyValueForId:kCMISPropertyObjectTypeId] == nil) {
log(@"Must provide %@ and %@ as properties", kCMISPropertyName, kCMISPropertyObjectTypeId);
completionBlock(nil, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeInvalidArgument detailedDescription:nil]);
- return;
+ return nil;
}
// Validate parent folder id
if (!folderObjectId) {
log(@"Must provide a parent folder object id when creating a new folder");
completionBlock(nil, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeObjectNotFound detailedDescription:nil]);
- return;
+ return nil;
}
-
+ CMISRequest *request = [[CMISRequest alloc] init];
// Get Down link
[self loadLinkForObjectId:folderObjectId
relation:kCMISLinkRelationDown
type:kCMISMediaTypeChildren
+ cmisRequest:request
completionBlock:^(NSString *downLink, NSError *error) {
if (error) {
log(@"Could not retrieve down link: %@", error.description);
@@ -433,14 +469,16 @@
[self sendAtomEntryXmlToLink:downLink
httpRequestMethod:HTTP_POST
properties:properties
+ cmisRequest:request
completionBlock:^(CMISObjectData *objectData, NSError *error) {
completionBlock(objectData.identifier, error);
}];
}
}];
+ return request;
}
-- (void)deleteTree:(NSString *)folderObjectId
+- (CMISRequest*)deleteTree:(NSString *)folderObjectId
allVersion:(BOOL)allVersions
unfileObjects:(CMISUnfileObject)unfileObjects
continueOnFailure:(BOOL)continueOnFailure
@@ -450,12 +488,14 @@
if (!folderObjectId) {
log(@"Must provide a folder object id when deleting a folder tree");
completionBlock(nil, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeObjectNotFound detailedDescription:nil]);
- return;
+ return nil;
}
+ CMISRequest *request = [[CMISRequest alloc] init];
[self loadLinkForObjectId:folderObjectId
relation:kCMISLinkRelationDown
type:kCMISMediaTypeDescendants
+ cmisRequest:request
completionBlock:^(NSString *link, NSError *error) {
if (error) {
log(@"Error while fetching %@ link : %@", kCMISLinkRelationDown, error.description);
@@ -469,8 +509,9 @@
link = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterContinueOnFailure value:(continueOnFailure ? @"true" : @"false") urlString:link];
[self.bindingSession.networkProvider invokeDELETE:[NSURL URLWithString:link]
- session:self.bindingSession
- completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
+ session:self.bindingSession
+ cmisRequest:request
+ completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
if (httpResponse) {
// TODO: retrieve failed folders and files and return
completionBlock([NSArray array], nil);
@@ -483,6 +524,7 @@
if (link == nil) {
[self loadLinkForObjectId:folderObjectId
relation:kCMISLinkRelationFolderTree
+ cmisRequest:request
completionBlock:^(NSString *link, NSError *error) {
if (error) {
log(@"Error while fetching %@ link : %@", kCMISLinkRelationFolderTree, error.description);
@@ -498,9 +540,10 @@
continueWithLink(link);
}
}];
+ return request;
}
-- (void)updatePropertiesForObject:(CMISStringInOutParameter *)objectIdParam
+- (CMISRequest*)updatePropertiesForObject:(CMISStringInOutParameter *)objectIdParam
properties:(CMISProperties *)properties
changeToken:(CMISStringInOutParameter *)changeTokenParam
completionBlock:(void (^)(NSError *error))completionBlock
@@ -509,12 +552,14 @@
if (objectIdParam == nil || objectIdParam.inParameter == nil) {
log(@"Object id is nil or inParameter of objectId is nil");
completionBlock([[NSError alloc] init]); // TODO: properly init error (CmisInvalidArgumentException)
- return;
+ return nil;
}
+ CMISRequest *request = [[CMISRequest alloc] init];
// Get self link
[self loadLinkForObjectId:objectIdParam.inParameter
relation:kCMISLinkRelationSelf
+ cmisRequest:request
completionBlock:^(NSString *selfLink, NSError *error) {
if (selfLink == nil) {
log(@"Could not retrieve %@ link", kCMISLinkRelationSelf);
@@ -532,6 +577,7 @@
[self sendAtomEntryXmlToLink:selfLink
httpRequestMethod:HTTP_PUT
properties:properties
+ cmisRequest:request
completionBlock:^(CMISObjectData *objectData, NSError *error) {
// Create XML needed as body of html
@@ -541,8 +587,9 @@
[self.bindingSession.networkProvider invokePUT:[NSURL URLWithString:selfLink]
session:self.bindingSession
- body:[xmlWriter.generateAtomEntryXml dataUsingEncoding:NSUTF8StringEncoding]
- headers:[NSDictionary dictionaryWithObject:kCMISMediaTypeEntry forKey:@"Content-type"]
+ body:[xmlWriter.generateAtomEntryXml dataUsingEncoding:NSUTF8StringEncoding]
+ headers:[NSDictionary dictionaryWithObject:kCMISMediaTypeEntry forKey:@"Content-type"]
+ cmisRequest:request
completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
if (httpResponse) {
// Object id and changeToken might have changed because of this operation
@@ -559,22 +606,30 @@
} else {
completionBlock([CMISErrors cmisError:error cmisErrorCode:kCMISErrorCodeConnection]);
}
- }];
+ } ];
}];
}];
+ return request;
}
-- (void)retrieveRenditions:(NSString *)objectId
+- (CMISRequest*)retrieveRenditions:(NSString *)objectId
renditionFilter:(NSString *)renditionFilter
maxItems:(NSNumber *)maxItems
skipCount:(NSNumber *)skipCount
completionBlock:(void (^)(NSArray *renditions, NSError *error))completionBlock
{
// Only fetching the bare minimum
- [self retrieveObjectInternal:objectId returnVersion:LATEST filter:kCMISPropertyObjectId
- relationShips:CMISIncludeRelationshipNone includePolicyIds:NO
- renditionFilder:renditionFilter includeACL:NO includeAllowableActions:NO
+ CMISRequest *cmisRequest = [[CMISRequest alloc] init];
+ [self retrieveObjectInternal:objectId
+ returnVersion:LATEST
+ filter:kCMISPropertyObjectId
+ relationships:CMISIncludeRelationshipNone
+ includePolicyIds:NO
+ renditionFilder:renditionFilter
+ includeACL:NO
+ includeAllowableActions:NO
+ cmisRequest:cmisRequest
completionBlock:^(CMISObjectData *objectData, NSError *error) {
if (error) {
completionBlock(nil, [CMISErrors cmisError:error cmisErrorCode:kCMISErrorCodeObjectNotFound]);
@@ -582,6 +637,7 @@
completionBlock(objectData.renditions, nil);
}
}];
+ return cmisRequest;
}
#pragma mark Helper methods
@@ -589,6 +645,7 @@
- (void)sendAtomEntryXmlToLink:(NSString *)link
httpRequestMethod:(CMISHttpRequestMethod)httpRequestMethod
properties:(CMISProperties *)properties
+ cmisRequest:(CMISRequest *)request
completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
{
// Validate params
@@ -612,6 +669,7 @@
session:self.bindingSession
body:[writeResult dataUsingEncoding:NSUTF8StringEncoding]
headers:[NSDictionary dictionaryWithObject:kCMISMediaTypeEntry forKey:@"Content-type"]
+ cmisRequest:request
completionBlock:^(CMISHttpResponse *response, NSError *error) {
if (error) {
log(@"HTTP error when creating/uploading content: %@", error);
@@ -647,9 +705,9 @@
contentInputStream:(NSInputStream *)contentInputStream
contentMimeType:(NSString *)contentMimeType
bytesExpected:(unsigned long long)bytesExpected
+ cmisRequest:(CMISRequest*)request
completionBlock:(void (^)(NSString *objectId, NSError *error))completionBlock
progressBlock:(void (^)(unsigned long long bytesUploaded, unsigned long long bytesTotal))progressBlock
- requestObject:(CMISRequest*)request
{
// Validate param
if (link == nil) {
@@ -670,7 +728,7 @@
NSInputStream *inputStream = [NSInputStream inputStreamWithFileAtPath:writeResult];
NSError *fileSizeError = nil;
- unsigned long long fileSize = [FileUtil fileSizeForFileAtPath:writeResult error:&fileSizeError];
+ unsigned long long fileSize = [CMISFileUtil fileSizeForFileAtPath:writeResult error:&fileSizeError];
if (fileSizeError) {
log(@"Could not determine file size of %@ : %@", writeResult, [fileSizeError description]);
}
@@ -681,6 +739,7 @@
inputStream:inputStream
headers:[NSDictionary dictionaryWithObject:kCMISMediaTypeEntry forKey:@"Content-type"]
bytesExpected:fileSize
+ cmisRequest:request
completionBlock:^(CMISHttpResponse *response, NSError *error) {
// close stream to and delete temporary file
[inputStream close];
@@ -717,8 +776,7 @@
}
}
}
- progressBlock:progressBlock
- requestObject:request];
+ progressBlock:progressBlock];
}
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubRepositoryService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubRepositoryService.m?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubRepositoryService.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubRepositoryService.m Wed Feb 20 13:18:59 2013
@@ -30,16 +30,16 @@
@end
@interface CMISAtomPubRepositoryService (PrivateMethods)
-- (void)internalRetrieveRepositoriesWithCompletionBlock:(void (^)(NSError *error))completionBlock;
+- (CMISRequest*)internalRetrieveRepositoriesWithCompletionBlock:(void (^)(NSError *error))completionBlock;
@end
@implementation CMISAtomPubRepositoryService
-- (void)retrieveRepositoriesWithCompletionBlock:(void (^)(NSArray *repositories, NSError *error))completionBlock
+- (CMISRequest*)retrieveRepositoriesWithCompletionBlock:(void (^)(NSArray *repositories, NSError *error))completionBlock
{
- [self internalRetrieveRepositoriesWithCompletionBlock:^(NSError *error) {
+ return [self internalRetrieveRepositoriesWithCompletionBlock:^(NSError *error) {
if (error) {
completionBlock(nil, [CMISErrors cmisError:error cmisErrorCode:kCMISErrorCodeObjectNotFound]);
} else {
@@ -48,9 +48,9 @@
}];
}
-- (void)retrieveRepositoryInfoForId:(NSString *)repositoryId completionBlock:(void (^)(CMISRepositoryInfo *repositoryInfo, NSError *error))completionBlock
+- (CMISRequest*)retrieveRepositoryInfoForId:(NSString *)repositoryId completionBlock:(void (^)(CMISRepositoryInfo *repositoryInfo, NSError *error))completionBlock
{
- [self internalRetrieveRepositoriesWithCompletionBlock:^(NSError *error) {
+ return [self internalRetrieveRepositoriesWithCompletionBlock:^(NSError *error) {
if (error) {
completionBlock(nil, [CMISErrors cmisError:error cmisErrorCode:kCMISErrorCodeInvalidArgument]);
} else {
@@ -59,10 +59,11 @@
}];
}
-- (void)internalRetrieveRepositoriesWithCompletionBlock:(void (^)(NSError *error))completionBlock
+- (CMISRequest*)internalRetrieveRepositoriesWithCompletionBlock:(void (^)(NSError *error))completionBlock
{
self.repositories = [NSMutableDictionary dictionary];
- [self retrieveCMISWorkspacesWithCompletionBlock:^(NSArray *cmisWorkSpaces, NSError *error) {
+ CMISRequest *request = [[CMISRequest alloc] init];
+ [self retrieveCMISWorkspacesWithCancellableRequest:request completionBlock:^(NSArray *cmisWorkSpaces, NSError *error) {
if (cmisWorkSpaces != nil) {
for (CMISWorkspace *workspace in cmisWorkSpaces) {
[self.repositories setObject:workspace.repositoryInfo forKey:workspace.repositoryInfo.identifier];
@@ -70,22 +71,27 @@
}
completionBlock(error);
}];
+ return request;
}
-
-- (void)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");
NSError *error = [[NSError alloc] init]; // TODO: proper error init
completionBlock(nil, error);
- return;
+ return nil;
}
-
- [self retrieveFromCache:kCMISBindingSessionKeyTypeByIdUriBuilder completionBlock:^(id object, NSError *error) {
+ CMISRequest *request = [[CMISRequest alloc] init];
+ [self retrieveFromCache:kCMISBindingSessionKeyTypeByIdUriBuilder
+ cmisRequest:request
+ completionBlock:^(id object, NSError *error) {
CMISTypeByIdUriBuilder *typeByIdUriBuilder = object;
typeByIdUriBuilder.id = typeId;
- [self.bindingSession.networkProvider invokeGET:[typeByIdUriBuilder buildUrl] session:self.bindingSession completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
+ [self.bindingSession.networkProvider invokeGET:[typeByIdUriBuilder buildUrl]
+ session:self.bindingSession
+ cmisRequest:request
+ completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
if (httpResponse) {
if (httpResponse.data != nil) {
CMISTypeDefinitionAtomEntryParser *parser = [[CMISTypeDefinitionAtomEntryParser alloc] initWithData:httpResponse.data];
@@ -104,6 +110,8 @@
}
}];
}];
+
+ return request;
}
@end
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubVersioningService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubVersioningService.m?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubVersioningService.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubVersioningService.m Wed Feb 20 13:18:59 2013
@@ -27,30 +27,33 @@
@implementation CMISAtomPubVersioningService
-- (void)retrieveObjectOfLatestVersion:(NSString *)objectId
+- (CMISRequest*)retrieveObjectOfLatestVersion:(NSString *)objectId
major:(BOOL)major
filter:(NSString *)filter
- includeRelationShips:(CMISIncludeRelationship)includeRelationships
+ 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
returnVersion:(major ? LATEST_MAJOR : LATEST)
filter:filter
- relationShips:includeRelationships
+ relationships:relationships
includePolicyIds:includePolicyIds
renditionFilder:renditionFilter
includeACL:includeACL
includeAllowableActions:includeAllowableActions
+ cmisRequest:request
completionBlock:^(CMISObjectData *objectData, NSError *error) {
completionBlock(objectData, error);
}];
+ return request;
}
-- (void)retrieveAllVersions:(NSString *)objectId
+- (CMISRequest*)retrieveAllVersions:(NSString *)objectId
filter:(NSString *)filter
includeAllowableActions:(BOOL)includeAllowableActions
completionBlock:(void (^)(NSArray *objects, NSError *error))completionBlock
@@ -59,12 +62,14 @@
if (!objectId) {
log(@"Must provide an objectId when retrieving all versions");
completionBlock(nil, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeObjectNotFound detailedDescription:nil]);
- return;
+ return nil;
}
+ CMISRequest *request = [[CMISRequest alloc] init];
// Fetch version history link
[self loadLinkForObjectId:objectId
relation:kCMISLinkVersionHistory
+ cmisRequest:request
completionBlock:^(NSString *versionHistoryLink, NSError *error) {
if (error) {
completionBlock(nil, [CMISErrors cmisError:error cmisErrorCode:kCMISErrorCodeObjectNotFound]);
@@ -79,8 +84,9 @@
// Execute call
[self.bindingSession.networkProvider invokeGET:[NSURL URLWithString:versionHistoryLink]
- session:self.bindingSession
- completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
+ session:self.bindingSession
+ cmisRequest:request
+ completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
if (httpResponse) {
NSData *data = httpResponse.data;
CMISAtomFeedParser *feedParser = [[CMISAtomFeedParser alloc] initWithData:data];
@@ -95,6 +101,7 @@
}
}];
}];
+ return request;
}
@end
\ No newline at end of file
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByIdUriBuilder.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByIdUriBuilder.h?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByIdUriBuilder.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByIdUriBuilder.h Wed Feb 20 13:18:59 2013
@@ -36,7 +36,7 @@ typedef enum
@property (nonatomic, strong) NSString *filter;
@property BOOL includeAllowableActions;
@property BOOL includePolicyIds;
-@property CMISIncludeRelationship includeRelationships;
+@property CMISIncludeRelationship relationships;
@property BOOL includeACL;
@property (nonatomic, strong) NSString *renditionFilter;
@property CMISReturnVersion returnVersion;
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByIdUriBuilder.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByIdUriBuilder.m?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByIdUriBuilder.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByIdUriBuilder.m Wed Feb 20 13:18:59 2013
@@ -36,7 +36,7 @@
// Defaults
self.includeAllowableActions = YES;
- self.includeRelationships = CMISIncludeRelationshipNone;
+ self.relationships = CMISIncludeRelationshipNone;
self.returnVersion = NOT_PROVIDED;
}
return self;
@@ -49,7 +49,7 @@
urlString = [urlString stringByReplacingOccurrencesOfString:@"{includeAllowableActions}" withString:(self.includeAllowableActions ? @"true" : @"false")];
urlString = [urlString stringByReplacingOccurrencesOfString:@"{includePolicyIds}" withString:(self.includePolicyIds ? @"true" : @"false")];
- NSString *includeRelationShipParam = [CMISEnums stringForIncludeRelationShip:self.includeRelationships];
+ NSString *includeRelationShipParam = [CMISEnums stringForIncludeRelationShip:self.relationships];
urlString = [urlString stringByReplacingOccurrencesOfString:@"{includeRelationships}" withString:includeRelationShipParam];
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByPathUriBuilder.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByPathUriBuilder.h?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByPathUriBuilder.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByPathUriBuilder.h Wed Feb 20 13:18:59 2013
@@ -27,7 +27,7 @@
@property (nonatomic, strong) NSString *filter;
@property BOOL includeAllowableActions;
@property BOOL includePolicyIds;
-@property CMISIncludeRelationship includeRelationships;
+@property CMISIncludeRelationship relationships;
@property BOOL includeACL;
@property (nonatomic, strong) NSString *renditionFilter;
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByPathUriBuilder.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByPathUriBuilder.m?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByPathUriBuilder.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISObjectByPathUriBuilder.m Wed Feb 20 13:18:59 2013
@@ -44,7 +44,7 @@
urlString = [urlString stringByReplacingOccurrencesOfString:@"{filter}" withString:(self.filter != nil ? self.filter : @"")];
urlString = [urlString stringByReplacingOccurrencesOfString:@"{includeAllowableActions}" withString:(self.includeAllowableActions ? @"true" : @"false")];
urlString = [urlString stringByReplacingOccurrencesOfString:@"{includePolicyIds}" withString:(self.includePolicyIds ? @"true" : @"false")];
- urlString = [urlString stringByReplacingOccurrencesOfString:@"{includeRelationships}" withString:[CMISEnums stringForIncludeRelationShip:self.includeRelationships]];
+ urlString = [urlString stringByReplacingOccurrencesOfString:@"{includeRelationships}" withString:[CMISEnums stringForIncludeRelationShip:self.relationships]];
urlString = [urlString stringByReplacingOccurrencesOfString:@"{includeACL}" withString:(self.includeACL ? @"true" : @"false")];
urlString = [urlString stringByReplacingOccurrencesOfString:@"{renditionFilter}" withString:(self.renditionFilter != nil ? self.renditionFilter : @"")];
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISQueryAtomEntryWriter.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISQueryAtomEntryWriter.h?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISQueryAtomEntryWriter.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISQueryAtomEntryWriter.h Wed Feb 20 13:18:59 2013
@@ -25,7 +25,7 @@
@property (nonatomic, strong) NSString *statement;
@property BOOL searchAllVersions;
-@property CMISIncludeRelationship includeRelationships;
+@property CMISIncludeRelationship relationships;
@property (nonatomic, strong) NSString *renditionFilter;
@property BOOL includeAllowableActions;
@property (nonatomic, strong) NSNumber * skipCount;
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISQueryAtomEntryWriter.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISQueryAtomEntryWriter.m?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISQueryAtomEntryWriter.m (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISQueryAtomEntryWriter.m Wed Feb 20 13:18:59 2013
@@ -28,7 +28,7 @@
{
self = [super init];
if (self) {
- self.includeRelationships = CMISIncludeRelationshipNone;
+ self.relationships = CMISIncludeRelationshipNone;
}
return self;
}
@@ -48,7 +48,7 @@
[xml appendFormat:@"<cmis:searchAllVersions>%@</cmis:searchAllVersions>", self.searchAllVersions ? @"true" : @"false"];
[xml appendFormat:@"<cmis:includeAllowableActions>%@</cmis:includeAllowableActions>", self.includeAllowableActions ? @"true" : @"false"];
- [xml appendFormat:@"<cmis:includeRelationships>%@</cmis:includeRelationships>", [CMISEnums stringForIncludeRelationShip:self.includeRelationships]];
+ [xml appendFormat:@"<cmis:includeRelationships>%@</cmis:includeRelationships>", [CMISEnums stringForIncludeRelationShip:self.relationships]];
[xml appendFormat:@"<cmis:renditionFilter>%@</cmis:renditionFilter>", self.renditionFilter != nil ? self.renditionFilter : @"*"];
if (self.maxItems != nil) {
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISDiscoveryService.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISDiscoveryService.h?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISDiscoveryService.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISDiscoveryService.h Wed Feb 20 13:18:59 2013
@@ -21,6 +21,7 @@
#import "CMISEnums.h"
@class CMISObjectList;
+@class CMISRequest;
@protocol CMISDiscoveryService <NSObject>
@@ -33,12 +34,12 @@
/** launches a query on the server with the parameters specified
* completionBlock returns the found object list or nil if unsuccessful
*/
-- (void)query:(NSString *)statement searchAllVersions:(BOOL)searchAllVersions
- relationShips:(CMISIncludeRelationship)includeRelationships
- 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;
@end
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISNavigationService.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISNavigationService.h?rev=1448154&r1=1448153&r2=1448154&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISNavigationService.h (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/CMISNavigationService.h Wed Feb 20 13:18:59 2013
@@ -22,6 +22,7 @@
@class CMISFolder;
@class CMISObjectList;
+@class CMISRequest;
@protocol CMISNavigationService <NSObject>
@@ -29,10 +30,10 @@
* Retrieves the children for the given object identifier.
* completionBlock returns object list or nil if unsuccessful
*/
-- (void)retrieveChildren:(NSString *)objectId
+- (CMISRequest*)retrieveChildren:(NSString *)objectId
orderBy:(NSString *)orderBy
filter:(NSString *)filter
- relationShips:(CMISIncludeRelationship)includeRelationship
+ relationships:(CMISIncludeRelationship)relationships
renditionFilter:(NSString *)renditionFilter
includeAllowableActions:(BOOL)includeAllowableActions
includePathSegment:(BOOL)includePathSegment
@@ -47,9 +48,9 @@
* TODO: OpenCMIS returns an ObjectParentData object .... is this necessary?
* completionBlock returns array of parents or nil if unsuccessful
*/
-- (void)retrieveParentsForObject:(NSString *)objectId
+- (CMISRequest*)retrieveParentsForObject:(NSString *)objectId
filter:(NSString *)filter
- relationships:(CMISIncludeRelationship)includeRelationship
+ relationships:(CMISIncludeRelationship)relationships
renditionFilter:(NSString *)renditionFilter
includeAllowableActions:(BOOL)includeAllowableActions
includeRelativePathSegment:(BOOL)includeRelativePathSegment