Skip to content
Snippets Groups Projects
Commit 0f5e28ea authored by juanf's avatar juanf
Browse files

SSDM-1078 : PAPER - Provide sensible defaults - Implementation

SVN: 32755
parent 47948a5a
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ import ch.systemsx.cisd.openbis.generic.server.jython.api.v1.DataType as DataTyp ...@@ -22,6 +22,7 @@ import ch.systemsx.cisd.openbis.generic.server.jython.api.v1.DataType as DataTyp
## ##
vocabulariesCache = {}; vocabulariesCache = {};
propertiesCache = {}; propertiesCache = {};
samplesCache = {};
tr = service.transaction() tr = service.transaction()
## ##
...@@ -47,6 +48,7 @@ def createSampleTypeWithProperties(sampleTypeCode, description, properties): ...@@ -47,6 +48,7 @@ def createSampleTypeWithProperties(sampleTypeCode, description, properties):
newSampleType.setAutoGeneratedCode(True); newSampleType.setAutoGeneratedCode(True);
newSampleType.setGeneratedCodePrefix(sampleTypeCode[:3]); newSampleType.setGeneratedCodePrefix(sampleTypeCode[:3]);
addProperties(newSampleType, properties); addProperties(newSampleType, properties);
samplesCache[sampleTypeCode] = newSampleType;
def createDataSetTypeWithProperties(dataSetCode, kind, description, properties): def createDataSetTypeWithProperties(dataSetCode, kind, description, properties):
newDataSet = tr.getOrCreateNewDataSetType(dataSetCode); newDataSet = tr.getOrCreateNewDataSetType(dataSetCode);
...@@ -58,6 +60,11 @@ def createExperimentTypeWithProperties(experimentTypeCode, description, properti ...@@ -58,6 +60,11 @@ def createExperimentTypeWithProperties(experimentTypeCode, description, properti
newExperiment = tr.getOrCreateNewExperimentType(experimentTypeCode); newExperiment = tr.getOrCreateNewExperimentType(experimentTypeCode);
newExperiment.setDescription(description); newExperiment.setDescription(description);
addProperties(newExperiment, properties); addProperties(newExperiment, properties);
def addPropertiesToSamples(sampleTypeCodes, properties):
for sampleTypeCode in sampleTypeCodes:
sampleType = samplesCache[sampleTypeCode];
addProperties(sampleType, properties);
def addProperties(entity, properties): def addProperties(entity, properties):
for property in properties: for property in properties:
...@@ -357,6 +364,11 @@ createVocabularyWithTerms("PLASMID_RELATIONSHIP", [ ...@@ -357,6 +364,11 @@ createVocabularyWithTerms("PLASMID_RELATIONSHIP", [
["OTHER", "Other"] ["OTHER", "Other"]
]); ]);
createVocabularyWithTerms("STORAGE_NAMES", [
["BENCH", "Bench"],
["DEFAULT_STORAGE", "Default Storage"]
]);
## ##
## Property Types for annotations ## Property Types for annotations
## ##
...@@ -410,8 +422,9 @@ createExperimentTypeWithProperties("DEFAULT_EXPERIMENT", "Default Experiment", [ ...@@ -410,8 +422,9 @@ createExperimentTypeWithProperties("DEFAULT_EXPERIMENT", "Default Experiment", [
]); ]);
## ##
## Sample Types ## Sample Types - Materials
## ##
createSampleTypeWithProperties("ANTIBODY", "", [ createSampleTypeWithProperties("ANTIBODY", "", [
["NAME", "General", "Name", DataType.VARCHAR, None, "Name"], ["NAME", "General", "Name", DataType.VARCHAR, None, "Name"],
["HOST", "General", "Host", DataType.CONTROLLEDVOCABULARY, "HOST", "Host used to produce the antibody"], ["HOST", "General", "Host", DataType.CONTROLLEDVOCABULARY, "HOST", "Host used to produce the antibody"],
...@@ -475,46 +488,6 @@ createSampleTypeWithProperties("SOLUTION_BUFFER", "", [ ...@@ -475,46 +488,6 @@ createSampleTypeWithProperties("SOLUTION_BUFFER", "", [
["ANNOTATIONS_STATE", "Comments", "Annotations State", DataType.XML, None, "Annotations State"] ["ANNOTATIONS_STATE", "Comments", "Annotations State", DataType.XML, None, "Annotations State"]
]); ]);
createSampleTypeWithProperties("GENERAL_PROTOCOL", "", [
["NAME", "General", "Name", DataType.MULTILINE_VARCHAR, None, "Name"],
["FOR_WHAT", "General", "For what", DataType.MULTILINE_VARCHAR, None, "For what kind of experimental application/readout this sample is used in the lab"],
["PROTOCOL_TYPE", "General", "Protocol type", DataType.CONTROLLEDVOCABULARY, "PROTOCOL_TYPE", "Category a protocol belongs"],
["MATERIALS", "Materials", "Materials", DataType.MULTILINE_VARCHAR, None, "Machines (and relative set up), special labware required for the protocol."],
["TIME_REQUIREMENT", "Method", "Time requirement", DataType.MULTILINE_VARCHAR, None, "Time required to complete a protocol"],
["PROCEDURE", "Method", "Procedure", DataType.MULTILINE_VARCHAR, None, "Procedure required by the protocol by points (1,2,3,...)"],
["PROTOCOL_EVALUATION", "Method", "Protocol evaluation", DataType.MULTILINE_VARCHAR, None, "Parameters and observations to meet the minimal efficiency of the protocol"],
["SUGGESTIONS", "Comments", "Suggestions", DataType.MULTILINE_VARCHAR, None, "Suggestions for the protocol"],
["PROTOCOL_MODIFICATIONS", "Comments", "Protocol modifications", DataType.MULTILINE_VARCHAR, None, "Alternative procedures used to make protocol variations"],
["PUBLICATION", "Comments", "Publication", DataType.MULTILINE_VARCHAR, None, "Publication from where the information was first found OR technical sheet given by the manufacturer"],
["XMLCOMMENTS", "Comments", "Comments List", DataType.XML, None, "Several comments can be added by different users"],
["ANNOTATIONS_STATE", "Comments", "Annotations State", DataType.XML, None, "Annotations State"]
]);
createSampleTypeWithProperties("PCR_PROTOCOL", "", [
["NAME", "General", "Name", DataType.MULTILINE_VARCHAR, None, "Name"],
["FOR_WHAT", "General", "For what", DataType.MULTILINE_VARCHAR, None, "For what kind of experimental application/readout this sample is used in the lab"],
["TEMPLATE", "General", "Template", DataType.CONTROLLEDVOCABULARY, "TEMPLATE", "Type of template used in the PCR protocol"],
["REACTION_MIX", "Materials", "Reaction mix", DataType.MULTILINE_VARCHAR, None, "Reaction mix recipe for the PCR"],
["THERMOCYCLER_PROTOCOL", "Method", "Thermocycler protocol", DataType.MULTILINE_VARCHAR, None, "Thermocycler protocol for PCR"],
["PROTOCOL_EVALUATION", "Method", "Protocol evaluation", DataType.MULTILINE_VARCHAR, None, "Parameters and observations to meet the minimal efficiency of the protocol"],
["SUGGESTIONS", "Comments", "Suggestions", DataType.MULTILINE_VARCHAR, None, "Suggestions for the protocol"],
["PROTOCOL_MODIFICATIONS", "Comments", "Protocol modifications", DataType.MULTILINE_VARCHAR, None, "Alternative procedures used to make protocol variations"],
["PUBLICATION", "Comments", "Publication", DataType.MULTILINE_VARCHAR, None, "Publication from where the information was first found OR technical sheet given by the manufacturer"],
["XMLCOMMENTS", "Comments", "Comments List", DataType.XML, None, "Several comments can be added by different users"],
["ANNOTATIONS_STATE", "Comments", "Annotations State", DataType.XML, None, "Annotations State"]
]);
createSampleTypeWithProperties("WESTERN_BLOTTING_PROTOCOL", "", [
["NAME", "General", "Name", DataType.MULTILINE_VARCHAR, None, "Name"],
["FOR_WHAT", "General", "For what", DataType.MULTILINE_VARCHAR, None, "For what kind of experimental application/readout this sample is used in the lab"],
["STORAGE", "General", "Storage", DataType.CONTROLLEDVOCABULARY, "STORAGE", "Storage conditions of the product"],
["MEMBRANE", "Materials", "Membrane", DataType.CONTROLLEDVOCABULARY, "MEMBRANE", "Membrane used for western blotting"],
["PUBLICATION", "Comments", "Publication", DataType.MULTILINE_VARCHAR, None, "Publication from where the information was first found OR technical sheet given by the manufacturer"],
["NOTES", "Comments", "Notes", DataType.MULTILINE_VARCHAR, None, "Notes"],
["XMLCOMMENTS", "Comments", "Comments List", DataType.XML, None, "Several comments can be added by different users"],
["ANNOTATIONS_STATE", "Comments", "Annotations State", DataType.XML, None, "Annotations State"]
]);
createSampleTypeWithProperties("OLIGO", "", [ createSampleTypeWithProperties("OLIGO", "", [
["TARGET", "General", "Target", DataType.MULTILINE_VARCHAR, None, "Target of the oligonucleotide"], ["TARGET", "General", "Target", DataType.MULTILINE_VARCHAR, None, "Target of the oligonucleotide"],
["DIRECTION", "Details", "Direction", DataType.CONTROLLEDVOCABULARY, "DIRECTION", "Direction of the oligonucleotide"], ["DIRECTION", "Details", "Direction", DataType.CONTROLLEDVOCABULARY, "DIRECTION", "Direction of the oligonucleotide"],
...@@ -632,6 +605,31 @@ createSampleTypeWithProperties("FLY", "", [ ...@@ -632,6 +605,31 @@ createSampleTypeWithProperties("FLY", "", [
["ANNOTATIONS_STATE", "Comments", "Annotations State", DataType.XML, None, "Annotations State"] ["ANNOTATIONS_STATE", "Comments", "Annotations State", DataType.XML, None, "Annotations State"]
]); ]);
addPropertiesToSamples([
"ANTIBODY",
"BACTERIA",
"CHEMICAL",
"ENZYME",
"CELL_LINE",
"FLY",
"MEDIA",
"OLIGO",
"PLASMID",
"YEAST",
"SOLUTION_BUFFER",
"RNA"
],[
["STORAGE_NAMES", "Physical Storage", "Storage Name", DataType.CONTROLLEDVOCABULARY, "STORAGE_NAMES", "Storage Name"],
["STORAGE_ROW", "Physical Storage", "Storage Row", DataType.INTEGER, None, "Storage Row"],
["STORAGE_COLUMN", "Physical Storage", "Storage Column", DataType.INTEGER, None, "Storage Column"],
["STORAGE_BOX_NAME", "Physical Storage", "Storage Box Name", DataType.VARCHAR, None, "Storage Box Name"],
["STORAGE_USER", "Physical Storage", "Storage User Id", DataType.VARCHAR, None, "Storage User Id"]
]);
##
## Sample Types - Non Materials
##
createSampleTypeWithProperties("EXPERIMENTAL_STEP", "", [ createSampleTypeWithProperties("EXPERIMENTAL_STEP", "", [
["NAME", "General", "Name", DataType.MULTILINE_VARCHAR, None, "Name"], ["NAME", "General", "Name", DataType.MULTILINE_VARCHAR, None, "Name"],
["OWNER", "General", "Owner", DataType.CONTROLLEDVOCABULARY, "OWNER", "Who produced/owned the sample"], ["OWNER", "General", "Owner", DataType.CONTROLLEDVOCABULARY, "OWNER", "Who produced/owned the sample"],
...@@ -645,3 +643,43 @@ createSampleTypeWithProperties("EXPERIMENTAL_STEP", "", [ ...@@ -645,3 +643,43 @@ createSampleTypeWithProperties("EXPERIMENTAL_STEP", "", [
["XMLCOMMENTS", "Comments", "Comments List", DataType.XML, None, "Several comments can be added by different users"], ["XMLCOMMENTS", "Comments", "Comments List", DataType.XML, None, "Several comments can be added by different users"],
["ANNOTATIONS_STATE", "Comments", "Annotations State", DataType.XML, None, "Annotations State"] ["ANNOTATIONS_STATE", "Comments", "Annotations State", DataType.XML, None, "Annotations State"]
]); ]);
createSampleTypeWithProperties("GENERAL_PROTOCOL", "", [
["NAME", "General", "Name", DataType.MULTILINE_VARCHAR, None, "Name"],
["FOR_WHAT", "General", "For what", DataType.MULTILINE_VARCHAR, None, "For what kind of experimental application/readout this sample is used in the lab"],
["PROTOCOL_TYPE", "General", "Protocol type", DataType.CONTROLLEDVOCABULARY, "PROTOCOL_TYPE", "Category a protocol belongs"],
["MATERIALS", "Materials", "Materials", DataType.MULTILINE_VARCHAR, None, "Machines (and relative set up), special labware required for the protocol."],
["TIME_REQUIREMENT", "Method", "Time requirement", DataType.MULTILINE_VARCHAR, None, "Time required to complete a protocol"],
["PROCEDURE", "Method", "Procedure", DataType.MULTILINE_VARCHAR, None, "Procedure required by the protocol by points (1,2,3,...)"],
["PROTOCOL_EVALUATION", "Method", "Protocol evaluation", DataType.MULTILINE_VARCHAR, None, "Parameters and observations to meet the minimal efficiency of the protocol"],
["SUGGESTIONS", "Comments", "Suggestions", DataType.MULTILINE_VARCHAR, None, "Suggestions for the protocol"],
["PROTOCOL_MODIFICATIONS", "Comments", "Protocol modifications", DataType.MULTILINE_VARCHAR, None, "Alternative procedures used to make protocol variations"],
["PUBLICATION", "Comments", "Publication", DataType.MULTILINE_VARCHAR, None, "Publication from where the information was first found OR technical sheet given by the manufacturer"],
["XMLCOMMENTS", "Comments", "Comments List", DataType.XML, None, "Several comments can be added by different users"],
["ANNOTATIONS_STATE", "Comments", "Annotations State", DataType.XML, None, "Annotations State"]
]);
createSampleTypeWithProperties("PCR_PROTOCOL", "", [
["NAME", "General", "Name", DataType.MULTILINE_VARCHAR, None, "Name"],
["FOR_WHAT", "General", "For what", DataType.MULTILINE_VARCHAR, None, "For what kind of experimental application/readout this sample is used in the lab"],
["TEMPLATE", "General", "Template", DataType.CONTROLLEDVOCABULARY, "TEMPLATE", "Type of template used in the PCR protocol"],
["REACTION_MIX", "Materials", "Reaction mix", DataType.MULTILINE_VARCHAR, None, "Reaction mix recipe for the PCR"],
["THERMOCYCLER_PROTOCOL", "Method", "Thermocycler protocol", DataType.MULTILINE_VARCHAR, None, "Thermocycler protocol for PCR"],
["PROTOCOL_EVALUATION", "Method", "Protocol evaluation", DataType.MULTILINE_VARCHAR, None, "Parameters and observations to meet the minimal efficiency of the protocol"],
["SUGGESTIONS", "Comments", "Suggestions", DataType.MULTILINE_VARCHAR, None, "Suggestions for the protocol"],
["PROTOCOL_MODIFICATIONS", "Comments", "Protocol modifications", DataType.MULTILINE_VARCHAR, None, "Alternative procedures used to make protocol variations"],
["PUBLICATION", "Comments", "Publication", DataType.MULTILINE_VARCHAR, None, "Publication from where the information was first found OR technical sheet given by the manufacturer"],
["XMLCOMMENTS", "Comments", "Comments List", DataType.XML, None, "Several comments can be added by different users"],
["ANNOTATIONS_STATE", "Comments", "Annotations State", DataType.XML, None, "Annotations State"]
]);
createSampleTypeWithProperties("WESTERN_BLOTTING_PROTOCOL", "", [
["NAME", "General", "Name", DataType.MULTILINE_VARCHAR, None, "Name"],
["FOR_WHAT", "General", "For what", DataType.MULTILINE_VARCHAR, None, "For what kind of experimental application/readout this sample is used in the lab"],
["STORAGE", "General", "Storage", DataType.CONTROLLEDVOCABULARY, "STORAGE", "Storage conditions of the product"],
["MEMBRANE", "Materials", "Membrane", DataType.CONTROLLEDVOCABULARY, "MEMBRANE", "Membrane used for western blotting"],
["PUBLICATION", "Comments", "Publication", DataType.MULTILINE_VARCHAR, None, "Publication from where the information was first found OR technical sheet given by the manufacturer"],
["NOTES", "Comments", "Notes", DataType.MULTILINE_VARCHAR, None, "Notes"],
["XMLCOMMENTS", "Comments", "Comments List", DataType.XML, None, "Several comments can be added by different users"],
["ANNOTATIONS_STATE", "Comments", "Annotations State", DataType.XML, None, "Annotations State"]
]);
\ No newline at end of file
...@@ -7,48 +7,36 @@ $.extend(StandardProfile.prototype, DefaultProfile.prototype, { ...@@ -7,48 +7,36 @@ $.extend(StandardProfile.prototype, DefaultProfile.prototype, {
init: function(serverFacade){ init: function(serverFacade){
DefaultProfile.prototype.init.call(this, serverFacade); DefaultProfile.prototype.init.call(this, serverFacade);
// this.inventorySpaces = ["INVENTORY"]; this.storagesConfiguration = {
"isEnabled" : true,
// this.storagesConfiguration = { /*
// "isEnabled" : true, * Should be the same across all storages, if not correct behaviour is not guaranteed.
// /* */
// * Should be the same across all storages, if not correct behaviour is not guaranteed. "STORAGE_PROPERTIES": [{
// */ "STORAGE_PROPERTY_GROUP" : "Physical Storage", //Where the storage will be painted.
// "STORAGE_PROPERTIES": [{ "STORAGE_GROUP_DISPLAY_NAME" : "Physical Storage", //Storage Group Name
// "STORAGE_PROPERTY_GROUP" : "Storage Utility", //Where the storage will be painted. "NAME_PROPERTY" : "STORAGE_NAMES", //Should be a Vocabulary.
// "STORAGE_GROUP_DISPLAY_NAME" : "Storage Utility", //Storage Group Name "ROW_PROPERTY" : "STORAGE_ROW", //Should be an integer.
// "NAME_PROPERTY" : "FREEZER_NAME", //Should be a Vocabulary. "COLUMN_PROPERTY" : "STORAGE_COLUMN", //Should be an integer.
// "ROW_PROPERTY" : "ROW", //Should be an integer. "BOX_PROPERTY" : "STORAGE_BOX_NAME", //Should be text.
// "COLUMN_PROPERTY" : "COLUMN", //Should be an integer. "USER_PROPERTY" : "STORAGE_USER" //Should be text.
// "BOX_PROPERTY" : "BOX_NUMBER", //Should be text. }],
// "USER_PROPERTY" : "USER_PROPERTY" //Should be text. /*
// }], * Storages map, can hold configurations for several storages.
// /* */
// * Storages map, can hold configurations for several storages. "STORAGE_CONFIGS": {
// */ "BENCH" : { //Freezer name given by the NAME_PROPERTY
// "STORAGE_CONFIGS": { "ROW_NUM" : 1, //Number of rows
// "MINUS80_1" : { //Freezer name given by the NAME_PROPERTY "COLUMN_NUM" : 1, //Number of columns
// "ROW_NUM" : 9, //Number of rows "BOX_NUM" : 999999 //Boxes on each rack, used for validation, to avoid validation increase the number to 9999 for example
// "COLUMN_NUM" : 9, //Number of columns },
// "BOX_NUM" : 3 //Boxes on each rack, used for validation, to avoid validation increase the number to 9999 for example "DEFAULT_STORAGE" : { //Freezer name given by the NAME_PROPERTY
// }, "ROW_NUM" : 1, //Number of rows
// "MINUS80_2" : { //Freezer name given by the NAME_PROPERTY "COLUMN_NUM" : 1, //Number of columns
// "ROW_NUM" : 9, //Number of rows "BOX_NUM" : 999999 //Boxes on each rack, used for validation, to avoid validation increase the number to 9999 for example
// "COLUMN_NUM" : 9, //Number of columns }
// "BOX_NUM" : 3 //Boxes on each rack, used for validation, to avoid validation increase the number to 9999 for example }
// }, };
// "MINUS820_1" : { //Freezer name given by the NAME_PROPERTY
// "ROW_NUM" : 9, //Number of rows
// "COLUMN_NUM" : 9, //Number of columns
// "BOX_NUM" : 3 //Boxes on each rack, used for validation, to avoid validation increase the number to 9999 for example
// },
// "BENCH" : { //Freezer name given by the NAME_PROPERTY
// "ROW_NUM" : 1, //Number of rows
// "COLUMN_NUM" : 1, //Number of columns
// "BOX_NUM" : 99999 //Boxes on each rack, used for validation, to avoid validation increase the number to 9999 for example
// }
// }
// };
/* New Sample definition tests*/ /* New Sample definition tests*/
this.sampleTypeDefinitionsExtension = { this.sampleTypeDefinitionsExtension = {
...@@ -358,24 +346,15 @@ $.extend(StandardProfile.prototype, DefaultProfile.prototype, { ...@@ -358,24 +346,15 @@ $.extend(StandardProfile.prototype, DefaultProfile.prototype, {
} }
], ],
} }
}
//The properties you want to appear on the tables, if you don«t specify the list, all of them will appear by default. }
this.typePropertiesForTable = {};
//The colors for the notes, if you don«t specify the color, light yellow will be used by default.
this.colorForInspectors = {};
this.sampleFormContentExtra = function(sampleTypeCode, sample, containerId) { this.sampleFormContentExtra = function(sampleTypeCode, sample, containerId) {
if(sampleTypeCode === "EXPERIMENTAL_STEP") { if(sampleTypeCode === "EXPERIMENTAL_STEP") {
var isEnabled = mainController.currentView._sampleFormModel.mode !== FormMode.VIEW; var isEnabled = mainController.currentView._sampleFormModel.mode !== FormMode.VIEW;
var freeFormTableController = new FreeFormTableController(sample, isEnabled); var freeFormTableController = new FreeFormTableController(sample, isEnabled);
freeFormTableController.init($("#" + containerId)); freeFormTableController.init($("#" + containerId));
} }
} }
} }
}); });
\ No newline at end of file
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