chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lgr...@apache.org
Subject svn commit: r1589611 [1/2] - in /chemistry/objectivecmis/branches/browser-binding: ObjectiveCMIS.xcodeproj/ ObjectiveCMIS/ ObjectiveCMIS/Bindings/ ObjectiveCMIS/Bindings/Browser/ ObjectiveCMIS/Client/ ObjectiveCMIS/Common/
Date Thu, 24 Apr 2014 06:51:56 GMT
Author: lgross
Date: Thu Apr 24 06:51:55 2014
New Revision: 1589611

URL: http://svn.apache.org/r1589611
Log:
CMIS-788: Browser Binding: Implement property conversion according to type definition

Added:
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService+Protected.h
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISNSDictionary+CMISUtil.h
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISNSDictionary+CMISUtil.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISTypeCache.h
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISTypeCache.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISTypeDefinitionCache.h
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISTypeDefinitionCache.m
Removed:
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/CMISNSDictionary+CMISUtil.h
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/CMISNSDictionary+CMISUtil.m
Modified:
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS.xcodeproj/project.pbxproj
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserConstants.h
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserConstants.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserNavigationService.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserObjectService.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserRepositoryService.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserUtil.h
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserUtil.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserVersioningService.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISBindingSession.h
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISBindingSession.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Client/CMISSession.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Common/CMISConstants.h
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Common/CMISConstants.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Common/CMISPropertyData.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Common/CMISSessionParameters.h
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Common/CMISSessionParameters.m

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS.xcodeproj/project.pbxproj
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS.xcodeproj/project.pbxproj?rev=1589611&r1=1589610&r2=1589611&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS.xcodeproj/project.pbxproj (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS.xcodeproj/project.pbxproj Thu Apr 24 06:51:55 2014
@@ -215,10 +215,15 @@
 		BD5C9715162C11E3002DDC6E /* CMISHttpResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = BD5C9712162C11E3002DDC6E /* CMISHttpResponse.m */; };
 		BD70F11B17F4649B00AE2B0C /* CMISDocumentTypeDefinition.h in Headers */ = {isa = PBXBuildFile; fileRef = BD70F11917F4649B00AE2B0C /* CMISDocumentTypeDefinition.h */; };
 		BD70F11C17F4649B00AE2B0C /* CMISDocumentTypeDefinition.m in Sources */ = {isa = PBXBuildFile; fileRef = BD70F11A17F4649B00AE2B0C /* CMISDocumentTypeDefinition.m */; };
-		C94AB15B19002CCD00ACC3D4 /* CMISNSDictionary+CMISUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = C94AB15919002CCD00ACC3D4 /* CMISNSDictionary+CMISUtil.h */; };
-		C94AB15C19002CCD00ACC3D4 /* CMISNSDictionary+CMISUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = C94AB15A19002CCD00ACC3D4 /* CMISNSDictionary+CMISUtil.m */; };
 		C94AB15F19003A5A00ACC3D4 /* CMISBrowserVersioningService.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B9C8D518DE3379001D5C1B /* CMISBrowserVersioningService.m */; };
-		C94AB16019003A8200ACC3D4 /* CMISNSDictionary+CMISUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = C94AB15A19002CCD00ACC3D4 /* CMISNSDictionary+CMISUtil.m */; };
+		C94AB17119065C7500ACC3D4 /* CMISNSDictionary+CMISUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = C94AB16F19065C7500ACC3D4 /* CMISNSDictionary+CMISUtil.h */; };
+		C94AB17219065C7500ACC3D4 /* CMISNSDictionary+CMISUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = C94AB17019065C7500ACC3D4 /* CMISNSDictionary+CMISUtil.m */; };
+		C94AB17319065CAC00ACC3D4 /* CMISNSDictionary+CMISUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = C94AB17019065C7500ACC3D4 /* CMISNSDictionary+CMISUtil.m */; };
+		C94AB17619065D7500ACC3D4 /* CMISTypeCache.h in Headers */ = {isa = PBXBuildFile; fileRef = C94AB17419065D7500ACC3D4 /* CMISTypeCache.h */; };
+		C94AB17719065D7500ACC3D4 /* CMISTypeCache.m in Sources */ = {isa = PBXBuildFile; fileRef = C94AB17519065D7500ACC3D4 /* CMISTypeCache.m */; };
+		C94AB17A190662A600ACC3D4 /* CMISBrowserBaseService+Protected.h in Headers */ = {isa = PBXBuildFile; fileRef = C94AB178190662A600ACC3D4 /* CMISBrowserBaseService+Protected.h */; };
+		C94AB17E190667F100ACC3D4 /* CMISTypeDefinitionCache.h in Headers */ = {isa = PBXBuildFile; fileRef = C94AB17C190667F100ACC3D4 /* CMISTypeDefinitionCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		C94AB17F190667F100ACC3D4 /* CMISTypeDefinitionCache.m in Sources */ = {isa = PBXBuildFile; fileRef = C94AB17D190667F100ACC3D4 /* CMISTypeDefinitionCache.m */; };
 		C97B945818FE828300EDC1A6 /* CMISObjectByPathUriBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = C97B945618FE828300EDC1A6 /* CMISObjectByPathUriBuilder.h */; };
 		C97B945918FE828300EDC1A6 /* CMISObjectByPathUriBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = C97B945718FE828300EDC1A6 /* CMISObjectByPathUriBuilder.m */; };
 		C97B947818FECA6400EDC1A6 /* CMISFolderTypeDefinition.h in Headers */ = {isa = PBXBuildFile; fileRef = C97B947618FECA6400EDC1A6 /* CMISFolderTypeDefinition.h */; };
@@ -450,8 +455,13 @@
 		BD5C9712162C11E3002DDC6E /* CMISHttpResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CMISHttpResponse.m; path = Utils/CMISHttpResponse.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
 		BD70F11917F4649B00AE2B0C /* CMISDocumentTypeDefinition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CMISDocumentTypeDefinition.h; path = Bindings/CMISDocumentTypeDefinition.h; sourceTree = "<group>"; };
 		BD70F11A17F4649B00AE2B0C /* CMISDocumentTypeDefinition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CMISDocumentTypeDefinition.m; path = Bindings/CMISDocumentTypeDefinition.m; sourceTree = "<group>"; };
-		C94AB15919002CCD00ACC3D4 /* CMISNSDictionary+CMISUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CMISNSDictionary+CMISUtil.h"; sourceTree = "<group>"; };
-		C94AB15A19002CCD00ACC3D4 /* CMISNSDictionary+CMISUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CMISNSDictionary+CMISUtil.m"; sourceTree = "<group>"; };
+		C94AB16F19065C7500ACC3D4 /* CMISNSDictionary+CMISUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CMISNSDictionary+CMISUtil.h"; path = "Bindings/Browser/CMISNSDictionary+CMISUtil.h"; sourceTree = "<group>"; };
+		C94AB17019065C7500ACC3D4 /* CMISNSDictionary+CMISUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CMISNSDictionary+CMISUtil.m"; path = "Bindings/Browser/CMISNSDictionary+CMISUtil.m"; sourceTree = "<group>"; };
+		C94AB17419065D7500ACC3D4 /* CMISTypeCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CMISTypeCache.h; path = Bindings/Browser/CMISTypeCache.h; sourceTree = "<group>"; };
+		C94AB17519065D7500ACC3D4 /* CMISTypeCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CMISTypeCache.m; path = Bindings/Browser/CMISTypeCache.m; sourceTree = "<group>"; };
+		C94AB178190662A600ACC3D4 /* CMISBrowserBaseService+Protected.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CMISBrowserBaseService+Protected.h"; path = "Bindings/Browser/CMISBrowserBaseService+Protected.h"; sourceTree = "<group>"; };
+		C94AB17C190667F100ACC3D4 /* CMISTypeDefinitionCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CMISTypeDefinitionCache.h; path = Bindings/CMISTypeDefinitionCache.h; sourceTree = "<group>"; };
+		C94AB17D190667F100ACC3D4 /* CMISTypeDefinitionCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CMISTypeDefinitionCache.m; path = Bindings/CMISTypeDefinitionCache.m; sourceTree = "<group>"; };
 		C97B945618FE828300EDC1A6 /* CMISObjectByPathUriBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CMISObjectByPathUriBuilder.h; sourceTree = "<group>"; };
 		C97B945718FE828300EDC1A6 /* CMISObjectByPathUriBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CMISObjectByPathUriBuilder.m; sourceTree = "<group>"; };
 		C97B947618FECA6400EDC1A6 /* CMISFolderTypeDefinition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CMISFolderTypeDefinition.h; path = Bindings/CMISFolderTypeDefinition.h; sourceTree = "<group>"; };
@@ -509,6 +519,7 @@
 			children = (
 				58B9C8CA18DE3379001D5C1B /* CMISBrowserBaseService.h */,
 				58B9C8CB18DE3379001D5C1B /* CMISBrowserBaseService.m */,
+				C94AB178190662A600ACC3D4 /* CMISBrowserBaseService+Protected.h */,
 				58B9C8CC18DE3379001D5C1B /* CMISBrowserBinding.h */,
 				58B9C8CD18DE3379001D5C1B /* CMISBrowserBinding.m */,
 				58B9C90018E588D7001D5C1B /* CMISBrowserConstants.h */,
@@ -525,8 +536,10 @@
 				58B9C8D518DE3379001D5C1B /* CMISBrowserVersioningService.m */,
 				58B9C8FC18E58028001D5C1B /* CMISBrowserUtil.h */,
 				58B9C8FD18E58028001D5C1B /* CMISBrowserUtil.m */,
-				C94AB15919002CCD00ACC3D4 /* CMISNSDictionary+CMISUtil.h */,
-				C94AB15A19002CCD00ACC3D4 /* CMISNSDictionary+CMISUtil.m */,
+				C94AB16F19065C7500ACC3D4 /* CMISNSDictionary+CMISUtil.h */,
+				C94AB17019065C7500ACC3D4 /* CMISNSDictionary+CMISUtil.m */,
+				C94AB17419065D7500ACC3D4 /* CMISTypeCache.h */,
+				C94AB17519065D7500ACC3D4 /* CMISTypeCache.m */,
 			);
 			name = Browser;
 			sourceTree = "<group>";
@@ -733,6 +746,8 @@
 				8276E157155E392A00344A29 /* CMISRepositoryService.h */,
 				FE417D6115761A34009056AA /* CMISTypeDefinition.h */,
 				FE417D6215761A34009056AA /* CMISTypeDefinition.m */,
+				C94AB17C190667F100ACC3D4 /* CMISTypeDefinitionCache.h */,
+				C94AB17D190667F100ACC3D4 /* CMISTypeDefinitionCache.m */,
 				BD70F11917F4649B00AE2B0C /* CMISDocumentTypeDefinition.h */,
 				BD70F11A17F4649B00AE2B0C /* CMISDocumentTypeDefinition.m */,
 				C97B947618FECA6400EDC1A6 /* CMISFolderTypeDefinition.h */,
@@ -876,7 +891,6 @@
 				8280731E1515405C00EF635C /* CMISServiceDocumentParser.h in Headers */,
 				828073201515405C00EF635C /* CMISAtomPubBinding.h in Headers */,
 				58B9C8FE18E58028001D5C1B /* CMISBrowserUtil.h in Headers */,
-				C94AB15B19002CCD00ACC3D4 /* CMISNSDictionary+CMISUtil.h in Headers */,
 				828073221515405C00EF635C /* CMISAtomPubObjectService.h in Headers */,
 				58B9C8E418DE344B001D5C1B /* CMISBrowserDiscoveryService.h in Headers */,
 				828073241515405C00EF635C /* CMISAtomPubRepositoryService.h in Headers */,
@@ -885,6 +899,7 @@
 				82C1C63215344B56009B7B3D /* CMISAtomPubBaseService.h in Headers */,
 				82C1C63615348EC4009B7B3D /* CMISAtomPubNavigationService.h in Headers */,
 				82C1C63A1535790B009B7B3D /* CMISAtomFeedParser.h in Headers */,
+				C94AB17A190662A600ACC3D4 /* CMISBrowserBaseService+Protected.h in Headers */,
 				82C1C63E15358733009B7B3D /* CMISAtomPubConstants.h in Headers */,
 				82AD4AEB1541642A0012DDB6 /* CMISBindingFactory.h in Headers */,
 				82AD4AEF15416A150012DDB6 /* CMISAclService.h in Headers */,
@@ -900,6 +915,7 @@
 				58B9C8D818DE3379001D5C1B /* CMISBrowserBinding.h in Headers */,
 				82C1C63F15358733009B7B45 /* CMISObjectByIdUriBuilder.h in Headers */,
 				82ABA0481554655A00935225 /* CMISBindingSession.h in Headers */,
+				C94AB17619065D7500ACC3D4 /* CMISTypeCache.h in Headers */,
 				82ABA04C1554819300935225 /* CMISAtomPubBaseService+Protected.h in Headers */,
 				82C1C63F15358733009B7B5C /* CMISAtomEntryWriter.h in Headers */,
 				258998E518D73E1A0091BA96 /* CMISPrincipalParser.h in Headers */,
@@ -943,6 +959,7 @@
 				FE417D6815761A34009056C0 /* CMISRenditionData.h in Headers */,
 				FE417D6815761A34009056C4 /* CMISRendition.h in Headers */,
 				755E7D061586E8C3002CACB0 /* CMISAtomPubExtensionDataParserBase.h in Headers */,
+				C94AB17E190667F100ACC3D4 /* CMISTypeDefinitionCache.h in Headers */,
 				4E39DF5C163A72B400F21DE6 /* CMISDateUtil.h in Headers */,
 				4E39DF60163A767B00F21DE6 /* CMISAtomParserUtil.h in Headers */,
 				258998D318D73D160091BA96 /* CMISAceParser.h in Headers */,
@@ -951,6 +968,7 @@
 				BD5C970E16282977002DDC6E /* CMISHttpDownloadRequest.h in Headers */,
 				58B9C8DE18DE3379001D5C1B /* CMISBrowserRepositoryService.h in Headers */,
 				58B9C8E018DE3379001D5C1B /* CMISBrowserVersioningService.h in Headers */,
+				C94AB17119065C7500ACC3D4 /* CMISNSDictionary+CMISUtil.h in Headers */,
 				C97B948418FECD9600EDC1A6 /* CMISItemTypeDefinition.h in Headers */,
 				BD5C9713162C11E3002DDC6E /* CMISHttpResponse.h in Headers */,
 				4E3E14B316AFFB190057CE22 /* CMISNetworkProvider.h in Headers */,
@@ -1097,6 +1115,7 @@
 				828072F21515403800EF635C /* CMISSession.m in Sources */,
 				828073011515404F00EF635C /* CMISConstants.m in Sources */,
 				258998D618D73D160091BA96 /* CMISAclParser.m in Sources */,
+				C94AB17719065D7500ACC3D4 /* CMISTypeCache.m in Sources */,
 				828073041515404F00EF635C /* CMISObjectData.m in Sources */,
 				828073061515404F00EF635C /* CMISProperties.m in Sources */,
 				828073081515404F00EF635C /* CMISPropertyData.m in Sources */,
@@ -1131,6 +1150,7 @@
 				75C5E2F81559172B0065550A /* CMISAllowableActionsParser.m in Sources */,
 				75C8D0871559B7EA00B63D2B /* CMISAllowableActions.m in Sources */,
 				8276E124155E34ED00344A29 /* CMISObjectId.m in Sources */,
+				C94AB17219065C7500ACC3D4 /* CMISNSDictionary+CMISUtil.m in Sources */,
 				C97B947918FECA6400EDC1A6 /* CMISFolderTypeDefinition.m in Sources */,
 				8276E130155E355D00344A29 /* CMISBase64Encoder.m in Sources */,
 				8276E132155E355D00344A29 /* CMISFileUtil.m in Sources */,
@@ -1150,6 +1170,7 @@
 				758B5A79156506840050D034 /* CMISRepositoryInfoParser.m in Sources */,
 				758B5A82156517F00050D034 /* CMISWorkspace.m in Sources */,
 				82C1C63F15358733009B7BA1 /* CMISTypeByIdUriBuilder.m in Sources */,
+				C94AB17F190667F100ACC3D4 /* CMISTypeDefinitionCache.m in Sources */,
 				82C1C63F15358733009B7BA5 /* CMISTypeDefinitionAtomEntryParser.m in Sources */,
 				82C1C63F15358733009B7BA9 /* CMISPropertyDefinitionParser.m in Sources */,
 				752067F6156AC06300231A5D /* CMISExtensionData.m in Sources */,
@@ -1175,7 +1196,6 @@
 				BD30D33E162D7DD7001FFF80 /* CMISRequest.m in Sources */,
 				4E39DF5D163A72B400F21DE6 /* CMISDateUtil.m in Sources */,
 				4E39DF61163A767B00F21DE6 /* CMISAtomParserUtil.m in Sources */,
-				C94AB15C19002CCD00ACC3D4 /* CMISNSDictionary+CMISUtil.m in Sources */,
 				4E10AC0016B916B500E2287E /* CMISDefaultNetworkProvider.m in Sources */,
 				4E3C32A916C4EF190099B21E /* CMISAtomPubVersioningService.m in Sources */,
 				82895A1B16D8A8C5007BC80A /* CMISLog.m in Sources */,
@@ -1192,11 +1212,11 @@
 				75E7789D155BA59D00191BAE /* ObjectiveCMISTests+Environment.m in Sources */,
 				4EA61BD91564F70C00C759E4 /* CMISStringInOutParameter.m in Sources */,
 				4EA61BDC1564F70C00C759E4 /* CMISURLUtil.m in Sources */,
+				C94AB17319065CAC00ACC3D4 /* CMISNSDictionary+CMISUtil.m in Sources */,
 				4EA61BE31564F73900C759E4 /* CMISObjectList.m in Sources */,
 				4EA61BE61564F73900C759E4 /* CMISQueryResult.m in Sources */,
 				4EA61BEB1564F75000C759E4 /* CMISErrors.m in Sources */,
 				FE417D6815761A34009056D2 /* CMISBaseTest.m in Sources */,
-				C94AB16019003A8200ACC3D4 /* CMISNSDictionary+CMISUtil.m in Sources */,
 				BD5C970016281A54002DDC6E /* CMISHttpRequest.m in Sources */,
 				BD5C970B1628293F002DDC6E /* CMISHttpUploadRequest.m in Sources */,
 				C94AB15F19003A5A00ACC3D4 /* CMISBrowserVersioningService.m in Sources */,

Added: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService+Protected.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService%2BProtected.h?rev=1589611&view=auto
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService+Protected.h (added)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService+Protected.h Thu Apr 24 06:51:55 2014
@@ -0,0 +1,28 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CMISBrowserBaseService.h"
+
+@interface CMISBrowserBaseService (Protected)
+
+- (CMISRequest*)retrieveTypeDefinitionInternal:(NSString *)typeId
+                                   cmisRequest:(CMISRequest *)cmisRequest
+                               completionBlock:(void (^)(CMISTypeDefinition *typeDefinition, NSError *error))completionBlock;
+
+@end

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService.m?rev=1589611&r1=1589610&r2=1589611&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService.m (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService.m Thu Apr 24 06:51:55 2014
@@ -21,6 +21,8 @@
 #import "CMISConstants.h"
 #import "CMISBrowserConstants.h"
 #import "CMISURLUtil.h"
+#import "CMISHttpResponse.h"
+#import "CMISBrowserUtil.h"
 
 @interface CMISBrowserBaseService ()
 @property (nonatomic, strong, readwrite) CMISBindingSession *bindingSession;
@@ -44,7 +46,7 @@
     NSString *rootUrl = [self.bindingSession objectForKey:kCMISBrowserBindingSessionKeyRootFolderUrl];
     
     NSString *objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterObjectId value:objectId urlString:rootUrl];
-    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterSelector value:selector urlString:objectUrl];
+    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISBrowserJSONParameterSelector value:selector urlString:objectUrl];
     return objectUrl;
 }
 
@@ -53,15 +55,45 @@
     NSString *rootUrl = [self.bindingSession objectForKey:kCMISBrowserBindingSessionKeyRootFolderUrl];
     
     NSString *objectUrl = [CMISURLUtil urlStringByAppendingPath:path urlString:rootUrl];
-    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterSelector value:selector urlString:objectUrl];
+    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISBrowserJSONParameterSelector value:selector urlString:objectUrl];
     return objectUrl;
 }
 
 -(NSString *)getRepositoryUrlWithSelector:(NSString *)selector
 {
     NSString *repoUrl = [self.bindingSession objectForKey:kCMISBrowserBindingSessionKeyRepositoryUrl];
-    repoUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterSelector value:selector urlString:repoUrl];
+    repoUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISBrowserJSONParameterSelector value:selector urlString:repoUrl];
     return repoUrl;
 }
 
+- (CMISRequest*)retrieveTypeDefinitionInternal:(NSString *)typeId
+                                   cmisRequest:(CMISRequest *)cmisRequest
+                       completionBlock:(void (^)(CMISTypeDefinition *typeDefinition, NSError *error))completionBlock
+{
+    NSString *repoUrl = [self getRepositoryUrlWithSelector:kCMISBrowserJSONSelectorTypeDefinition];
+    repoUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterTypeId value:typeId urlString:repoUrl];
+    
+    [self.bindingSession.networkProvider invokeGET:[NSURL URLWithString:repoUrl]
+                                           session:self.bindingSession
+                                       cmisRequest:cmisRequest
+                                   completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
+                                       if (httpResponse) {
+                                           NSData *data = httpResponse.data;
+                                           if (data) {
+                                               NSError *parsingError = nil;
+                                               CMISTypeDefinition *typeDef = [CMISBrowserUtil typeDefinitionFromJSONData:data error:&parsingError];
+                                               if (parsingError) {
+                                                   completionBlock(nil, parsingError);
+                                               }
+                                               else {
+                                                   completionBlock(typeDef, nil);
+                                               }
+                                           }
+                                       } else {
+                                           completionBlock(nil, error);
+                                       }
+                                   }];
+    return cmisRequest;
+}
+
 @end

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserConstants.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserConstants.h?rev=1589611&r1=1589610&r2=1589611&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserConstants.h (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserConstants.h Thu Apr 24 06:51:55 2014
@@ -146,6 +146,10 @@ extern NSString * const kCMISBrowserJSON
 extern NSString * const kCMISBrowserJSONRenditionWidth;
 extern NSString * const kCMISBrowserJSONRenditionDocumentId;
 
+// JSON specific parameters
+extern NSString * const kCMISBrowserJSONParameterSelector;
+extern NSString * const kCMISBrowserJSONParameterSuccinct;
+
 + (NSSet *)objectKeys;
 + (NSSet *)repositoryInfoKeys;
 + (NSSet *)typeKeys;

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserConstants.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserConstants.m?rev=1589611&r1=1589610&r2=1589611&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserConstants.m (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserConstants.m Thu Apr 24 06:51:55 2014
@@ -154,6 +154,10 @@ NSString * const kCMISBrowserJSONRenditi
 NSString * const kCMISBrowserJSONRenditionWidth = @"width";
 NSString * const kCMISBrowserJSONRenditionDocumentId = @"renditionDocumentId";
 
+// JSON specific parameters
+NSString * const kCMISBrowserJSONParameterSelector = @"cmisselector";
+NSString * const kCMISBrowserJSONParameterSuccinct = @"succinct";
+
 +(NSSet *)objectKeys
 {
     if(!_objectKeys) {

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserNavigationService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserNavigationService.m?rev=1589611&r1=1589610&r2=1589611&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserNavigationService.m (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserNavigationService.m Thu Apr 24 06:51:55 2014
@@ -47,7 +47,7 @@
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludePathSegment boolValue:includePathSegment urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterMaxItems numberValue:maxItems urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterSkipCount numberValue:skipCount urlString:objectUrl];
-    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterSuccinct value:kCMISParameterValueTrue urlString:objectUrl];
+    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISBrowserJSONParameterSuccinct value:kCMISParameterValueTrue urlString:objectUrl];
     
     CMISRequest *cmisRequest = [[CMISRequest alloc] init];
     
@@ -58,14 +58,15 @@
                                        if (httpResponse) {
                                            NSData *data = httpResponse.data;
                                            if (data) {
-                                               NSError *parsingError = nil;
-                                               CMISObjectList *objectList = [CMISBrowserUtil objectListFromJSONData:data error:&parsingError];
-                                               if (parsingError)
-                                               {
-                                                   completionBlock(nil, parsingError);
-                                               } else {
-                                                   completionBlock(objectList, nil);
-                                               }
+                                               CMISTypeCache *typeCache = [[CMISTypeCache alloc] initWithRepositoryId:self.bindingSession.repositoryId bindingService:self];
+                                               [CMISBrowserUtil objectListFromJSONData:data typeCache:typeCache completionBlock:^(CMISObjectList *objectList, NSError *error) {
+                                                   if (error) {
+                                                       completionBlock(nil, error);
+                                                   } else {
+                                                       completionBlock(objectList, nil);
+                                                   }
+                                               }];
+                                               
                                            }
                                        } else {
                                            completionBlock(nil, error);

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserObjectService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserObjectService.m?rev=1589611&r1=1589610&r2=1589611&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserObjectService.m (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserObjectService.m Thu Apr 24 06:51:55 2014
@@ -46,7 +46,7 @@
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterRenditionFilter value:renditionFilter urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludePolicyIds boolValue:includePolicyIds urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeAcl boolValue:includeACL urlString:objectUrl];
-    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterSuccinct value:kCMISParameterValueTrue urlString:objectUrl];
+    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISBrowserJSONParameterSuccinct value:kCMISParameterValueTrue urlString:objectUrl];
     
     CMISRequest *cmisRequest = [[CMISRequest alloc] init];
     
@@ -55,14 +55,15 @@
                                        cmisRequest:cmisRequest
                                    completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
                                        if (httpResponse.statusCode == 200 && httpResponse.data) {
-                                           NSError *parsingError = nil;
-                                           CMISObjectData *objectData = [CMISBrowserUtil objectDataFromJSONData:httpResponse.data error:&parsingError];
-                                           if (parsingError)
-                                           {
-                                               completionBlock(nil, parsingError);
-                                           } else {
-                                               completionBlock(objectData, nil);
-                                           }
+                                           CMISTypeCache *typeCache = [[CMISTypeCache alloc] initWithRepositoryId:self.bindingSession.repositoryId bindingService:self];
+                                           [CMISBrowserUtil objectDataFromJSONData:httpResponse.data typeCache:typeCache completionBlock:^(CMISObjectData *objectData, NSError *error) {
+                                               if (error) {
+                                                   completionBlock(nil, error);
+                                               } else {
+                                                   completionBlock(objectData, nil);
+                                               }
+                                           }];
+                                           
                                        } else {
                                            completionBlock(nil, error);
                                        }
@@ -87,7 +88,7 @@
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterRenditionFilter value:renditionFilter urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludePolicyIds boolValue:includePolicyIds urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeAcl boolValue:includeACL urlString:objectUrl];
-    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterSuccinct value:kCMISParameterValueTrue urlString:objectUrl];
+    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISBrowserJSONParameterSuccinct value:kCMISParameterValueTrue urlString:objectUrl];
     
     CMISRequest *cmisRequest = [[CMISRequest alloc] init];
     
@@ -96,14 +97,15 @@
                                        cmisRequest:cmisRequest
                                    completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
                                        if (httpResponse.statusCode == 200 && httpResponse.data) {
-                                           NSError *parsingError = nil;
-                                           CMISObjectData *objectData = [CMISBrowserUtil objectDataFromJSONData:httpResponse.data error:&parsingError];
-                                           if (parsingError)
-                                           {
-                                               completionBlock(nil, parsingError);
-                                           } else {
-                                               completionBlock(objectData, nil);
-                                           }
+                                           CMISTypeCache *typeCache = [[CMISTypeCache alloc] initWithRepositoryId:self.bindingSession.repositoryId bindingService:self];
+                                           [CMISBrowserUtil objectDataFromJSONData:httpResponse.data typeCache:typeCache completionBlock:^(CMISObjectData *objectData, NSError *error) {
+                                               if (error) {
+                                                   completionBlock(nil, error);
+                                               } else {
+                                                   completionBlock(objectData, nil);
+                                               }
+                                           }];
+                                          
                                        } else {
                                            completionBlock(nil, error);
                                        }
@@ -182,7 +184,7 @@
     
     NSString *contentUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterStreamId value:streamId urlString:rootUrl];
     contentUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterObjectId value:objectId urlString:contentUrl];
-    contentUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterSelector value:kCMISBrowserJSONSelectorContent urlString:contentUrl];
+    contentUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISBrowserJSONParameterSelector value:kCMISBrowserJSONSelectorContent urlString:contentUrl];
 
     unsigned long long streamLength = 0; //TODO do we need this?
 

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserRepositoryService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserRepositoryService.m?rev=1589611&r1=1589610&r2=1589611&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserRepositoryService.m (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserRepositoryService.m Thu Apr 24 06:51:55 2014
@@ -29,6 +29,7 @@
 #import "CMISConstants.h"
 #import "CMISBrowserConstants.h"
 #import "CMISURLUtil.h"
+#import "CMISBrowserBaseService+Protected.h"
 
 @interface CMISBrowserRepositoryService ()
 @property (nonatomic, strong) NSDictionary *repositories;
@@ -92,33 +93,32 @@
 - (CMISRequest*)retrieveTypeDefinition:(NSString *)typeId
                        completionBlock:(void (^)(CMISTypeDefinition *typeDefinition, NSError *error))completionBlock
 {
-    NSString *repoUrl = [self getRepositoryUrlWithSelector:kCMISBrowserJSONSelectorTypeDefinition];
-    repoUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterTypeId value:typeId urlString:repoUrl];
+    NSString *repositoryId = self.bindingSession.repositoryId;
     
-    CMISRequest *cmisRequest = [[CMISRequest alloc] init];
+    // Check the cache first
+    CMISTypeDefinitionCache *typeDefinitionCache = self.bindingSession.typeDefinitionCache;
     
-    [self.bindingSession.networkProvider invokeGET:[NSURL URLWithString:repoUrl]
-                                           session:self.bindingSession
-                                       cmisRequest:cmisRequest
-                                   completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
-                                       if (httpResponse) {
-                                           NSData *data = httpResponse.data;
-                                           if (data) {
-                                               NSError *parsingError = nil;
-                                               CMISTypeDefinition *typeDef = [CMISBrowserUtil typeDefinitionFromJSONData:data error:&parsingError];
-                                               if (parsingError) {
-                                                   completionBlock(nil, parsingError);
-                                               }
-                                               else {
-                                                   completionBlock(typeDef, nil);
-                                               }
-                                           }
-                                       } else {
-                                           completionBlock(nil, error);
-                                       }
-                                   }];
-    
-    return cmisRequest;
+    CMISTypeDefinition *typeDefinition = [typeDefinitionCache typeDefinitionForTypeId:typeId repositoryId:repositoryId];
+    if(typeDefinition){
+        completionBlock(typeDefinition, nil);
+        
+        return nil; //TODO is it correct to return nil here?
+    } else {
+        CMISRequest *cmisRequest = [[CMISRequest alloc] init];
+        
+        [self retrieveTypeDefinitionInternal:typeId cmisRequest:cmisRequest completionBlock:^(CMISTypeDefinition *typeDefinition, NSError *error) {
+            if (error){
+                completionBlock(nil, error);
+            } else {
+                // Put it into the cache
+                [typeDefinitionCache addTypeDefinition:typeDefinition repositoryId:repositoryId];
+                
+                completionBlock(typeDefinition, nil);
+            }
+        }];
+        
+        return cmisRequest;
+    }
 }
 
 @end

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserUtil.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserUtil.h?rev=1589611&r1=1589610&r2=1589611&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserUtil.h (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserUtil.h Thu Apr 24 06:51:55 2014
@@ -22,6 +22,7 @@
 #import "CMISObjectData.h"
 #import "CMISObjectList.h"
 #import "CMISBindingSession.h"
+#import "CMISTypeCache.h"
 
 @interface CMISBrowserUtil : NSObject
 
@@ -38,12 +39,12 @@
 /**
  Returns a CMISObjectData object parsed from the given JSON data.
  */
-+ (CMISObjectData *)objectDataFromJSONData:(NSData *)jsonData error:(NSError **)outError;
++ (void)objectDataFromJSONData:(NSData *)jsonData typeCache:(CMISTypeCache *)typeCache completionBlock:(void(^)(CMISObjectData *objectData, NSError *error))completionBlock;
 
 /**
  Returns a CMISObjectList object parsed from the given JSON data.
  */
-+ (CMISObjectList *)objectListFromJSONData:(NSData *)jsonData error:(NSError **)outError;
++ (void)objectListFromJSONData:(NSData *)jsonData typeCache:(CMISTypeCache *)typeCache completionBlock:(void(^)(CMISObjectList *objectList, NSError *error))completionBlock;
 
 /**
  Returns an array of CMISRenditionData objects, parsed from the given JSON data.

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserUtil.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserUtil.m?rev=1589611&r1=1589610&r2=1589611&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserUtil.m (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserUtil.m Thu Apr 24 06:51:55 2014
@@ -116,10 +116,10 @@
                 typeDef = [CMISRelationshipTypeDefinition new];
                 
                 id allowedSourceTypes = [jsonDictionary cmis_objectForKeyNotNull:kCMISBrowserJSONAllowedSourceTypes];
-                if([allowedSourceTypes isKindOfClass:NSArray.class]){
+                if ([allowedSourceTypes isKindOfClass:NSArray.class]){
                     NSMutableArray *types = [[NSMutableArray alloc] init];
                     for (id type in allowedSourceTypes) {
-                        if(type){
+                        if (type){
                             [types addObject:type];
                         }
                     }
@@ -127,10 +127,10 @@
                 }
                 
                 id allowedTargetTypes = [jsonDictionary cmis_objectForKeyNotNull:kCMISBrowserJSONAllowedTargetTypes];
-                if([allowedTargetTypes isKindOfClass:NSArray.class]){
+                if ([allowedTargetTypes isKindOfClass:NSArray.class]){
                     NSMutableArray *types = [[NSMutableArray alloc] init];
                     for (id type in allowedTargetTypes) {
-                        if(type){
+                        if (type){
                             [types addObject:type];
                         }
                     }
@@ -179,7 +179,7 @@
     return typeDef;
 }
 
-+ (CMISObjectData *)objectDataFromJSONData:(NSData *)jsonData error:(NSError **)outError
++ (void)objectDataFromJSONData:(NSData *)jsonData typeCache:(CMISTypeCache *)typeCache completionBlock:(void(^)(CMISObjectData *objectData, NSError *error))completionBlock
 {
     // TODO: error handling i.e. if jsonData is nil, also handle outError being nil
 
@@ -187,16 +187,17 @@
     NSError *serialisationError = nil;
     id jsonDictionary = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&serialisationError];
     
-    CMISObjectData *objectData = nil;
     if (!serialisationError) {
         // parse the json into a CMISObjectData object
-        objectData = [CMISBrowserUtil convertObject:jsonDictionary];
+        [CMISBrowserUtil convertObject:jsonDictionary typeCache:typeCache completionBlock:^(CMISObjectData *objectData, NSError *error) {
+            completionBlock(objectData, error);
+        }];
+    } else {
+        completionBlock(nil, [CMISErrors cmisError:serialisationError cmisErrorCode:kCMISErrorCodeRuntime]);
     }
-    
-    return objectData;
 }
 
-+ (CMISObjectList *)objectListFromJSONData:(NSData *)jsonData error:(NSError **)outError
++ (void)objectListFromJSONData:(NSData *)jsonData typeCache:(CMISTypeCache *)typeCache completionBlock:(void(^)(CMISObjectList *objectList, NSError *error))completionBlock
 {
     // TODO: error handling i.e. if jsonData is nil, also handle outError being nil
     
@@ -210,9 +211,8 @@
         objectList = [CMISObjectList new];
         
         // parse the objects
-        BOOL isArray = [jsonDictionary isKindOfClass:NSArray.class];
         NSArray *objectsArray;
-        if(isArray){
+        if ([jsonDictionary isKindOfClass:NSArray.class]){
             objectsArray = jsonDictionary;
             
             objectList.hasMoreItems = NO;
@@ -224,27 +224,20 @@
             objectList.hasMoreItems = [jsonDictionary cmis_boolForKey:kCMISBrowserJSONHasMoreItems];
             objectList.numItems = [jsonDictionary cmis_intForKey:kCMISBrowserJSONNumberItems];
         }
-        if (objectsArray) {
-            NSMutableArray *objects = [NSMutableArray arrayWithCapacity:objectsArray.count];
-            for (NSDictionary *dictionary in objectsArray) {
-                NSDictionary *objectDictionary;
-                if(isArray){
-                    objectDictionary = dictionary;
-                } else {
-                    objectDictionary = [dictionary cmis_objectForKeyNotNull:kCMISBrowserJSONObject];
-                }
-                CMISObjectData *objectData = [CMISBrowserUtil convertObject:objectDictionary];
-                if(objectData){
-                    [objects addObject:objectData];
-                }
+        
+        [CMISBrowserUtil convertObjects:objectsArray typeCache:typeCache completionBlock:^(NSArray *objects, NSError *error) {
+            if (error){
+                completionBlock(nil, error);
+            } else {
+                // pass objects to list
+                objectList.objects = objects;
+                
+                completionBlock(objectList, nil);
             }
-            
-            // pass objects to list
-            objectList.objects = objects;
-        }
+        }];
+    } else {
+        completionBlock(nil, [CMISErrors cmisError:serialisationError cmisErrorCode:kCMISErrorCodeRuntime]);
     }
-    
-    return objectList;
 }
 
 + (NSArray *)renditionsFromJSONData:(NSData *)jsonData error:(NSError **)outError
@@ -267,10 +260,10 @@
 #pragma mark -
 #pragma mark Private helper methods
 
-+ (CMISObjectData *)convertObject:(NSDictionary *)dictionary
++ (void)convertObject:(NSDictionary *)dictionary typeCache:(CMISTypeCache *)typeCache completionBlock:(void(^)(CMISObjectData *objectData, NSError *error))completionBlock
 {
-    if(!dictionary) {
-        return nil;
+    if (!dictionary) {
+        completionBlock(nil, nil);
     }
     
     CMISObjectData *objectData = [CMISObjectData new];
@@ -287,79 +280,336 @@
     
     // set the properties
     NSDictionary *propertiesExtension = [dictionary cmis_objectForKeyNotNull:kCMISBrowserJSONPropertiesExtension];
-    objectData.properties = [CMISBrowserUtil convertSuccinctProperties:propertiesJson propertiesExtension:propertiesExtension];
     
-    // relationships
-    NSArray *relationshipsJson = [dictionary cmis_objectForKeyNotNull:kCMISBrowserJSONRelationships];
-    objectData.relationships = [CMISBrowserUtil convertObjects:relationshipsJson];
-    
-    //renditions
-    NSArray *renditionsJson = [dictionary cmis_objectForKeyNotNull:kCMISBrowserJSONRenditions];
-    objectData.renditions = [self renditionsFromArray:renditionsJson];
+    [CMISBrowserUtil convertSuccinctProperties:propertiesJson propertiesExtension:propertiesExtension typeCache:typeCache completionBlock:^(CMISProperties *properties, NSError *error) {
+        if (error){
+            completionBlock(nil, error);
+        } else {
+            objectData.properties = properties;
+            
+            // relationships
+            NSArray *relationshipsJson = [dictionary cmis_objectForKeyNotNull:kCMISBrowserJSONRelationships];
+            [CMISBrowserUtil convertObjects:relationshipsJson typeCache:typeCache completionBlock:^(NSArray *objects, NSError *error) {
+                if (error){
+                    completionBlock(nil, error);
+                } else {
+                    objectData.relationships = objects;
+                    
+                    //renditions
+                    NSArray *renditionsJson = [dictionary cmis_objectForKeyNotNull:kCMISBrowserJSONRenditions];
+                    objectData.renditions = [self renditionsFromArray:renditionsJson];
+                    
+                    // handle extensions
+                    objectData.extensions = [CMISBrowserUtil convertExtensions:dictionary cmisKeys:[CMISBrowserConstants objectKeys]];
+                    
+                    completionBlock(objectData, nil);
+                }
+            }];
+        }
+
+    }];
+}
+
++ (void)convertObjects:(NSArray *)objectsArray position:(NSInteger)position convertedObjects:(NSMutableArray *)convertedObjects typeCache:(CMISTypeCache *)typeCache completionBlock:(void(^)(NSArray* objects, NSError *error))completionBlock
+{
+    NSDictionary *dictionary = [objectsArray objectAtIndex:position];
+    NSDictionary *objectDictionary = [dictionary cmis_objectForKeyNotNull:kCMISBrowserJSONObject];
+    if (!objectDictionary) {
+        objectDictionary = dictionary;
+    }
+
+    if(![objectDictionary isKindOfClass:NSDictionary.class]){
+        completionBlock(nil, [CMISErrors createCMISErrorWithCode:kCMISErrorCodeInvalidArgument detailedDescription:[NSString stringWithFormat:@"expected a dictionary but was %@", objectDictionary.class]]);
+    }
+    [CMISBrowserUtil convertObject:objectDictionary typeCache:typeCache completionBlock:^(CMISObjectData *objectData, NSError *error) {
+        if (position == 0) {
+            [convertedObjects addObject:objectData];
+            completionBlock(convertedObjects, error);
+        } else {
+            // TODO check if there is a better way on how to avoid a large call stack
+            // We need to do this workaround or else we would end up with a very large call stack
+            [CMISBrowserUtil performBlock:^{
+                [self convertObjects:objectsArray
+                            position:(position -1)
+                    convertedObjects:convertedObjects
+                           typeCache:typeCache
+                     completionBlock:^(NSArray *objects, NSError *error) {
+                         [convertedObjects addObject:objectData];
+                         completionBlock(objects, error);
+                     }];
+            }];
+        }
+    }];
+
+}
+
++ (void)convertObjects:(NSArray *)objectsArray typeCache:(CMISTypeCache *)typeCache completionBlock:(void(^)(NSArray* objects, NSError *error))completionBlock
+{
+    NSMutableArray *objects = [NSMutableArray arrayWithCapacity:objectsArray.count];
+    if (objectsArray.count > 0) {
+        [CMISBrowserUtil convertObjects:objectsArray
+                               position:(objectsArray.count - 1) // start recursion with last item
+                       convertedObjects:objects
+                                 typeCache:typeCache
+                           completionBlock:^(NSArray *objects, NSError *error) {
+                               completionBlock(objects, error);
+                           }];
+    } else {
+        completionBlock([NSArray array], nil);
+    }
+}
+
++ (void)convertSuccinctProperties:(NSDictionary *)propertiesJson propertiesExtension:(NSDictionary *)extJson typeCache:(CMISTypeCache *)typeCache completionBlock:(void(^)(CMISProperties *properties, NSError *error))completionBlock
+{
+    if (!propertiesJson) {
+        completionBlock(nil, nil);
+    }
     
-    // handle extensions
-    objectData.extensions = [CMISBrowserUtil convertExtensions:dictionary cmisKeys:[CMISBrowserConstants objectKeys]];
+    void (^continueConvertSuccinctPropertiesAndGetSecondaryObjectTypeDefinitions)(CMISTypeDefinition*) = ^(CMISTypeDefinition *typeDef) {
+        
+        void (^continueConvertSuccinctPropertiesSecondaryObjectTypeDefinitions)(NSArray*) = ^(NSArray *secTypeDefs) {
+            
+            [self convertProperties:propertiesJson typeCache:typeCache typeDefinition:typeDef secondaryTypeDefinitions:secTypeDefs completionBlock:^(CMISProperties *properties, NSError *error){
+                if (extJson){
+                    properties.extensions = [CMISBrowserUtil convertExtensions:extJson cmisKeys:[NSSet set]];
+                }
+                
+                completionBlock(properties, nil);
+            }];
+        };
+        
+        // Get secondary object type definitions
+        NSArray *secTypeIds = [propertiesJson cmis_objectForKeyNotNull:kCMISPropertySecondaryObjectTypeIds];
+        if (secTypeIds != nil && secTypeIds.count > 0) {
+            [CMISBrowserUtil retrieveTypeDefinitions:secTypeIds typeCache:typeCache completionBlock:^(NSArray *typeDefinitions, NSError *error) {
+                continueConvertSuccinctPropertiesSecondaryObjectTypeDefinitions(typeDefinitions);
+            }];
+        } else {
+            continueConvertSuccinctPropertiesSecondaryObjectTypeDefinitions(nil);
+        }
+    };
     
-    return objectData;
+    // Get type definition for given object type id
+    CMISTypeDefinition *typeDef = nil;
+    if ([[propertiesJson cmis_objectForKeyNotNull:kCMISPropertyObjectTypeId] isKindOfClass:NSString.class]){
+        [typeCache typeDefinition:[propertiesJson cmis_objectForKeyNotNull:kCMISPropertyObjectTypeId] completionBlock:^(CMISTypeDefinition *typeDef, NSError *error){
+            continueConvertSuccinctPropertiesAndGetSecondaryObjectTypeDefinitions(typeDef);
+        }];
+    } else {
+        continueConvertSuccinctPropertiesAndGetSecondaryObjectTypeDefinitions(typeDef);
+    }
 }
 
-+ (NSArray *)convertObjects:(NSArray *)json
-{
-    if (!json){
-        return nil;
++(void)convertProperty:(NSString *)propName propertiesJson:(NSDictionary *)propertiesJson typeCache:(CMISTypeCache *)typeCache typeDefinition:(CMISTypeDefinition *)typeDef secondaryTypeDefinitions:(NSArray *)secTypeDefs completionBlock:(void(^)(CMISPropertyData *propertyData, NSError *error))completionBlock {
+    CMISPropertyDefinition *propDef = nil;
+    if (typeDef){
+        propDef = typeDef.propertyDefinitions[propName];
     }
     
-    NSMutableArray *result = [[NSMutableArray alloc] init];
-    for (id obj in json) {
-        //TODO check if obj is NSDictionary or else abort with error
-        CMISObjectData *relationship = [CMISBrowserUtil convertObject:obj];
-        if(relationship){
-            [result addObject:relationship];
+    if (propDef == nil && secTypeDefs != nil) {
+        for (CMISTypeDefinition *secTypeDef in secTypeDefs) {
+            propDef = secTypeDef.propertyDefinitions[propName];
+            if (propDef){
+                break;
+            }
         }
     }
     
-    return result;
+    void (^continueConvertSuccinctPropertiesTypeDefinitionDocument)(CMISPropertyDefinition*) = ^(CMISPropertyDefinition *propDef) {
+        
+        void (^continueConvertSuccinctPropertiesTypeDefinitionFolder)(CMISPropertyDefinition*) = ^(CMISPropertyDefinition *propDef) {
+            
+            id propValue = [propertiesJson cmis_objectForKeyNotNull:propName];
+            NSArray *values = nil;
+            if ([propValue isKindOfClass:NSArray.class]) {
+                values = propValue;
+            } else if (propValue) {
+                values = [NSArray arrayWithObject:propValue];
+            }
+            
+            CMISPropertyData *propertyData;
+            
+            if (propDef){
+                
+                switch (propDef.propertyType) {
+                    case CMISPropertyTypeString:
+                    case CMISPropertyTypeId:
+                    case CMISPropertyTypeBoolean:
+                    case CMISPropertyTypeInteger:
+                    case CMISPropertyTypeDecimal:
+                    case CMISPropertyTypeHtml:
+                    case CMISPropertyTypeUri:
+                        propertyData = [CMISPropertyData createPropertyForId:propName arrayValue:values type:propDef.propertyType];
+                        break;
+                    case CMISPropertyTypeDateTime: {
+                        NSArray *dateValues = [CMISBrowserUtil convertNumbersToDates:values];
+                        propertyData = [CMISPropertyData createPropertyForId:propName arrayValue:dateValues type:propDef.propertyType];
+                        break;
+                    }
+                    default: {
+                        NSError *error = [CMISErrors createCMISErrorWithCode:kCMISErrorCodeInvalidArgument
+                                                         detailedDescription:@"Unknown property type!"];
+                        completionBlock(nil, error);
+                        return;
+                    }
+                }
+                propertyData.identifier = propName;
+                propertyData.displayName = propDef.displayName;
+                propertyData.queryName = propDef.queryName;
+                propertyData.localName = propDef.localName;
+            } else {
+                // this else block should only be reached in rare circumstances
+                // it may return incorrect types
+                if (values == nil) {
+                    propertyData = [CMISPropertyData createPropertyForId:propName arrayValue:nil type:CMISPropertyTypeString];
+                } else {
+                    id firstValue = values[0];
+                    if ([firstValue isKindOfClass:NSNumber.class]) {
+                        propertyData = [CMISPropertyData createPropertyForId:propName arrayValue:values type:CMISPropertyTypeInteger];
+                    } else {
+                        propertyData = [CMISPropertyData createPropertyForId:propName arrayValue:values type:CMISPropertyTypeString];
+                    }
+                }
+                
+                propertyData.identifier = propName;
+                propertyData.displayName = propName;
+                propertyData.queryName = nil;
+                propertyData.localName = nil;
+            }
+            
+            completionBlock(propertyData, nil);
+        };
+        
+        if (!propDef) { //try to find property definition on folder
+            [typeCache typeDefinition:kCMISPropertyObjectTypeIdValueFolder completionBlock:^(CMISTypeDefinition *typeDefinition, NSError *error) {
+                CMISPropertyDefinition *propertyDefinition = typeDefinition.propertyDefinitions[propName];
+                continueConvertSuccinctPropertiesTypeDefinitionFolder(propertyDefinition);
+            }];
+        } else {
+            continueConvertSuccinctPropertiesTypeDefinitionFolder(propDef);
+        }
+        
+    };
+    
+    if (!propDef) { //try to find property definition on document
+        [typeCache typeDefinition:kCMISPropertyObjectTypeIdValueDocument completionBlock:^(CMISTypeDefinition *typeDefinition, NSError *error) {
+            CMISPropertyDefinition *propertyDefinition = typeDefinition.propertyDefinitions[propName];
+            continueConvertSuccinctPropertiesTypeDefinitionDocument(propertyDefinition);
+        }];
+    } else {
+        continueConvertSuccinctPropertiesTypeDefinitionDocument(propDef);
+    }
 }
 
-+ (CMISProperties *)convertSuccinctProperties:(NSDictionary *)propertiesJson propertiesExtension:(NSDictionary *)extJson
++ (NSArray *)convertNumbersToDates:(NSArray *)numbers
 {
-    if(!propertiesJson) {
+    if(!numbers) {
         return nil;
     }
     
-    // TODO convert properties according to typeDefinition
-    
+    NSMutableArray *dates = [[NSMutableArray alloc] initWithCapacity:numbers.count];
+    for (NSNumber *number in numbers) {
+        NSDate *date = [NSDate dateWithTimeIntervalSinceReferenceDate:[number doubleValue]];
+        [dates addObject:date];
+    }
+    return dates;
+}
+
++ (void)convertProperties:(NSArray*)propNames position:(NSInteger)position properties:(CMISProperties *)properties propertiesJson:(NSDictionary *)propertiesJson typeCache:(CMISTypeCache *)typeCache typeDefinition:(CMISTypeDefinition *)typeDef secondaryTypeDefinitions:(NSArray *)secTypeDefs completionBlock:(void (^)(CMISProperties *properties, NSError *error))completionBlock
+{
+    NSString *propName = [propNames objectAtIndex:position];
+    
+    [self convertProperty:propName
+           propertiesJson:propertiesJson
+                typeCache:typeCache
+           typeDefinition:typeDef
+ secondaryTypeDefinitions:secTypeDefs
+          completionBlock:^(CMISPropertyData *propertyData, NSError *error) {
+              
+              if (position == 0) {
+                  [properties addProperty:propertyData];
+                  completionBlock(properties, error);
+              } else {
+                  // TODO check if there is a better way on how to avoid a large call stack
+                  // We need to do this workaround or else we would end up with a very large call stack
+                  [CMISBrowserUtil performBlock:^{
+                      [self convertProperties:propNames
+                                     position:(position -1)
+                                   properties:properties
+                               propertiesJson:propertiesJson
+                                    typeCache:typeCache
+                               typeDefinition:typeDef
+                     secondaryTypeDefinitions:secTypeDefs
+                              completionBlock:^(CMISProperties *properties, NSError *error) {
+                                  [properties addProperty:propertyData];
+                                  completionBlock(properties, error);
+                                  
+                              }];
+                  }];
+              }
+          }];
+}
+
++ (void)convertProperties:(NSDictionary *)propertiesJson typeCache:(CMISTypeCache *)typeCache typeDefinition:(CMISTypeDefinition *)typeDef secondaryTypeDefinitions:(NSArray *)secTypeDefs completionBlock:(void(^)(CMISProperties *properties, NSError *error))completionBlock
+{
     // create properties
     CMISProperties *properties = [CMISProperties new];
+    
     NSArray *propNames = [propertiesJson allKeys];
-    for (NSString *propName in propNames) {
-        CMISPropertyData *propertyData;
-        id propValue = [propertiesJson cmis_objectForKeyNotNull:propName];
-        if ([propValue isKindOfClass:[NSArray class]]) {
-            propertyData = [CMISPropertyData createPropertyForId:propName arrayValue:propValue type:CMISPropertyTypeString];
-        }
-        else {
-            if(propValue){
-                propertyData = [CMISPropertyData createPropertyForId:propName stringValue:propValue];
-            } else {
-                //TODO create convenient method for nil values?
-                propertyData = [CMISPropertyData createPropertyForId:propName arrayValue:[NSArray array] type:CMISPropertyTypeString];
-            }
-        }
-        
-        [properties addProperty:propertyData];
+    if (propNames.count > 0) {
+        [CMISBrowserUtil convertProperties:propNames
+                                        position:(propNames.count - 1) // start recursion with last item
+                                properties:properties
+                            propertiesJson:propertiesJson
+                                 typeCache:typeCache
+                            typeDefinition:typeDef
+                  secondaryTypeDefinitions:secTypeDefs
+                           completionBlock:^(CMISProperties *properties, NSError *error) {
+                                     completionBlock(properties, error);
+                                 }];
+    } else {
+        completionBlock(properties, nil);
     }
-    
-    if(extJson){
-        properties.extensions = [CMISBrowserUtil convertExtensions:extJson cmisKeys:[NSSet set]];
+}
+
++ (void)retrieveTypeDefinitions:(NSArray *)objectTypeIds position:(NSInteger)position typeCache:(CMISTypeCache *)typeCache completionBlock:(void (^)(NSMutableArray *typeDefinitions, NSError *error))completionBlock
+{
+    [typeCache typeDefinition:[objectTypeIds objectAtIndex:position]
+              completionBlock:^(CMISTypeDefinition *typeDefinition, NSError *error) {
+                             if (error){
+                                 completionBlock(nil, error);
+                             } else {
+                                 if (position == 0) {
+                                     NSMutableArray *typeDefinitions = [[NSMutableArray alloc] initWithCapacity:objectTypeIds.count];
+                                     [typeDefinitions addObject:typeDefinition];
+                                     completionBlock(typeDefinitions, error);
+                                 } else {
+                                     [self retrieveTypeDefinitions:objectTypeIds position:(position - 1) typeCache:typeCache completionBlock:^(NSMutableArray *typeDefinitions, NSError *error) {
+                                         [typeDefinitions addObject:typeDefinition];
+                                         completionBlock(typeDefinitions, error);
+                                     }];
+                                 }
+                             }
+                         }];
+}
+
++ (void)retrieveTypeDefinitions:(NSArray *)objectTypeIds typeCache:(CMISTypeCache *)typeCache completionBlock:(void (^)(NSArray *typeDefinitions, NSError *error))completionBlock
+{
+    if (objectTypeIds.count > 0) {
+        [CMISBrowserUtil retrieveTypeDefinitions:objectTypeIds
+                                        position:(objectTypeIds.count - 1) // start recursion with last item
+                                       typeCache:typeCache
+                                 completionBlock:^(NSMutableArray *typeDefinitions, NSError *error) {
+                                     completionBlock(typeDefinitions, error);
+                                 }];
+    } else {
+        completionBlock([[NSArray alloc] init], nil);
     }
-    
-    return properties;
 }
 
 + (NSArray *)renditionsFromArray:(NSArray *)array
 {
-    if(!array) {
+    if (!array) {
         return nil;
     }
     NSMutableArray *renditions = [[NSMutableArray alloc] initWithCapacity:array.count];
@@ -385,7 +635,7 @@
 
 + (CMISPropertyDefinition *)convertPropertyDefinition:(NSDictionary *)propertyDictionary
 {
-    if(!propertyDictionary){
+    if (!propertyDictionary){
         return nil;
     }
     
@@ -523,4 +773,15 @@
     return extensions;
 }
 
+// TODO could be moved to category
++ (void)performBlock:(void (^)(void))block
+{
+    [CMISBrowserUtil performSelector:@selector(executeBlock:) onThread:[NSThread currentThread] withObject:block waitUntilDone:NO];
+}
+
++ (void)executeBlock:(void (^)(void))block {
+    block();
+}
+
+
 @end

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserVersioningService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserVersioningService.m?rev=1589611&r1=1589610&r2=1589611&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserVersioningService.m (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserVersioningService.m Thu Apr 24 06:51:55 2014
@@ -45,7 +45,7 @@
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludePolicyIds boolValue:includePolicyIds urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeAcl boolValue:includeACL urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterReturnVersion value:[CMISEnums stringForReturnVersion:major] urlString:objectUrl];
-    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterSuccinct value:kCMISParameterValueTrue urlString:objectUrl];
+    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISBrowserJSONParameterSuccinct value:kCMISParameterValueTrue urlString:objectUrl];
     
     CMISRequest *cmisRequest = [[CMISRequest alloc] init];
     
@@ -54,14 +54,16 @@
                                        cmisRequest:cmisRequest
                                    completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
                                        if (httpResponse.statusCode == 200 && httpResponse.data) {
+                                           CMISTypeCache *typeCache = [[CMISTypeCache alloc] initWithRepositoryId:self.bindingSession.repositoryId bindingService:self];
                                            NSError *parsingError = nil;
-                                           CMISObjectData *objectData = [CMISBrowserUtil objectDataFromJSONData:httpResponse.data error:&parsingError];
-                                           if (parsingError)
-                                           {
-                                               completionBlock(nil, parsingError);
-                                           } else {
-                                               completionBlock(objectData, nil);
-                                           }
+                                           [CMISBrowserUtil objectDataFromJSONData:httpResponse.data typeCache:typeCache completionBlock:^(CMISObjectData *objectData, NSError *error) {
+                                               if (error) {
+                                                   completionBlock(nil, parsingError);
+                                               } else {
+                                                   completionBlock(objectData, nil);
+                                               }
+                                           }];
+                                          
                                        } else {
                                            completionBlock(nil, error);
                                        }
@@ -78,7 +80,7 @@
     NSString *objectUrl = [self getObjectUrlObjectId:objectId selector:kCMISBrowserJSONSelectorVersions];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterFilter value:filter urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeAllowableActions value:(includeAllowableActions ? @"true" : @"false") urlString:objectUrl];
-    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterSuccinct value:@"true" urlString:objectUrl];
+    objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISBrowserJSONParameterSuccinct value:@"true" urlString:objectUrl];
     
     CMISRequest *cmisRequest = [[CMISRequest alloc] init];
     
@@ -87,14 +89,14 @@
                                        cmisRequest:cmisRequest
                                    completionBlock:^(CMISHttpResponse *httpResponse, NSError *error) {
                                        if (httpResponse.statusCode == 200 && httpResponse.data) {
-                                           NSError *parsingError = nil;
-                                           CMISObjectList *objectList = [CMISBrowserUtil objectListFromJSONData:httpResponse.data error:&parsingError];
-                                           if (!objectList.objects)
-                                           {
-                                               completionBlock(nil, parsingError);
-                                           } else {
-                                               completionBlock(objectList.objects, nil);
-                                           }
+                                           CMISTypeCache *typeCache = [[CMISTypeCache alloc] initWithRepositoryId:self.bindingSession.repositoryId bindingService:self];
+                                           [CMISBrowserUtil objectListFromJSONData:httpResponse.data typeCache:typeCache completionBlock:^(CMISObjectList *objectList, NSError *error) {
+                                               if (error) {
+                                                   completionBlock(nil, error);
+                                               } else {
+                                                   completionBlock(objectList.objects, nil);
+                                               }
+                                           }];
                                        } else {
                                            completionBlock(nil, error);
                                        }

Added: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISNSDictionary+CMISUtil.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISNSDictionary%2BCMISUtil.h?rev=1589611&view=auto
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISNSDictionary+CMISUtil.h (added)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISNSDictionary+CMISUtil.h Thu Apr 24 06:51:55 2014
@@ -0,0 +1,33 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+@interface NSDictionary (CMISUtil)
+
+///returns the object or nil if value is NSNull for given key
+- (id)cmis_objectForKeyNotNull:(id)aKey;
+
+///convenient method; returns BOOL value or NO if value is NSNull for given key
+- (BOOL)cmis_boolForKey:(id)aKey;
+
+///convenient method; returns int value or 0 if value is NSNull for given key
+- (int)cmis_intForKey:(id)aKey;
+
+@end

Added: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISNSDictionary+CMISUtil.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISNSDictionary%2BCMISUtil.m?rev=1589611&view=auto
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISNSDictionary+CMISUtil.m (added)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISNSDictionary+CMISUtil.m Thu Apr 24 06:51:55 2014
@@ -0,0 +1,40 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CMISNSDictionary+CMISUtil.h"
+
+@implementation NSDictionary (CMISUtil)
+
+- (id)cmis_objectForKeyNotNull:(id)aKey
+{
+    id value = self[aKey];
+    return value == [NSNull null] ? nil : value;
+}
+
+- (BOOL)cmis_boolForKey:(id)aKey
+{
+    return [[self cmis_objectForKeyNotNull:aKey] boolValue];
+}
+
+- (int)cmis_intForKey:(id)aKey
+{
+    return [[self cmis_objectForKeyNotNull:aKey] intValue];
+}
+
+@end

Added: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISTypeCache.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISTypeCache.h?rev=1589611&view=auto
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISTypeCache.h (added)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISTypeCache.h Thu Apr 24 06:51:55 2014
@@ -0,0 +1,31 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import "CMISTypeDefinition.h"
+#import "CMISBrowserBaseService.h"
+
+@interface CMISTypeCache : NSObject
+
+- (id)initWithRepositoryId:(NSString *)repositoryId bindingService:(CMISBrowserBaseService *)service;
+
+- (CMISRequest *)typeDefinition:(NSString *)typeId
+                       completionBlock:(void (^)(CMISTypeDefinition *typeDefinition, NSError *error))completionBlock;
+
+@end

Added: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISTypeCache.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISTypeCache.m?rev=1589611&view=auto
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISTypeCache.m (added)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISTypeCache.m Thu Apr 24 06:51:55 2014
@@ -0,0 +1,73 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CMISTypeCache.h"
+#import "CMISTypeDefinition.h"
+#import "CMISBrowserBaseService+Protected.h"
+#import "CMISRequest.h"
+#import "CMISTypeDefinitionCache.h"
+#import "CMISBindingSession.h"
+
+@interface CMISTypeCache ()
+
+@property (nonatomic, weak) NSString * repositoryId;
+@property (nonatomic, weak) CMISBrowserBaseService * service;
+
+@end
+
+@implementation CMISTypeCache
+
+
+-(id)initWithRepositoryId:(NSString *)repositoryId bindingService:(CMISBrowserBaseService *)service
+{
+    self = [super init];
+    if (self) {
+        _repositoryId = repositoryId;
+        _service = service;
+    }
+    return self;
+}
+
+- (CMISRequest *)typeDefinition:(NSString *)typeId
+                       completionBlock:(void (^)(CMISTypeDefinition *typeDefinition, NSError *error))completionBlock
+{
+    CMISTypeDefinitionCache *cache = _service.bindingSession.typeDefinitionCache;
+    CMISRequest *request = nil;
+    CMISTypeDefinition *typeDefinition = [cache typeDefinitionForTypeId:typeId repositoryId:self.repositoryId];
+    if (!typeDefinition) { // Retrieve type definition from server
+        request = [[CMISRequest alloc] init];
+        [_service retrieveTypeDefinitionInternal:typeId cmisRequest:request completionBlock:^(CMISTypeDefinition *typeDefinition, NSError *error){
+            if (error) {
+                completionBlock(nil, error);
+            } else {
+                if (typeDefinition) { // Store type definition in cache
+                    [cache addTypeDefinition:typeDefinition repositoryId:self.repositoryId];
+                }
+                
+                completionBlock(typeDefinition, nil);
+            }
+        }];
+    } else { // Type definition from cache
+        completionBlock(typeDefinition, nil);
+    }
+    
+    return request;
+}
+
+@end

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISBindingSession.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISBindingSession.h?rev=1589611&r1=1589610&r2=1589611&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISBindingSession.h (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISBindingSession.h Thu Apr 24 06:51:55 2014
@@ -21,6 +21,7 @@
 #import "CMISSessionParameters.h"
 #import "CMISAuthenticationProvider.h"
 #import "CMISNetworkProvider.h"
+#import "CMISTypeDefinitionCache.h"
 
 // session key constants
 extern NSString * const kCMISBindingSessionKeyUrl;
@@ -35,6 +36,7 @@ extern NSString * const kCMISBindingSess
 @property (nonatomic, strong, readonly) NSString *repositoryId;
 @property (nonatomic, strong, readonly) id<CMISAuthenticationProvider> authenticationProvider;
 @property (nonatomic, strong, readonly) id<CMISNetworkProvider> networkProvider;
+@property (nonatomic, strong, readonly) CMISTypeDefinitionCache *typeDefinitionCache;
 
 - (id)initWithSessionParameters:(CMISSessionParameters *)sessionParameters;
 

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISBindingSession.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISBindingSession.m?rev=1589611&r1=1589610&r2=1589611&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISBindingSession.m (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISBindingSession.m Thu Apr 24 06:51:55 2014
@@ -30,6 +30,7 @@ NSString * const kCMISBindingSessionKeyT
 @property (nonatomic, strong, readwrite) NSString *repositoryId;
 @property (nonatomic, strong, readwrite) id<CMISAuthenticationProvider> authenticationProvider;
 @property (nonatomic, strong, readwrite) id<CMISNetworkProvider> networkProvider;
+@property (nonatomic, strong, readwrite) CMISTypeDefinitionCache *typeDefinitionCache;
 @property (nonatomic, strong, readwrite) NSMutableDictionary *sessionData;
 @end
 
@@ -59,6 +60,13 @@ NSString * const kCMISBindingSessionKeyT
         for (id key in sessionParameters.allKeys) {
             [self.sessionData setObject:[sessionParameters objectForKey:key] forKey:key];
         }
+        
+        //set type definition cache after other data stored in the dictionary as the cache size is retrieved from the sessionData in the init method of the CMISTypeDefinitionCache
+        if(sessionParameters.typeDefinitionCache == nil) {
+            self.typeDefinitionCache = [[CMISTypeDefinitionCache alloc] initWithBindingSession:self];
+        } else {
+            self.typeDefinitionCache = sessionParameters.typeDefinitionCache;
+        }
     }
     
     return self;

Added: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISTypeDefinitionCache.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISTypeDefinitionCache.h?rev=1589611&view=auto
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISTypeDefinitionCache.h (added)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/CMISTypeDefinitionCache.h Thu Apr 24 06:51:55 2014
@@ -0,0 +1,52 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import "CMISTypeDefinition.h"
+
+@class CMISBindingSession;
+
+@interface CMISTypeDefinitionCache : NSObject
+
+- (id)initWithBindingSession:(CMISBindingSession *)bindingSession;
+
+/**
+ * Adds a type definition object to the cache.
+ */
+- (void)addTypeDefinition:(CMISTypeDefinition *)typeDefinition repositoryId:(NSString *)repositoryId;
+
+/**
+ * Retrieves a type definition object from the cache.
+ *
+ * @return the type definition object or nil if the object is
+ *         not in the cache
+ */
+- (CMISTypeDefinition *)typeDefinitionForTypeId:(NSString *)typeId repositoryId:(NSString *)repositoryId;
+
+/**
+ * Removes a type definition object from the cache.
+ */
+- (void)removeTypeDefinitionForTypeId:(NSString *)typeId repositoryId:(NSString *)repositoryId;
+
+/**
+ * Removes all cache entries.
+ */
+- (void)removeAll;
+
+@end



Mime
View raw message