diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/PropertyAssignment.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/PropertyAssignment.js index 89b940f78a0128d44df0ccfd80d329441b927f43..e61ed84e380b267071140444d77437de97cca4bc 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/PropertyAssignment.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/PropertyAssignment.js @@ -18,6 +18,15 @@ define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { prototype.setPropertyType = function(propertyType) { this.propertyType = propertyType; }; + prototype.getVocabularyFetchOptions = function() { + return this.propertyType.getVocabularyFetchOptions(); + } + prototype.getVocabulary = function() { + if (this.getVocabularyFetchOptions()) { + return this.propertyType.getVocabulary(); + } else { + throw new exceptions.NotFetchedException("Vocabulary has not been fetched."); + } } }, { propertyType : "PropertyType" }); 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 ff007fc95593a7751b70f7a081ade7c19a3f821e..13141c23e1922703a95ab37ee808f80186369266 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 @@ -9,6 +9,8 @@ define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { prototype.description = null; prototype.dataTypeCode = null; prototype.internalNameSpace = null; + prototype.vocabularyFetchOptions = null; + prototype.vocabulary = null; prototype.getCode = function() { return this.code; }; @@ -39,7 +41,25 @@ define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { prototype.setInternalNameSpace = function(internalNameSpace) { this.internalNameSpace = internalNameSpace; }; + prototype.getVocabularyFetchOptions = function() { + return this.vocabularyFetchOptions; + }; + prototype.setVocabularyFetchOptions = function(vocabularyFetchOptions) { + this.vocabularyFetchOptions = vocabularyFetchOptions; + }; + prototype.getVocabulary = function() { + if (this.getVocabularyFetchOptions() && this.getVocabularyFetchOptions().hasVocabulary()) { + return this.vocabulary; + } else { + throw new exceptions.NotFetchedException("Vocabulary has not been fetched."); + } + }; + prototype.setVocabulary = function(vocabulary) { + this.vocabulary = vocabulary; + }; }, { + vocabularyFetchOptions : "VocabularyTermFetchOptions", + vocabulary : "Vocabulary", dataTypeCode : "DataTypeCode" }); return PropertyType; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/fetchoptions/PropertyAssignmentFetchOptions.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/fetchoptions/PropertyAssignmentFetchOptions.js index ece39971e15fa1a7faf1bd4e6e13db4d94fc7e21..ca048e4257e4cba1d14d3f472af1263a2385caeb 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/fetchoptions/PropertyAssignmentFetchOptions.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/property/fetchoptions/PropertyAssignmentFetchOptions.js @@ -1,10 +1,25 @@ -define([ "stjs", "as/dto/common/fetchoptions/FetchOptions", "as/dto/property/fetchoptions/PropertyAssignmentSortOptions" ], function(stjs, FetchOptions) { +define([ "stjs", "as/dto/common/fetchoptions/FetchOptions", "as/dto/vocabulary/fetchoptions/VocabularyFetchOptions", + "as/dto/property/fetchoptions/PropertyAssignmentSortOptions" ], function(stjs, FetchOptions) { var PropertyAssignmentFetchOptions = function() { }; stjs.extend(PropertyAssignmentFetchOptions, FetchOptions, [ FetchOptions ], function(constructor, prototype) { prototype['@type'] = 'as.dto.property.fetchoptions.PropertyAssignmentFetchOptions'; constructor.serialVersionUID = 1; + prototype.vocabulary = null; prototype.sort = null; + prototype.withVocabulary = function() { + if (this.vocabulary == null) { + var VocabularyFetchOptions = require("as/dto/vocabulary/fetchoptions/VocabularyFetchOptions"); + this.vocabulary = new VocabularyFetchOptions(); + } + return this.vocabulary; + }; + prototype.withVocabularyUsing = function(fetchOptions) { + return this.vocabulary = fetchOptions; + }; + prototype.hasVocabulary = function() { + return this.vocabulary != null; + }; prototype.sortBy = function() { if (this.sort == null) { var PropertyAssignmentSortOptions = require("as/dto/property/fetchoptions/PropertyAssignmentSortOptions");