chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pweschm...@apache.org
Subject svn commit: r1457862 - in /chemistry/objectivecmis/trunk: ObjectiveCMIS.xcodeproj/project.pbxproj ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m ObjectiveCMIS/Utils/CMISBase64InputStream.h ObjectiveCMIS/Utils/CMISBase64InputStream.m
Date Mon, 18 Mar 2013 16:55:33 GMT
Author: pweschmidt
Date: Mon Mar 18 16:55:32 2013
New Revision: 1457862

URL: http://svn.apache.org/r1457862
Log:
CMISBase64InputStream is not required. streaming is done in CMISHttpUploadRequest using only
public API methods

Removed:
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISBase64InputStream.h
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Utils/CMISBase64InputStream.m
Modified:
    chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.pbxproj
    chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.pbxproj
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.pbxproj?rev=1457862&r1=1457861&r2=1457862&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.pbxproj (original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.pbxproj Mon Mar 18 16:55:32
2013
@@ -31,8 +31,6 @@
 		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,
); }; };
 		4E41596F16E0A06200B52587 /* small_test.txt in Resources */ = {isa = PBXBuildFile; fileRef
= 4E41596E16E0A06200B52587 /* small_test.txt */; };
-		4E785C2916D7D76F00FC36FB /* CMISBase64InputStream.h in Headers */ = {isa = PBXBuildFile;
fileRef = 4E785C2716D7D76F00FC36FB /* CMISBase64InputStream.h */; settings = {ATTRIBUTES =
(Public, ); }; };
-		4E785C2A16D7D76F00FC36FB /* CMISBase64InputStream.m in Sources */ = {isa = PBXBuildFile;
fileRef = 4E785C2816D7D76F00FC36FB /* CMISBase64InputStream.m */; };
 		4E9CE52F16D50083004C7934 /* CMISLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E9CE52E16D50083004C7934
/* CMISLog.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		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 */; };
@@ -227,8 +225,6 @@
 		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>"; };
 		4E41596E16E0A06200B52587 /* small_test.txt */ = {isa = PBXFileReference; fileEncoding =
4; lastKnownFileType = text; path = small_test.txt; sourceTree = "<group>"; };
-		4E785C2716D7D76F00FC36FB /* CMISBase64InputStream.h */ = {isa = PBXFileReference; fileEncoding
= 4; lastKnownFileType = sourcecode.c.h; name = CMISBase64InputStream.h; path = Utils/CMISBase64InputStream.h;
sourceTree = "<group>"; };
-		4E785C2816D7D76F00FC36FB /* CMISBase64InputStream.m */ = {isa = PBXFileReference; fileEncoding
= 4; lastKnownFileType = sourcecode.c.objc; name = CMISBase64InputStream.m; path = Utils/CMISBase64InputStream.m;
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>"; };
@@ -649,8 +645,6 @@
 				4EA61BD41564F70C00C759E4 /* CMISStringInOutParameter.m */,
 				4EA61BD51564F70C00C759E4 /* CMISURLUtil.h */,
 				4EA61BD61564F70C00C759E4 /* CMISURLUtil.m */,
-				4E785C2716D7D76F00FC36FB /* CMISBase64InputStream.h */,
-				4E785C2816D7D76F00FC36FB /* CMISBase64InputStream.m */,
 			);
 			name = Utils;
 			sourceTree = "<group>";
@@ -807,7 +801,6 @@
 				4E3E14B316AFFB190057CE22 /* CMISNetworkProvider.h in Headers */,
 				4E10ABFF16B916B500E2287E /* CMISDefaultNetworkProvider.h in Headers */,
 				4E9CE52F16D50083004C7934 /* CMISLog.h in Headers */,
-				4E785C2916D7D76F00FC36FB /* CMISBase64InputStream.h in Headers */,
 				4E3C32A816C4EF190099B21E /* CMISAtomPubVersioningService.h in Headers */,
 				BD30D33D162D7DD7001FFF80 /* CMISRequest.h in Headers */,
 			);
@@ -1019,7 +1012,6 @@
 				4E39DF61163A767B00F21DE6 /* CMISAtomParserUtil.m in Sources */,
 				4E10AC0016B916B500E2287E /* CMISDefaultNetworkProvider.m in Sources */,
 				4E3C32A916C4EF190099B21E /* CMISAtomPubVersioningService.m in Sources */,
-				4E785C2A16D7D76F00FC36FB /* CMISBase64InputStream.m in Sources */,
 				82895A1B16D8A8C5007BC80A /* CMISLog.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m?rev=1457862&r1=1457861&r2=1457862&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m
(original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubObjectService.m
Mon Mar 18 16:55:32 2013
@@ -28,7 +28,6 @@
 #import "CMISURLUtil.h"
 #import "CMISFileUtil.h"
 #import "CMISRequest.h"
-#import "CMISBase64InputStream.h"
 #import "CMISLog.h"
 
 @implementation CMISAtomPubObjectService
@@ -846,76 +845,6 @@
                                   progressBlock:progressBlock];
 }
 
-/**
- This is an alternative implementation of the 'sendAtomEntryXmlToLink' method. It is using
base64 streaming. In contrast to the method above
- it is using a custom class CMISBase64InputStream, which inherits directly from NSInputStream.

- The class, however, has to use some of the "private" API functions. See the class for more
explanations
- */
-- (void)sendAtomEntryXmlToLinkUsingBase64InputStream:(NSString *)link
-                                   httpRequestMethod:(CMISHttpRequestMethod)httpRequestMethod
-                                          properties:(CMISProperties *)properties
-                                  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
-{
-    // Validate param
-    if (link == nil) {
-        CMISLogError(@"Could not retrieve link from object to do creation or update");
-        if (completionBlock) {
-            completionBlock(nil, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeInvalidArgument
detailedDescription:nil]);
-        }
-        return;
-    }
-    
-    
-    // Generate XML
-     CMISBase64InputStream *inputStream = [[CMISBase64InputStream alloc] initWithInputStream:contentInputStream
-                                                                              cmisProperties:properties
-                                                                                    mimeType:contentMimeType
-                                                                             nonEncodedBytes:bytesExpected];
-    
-    [self.bindingSession.networkProvider invoke:[NSURL URLWithString:link]
-                                     httpMethod:HTTP_POST
-                                        session:self.bindingSession
-                                    inputStream:inputStream
-                                        headers:[NSDictionary dictionaryWithObject:kCMISMediaTypeEntry
forKey:@"Content-type"]
-                                  bytesExpected:bytesExpected
-                                    cmisRequest:request
-                                completionBlock:^(CMISHttpResponse *response, NSError *error)
{
-                                    // close stream to and delete temporary file
-                                    [inputStream close];
-                                    
-                                    if (error) {
-                                        CMISLogError(@"HTTP error when creating/uploading
content: %@", error);
-                                        if (completionBlock) {
-                                            completionBlock(nil, error);
-                                        }
-                                    } else if (response.statusCode == 200 || response.statusCode
== 201 || response.statusCode == 204) {
-                                        if (completionBlock) {
-                                            NSError *parseError = nil;
-                                            CMISAtomEntryParser *atomEntryParser = [[CMISAtomEntryParser
alloc] initWithData:response.data];
-                                            [atomEntryParser parseAndReturnError:&parseError];
-                                            if (parseError == nil) {
-                                                completionBlock(atomEntryParser.objectData.identifier,
nil);
-                                            } else {
-                                                CMISLogError(@"Error while parsing response:
%@", [parseError description]);
-                                                completionBlock(nil, [CMISErrors cmisError:parseError
cmisErrorCode:kCMISErrorCodeUpdateConflict]);
-                                            }
-                                        }
-                                    } else {
-                                        CMISLogError(@"Invalid http response status code
when creating/uploading content: %d", response.statusCode);
-                                        CMISLogError(@"Error content: %@", [[NSString alloc]
initWithData:response.data encoding:NSUTF8StringEncoding]);
-                                        if (completionBlock) {
-                                            completionBlock(nil, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeRuntime
-                                                                                 detailedDescription:[NSString
stringWithFormat:@"Could not create content: http status code %d", response.statusCode]]);
-                                        }
-                                    }
-                                }
-                                  progressBlock:progressBlock];
-}
 
 
 



Mime
View raw message