Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/jamesagnew/hapi-fhir into…
… jaxrs-sever-evolution
- Loading branch information
Showing
368 changed files
with
3,813 additions
and
6,166 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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,8 @@ | ||
# Help Wanted | ||
|
||
This page is a work in progress! | ||
|
||
It serves as a place to list potential help a new volunteer could offer. | ||
|
||
* Investigate adding support for FHIR's RDF (Turtle) encoding to HAPI | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
27 changes: 27 additions & 0 deletions
27
...e-projects/hapi-fhir-base-example-embedded-ws/src/main/java/embedded/ContextListener.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,27 @@ | ||
package embedded; | ||
|
||
import javax.inject.Singleton; | ||
|
||
import org.ebaysf.web.cors.CORSFilter; | ||
|
||
import com.google.inject.Guice; | ||
import com.google.inject.Injector; | ||
import com.google.inject.servlet.GuiceServletContextListener; | ||
import com.sun.jersey.guice.JerseyServletModule; | ||
|
||
public class ContextListener extends GuiceServletContextListener { | ||
|
||
@Override | ||
protected Injector getInjector() { | ||
|
||
return Guice.createInjector(new JerseyServletModule() { | ||
|
||
@Override | ||
protected void configureServlets() { | ||
bind(CORSFilter.class).in(Singleton.class); | ||
filter("/*").through(CORSFilter.class); | ||
serve("/model/*").with(FhirRestfulServlet.class); | ||
} | ||
}); | ||
} | ||
} |
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
13 changes: 10 additions & 3 deletions
13
...src/main/java/embedded/ServerStartup.java → ...src/main/java/embedded/ServerStartup.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,25 +1,32 @@ | ||
package embedded; | ||
|
||
import java.util.EnumSet; | ||
|
||
import javax.servlet.DispatcherType; | ||
|
||
import org.eclipse.jetty.server.Server; | ||
import org.eclipse.jetty.servlet.DefaultServlet; | ||
import org.eclipse.jetty.servlet.ServletContextHandler; | ||
import org.slf4j.bridge.SLF4JBridgeHandler; | ||
|
||
import com.google.inject.servlet.GuiceFilter; | ||
|
||
public class ServerStartup { | ||
|
||
public static void main(final String[] args) throws Exception { | ||
|
||
SLF4JBridgeHandler.removeHandlersForRootLogger(); | ||
SLF4JBridgeHandler.install(); | ||
|
||
final Server server = new Server(9090); | ||
final ServletContextHandler sch = new ServletContextHandler(server, "/"); | ||
sch.addEventListener(new ContextListener()); | ||
sch.addFilter(GuiceFilter.class, "/*", | ||
EnumSet.of(DispatcherType.REQUEST)); | ||
sch.addFilter(GuiceFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST)); | ||
sch.addServlet(DefaultServlet.class, "/"); | ||
server.start(); | ||
server.start(); | ||
|
||
// Service is now accessible through | ||
// http://localhost:9090/model/Practitioner | ||
} | ||
|
||
} |
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
1 change: 0 additions & 1 deletion
1
...settings/org.eclipse.core.resources.prefs → ...settings/org.eclipse.core.resources.prefs
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,5 +1,4 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/main/java=UTF-8 | ||
encoding//src/test/java=UTF-8 | ||
encoding//src/test/resources=UTF-8 | ||
encoding/<project>=UTF-8 |
5 changes: 5 additions & 0 deletions
5
example-projects/hapi-fhir-standalone-overlay-example/.settings/org.eclipse.jdt.core.prefs
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,5 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
org.eclipse.jdt.core.compiler.compliance=1.8 | ||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning | ||
org.eclipse.jdt.core.compiler.source=1.8 |
File renamed without changes.
81 changes: 81 additions & 0 deletions
81
example-projects/hapi-fhir-standalone-overlay-example/pom.xml
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,81 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>ca.uhn.hapi.fhir</groupId> | ||
<artifactId>hapi-fhir</artifactId> | ||
<version>2.3-SNAPSHOT</version> | ||
<relativePath>../hapi-deployable-pom/pom.xml</relativePath> | ||
</parent> | ||
<artifactId>hapi-fhir-standalone-overlay-example</artifactId> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<configuration> | ||
<overlays> | ||
<overlay> | ||
<groupId>ca.uhn.hapi.fhir</groupId> | ||
<artifactId>hapi-fhir-testpage-overlay</artifactId> | ||
</overlay> | ||
</overlays> | ||
<warName>fhirtester</warName> | ||
<failOnMissingWebXml>true</failOnMissingWebXml> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<dependencies> | ||
<dependency> | ||
<groupId>ca.uhn.hapi.fhir</groupId> | ||
<artifactId>hapi-fhir-testpage-overlay</artifactId> | ||
<version>2.3-SNAPSHOT</version> | ||
<type>war</type> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>ca.uhn.hapi.fhir</groupId> | ||
<artifactId>hapi-fhir-testpage-overlay</artifactId> | ||
<version>2.3-SNAPSHOT</version> | ||
<classifier>classes</classifier> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-servlet</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.jetty</groupId> | ||
<artifactId>jetty-webapp</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.inject</groupId> | ||
<artifactId>guice</artifactId> | ||
<version>4.1.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.inject.extensions</groupId> | ||
<artifactId>guice-servlet</artifactId> | ||
<version>4.1.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.sun.jersey.contribs</groupId> | ||
<artifactId>jersey-guice</artifactId> | ||
<version>1.19.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.ebaysf.web</groupId> | ||
<artifactId>cors-filter</artifactId> | ||
<version>1.0.1</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
51 changes: 51 additions & 0 deletions
51
.../hapi-fhir-standalone-overlay-example/src/main/java/embedded/example/ContextListener.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,51 @@ | ||
package embedded.example; | ||
|
||
import javax.inject.Singleton; | ||
import javax.servlet.ServletContextEvent; | ||
|
||
import org.ebaysf.web.cors.CORSFilter; | ||
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; | ||
import org.springframework.web.servlet.DispatcherServlet; | ||
|
||
import com.google.inject.Guice; | ||
import com.google.inject.Injector; | ||
import com.google.inject.servlet.GuiceServletContextListener; | ||
import com.sun.jersey.guice.JerseyServletModule; | ||
|
||
public class ContextListener extends GuiceServletContextListener { | ||
|
||
static String username; | ||
static String password; | ||
static String serverAddress; | ||
|
||
@Override | ||
public void contextInitialized(ServletContextEvent servletContextEvent) { | ||
super.contextInitialized(servletContextEvent); | ||
|
||
username = servletContextEvent.getServletContext().getInitParameter("username") != null | ||
? servletContextEvent.getServletContext().getInitParameter("username") | ||
: null; | ||
password = servletContextEvent.getServletContext().getInitParameter("password") != null | ||
? servletContextEvent.getServletContext().getInitParameter("password") | ||
: null; | ||
serverAddress = servletContextEvent.getServletContext().getInitParameter("serverAddress") != null | ||
? servletContextEvent.getServletContext().getInitParameter("serverAddress") | ||
: null; | ||
} | ||
|
||
@Override | ||
protected Injector getInjector() { | ||
return Guice.createInjector(new JerseyServletModule() { | ||
|
||
@Override | ||
protected void configureServlets() { | ||
|
||
AnnotationConfigWebApplicationContext webApp = new AnnotationConfigWebApplicationContext(); | ||
webApp.setConfigLocation(FhirTesterConfig.class.getName()); | ||
serve("/*").with(new DispatcherServlet(webApp)); | ||
bind(CORSFilter.class).in(Singleton.class); | ||
filter("/*").through(CORSFilter.class); | ||
} | ||
}); | ||
} | ||
} |
Oops, something went wrong.