Merge branch 'master' of ssh://git.code.sf.net/p/hl7api/fhircode
Conflicts: hapi-fhir-base/pom.xml
This commit is contained in:
commit
14b795ad68
|
@ -64,6 +64,16 @@
|
||||||
<version>4.2.3</version>
|
<version>4.2.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>log4j</groupId>
|
||||||
|
<artifactId>log4j</artifactId>
|
||||||
|
<version>1.2.17</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Testing -->
|
<!-- Testing -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -97,6 +107,33 @@
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-server</artifactId>
|
||||||
|
<version>9.1.1.v20140108</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-servlet</artifactId>
|
||||||
|
<version>9.1.1.v20140108</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-httpclient</groupId>
|
||||||
|
<artifactId>commons-httpclient</artifactId>
|
||||||
|
<version>3.1</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>directory-naming</groupId>
|
||||||
|
<artifactId>naming-java</artifactId>
|
||||||
|
<version>0.8</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -36,8 +36,8 @@ public class ResourceMethod {
|
||||||
this.resourceType = resourceType;
|
this.resourceType = resourceType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IResource getResourceType() throws IllegalAccessException, InstantiationException {
|
public Class getResourceType() throws IllegalAccessException, InstantiationException {
|
||||||
return (IResource)resourceType.newInstance();
|
return resourceType.getClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
public RequestType getRequestType() {
|
public RequestType getRequestType() {
|
||||||
|
|
|
@ -171,7 +171,7 @@ public class Service extends HttpServlet {
|
||||||
ResourceMethod resourceMethod = resource.getMethod(params.keySet());
|
ResourceMethod resourceMethod = resource.getMethod(params.keySet());
|
||||||
if (null == resourceMethod) throw new MethodNotFoundException("No resource method available for the supplied parameters " + params);
|
if (null == resourceMethod) throw new MethodNotFoundException("No resource method available for the supplied parameters " + params);
|
||||||
|
|
||||||
FhirContext ctx = new FhirContext(resourceMethod.getResourceType().getClass());
|
FhirContext ctx = new FhirContext(resourceMethod.getResourceType());
|
||||||
XmlParser p = new XmlParser(ctx);
|
XmlParser p = new XmlParser(ctx);
|
||||||
response.getWriter().write(p.encodeResourceToString(resourceMethod.invoke(params)));
|
response.getWriter().write(p.encodeResourceToString(resourceMethod.invoke(params)));
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
|
Loading…
Reference in New Issue