From e2b9b3318dbaa4cd73b00d343046b0529bf15216 Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Mon, 11 Aug 2014 09:09:01 -0400 Subject: [PATCH] Add OperationOutcome narrative template --- hapi-fhir-base/pom.xml | 2 + hapi-fhir-base/src/changes/changes.xml | 3 + .../BaseThymeleafNarrativeGenerator.java | 43 +- .../uhn/fhir/narrative/OperationOutcome.html | 22 + .../uhn/fhir/narrative/narratives.properties | 4 + .../narrative/title/OperationOutcome.html | 5 + ...efaultThymeleafNarrativeGeneratorTest.java | 55 +- .../ca/uhn/fhir/rest/server/CorsTest.java | 1 - .../org.eclipse.wst.common.component | 2 +- hapi-fhir-mitreid-integration/.classpath | 26 + hapi-fhir-mitreid-integration/.gitignore | 1 + hapi-fhir-mitreid-integration/.project | 23 + .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.jdt.core.prefs | 5 + .../.settings/org.eclipse.m2e.core.prefs | 4 + hapi-fhir-mitreid-integration/pom.xml | 528 ++++++++++++++++++ ...enIdConnectBearerTokenSecurityManager.java | 0 ...ConnectBearerTokenSecurityManagerTest.java | 0 .../RestAuthenticationEntryPoint.java | 0 hapi-fhir-testpage-overlay/.classpath | 209 ++++++- hapi-fhir-testpage-overlay/.project | 56 +- .../.settings/org.eclipse.jdt.core.prefs | 9 +- .../org.eclipse.wst.common.component | 1 - ....eclipse.wst.common.project.facet.core.xml | 7 - hapi-fhir-testpage-overlay/pom.xml | 28 +- .../main/webapp/js/ClientCodeGeneratorHapi.js | 4 + .../src/main/webapp/js/RestfulTester.js | 25 +- .../ca/uhn/fhir/jpa/test/OverlayTestApp.java | 11 +- .../java/ca/uhn/fhir/jpa/test/WebUiTest_.java | 224 ++++++++ .../org.eclipse.wst.common.component | 2 +- 30 files changed, 1173 insertions(+), 129 deletions(-) create mode 100644 hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/OperationOutcome.html create mode 100644 hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/title/OperationOutcome.html create mode 100644 hapi-fhir-mitreid-integration/.classpath create mode 100644 hapi-fhir-mitreid-integration/.gitignore create mode 100644 hapi-fhir-mitreid-integration/.project create mode 100644 hapi-fhir-mitreid-integration/.settings/org.eclipse.core.resources.prefs create mode 100644 hapi-fhir-mitreid-integration/.settings/org.eclipse.jdt.core.prefs create mode 100644 hapi-fhir-mitreid-integration/.settings/org.eclipse.m2e.core.prefs create mode 100644 hapi-fhir-mitreid-integration/pom.xml rename {hapi-fhir-base => hapi-fhir-mitreid-integration}/src/main/java/ca/uhn/fhir/rest/server/security/OpenIdConnectBearerTokenSecurityManager.java (100%) rename {hapi-fhir-base => hapi-fhir-mitreid-integration}/src/test/java/ca/uhn/fhir/rest/server/security/OpenIdConnectBearerTokenSecurityManagerTest.java (100%) rename {hapi-fhir-base => hapi-fhir-mitreid-integration}/src/test/java/ca/uhn/fhir/rest/server/security/RestAuthenticationEntryPoint.java (100%) delete mode 100644 hapi-fhir-testpage-overlay/.settings/org.eclipse.wst.common.component delete mode 100644 hapi-fhir-testpage-overlay/.settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 hapi-fhir-testpage-overlay/src/test/java/ca/uhn/fhir/jpa/test/WebUiTest_.java diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml index 86510343f36..afe6e3876a7 100644 --- a/hapi-fhir-base/pom.xml +++ b/hapi-fhir-base/pom.xml @@ -47,6 +47,7 @@ + diff --git a/hapi-fhir-base/src/changes/changes.xml b/hapi-fhir-base/src/changes/changes.xml index 44d34c9bf2a..fcbbfb29031 100644 --- a/hapi-fhir-base/src/changes/changes.xml +++ b/hapi-fhir-base/src/changes/changes.xml @@ -64,6 +64,9 @@ bundle (generally these are referenced resources, so they are populated in the reference fields instead). Thanks to Tahura Chaudhry of University Health Network for the unit test! + + Added narrative generator template for OperationOutcome resource + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/BaseThymeleafNarrativeGenerator.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/BaseThymeleafNarrativeGenerator.java index c823b6b775f..95bf7531148 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/BaseThymeleafNarrativeGenerator.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/narrative/BaseThymeleafNarrativeGenerator.java @@ -301,9 +301,11 @@ public abstract class BaseThymeleafNarrativeGenerator implements INarrativeGener } /** - * If set to true (which is the default), most whitespace will be trimmed from the generated narrative before it is returned. + * If set to true (which is the default), most whitespace will be trimmed from the generated narrative + * before it is returned. *

- * Note that in order to preserve formatting, not all whitespace is trimmed. Repeated whitespace characters (e.g. "\n \n ") will be trimmed to a single space. + * Note that in order to preserve formatting, not all whitespace is trimmed. Repeated whitespace characters (e.g. + * "\n \n ") will be trimmed to a single space. *

*/ public boolean isCleanWhitespace() { @@ -311,8 +313,9 @@ public abstract class BaseThymeleafNarrativeGenerator implements INarrativeGener } /** - * If set to true, which is the default, if any failure occurs during narrative generation the generator will suppress any generated exceptions, and simply return a default narrative - * indicating that no narrative is available. + * If set to true, which is the default, if any failure occurs during narrative generation the + * generator will suppress any generated exceptions, and simply return a default narrative indicating that no + * narrative is available. */ public boolean isIgnoreFailures() { return myIgnoreFailures; @@ -429,9 +432,11 @@ public abstract class BaseThymeleafNarrativeGenerator implements INarrativeGener } /** - * If set to true (which is the default), most whitespace will be trimmed from the generated narrative before it is returned. + * If set to true (which is the default), most whitespace will be trimmed from the generated narrative + * before it is returned. *

- * Note that in order to preserve formatting, not all whitespace is trimmed. Repeated whitespace characters (e.g. "\n \n ") will be trimmed to a single space. + * Note that in order to preserve formatting, not all whitespace is trimmed. Repeated whitespace characters (e.g. + * "\n \n ") will be trimmed to a single space. *

*/ public void setCleanWhitespace(boolean theCleanWhitespace) { @@ -439,8 +444,9 @@ public abstract class BaseThymeleafNarrativeGenerator implements INarrativeGener } /** - * If set to true, which is the default, if any failure occurs during narrative generation the generator will suppress any generated exceptions, and simply return a default narrative - * indicating that no narrative is available. + * If set to true, which is the default, if any failure occurs during narrative generation the + * generator will suppress any generated exceptions, and simply return a default narrative indicating that no + * narrative is available. */ public void setIgnoreFailures(boolean theIgnoreFailures) { myIgnoreFailures = theIgnoreFailures; @@ -458,9 +464,13 @@ public abstract class BaseThymeleafNarrativeGenerator implements INarrativeGener boolean inWhitespace = false; boolean betweenTags = false; boolean lastNonWhitespaceCharWasTagEnd = false; + boolean inPre = false; for (int i = 0; i < theResult.length(); i++) { char nextChar = theResult.charAt(i); - if (nextChar == '>') { + if (inPre) { + b.append(nextChar); + continue; + } else if (nextChar == '>') { b.append(nextChar); betweenTags = true; lastNonWhitespaceCharWasTagEnd = true; @@ -485,6 +495,17 @@ public abstract class BaseThymeleafNarrativeGenerator implements INarrativeGener inWhitespace = false; betweenTags = false; lastNonWhitespaceCharWasTagEnd = false; + if (i + 3 < theResult.length()) { + char char1 = Character.toLowerCase(theResult.charAt(i + 1)); + char char2 = Character.toLowerCase(theResult.charAt(i + 2)); + char char3 = Character.toLowerCase(theResult.charAt(i + 3)); + char char4 = Character.toLowerCase((i + 4 < theResult.length()) ? theResult.charAt(i + 4) : ' '); + if (char1 == 'p' && char2 == 'r' && char3 == 'e') { + inPre = true; + } else if (char1 == '/' && char2 == 'p' && char3 == 'r'&&char4=='e') { + inPre = false; + } + } } else { lastNonWhitespaceCharWasTagEnd = false; if (inWhitespace) { @@ -520,7 +541,7 @@ public abstract class BaseThymeleafNarrativeGenerator implements INarrativeGener final IStandardExpression expression = expressionParser.parseExpression(configuration, theArguments, attributeValue); final Object value = expression.execute(configuration, theArguments); - + theElement.removeAttribute(theAttributeName); theElement.clearChildren(); @@ -539,7 +560,7 @@ public abstract class BaseThymeleafNarrativeGenerator implements INarrativeGener nextClass = nextClass.getSuperclass(); } while (name == null && nextClass.equals(Object.class) == false); } - + if (name == null) { if (myIgnoreMissingTemplates) { ourLog.debug("No narrative template available for type: {}", value.getClass()); diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/OperationOutcome.html b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/OperationOutcome.html new file mode 100644 index 00000000000..4c11c044df9 --- /dev/null +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/OperationOutcome.html @@ -0,0 +1,22 @@ + + + + + + + +
+

Operation Outcome

+ + + + + + +
+
+ + + + + diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/narratives.properties b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/narratives.properties index dedb24ab88c..ca7b7dacb44 100644 --- a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/narratives.properties +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/narratives.properties @@ -49,6 +49,10 @@ diagnosticreport.title=classpath:ca/uhn/fhir/narrative/title/DiagnosticReport.ht encounter.class=ca.uhn.fhir.model.dstu.resource.Encounter encounter.title=classpath:ca/uhn/fhir/narrative/title/Encounter.html +operationoutcome.class=ca.uhn.fhir.model.dstu.resource.OperationOutcome +operationoutcome.title=classpath:ca/uhn/fhir/narrative/title/OperationOutcome.html +operationoutcome.narrative=classpath:ca/uhn/fhir/narrative/OperationOutcome.html + organization.class=ca.uhn.fhir.model.dstu.resource.Organization organization.title=classpath:ca/uhn/fhir/narrative/title/Organization.html diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/title/OperationOutcome.html b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/title/OperationOutcome.html new file mode 100644 index 00000000000..ecbadfc6b42 --- /dev/null +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/title/OperationOutcome.html @@ -0,0 +1,5 @@ +
+ Operation Outcome + + +
\ No newline at end of file diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorTest.java index 493258f0af8..19683c9edc1 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/narrative/DefaultThymeleafNarrativeGeneratorTest.java @@ -20,11 +20,13 @@ import ca.uhn.fhir.model.dstu.resource.Conformance; import ca.uhn.fhir.model.dstu.resource.DiagnosticReport; import ca.uhn.fhir.model.dstu.resource.Encounter; import ca.uhn.fhir.model.dstu.resource.Observation; +import ca.uhn.fhir.model.dstu.resource.OperationOutcome; import ca.uhn.fhir.model.dstu.resource.Organization; import ca.uhn.fhir.model.dstu.resource.Patient; import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum; import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.model.primitive.StringDt; @@ -41,14 +43,11 @@ public class DefaultThymeleafNarrativeGeneratorTest { gen.setUseHapiServerConformanceNarrative(true); gen.setIgnoreFailures(false); gen.setIgnoreMissingTemplates(false); - - myCtx=new FhirContext(); + + myCtx = new FhirContext(); myCtx.setNarrativeGenerator(gen); } - - - @Test public void testGeneratePatient() throws DataFormatException { Patient value = new Patient(); @@ -62,7 +61,7 @@ public class DefaultThymeleafNarrativeGeneratorTest { String output = gen.generateNarrative(value).getDiv().getValueAsString(); assertThat(output, StringContains.containsString("
joe john BLOW
")); - + String title = gen.generateTitle(value); assertEquals("joe john BLOW (123456)", title); ourLog.info(title); @@ -74,7 +73,6 @@ public class DefaultThymeleafNarrativeGeneratorTest { } - @Test public void testGenerateEncounter() throws DataFormatException { Encounter enc = new Encounter(); @@ -97,24 +95,22 @@ public class DefaultThymeleafNarrativeGeneratorTest { enc.addIdentifier("urn:visits", "1234567"); enc.setName("Some Test Org"); enc.addAddress().addLine("123 Fake St").setCity("Toronto").setState("ON").setCountry("Canada").setZip("12345"); - + String title = gen.generateTitle(enc); assertEquals("Some Test Org", title); ourLog.info(title); } - @Test public void testGenerateServerConformance() throws DataFormatException { Conformance value = myCtx.newXmlParser().parseResource(Conformance.class, new InputStreamReader(getClass().getResourceAsStream("/server-conformance-statement.xml"))); - + String output = gen.generateNarrative(value).getDiv().getValueAsString(); ourLog.info(output); } - @Test public void testGenerateDiagnosticReport() throws DataFormatException { DiagnosticReport value = new DiagnosticReport(); @@ -127,7 +123,39 @@ public class DefaultThymeleafNarrativeGeneratorTest { String output = gen.generateNarrative("http://hl7.org/fhir/profiles/DiagnosticReport", value).getDiv().getValueAsString(); ourLog.info(output); - assertThat(output,StringContains.containsString(value.getName().getText().getValue())); + assertThat(output, StringContains.containsString(value.getName().getText().getValue())); + } + + @Test + public void testGenerateOperationOutcome() { + //@formatter:off + String parse = "\n" + + " \n" + + " \n" + + "
\n" + + " \n" + + " \n" + + " \n" + + "
\n" + + " \n" + + ""; + //@formatter:on + + OperationOutcome oo = myCtx.newXmlParser().parseResource(OperationOutcome.class, parse); + +// String output = gen.generateTitle(oo); +// ourLog.info(output); +// assertEquals("Operation Outcome (2 issues)", output); + + String nar = gen.generateNarrative(null, oo).getDiv().getValueAsString(); + ourLog.info(nar); + +// oo = new OperationOutcome(); +// oo.addIssue().setSeverity(IssueSeverityEnum.FATAL).setDetails("AA"); +// output = gen.generateTitle(oo); +// ourLog.info(output); +// assertEquals("Operation Outcome (fatal)", output); + } @Test @@ -166,10 +194,9 @@ public class DefaultThymeleafNarrativeGeneratorTest { assertThat(output, StringContains.containsString("
Some & Diagnostic Report
")); String title = gen.generateTitle(value); -// ourLog.info(title); + // ourLog.info(title); assertEquals("Some & Diagnostic Report - final - 3 observations", title); - // Now try it with the parser output = myCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(value); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CorsTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CorsTest.java index 3726ce2c2fb..2085cb713a7 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CorsTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/CorsTest.java @@ -115,7 +115,6 @@ public class CorsTest { IOUtils.closeQuietly(status.getEntity().getContent()); ourLog.info("Response: {}", status); ourLog.info("Response was:\n{}", responseContent); - assertEquals("POST", status.getFirstHeader(Constants.HEADER_CORS_ALLOW_METHODS).getValue()); assertEquals("http://www.fhir-starter.com", status.getFirstHeader(Constants.HEADER_CORS_ALLOW_ORIGIN).getValue()); } } finally { diff --git a/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.wst.common.component b/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.wst.common.component index c94187882b4..ee477891317 100644 --- a/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.wst.common.component +++ b/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.wst.common.component @@ -12,7 +12,7 @@ uses - + consumes diff --git a/hapi-fhir-mitreid-integration/.classpath b/hapi-fhir-mitreid-integration/.classpath new file mode 100644 index 00000000000..fd7ad7fbda7 --- /dev/null +++ b/hapi-fhir-mitreid-integration/.classpath @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hapi-fhir-mitreid-integration/.gitignore b/hapi-fhir-mitreid-integration/.gitignore new file mode 100644 index 00000000000..b83d22266ac --- /dev/null +++ b/hapi-fhir-mitreid-integration/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/hapi-fhir-mitreid-integration/.project b/hapi-fhir-mitreid-integration/.project new file mode 100644 index 00000000000..cda5bf3d6e4 --- /dev/null +++ b/hapi-fhir-mitreid-integration/.project @@ -0,0 +1,23 @@ + + + hapi-fhir-mitreid-integration + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/hapi-fhir-mitreid-integration/.settings/org.eclipse.core.resources.prefs b/hapi-fhir-mitreid-integration/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..99f26c0203a --- /dev/null +++ b/hapi-fhir-mitreid-integration/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/hapi-fhir-mitreid-integration/.settings/org.eclipse.jdt.core.prefs b/hapi-fhir-mitreid-integration/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..60105c1b951 --- /dev/null +++ b/hapi-fhir-mitreid-integration/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/hapi-fhir-mitreid-integration/.settings/org.eclipse.m2e.core.prefs b/hapi-fhir-mitreid-integration/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/hapi-fhir-mitreid-integration/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/hapi-fhir-mitreid-integration/pom.xml b/hapi-fhir-mitreid-integration/pom.xml new file mode 100644 index 00000000000..c9fbc43d4bd --- /dev/null +++ b/hapi-fhir-mitreid-integration/pom.xml @@ -0,0 +1,528 @@ + + 4.0.0 + + + ca.uhn.hapi.fhir + hapi-fhir + 0.6-SNAPSHOT + ../pom.xml + + + ca.uhn.hapi.fhir + hapi-fhir-mitreid-integration + jar + HAPI FHIR - MitreID Integration Module + + + + + ca.uhn.hapi.fhir + hapi-fhir-base + 0.6-SNAPSHOT + + + + + org.mitre + openid-connect-client + ${mitreid-connect-version} + + + org.springframework.security.oauth + spring-security-oauth2 + 2.0.2.RELEASE + + + + + javax.servlet + javax.servlet-api + 3.1.0 + provided + + + + + junit + junit + ${junit_version} + test + + + xmlunit + xmlunit + 1.5 + test + + + org.eclipse.jetty + jetty-servlets + 9.1.1.v20140108 + test + + + org.eclipse.jetty + jetty-servlet + 9.1.1.v20140108 + test + + + org.eclipse.jetty + jetty-server + 9.1.1.v20140108 + test + + + org.eclipse.jetty + jetty-servlet + 9.1.1.v20140108 + test + + + org.eclipse.jetty + jetty-util + 9.1.1.v20140108 + test + + + org.eclipse.jetty + jetty-webapp + 9.1.1.v20140108 + test + + + + + org.mockito + mockito-all + 1.9.5 + test + + + org.hamcrest + hamcrest-all + ${hamcrest_version} + test + + + + + + + + + + org.apache.maven.plugins + maven-changes-plugin + 2.10 + false + + + + changes-report + + + + + atom_1.0 + + http://sourceforge.net/support/tracker.php?aid=%ISSUE% + https://sourceforge.net/p/hl7api/bugs/%ISSUE%/ + https://sourceforge.net/p/hl7api/feature-requests/%ISSUE%/ + + false + + + + org.apache.maven.plugins + maven-surefire-report-plugin + 2.16 + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + + + + default + + javadoc + + + + + + org.codehaus.mojo + findbugs-maven-plugin + 2.5.3 + + + org.apache.maven.plugins + maven-jxr-plugin + 2.4 + + + normal + + jxr + + + + restful-server-example + + jxr + + + ../restful-server-example/src/main/java + ${project.reporting.outputDirectory}/rse-xref + tmp + rse-xref + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 2.7 + + + + project-team + issue-tracking + license + scm + + + + + + + + + + UTF-8 + ${user.home}/sites/hapi-fhir + ${user.home}/sites/scm/hapi-fhir + + + + + + + maven-site-plugin + + false + true + + + + org.apache.maven.wagon + wagon-scm + 2.2 + + + org.apache.maven.scm + maven-scm-manager-plexus + 1.9 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.9 + + + org.apache.maven.scm + maven-scm-api + 1.9 + + + + + + + + maven-antrun-plugin + 1.7 + + + addSyntaxHighlighter + site + + run + + + + Adding Syntax Highlighter + + + ]]> + + var elements = document.getElementsByClassName("source"); + for (var i=0; i < elements.length; i++) { + var pres = elements[i].getElementsByTagName("pre"); + for (var j = 0; j < pres.length; j++) { + var pre = pres[j]; + if (pre.innerHTML.match(/\/\*/)) { + pre.className = 'brush: java'; + } else if (pre.innerHTML.match(/^\/\//)) { + pre.className = 'brush: java'; + } else if (pre.innerHTML.match(/^\{/)) { + pre.className = 'brush: jscript'; + } else if (pre.innerHTML.match(/^\#/)) { + pre.className = 'brush: bash'; + } else if (pre.innerHTML.match(/\<\;\//)) { + pre.className = 'brush: xml'; + } else { + pre.className = 'brush: java'; + } + } + } + + SyntaxHighlighter.all(); + + + ]]> + + + + + + addAnalytics + post-site + + + Adding Google analytics in target/site for <body> + + + + + ]]> + + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-1395874-5', 'auto'); + ga('require', 'displayfeatures'); + ga('require', 'linkid', 'linkid.js'); + ga('send', 'pageview'); + + + + ]]> + + Adding Google analytics in target/site for <BODY> + + + ]]> + + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + ga('create', 'UA-1395874-5', 'auto'); + ga('require', 'displayfeatures'); + ga('require', 'linkid', 'linkid.js'); + ga('send', 'pageview'); + + + + ]]> + + Adding social plugins for HAPI + + + + +
+
+ + +

+ + +

+ + ]]>
+
+ + +
+
+ + run + +
+
+
+ + maven-site-plugin + + + stage-for-scm-publish + post-site + + stage + + + ${siteMainDirectory} + + + + + + org.apache.maven.plugins + maven-scm-publish-plugin + 1.1 + + ${scmPubCheckoutDirectory} + \${siteMainDirectory} + true + gh-pages + scm:git:git@github.com:jamesagnew/hapi-fhir.git + + + + scm-publish + site-deploy + + publish-scm + + + + +
+ + + src/main/resources + true + + + +
+ + + + DIST + + + + org.apache.maven.plugins + maven-javadoc-plugin + true + + 128m + 1g + true + false + false + + + + package + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + + + package + + jar-no-fork + + + + + + maven-assembly-plugin + 2.4 + + + package + + single + + + false + + ${project.basedir}/src/assembly/hapi-fhir-all.xml + + + + + + + + org.codehaus.mojo + license-maven-plugin + + + first + + update-file-header + + process-sources + + apache_v2 + true + true + + src/main/java + + + + + + + + + + +
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/security/OpenIdConnectBearerTokenSecurityManager.java b/hapi-fhir-mitreid-integration/src/main/java/ca/uhn/fhir/rest/server/security/OpenIdConnectBearerTokenSecurityManager.java similarity index 100% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/security/OpenIdConnectBearerTokenSecurityManager.java rename to hapi-fhir-mitreid-integration/src/main/java/ca/uhn/fhir/rest/server/security/OpenIdConnectBearerTokenSecurityManager.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/security/OpenIdConnectBearerTokenSecurityManagerTest.java b/hapi-fhir-mitreid-integration/src/test/java/ca/uhn/fhir/rest/server/security/OpenIdConnectBearerTokenSecurityManagerTest.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/security/OpenIdConnectBearerTokenSecurityManagerTest.java rename to hapi-fhir-mitreid-integration/src/test/java/ca/uhn/fhir/rest/server/security/OpenIdConnectBearerTokenSecurityManagerTest.java diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/security/RestAuthenticationEntryPoint.java b/hapi-fhir-mitreid-integration/src/test/java/ca/uhn/fhir/rest/server/security/RestAuthenticationEntryPoint.java similarity index 100% rename from hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/security/RestAuthenticationEntryPoint.java rename to hapi-fhir-mitreid-integration/src/test/java/ca/uhn/fhir/rest/server/security/RestAuthenticationEntryPoint.java diff --git a/hapi-fhir-testpage-overlay/.classpath b/hapi-fhir-testpage-overlay/.classpath index f9355c7897b..97ac003ddee 100644 --- a/hapi-fhir-testpage-overlay/.classpath +++ b/hapi-fhir-testpage-overlay/.classpath @@ -1,31 +1,180 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hapi-fhir-testpage-overlay/.project b/hapi-fhir-testpage-overlay/.project index adf73f36dcc..b44d8276004 100644 --- a/hapi-fhir-testpage-overlay/.project +++ b/hapi-fhir-testpage-overlay/.project @@ -1,42 +1,16 @@ - - hapi-fhir-tester-overlay - - - - - - org.eclipse.wst.jsdt.core.javascriptValidator - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.wst.validation.validationbuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jem.workbench.JavaEMFNature - org.eclipse.wst.common.modulecore.ModuleCoreNature - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.wst.jsdt.core.jsNature - - + hapi-fhir-testpage-overlay + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + hapi-fhir-jpaserver-base + hapi-fhir-jpaserver-test + + + + org.eclipse.jdt.core.javabuilder + + + + org.eclipse.jdt.core.javanature + + \ No newline at end of file diff --git a/hapi-fhir-testpage-overlay/.settings/org.eclipse.jdt.core.prefs b/hapi-fhir-testpage-overlay/.settings/org.eclipse.jdt.core.prefs index 69c31cd493c..3f9a1773abb 100644 --- a/hapi-fhir-testpage-overlay/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-fhir-testpage-overlay/.settings/org.eclipse.jdt.core.prefs @@ -1,8 +1,5 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +#Sun Aug 10 11:41:00 EDT 2014 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 diff --git a/hapi-fhir-testpage-overlay/.settings/org.eclipse.wst.common.component b/hapi-fhir-testpage-overlay/.settings/org.eclipse.wst.common.component deleted file mode 100644 index bcc91bc3266..00000000000 --- a/hapi-fhir-testpage-overlay/.settings/org.eclipse.wst.common.component +++ /dev/null @@ -1 +0,0 @@ - diff --git a/hapi-fhir-testpage-overlay/.settings/org.eclipse.wst.common.project.facet.core.xml b/hapi-fhir-testpage-overlay/.settings/org.eclipse.wst.common.project.facet.core.xml deleted file mode 100644 index 9f1491f6f6a..00000000000 --- a/hapi-fhir-testpage-overlay/.settings/org.eclipse.wst.common.project.facet.core.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/hapi-fhir-testpage-overlay/pom.xml b/hapi-fhir-testpage-overlay/pom.xml index c1184e6c4c4..b13ede1b425 100644 --- a/hapi-fhir-testpage-overlay/pom.xml +++ b/hapi-fhir-testpage-overlay/pom.xml @@ -1,5 +1,4 @@ - + 4.0.0 @@ -14,6 +13,16 @@ HAPI FHIR TestPage Overlay + + + oss-snapshots + + true + + https://oss.sonatype.org/content/repositories/snapshots/ + + + ca.uhn.hapi.fhir @@ -63,6 +72,12 @@ ${hamcrest_version} test + + net.sourceforge.htmlunit + htmlunit + 2.16-SNAPSHOT + test + @@ -79,8 +94,7 @@ ${derby_version} test - + @@ -200,11 +214,9 @@ - + - + diff --git a/hapi-fhir-testpage-overlay/src/main/webapp/js/ClientCodeGeneratorHapi.js b/hapi-fhir-testpage-overlay/src/main/webapp/js/ClientCodeGeneratorHapi.js index 647513eb45b..baeff1ef1d1 100644 --- a/hapi-fhir-testpage-overlay/src/main/webapp/js/ClientCodeGeneratorHapi.js +++ b/hapi-fhir-testpage-overlay/src/main/webapp/js/ClientCodeGeneratorHapi.js @@ -34,6 +34,10 @@ function generateHapiSearch(json, container) { paramLine = '.where(new StringClientParam("' + nextParam.name + '")'; paramLine += nextParam.qualifier = ':exact' ? '.matchesExactly()' : '.matches()'; paramLine += '.value("' + nextParam.value + '"))'; + } else if (nextParam.type == 'id') { + paramLine = '.where(new StringClientParam("' + nextParam.name + '")'; + paramLine += '.matches()'; + paramLine += '.value("' + nextParam.value + '"))'; } else if (nextParam.type == 'token') { var idx = nextParam.value.indexOf('|'); if (idx == -1) { diff --git a/hapi-fhir-testpage-overlay/src/main/webapp/js/RestfulTester.js b/hapi-fhir-testpage-overlay/src/main/webapp/js/RestfulTester.js index cc40b019870..4bf2f6dd40e 100644 --- a/hapi-fhir-testpage-overlay/src/main/webapp/js/RestfulTester.js +++ b/hapi-fhir-testpage-overlay/src/main/webapp/js/RestfulTester.js @@ -63,7 +63,13 @@ function updateSearchDateQualifier(qualifierBtn, qualifierInput, qualifier) { function addSearchControls(theConformance, theSearchParamType, theSearchParamName, theSearchParamChain, theSearchParamTarget, theContainerRowNum, theRowNum) { var addNameAndType = true; - if (theSearchParamType == 'token') { + if (theSearchParamType == 'id') { + $('#search-param-rowopts-' + theContainerRowNum).append( + $('
', { 'class': 'col-sm-3' }).append( + $('', { id: 'param.' + theRowNum + '.0', placeholder: 'id', type: 'text', 'class': 'form-control' }) + ) + ); + } else if (theSearchParamType == 'token') { $('#search-param-rowopts-' + theContainerRowNum).append( $('
', { 'class': 'col-sm-3' }).append( $('', { id: 'param.' + theRowNum + '.0', placeholder: 'system/namespace', type: 'text', 'class': 'form-control' }) @@ -92,12 +98,12 @@ function addSearchControls(theConformance, theSearchParamType, theSearchParamNam var qualifierDropdown = $('
    ', {'class':'dropdown-menu', role:'menu'}); for (var i = 0; i < qualifiers.length; i++) { var nextLink = $('' + qualifiers[i].name+''); - var nextName = qualifiers[i].name; + var theSearchParamName = qualifiers[i].name; var nextValue = qualifiers[i].value; qualifierDropdown.append($('
  • ').append(nextLink)); nextLink.click(function(){ qualifierInput.val(nextValue); - matchesLabel.text(nextName); + matchesLabel.text(theSearchParamName); }); } @@ -173,6 +179,19 @@ function addSearchControls(theConformance, theSearchParamType, theSearchParamNam // ); var params = new Array(); + { + var param = new Object(); + param.type = 'id'; + param.chain = ''; + param.name = theSearchParamName; + param.documentation = 'The resource identity'; + param.target = new Array(); + params[theSearchParamName] = param; + select.append( + $('