diff --git a/ChangeLog b/ChangeLog index 3a9ceb7e7..4acd03d55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2012-07-19 Wolfgang Sourdeau + * OpenChange/MAPIStoreObject.m (-nameInContainer): moved method + from MAPIStoreSOGoObject and made mandatory for subclasses. + (-url): new methed moved from MAPIStoreSOGoObject. + * OpenChange/MAPIStoreAppointmentWrapper.m: now a subclass of MAPIStoreObjectProxy. diff --git a/OpenChange/MAPIStoreObject.h b/OpenChange/MAPIStoreObject.h index bd30a77a0..e0deb91ed 100644 --- a/OpenChange/MAPIStoreObject.h +++ b/OpenChange/MAPIStoreObject.h @@ -60,6 +60,8 @@ - (MAPIStoreUserContext *) userContext; - (MAPIStoreMapping *) mapping; +- (NSString *) url; + /* properties */ - (void) addProperties: (NSDictionary *) newProperties; @@ -89,6 +91,7 @@ inMemCtx: (TALLOC_CTX *) memCtx; /* subclasses */ +- (NSString *) nameInContainer - (NSDate *) creationTime; - (NSDate *) lastModificationTime; diff --git a/OpenChange/MAPIStoreObject.m b/OpenChange/MAPIStoreObject.m index b092bbe03..0204f3a2d 100644 --- a/OpenChange/MAPIStoreObject.m +++ b/OpenChange/MAPIStoreObject.m @@ -122,6 +122,20 @@ static Class NSExceptionK, MAPIStoreFolderK; return [[self userContext] mapping]; } +- (NSString *) url +{ + NSString *containerURL, *format; + + containerURL = (NSString *) [container url]; + if ([containerURL hasSuffix: @"/"]) + format = @"%@%@"; + else + format = @"%@/%@"; + + return [NSString stringWithFormat: format, + containerURL, [self nameInContainer]]; +} + /* helpers */ - (void) addProperties: (NSDictionary *) newNewProperties @@ -293,6 +307,13 @@ static Class NSExceptionK, MAPIStoreFolderK; } /* subclasses */ +- (NSString *) nameInContainer +{ + [self subclassResponsibility: _cmd]; + + return nil; +} + - (NSDate *) creationTime { [self subclassResponsibility: _cmd]; diff --git a/OpenChange/MAPIStoreSOGoObject.h b/OpenChange/MAPIStoreSOGoObject.h index 90524558f..cacdf23b1 100644 --- a/OpenChange/MAPIStoreSOGoObject.h +++ b/OpenChange/MAPIStoreSOGoObject.h @@ -58,14 +58,11 @@ - (id) sogoObject; -- (NSString *) nameInContainer; - - (MAPIStoreObject *) container; - (void) cleanupCaches; - (uint64_t) objectId; -- (NSString *) url; /* implemented getters */ - (int) getPidTagDisplayName: (void **) data diff --git a/OpenChange/MAPIStoreSOGoObject.m b/OpenChange/MAPIStoreSOGoObject.m index d2d3b4790..421337505 100644 --- a/OpenChange/MAPIStoreSOGoObject.m +++ b/OpenChange/MAPIStoreSOGoObject.m @@ -146,20 +146,6 @@ static Class MAPIStoreFolderK; return objectId; } -- (NSString *) url -{ - NSString *containerURL, *format; - - containerURL = (NSString *) [container url]; - if ([containerURL hasSuffix: @"/"]) - format = @"%@%@"; - else - format = @"%@/%@"; - - return [NSString stringWithFormat: format, - containerURL, [self nameInContainer]]; -} - /* getters */ - (int) getPidTagDisplayName: (void **) data inMemCtx: (TALLOC_CTX *) memCtx