diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/PropertyType.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/PropertyType.js index a163bb6c388019e9dc5afb7e55645ae060bb9ba0..c6de5062986ee634d708a754fd943e015d5366ff 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/PropertyType.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/PropertyType.js @@ -14,6 +14,7 @@ define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { prototype.dataType = null; prototype.vocabulary = null; prototype.materialType = null; + prototype.sampleType = null; prototype.schema = null; prototype.transformation = null; prototype.semanticAnnotations = null; @@ -89,6 +90,16 @@ define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { prototype.setMaterialType = function(materialType) { this.materialType = materialType; }; + prototype.getSampleType = function() { + if (this.getFetchOptions() && this.getFetchOptions().hasSampleType()) { + return this.sampleType; + } else { + throw new exceptions.NotFetchedException("Sample type has not been fetched."); + } + }; + prototype.setSampleType = function(sampleType) { + this.sampleType = sampleType; + }; prototype.getSchema = function() { return this.schema; }; @@ -139,6 +150,7 @@ define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { dataType : "DataType", vocabulary : "Vocabulary", materialType : "MaterialType", + sampleType : "SampleType", registrator : "Person", registrationDate : "Date" }); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/create/PropertyTypeCreation.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/create/PropertyTypeCreation.js index 94ffd139e6c891a5a245e029419bc30282fc151f..f2f7b875f7ade1b30be104662111639c269275f5 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/create/PropertyTypeCreation.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/create/PropertyTypeCreation.js @@ -12,6 +12,7 @@ define([ "stjs" ], function(stjs) { prototype.dataType = null; prototype.vocabularyId = null; prototype.materialTypeId = null; + prototype.sampleTypeId = null; prototype.schema = null; prototype.transformation = null; prototype.metaData = null; @@ -64,6 +65,12 @@ define([ "stjs" ], function(stjs) { prototype.setMaterialTypeId = function(materialTypeId) { this.materialTypeId = materialTypeId; }; + prototype.getSampleTypeId = function() { + return this.sampleTypeId; + }; + prototype.setSampleTypeId = function(sampleTypeId) { + this.sampleTypeId = sampleTypeId; + }; prototype.getSchema = function() { return this.schema; }; @@ -85,7 +92,8 @@ define([ "stjs" ], function(stjs) { }, { dataType : "DataType", vocabularyId : "IVocabularyId", - materialTypeId : "IEntityTypeId" + materialTypeId : "IEntityTypeId", + sampleTypeId : "IEntityTypeId" }); return PropertyTypeCreation; }) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/fetchoptions/PropertyTypeFetchOptions.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/fetchoptions/PropertyTypeFetchOptions.js index f706e3f0cabca52f9801469fa8ec25693f4eb43e..f0b37460a527ac3353e2bbb84f379688fa1becfb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/fetchoptions/PropertyTypeFetchOptions.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/fetchoptions/PropertyTypeFetchOptions.js @@ -1,4 +1,5 @@ -define([ "stjs", "as/dto/common/fetchoptions/FetchOptions", "as/dto/vocabulary/fetchoptions/VocabularyFetchOptions", "as/dto/material/fetchoptions/MaterialTypeFetchOptions", +define([ "stjs", "as/dto/common/fetchoptions/FetchOptions", "as/dto/vocabulary/fetchoptions/VocabularyFetchOptions", "as/dto/material/fetchoptions/MaterialTypeFetchOptions", + "as/dto/sample/fetchoptions/SampleTypeFetchOptions", "as/dto/semanticannotation/fetchoptions/SemanticAnnotationFetchOptions", "as/dto/person/fetchoptions/PersonFetchOptions", "as/dto/property/fetchoptions/PropertyTypeSortOptions" ], function( stjs, FetchOptions) { var PropertyTypeFetchOptions = function() { @@ -8,6 +9,7 @@ define([ "stjs", "as/dto/common/fetchoptions/FetchOptions", "as/dto/vocabulary/f constructor.serialVersionUID = 1; prototype.vocabulary = null; prototype.materialType = null; + prototype.sampleType = null; prototype.semanticAnnotations = null; prototype.registrator = null; prototype.sort = null; @@ -37,6 +39,19 @@ define([ "stjs", "as/dto/common/fetchoptions/FetchOptions", "as/dto/vocabulary/f prototype.hasMaterialType = function() { return this.materialType != null; }; + prototype.withSampleType = function() { + if (this.sampleType == null) { + var SampleTypeFetchOptions = require("as/dto/sample/fetchoptions/SampleTypeFetchOptions"); + this.sampleType = new SampleTypeFetchOptions(); + } + return this.sampleType; + }; + prototype.withSampleTypeUsing = function(fetchOptions) { + return this.sampleType = fetchOptions; + }; + prototype.hasSampleType = function() { + return this.sampleType != null; + }; prototype.withSemanticAnnotations = function() { if (this.semanticAnnotations == null) { var SemanticAnnotationFetchOptions = require("as/dto/semanticannotation/fetchoptions/SemanticAnnotationFetchOptions"); @@ -76,6 +91,7 @@ define([ "stjs", "as/dto/common/fetchoptions/FetchOptions", "as/dto/vocabulary/f }, { vocabulary : "VocabularyFetchOptions", materialType : "MaterialTypeFetchOptions", + sampleType : "SampleTypeFetchOptions", semanticAnnotations : "SemanticAnnotationFetchOptions", registrator : "PersonFetchOptions", sort : "PropertyTypeSortOptions" diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/property/PropertyType.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/property/PropertyType.java index 138d72a3a8b7f9470bc29a4a2d456a27081ecdf3..0274c09662c1fd7915e5d91182f83248cc0c21a9 100644 --- a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/property/PropertyType.java +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/property/PropertyType.java @@ -15,6 +15,14 @@ */ package ch.ethz.sis.openbis.generic.asapi.v3.dto.property; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.interfaces.ICodeHolder; import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.interfaces.IDescriptionHolder; import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.interfaces.IPermIdHolder; @@ -23,19 +31,13 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.interfaces.IRegistratorHo import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.interfaces.ISemanticAnnotationsHolder; import ch.ethz.sis.openbis.generic.asapi.v3.dto.material.MaterialType; import ch.ethz.sis.openbis.generic.asapi.v3.dto.person.Person; -import ch.ethz.sis.openbis.generic.asapi.v3.dto.property.DataType; import ch.ethz.sis.openbis.generic.asapi.v3.dto.property.fetchoptions.PropertyTypeFetchOptions; import ch.ethz.sis.openbis.generic.asapi.v3.dto.property.id.PropertyTypePermId; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.SampleType; import ch.ethz.sis.openbis.generic.asapi.v3.dto.semanticannotation.SemanticAnnotation; import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.Vocabulary; import ch.ethz.sis.openbis.generic.asapi.v3.exceptions.NotFetchedException; import ch.systemsx.cisd.base.annotation.JsonObject; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; -import java.util.Date; -import java.util.List; -import java.util.Map; /* * Class automatically generated with DtoGenerator @@ -76,6 +78,9 @@ public class PropertyType implements Serializable, ICodeHolder, IDescriptionHold @JsonProperty private MaterialType materialType; + @JsonProperty + private SampleType sampleType; + @JsonProperty private String schema; @@ -239,6 +244,23 @@ public class PropertyType implements Serializable, ICodeHolder, IDescriptionHold this.materialType = materialType; } + @JsonIgnore + public SampleType getSampleType() + { + if (getFetchOptions() != null && getFetchOptions().hasSampleType()) + { + return sampleType; + } else + { + throw new NotFetchedException("Sample type has not been fetched."); + } + } + + public void setSampleType(SampleType sampleType) + { + this.sampleType = sampleType; + } + // Method automatically generated with DtoGenerator @JsonIgnore public String getSchema() diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/property/create/PropertyTypeCreation.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/property/create/PropertyTypeCreation.java index 25fd7e46974092146cd049145192e25085e30990..d8c4fa17504299a0452786e40bfc192b5eb967f9 100644 --- a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/property/create/PropertyTypeCreation.java +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/property/create/PropertyTypeCreation.java @@ -61,6 +61,9 @@ public class PropertyTypeCreation implements ICreation, IObjectCreation @JsonProperty private IEntityTypeId materialTypeId; + @JsonProperty + private IEntityTypeId sampleTypeId; + @JsonProperty private String schema; @@ -69,7 +72,7 @@ public class PropertyTypeCreation implements ICreation, IObjectCreation @JsonProperty private Map<String, String> metaData; - + @JsonIgnore public String getCode() { @@ -158,6 +161,17 @@ public class PropertyTypeCreation implements ICreation, IObjectCreation this.materialTypeId = materialTypeId; } + @JsonIgnore + public IEntityTypeId getSampleTypeId() + { + return sampleTypeId; + } + + public void setSampleTypeId(IEntityTypeId sampleTypeId) + { + this.sampleTypeId = sampleTypeId; + } + @JsonIgnore public String getSchema() { diff --git a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/property/fetchoptions/PropertyTypeFetchOptions.java b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/property/fetchoptions/PropertyTypeFetchOptions.java index 7b25b5abc49feed0732cb85ae149f91888a911d7..0c034fe7b11d433f6be17a109f9e6683d586afd3 100644 --- a/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/property/fetchoptions/PropertyTypeFetchOptions.java +++ b/openbis_api/source/java/ch/ethz/sis/openbis/generic/asapi/v3/dto/property/fetchoptions/PropertyTypeFetchOptions.java @@ -15,16 +15,19 @@ */ package ch.ethz.sis.openbis.generic.asapi.v3.dto.property.fetchoptions; +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; + import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.fetchoptions.FetchOptions; import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.fetchoptions.FetchOptionsToStringBuilder; import ch.ethz.sis.openbis.generic.asapi.v3.dto.material.fetchoptions.MaterialTypeFetchOptions; import ch.ethz.sis.openbis.generic.asapi.v3.dto.person.fetchoptions.PersonFetchOptions; import ch.ethz.sis.openbis.generic.asapi.v3.dto.property.PropertyType; +import ch.ethz.sis.openbis.generic.asapi.v3.dto.sample.fetchoptions.SampleTypeFetchOptions; import ch.ethz.sis.openbis.generic.asapi.v3.dto.semanticannotation.fetchoptions.SemanticAnnotationFetchOptions; import ch.ethz.sis.openbis.generic.asapi.v3.dto.vocabulary.fetchoptions.VocabularyFetchOptions; import ch.systemsx.cisd.base.annotation.JsonObject; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.io.Serializable; /* * Class automatically generated with DtoGenerator @@ -40,6 +43,9 @@ public class PropertyTypeFetchOptions extends FetchOptions<PropertyType> impleme @JsonProperty private MaterialTypeFetchOptions materialType; + @JsonProperty + private SampleTypeFetchOptions sampleType; + @JsonProperty private SemanticAnnotationFetchOptions semanticAnnotations; @@ -93,6 +99,25 @@ public class PropertyTypeFetchOptions extends FetchOptions<PropertyType> impleme return materialType != null; } + public SampleTypeFetchOptions withSampleType() + { + if (sampleType == null) + { + sampleType = new SampleTypeFetchOptions(); + } + return sampleType; + } + + public SampleTypeFetchOptions withSampleTypeUsing(SampleTypeFetchOptions fetchOptions) + { + return sampleType = fetchOptions; + } + + public boolean hasSampleType() + { + return sampleType != null; + } + // Method automatically generated with DtoGenerator public SemanticAnnotationFetchOptions withSemanticAnnotations() { @@ -154,6 +179,7 @@ public class PropertyTypeFetchOptions extends FetchOptions<PropertyType> impleme { return sort; } + @Override protected FetchOptionsToStringBuilder getFetchOptionsStringBuilder() { diff --git a/openbis_api/sourceTest/java/ch/ethz/sis/openbis/generic/sharedapi/v3/dictionary.txt b/openbis_api/sourceTest/java/ch/ethz/sis/openbis/generic/sharedapi/v3/dictionary.txt index 286dd2c7fe1d350334593c02c8cfc474959de409..378bce5d0abe82d88a1e3e354881a6656adbf0c9 100644 --- a/openbis_api/sourceTest/java/ch/ethz/sis/openbis/generic/sharedapi/v3/dictionary.txt +++ b/openbis_api/sourceTest/java/ch/ethz/sis/openbis/generic/sharedapi/v3/dictionary.txt @@ -2333,4 +2333,12 @@ set Rights CREATE is Execute In Order -set Execute In Order \ No newline at end of file +set Execute In Order + +get Sample Type +get Sample Type Id +has Sample Type +set Sample Type +set Sample Type Id +with Sample Type +with Sample Type Using