Skip to content

Commit

Permalink
Merge branch 'feature-738/738-add-information-on-how-to-enter-experim…
Browse files Browse the repository at this point in the history
…ental-variables' of https://github.com/qbicsoftware/data-manager-app into feature-738/738-add-information-on-how-to-enter-experimental-variables
  • Loading branch information
Steffengreiner committed Aug 29, 2024
2 parents 488089b + 834cb96 commit d97ea49
Show file tree
Hide file tree
Showing 16 changed files with 903 additions and 392 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public enum ErrorCode {
NO_ANALYTE_DEFINED,
DATA_ATTACHED_TO_SAMPLES,
SAMPLES_ATTACHED_TO_EXPERIMENT,
SERVICE_FAILED;
SERVICE_FAILED,
UNKNOWN_METADATA;

@Override
public String toString() {
Expand Down
4 changes: 2 additions & 2 deletions logging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.13</version>
<version>2.0.16</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.13</version>
<version>2.0.16</version>
</dependency>
<!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-core -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ private int readInjectionVolume(String value) throws NumberFormatException {
if (value.isBlank()) {
return -1;
}
return Integer.parseInt(value);
return (int) Double.parseDouble(value);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ protected SampleCode() {
// needed for JPA
}

private SampleCode(String code) {
private SampleCode(String code) throws IllegalArgumentException{
Objects.requireNonNull(code, "Sample code must not be null");
if (code.isBlank()) {
throw new IllegalArgumentException("Sample code must not be blank");
}
this.code = code;
}

public static SampleCode create(String code) {
public static SampleCode create(String code) throws IllegalArgumentException {
return new SampleCode(code);
}

Expand Down
Binary file modified user-interface/src/main/bundles/dev.bundle
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package life.qbic.datamanager.parser;

import java.util.List;
import life.qbic.projectmanagement.application.measurement.MeasurementMetadata;

/**
* <b>Measurement Metadata Converter</b>
* <p>
* Measurement metadata converter enable the client to process a {@link ParsingResult} object and
* convert them into known implementations of the {@link MeasurementMetadata} interface.
*
* @since 1.4.0
*/
public interface MeasurementMetadataConverter {

/**
* Takes an instance of {@link ParsingResult} and tries to convert it to known implementations of
* the {@link MeasurementMetadata} interface.
* <p>
* Currently supported implementations are:
*
* <ul>
* <li>NGS Measurement Metadata {@link life.qbic.projectmanagement.application.measurement.NGSMeasurementMetadata}</li>
* <li>Proteomics Measurement Metadata {@link life.qbic.projectmanagement.application.measurement.ProteomicsMeasurementMetadata}</li>
* </ul>
*
* @param parsingResult the parsing result to take as input for the conversion.
* @param ignoreMeasurementId weather to ignore the measurement identifier or not
* @return a list of converted implementations of {@link MeasurementMetadata}.
* @throws UnknownMetadataTypeException if no matching implementation of
* {@link MeasurementMetadata} can be associated from the
* provided {@link ParsingResult#keys()}.
* @since 1.4.0
*/
List<? extends MeasurementMetadata> convert(ParsingResult parsingResult,
boolean ignoreMeasurementId)
throws UnknownMetadataTypeException;

class UnknownMetadataTypeException extends RuntimeException {

public UnknownMetadataTypeException(String message) {
super(message);
}
}

class MissingSampleIdException extends RuntimeException {
public MissingSampleIdException(String message) {
super(message);
}
}

}
Loading

0 comments on commit d97ea49

Please sign in to comment.