Skip to content

Commit

Permalink
Issue #731 Metabolic pathways search changes
Browse files Browse the repository at this point in the history
  • Loading branch information
okolesn committed Jan 31, 2022
1 parent e924dde commit d5c565c
Show file tree
Hide file tree
Showing 8 changed files with 144 additions and 199 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public final class MessagesConstants {
public static final String ERROR_SPECIES_NOT_SPECIFIED = "error.no.species";
public static final String ERROR_INDEX_NOT_SPECIFIED = "error.no.index.cache";
public static final String ERROR_INDEX_URL_NOT_SPECIFIED = "error.no.index.url.cache";
public static final String ERROR_INDEX_DIRECTORY_IS_EMPTY = "error.empty.index.directory";
public static final String ERROR_CHROMOSOME_NOT_SPECIFIED = "error.no.chromosome";
public static final String ERROR_STARTPOSITION_NOT_SPECIFIED = "error.no.startposition";
public static final String ERROR_FINISHPOSITION_NOT_SPECIFIED = "error.no.finishposition";
Expand Down Expand Up @@ -294,8 +295,6 @@ public final class MessagesConstants {

//Pathway
public static final String ERROR_PATHWAY_NOT_FOUND = "error.pathway.not.found";
public static final String ERROR_PATHWAY_NO_GLYPHS = "error.pathway.no.glyphs.found";
public static final String ERROR_PATHWAY_NO_ARCS = "error.pathway.no.arcs.found";

//Attributes
public static final String ERROR_ATTRIBUTE_INVALID_VALUE = "error.attribute.invalid.value";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@
import com.epam.catgenome.controller.Result;
import com.epam.catgenome.controller.vo.registration.PathwayRegistrationRequest;
import com.epam.catgenome.entity.pathway.Pathway;
import com.epam.catgenome.entity.pathway.SbgnElement;
import com.epam.catgenome.entity.pathway.PathwayQueryParams;
import com.epam.catgenome.util.db.Page;
import com.epam.catgenome.manager.pathway.PathwaySecurityService;
import com.epam.catgenome.util.db.QueryParameters;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiResponse;
Expand All @@ -50,7 +49,6 @@
import javax.servlet.http.HttpServletResponse;
import javax.xml.bind.JAXBException;
import java.io.IOException;
import java.util.List;

@RestController
@Api(value = "pathway", description = "Metabolic Pathways Management")
Expand Down Expand Up @@ -88,19 +86,6 @@ public void loadPathwayContent(@PathVariable final Long pathwayId,
response.flushBuffer();
}

@PostMapping(value = "/pathway/search")
@ApiOperation(
value = "Searches sbgn file elements",
notes = "Searches sbgn file elements",
produces = MediaType.APPLICATION_JSON_VALUE)
@ApiResponses(
value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
})
public Result<List<SbgnElement>> searchElements(@RequestBody SbgnElement sbgnElement)
throws IOException, ParseException {
return Result.success(pathwaySecurityService.searchElements(sbgnElement));
}

@PostMapping(value = "/pathways")
@ApiOperation(
value = "Returns pathways page",
Expand All @@ -109,8 +94,9 @@ public Result<List<SbgnElement>> searchElements(@RequestBody SbgnElement sbgnEle
@ApiResponses(
value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
})
public Result<Page<Pathway>> loadPathways(@RequestBody final QueryParameters queryParameters) {
return Result.success(pathwaySecurityService.loadPathways(queryParameters));
public Result<Page<Pathway>> loadPathways(@RequestBody final PathwayQueryParams params)
throws IOException, ParseException {
return Result.success(pathwaySecurityService.loadPathways(params));
}

@PostMapping(value = "/pathway")
Expand All @@ -122,7 +108,7 @@ public Result<Page<Pathway>> loadPathways(@RequestBody final QueryParameters que
value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
})
public Result<Pathway> createPathway(@RequestBody final PathwayRegistrationRequest request)
throws IOException, ParseException, JAXBException {
throws IOException, JAXBException {
return Result.success(pathwaySecurityService.createPathway(request));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@
*/
package com.epam.catgenome.entity.pathway;

import lombok.Builder;
import com.epam.catgenome.util.db.PagingInfo;
import com.epam.catgenome.util.db.SortInfo;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Builder
public class SbgnElement {
private Long pathwayId;
private SbgnElementType type;
private String clazz;
private String entryId;
private String label;
@Getter
public class PathwayQueryParams {
private PagingInfo pagingInfo;
private String term;
private SortInfo sortInfo;
}

This file was deleted.

Loading

0 comments on commit d5c565c

Please sign in to comment.