Site update

This commit is contained in:
James Agnew 2015-02-27 18:10:01 -05:00
parent db65d5db59
commit 68bccf4f6f
1 changed files with 0 additions and 176 deletions

View File

@ -1,176 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>Server Tester - HAPI FHIR</title>
<author email="jamesagnew@users.sourceforge.net">James Agnew</author>
</properties>
<body>
<section name="FHIR Tester Web Application">
<macro name="toc">
</macro>
<p>
HAPI FHIR includes a web UI that can be used to test your server implementation.
This UI is the same UI used on the <a href="http://fhirtest.uhn.ca">http://fhirtest.uhn.ca</a>
public server.
</p>
<p>
The Tester is a
<a href="http://maven.apache.org/plugins/maven-war-plugin/overlays.html">Maven WAR Overlay</a>,
meaning that you create your own WAR project (which you would likely be doing anyway
to create your server) and the overlay drops a number of files into your project.
</p>
<subsection name="Adding the Overlay">
<p>
These instructions assume that you have an exsiting web project
which uses Maven to build. The POM.xml should have a "packaging"
type of "war".
</p>
<p>
Adding the overlay to your project is relatively simple. First,
add the "hapi-fhir-testpage-overlay" dependency to the dependencies
section of your POM.xml file.
<source><![CDATA[<dependencies>
<!-- ... other dependencies ... -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-testpage-overlay</artifactId>
<version>0.6-SNAPSHOT</version>
<type>war</type>
<scope>provided</scope>
</dependency>
</dependencies>]]></source>
</p>
<p>
Then, add the following WAR plugin to the plugins section
of your POM.xml
<source><![CDATA[<build>
<plugins>
<!-- ... other plugins ... -->
<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>
</configuration>
</plugin>
</build>
</plugins>]]></source>
</p>
<p>
Next, create the following directory in your project
if it doesn't already exist:<br/>
<code>src/main/webapp/WEB-INF</code>
</p>
<p>
Then, create a file in that directory
called <code>hapi-fhir-tester-config.xml</code>
and copy in the following contents:
</p>
<macro name="snippet">
<param name="file" value="restful-server-example/src/main/webapp/WEB-INF/hapi-fhir-tester-config.xml" />
</macro>
<p>
Note that the URL in the file above must be customized to point to
the FHIR endpoint your server will be deployed to. For example, if you
are naming your project "myfhir-1.0.war" and your endpoint in the WAR is
deployed to "/fhirbase/*" then you should put a URL similar to
<code>http://localhost:8080/myfhir-1.0/fhirbase</code>
</p>
<p>
Finally, in the same directory you should open you web.xml file. This file is
required in order to deploy to a servlet container and you should create it if
it does not already exist. Place the following contents in that file.
</p>
<source><![CDATA[<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/hapi-fhir-tester-application-context.xml
/WEB-INF/hapi-fhir-tester-config.xml
</param-value>
</context-param>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/hapi-fhir-tester-application-context.xml
/WEB-INF/hapi-fhir-tester-config.xml
</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/tester/*</url-pattern>
</servlet-mapping>]]></source>
</subsection>
<subsection name="Customizing the Overlay">
<p>
The most important customization required is to
set the FHIR server base URL in the
<code>hapi-fhir-tester-config.xml</code>
configuration file created during the
previous step.
</p>
<p>
Beyond this, the entire tester application is built
from a number of
<a href="http://thymeleaf.org">Thymeleaf</a>
template files, any of which can be replaced to
create your own look and feel. All of the templates
can be found in your built war (after running the Maven
build), or in the target directory's staging area, in
<code>WEB-INF/templates</code>. By placing a file
with the same path/name in your <code>src/main/webapp/WEB-INF/templates</code>
directory you can replace the built in template
with your own file.
</p>
</subsection>
<subsection name="A Complete Example">
<p>
The "Restful Server Example" project contains a complete working
example of the FHIR Tester as a part of its configuration. You may
wish to browse its source to see how this works:<br/>
<a href="https://github.com/jamesagnew/hapi-fhir/tree/master/restful-server-example">https://github.com/jamesagnew/hapi-fhir/tree/master/restful-server-example</a>
</p>
</subsection>
</section>
</body>
</document>