chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gavincornw...@apache.org
Subject svn commit: r1592693 - in /chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS: Bindings/AtomPub/ Bindings/Browser/ Common/ Utils/
Date Tue, 06 May 2014 09:10:49 GMT
Author: gavincornwell
Date: Tue May  6 09:10:49 2014
New Revision: 1592693

URL: http://svn.apache.org/r1592693
Log:
Moved atom pub specific media types back to CMISAtomPubConstants class, converted the category
method declared in CMISURLUtils to a private helper method and renamed the get**Url methods
in CMISBrowserBaseService to follow Apple recommendations.

Modified:
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubConstants.h
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubConstants.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService.h
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService.m
    chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserDiscoveryService.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/CMISBrowserVersioningService.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/Utils/CMISURLUtil.m

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubConstants.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubConstants.h?rev=1592693&r1=1592692&r2=1592693&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubConstants.h
(original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubConstants.h
Tue May  6 09:10:49 2014
@@ -35,7 +35,6 @@ extern NSString * const kCMISAtomFeedNum
 // Entry
 extern NSString * const kCMISAtomEntry;
 extern NSString * const kCMISAtomEntryLink;
-extern NSString * const kCMISAtomEntryLinkTypeAtomFeed;
 extern NSString * const kCMISAtomEntryRel;
 extern NSString * const kCMISAtomEntryHref;
 extern NSString * const kCMISAtomEntryType;
@@ -68,6 +67,13 @@ extern NSString * const kCMISAtomEntryDi
 extern NSString * const kCMISAtomCollectionQuery;
 extern NSString * const kCMISAtomCollectionCheckedout;
 
+// Media Types
+extern NSString * const kCMISMediaTypeFeed;
+extern NSString * const kCMISMediaTypeEntry;
+extern NSString * const kCMISMediaTypeChildren;
+extern NSString * const kCMISMediaTypeDescendants;
+extern NSString * const kCMISMediaTypeQuery;
+
 // Links
 extern NSString * const kCMISLinkRelationDown;
 extern NSString * const kCMISLinkRelationUp;

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubConstants.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubConstants.m?rev=1592693&r1=1592692&r2=1592693&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubConstants.m
(original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/AtomPub/CMISAtomPubConstants.m
Tue May  6 09:10:49 2014
@@ -35,7 +35,6 @@ NSString * const kCMISAtomFeedNumItems =
 // Entry
 NSString * const kCMISAtomEntry = @"entry";
 NSString * const kCMISAtomEntryLink = @"link";
-NSString * const kCMISAtomEntryLinkTypeAtomFeed = @"application/atom+xml;type=feed";
 NSString * const kCMISAtomEntryRel = @"rel";
 NSString * const kCMISAtomEntryHref = @"href";
 NSString * const kCMISAtomEntryType = @"type";
@@ -68,6 +67,13 @@ NSString * const kCMISAtomEntryDirect = 
 NSString * const kCMISAtomCollectionQuery = @"query";
 NSString * const kCMISAtomCollectionCheckedout = @"checkedout";
 
+// Media Types
+NSString * const kCMISMediaTypeFeed = @"application/atom+xml;type=feed";
+NSString * const kCMISMediaTypeEntry = @"application/atom+xml;type=entry";
+NSString * const kCMISMediaTypeChildren = @"application/atom+xml;type=feed";
+NSString * const kCMISMediaTypeDescendants = @"application/cmistree+xml";
+NSString * const kCMISMediaTypeQuery = @"application/cmisquery+xml";
+
 // Links
 NSString * const kCMISLinkRelationDown = @"down";
 NSString * const kCMISLinkRelationUp = @"up";

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService.h?rev=1592693&r1=1592692&r2=1592693&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService.h
(original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService.h
Tue May  6 09:10:49 2014
@@ -27,10 +27,10 @@
 
 - (id)initWithBindingSession:(CMISBindingSession *)session;
 
-- (NSString *)getRepositoryUrl;
-- (NSString *)getObjectUrlObjectId:(NSString *)objectId;
-- (NSString *)getObjectUrlObjectId:(NSString *)objectId selector:(NSString *)selector;
-- (NSString *)getObjectUrlByPath:(NSString *)path selector:(NSString *)selector;
-- (NSString *)getRepositoryUrlWithSelector:(NSString *)selector;
+- (NSString *)retrieveRepositoryUrl;
+- (NSString *)retrieveRepositoryUrlWithSelector:(NSString *)selector;
+- (NSString *)retrieveObjectUrlForObjectWithId:(NSString *)objectId;
+- (NSString *)retrieveObjectUrlForObjectWithId:(NSString *)objectId selector:(NSString *)selector;
+- (NSString *)retrieveObjectUrlForObjectWithPath:(NSString *)path selector:(NSString *)selector;
 
 @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=1592693&r1=1592692&r2=1592693&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService.m
(original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserBaseService.m
Tue May  6 09:10:49 2014
@@ -41,13 +41,20 @@
     return self;
 }
 
-- (NSString *)getRepositoryUrl
+- (NSString *)retrieveRepositoryUrl
 {
     NSString *repoUrl = [self.bindingSession objectForKey:kCMISBrowserBindingSessionKeyRepositoryUrl];
     return repoUrl;
 }
 
-- (NSString *)getObjectUrlObjectId:(NSString *)objectId
+- (NSString *)retrieveRepositoryUrlWithSelector:(NSString *)selector
+{
+    NSString *repoUrl = [self retrieveRepositoryUrl];
+    repoUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISBrowserJSONParameterSelector
value:selector urlString:repoUrl];
+    return repoUrl;
+}
+
+- (NSString *)retrieveObjectUrlForObjectWithId:(NSString *)objectId
 {
     NSString *rootUrl = [self.bindingSession objectForKey:kCMISBrowserBindingSessionKeyRootFolderUrl];
     
@@ -56,14 +63,14 @@
     return objectUrl;
 }
 
-- (NSString *)getObjectUrlObjectId:(NSString *)objectId selector:(NSString *)selector
+- (NSString *)retrieveObjectUrlForObjectWithId:(NSString *)objectId selector:(NSString *)selector
 {
-    NSString *objectUrl = [self getObjectUrlObjectId:objectId];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectId];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISBrowserJSONParameterSelector
value:selector urlString:objectUrl];
     return objectUrl;
 }
 
-- (NSString *)getObjectUrlByPath:(NSString *)path selector:(NSString *)selector
+- (NSString *)retrieveObjectUrlForObjectWithPath:(NSString *)path selector:(NSString *)selector
 {
     NSString *rootUrl = [self.bindingSession objectForKey:kCMISBrowserBindingSessionKeyRootFolderUrl];
     
@@ -72,18 +79,11 @@
     return objectUrl;
 }
 
-- (NSString *)getRepositoryUrlWithSelector:(NSString *)selector
-{
-    NSString *repoUrl = [self getRepositoryUrl];
-    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];
+    NSString *repoUrl = [self retrieveRepositoryUrlWithSelector:kCMISBrowserJSONSelectorTypeDefinition];
     repoUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterTypeId value:typeId
urlString:repoUrl];
     
     [self.bindingSession.networkProvider invokeGET:[NSURL URLWithString:repoUrl]

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserDiscoveryService.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserDiscoveryService.m?rev=1592693&r1=1592692&r2=1592693&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserDiscoveryService.m
(original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserDiscoveryService.m
Tue May  6 09:10:49 2014
@@ -38,7 +38,7 @@ includeAllowableActions:(BOOL)includeAll
             skipCount:(NSNumber *)skipCount
       completionBlock:(void (^)(CMISObjectList *objectList, NSError *error))completionBlock
 {
-    NSString *url = [self getRepositoryUrl];
+    NSString *url = [self retrieveRepositoryUrl];
 
     // prepare form data
     CMISBroswerFormDataWriter *formData = [[CMISBroswerFormDataWriter alloc] initWithAction:kCMISBrowserJSONActionQuery];

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=1592693&r1=1592692&r2=1592693&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserNavigationService.m
(original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserNavigationService.m
Tue May  6 09:10:49 2014
@@ -38,7 +38,7 @@
                         maxItems:(NSNumber *)maxItems
                  completionBlock:(void (^)(CMISObjectList *objectList, NSError *error))completionBlock
 {
-    NSString *objectUrl = [self getObjectUrlObjectId:objectId selector:kCMISBrowserJSONSelectorChildren];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectId selector:kCMISBrowserJSONSelectorChildren];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterFilter value:filter
urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterOrderBy value:orderBy
urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeAllowableActions
boolValue:includeAllowableActions urlString:objectUrl];
@@ -81,7 +81,7 @@
               includeRelativePathSegment:(BOOL)includeRelativePathSegment
                          completionBlock:(void (^)(NSArray *parents, NSError *error))completionBlock
 {
-    NSString *objectUrl = [self getObjectUrlObjectId:objectId selector:kCMISBrowserJSONSelectorParents];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectId selector:kCMISBrowserJSONSelectorParents];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterFilter value:filter
urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeAllowableActions
boolValue:includeAllowableActions urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeRelationships
value:[CMISEnums stringForIncludeRelationShip:relationships] urlString:objectUrl];

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=1592693&r1=1592692&r2=1592693&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserObjectService.m
(original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserObjectService.m
Tue May  6 09:10:49 2014
@@ -41,7 +41,7 @@
        includeAllowableActions:(BOOL)includeAllowableActions
                completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
 {
-    NSString *objectUrl = [self getObjectUrlObjectId:objectId selector:kCMISBrowserJSONSelectorObject];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectId selector:kCMISBrowserJSONSelectorObject];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterFilter value:filter
urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeAllowableActions
boolValue:includeAllowableActions urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeRelationships
value:[CMISEnums stringForIncludeRelationShip:relationships] urlString:objectUrl];
@@ -83,7 +83,7 @@
              includeAllowableActions:(BOOL)includeAllowableActions
                      completionBlock:(void (^)(CMISObjectData *objectData, NSError *error))completionBlock
 {
-    NSString *objectUrl = [self getObjectUrlByPath:path selector:kCMISBrowserJSONSelectorObject];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithPath:path selector:kCMISBrowserJSONSelectorObject];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterFilter value:filter
urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeAllowableActions
boolValue:includeAllowableActions urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeRelationships
value:[CMISEnums stringForIncludeRelationShip:relationships] urlString:objectUrl];
@@ -219,7 +219,7 @@
     }
     
     // build URL
-    NSString *objectUrl = [self getObjectUrlObjectId:objectIdParam.inParameter];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectIdParam.inParameter];
     
     // prepare form data
     CMISBroswerFormDataWriter *formData = [[CMISBroswerFormDataWriter alloc] initWithAction:kCMISBrowserJSONActionDeleteContent];
@@ -315,7 +315,7 @@
     }
     
     // build URL
-    NSString *objectUrl = [self getObjectUrlObjectId:objectId.inParameter];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectId.inParameter];
     
     // prepare form data
     CMISBroswerFormDataWriter *formData = [[CMISBroswerFormDataWriter alloc] initWithAction:kCMISBrowserJSONActionSetContent
contentStream:inputStream mediaType:mimeType];
@@ -417,7 +417,7 @@
     }
     
     // build URL
-    NSString *folderObjectUrl = (folderObjectId != nil ? [self getObjectUrlObjectId:folderObjectId]
: [self getRepositoryUrl]);
+    NSString *folderObjectUrl = (folderObjectId != nil ? [self retrieveObjectUrlForObjectWithId:folderObjectId]
: [self retrieveRepositoryUrl]);
     
     // prepare form data
     CMISBroswerFormDataWriter *formData = [[CMISBroswerFormDataWriter alloc] initWithAction:kCMISBrowserJSONActionCreateDocument
contentStream:inputStream mediaType:mimeType];
@@ -475,7 +475,7 @@
              completionBlock:(void (^)(BOOL objectDeleted, NSError *error))completionBlock
 {
     // build URL
-    NSString *objectUrl = [self getObjectUrlObjectId:objectId];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectId];
     
     CMISBroswerFormDataWriter *formData = [[CMISBroswerFormDataWriter alloc] initWithAction:kCMISBrowserJSONActionDelete];
     [formData addParameter:kCMISParameterAllVersions boolValue:allVersions];
@@ -504,7 +504,7 @@
                            completionBlock:(void (^)(NSString *objectId, NSError *error))completionBlock
 {
     // build URL
-    NSString *folderObjectUrl = [self getObjectUrlObjectId:folderObjectId];
+    NSString *folderObjectUrl = [self retrieveObjectUrlForObjectWithId:folderObjectId];
     
     // prepare form data
     CMISBroswerFormDataWriter *formData = [[CMISBroswerFormDataWriter alloc] initWithAction:kCMISBrowserJSONActionCreateFolder];
@@ -552,7 +552,7 @@
     }
     
     // build URL
-    NSString *objectUrl = [self getObjectUrlObjectId:objectId];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectId];
     
     // prepare form data
     CMISBroswerFormDataWriter *formData = [[CMISBroswerFormDataWriter alloc] initWithAction:kCMISBrowserJSONActionMove];
@@ -593,7 +593,7 @@
            completionBlock:(void (^)(NSArray *failedObjects, NSError *error))completionBlock
 {
     // build URL
-    NSString *folderObjectUrl = [self getObjectUrlObjectId:folderObjectId];
+    NSString *folderObjectUrl = [self retrieveObjectUrlForObjectWithId:folderObjectId];
     
     CMISBroswerFormDataWriter *formData = [[CMISBroswerFormDataWriter alloc] initWithAction:kCMISBrowserJSONActionDeleteTree];
     [formData addParameter:kCMISParameterAllVersions boolValue:allVersions];
@@ -641,7 +641,7 @@
     }
     
     // build URL
-    NSString *objectUrl = [self getObjectUrlObjectId:objectIdParam.inParameter];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectIdParam.inParameter];
     
     // prepare form data
     CMISBroswerFormDataWriter *formData = [[CMISBroswerFormDataWriter alloc] initWithAction:kCMISBrowserJSONActionUpdateProperties];
@@ -684,7 +684,7 @@
                          skipCount:(NSNumber *)skipCount
                    completionBlock:(void (^)(NSArray *renditions, NSError *error))completionBlock
 {
-    NSString *objectUrl = [self getObjectUrlObjectId:objectId selector:kCMISBrowserJSONSelectorRenditions];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectId selector:kCMISBrowserJSONSelectorRenditions];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterRenditionFilter
value:renditionFilter urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterMaxItems value:[maxItems
stringValue] urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterSkipCount value:[skipCount
stringValue] urlString:objectUrl];

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=1592693&r1=1592692&r2=1592693&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserVersioningService.m
(original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Bindings/Browser/CMISBrowserVersioningService.m
Tue May  6 09:10:49 2014
@@ -41,7 +41,7 @@
                       includeAllowableActions:(BOOL)includeAllowableActions
                               completionBlock:(void (^)(CMISObjectData *objectData, NSError
*error))completionBlock
 {
-    NSString *objectUrl = [self getObjectUrlObjectId:objectId selector:kCMISBrowserJSONSelectorObject];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectId selector:kCMISBrowserJSONSelectorObject];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterFilter value:filter
urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeAllowableActions
boolValue:includeAllowableActions urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeRelationships
value:[CMISEnums stringForIncludeRelationShip:relationships] urlString:objectUrl];
@@ -81,7 +81,7 @@
             includeAllowableActions:(BOOL)includeAllowableActions
                     completionBlock:(void (^)(NSArray *objects, NSError *error))completionBlock
 {    
-    NSString *objectUrl = [self getObjectUrlObjectId:objectId selector:kCMISBrowserJSONSelectorVersions];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectId selector:kCMISBrowserJSONSelectorVersions];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterFilter value:filter
urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISParameterIncludeAllowableActions
value:(includeAllowableActions ? @"true" : @"false") urlString:objectUrl];
     objectUrl = [CMISURLUtil urlStringByAppendingParameter:kCMISBrowserJSONParameterSuccinct
value:@"true" urlString:objectUrl];
@@ -125,7 +125,7 @@
     }
     
     // build URL
-    NSString *objectUrl = [self getObjectUrlObjectId:objectId];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectId];
     
     // prepare form data
     CMISBroswerFormDataWriter *formData = [[CMISBroswerFormDataWriter alloc] initWithAction:kCMISBrowserJSONActionCheckOut];
@@ -173,7 +173,7 @@
     }
     
     // build URL
-    NSString *objectUrl = [self getObjectUrlObjectId:objectId];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectId];
     
     // prepare form data
     CMISBroswerFormDataWriter *formData = [[CMISBroswerFormDataWriter alloc] initWithAction:kCMISBrowserJSONActionCancelCheckOut];
@@ -283,7 +283,7 @@
     }
     
     // build URL
-    NSString *objectUrl = [self getObjectUrlObjectId:objectId];
+    NSString *objectUrl = [self retrieveObjectUrlForObjectWithId:objectId];
     
     // prepare form data
     CMISBroswerFormDataWriter *formData = [[CMISBroswerFormDataWriter alloc] initWithAction:kCMISBrowserJSONActionCheckIn
contentStream:inputStream mediaType:mimeType];

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Common/CMISConstants.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Common/CMISConstants.h?rev=1592693&r1=1592692&r2=1592693&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Common/CMISConstants.h
(original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Common/CMISConstants.h
Tue May  6 09:10:49 2014
@@ -130,16 +130,7 @@ extern NSString * const kCMISParameterVa
 extern NSString * const kCMISParameterValueReturnValueLatest;
 extern NSString * const kCMISParameterValueReturnValueLatestMajor;
 
-// Media Types
-extern NSString * const kCMISMediaTypeService;
-extern NSString * const kCMISMediaTypeFeed;
-extern NSString * const kCMISMediaTypeEntry;
-extern NSString * const kCMISMediaTypeChildren;
-extern NSString * const kCMISMediaTypeDescendants;
-extern NSString * const kCMISMediaTypeQuery;
-extern NSString * const kCMISMediaTypeAllowableAction;
-extern NSString * const kCMISMediaTypeAcl;
-extern NSString * const kCMISMediaTypeCmisAtom;
+// Common Media Types
 extern NSString * const kCMISMediaTypeOctetStream;
 
 //ContentStreamAllowed enum values

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Common/CMISConstants.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Common/CMISConstants.m?rev=1592693&r1=1592692&r2=1592693&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Common/CMISConstants.m
(original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Common/CMISConstants.m
Tue May  6 09:10:49 2014
@@ -138,16 +138,7 @@ NSString * const kCMISParameterValueRetu
 NSString * const kCMISParameterValueReturnValueLatest = @"latest";
 NSString * const kCMISParameterValueReturnValueLatestMajor = @"latestmajor";
 
-// Media Types
-NSString * const kCMISMediaTypeService = @"application/atomsvc+xml";
-NSString * const kCMISMediaTypeFeed = @"application/atom+xml;type=feed";
-NSString * const kCMISMediaTypeEntry = @"application/atom+xml;type=entry";
-NSString * const kCMISMediaTypeChildren = @"application/atom+xml;type=feed";
-NSString * const kCMISMediaTypeDescendants = @"application/cmistree+xml";
-NSString * const kCMISMediaTypeQuery = @"application/cmisquery+xml";
-NSString * const kCMISMediaTypeAllowableAction  = @"application/cmisallowableactions+xml";
-NSString * const kCMISMediaTypeAcl = @"application/cmisacl+xml";
-NSString * const kCMISMediaTypeCmisAtom = @"application/cmisatom+xml";
+// Common Media Types
 NSString * const kCMISMediaTypeOctetStream = @"application/octet-stream";
 
 //ContentStreamAllowed enum values

Modified: chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Utils/CMISURLUtil.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Utils/CMISURLUtil.m?rev=1592693&r1=1592692&r2=1592693&view=diff
==============================================================================
--- chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Utils/CMISURLUtil.m (original)
+++ chemistry/objectivecmis/branches/browser-binding/ObjectiveCMIS/Utils/CMISURLUtil.m Tue
May  6 09:10:49 2014
@@ -23,45 +23,6 @@
 NSString * const kCMISRFC7232Reserved = @";?:@&=+$,[]";
 
 
-@interface NSString (CMISURLUtil)
-
-- (NSString *)replacePathWithPath:(NSString *)path;
-
-@end
-
-@implementation NSString (CMISURLUtil)
-
-- (NSString *)replacePathWithPath:(NSString *)path
-{
-    NSMutableString *serverUrl = [[NSMutableString alloc] init];
-    
-    NSURL *tmp = [[NSURL alloc] initWithString:self];
-    
-    if(tmp.scheme){
-        [serverUrl appendFormat:@"%@://", tmp.scheme];
-    }
-    if(tmp.host){
-        [serverUrl appendString:tmp.host];
-    }
-    if(tmp.port){
-        [serverUrl appendFormat:@":%@", [tmp.port stringValue]];
-    }
-    if(path){
-        [serverUrl appendString:path];
-    }
-    if(tmp.query){
-        [serverUrl appendFormat:@"?%@", tmp.query];
-    }
-    
-    if(serverUrl.length == 0){ //this happens when it's not a valid url
-        [serverUrl appendString:self];
-    }
-    
-    return serverUrl;
-}
-
-@end
-
 @implementation CMISURLUtil
 
 + (NSString *)urlStringByAppendingParameter:(NSString *)parameterName boolValue:(BOOL)parameterValue
urlString:(NSString *)urlString
@@ -118,8 +79,7 @@ NSString * const kCMISRFC7232Reserved = 
                                                                      (CFStringRef)kCMISRFC7232Reserved,
                                                                      kCFStringEncodingUTF8));
     
-    
-    return [[url absoluteString] replacePathWithPath:path];
+    return [self replacePathInUrl:[url absoluteString] withPath:path];
 }
 
 + (NSURL *)urlStringByAppendingParameter:(NSString *)parameterName value:(NSString *)parameterValue
url:(NSURL *)url
@@ -137,4 +97,36 @@ NSString * const kCMISRFC7232Reserved = 
     return encodedValue;
 }
 
+#pragma mark -
+#pragma mark Private helper methods
+
++ (NSString *)replacePathInUrl:(NSString *)url withPath:(NSString *)replacementPath
+{
+    NSMutableString *serverUrl = [[NSMutableString alloc] init];
+    
+    NSURL *tmp = [[NSURL alloc] initWithString:url];
+    
+    if(tmp.scheme){
+        [serverUrl appendFormat:@"%@://", tmp.scheme];
+    }
+    if(tmp.host){
+        [serverUrl appendString:tmp.host];
+    }
+    if(tmp.port){
+        [serverUrl appendFormat:@":%@", [tmp.port stringValue]];
+    }
+    if(replacementPath){
+        [serverUrl appendString:replacementPath];
+    }
+    if(tmp.query){
+        [serverUrl appendFormat:@"?%@", tmp.query];
+    }
+    
+    if(serverUrl.length == 0){ //this happens when it's not a valid url
+        [serverUrl appendString:url];
+    }
+    
+    return serverUrl;
+}
+
 @end
\ No newline at end of file



Mime
View raw message