diff --git a/openbis-ipad/BisKit/Classes/CISDOBIpadService.h b/openbis-ipad/BisKit/Classes/CISDOBIpadService.h index b4c5741f329d9f9397635ba47b92a96d061dbc38..e141706ca0be5c679e968f811a11f34db0f66bf2 100644 --- a/openbis-ipad/BisKit/Classes/CISDOBIpadService.h +++ b/openbis-ipad/BisKit/Classes/CISDOBIpadService.h @@ -55,7 +55,10 @@ enum CISOBIpadServiceErrorCode { //! Get all root-level entities from the openBIS ipad service, possibly along with some children as well. The success message will be invoked with a collection of CISDOBIpadRawEntity objects. - (CISDOBAsyncCall *)listRootLevelEntities; -//! Get drill information from the openBIS ipad service -- this will include information about the children of the entity and possibly their children as well. The success message will be invoked with a collection of CISDOBIpadRawEntity objects. +//! Get drill information from the openBIS ipad service -- this will include information about the children of the entity and possibly their children as well. The two collections must have the same cardinality. The success message will be invoked with a collection of CISDOBIpadRawEntity objects. +- (CISDOBAsyncCall *)drillOnEntities:(NSArray *)permIds refcons:(NSArray *)refcons; + +//! A convenience version of drillOnEntities:refcons: for one entity. - (CISDOBAsyncCall *)drillOnEntityWithPermId:(NSString *)permId refcon:(id)refcon; @end diff --git a/openbis-ipad/BisKit/Classes/CISDOBIpadService.m b/openbis-ipad/BisKit/Classes/CISDOBIpadService.m index 628c5747973ec5e260c1cc9e108b3a5d924b0d23..03f6701f502b3a4be8dd6e530c0b698af79b5072 100644 --- a/openbis-ipad/BisKit/Classes/CISDOBIpadService.m +++ b/openbis-ipad/BisKit/Classes/CISDOBIpadService.m @@ -175,14 +175,19 @@ NSString *const CISDOBIpadServiceErrorDomain = @"CISDOBIpadServiceErrorDomain"; return iPadCall; } -- (CISDOBAsyncCall *)drillOnEntityWithPermId:(NSString *)permId refcon:(id)refcon +- (CISDOBAsyncCall *)drillOnEntities:(NSArray *)permIds refcons:(NSArray *)refcons { - // A simple version of the method that just request data for one entity. - NSDictionary *entity = - [NSDictionary dictionaryWithObjectsAndKeys: - permId, @"PERM_ID", - refcon, @"REFCON", nil]; - NSArray *entities = [NSArray arrayWithObject: entity]; + NSUInteger count = [permIds count]; + NSAssert([refcons count] == count, @"Drilling requires permIds and refcons. There must be an equal number of these."); + NSMutableArray *entities = [[NSMutableArray alloc] initWithCapacity: [permIds count]]; + for (NSUInteger i = 0; i < count; ++i) { + NSDictionary *entity = + [NSDictionary dictionaryWithObjectsAndKeys: + [permIds objectAtIndex: i], @"PERM_ID", + [refcons objectAtIndex: i], @"REFCON", nil]; + [entities addObject: entity]; + } + NSDictionary *parameters = [NSDictionary dictionaryWithObjectsAndKeys: @"DRILL", @"requestKey", @@ -203,6 +208,13 @@ NSString *const CISDOBIpadServiceErrorDomain = @"CISDOBIpadServiceErrorDomain"; return iPadCall; } +- (CISDOBAsyncCall *)drillOnEntityWithPermId:(NSString *)permId refcon:(id)refcon +{ + NSArray *permIds = [NSArray arrayWithObject: permId]; + NSArray *refcons = [NSArray arrayWithObject: refcon]; + return [self drillOnEntities: permIds refcons: refcons]; +} + @end @implementation CISDOBIpadServiceCall diff --git a/openbis-ipad/Research/BisMac.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate b/openbis-ipad/Research/BisMac.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate index 83dd8cd9fafabda01d67e678a25b79e6c540cd49..7837fda048c7430ec7f40075db8719c3fd2fc6b8 100644 Binary files a/openbis-ipad/Research/BisMac.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate and b/openbis-ipad/Research/BisMac.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate differ