Skip to content

Commit

Permalink
make properties in camel-oai-pmh.properties available in the camel co…
Browse files Browse the repository at this point in the history
…ntext
  • Loading branch information
jvanzadelhoff committed Jul 17, 2020
1 parent 08505c7 commit c0674f1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
target
*.swp
build.properties
4 changes: 3 additions & 1 deletion build.properties.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ db.item.csw.TYPE=inspire
db.item.csw.URL=https://localhost:8080/soapServices/CSWStartup

db.item.ckan.TYPE=ckan
db.item.ckan.URL=https://localhost:9090
db.item.ckan.URL=https://localhost:9090

dcatde.contributorID=http:https://dcat-ap.de/def/contributors/gdiDE
2 changes: 1 addition & 1 deletion src/main/resources/camel-oai-pmh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ db.item.csw.TYPE=${db.item.csw.TYPE}
db.item.csw.URL=${db.item.csw.URL}
db.item.ckan.TYPE=${db.item.ckan.TYPE}
db.item.ckan.URL=${db.item.ckan.URL}
dcatde.contributorID=http:https://dcat-ap.de/def/contributors/gdiDE
dcatde.contributorID=${dcatde.contributorID}
15 changes: 11 additions & 4 deletions src/main/resources/camel-oai-pmh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
<!-- spring property placeholder -->
<context:property-placeholder location="classpath:camel-oai-pmh.properties"/>

<!-- spring camel bridge property placeholder -->
<bean id="propertyConfigurer" class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
<property name="location" value="classpath:camel-oai-pmh.properties"/>
<property name="ignoreResourceNotFound" value="true" />
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
</bean>

<!-- This configures HttpClient to trust all server certificates - there are several catalogs that use self-signed
certificates. Remove this bean from the configuration if you require trusted HTTPS connections! -->
<bean id="httpClientConfigurer" class="eu.odp.harvest.geo.oai.http.AllowAllHttpClientConfig"/>
Expand Down Expand Up @@ -174,7 +181,7 @@
<convertBodyTo type="java.lang.String"/>
<to uri="log:input"/>
<setHeader headerName="CamelHttpUri">
<simple>${db.item.csw.URL}</simple>
<simple>{{db.item.csw.URL}}</simple>
</setHeader>
<choice>
<when>
Expand Down Expand Up @@ -306,7 +313,7 @@
<route>
<from ref="csw"/>
<setHeader headerName="CamelHttpUri">
<simple>${db.item.csw.URL}</simple>
<simple>{{db.item.csw.URL}}</simple>
</setHeader>
<setHeader headerName="CamelHttpPath">
<constant/>
Expand All @@ -320,7 +327,7 @@
</when>
</choice>
<recipientList>
<simple>${db.item.csw.TYPE}</simple>
<simple>{{db.item.csw.TYPE}}</simple>
</recipientList>
</route>

Expand Down Expand Up @@ -399,7 +406,7 @@
</when>
</choice>
<setHeader headerName="db.item.ckan.URL">
<simple>${db.item.ckan.URL}</simple>
<simple>{{db.item.ckan.URL}}</simple>
</setHeader>
<setBody>
<constant>&lt;dummy/&gt;</constant>
Expand Down

0 comments on commit c0674f1

Please sign in to comment.