diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/EntityPropertyTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/EntityPropertyTranslator.java index 0fa393a89202a3bbb36bd65ebf6d1f439ce94ad2..03b717c1e6c66744c5630c2496e55b616d5c7aff 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/EntityPropertyTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/EntityPropertyTranslator.java @@ -63,30 +63,6 @@ public final class EntityPropertyTranslator return result; } - public static IEntityProperty translateWithoutEscaping(EntityPropertyPE propertyPE, - Map<PropertyTypePE, PropertyType> cacheOrNull) - { - final DataTypeCode typeCode = PropertyTranslatorUtils.getDataTypeCode(propertyPE); - final IEntityProperty result = PropertyTranslatorUtils.createEntityProperty(typeCode); - result.setPropertyType(PropertyTypeTranslator.translate(propertyPE - .getEntityTypePropertyType().getPropertyType(), cacheOrNull)); - result.setOrdinal(propertyPE.getEntityTypePropertyType().getOrdinal()); - switch (typeCode) - { - case CONTROLLEDVOCABULARY: - result.setVocabularyTerm(VocabularyTermTranslator - .translateWithoutEscaping(propertyPE.getVocabularyTerm())); - break; - case MATERIAL: - result.setMaterial(MaterialTranslator.translateWithoutEscaping( - propertyPE.getMaterialValue(), false)); - break; - default: - result.setValue(propertyPE.tryGetUntypedValue()); - } - return result; - } - public final static List<IEntityProperty> translate(final Set<? extends EntityPropertyPE> list, Map<PropertyTypePE, PropertyType> cacheOrNull) { @@ -102,22 +78,6 @@ public final class EntityPropertyTranslator return result; } - public final static List<IEntityProperty> translateWithoutEscaping( - final Set<? extends EntityPropertyPE> list, - Map<PropertyTypePE, PropertyType> cacheOrNull) - { - if (list == null) - { - return null; - } - final List<IEntityProperty> result = new ArrayList<IEntityProperty>(); - for (final EntityPropertyPE property : list) - { - result.add(translateWithoutEscaping(property, cacheOrNull)); - } - return result; - } - public final static IEntityProperty[] translate(final EntityPropertyPE[] list, Map<PropertyTypePE, PropertyType> cacheOrNull) { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/ExperimentTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/ExperimentTranslator.java index da9cd75818c0ae97ccbbf64cdb6daf02580988de..8992f58c95b5debce9a82c990166cbd06b2bad97 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/ExperimentTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/ExperimentTranslator.java @@ -54,8 +54,8 @@ public final class ExperimentTranslator { if (experiment.isPropertiesInitialized()) { - result.setProperties(EntityPropertyTranslator.translateWithoutEscaping( - experiment.getProperties(), new HashMap<PropertyTypePE, PropertyType>())); + result.setProperties(EntityPropertyTranslator.translate(experiment.getProperties(), + new HashMap<PropertyTypePE, PropertyType>())); } else { result.setProperties(new ArrayList<IEntityProperty>()); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/MaterialTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/MaterialTranslator.java index 7f2c9ee661f3aab9f53761e411ac8f691593f641..e875ba96b63e6ab3c824068f2cf1f76e3eae8ed2 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/MaterialTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/MaterialTranslator.java @@ -79,30 +79,6 @@ public final class MaterialTranslator return result; } - public final static Material translateWithoutEscaping(final MaterialPE materialPE, - final boolean withProperties) - { - if (materialPE == null) - { - return null; - } - final Material result = new Material(); - result.setCode(materialPE.getCode()); - result.setId(HibernateUtils.getId(materialPE)); - result.setModificationDate(materialPE.getModificationDate()); - result.setMaterialType(MaterialTypeTranslator.translate(materialPE.getMaterialType(), - new HashMap<PropertyTypePE, PropertyType>())); - result.setDatabaseInstance(DatabaseInstanceTranslator.translate(materialPE - .getDatabaseInstance())); - result.setRegistrator(PersonTranslator.translate(materialPE.getRegistrator())); - result.setRegistrationDate(materialPE.getRegistrationDate()); - if (withProperties) - { - setProperties(materialPE, result); - } - return result; - } - private static void setProperties(final MaterialPE materialPE, final Material result) { if (materialPE.isPropertiesInitialized()) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/VocabularyTermTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/VocabularyTermTranslator.java index b8528f8f6e5852c9210d5c61a181d8e64713f384..967a00365bfd9c0d8e9f366f1fdb1b5a5f2d355b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/VocabularyTermTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/VocabularyTermTranslator.java @@ -53,24 +53,6 @@ public class VocabularyTermTranslator return result; } - public static VocabularyTerm translateWithoutEscaping(VocabularyTermPE vt) - { - if (vt == null) - { - return null; - } - VocabularyTerm result = new VocabularyTerm(); - result.setId(HibernateUtils.getId(vt)); - result.setCode(vt.getCode()); - result.setLabel(vt.getLabel()); - result.setDescription(vt.getDescription()); - result.setOrdinal(vt.getOrdinal()); - result.setUrl(vt.getUrl()); - result.setRegistrationDate(vt.getRegistrationDate()); - result.setRegistrator(PersonTranslator.translate(vt.getRegistrator())); - return result; - } - public static List<VocabularyTerm> translateTerms(List<VocabularyTermPE> terms) { final List<VocabularyTerm> result = new ArrayList<VocabularyTerm>();