Skip to content
Snippets Groups Projects
Commit 9381e89c authored by felmer's avatar felmer
Browse files

SSDM-3529: Javascript part done.

SVN: 36460
parent a82c8350
No related branches found
No related tags found
No related merge requests found
......@@ -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"
});
......
......@@ -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;
......
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");
......
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