Skip to content
Snippets Groups Projects
Commit 9b985f3c authored by cramakri's avatar cramakri
Browse files

Added method for drilling on many objects simultaneously

SVN: 27278
parent 32c9c4c1
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,10 @@ enum CISOBIpadServiceErrorCode { ...@@ -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. //! 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; - (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; - (CISDOBAsyncCall *)drillOnEntityWithPermId:(NSString *)permId refcon:(id)refcon;
@end @end
......
...@@ -175,14 +175,19 @@ NSString *const CISDOBIpadServiceErrorDomain = @"CISDOBIpadServiceErrorDomain"; ...@@ -175,14 +175,19 @@ NSString *const CISDOBIpadServiceErrorDomain = @"CISDOBIpadServiceErrorDomain";
return iPadCall; 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. NSUInteger count = [permIds count];
NSDictionary *entity = NSAssert([refcons count] == count, @"Drilling requires permIds and refcons. There must be an equal number of these.");
[NSDictionary dictionaryWithObjectsAndKeys: NSMutableArray *entities = [[NSMutableArray alloc] initWithCapacity: [permIds count]];
permId, @"PERM_ID", for (NSUInteger i = 0; i < count; ++i) {
refcon, @"REFCON", nil]; NSDictionary *entity =
NSArray *entities = [NSArray arrayWithObject: entity]; [NSDictionary dictionaryWithObjectsAndKeys:
[permIds objectAtIndex: i], @"PERM_ID",
[refcons objectAtIndex: i], @"REFCON", nil];
[entities addObject: entity];
}
NSDictionary *parameters = NSDictionary *parameters =
[NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionaryWithObjectsAndKeys:
@"DRILL", @"requestKey", @"DRILL", @"requestKey",
...@@ -203,6 +208,13 @@ NSString *const CISDOBIpadServiceErrorDomain = @"CISDOBIpadServiceErrorDomain"; ...@@ -203,6 +208,13 @@ NSString *const CISDOBIpadServiceErrorDomain = @"CISDOBIpadServiceErrorDomain";
return iPadCall; 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 @end
@implementation CISDOBIpadServiceCall @implementation CISDOBIpadServiceCall
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment