Skip to content

Commit

Permalink
Updated swagger config and README.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Hoffmann committed Aug 7, 2019
1 parent b163de7 commit fc95118
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 23 deletions.
5 changes: 5 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ image:https://img.shields.io/github/release/lifs-tools/jmzTab-m-webapp.svg["Late

This project provides a validator implementation for the mzTab 1.0 standard and for the current draft 2.0 standard for metabolomics.

== Using the LIFS Web application

The mzTab validator webapplication is hosted https://apps.lifs.isas.de/mztabvalidator[here].
For programmatic usage of the validation service, the REST API description is available https://apps.lifs.isas.de/mztabvalidator/swagger-ui.html[here].

== Building the project from the command-line

In order to build the project and run the unit tests, execute the following command from a terminal:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.isas.mztab</groupId>
<artifactId>mztab-validator-webapp</artifactId>
<version>1.0.22-SNAPSHOT</version>
<version>1.0.22</version>
<packaging>jar</packaging>
<description>A web-based validator for mzTab format version 1.0 onwards.</description>
<name>MzTab validator webapplication.</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,30 @@

import de.isas.lipidomics.mztab.validator.webapp.ExampleFileConfig;
import de.isas.lipidomics.mztab.validator.webapp.domain.AppInfo;
import de.isas.lipidomics.mztab.validator.webapp.domain.ValidationStatistics;
import de.isas.lipidomics.mztab.validator.webapp.domain.Page;
import de.isas.lipidomics.mztab.validator.webapp.domain.ToolResult;
import de.isas.lipidomics.mztab.validator.webapp.domain.ToolResult.Keys;
import de.isas.lipidomics.mztab.validator.webapp.domain.ValidationForm;
import de.isas.lipidomics.mztab.validator.webapp.service.StorageService;
import de.isas.lipidomics.mztab.validator.webapp.service.ValidationService;
import de.isas.lipidomics.mztab.validator.webapp.service.storage.StorageFileNotFoundException;
import de.isas.lipidomics.mztab.validator.webapp.domain.UserSessionFile;
import de.isas.lipidomics.mztab.validator.webapp.domain.ValidationForm;
import de.isas.lipidomics.mztab.validator.webapp.domain.ValidationLevel;
import de.isas.lipidomics.mztab.validator.webapp.domain.ValidationResult;
import de.isas.lipidomics.mztab.validator.webapp.domain.ValidationStatistics;
import de.isas.lipidomics.mztab.validator.webapp.service.SessionIdGenerator;
import de.isas.lipidomics.mztab.validator.webapp.service.StorageService;
import de.isas.lipidomics.mztab.validator.webapp.service.StorageService.SLOT;
import de.isas.lipidomics.mztab.validator.webapp.service.ToolResultService;
import de.isas.lipidomics.mztab.validator.webapp.service.ValidationService;
import de.isas.lipidomics.mztab.validator.webapp.service.ValidationService.Status;
import de.isas.lipidomics.mztab.validator.webapp.service.storage.StorageException;
import java.io.File;
import de.isas.lipidomics.mztab.validator.webapp.service.storage.StorageFileNotFoundException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@Service
public class DefaultToolResultService implements ToolResultService {

private ConcurrentHashMap<UUID, ToolResult> sessionToToolResultMap = new ConcurrentHashMap<>();
private final ConcurrentHashMap<UUID, ToolResult> sessionToToolResultMap = new ConcurrentHashMap<>();

@Override
public ToolResult getOrCreateResultFor(UUID sessionId) {
Expand All @@ -43,14 +43,7 @@ public ToolResult getOrCreateResultFor(UUID sessionId) {

@Override
public void addResultFor(UUID sessionId, ToolResult result) {
// if(sessionToToolResultMap.containsKey(sessionId)) {
// sessionToToolResultMap.get(sessionId).setException(result.getException());
// sessionToToolResultMap.get(sessionId).setStatus(result.getStatus());
// sessionToToolResultMap.get(sessionId).getMessages().addAll(result.getMessages());
// sessionToToolResultMap.get(sessionId).getParameters().putAll(result.getParameters());
// } else {
sessionToToolResultMap.put(sessionId, result);
// }
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/isas/mztab2/server/api/ValidateApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen",
date = "2018-01-11T19:50:29.849+01:00")

@Api(value = "validate", description = "the validate API")
@Api(value = "validate", description = "The validation API for mzTab-m documents in JSON or XML format.", tags = {"validate"})
@RequestMapping(path = "/rest/v2")
public interface ValidateApi {

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/de/isas/mztab2/server/api/ValidatePlainApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen",
date = "2018-01-11T19:50:29.849+01:00")

@Api(value = "validatePlain", description = "the validatePlain API")
@Api(value = "validatePlain", description = "The validation API for mzTab-m documents in plaintext / tsv format.", tags = {"validatePlain"})
@RequestMapping(path = "/rest/v2")
public interface ValidatePlainApi {

Expand Down Expand Up @@ -179,7 +179,8 @@ default Optional<StorageService> getStorageService() {
method = RequestMethod.POST)
default ResponseEntity<List<ValidationMessage>> validatePlainMzTabFile(
@ApiParam(value = "mzTab file that should be validated.",
required = true, examples = @Example({@ExampleProperty(mediaType = "text/plain", value=GCGCMS_EXAMPLE),@ExampleProperty(mediaType = "text/tab-separated-values", value=GCGCMS_EXAMPLE)})) @Valid @RequestBody String mztabfile,
required = true,
examples = @Example(value={@ExampleProperty(mediaType = "text/plain", value=GCGCMS_EXAMPLE),@ExampleProperty(mediaType = "text/tab-separated-values", value=GCGCMS_EXAMPLE)})) @Valid @RequestBody String mztabfile,
@RequestParam(
value = "The level of errors that should be reported, one of error, warn, info.",
defaultValue = "info",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ public class SwaggerDocumentationConfig {
ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("mzTab validation API.")
.description("This is an mzTab validation service.")
.description("This is the mzTab validation service.")
.license("Apache 2.0")
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html")
.termsOfServiceUrl("")
.termsOfServiceUrl("https://lifs.isas.de/imprint-privacy-policy.html")
.version("2.0.0")
.contact(new Contact("","", "nils.hoffmann@isas.de"))
.contact(new Contact("LIFS-Tools jmzTab-m-webapp","https://github.com/lifs-tools/jmzTab-m-webapp", "lifs-support@isas.de"))
.build();
}

Expand Down
14 changes: 14 additions & 0 deletions src/main/resources/static/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,18 @@
.form-row {
margin-bottom: 5px;
}
/*
#metaDataRowsTable > tbody:nth-child(2) {
background-color: #ebf0f5;
}
#summaryDataRowsTable > tbody:nth-child(2) {
background-color: #ebf6ea;
}
#featureDataRowsTable > tbody:nth-child(2) {
background-color: #fff5e1;
}
#evidenceDataRowsTable > tbody:nth-child(2) {
background-color: #ffe9e1;
}
*/

0 comments on commit fc95118

Please sign in to comment.