Skip to content
Snippets Groups Projects
Commit 58399eb0 authored by juanf's avatar juanf
Browse files

SSDM-9367 : Minimum modifications to get Sample/Material types into Property types on the V1 API

parent b5c394ca
No related merge requests found
......@@ -92,6 +92,7 @@ import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.project.ProjectIden
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.project.ProjectPermIdId;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.project.ProjectTechIdId;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.sample.ISampleId;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.sample.ISampleId;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.sample.SampleIdentifierId;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.sample.SamplePermIdId;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.id.sample.SampleTechIdId;
......@@ -366,6 +367,12 @@ public class Translator
}
ptInitializer.setDataType(propertyType.getDataType().getCode());
if (propertyType.getSampleType() != null) {
ptInitializer.setSampleTypeCode(propertyType.getSampleType().getCode());
}
if (propertyType.getMaterialType() != null) {
ptInitializer.setMaterialTypeCode(propertyType.getMaterialType().getCode());
}
ptInitializer.setCode(propertyType.getCode());
ptInitializer.setLabel(propertyType.getLabel());
ptInitializer.setDescription(propertyType.getDescription());
......@@ -851,6 +858,12 @@ public class Translator
ptInitializer = new PropertyTypeInitializer();
}
ptInitializer.setDataType(propertyType.getDataType().getCode());
if (propertyType.getSampleType() != null) {
ptInitializer.setSampleTypeCode(propertyType.getSampleType().getCode());
}
if (propertyType.getMaterialType() != null) {
ptInitializer.setMaterialTypeCode(propertyType.getMaterialType().getCode());
}
ptInitializer.setCode(propertyType.getCode());
ptInitializer.setLabel(propertyType.getLabel());
ptInitializer.setDescription(propertyType.getDescription());
......
......@@ -46,6 +46,10 @@ public class PropertyType implements Serializable
{
private DataTypeCode dataType;
private String sampleTypeCode;
private String materialTypeCode;
private String code;
private String label;
......@@ -100,6 +104,14 @@ public class PropertyType implements Serializable
this.dataType = dataType;
}
public String getSampleTypeCode() { return sampleTypeCode; }
public void setSampleTypeCode(String sampleTypeCode) { this.sampleTypeCode = sampleTypeCode; }
public String getMaterialTypeCode() { return materialTypeCode; }
public void setMaterialTypeCode(String materialTypeCode) { this.materialTypeCode = materialTypeCode; }
public String getCode()
{
return code;
......@@ -143,6 +155,10 @@ public class PropertyType implements Serializable
private DataTypeCode dataType;
private String sampleTypeCode;
private String materialTypeCode;
private String code;
private String label;
......@@ -169,6 +185,8 @@ public class PropertyType implements Serializable
throw new IllegalArgumentException("Unspecified data type.");
}
this.dataType = initializer.getDataType();
this.sampleTypeCode = initializer.getSampleTypeCode();
this.materialTypeCode = initializer.getMaterialTypeCode();
InitializingChecks.checkValidString(initializer.getCode(), "Unspecified code.");
this.code = initializer.getCode();
......@@ -204,6 +222,10 @@ public class PropertyType implements Serializable
return dataType;
}
public String getSampleTypeCode() { return sampleTypeCode; }
public String getMaterialTypeCode() { return materialTypeCode; }
/**
* Return the code of this property type.
*/
......@@ -293,6 +315,10 @@ public class PropertyType implements Serializable
this.dataType = dataType;
}
public void setSampleTypeCode(String sampleTypeCode) { this.sampleTypeCode = sampleTypeCode; }
public void setMaterialTypeCode(String materialTypeCode) { this.materialTypeCode = materialTypeCode; }
private void setCode(String code)
{
this.code = code;
......
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