-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/feature/web-extjs' into develop
Conflicts: eva-server/src/main/java/uk/ac/ebi/variation/eva/server/ws/FilesWSServer.java eva-server/src/main/java/uk/ac/ebi/variation/eva/server/ws/GeneWSServer.java eva-server/src/main/java/uk/ac/ebi/variation/eva/server/ws/RegionWSServer.java eva-server/src/main/java/uk/ac/ebi/variation/eva/server/ws/StudyWSServer.java eva-server/src/main/java/uk/ac/ebi/variation/eva/server/ws/VariantWSServer.java eva-server/src/main/java/uk/ac/ebi/variation/eva/server/ws/ga4gh/GA4GHVariantCallSetWSServer.java eva-web/src/js/eva-variant-widget-panel.js eva-web/src/js/variant-widget/eva-variant-widget.js
- Loading branch information
Showing
631 changed files
with
19,280 additions
and
1,065 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ion/eva/server/ws/CORSResponseFilter.java → ...iation/eva/server/CORSResponseFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package uk.ac.ebi.variation.eva.server.ws; | ||
package uk.ac.ebi.variation.eva.server; | ||
|
||
import java.io.IOException; | ||
|
||
|
4 changes: 2 additions & 2 deletions
4
eva-server/src/main/java/uk/ac/ebi/variation/eva/server/EvaWSRegistry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
eva-server/src/main/java/uk/ac/ebi/variation/eva/server/exception/SpeciesException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package uk.ac.ebi.variation.eva.server.exception; | ||
|
||
@SuppressWarnings("serial") | ||
public class SpeciesException extends Exception { | ||
|
||
public SpeciesException(String msg) { | ||
super(msg); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
eva-server/src/main/java/uk/ac/ebi/variation/eva/server/exception/VersionException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package uk.ac.ebi.variation.eva.server.exception; | ||
|
||
|
||
@SuppressWarnings("serial") | ||
public class VersionException extends Exception { | ||
|
||
public VersionException(String msg) { | ||
super(msg); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,56 +5,66 @@ | |
import java.util.Arrays; | ||
import javax.naming.NamingException; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.ws.rs.DefaultValue; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.PathParam; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.QueryParam; | ||
import javax.ws.rs.*; | ||
import javax.ws.rs.core.Context; | ||
import javax.ws.rs.core.MediaType; | ||
import javax.ws.rs.core.Response; | ||
import javax.ws.rs.core.UriInfo; | ||
|
||
import com.wordnik.swagger.annotations.Api; | ||
import com.wordnik.swagger.annotations.ApiOperation; | ||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
import org.opencb.opencga.lib.auth.IllegalOpenCGACredentialsException; | ||
import org.opencb.opencga.storage.core.variant.adaptors.VariantSourceDBAdaptor; | ||
import uk.ac.ebi.variation.eva.lib.datastore.DBAdaptorConnector; | ||
import uk.ac.ebi.variation.eva.lib.storage.metadata.VariantSourceEvaproDBAdaptor; | ||
import uk.ac.ebi.variation.eva.server.exception.SpeciesException; | ||
import uk.ac.ebi.variation.eva.server.exception.VersionException; | ||
|
||
/** | ||
* | ||
* @author Cristina Yenyxe Gonzalez Garcia <[email protected]> | ||
*/ | ||
@Path("/{version}/files") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Produces("application/json") | ||
@Api(value = "Files", description = "Files RESTful Web Services API") | ||
public class FilesWSServer extends EvaWSServer { | ||
|
||
private VariantSourceDBAdaptor variantSourceEvaproDbAdaptor; | ||
|
||
public FilesWSServer() throws IllegalOpenCGACredentialsException { | ||
super(); | ||
} | ||
|
||
public FilesWSServer(@DefaultValue("") @PathParam("version") String version, @Context UriInfo uriInfo, @Context HttpServletRequest hsr) | ||
throws NamingException { | ||
public FilesWSServer(@DefaultValue("") @PathParam("version") String version, | ||
@Context UriInfo uriInfo, @Context HttpServletRequest hsr) throws NamingException { | ||
super(version, uriInfo, hsr); | ||
variantSourceEvaproDbAdaptor = new VariantSourceEvaproDBAdaptor(); | ||
} | ||
|
||
@GET | ||
@Path("/all") | ||
@ApiOperation(httpMethod = "GET", value = "Gets the files of a species") | ||
public Response getFiles(@QueryParam("species") String species) | ||
throws UnknownHostException, IllegalOpenCGACredentialsException, IOException { | ||
if (species != null && !species.isEmpty()) { | ||
queryOptions.put("species", species); | ||
try { | ||
checkParams(); | ||
} catch (VersionException | SpeciesException ex) { | ||
return createErrorResponse(ex.toString()); | ||
} | ||
|
||
VariantSourceDBAdaptor variantSourceMongoDbAdaptor = DBAdaptorConnector.getVariantSourceDBAdaptor(species); | ||
return createOkResponse(variantSourceMongoDbAdaptor.getAllSources(queryOptions)); | ||
} | ||
|
||
@GET | ||
@Path("/{files}/url") | ||
@ApiOperation(httpMethod = "GET", value = "Gets the URL of a file") | ||
public Response getFileUrl(@PathParam("files") String filenames) { | ||
try { | ||
checkParams(); | ||
} catch (VersionException | SpeciesException ex) { | ||
return createErrorResponse(ex.toString()); | ||
} | ||
|
||
return createOkResponse(variantSourceEvaproDbAdaptor.getSourceDownloadUrlByName(Arrays.asList(filenames.split(",")))); | ||
} | ||
|
||
} |
Oops, something went wrong.