Commit cab866d5 authored by Jasper Koehorst's avatar Jasper Koehorst
Browse files

enabled sheet download

parent 217a41c8
Pipeline #35264 passed with stage
in 2 minutes and 37 seconds
......@@ -43,8 +43,6 @@ configurations {
}
}
exclude group: 'log4j'
}
}
......@@ -91,11 +89,9 @@ dependencies {
implementation 'com.google.guava:guava:31.0.1-jre'
// irods dependency obtained locally
// implementation 'jargon:core:4.3.0.2' // now using direct download versus build.sh script
implementation urlFile('https://github.com/DICE-UNC/jargon/releases/download/4.3.0.2-RELEASE/jargon-core-4.3.0.2-RELEASE-jar-with-dependencies.jar', 'jargon-core-4.3.0.2-RELEASE-jar-with-dependencies')
// unlock ontology obtained locally
// implementation 'nl.munlock:unlockapi:1.0.1' // now using direct download versus build.sh script
implementation urlFile('http://download.systemsbiology.nl/unlock/UnlockOntology.jar', 'UnlockOntology')
// kubernetes api
......
......@@ -89,7 +89,6 @@ public class MetadataParser extends Metadata {
}
}
// Preferred unit
if (index.containsKey("preferred unit") && row.getCell(index.get("preferred unit")) != null) {
metadata.setPreferredUnit(row.getCell(index.get("preferred unit")).getStringCellValue());
......
......@@ -294,6 +294,8 @@ public class ExcelValidator {
logging("\n\nUploading database file to the data management system");
Data.uploadIrodsFile(new Connection().getIrodsAccount(), turtleFile, new File(destination + "/" + remoteturtleFile.getName()));
logging("\n\nFiles uploaded to: " + destination);
logging("\nExcel file: " + xlsxFile);
logging("\nTurtle file: " + turtleFile);
// Technicians have own rights?
CollectionAO collectionAO = connection.getAccessObjectFactory().getCollectionAO(connection.getIrodsAccount());
......
......@@ -75,7 +75,7 @@ public class TemplateView extends Div {
// Grids needed for Sample / Assay objects
ArrayList<Grid> gridList = new ArrayList<>();
// Package names for 'observation unit' and for 'sample'
// Package names for 'observation unit', 'sample' and 'assay'
ArrayList<String> packages = new ArrayList<>(Arrays.asList("Select a package", "Select a package", "Select a package"));
private Checkbox privacyCheckBox;
......@@ -114,7 +114,7 @@ public class TemplateView extends Div {
createPackageSelectionGrid(sampleInformation, "Sample", "help/sample.txt", true);
accordion.add("Sample Information", sampleInformation);
// Based on the template create the views per tab in the excel sheet
// Based on the template create the views per tab in the Excel sheet
for (String key : metadataSet.keySet()) {
// Only assay subtypes not assay itself
if (key.toLowerCase().contains("assay") && !key.toLowerCase().matches("assay")) {
......@@ -327,6 +327,13 @@ public class TemplateView extends Div {
addButton.setEnabled(visible);
addButton.setVisible(visible);
Button exportButton = new Button("Export", new Icon(VaadinIcon.FILE));
exportButton.setEnabled(visible);
exportButton.setVisible(visible);
// Export this directly to a sheet...
exportButton.addClickListener(buttonClickEvent -> exportSheet(gridSelection));
// List box for different environments
ComboBox<String> listBox = new ComboBox<>();
......@@ -336,17 +343,22 @@ public class TemplateView extends Div {
packagesViewList.add("core");
// Add all packages from the metadata file
HashSet<String> subPackages = new HashSet<>();
// Add metadata fields from selected package
for (Metadata m : metadataSet.get(metadata)) {
// Skipp core package as it is manually added
// Skip core package as it is manually added
if (m.getPackage().matches("core")) continue;
subPackages.add(m.getPackage());
}
// Add all other packages in a sorted fashion
packagesViewList.addAll(subPackages.stream().sorted().collect(Collectors.toList()));
listBox.setItems(packagesViewList);
listBox.setVisible(visible);
listBox.setEnabled(visible);
HorizontalLayout horizontalLayout = new HorizontalLayout();
horizontalLayout.add(labelField, addButton, enableBox, listBox);
horizontalLayout.add(labelField, addButton, exportButton, listBox, enableBox);
// Listener for package selection
listBox.addValueChangeListener(listener -> {
......@@ -379,6 +391,20 @@ public class TemplateView extends Div {
}
}
}
if (metadata.toLowerCase().matches(".*assay$")) {
for (Metadata m : metadataSet.get("Assay")) {
// Add all elements matching the package, core or user specified values
System.err.println(m.getPackage() + " " + listBox.getValue() + " " + m.getPackage().matches(listBox.getValue()));
if (m.getPackage().matches(listBox.getValue()) || m.getPackage().matches("core")) {
items.get().add(m);
// Obligatory items to be added to list for selection
if (m.getRequirement().toLowerCase().trim().contains("m")) {
obligatoryList.add(m);
}
}
}
}
}
// Add the items and select the obligatory items
gridSelection.setItems(items.get());
......@@ -414,21 +440,27 @@ public class TemplateView extends Div {
addButton.setEnabled(true);
gridSelection.setEnabled(true);
labelField.setEnabled(true);
exportButton.setEnabled(true);
listBox.setEnabled(true);
addButton.setVisible(true);
gridSelection.setVisible(true);
labelField.setVisible(true);
// optionalText.setVisible(true);
exportButton.setVisible(true);
listBox.setVisible(true);
enableBox.setLabel("Page enabled");
} else {
addButton.setEnabled(false);
gridSelection.setEnabled(false);
labelField.setEnabled(false);
exportButton.setEnabled(false);
listBox.setEnabled(false);
addButton.setVisible(false);
gridSelection.setVisible(false);
labelField.setVisible(false);
exportButton.setVisible(false);
listBox.setVisible(false);
// optionalText.setVisible(false);
enableBox.setLabel("Enable this page");
......@@ -933,7 +965,7 @@ public class TemplateView extends Div {
HorizontalLayout horizontalLayout = new HorizontalLayout();
horizontalLayout.add(labelField, addButton, exportButton, enableBox);
// wrapper.add(horizontalLayout);
// wrapper.add(horizontalLayout);
// When clicked an additional sample thing is added to the grid
addButton.addClickListener(buttonClickEvent -> {
......@@ -975,7 +1007,6 @@ public class TemplateView extends Div {
gridSelection.setVisible(false);
labelField.setVisible(false);
// optionalText.setVisible(false);
enableBox.setLabel("Enable this page");
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment