Author: gavincornwell
Date: Tue Oct 14 12:44:57 2014
New Revision: 1631734
URL: http://svn.apache.org/r1631734
Log:
Added removePropertyWithId method to CMISProperties and also removed use of
"id" as a method parameter.
Modified:
chemistry/objectivecmis/trunk/ObjectiveCMIS/Common/CMISProperties.h
chemistry/objectivecmis/trunk/ObjectiveCMIS/Common/CMISProperties.m
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Common/CMISProperties.h
URL:
http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Common/CMISProperties.h?rev=1631734&r1=1631733&r2=1631734&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Common/CMISProperties.h
(original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Common/CMISProperties.h Tue Oct
14 12:44:57 2014
@@ -32,6 +32,9 @@
// adds a property
- (void)addProperty:(CMISPropertyData *)propertyData;
+// removes a property
+- (void)removePropertyWithId:(NSString *)propertyId;
+
/**
* Returns a property by id.
* <p>
@@ -39,7 +42,7 @@
* result properties, this method might not always work as expected with
* some repositories. Use {@link #getPropertyByQueryName(String)} instead.
*/
-- (CMISPropertyData *)propertyForId:(NSString *)id;
+- (CMISPropertyData *)propertyForId:(NSString *)propertyId;
/**
* Returns a property by query name or alias.
@@ -60,7 +63,7 @@
/**
* Returns a property multi-value by id.
*/
-- (NSArray *)propertyMultiValueById:(NSString *)id;
+- (NSArray *)propertyMultiValueById:(NSString *)propertyId;
/**
* Returns a property multi-value by query name or alias.
Modified: chemistry/objectivecmis/trunk/ObjectiveCMIS/Common/CMISProperties.m
URL:
http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Common/CMISProperties.m?rev=1631734&r1=1631733&r2=1631734&view=diff
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Common/CMISProperties.m
(original)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Common/CMISProperties.m Tue Oct
14 12:44:57 2014
@@ -43,6 +43,20 @@
}
}
+- (void)removePropertyWithId:(NSString *)propertyId
+{
+ if (self.internalPropertiesByIdDict) {
+ CMISPropertyData *propertyData =
self.internalPropertiesByIdDict[propertyId];
+ if (propertyData) {
+ [self.internalPropertiesByIdDict removeObjectForKey:propertyId];
+
+ if (propertyData.queryName) {
+ [self.internalPropertiesByQueryNameDict
removeObjectForKey:propertyData.queryName];
+ }
+ }
+ }
+}
+
- (NSDictionary *)propertiesDictionary
{
return [NSDictionary
dictionaryWithDictionary:self.internalPropertiesByIdDict];
@@ -53,9 +67,9 @@
return [NSArray arrayWithArray:self.internalPropertiesByIdDict.allValues];
}
-- (CMISPropertyData *)propertyForId:(NSString *)id
+- (CMISPropertyData *)propertyForId:(NSString *)propertyId
{
- return [self.internalPropertiesByIdDict objectForKey:id];
+ return [self.internalPropertiesByIdDict objectForKey:propertyId];
}
- (CMISPropertyData *)propertyForQueryName:(NSString *)queryName
@@ -73,9 +87,9 @@
return [[self propertyForQueryName:queryName] firstValue];
}
-- (NSArray *)propertyMultiValueById:(NSString *)id
+- (NSArray *)propertyMultiValueById:(NSString *)propertyId
{
- return [[self propertyForId:id] values];
+ return [[self propertyForId:propertyId] values];
}
- (NSArray *)propertyMultiValueByQueryName:(NSString *)queryName