diff --git a/openbis-ipad/BisKit/Classes/CISDOBIpadService.m b/openbis-ipad/BisKit/Classes/CISDOBIpadService.m index 213d911818c7cb32a3c3745536fc15b55daf18a6..f903339ef8405812c68603d93520083cec2cb9e6 100644 --- a/openbis-ipad/BisKit/Classes/CISDOBIpadService.m +++ b/openbis-ipad/BisKit/Classes/CISDOBIpadService.m @@ -273,7 +273,8 @@ static id OpenBisTableRowValueAtIndex(NSArray *rowData, NSUInteger index) // This value was not provided if (!indexHolder) return nil; NSUInteger index = [indexHolder unsignedIntegerValue]; - return OpenBisTableRowValueAtIndex(_content, index); + NSString *rowValue = OpenBisTableRowValueAtIndex(_content, index); + return rowValue; } - (NSString *)permId { return [self stringContentValueAtName: @"PERM_ID"]; } diff --git a/openbis-ipad/BisKit/Tests/CISDOBIpadServiceManagerTest.m b/openbis-ipad/BisKit/Tests/CISDOBIpadServiceManagerTest.m index b6ad115872ec4ff0740a028b566577bbcfdf5af3..e2f0521fb2238341106c19c0497edb34f79a06c7 100644 --- a/openbis-ipad/BisKit/Tests/CISDOBIpadServiceManagerTest.m +++ b/openbis-ipad/BisKit/Tests/CISDOBIpadServiceManagerTest.m @@ -484,6 +484,24 @@ static BOOL IsPermIdTarget(NSString *permId) STAssertNil(image.textEncodingName, @"Text encoding should be nil"); } +- (void)testUnicode +{ + + [self performLogin]; + [self performRootLevelCall]; + + NSArray *targetsAndCompounds = [self targetsAndCompounds]; + CISDOBIpadEntity *targetOrCompound = [targetsAndCompounds objectAtIndex: 0]; + + [self performDetails: targetOrCompound]; + STAssertNotNil(targetOrCompound.properties, @"Properties should have been retrieved"); + NSDictionary *unicodeProperty = [targetOrCompound.properties objectAtIndex: 4]; + NSString *unicodeValue = [unicodeProperty objectForKey: @"value"]; + NSString *expectedValue = [NSString stringWithFormat: @"A pr%Cperty w%Cth accents.", (unsigned short) 0x00F6, (unsigned short) 0x00EF]; + STAssertEqualObjects(expectedValue, unicodeValue, @"Property should equal"); +} + + - (void)testNilUrl { diff --git a/openbis-ipad/Research/BisMac.xcodeproj/xcuserdata/cramakri.xcuserdatad/xcschemes/Test Minimal.xcscheme b/openbis-ipad/Research/BisMac.xcodeproj/xcuserdata/cramakri.xcuserdatad/xcschemes/Test Minimal.xcscheme index e3c0e9998ccb7cb824e3712655aa90ecb39d5be3..5a2866d3b58b284f30dee7c8629ad19e9f79cd63 100644 --- a/openbis-ipad/Research/BisMac.xcodeproj/xcuserdata/cramakri.xcuserdatad/xcschemes/Test Minimal.xcscheme +++ b/openbis-ipad/Research/BisMac.xcodeproj/xcuserdata/cramakri.xcuserdatad/xcschemes/Test Minimal.xcscheme @@ -44,9 +44,6 @@ <Test Identifier = "CISDOBAsyncTest"> </Test> - <Test - Identifier = "CISDOBIpadEntityTest"> - </Test> <Test Identifier = "CISDOBJsonRpcCallGenericTest"> </Test> @@ -62,6 +59,9 @@ <Test Identifier = "CISDOBIpadServiceTest"> </Test> + <Test + Identifier = "CISDOBIpadEntityTest"> + </Test> </SkippedTests> </TestableReference> </Testables> 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 e12f6b88cd78110ba9c4da1aff45a866a47b35a8..2d8cc3a267ad54846950a33fa2b941613fe6bca0 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,6 +11,14 @@ def json_encoded_value(coll): """Utility function for converting a list into a json-encoded list""" return ObjectMapper().writeValueAsString(coll) +def json_empty_list(): + """Utility function to return an json-encoded empty list""" + return json_encoded_value([]) + +def json_empty_dict(): + """Utility function to return an json-encoded empty dictionary""" + return json_encoded_value({}) + class RequestHandler(object): """Abstract superclass for the handlers for concrete requests like ROOT. @@ -263,10 +271,10 @@ def material_to_dict(material, material_type_properties_definitions): material_dict['IMAGES'] = json_encoded_value(marquee_image_spec_for_url(image_url_for_compound(material))) else: material_dict['SUMMARY'] = material.getPropertyValue("DESC") - material_dict['IMAGES'] = [] + material_dict['IMAGES'] = json_empty_dict() material_dict['ROOT_LEVEL'] = None - material_dict['CHILDREN'] = json_encoded_value([]) + material_dict['CHILDREN'] = json_empty_list() prop_names = set(["NAME", "PROT_NAME", "GENE_NAME", "LENGTH", "CHEMBL", "DESC", "FORMULA", "WEIGHT", "SMILES"]) property_definitions = material_type_properties_definitions.get(material.getMaterialType(), []) diff --git a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate index 8724d670dc8357695a3e4b31c29a265113f46fa0..083b70b0ba5e2dcf29172973c068078326816f5e 100644 Binary files a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate and b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate differ