Skip to content
Snippets Groups Projects
Material.js 8.75 KiB
Newer Older
  • Learn to ignore specific revisions
  • /**
     * Class automatically generated with
     * {@link ch.ethz.sis.openbis.generic.shared.api.v3.dto.generators.DtoGenerator}
     */
    define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) {
    	var Material = function() {
    	};
    	stjs.extend(Material, null, [], function(constructor, prototype) {
    
    		prototype['@type'] = 'as.dto.material.Material';
    
    		constructor.serialVersionUID = 1;
    		prototype.fetchOptions = null;
    		prototype.permId = null;
    		prototype.code = null;
    		prototype.type = null;
    		prototype.history = null;
    		prototype.registrationDate = null;
    		prototype.registrator = null;
    		prototype.modificationDate = null;
    		prototype.properties = null;
    		prototype.materialProperties = null;
    		prototype.tags = null;
    		prototype.getFetchOptions = function() {
    			return this.fetchOptions;
    		};
    		prototype.setFetchOptions = function(fetchOptions) {
    			this.fetchOptions = fetchOptions;
    		};
    		prototype.getPermId = function() {
    			return this.permId;
    		};
    		prototype.setPermId = function(permId) {
    			this.permId = permId;
    		};
    		prototype.getCode = function() {
    			return this.code;
    		};
    		prototype.setCode = function(code) {
    			this.code = code;
    		};
    		prototype.getType = function() {
    
    			if (this.getFetchOptions() && this.getFetchOptions().hasType()) {
    
    				return this.type;
    			} else {
    				throw new exceptions.NotFetchedException("Material type has not been fetched.");
    			}
    		};
    		prototype.setType = function(type) {
    			this.type = type;
    		};
    		prototype.getHistory = function() {
    
    			if (this.getFetchOptions() && this.getFetchOptions().hasHistory()) {
    
    				return this.history;
    			} else {
    				throw new exceptions.NotFetchedException("History has not been fetched.");
    			}
    		};
    		prototype.setHistory = function(history) {
    			this.history = history;
    		};
    		prototype.getRegistrationDate = function() {
    			return this.registrationDate;
    		};
    		prototype.setRegistrationDate = function(registrationDate) {
    			this.registrationDate = registrationDate;
    		};
    		prototype.getRegistrator = function() {
    
    			if (this.getFetchOptions() && this.getFetchOptions().hasRegistrator()) {
    
    				return this.registrator;
    			} else {
    				throw new exceptions.NotFetchedException("Registrator has not been fetched.");
    			}
    		};
    		prototype.setRegistrator = function(registrator) {
    			this.registrator = registrator;
    		};
    		prototype.getModificationDate = function() {
    			return this.modificationDate;
    		};
    		prototype.setModificationDate = function(modificationDate) {
    			this.modificationDate = modificationDate;
    		};
    
    		prototype.getProperty = function(propertyName) {
    			var properties = this.getProperties();
    			return properties ? properties[propertyName] : null;
    
    pkupczyk's avatar
    pkupczyk committed
    		};
    
    		prototype.setProperty = function(propertyName, propertyValue) {
    			if (this.properties == null) {
    				this.properties = {};
    			}
    			this.properties[propertyName] = propertyValue;
    		};
    
    		prototype.getProperties = function() {
    
    			if (this.getFetchOptions() && this.getFetchOptions().hasProperties()) {
    
    				return this.properties;
    			} else {
    				throw new exceptions.NotFetchedException("Properties has not been fetched.");
    			}
    		};
    		prototype.setProperties = function(properties) {
    			this.properties = properties;
    		};
    
    		prototype.getIntegerProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setIntegerProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getVarcharProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setVarcharProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getMultilineVarcharProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setMultilineVarcharProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getRealProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setRealProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getTimestampProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setTimestampProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getBooleanProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setBooleanProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getControlledVocabularyProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setControlledVocabularyProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getSampleProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setSampleProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getHyperlinkProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setHyperlinkProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getXmlProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setXmlProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getIntegerArrayProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setIntegerArrayProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getRealArrayProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setRealArrayProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getStringArrayProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setStringArrayProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getTimestampArrayProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setTimestampArrayProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
            prototype.getJsonProperty = function(propertyName) {
                return this.getProperty(propertyName);
            };
            prototype.setJsonProperty = function(propertyName, propertyValue) {
                this.setProperty(propertyName, propertyValue);
            };
    
    		prototype.getMaterialProperty = function(propertyName) {
    			var properties = this.getMaterialProperties();
    			return properties ? properties[propertyName] : null;
    		};
    
    		prototype.setMaterialProperty = function(propertyName, propertyValue) {
    			if (this.materialProperties == null) {
    				this.materialProperties = {};
    			}
    			this.materialProperties[propertyName] = propertyValue;
    		};
    
    		prototype.getMaterialProperties = function() {
    
    			if (this.getFetchOptions() && this.getFetchOptions().hasMaterialProperties()) {
    
    				return this.materialProperties;
    			} else {
    				throw new exceptions.NotFetchedException("Material properties has not been fetched.");
    			}
    		};
    		prototype.setMaterialProperties = function(materialProperties) {
    			this.materialProperties = materialProperties;
    		};
    		prototype.getTags = function() {
    
    			if (this.getFetchOptions() && this.getFetchOptions().hasTags()) {
    
    				return this.tags;
    			} else {
    				throw new exceptions.NotFetchedException("Tags has not been fetched.");
    			}
    		};
    		prototype.setTags = function(tags) {
    			this.tags = tags;
    		};
    	}, {
    		fetchOptions : "MaterialFetchOptions",
    		permId : "MaterialPermId",
    		type : "MaterialType",
    		history : {
    			name : "List",
    			arguments : [ "HistoryEntry" ]
    		},
    		registrationDate : "Date",
    		registrator : "Person",
    		modificationDate : "Date",
    		properties : {
    			name : "Map",
    
    Adam Laskowski's avatar
    Adam Laskowski committed
    			arguments : [ "String", "Serializable" ]
    
    		},
    		tags : {
    			name : "Set",
    			arguments : [ "Tag" ]
    		}
    	});
    	return Material;
    })