Skip to content
Snippets Groups Projects
Commit dd4251cd authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Adaptation to separating out the models. Cleaning up dependency mess

parent ee9e6b79
Branches
Tags
No related merge requests found
...@@ -26,9 +26,21 @@ ...@@ -26,9 +26,21 @@
<dependency> <dependency>
<groupId>org.jboss.resteasy</groupId> <groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId> <artifactId>resteasy-jaxrs</artifactId>
<version>3.0.2.Final</version> <version>3.0.9.Final</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.12</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.12</version>
<scope>provided</scope>
</dependency>
<dependency> <dependency>
<groupId>javax.persistence</groupId> <groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId> <artifactId>persistence-api</artifactId>
...@@ -44,20 +56,20 @@ ...@@ -44,20 +56,20 @@
<dependency> <dependency>
<groupId>org.reflections</groupId> <groupId>org.reflections</groupId>
<artifactId>reflections</artifactId> <artifactId>reflections</artifactId>
<version>0.9.9-RC1</version> <version>0.9.9</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.bioforsk.vips.common</groupId> <groupId>no.bioforsk.vips.common</groupId>
<artifactId>VIPSCommon</artifactId> <artifactId>VIPSCommon</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<!--scope>provided</scope--> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.thetransactioncompany</groupId> <groupId>com.thetransactioncompany</groupId>
<artifactId>cors-filter</artifactId> <artifactId>cors-filter</artifactId>
<version>1.7.1</version> <version>1.7.1</version>
</dependency> </dependency>
<dependency> <!--dependency>
<groupId>no.bioforsk.vips.model.</groupId> <groupId>no.bioforsk.vips.model.</groupId>
<artifactId>NaerstadModel</artifactId> <artifactId>NaerstadModel</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
...@@ -74,19 +86,20 @@ ...@@ -74,19 +86,20 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.bioforsk.vips</groupId> <groupId>no.bioforsk.vips</groupId>
<artifactId>GenericPathogenPlantInfectionModel</artifactId> <artifactId>GrassDryingModel</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>no.bioforsk.vips</groupId> <groupId>no.bioforsk.vips</groupId>
<artifactId>GrassDryingModel</artifactId> <artifactId>GenericPathogenPlantInfectionModel</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</dependency> </dependency-->
<dependency> <dependency>
<groupId>javax</groupId> <groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId> <artifactId>javaee-web-api</artifactId>
<version>6.0</version> <version>6.0</version>
<type>jar</type> <type>jar</type>
<scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -25,7 +25,7 @@ import javax.ws.rs.core.Application; ...@@ -25,7 +25,7 @@ import javax.ws.rs.core.Application;
/** /**
* Responsible for adding REST resources * Responsible for adding REST resources
* @copyright 2013 {@link http://www.bioforsk.no Bioforsk} * @copyright 2013-2014 {@link http://www.bioforsk.no Bioforsk}
* @author Tor-Einar Skog <tor-einar.skog@bioforsk.no> * @author Tor-Einar Skog <tor-einar.skog@bioforsk.no>
*/ */
@ApplicationPath("/") @ApplicationPath("/")
...@@ -56,5 +56,6 @@ public class VIPSCoreApplication extends Application ...@@ -56,5 +56,6 @@ public class VIPSCoreApplication extends Application
*/ */
private void addRestResourceClasses(Set<Class<?>> resources) { private void addRestResourceClasses(Set<Class<?>> resources) {
resources.add(no.bioforsk.vips.core.config.JacksonConfig.class); resources.add(no.bioforsk.vips.core.config.JacksonConfig.class);
resources.add(no.bioforsk.vips.core.service.ModelResourceImpl.class);
} }
} }
\ No newline at end of file
...@@ -22,7 +22,10 @@ package no.bioforsk.vips.core.service; ...@@ -22,7 +22,10 @@ package no.bioforsk.vips.core.service;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam; import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException; import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import no.bioforsk.vips.entity.ModelConfiguration; import no.bioforsk.vips.entity.ModelConfiguration;
...@@ -38,6 +41,7 @@ import no.bioforsk.vips.model.factory.ModelFactory; ...@@ -38,6 +41,7 @@ import no.bioforsk.vips.model.factory.ModelFactory;
* @copyright 2013 {@link http://www.bioforsk.no Bioforsk} * @copyright 2013 {@link http://www.bioforsk.no Bioforsk}
* @author Tor-Einar Skog <tor-einar.skog@bioforsk.no> * @author Tor-Einar Skog <tor-einar.skog@bioforsk.no>
*/ */
//@Path("")
public class ModelResourceImpl implements ModelResource{ public class ModelResourceImpl implements ModelResource{
/** /**
...@@ -55,9 +59,9 @@ public class ModelResourceImpl implements ModelResource{ ...@@ -55,9 +59,9 @@ public class ModelResourceImpl implements ModelResource{
* Lists all models available in this instance, using default language (English) * Lists all models available in this instance, using default language (English)
* @return list of all models available * @return list of all models available
*/ */
//@GET @GET
//@Path("models/json") @Path("models/json")
//@Produces("application/json;charset=UTF-8") @Produces("application/json;charset=UTF-8")
@Override @Override
public Response printModelListJSON() public Response printModelListJSON()
{ {
...@@ -69,9 +73,9 @@ public class ModelResourceImpl implements ModelResource{ ...@@ -69,9 +73,9 @@ public class ModelResourceImpl implements ModelResource{
* Lists all models available in this instance, using default language (English) * Lists all models available in this instance, using default language (English)
* @return list of all models available * @return list of all models available
*/ */
//@GET @GET
//@Path("models/json/{language}") @Path("models/json/{language}")
//@Produces("application/json;charset=UTF-8") @Produces("application/json;charset=UTF-8")
@Override @Override
public Response printModelListJSON(@PathParam("language") String language) public Response printModelListJSON(@PathParam("language") String language)
{ {
...@@ -109,9 +113,9 @@ public class ModelResourceImpl implements ModelResource{ ...@@ -109,9 +113,9 @@ public class ModelResourceImpl implements ModelResource{
* Lists all models available in this instance, using default language (English) * Lists all models available in this instance, using default language (English)
* @return list of all models available * @return list of all models available
*/ */
//@GET @GET
//@Path("models/{language}") @Path("models/{language}")
//@Produces("text/plain;charset=UTF-8") @Produces("text/plain;charset=UTF-8")
@Override @Override
public Response printModelList(@PathParam("language") String language) public Response printModelList(@PathParam("language") String language)
{ {
...@@ -148,9 +152,9 @@ public class ModelResourceImpl implements ModelResource{ ...@@ -148,9 +152,9 @@ public class ModelResourceImpl implements ModelResource{
* @param language two-letter code (<a href="http://www.loc.gov/standards/iso639-2/php/English_list.php">ISO-639-2</a>) * @param language two-letter code (<a href="http://www.loc.gov/standards/iso639-2/php/English_list.php">ISO-639-2</a>)
* @return * @return
*/ */
//@GET @GET
//@Path("models/{modelId}/usage/{language}") @Path("models/{modelId}/usage/{language}")
//@Produces("text/plain;charset=UTF-8") @Produces("text/plain;charset=UTF-8")
@Override @Override
public Response printModelUsage(@PathParam("modelId") String modelId, @PathParam("language") String language) public Response printModelUsage(@PathParam("modelId") String modelId, @PathParam("language") String language)
{ {
...@@ -164,9 +168,9 @@ public class ModelResourceImpl implements ModelResource{ ...@@ -164,9 +168,9 @@ public class ModelResourceImpl implements ModelResource{
* @param language two-letter code (<a href="http://www.loc.gov/standards/iso639-2/php/English_list.php">ISO-639-2</a>) * @param language two-letter code (<a href="http://www.loc.gov/standards/iso639-2/php/English_list.php">ISO-639-2</a>)
* @return * @return
*/ */
//@GET @GET
//@Path("models/{modelId}/usage") @Path("models/{modelId}/usage")
//@Produces("text/plain;charset=UTF-8") @Produces("text/plain;charset=UTF-8")
@Override @Override
public Response printModelUsage(@PathParam("modelId") String modelId) public Response printModelUsage(@PathParam("modelId") String modelId)
{ {
...@@ -178,9 +182,9 @@ public class ModelResourceImpl implements ModelResource{ ...@@ -178,9 +182,9 @@ public class ModelResourceImpl implements ModelResource{
* @param modelId the requested model * @param modelId the requested model
* @return * @return
*/ */
//@GET @GET
//@Path("models/{modelId}/sampleconfig") @Path("models/{modelId}/sampleconfig")
//@Produces("text/plain;charset=UTF-8") @Produces("text/plain;charset=UTF-8")
@Override @Override
public Response printModelSampleConfig(@PathParam("modelId") String modelId) public Response printModelSampleConfig(@PathParam("modelId") String modelId)
{ {
......
...@@ -143,7 +143,6 @@ public class ModelFactory { ...@@ -143,7 +143,6 @@ public class ModelFactory {
for(Class<? extends Model> subType : subTypes) for(Class<? extends Model> subType : subTypes)
{ {
try { try {
Model model = subType.newInstance(); Model model = subType.newInstance();
if(models.get(model.getModelId().toString()) == null) if(models.get(model.getModelId().toString()) == null)
{ {
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2014 Bioforsk <http://www.bioforsk.no/>.
This file is part of VIPSCore.
VIPSCore is free software: you can redistribute it and/or modify
it under the terms of the Bioforsk Open Source License as published by
Bioforsk, either version 1 of the License, or (at your option) any
later version.
VIPSCore is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Bioforsk Open Source License for more details.
You should have received a copy of the Bioforsk Open Source License
along with VIPSCore. If not, see <http://www.bioforsk.no/licenses/>.
-->
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="no.bioforsk.vips.modelcontainer"/>
<module name="no.bioforsk.vips.VIPSCommon" export="true"/>
<module name="org.codehaus.jackson.jackson-core-asl" />
<module name="org.codehaus.jackson.jackson-mapper-asl" />
</dependencies>
</deployment>
</jboss-deployment-structure>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment