Permalink
Browse files

Add repro project for SPR-8625 as attached to JIRA

Maven build fails on dependency resolution. Reporter has been asked to
address this.
  • Loading branch information...
1 parent a27a381 commit b5326ccd647c3a1976cda9a1f9b615a13a985745 @cbeams cbeams committed Nov 18, 2011
View
@@ -2,6 +2,7 @@
.project
.settings
.springBeans
+.idea
target
*.sw?
.gradle
View
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.springframework.issues</groupId>
+ <artifactId>SPR-8625</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.openehealth.ipf.platform-camel</groupId>
+ <artifactId>platform-camel-hl7</artifactId>
+ <version>2.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jetty</artifactId>
+ <version>2.6.0</version>
+ </dependency>
+ <dependency>
+ <groupId>ca.uhn.hapi</groupId>
+ <artifactId>hapi-structures-v22</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>ca.uhn.hapi</groupId>
+ <artifactId>hapi-structures-v25</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>3.0.5.RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/bin.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.groovy.maven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generateStubs</goal>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <repositories>
+ <repository>
+ <id>openehealth.releases</id>
+ <name>Open eHealth Maven Repository</name>
+ <url>http://repo.openehealth.org/maven2/releases</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>openehealth.snapshots</id>
+ <name>Open eHealth Maven Repository</name>
+ <url>http://repo.openehealth.org/maven2/snapshots</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>java.net</id>
+ <name>java.net Maven Repository</name>
+ <url>http://download.java.net/maven/2/</url>
+ </repository>
+ <repository>
+ <id>codehaus</id>
+ <name>Codehaus Maven Repository</name>
+ <url>http://repository.codehaus.org</url>
+ </repository>
+ <repository>
+ <id>hapi-sf</id>
+ <name>HAPI Sourceforge Repository</name>
+ <url>http://hl7api.sourceforge.net/m2</url>
+ </repository>
+ </repositories>
+</project>
@@ -0,0 +1,42 @@
+<!--
+ Copyright 2008 the original author or authors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<assembly>
+ <id>bin</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <fileSets>
+ <fileSet>
+ <includes>
+ <include>startup*</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>src/test/resources</directory>
+ <outputDirectory>conf</outputDirectory>
+ <includes>
+ <include>log4j.xml</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>lib</outputDirectory>
+ <scope>runtime</scope>
+ </dependencySet>
+ </dependencySets>
+</assembly>
@@ -0,0 +1,14 @@
+package org.openehealth.tutorial
+
+import org.apache.camel.model.ProcessorDefinition
+class SampleModelExtension {
+
+ static extensions = {
+
+ ProcessorDefinition.metaClass.reverse = {
+ delegate.transmogrify { it.reverse() }
+ }
+
+ }
+
+}
@@ -0,0 +1,32 @@
+package org.openehealth.tutorial
+
+import ca.uhn.hl7v2.validation.ValidationContext
+
+import org.apache.camel.Exchange
+import org.apache.camel.spring.SpringRouteBuilder
+
+class SampleRouteBuilder extends SpringRouteBuilder {
+
+ void configure() {
+ from('jetty:http://localhost:8080/tutorial') // start HTTP server
+ .to('direct:input') // forward request
+
+ from('direct:input') // receive HL7 message
+ .unmarshal().ghl7() // create message adapter (HL7 DSL support)
+ .validate().ghl7()
+ .profile(lookup(ValidationContext.class)) // validate against custom validation context
+ .transmogrify { msg ->
+ msg.PV1[3][2] = '' // clear room nr.
+ msg.PV1[3][3] = '' // clear bed nr.
+ msg.PID[7][1] = msg.PID[7][1].value.substring(0, 8) // format birth date
+ msg.PID[8] = msg.PID[8].mapGender() // map 'gender' code
+ msg // return result
+ }
+ .setHeader(Exchange.FILE_NAME) {exchange -> // set filename header to
+ exchange.in.body.MSH[4].value + '.hl7' // sending facility (MSH[4])
+ }
+ .marshal().ghl7() // convert to external representation
+ .to('file:target/output') // write external representation to file
+ }
+
+}
@@ -0,0 +1,29 @@
+package org.openehealth.tutorial
+
+import ca.uhn.hl7v2.validation.ValidationContext
+
+import org.openehealth.ipf.modules.hl7.validation.builder.RuleBuilder
+import org.openehealth.ipf.modules.hl7.validation.builder.ValidationContextBuilder
+
+class SampleRulesBuilder extends ValidationContextBuilder {
+
+ // We define only a subset of the segments defined in the HL7 2.2 spec
+
+ public RuleBuilder forContext(ValidationContext context) {
+ new RuleBuilder(context)
+ .forVersion('2.2')
+ .message('ADT', 'A01').abstractSyntax(
+ 'MSH',
+ 'EVN',
+ 'PID',
+ [ { 'NK1' } ],
+ 'PV1',
+ [ { INSURANCE(
+ 'IN1',
+ [ 'IN2' ] ,
+ [ 'IN3' ]
+ )}]
+ )
+ }
+
+}
@@ -0,0 +1,11 @@
+package org.openehealth.tutorial;
+
+import org.apache.camel.spring.Main;
+
+public class SampleServer {
+
+ public static void main(String[] args) throws Exception {
+ Main.main("-ac", "/context.xml");
+ }
+
+}
@@ -0,0 +1,34 @@
+
+
+import ca.uhn.hl7v2.validation.ValidationContext
+
+import org.apache.camel.Exchange
+import org.apache.camel.spring.SpringRouteBuilder
+import org.openehealth.ipf.platform.camel.core.extend.RouteModelExtender
+
+class DynamicGroovyRouteBuilder extends SpringRouteBuilder {
+ RouteModelExtender routeModelExtender;
+
+ void configure() {
+ from('jetty:http://localhost:8080/tutorial') // start HTTP server
+ .to('direct:input') // forward request
+
+ from('direct:input') // receive HL7 message
+ .unmarshal().ghl7() // create message adapter (HL7 DSL support)
+ .validate().ghl7()
+ .profile(lookup(ValidationContext.class)) // validate against custom validation context
+ .transmogrify { msg ->
+ msg.PV1[3][2] = '' // clear room nr.
+ msg.PV1[3][3] = '' // clear bed nr.
+ msg.PID[7][1] = msg.PID[7][1].value.substring(0, 8) // format birth date
+ msg.PID[8] = msg.PID[8].mapGender() // map 'gender' code
+ msg // return result
+ }
+ .setHeader(Exchange.FILE_NAME) {exchange -> // set filename header to
+ exchange.in.body.MSH[4].value + '.hl7' // sending facility (MSH[4])
+ }
+ .marshal().ghl7() // convert to external representation
+ .to('file:target/output') // write external representation to file
+ }
+
+}
@@ -0,0 +1,72 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:lang="http://www.springframework.org/schema/lang"
+ xmlns:camel="http://camel.apache.org/schema/spring"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans
+http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+http://www.springframework.org/schema/lang
+http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
+http://camel.apache.org/schema/spring
+http://camel.apache.org/schema/spring/camel-spring.xsd">
+
+ <camel:camelContext id="camelContext">
+ <camel:routeBuilder ref="routeBuilder"/>
+ </camel:camelContext>
+
+ <bean id="routeBuilder" depends-on="routeModelExtender"
+ class="org.openehealth.tutorial.SampleRouteBuilder">
+ </bean>
+
+ <!-- Code mapping service using map.groovy as mapping table -->
+ <bean id="mappingService"
+ class="org.openehealth.ipf.commons.map.BidiMappingService">
+ <property name="mappingScript" value="classpath:map.groovy"/>
+ </bean>
+
+ <!-- DSL extensions provided by platform-camel-core -->
+ <bean id="coreModelExtension"
+ class="org.openehealth.ipf.platform.camel.core.extend.CoreModelExtension">
+ </bean>
+
+ <!-- DSL extensions provided by platform-camel-hl7 -->
+ <bean id="hl7ModelExtension"
+ class="org.openehealth.ipf.platform.camel.hl7.extend.Hl7ModelExtension"/>
+
+ <!-- HAPI extensions provided by modules-hl7 -->
+ <bean id="hapiModelExtension"
+ class="org.openehealth.ipf.modules.hl7.extend.HapiModelExtension">
+ <property name="mappingService" ref="mappingService" />
+ </bean>
+
+ <bean id="mappingExtension"
+ class="org.openehealth.ipf.commons.map.extend.MappingExtension">
+ <property name="mappingService" ref="mappingService" />
+ </bean>
+
+ <bean id="routeModelExtender"
+ class="org.openehealth.ipf.platform.camel.core.extend.DefaultModelExtender">
+ <property name="routeModelExtensions">
+ <list>
+ <ref bean="coreModelExtension" /> <!-- Register core DSL extensions -->
+ <ref bean="hl7ModelExtension" /> <!-- Register HL7 DSL extensions -->
+ <ref bean="hapiModelExtension" /> <!-- Register HAPI extensions -->
+ <ref bean="mappingExtension" /> <!-- Register mapping extensions -->
+ </list>
+ </property>
+ </bean>
+
+ <!-- All we need for validation: a validator, a validation context, -->
+ <!-- and two set of rules -->
+ <bean id="myValidatorBean" class="org.openehealth.ipf.modules.hl7.validation.support.HL7Validator"/>
+
+ <bean id="validationContext"
+ class="org.openehealth.ipf.modules.hl7.validation.ValidationContextFactoryBean"/>
+
+ <bean id="defaultTypeRules"
+ class="org.openehealth.ipf.modules.hl7.validation.builder.DefaultTypeRulesBuilder"/>
+
+ <bean id="myCustomRules"
+ class="org.openehealth.tutorial.SampleRulesBuilder"/>
+
+</beans>
Oops, something went wrong.

0 comments on commit b5326cc

Please sign in to comment.