diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/index.html b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/index.html index 96e47bafbe5107f077e56b6313a8e0c2f907364c..2f9cf3b638edbe2d190d0b12e776720410e113a0 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/index.html +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/index.html @@ -15,7 +15,7 @@ require.paths["test/qunit-report"] = testPath + "/lib/qunit/js/qunit-reporter-junit"; require.paths["test/naturalsort"] = testPath + "/lib/naturalsort/js/naturalSort"; - require.urlArgs = 'now=' + Date.now(); +// require.urlArgs = 'now=' + Date.now(); require.shim["test/qunit-report"] = { deps : [ 'test/qunit' ] diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/common.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/common.js index e6b26804e1477ca4cea8bf31516047552fcf4be8..90f1376ca861d59d08c475b8f3f133ecd9fa48f6 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/common.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/common.js @@ -40,6 +40,7 @@ define([ 'jquery', 'openbis', 'underscore', 'test/dtos' ], function($, openbis, this.MaterialDeletionOptions = dtos.MaterialDeletionOptions; this.VocabularyTermDeletionOptions = dtos.VocabularyTermDeletionOptions; this.EntityTypePermId = dtos.EntityTypePermId; + this.EntityTypeSearchCriteria = dtos.EntityTypeSearchCriteria; this.SpacePermId = dtos.SpacePermId; this.ProjectPermId = dtos.ProjectPermId; this.ProjectIdentifier = dtos.ProjectIdentifier; @@ -62,9 +63,13 @@ define([ 'jquery', 'openbis', 'underscore', 'test/dtos' ], function($, openbis, this.SpaceFetchOptions = dtos.SpaceFetchOptions; this.ProjectFetchOptions = dtos.ProjectFetchOptions; this.ExperimentFetchOptions = dtos.ExperimentFetchOptions; + this.ExperimentTypeFetchOptions = dtos.ExperimentTypeFetchOptions; this.SampleFetchOptions = dtos.SampleFetchOptions; + this.SampleTypeFetchOptions = dtos.SampleTypeFetchOptions; this.DataSetFetchOptions = dtos.DataSetFetchOptions; + this.DataSetTypeFetchOptions = dtos.DataSetTypeFetchOptions; this.MaterialFetchOptions = dtos.MaterialFetchOptions; + this.MaterialTypeFetchOptions = dtos.MaterialTypeFetchOptions; this.VocabularyTermFetchOptions = dtos.VocabularyTermFetchOptions; this.DeletionFetchOptions = dtos.DeletionFetchOptions; this.DeletionSearchCriteria = dtos.DeletionSearchCriteria; diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-search.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-search.js index b883dc17fe80edd1afaaeffc89483e087538bed2..f37d68890c5df5d816230cebf58577f986203746 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-search.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-search.js @@ -211,6 +211,36 @@ define([ 'jquery', 'underscore', 'openbis', 'test/common', 'test/naturalsort' ], }, fo); }); + QUnit.test("searchExperimentTypes()", function(assert) { + var c = new common(assert); + + var fSearch = function(facade) { + var criteria = new c.EntityTypeSearchCriteria(); + criteria.withCode().thatStartsWith("HT"); + var fetchOptions = new c.ExperimentTypeFetchOptions(); + fetchOptions.withPropertyAssignments(); + return facade.searchExperimentTypes(criteria, fetchOptions); + } + + var fCheck = function(facade, experimentTypes) { + c.assertEqual(experimentTypes.length, 1, "Number of experiment types"); + var type = experimentTypes[0]; + c.assertEqual(type.getCode(), "HT_SEQUENCING", "Experiment type code"); + c.assertEqual(type.getFetchOptions().hasPropertyAssignments(), true); + var assignments = type.getPropertyAssignments(); + c.assertEqual(assignments.length, 1, "Number of property assignments"); + c.assertEqual(assignments[0].isMandatory(), false, "Mandatory property assignment?"); + var propertyType = assignments[0].getPropertyType(); + c.assertEqual(propertyType.getCode(), "EXPERIMENT_DESIGN", "Property type code"); + c.assertEqual(propertyType.getLabel(), "Experiment Design", "Property type label"); + c.assertEqual(propertyType.getDescription(), "", "Property type description"); + c.assertEqual(propertyType.getDataTypeCode(), "CONTROLLEDVOCABULARY", "Property data type code"); + c.assertEqual(propertyType.isInternalNameSpace(), false, "Property type internal name space?"); + } + + testSearch(c, fSearch, fCheck); + }); + QUnit.test("searchSamples()", function(assert) { var c = new common(assert); @@ -329,6 +359,37 @@ define([ 'jquery', 'underscore', 'openbis', 'test/common', 'test/naturalsort' ], testSearch(c, fSearch, fCheck); }); + QUnit.test("searchSampleTypes()", function(assert) { + var c = new common(assert); + + var fSearch = function(facade) { + var criteria = new c.EntityTypeSearchCriteria(); + criteria.withCode().thatStartsWith("MA"); + var fetchOptions = new c.SampleTypeFetchOptions(); + fetchOptions.withPropertyAssignments().sortBy().label().desc(); + return facade.searchSampleTypes(criteria, fetchOptions); + } + + var fCheck = function(facade, sampleTypes) { + c.assertEqual(sampleTypes.length, 1, "Number of sample types"); + var type = sampleTypes[0]; + c.assertEqual(type.getCode(), "MASTER_SAMPLE", "Sample type code"); + c.assertEqual(type.getFetchOptions().hasPropertyAssignments(), true); + var assignments = type.getPropertyAssignments(); + c.assertEqual(assignments.length, 8, "Number of property assignments"); + c.assertEqual(assignments[0].isMandatory(), true, "Mandatory property assignment?"); + var propertyType = assignments[0].getPropertyType(); + c.assertEqual(propertyType.getCode(), "SAMPLE_KIND", "Property type code"); + c.assertEqual(propertyType.getLabel(), "Sample Kind", "Property type label"); + c.assertEqual(propertyType.getDescription(), "", "Property type description"); + c.assertEqual(propertyType.getDataTypeCode(), "CONTROLLEDVOCABULARY", "Property data type code"); + c.assertEqual(propertyType.isInternalNameSpace(), false, "Property type internal name space?"); + c.assertEqual(assignments[1].getPropertyType().getCode(), "NCBI_ORGANISM_TAXONOMY", "Second property type code"); + } + + testSearch(c, fSearch, fCheck); + }); + QUnit.test("searchDataSets()", function(assert) { var c = new common(assert); @@ -461,6 +522,38 @@ define([ 'jquery', 'underscore', 'openbis', 'test/common', 'test/naturalsort' ], testSearch(c, fSearch, fCheck); }); + QUnit.test("searchDataSetTypes()", function(assert) { + var c = new common(assert); + + var fSearch = function(facade) { + var criteria = new c.EntityTypeSearchCriteria(); + criteria.withCode().thatStartsWith("MA"); + var fetchOptions = new c.DataSetTypeFetchOptions(); + fetchOptions.withPropertyAssignments().sortBy().code().asc(); + return facade.searchDataSetTypes(criteria, fetchOptions); + } + + var fCheck = function(facade, dataSetTypes) { + c.assertEqual(dataSetTypes.length, 1, "Number of data set types"); + var type = dataSetTypes[0]; + c.assertEqual(type.getCode(), "MACS_OUTPUT", "Data set type code"); + c.assertEqual(type.getFetchOptions().hasPropertyAssignments(), true); + var assignments = type.getPropertyAssignments(); + c.assertEqual(assignments.length, 2, "Number of property assignments"); + c.assertEqual(assignments[0].isMandatory(), false, "Mandatory property assignment?"); + var propertyType = assignments[0].getPropertyType(); + c.assertEqual(propertyType.getCode(), "MACS_VERSION", "Property type code"); + c.assertEqual(propertyType.getLabel(), "MACS VERSION", "Property type label"); + c.assertEqual(propertyType.getDescription(), "", "Property type description"); + c.assertEqual(propertyType.getDataTypeCode(), "CONTROLLEDVOCABULARY", "Property data type code"); + c.assertEqual(propertyType.isInternalNameSpace(), false, "Property type internal name space?"); + c.assertEqual(assignments[1].getPropertyType().getCode(), "NOTES", "Second property type code"); + c.assertEqual(assignments[1].getPropertyType().getDataTypeCode(), "MULTILINE_VARCHAR", "Second property data type code"); + } + + testSearch(c, fSearch, fCheck); + }); + QUnit.test("searchMaterials()", function(assert) { var c = new common(assert); @@ -497,6 +590,38 @@ define([ 'jquery', 'underscore', 'openbis', 'test/common', 'test/naturalsort' ], }, fo); }); + QUnit.test("searchMaterialTypes()", function(assert) { + var c = new common(assert); + + var fSearch = function(facade) { + var criteria = new c.EntityTypeSearchCriteria(); + criteria.withCode().thatStartsWith("G"); + var fetchOptions = new c.MaterialTypeFetchOptions(); + fetchOptions.withPropertyAssignments().sortBy().code().desc(); + return facade.searchMaterialTypes(criteria, fetchOptions); + } + + var fCheck = function(facade, materialTypes) { + c.assertEqual(materialTypes.length, 1, "Number of material types"); + var type = materialTypes[0]; + c.assertEqual(type.getCode(), "GENE", "Material type code"); + c.assertEqual(type.getFetchOptions().hasPropertyAssignments(), true); + var assignments = type.getPropertyAssignments(); + c.assertEqual(assignments.length, 2, "Number of property assignments"); + c.assertEqual(assignments[0].isMandatory(), false, "Mandatory property assignment?"); + var propertyType = assignments[0].getPropertyType(); + c.assertEqual(propertyType.getCode(), "GENE_SYMBOLS", "Property type code"); + c.assertEqual(propertyType.getLabel(), "Gene symbols", "Property type label"); + c.assertEqual(propertyType.getDescription(), "", "Property type description"); + c.assertEqual(propertyType.getDataTypeCode(), "VARCHAR", "Property data type code"); + c.assertEqual(propertyType.isInternalNameSpace(), false, "Property type internal name space?"); + c.assertEqual(assignments[1].getPropertyType().getCode(), "DESCRIPTION", "Second property type code"); + c.assertEqual(assignments[1].getPropertyType().getDescription(), "A Description", "Second property type description"); + } + + testSearch(c, fSearch, fCheck); + }); + QUnit.test("searchGlobally() withText thatContains", function(assert) { var c = new common(assert); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/dataset/fetchoptions/DataSetTypeFetchOptions.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/dataset/fetchoptions/DataSetTypeFetchOptions.js index b39179512bd114f0fd5c41d928360426f81ab39a..cd475e9d1cefb65467876b876760d6e20b3b6b90 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/dataset/fetchoptions/DataSetTypeFetchOptions.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/dataset/fetchoptions/DataSetTypeFetchOptions.js @@ -13,7 +13,7 @@ define([ "stjs", "as/dto/common/fetchoptions/FetchOptions" ], function(stjs, Fet prototype.withPropertyAssignments = function() { if (this.propertyAssignments == null) { var PropertyAssignmentFetchOptions = require("as/dto/property/fetchoptions/PropertyAssignmentFetchOptions"); - this.type = new PropertyAssignmentFetchOptions(); + this.propertyAssignments = new PropertyAssignmentFetchOptions(); } return this.propertyAssignments; }; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/experiment/fetchoptions/ExperimentTypeFetchOptions.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/experiment/fetchoptions/ExperimentTypeFetchOptions.js index 9a1acc7da102b29a439663aa7bd304a3308b0b22..7f9c9a386db0588c421a2f66cc0c7a130ded07ec 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/experiment/fetchoptions/ExperimentTypeFetchOptions.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/experiment/fetchoptions/ExperimentTypeFetchOptions.js @@ -13,7 +13,7 @@ define([ "stjs", "as/dto/common/fetchoptions/FetchOptions" ], function(stjs, Fet prototype.withPropertyAssignments = function() { if (this.propertyAssignments == null) { var PropertyAssignmentFetchOptions = require("as/dto/property/fetchoptions/PropertyAssignmentFetchOptions"); - this.type = new PropertyAssignmentFetchOptions(); + this.propertyAssignments = new PropertyAssignmentFetchOptions(); } return this.propertyAssignments; }; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/material/fetchoptions/MaterialTypeFetchOptions.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/material/fetchoptions/MaterialTypeFetchOptions.js index 0b7071f9d63b91eaccd3391f2dd0ab5c97df60e6..97e110f7a6e1f9b70041edc66b055170fded1019 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/material/fetchoptions/MaterialTypeFetchOptions.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/material/fetchoptions/MaterialTypeFetchOptions.js @@ -13,7 +13,7 @@ define([ "stjs", "as/dto/common/fetchoptions/FetchOptions" ], function(stjs, Fet prototype.withPropertyAssignments = function() { if (this.propertyAssignments == null) { var PropertyAssignmentFetchOptions = require("as/dto/property/fetchoptions/PropertyAssignmentFetchOptions"); - this.type = new PropertyAssignmentFetchOptions(); + this.propertyAssignments = new PropertyAssignmentFetchOptions(); } return this.propertyAssignments; }; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/sample/fetchoptions/SampleTypeFetchOptions.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/sample/fetchoptions/SampleTypeFetchOptions.js index c343e7f41410f9ac2b69151d3f206bbd369afd32..1365f357cab0cd9364390d5de8eb1281f01478d6 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/sample/fetchoptions/SampleTypeFetchOptions.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/as/dto/sample/fetchoptions/SampleTypeFetchOptions.js @@ -13,7 +13,7 @@ define([ "stjs", "as/dto/common/fetchoptions/FetchOptions" ], function(stjs, Fet prototype.withPropertyAssignments = function() { if (this.propertyAssignments == null) { var PropertyAssignmentFetchOptions = require("as/dto/property/fetchoptions/PropertyAssignmentFetchOptions"); - this.type = new PropertyAssignmentFetchOptions(); + this.propertyAssignments = new PropertyAssignmentFetchOptions(); } return this.propertyAssignments; }; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/openbis.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/openbis.js index 6ddd105b6450ea00f4227442793a8a17806aa666..736dd7d83a0c9a5f33c3f6aed0cdc9858fef4e4e 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/openbis.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/openbis.js @@ -452,6 +452,18 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { }) } + this.searchExperimentTypes = function(criteria, fetchOptions) { + var thisFacade = this; + return thisFacade._private.ajaxRequest({ + url : openbisUrl, + data : { + "method" : "searchExperimentTypes", + "params" : [ thisFacade._private.sessionToken, criteria, fetchOptions ] + }, + returnType : "SearchResult" + }) + } + this.searchSamples = function(criteria, fetchOptions) { var thisFacade = this; return thisFacade._private.ajaxRequest({ @@ -464,6 +476,18 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { }); } + this.searchSampleTypes = function(criteria, fetchOptions) { + var thisFacade = this; + return thisFacade._private.ajaxRequest({ + url : openbisUrl, + data : { + "method" : "searchSampleTypes", + "params" : [ thisFacade._private.sessionToken, criteria, fetchOptions ] + }, + returnType : "SearchResult" + }); + } + this.searchDataSets = function(criteria, fetchOptions) { var thisFacade = this; return thisFacade._private.ajaxRequest({ @@ -476,12 +500,24 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { }); } - this.searchMaterials = function(criteria, fetchOptions) { + this.searchDataSetTypes = function(criteria, fetchOptions) { + var thisFacade = this; + return thisFacade._private.ajaxRequest({ + url : openbisUrl, + data : { + "method" : "searchDataSetTypes", + "params" : [ thisFacade._private.sessionToken, criteria, fetchOptions ] + }, + returnType : "SearchResult" + }); + } + + this.searchMaterialTypes = function(criteria, fetchOptions) { var thisFacade = this; return thisFacade._private.ajaxRequest({ url : openbisUrl, data : { - "method" : "searchMaterials", + "method" : "searchMaterialTypes", "params" : [ thisFacade._private.sessionToken, criteria, fetchOptions ] }, returnType : "SearchResult"