Skip to content

Commit

Permalink
Added web services to Neji
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejeronimo committed Oct 26, 2016
1 parent e2bb9ac commit ba67bc7
Show file tree
Hide file tree
Showing 289 changed files with 99,595 additions and 2 deletions.
Binary file added conf/keystore.jks
Binary file not shown.
10 changes: 10 additions & 0 deletions conf/server-configuration.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
proxy.url =
proxy.port =
proxy.username =
proxy.password =

https.keystore.file = conf/keystore.jks
https.keystore.password = BMD4key

https.truststore.file = conf/truststore.jks
https.truststore.password = BMD4key
Binary file added conf/truststore.jks
Binary file not shown.
13 changes: 13 additions & 0 deletions loginRealm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
jdbcdriver = org.sqlite.JDBC
url = jdbc:sqlite:neji.db
usertable = users
usertablekey = id
usertableuserfield = username
usertablepasswordfield = pwd
roletable = roles
roletablekey = id
roletablerolefield = role
userroletable = user_roles
userroletableuserkey = user_id
userroletablerolekey = role_id
cachetime = 300
2 changes: 1 addition & 1 deletion neji.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
cp=target/neji-2.0-jar-with-dependencies.jar:$CLASSPATH
cp=target/neji-2.1.0-SNAPSHOT-jar-with-dependencies.jar:$CLASSPATH
MEMORY=8G
JAVA_COMMAND="java -Xmx$MEMORY -Dfile.encoding=UTF-8 -classpath $cp"
CLASS=pt.ua.tm.neji.cli.Main
Expand Down
2 changes: 1 addition & 1 deletion nejiTrain.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
cp=target/neji-2.0-jar-with-dependencies.jar:$CLASSPATH
cp=target/neji-2.1.0-SNAPSHOT-jar-with-dependencies.jar:$CLASSPATH
MEMORY=12G
JAVA_COMMAND="java -Xmx$MEMORY -Dfile.encoding=UTF-8 -classpath $cp"
CLASS=pt.ua.tm.neji.train.cli.TrainMain
Expand Down
7 changes: 7 additions & 0 deletions nejiWeb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
cp=target/neji-2.1.0-SNAPSHOT-server.jar:$CLASSPATH
MEMORY=6G
JAVA_COMMAND="java -Xmx$MEMORY -Dfile.encoding=UTF-8 -classpath $cp"
CLASS=pt.ua.tm.neji.web.cli.WebMain

$JAVA_COMMAND $CLASS $*
120 changes: 120 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/resources/webapp</directory>
</resource>
</resources>
<plugins>
<plugin>
Expand Down Expand Up @@ -235,6 +238,44 @@
<forkMode>always</forkMode>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>${project.build.finalName}-server</finalName>
<transformers>
<!--use transformer to handle merge of META-INF/services - see http://java.net/jira/browse/JERSEY-440?focusedCommentId=14822&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_14822-->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>pt.ua.tm.neji.web.cli.WebMain</Main-Class>
</manifestEntries>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
<filters>
<!--filter to address "Invalid signature file" issue - see http://stackoverflow.com/a/6743609/589215-->
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -377,6 +418,85 @@
<version>2015</version>
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>8.0.0.RC0</version>
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jsp-2.1</artifactId>
<version>7.5.4.v20111024</version>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.1-glassfish</artifactId>
<version>2.1.v20100127</version>
</dependency>

<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.9</version>
</dependency>

<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.9</version>
</dependency>

<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>1.9</version>
</dependency>

<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-multipart</artifactId>
<version>1.9</version>
<exclusions>
<exclusion>
<groupId>org.jvnet</groupId>
<artifactId>mimepull</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.jvnet.mimepull</groupId>
<artifactId>mimepull</artifactId>
<version>1.9</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.4</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.1</version>
</dependency>

<!-- SQLite -->
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.8.10.1</version>
</dependency>

</dependencies>

</project>
31 changes: 31 additions & 0 deletions src/main/java/pt/ua/tm/neji/web/WebConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2016 BMD Software and University of Aveiro.
*
* Neji is a flexible and powerful platform for biomedical information extraction from text.
*
* This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/.
*
* This project is a free software, you are free to copy, distribute, change and transmit it.
* However, you may not use it for commercial purposes.
*
* It 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.
*/

package pt.ua.tm.neji.web;

import java.io.File;

/**
* Constants to use in the web features.
*
* @author André Santos (<a href="mailto:andre.jeronimo@ua.pt">andre.jeronimo@ua.pt</a>)
* @version 1.0
*/
public class WebConstants {

public static final String DICTIONARIES_PATH = "resources" + File.separator + "dictionaries" + File.separator;
public static final String DICTIONARIES_PRIORITY_PATH = "resources" + File.separator + "dictionaries" + File.separator + "_priority";
public static final String MODELS_PATH = "resources" + File.separator + "models" + File.separator;
}
Loading

0 comments on commit ba67bc7

Please sign in to comment.