diff --git a/vcell-api/src/main/java/org/vcell/rest/server/BiomodelOMEXServerResource.java b/vcell-api/src/main/java/org/vcell/rest/server/BiomodelOMEXServerResource.java index a702a037ae..d8ce62fa42 100644 --- a/vcell-api/src/main/java/org/vcell/rest/server/BiomodelOMEXServerResource.java +++ b/vcell-api/src/main/java/org/vcell/rest/server/BiomodelOMEXServerResource.java @@ -65,37 +65,39 @@ protected void describeGet(MethodInfo info) { @Override @Get(BiomodelOMEXResource.APPLICATION_OMEX_ZIP) public ByteArrayRepresentation get_omex() { - VCellApiApplication application = ((VCellApiApplication)getApplication()); - User vcellUser = application.getVCellUser(getChallengeResponse(),AuthenticationPolicy.ignoreInvalidCredentials); - boolean bSkipUnsupported = false; - StringBuffer suggestedProjectName = new StringBuffer(); - ByteArrayRepresentation omexRep = getOmex(vcellUser, bSkipUnsupported, suggestedProjectName); - - if (omexRep != null){ - String bioModelID = (String)getRequestAttributes().get(VCellApiApplication.BIOMODELID); -// setAttribute("Content-type", "application/vcml+xml"); - setAttribute("Content-Disposition", "attachment; filename=\""+suggestedProjectName+".omex\""); - return omexRep; - } - throw new RuntimeException("biomodel not found"); + // TODO: Implement this method properly, as it is currently using too much resources + throw new ResourceException(Status.SERVER_ERROR_NOT_IMPLEMENTED, "biomodel.omex endpoint not implemented"); +// VCellApiApplication application = ((VCellApiApplication)getApplication()); +// User vcellUser = application.getVCellUser(getChallengeResponse(),AuthenticationPolicy.ignoreInvalidCredentials); +// boolean bSkipUnsupported = false; +// StringBuffer suggestedProjectName = new StringBuffer(); +// ByteArrayRepresentation omexRep = getOmex(vcellUser, bSkipUnsupported, suggestedProjectName); +// +// if (omexRep != null){ +// String bioModelID = (String)getRequestAttributes().get(VCellApiApplication.BIOMODELID); +//// setAttribute("Content-type", "application/vcml+xml"); +// setAttribute("Content-Disposition", "attachment; filename=\""+suggestedProjectName+".omex\""); +// return omexRep; +// } +// throw new RuntimeException("biomodel not found"); } - private ByteArrayRepresentation getOmex(User vcellUser, boolean bSkipUnsupported, StringBuffer suggestedProjectName) { - RestDatabaseService restDatabaseService = ((VCellApiApplication)getApplication()).getRestDatabaseService(); - try { - ByteArrayRepresentation omexRep = restDatabaseService.query(this, vcellUser, bSkipUnsupported, suggestedProjectName); - return omexRep; - } catch (PermissionException e) { - lg.error(e); - throw new ResourceException(Status.CLIENT_ERROR_UNAUTHORIZED, "permission denied to requested resource"); - } catch (ObjectNotFoundException e) { - lg.error(e); - throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, "biomodel not found"); - } catch (Exception e){ - throw new ResourceException(Status.SERVER_ERROR_INTERNAL, e.toString()); - } - } +// private ByteArrayRepresentation getOmex(User vcellUser, boolean bSkipUnsupported, StringBuffer suggestedProjectName) { +// RestDatabaseService restDatabaseService = ((VCellApiApplication)getApplication()).getRestDatabaseService(); +// try { +// ByteArrayRepresentation omexRep = restDatabaseService.query(this, vcellUser, bSkipUnsupported, suggestedProjectName); +// return omexRep; +// } catch (PermissionException e) { +// lg.error(e); +// throw new ResourceException(Status.CLIENT_ERROR_UNAUTHORIZED, "permission denied to requested resource"); +// } catch (ObjectNotFoundException e) { +// lg.error(e); +// throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, "biomodel not found"); +// } catch (Exception e){ +// throw new ResourceException(Status.SERVER_ERROR_INTERNAL, e.toString()); +// } +// } } diff --git a/vcell-api/src/main/resources/biomodel.ftl b/vcell-api/src/main/resources/biomodel.ftl index f6b9b29d71..4b9f4b0c8c 100644 --- a/vcell-api/src/main/resources/biomodel.ftl +++ b/vcell-api/src/main/resources/biomodel.ftl @@ -6,7 +6,7 @@ <#assign diagramlink="${pathPrefix}/biomodel/${biomodel.bmKey}/diagram"> <#assign vcmllink="${pathPrefix}/biomodel/${biomodel.bmKey}/biomodel.vcml"> <#assign sbmllink="${pathPrefix}/biomodel/${biomodel.bmKey}/biomodel.sbml"> -<#assign omexlink="${pathPrefix}/biomodel/${biomodel.bmKey}/biomodel.omex"> +<#--<#assign omexlink="${pathPrefix}/biomodel/${biomodel.bmKey}/biomodel.omex">--> <#assign simstatuslink="${pathPrefix}/simstatus?submitLow=&submitHigh=&startRow=1&maxRows=10&hasData=all&active=on&running=on&completed=on&stopped=on&failed=on"> <#assign simtasklink="${pathPrefix}/simtask?submitLow=&submitHigh=&startRow=1&maxRows=10&hasData=all&waiting=on&queued=on&dispatched=on&running=on&completed=on&failed=on&stopped=on">

Publications   BioModels   Simulation Status   Simulation Tasks   <#if userid?? >(user: ${userid} Log out)<#else>(not logged in sign in)


@@ -17,7 +17,7 @@
saved: ${biomodel.savedDate?number_to_date!""}

download vcml

download sbml
-
download omex
+<#--
download omex
-->


Applications

diff --git a/vcell-rest/src/main/java/org/vcell/restq/Main.java b/vcell-rest/src/main/java/org/vcell/restq/Main.java index 48402ad0cb..81f2e7f629 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/Main.java +++ b/vcell-rest/src/main/java/org/vcell/restq/Main.java @@ -80,7 +80,7 @@ public static void main(String... args) { public static final String VCML_DOWNLOAD = "biomodel.vcml"; public static final String SBML_DOWNLOAD = "biomodel.sbml"; - public static final String OMEX_DOWNLOAD = "biomodel.omex"; +// public static final String OMEX_DOWNLOAD = "biomodel.omex"; public static final String BNGL_DOWNLOAD = "biomodel.bngl"; public static final String DIAGRAM_DOWNLOAD = "diagram"; public static final String SIMULATION = "simulation";