diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/PropertySampleColDef.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/PropertySampleColDef.java index 775dadcb6a81e494f1056d832758b4fb8ed6f5b7..9f8b54d07b5832abcf4d94aabccd3f432d115f36 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/PropertySampleColDef.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/PropertySampleColDef.java @@ -32,7 +32,7 @@ class PropertySampleColDef extends AbstractSampleColDef implements IsSerializabl private boolean isInternalNamespace; - private String code; + private String simpleCode; // GWT only public PropertySampleColDef() @@ -43,7 +43,7 @@ class PropertySampleColDef extends AbstractSampleColDef implements IsSerializabl { super(propertyType.getLabel(), PROPERTY_COLUMN_WIDTH, isDisplayedByDefault); this.isInternalNamespace = propertyType.isInternalNamespace(); - this.code = propertyType.getCode(); + this.simpleCode = propertyType.getSimpleCode(); } @Override @@ -64,11 +64,11 @@ class PropertySampleColDef extends AbstractSampleColDef implements IsSerializabl { PropertyType propertyType = prop.getEntityTypePropertyType().getPropertyType(); return propertyType.isInternalNamespace() == isInternalNamespace - && propertyType.getCode().equals(code); + && propertyType.getSimpleCode().equals(simpleCode); } public String getIdentifier() { - return PROPERTY_PREFIX + isInternalNamespace + code; + return PROPERTY_PREFIX + isInternalNamespace + simpleCode; } } \ No newline at end of file diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/PropertyType.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/PropertyType.java index b6b4615cbe00771b8eee2336a7e7d68a821dec17..ee3609f0507a1fc4ef5567fbd070dbc643bd2d51 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/PropertyType.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/dto/PropertyType.java @@ -25,6 +25,15 @@ import com.google.gwt.user.client.rpc.IsSerializable; */ public class PropertyType extends Code<PropertyType> implements IsSerializable { + /** + * Only used for displaying/viewing. With <code>managedInternally</code> is unambiguous + * (meaning that <code>simpleCode</code> alone could be not unique). + * <p> + * We have to use it, partly because <i>Javascript</i> handle '.' in an object-oriented way. + * </p> + */ + private String simpleCode; + private String label; private boolean internalNamespace; @@ -43,6 +52,16 @@ public class PropertyType extends Code<PropertyType> implements IsSerializable private List<ExperimentTypePropertyType> experimentTypePropertyTypes; + public String getSimpleCode() + { + return simpleCode; + } + + public void setSimpleCode(final String simpleCode) + { + this.simpleCode = simpleCode; + } + public String getLabel() { return label; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/translator/PropertyTypeTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/translator/PropertyTypeTranslator.java index aece7624af4b25824c32317252ae1f1944b5dac0..34a04e86dee1fd52d207c5deb2b1c8726f856b4d 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/translator/PropertyTypeTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/translator/PropertyTypeTranslator.java @@ -16,9 +16,6 @@ package ch.systemsx.cisd.openbis.generic.client.web.server.translator; -import java.util.ArrayList; -import java.util.List; - import ch.systemsx.cisd.openbis.generic.client.web.client.dto.PropertyType; import ch.systemsx.cisd.openbis.generic.shared.dto.PropertyTypePE; @@ -39,6 +36,7 @@ public final class PropertyTypeTranslator { final PropertyType result = new PropertyType(); result.setCode(propertyType.getCode()); + result.setSimpleCode(propertyType.getSimpleCode()); result.setInternalNamespace(propertyType.isInternalNamespace()); result.setManagedInternally(propertyType.isManagedInternally()); result.setLabel(propertyType.getLabel()); @@ -53,24 +51,4 @@ public final class PropertyTypeTranslator propertyType.getExperimentTypePropertyTypes(), result)); return result; } - - public final static PropertyTypePE translate(final PropertyType propertyType) - { - final PropertyTypePE result = new PropertyTypePE(); - result.setCode(propertyType.getCode()); - result.setInternalNamespace(propertyType.isInternalNamespace()); - result.setLabel(propertyType.getLabel()); - return result; - } - - public final static List<PropertyTypePE> translate(final List<PropertyType> propertyCodes) - { - final List<PropertyTypePE> result = new ArrayList<PropertyTypePE>(); - for (final PropertyType s : propertyCodes) - { - result.add(translate(s)); - } - return result; - } - } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/SampleRow.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/SampleRow.java index 3a34a30255aa51e0a1a7917ecc214323fc0949a4..826608643da7269ed3828b6d380c96cf4068c1c3 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/SampleRow.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/columns/SampleRow.java @@ -143,7 +143,7 @@ public class SampleRow extends Row { final PropertyType propertyType = new PropertyType(); propertyType.setInternalNamespace(internalNamespace); - propertyType.setCode(propertyCode); + propertyType.setSimpleCode(propertyCode); return propertyType; } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationTest.java index b7e0431b5c7d24aee3e9ada655f0b25d40f614e0..c62ed5c2f311ff68eab604f54d4ba5433bcc8f55 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/plugin/generic/client/web/client/application/sample/GenericSampleRegistrationTest.java @@ -63,14 +63,15 @@ public class GenericSampleRegistrationTest extends AbstractGWTTestCase { final String sampleTypeCode = SampleTypeCode.CONTROL_LAYOUT.getCode(); loginAndPreprareRegistration(sampleTypeCode); - final String userDescription = "A very nice control layout."; - remoteConsole.prepare(new FillSampleRegistrationForm(true, null, SHARED_CL) - .addProperty(new FillSampleRegistrationForm.Property( - GenericSampleRegistrationForm.ID_PREFIX + "user-description", - userDescription))); + final String description = "A very nice control layout."; + remoteConsole + .prepare(new FillSampleRegistrationForm(true, null, SHARED_CL) + .addProperty(new FillSampleRegistrationForm.Property( + GenericSampleRegistrationForm.ID_PREFIX + "user-description", + description))); prepareListingAfterRegistration(sampleTypeCode); remoteConsole.prepare(new CheckSampleTable().expectedRow(new SampleRow(SHARED_CL) - .identifier("CISD").property("USER.DESCRIPTION", userDescription))); + .identifier("CISD").property("DESCRIPTION", false, description))); remoteConsole.finish(30000); client.onModuleLoad(); }