diff --git a/plasmid/source/core-plugins/newbrowser/1/as/initialize-master-data.py b/plasmid/source/core-plugins/newbrowser/1/as/initialize-master-data.py index 418e552ed6db749967ae6d5ed3b196fde00703c0..430d54465d762ce730f071177eab514ed1992714 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/initialize-master-data.py +++ b/plasmid/source/core-plugins/newbrowser/1/as/initialize-master-data.py @@ -17,8 +17,8 @@ ## ## Configuration ## -#PATH_TO_MANAGE_PROPERTIES_SCRIPTS = "/Users/juanf/Documents/workspace/openbis/source/core-plugins/newbrowser/1/compatibility/"; -PATH_TO_MANAGE_PROPERTIES_SCRIPTS = None; +PATH_TO_MANAGE_PROPERTIES_SCRIPTS = "/Users/juanf/Documents/workspace/openbis/source/core-plugins/newbrowser/1/compatibility/"; +#PATH_TO_MANAGE_PROPERTIES_SCRIPTS = "/Users/juanf/Documents/installations/S195/servers/core-plugins/newbrowser/1/compatibility/"; # MasterDataRegistrationTransaction Class import os @@ -699,7 +699,8 @@ addPropertiesToSamples([ ["STORAGE_ROW", "Physical Storage", "Storage Row", DataType.INTEGER, None, "Storage Row", None], ["STORAGE_COLUMN", "Physical Storage", "Storage Column", DataType.INTEGER, None, "Storage Column", None], ["STORAGE_BOX_NAME", "Physical Storage", "Storage Box Name", DataType.VARCHAR, None, "Storage Box Name", None], - ["STORAGE_USER", "Physical Storage", "Storage User Id", DataType.VARCHAR, None, "Storage User Id", None] + ["STORAGE_USER", "Physical Storage", "Storage User Id", DataType.VARCHAR, None, "Storage User Id", None], + ["STORAGE_POSITION", "Physical Storage", "Storage Position", DataType.VARCHAR, None, "Storage Position", None] ]); ## diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/Profile.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/Profile.js index c78f15065e450cd41ab0148693ff28ca98f1fc33..67b5e6fae6a1e69017e88bcd8a050a6ab885d047 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/Profile.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/Profile.js @@ -105,6 +105,7 @@ $.extend(DefaultProfile.prototype, { propertyGroup.columnProperty = storagePropertyGroups[i]["COLUMN_PROPERTY"]; propertyGroup.boxProperty = storagePropertyGroups[i]["BOX_PROPERTY"]; propertyGroup.userProperty = storagePropertyGroups[i]["USER_PROPERTY"]; + propertyGroup.positionProperty = storagePropertyGroups[i]["POSITION_PROPERTY"]; return propertyGroup; } } @@ -131,6 +132,7 @@ $.extend(DefaultProfile.prototype, { propertyGroups[i].columnProperty = storagePropertyGroups[i]["COLUMN_PROPERTY"]; propertyGroups[i].boxProperty = storagePropertyGroups[i]["BOX_PROPERTY"]; propertyGroups[i].userProperty = storagePropertyGroups[i]["USER_PROPERTY"]; + propertyGroups[i].positionProperty = storagePropertyGroups[i]["POSITION_PROPERTY"]; } return propertyGroups; } diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/StandardProfile.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/StandardProfile.js index 896d9ea4e6375531c29adadb073d28f4915f9265..42735ad0115fdd6b1fda1b17b1b585f5160d5338 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/StandardProfile.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/config/StandardProfile.js @@ -7,8 +7,6 @@ $.extend(StandardProfile.prototype, DefaultProfile.prototype, { init: function(serverFacade){ DefaultProfile.prototype.init.call(this, serverFacade); - this.inventorySpaces = ["MATERIALS", "METHODS"]; - this.storagesConfiguration = { "isEnabled" : true, /* @@ -17,11 +15,12 @@ $.extend(StandardProfile.prototype, DefaultProfile.prototype, { "STORAGE_PROPERTIES": [{ "STORAGE_PROPERTY_GROUP" : "Physical Storage", //Where the storage will be painted. "STORAGE_GROUP_DISPLAY_NAME" : "Physical Storage", //Storage Group Name - "NAME_PROPERTY" : "STORAGE_NAMES", //Should be a Vocabulary. - "ROW_PROPERTY" : "STORAGE_ROW", //Should be an integer. - "COLUMN_PROPERTY" : "STORAGE_COLUMN", //Should be an integer. - "BOX_PROPERTY" : "STORAGE_BOX_NAME", //Should be text. - "USER_PROPERTY" : "STORAGE_USER" //Should be text. + "NAME_PROPERTY" : "STORAGE_NAMES", //Should be a Vocabulary. + "ROW_PROPERTY" : "STORAGE_ROW", //Should be an integer. + "COLUMN_PROPERTY" : "STORAGE_COLUMN", //Should be an integer. + "BOX_PROPERTY" : "STORAGE_BOX_NAME", //Should be text. + "USER_PROPERTY" : "STORAGE_USER", //Should be text. + "POSITION_PROPERTY" : "STORAGE_POSITION" //Should be text. }], /* * Storages map, can hold configurations for several storages. diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/SampleFormController.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/SampleFormController.js index 9b463ce87276145fbf020944463adb2a70c72366..c6c4da9e67d8a6810ec4edf78e5578a5e8714adf 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/SampleFormController.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/SampleForm/SampleFormController.js @@ -50,7 +50,8 @@ function SampleFormController(mainController, mode, sample) { userSelector : "off", boxSelector: "on", rackSelector: "on", - contentsSelector: "off" + contentsSelector: "off", + positionSelector: "on" }); storageController.getModel().storagePropertyGroup = profile.getStoragePropertyGroup(storagePropertyGroupName); this._storageControllers.push(storageController); diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/StorageManagerController.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/StorageManagerController.js index b580203c07ac242fc8de81f58adae54d0ed16d48..09da6dc78b0d40cda56bc3ba89bef3d9e0fde156 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/StorageManagerController.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/StorageManagerController.js @@ -25,7 +25,8 @@ function StorageManagerController(mainController) { userSelector : "on", boxSelector: "on", rackSelector: "off", - contentsSelector: "on" + contentsSelector: "on", + positionSelector: "off" }); this._storageToController = new StorageController({ @@ -35,7 +36,8 @@ function StorageManagerController(mainController) { userSelector : "on", boxSelector: "on", rackSelector: "on", - contentsSelector: "off" + contentsSelector: "off", + positionSelector: "off" }); @@ -69,12 +71,15 @@ function StorageManagerController(mainController) { sample.properties[fromModel.storagePropertyGroup.columnProperty] = ""; sample.properties[fromModel.storagePropertyGroup.boxProperty] = ""; sample.properties[fromModel.storagePropertyGroup.userProperty] = ""; +// IGNORING POSITIONS ON UPDATES, ARE NOT SUPPORTED YET +// sample.properties[fromModel.storagePropertyGroup.positionProperty] = ""; sample.properties[toModel.storagePropertyGroup.nameProperty] = toModel.storageCode; sample.properties[toModel.storagePropertyGroup.rowProperty] = toModel.row; sample.properties[toModel.storagePropertyGroup.columnProperty] = toModel.column; sample.properties[toModel.storagePropertyGroup.boxProperty] = toModel.boxName; sample.properties[toModel.storagePropertyGroup.userProperty] = mainController.serverFacade.openbisServer.getSession().split("-")[0]; +// sample.properties[toModel.storagePropertyGroup.positionProperty] = ""; var sampleSpace = sample.spaceCode; var sampleProject = null; diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/widgets/StorageController.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/widgets/StorageController.js index d3798db33df3d84f91cd158bc35dd1d553c681b8..83179893ca6b5ab1f6ebcb7cf9ca8c30999799e0 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/widgets/StorageController.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/widgets/StorageController.js @@ -55,6 +55,7 @@ function StorageController(configOverride) { // Delete old state in model and view and set new sate in model and view _this._storageModel.resetBoxInfo(posX, posY, null, null); _this._storageView.showBoxField(); + _this._storageView.showPosField(); if(_this._storageModel.config.contentsSelector === "on") { _this._storageView.refreshBoxContents(); } @@ -101,6 +102,7 @@ function StorageController(configOverride) { this._storageModel.resetBoxInfo(null, null, null, null); this._storageView.refreshGrid(); this._storageView.hideBoxField(); + this._storageView.hidePosField(); this._storageView.refreshBoxContents(); } @@ -117,6 +119,7 @@ function StorageController(configOverride) { // Delete old state in model and view and set new sate in model and view this._storageModel.resetBoxInfo(null, null, null, null); this._storageView.hideBoxField(); + this._storageView.hidePosField(); if(this._storageModel.config.contentsSelector === "on") { this._storageView.refreshBoxContents(); } diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/widgets/StorageModel.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/widgets/StorageModel.js index 47a8efe4085fa49270ed04682fbb678618a465ff..59011cd8ed8ec32fdacdf02108801adacf9c1f27 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/widgets/StorageModel.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/widgets/StorageModel.js @@ -25,7 +25,8 @@ function StorageModel(configOverride) { userSelector : "on", boxSelector: "on", rackSelector: "on", - contentsSelector: "off" + contentsSelector: "off", + positionSelector: "off" }; } diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/widgets/StorageView.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/widgets/StorageView.js index e4dfc0303ccc46328d0469d79e607dbd49876d86..ee427d39af16f89dbf29299646f937edebed8b3e 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/widgets/StorageView.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/views/StorageManager/widgets/StorageView.js @@ -25,6 +25,7 @@ function StorageView(storageController, storageModel, gridView) { this._gridContainer = $("<div>"); this._boxField = FormUtil._getInputField("text", "", "Box Name", null, false); this._boxContentsDropDown = $('<select>', { 'id' : 'boxSamplesSelector' , class : 'multiselect' , 'multiple' : 'multiple'}); + this._positionField = FormUtil._getInputField("text", "", "Position", null, false); this.repaint = function($container) { // @@ -122,12 +123,30 @@ function StorageView(storageController, storageModel, gridView) { }); } + if(this._storageModel.config.positionSelector === "on") { + //Paint + var $controlGroupPosition = FormUtil.getFieldForComponentWithLabel(this._positionField, "Position"); + $container.append($controlGroupPosition); + //Attach Event + this._positionField.change(function() { + if(_this._storageModel.sample) { //Sample to bind + _this._storageModel.sample.properties[_this._storageModel.storagePropertyGroup.positionProperty] = $(this).val(); + } + }); + //Sample to bind + if(this._storageModel.sample) { + this._positionField.val(this._storageModel.sample.properties[this._storageModel.storagePropertyGroup.positionProperty]); + this._positionField.show(); + } + } + if(this._storageModel.isDisabled) { this._storageGroupsDropDown.attr("disabled", ""); this._defaultStoragesDropDown.attr("disabled", ""); this._userIdDropdown.attr("disabled", ""); this._boxField.attr("disabled", ""); this._boxContentsDropDown.attr("disabled", ""); + this._positionField.attr("disabled", ""); } } @@ -164,6 +183,17 @@ function StorageView(storageController, storageModel, gridView) { this._gridView.repaint(this._gridContainer); } + this.hidePosField = function() { + this._positionField.val(""); + this._positionField.hide(); + } + + this.showPosField = function() { + this._positionField.val(""); + this._positionField.removeAttr("disabled"); + this._positionField.show(); + } + this.hideBoxField = function() { this._boxField.val(""); this._boxField.hide();