Get server working

This commit is contained in:
jamesagnew 2014-12-21 22:22:07 -05:00
parent 994e49057d
commit dde1d0495c
4 changed files with 8 additions and 9 deletions

View File

@ -6,7 +6,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/tinder"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>

View File

@ -9,6 +9,7 @@
</parent>
<artifactId>hapi-fhir-jpaserver-uhnfhirtest</artifactId>
<packaging>war</packaging>
<name>HAPI FHIR - fhirtest.uhn.ca Deployable WAR</name>
@ -215,5 +216,4 @@
<finalName>hapi-fhir-jpaserver</finalName>
</build>
<packaging>war</packaging>
</project>

View File

@ -55,15 +55,21 @@ public class TestRestfulServer extends RestfulServer {
myAppCtx = ContextLoaderListener.getCurrentWebApplicationContext();
List<IResourceProvider> beans;
JpaSystemProvider systemProvider;
IFhirSystemDao systemDao;
switch (fhirVersionParam.trim().toUpperCase()) {
case "DSTU":
case "DSTU1":
setFhirContext(FhirContext.forDstu1());
beans = myAppCtx.getBean("myResourceProvidersDstu1", List.class);
systemProvider = myAppCtx.getBean("mySystemProviderDstu1", JpaSystemProvider.class);
systemDao = myAppCtx.getBean("mySystemDaoDstu1", IFhirSystemDao.class);
break;
case "DEV":
setFhirContext(FhirContext.forDev());
beans = myAppCtx.getBean("myResourceProvidersDev", List.class);
systemProvider = myAppCtx.getBean("mySystemProviderDev", JpaSystemProvider.class);
systemDao = myAppCtx.getBean("mySystemDaoDev", IFhirSystemDao.class);
break;
default:
throw new ServletException("Unknown FHIR version specified in init-param[FhirVersion]: " + fhirVersionParam);
@ -76,10 +82,7 @@ public class TestRestfulServer extends RestfulServer {
ourLog.info(" * Have resource provider for: {}", nextResourceProvider.getResourceType().getSimpleName());
}
setResourceProviders(beans);
IFhirSystemDao systemDao = myAppCtx.getBean(IFhirSystemDao.class);
JpaSystemProvider sp = new JpaSystemProvider(systemDao);
setPlainProviders(sp);
setPlainProviders(systemProvider);
String implDesc = getInitParameter("ImplementationDescription");

View File

@ -16,9 +16,6 @@
<bean id="myDaoConfig" class="ca.uhn.fhir.jpa.dao.DaoConfig">
</bean>
<bean id="mySystemDao" class="ca.uhn.fhir.jpa.dao.FhirSystemDao">
</bean>
<bean id="myTxManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="myEntityManagerFactory" />
</bean>