diff --git a/openbis-ipad/BisKit/Classes/CISDOBIpadService.h b/openbis-ipad/BisKit/Classes/CISDOBIpadService.h index e7406c46185773ccef08c37330f53406dc06c556..b4c5741f329d9f9397635ba47b92a96d061dbc38 100644 --- a/openbis-ipad/BisKit/Classes/CISDOBIpadService.h +++ b/openbis-ipad/BisKit/Classes/CISDOBIpadService.h @@ -56,7 +56,7 @@ enum CISOBIpadServiceErrorCode { - (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. -- (CISDOBAsyncCall *)drillOnEntityWithPermId:(NSString *)permId refcon:(NSString *)refcon; +- (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 4e0e25714368a0addcd772e1b1f5a055f352ebe7..628c5747973ec5e260c1cc9e108b3a5d924b0d23 100644 --- a/openbis-ipad/BisKit/Classes/CISDOBIpadService.m +++ b/openbis-ipad/BisKit/Classes/CISDOBIpadService.m @@ -175,7 +175,7 @@ NSString *const CISDOBIpadServiceErrorDomain = @"CISDOBIpadServiceErrorDomain"; return iPadCall; } -- (CISDOBAsyncCall *)drillOnEntityWithPermId:(NSString *)permId refcon:(NSString *)refcon +- (CISDOBAsyncCall *)drillOnEntityWithPermId:(NSString *)permId refcon:(id)refcon { // A simple version of the method that just request data for one entity. NSDictionary *entity = diff --git a/openbis-ipad/BisKit/Tests/CISDOBIpadServiceTest.m b/openbis-ipad/BisKit/Tests/CISDOBIpadServiceTest.m index 3a318a53850338aa78d1dc9f125ea65f6eb72a44..75446ccff31ce76c7224168f14c557cbeb49f61d 100644 --- a/openbis-ipad/BisKit/Tests/CISDOBIpadServiceTest.m +++ b/openbis-ipad/BisKit/Tests/CISDOBIpadServiceTest.m @@ -105,7 +105,10 @@ } // Drill - call = [_service drillOnEntityWithPermId: entityWithChildren.permId refcon: entityWithChildren.refcon]; + NSError *error; + id refconObject = [NSJSONSerialization JSONObjectWithData: [entityWithChildren.refcon dataUsingEncoding: NSASCIIStringEncoding] options: 0 error: &error]; + STAssertNotNil(refconObject, @"Could not parse refcon string %@ : %@", entityWithChildren.refcon, error); + call = [_service drillOnEntityWithPermId: entityWithChildren.permId refcon: refconObject]; [self configureAndRunCallSynchronously: call]; rawEntities = _callResult; diff --git a/openbis-ipad/core-plugin/readme.md b/openbis-ipad/core-plugin/readme.md index db693a284866e18970a50a0f8509499d585607ba..30c59faa406eadf915b608c65a811e47ae4dd337 100644 --- a/openbis-ipad/core-plugin/readme.md +++ b/openbis-ipad/core-plugin/readme.md @@ -66,9 +66,9 @@ The iPad data model tracks information for displaying and navigating between ent </tr> <tr> <td>REFCON</td> - <td>Data that is passed unchanged back to the server when a row is modified. This can be used by the server to encode whatever it needs in order to modify the row.</td> + <td>Data that is passed unchanged back to the server when a row is modified. This can be used by the server to encode whatever it needs in order to modify the row. Transmitted as JSON.</td> <td>For server use only; transmitted to the server on every call that it is appropriate.</td> - <td>openBIS entity kind + type + permId</td> + <td>E.g., {code : [code], entityKind : [entity kind], entityType : [entity type], permId : [permId]}</td> </tr> <tr> <td>CATEGORY</td> diff --git a/openbis-ipad/ipad-example-data/ipad-ui/1/dss/reporting-plugins/ipad-read-service-v1/ipad_read.py b/openbis-ipad/ipad-example-data/ipad-ui/1/dss/reporting-plugins/ipad-read-service-v1/ipad_read.py index 9f1d5367f5ed3915daef5ac89c2ad09a765c442c..a86a0052c7c713b69616ea30bf7916c9f7656d0d 100644 --- a/openbis-ipad/ipad-example-data/ipad-ui/1/dss/reporting-plugins/ipad-read-service-v1/ipad_read.py +++ b/openbis-ipad/ipad-example-data/ipad-ui/1/dss/reporting-plugins/ipad-read-service-v1/ipad_read.py @@ -11,10 +11,6 @@ def json_encoded_value(coll): """Utility function for converting a list into a json-encoded list""" return ObjectMapper().writeValueAsString(coll) -def json_string_to_dict(string): - """Utility function for converting a json-encoded dictionary into a Java/Jython dictionary.""" - return ObjectMapper().readValue(string, dict) - class RequestHandler: """Abstract superclass for the handlers for concrete requests like ROOT. @@ -207,7 +203,7 @@ def samples_to_dict(samples, material_by_perm_id): def retrieve_samples(sample_perm_ids_and_ref_cons): sc = SearchCriteria() for sample in sample_perm_ids_and_ref_cons: - code = json_string_to_dict(sample['REFCON'])['code'] + code = sample['REFCON']['code'] sc.addMatchClause(sc.MatchClause.createAttributeMatch(sc.MatchClauseAttribute.CODE, code)) return searchService.searchForSamples(sc)