Skip to content

Commit

Permalink
Merge pull request #11 from qbicsoftware/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
christopher-mohr authored Dec 19, 2017
2 parents b2a2903 + 3ae9d66 commit a33e5fb
Show file tree
Hide file tree
Showing 30 changed files with 793 additions and 735 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 4 additions & 2 deletions QBiCMainPortlet/ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@
<!--upload -->
<dependency org="com.github.lookfirst" name="sardine" rev="5.5" />
<dependency org="commons-io" name="commons-io" rev="2.4" />
<dependency org="org.apache.httpcomponents" name="httpclient" rev="4.3" />
<dependency org="commons-httpclient" name="commons-httpclient" rev="3.1" />
<!--<dependency org="org.apache.httpcomponents" name="httpclient" rev="4.3" />-->

<!--QBiC -->
<dependency org="life.qbic.openbis" name="openbisclient" rev="1.1.3" />
<dependency org="life.qbic.openbis" name="liferayandvaadinhelpers" rev="1.1.3-SNAPSHOT" />
<!--name conversion -->
<dependency org="org.apache.commons" name="commons-collections4" rev="4.0" />

<!--vaadin charts -->
<!--<dependency org="com.vaadin.addon" name="vaadin-charts" rev="3.2.0" />-->

Expand Down
5 changes: 3 additions & 2 deletions QBiCMainPortlet/ivysettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
<chain name="default">
<!-- Public Maven repository -->
<ibiblio name="public" m2compatible="true" />
<!-- <ibiblio name="nexus-snapshots" m2compatible="true" usepoms="true" root="https://peltzer.com.de/nexus/content/repositories/snapshots" changingPattern="*-SNAPSHOT" />-->
<ibiblio name="nexus-releases" m2compatible="true" usepoms="true" root="https://peltzer.com.de/nexus/content/repositories/releases" />
<ibiblio name="QBiC Snapshots" m2compatible="true" usepoms="true" root="https://qbic-repo.am10.uni-tuebingen.de/repository/maven-snapshots" changingPattern=".+\\.-SNAPSHOT" checkmodified="true" changingMatcher="regexp" />
<ibiblio name="QBiC Releases" m2compatible="true" usepoms="true" root="https://qbic-repo.am10.uni-tuebingen.de/repository/maven-releases" />

<!-- Vaadin Add-on repository -->
<ibiblio name="vaadin-addons" usepoms="true" m2compatible="true"
root="http://maven.vaadin.com/vaadin-addons" />
Expand Down
65 changes: 29 additions & 36 deletions QBiCMainPortlet/src/controllers/WorkflowViewController.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*******************************************************************************
* QBiC Project qNavigator enables users to manage their projects. Copyright (C) "2016”
* Christopher Mohr, David Wojnar, Andreas Friedrich
* QBiC Project qNavigator enables users to manage their projects. Copyright (C) "2016” Christopher
* Mohr, David Wojnar, Andreas Friedrich
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3 of the
Expand All @@ -15,9 +15,6 @@
*******************************************************************************/
package controllers;

import helpers.Utils;
import life.qbic.openbis.openbisclient.OpenBisClient;

import java.io.Serializable;
import java.net.ConnectException;
import java.nio.file.Paths;
Expand All @@ -31,31 +28,31 @@

import javax.xml.bind.JAXBException;

import logging.Log4j2Logger;

import org.apache.commons.lang.NotImplementedException;

import parser.XMLParser;
import properties.Property;
import submitter.SubmitFailedException;
import submitter.Submitter;
import submitter.Workflow;
import com.vaadin.data.Container;
import com.vaadin.data.util.BeanItemContainer;

import ch.systemsx.cisd.openbis.dss.client.api.v1.DataSet;
import ch.systemsx.cisd.openbis.dss.generic.shared.api.v1.FileInfoDssDTO;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Experiment;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Sample;
import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.QueryTableModel;

import com.vaadin.data.Container;
import com.vaadin.data.util.BeanItemContainer;

import de.uni_tuebingen.qbic.beans.DatasetBean;
import de.uni_tuebingen.qbic.qbicmainportlet.DataHandler;
import de.uni_tuebingen.qbic.qbicmainportlet.DatasetView;
import de.uni_tuebingen.qbic.qbicmainportlet.ExperimentView;
import de.uni_tuebingen.qbic.qbicmainportlet.PatientView;
import de.uni_tuebingen.qbic.qbicmainportlet.ProjectView;
import de.uni_tuebingen.qbic.qbicmainportlet.SampleView;
import helpers.Utils;
import life.qbic.openbis.openbisclient.OpenBisClient;
import logging.Log4j2Logger;
import parser.XMLParser;
import properties.Property;
import submitter.SubmitFailedException;
import submitter.Submitter;
import submitter.Workflow;

public class WorkflowViewController {
private DataHandler datahandler;
Expand All @@ -69,7 +66,7 @@ public class WorkflowViewController {
private final String wf_started = "Q_WF_STARTED_AT";
private final String wf_status = "Q_WF_STATUS";
private final String wf_name = "Q_WF_NAME";
private final String openbis_dss = "DSS1";
private final String openbis_dss = "DSS1"; // TODO this shouldn't be hardcoded

// used by Microarray QC Workflow. See function mapExperimentalProperties
private Map<String, String> expProps;
Expand Down Expand Up @@ -113,10 +110,9 @@ public Container fillTable(
for (model.DatasetBean bean : datasetBeans) {
fileNames.add(bean.getFileName());

DatasetBean newBean =
new DatasetBean(bean.getFileName(), dataMap.get(bean.getCode()).getDataSetTypeCode(),
bean.getCode(), bean.getDssPath(), dataMap.get(bean.getCode())
.getSampleIdentifierOrNull());
DatasetBean newBean = new DatasetBean(bean.getFileName(),
dataMap.get(bean.getCode()).getDataSetTypeCode(), bean.getCode(), bean.getDssPath(),
dataMap.get(bean.getCode()).getSampleIdentifierOrNull());

if (dataMap.get(bean.getCode()).getProperties() != null) {
newBean.setProperties(dataMap.get(bean.getCode()).getProperties());
Expand Down Expand Up @@ -198,9 +194,8 @@ public List<String> getConnectedSamples(List<DatasetBean> datasetBeans) {
public String registerWFSample(String space, String project, String experiment, String typecode,
List<String> parents, List<DatasetBean> datasets) {
int last = 0;
for (Sample s : datahandler.getOpenBisClient().getSamplesofExperiment(
(new StringBuilder("/")).append(space).append("/").append(project).append("/")
.append(experiment).toString())) {
for (Sample s : datahandler.getOpenBisClient().getSamplesofExperiment((new StringBuilder("/"))
.append(space).append("/").append(project).append("/").append(experiment).toString())) {
String[] codeSplit = s.getCode().split("R");
String number = codeSplit[codeSplit.length - 1];
int num = 0;
Expand Down Expand Up @@ -413,25 +408,23 @@ public Submitter getSubmitter() {
}

public String submitAndRegisterWf(String type, String id, Workflow workflow,
List<DatasetBean> selectedDatasets) throws ConnectException, IllegalArgumentException,
SubmitFailedException {
List<DatasetBean> selectedDatasets)
throws ConnectException, IllegalArgumentException, SubmitFailedException {

SpaceAndProjectCodes spaceandproject = getSpaceAndProjects(type, id);

String spaceCode = spaceandproject.space;
String projectCode = spaceandproject.project;


String experimentCode =
registerWFExperiment(spaceCode, projectCode, workflow.getExperimentType(),
workflow.getID(), workflow.getVersion(), user);
String experimentCode = registerWFExperiment(spaceCode, projectCode,
workflow.getExperimentType(), workflow.getID(), workflow.getVersion(), user);

List<String> parents = getConnectedSamples(selectedDatasets);
String sampleType = workflow.getSampleType();

String sampleCode =
registerWFSample(spaceCode, projectCode, experimentCode, sampleType, parents,
selectedDatasets);
String sampleCode = registerWFSample(spaceCode, projectCode, experimentCode, sampleType,
parents, selectedDatasets);

String openbisId =
String.format("%s-%s-%s-%s", spaceCode, projectCode, experimentCode, sampleCode);
Expand All @@ -458,10 +451,9 @@ private SpaceAndProjectCodes getSpaceAndProjects(String type, String id) {
case "workflowExperimentType":
return new SpaceAndProjectCodes(split[1], split[2]);
case SampleView.navigateToLabel:
String expId =
datahandler.getOpenBisClient()
.getSampleByIdentifier(String.format("%s/%s", split[1], split[2]))
.getExperimentIdentifierOrNull();
String expId = datahandler.getOpenBisClient()
.getSampleByIdentifier(String.format("%s/%s", split[1], split[2]))
.getExperimentIdentifierOrNull();
if (expId == null)
return null;
return getSpaceAndProjects(ExperimentView.navigateToLabel, expId);
Expand Down Expand Up @@ -508,6 +500,7 @@ public String getDatasetsNfsPath(DatasetBean bean) throws IllegalArgumentExcepti
// TODO get rid of hardocded paths
path = path.replaceFirst("/mnt/" + openbis_dss, "/mnt/nfs/qbic");
path = path.replaceFirst("/mnt/DSS_icgc", "/mnt/glusterfs/DSS_icgc");
path = path.replaceFirst("/beegfs/bigbio", "/mnt/nfs/bigbio_temp");
return path;
} catch (Exception e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
import com.vaadin.ui.themes.ValoTheme;

import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.Project;
import de.uni_tuebingen.qbic.main.LiferayAndVaadinUtils;
import helpers.Utils;
import life.qbic.portal.liferayandvaadinhelpers.main.LiferayAndVaadinUtils;
import model.NewIvacSampleBean;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*******************************************************************************/
package de.uni_tuebingen.qbic.qbicmainportlet;

import helpers.Utils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
Expand All @@ -25,13 +23,6 @@

import javax.xml.bind.JAXBException;

import model.PropertyBean;
import parser.XMLParser;
import properties.Property;
import properties.PropertyType;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.ControlledVocabularyPropertyType;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.VocabularyTerm;

import com.vaadin.data.fieldgroup.FieldGroup;
import com.vaadin.server.Page;
import com.vaadin.shared.ui.MarginInfo;
Expand All @@ -47,7 +38,14 @@
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.ValoTheme;

import de.uni_tuebingen.qbic.main.LiferayAndVaadinUtils;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.ControlledVocabularyPropertyType;
import ch.systemsx.cisd.openbis.generic.shared.api.v1.dto.VocabularyTerm;
import helpers.Utils;
import life.qbic.portal.liferayandvaadinhelpers.main.LiferayAndVaadinUtils;
import model.PropertyBean;
import parser.XMLParser;
import properties.Property;
import properties.PropertyType;

public class ChangeExperimentMetadataComponent extends CustomComponent {
private DataHandler datahandler;
Expand Down Expand Up @@ -230,12 +228,12 @@ private void buildFormLayout() {

for (Property f : xmlProps) {
PropertyType type = f.getType();

String label = f.getLabel();
if (f.hasUnit())
label += " in " + f.getUnit();
TextField tf = new TextField(label);
tf.setData(type);//save property type for later, when it is written back
tf.setData(type);// save property type for later, when it is written back
fieldGroup.bind(tf, label);
tf.setCaption(label);
tf.setDescription("Q_PROPERTIES");
Expand Down
Loading

0 comments on commit a33e5fb

Please sign in to comment.