This is an automated email from the ASF dual-hosted git repository.
zregvart pushed a commit to branch camel-3.7.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.7.x by this push:
new 15aad01 CAMEL-16686: fix path and script to copy examples
15aad01 is described below
commit 15aad01dcda6093f8d2ec8abe21094a8c3f91249
Author: Zoran Regvart <[email protected]>
AuthorDate: Fri Jun 4 13:52:36 2021 +0200
CAMEL-16686: fix path and script to copy examples
The path to the example in `properties-component.adoc` had a small typo,
but also the Gulp script to copy over the examples did not consider
components bundled in core.
---
.../src/main/docs/properties-component.adoc | 6 +--
...amelSpringPropertyPlaceholderConfigurerTest.xml | 58 ++++++++++++++++++++++
.../modules/ROOT/pages/properties-component.adoc | 6 +--
docs/gulpfile.js | 7 ++-
4 files changed, 67 insertions(+), 10 deletions(-)
diff --git a/core/camel-base/src/main/docs/properties-component.adoc
b/core/camel-base/src/main/docs/properties-component.adoc
index 42d4a96..ed7a0bf 100644
--- a/core/camel-base/src/main/docs/properties-component.adoc
+++ b/core/camel-base/src/main/docs/properties-component.adoc
@@ -613,7 +613,7 @@ To bridge Spring and Camel you must define a single bean as
shown below:
[source,xml]
----
-include::{examplesdir}/components/camel-spring/src/test/resources/org/apache/camel/components/properties/CamelSpringPropertyPlaceholderConfigurerTest.xml[tags=e1]
+include::{examplesdir}/components/camel-spring/src/test/resources/org/apache/camel/component/properties/CamelSpringPropertyPlaceholderConfigurerTest.xml[tags=e1]
----
You *must not* use the spring `<context:property-placeholder>` namespace
@@ -625,7 +625,7 @@ as shown below:
[source,xml]
----
-include::{examplesdir}/components/camel-spring/src/test/resources/org/apache/camel/components/properties/CamelSpringPropertyPlaceholderConfigurerTest.xml[tags=e2]
+include::{examplesdir}/components/camel-spring/src/test/resources/org/apache/camel/component/properties/CamelSpringPropertyPlaceholderConfigurerTest.xml[tags=e2]
----
Notice how the hello bean is using pure Spring property placeholders
@@ -922,5 +922,3 @@ during startup.
The regular `PropertySource` will lookup the property on-demand, for example
to lookup
values from a backend source such as a database or HashiCorp Vault etc.
-
-
diff --git
a/docs/components/modules/ROOT/examples/components/camel-spring/src/test/resources/org/apache/camel/component/properties/CamelSpringPropertyPlaceholderConfigurerTest.xml
b/docs/components/modules/ROOT/examples/components/camel-spring/src/test/resources/org/apache/camel/component/properties/CamelSpringPropertyPlaceholderConfigurerTest.xml
new file mode 100644
index 0000000..a15e6d4
--- /dev/null
+++
b/docs/components/modules/ROOT/examples/components/camel-spring/src/test/resources/org/apache/camel/component/properties/CamelSpringPropertyPlaceholderConfigurerTest.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You 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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
+
+ <!-- START SNIPPET: e1 -->
+ <!-- tag::e1[] -->
+
+ <!-- bridge spring property placeholder with Camel -->
+ <!-- you must NOT use the <context:property-placeholder at the same time,
only this bridge bean -->
+ <bean id="bridgePropertyPlaceholder"
class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
+ <property name="location"
value="classpath:org/apache/camel/component/properties/cheese.properties"/>
+ </bean>
+
+ <!-- end::e1[] -->
+ <!-- END SNIPPET: e1 -->
+
+ <!-- START SNIPPET: e2 -->
+ <!-- tag::e2[] -->
+
+ <!-- a bean that uses Spring property placeholder -->
+ <!-- the ${hi} is a spring property placeholder -->
+ <bean id="hello" class="org.apache.camel.component.properties.HelloBean">
+ <property name="greeting" value="${hi}"/>
+ </bean>
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+ <!-- in this route we use Camels property placeholder {{ }} style -->
+ <route>
+ <from uri="direct:{{cool.bar}}"/>
+ <bean ref="hello"/>
+ <to uri="{{cool.end}}"/>
+ </route>
+ </camelContext>
+
+ <!-- end::e2[] -->
+ <!-- END SNIPPET: e2 -->
+
+</beans>
diff --git a/docs/components/modules/ROOT/pages/properties-component.adoc
b/docs/components/modules/ROOT/pages/properties-component.adoc
index 357e68d..85b69dd 100644
--- a/docs/components/modules/ROOT/pages/properties-component.adoc
+++ b/docs/components/modules/ROOT/pages/properties-component.adoc
@@ -615,7 +615,7 @@ To bridge Spring and Camel you must define a single bean as
shown below:
[source,xml]
----
-include::{examplesdir}/components/camel-spring/src/test/resources/org/apache/camel/components/properties/CamelSpringPropertyPlaceholderConfigurerTest.xml[tags=e1]
+include::{examplesdir}/components/camel-spring/src/test/resources/org/apache/camel/component/properties/CamelSpringPropertyPlaceholderConfigurerTest.xml[tags=e1]
----
You *must not* use the spring `<context:property-placeholder>` namespace
@@ -627,7 +627,7 @@ as shown below:
[source,xml]
----
-include::{examplesdir}/components/camel-spring/src/test/resources/org/apache/camel/components/properties/CamelSpringPropertyPlaceholderConfigurerTest.xml[tags=e2]
+include::{examplesdir}/components/camel-spring/src/test/resources/org/apache/camel/component/properties/CamelSpringPropertyPlaceholderConfigurerTest.xml[tags=e2]
----
Notice how the hello bean is using pure Spring property placeholders
@@ -924,5 +924,3 @@ during startup.
The regular `PropertySource` will lookup the property on-demand, for example
to lookup
values from a backend source such as a database or HashiCorp Vault etc.
-
-
diff --git a/docs/gulpfile.js b/docs/gulpfile.js
index 4a6fe0b..40af5ad 100644
--- a/docs/gulpfile.js
+++ b/docs/gulpfile.js
@@ -424,8 +424,11 @@ function createUserManualLanguageExamples () {
}
function createComponentExamples () {
- return src('../components/{*,*/*}/src/main/docs/*.adoc')
- .pipe(through2.obj(extractExamples))
+ return src([
+ '../core/camel-base/src/main/docs/*.adoc',
+ '../core/camel-main/src/main/docs/*.adoc',
+ '../components/{*,*/*}/src/main/docs/*.adoc',
+ ]).pipe(through2.obj(extractExamples))
.pipe(dest('components/modules/ROOT/examples/'))
}