You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/08/21 07:58:02 UTC
[camel] 07/20: Marshal RDF-XML from microformats. Default
configuration of Any 23.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 7222a04f2360ac298111ed8c83862516db7237f6
Author: Roberto Flores <be...@gmail.com>
AuthorDate: Mon Jul 1 00:43:31 2019 -0500
Marshal RDF-XML from microformats. Default configuration of Any 23.
---
components/camel-any23/pom.xml | 103 +++++++++++----------
.../src/main/docs/any23-dataformat.adoc | 12 ++-
.../camel/dataformat/any23/Any23DataFormat.java | 32 +++++--
.../dataformat/any23/Any23DataFormatBasicTest.java | 61 ++----------
.../camel/dataformat/any23/Any23TestSupport.java | 45 +++++++++
.../camel/dataformat/any23/microformat/vcard.html | 65 +++++++++++++
.../modules/ROOT/pages/any23-dataformat.adoc | 12 ++-
.../springboot/Any23DataFormatConfiguration.java | 36 +++++++
8 files changed, 251 insertions(+), 115 deletions(-)
diff --git a/components/camel-any23/pom.xml b/components/camel-any23/pom.xml
index 23cb7f0..14f7b4c 100644
--- a/components/camel-any23/pom.xml
+++ b/components/camel-any23/pom.xml
@@ -19,60 +19,65 @@
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.camel</groupId>
- <artifactId>components</artifactId>
- <version>3.0.0-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>components</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
- <artifactId>camel-any23</artifactId>
- <packaging>jar</packaging>
- <name>Camel :: Any23</name>
- <description>Camel Any23 support</description>
+ <artifactId>camel-any23</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel :: Any23</name>
+ <description>Camel Any23 support</description>
- <properties>
- </properties>
+ <properties>
+ </properties>
- <dependencies>
+ <dependencies>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-support</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-support</artifactId>
+ </dependency>
- <!-- test dependencies -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-api</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-slf4j-impl</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.any23</groupId>
- <artifactId>apache-any23-core</artifactId>
- <version>2.3</version>
- </dependency>
- </dependencies>
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.any23</groupId>
+ <artifactId>apache-any23-core</artifactId>
+ <version>2.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.rdf4j</groupId>
+ <artifactId>rdf4j-rio-rdfxml</artifactId>
+ <version>3.0.0-M1</version>
+ </dependency>
+ </dependencies>
</project>
diff --git a/components/camel-any23/src/main/docs/any23-dataformat.adoc b/components/camel-any23/src/main/docs/any23-dataformat.adoc
index 6ce4081..962f3a4 100644
--- a/components/camel-any23/src/main/docs/any23-dataformat.adoc
+++ b/components/camel-any23/src/main/docs/any23-dataformat.adoc
@@ -25,13 +25,17 @@ as we really don't want to turn well formed HTML into ugly HTML.
// dataformat options: START
-The Any23 dataformat supports 1 options, which are listed below.
+The Any23 dataformat supports 5 options, which are listed below.
[width="100%",cols="2s,1m,1m,6",options="header"]
|===
| Name | Default | Java Type | Description
+| outputFormat | MODEL | String |
+| configurations | | String |
+| extractors | | String |
+| baseuri | | String |
| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc.
|===
// dataformat options: END
@@ -51,15 +55,19 @@ When using Spring Boot make sure to use the following Maven dependency to have s
----
-The component supports 2 options, which are listed below.
+The component supports 6 options, which are listed below.
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
+| *camel.dataformat.any23.baseuri* | | | String
+| *camel.dataformat.any23.configurations* | | | String
| *camel.dataformat.any23.content-type-header* | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc. | false | Boolean
| *camel.dataformat.any23.enabled* | Whether to enable auto configuration of the any23 data format. This is enabled by default. | | Boolean
+| *camel.dataformat.any23.extractors* | | | String
+| *camel.dataformat.any23.output-format* | | MODEL | String
|===
// spring-boot-auto-configure options: END
diff --git a/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/Any23DataFormat.java b/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/Any23DataFormat.java
index 4b581c0..843a3e4 100644
--- a/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/Any23DataFormat.java
+++ b/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/Any23DataFormat.java
@@ -52,14 +52,14 @@ public class Any23DataFormat extends ServiceSupport implements DataFormat, DataF
private static final Logger LOG = LoggerFactory.getLogger(Any23DataFormat.class);
private Any23 any23;
- private Any23OutputFormat format;
+ private Any23OutputFormat format = Any23OutputFormat.RDFXML;
private ModifiableConfiguration conf;
private String[] extractorsList;
private String configurations;
private String extractors;
private String outputFormat;
- private String documentIRI;
+ private String documentIRI = "http://mock.foo/bar";
@Override
public String getDataFormatName() {
@@ -109,14 +109,28 @@ public class Any23DataFormat extends ServiceSupport implements DataFormat, DataF
@Override
protected void doStart() throws Exception {
conf = DefaultConfiguration.copy();
- String[] newConfigs = configurations.split(";");
- for (String con : newConfigs) {
- String[] vals = con.split("=");
- conf.setProperty(vals[0], vals[0]);
+ if (configurations != null) {
+ String[] newConfigs = configurations.split(";");
+ for (String con : newConfigs) {
+ String[] vals = con.split("=");
+ conf.setProperty(vals[0], vals[0]);
+ }
+ }
+ if (extractors != null) {
+ extractorsList = extractors.split(";");
+ }
+ if (configurations == null && extractors == null) {
+ any23 = new Any23();
+ } else if (configurations != null && extractors == null) {
+ any23 = new Any23(conf);
+ } else if (configurations == null && extractors != null) {
+ any23 = new Any23(extractors);
+ } else if (configurations != null && extractors != null) {
+ any23 = new Any23(conf, extractors);
+ }
+ if (outputFormat != null) {
+ format = Any23OutputFormat.valueOf(outputFormat);
}
- extractorsList = extractors.split(";");
- any23 = new Any23(conf, extractors);
- format = Any23OutputFormat.valueOf(outputFormat);
}
@Override
diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatBasicTest.java b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatBasicTest.java
index 815fc4a..a2e6353 100644
--- a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatBasicTest.java
+++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23DataFormatBasicTest.java
@@ -16,6 +16,7 @@
*/
package org.apache.camel.dataformat.any23;
+import java.io.File;
import java.util.List;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
@@ -29,59 +30,16 @@ public class Any23DataFormatBasicTest extends CamelTestSupport {
@Test
public void testUnMarshalToStringOfXml() throws Exception {
MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
- //resultEndpoint.expectedMessageCount(2);
-
- // String badHtml = TidyMarkupTestSupport.loadFileAsString(new File(
- // "src/test/resources/org/apache/camel/dataformat/any23/testfile1.html"));
- // String evilHtml = TidyMarkupTestSupport.loadFileAsString(new File(
- // "src/test/resources/org/apache/camel/dataformat/any23/testfile2-evilHtml.html"));
- String contenhtml = "<div id='hcard-JOSE-LUIS-SEGARRA-FLORES' class='vcard'> "
- + " <a class='url fn n' href='https://www.youtube.com/watch?v=kg1BljLu9YY'> <span class='given-name'>JOSE</span> "
- + " <span class='additional-name'>LUIS</span> "
- + " <span class='family-name'>SEGARRA FLORES</span> "
- + "</a> "
- + " <div class='org'>TransExpress</div> "
- + " <a class='email' href='mailto:joesega7@gmail.com'>joesega7@gmail.com</a> "
- + " <div class='adr'> "
- + " <div class='street-address'>7801 NW 37th Street Doral, FL 33195-6503</div> "
- + " <span class='locality'>Doral</span> "
- + ", "
- + " <span class='region'>Florida</span> "
- + ", "
- + " <span class='postal-code'>33195-6503</span> "
- + " "
- + " <span class='country-name'>Estados Unidos</span> "
- + " "
- + " </div> "
- + " <div class='tel'>3055920839</div> "
- + "<p style='font-size:smaller;'>This <a href='http://microformats.org/wiki/hcard'>hCard</a> created with the <a href='http://microformats.org/code/hcard/creator'>hCard creator</a>.</p> "
- + "</div>";
-
- final String content = "<span class='vcard'> "
- + " <span class='fn'>L'Amourita Pizza</span> "
- + " Located at "
- + " <span class='adr'> "
- + " <span class='street-address'>123 Main St</span>, "
- + " <span class='locality'>Albequerque</span>, "
- + " <span class='region'>NM</span>. "
- + " </span> "
- + " <a href='http://pizza.example.com' class='url'>http://pizza.example.com</a> "
- + "</span> ";
-
+ String contenhtml = Any23TestSupport.loadFileAsString(new File("src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html"));
template.sendBody("direct:start", contenhtml);
- // template.sendBody("direct:start", evilHtml);
-
- //resultEndpoint.assertIsSatisfied();
List<Exchange> list = resultEndpoint.getReceivedExchanges();
- System.out.print(list.size());
for (Exchange exchange : list) {
-
Message in = exchange.getIn();
- // Node tidyMarkup = in.getBody(Node.class);
- System.out.print(in.getBody(String.class));
- log.info("Received " + in.getBody(String.class));
- // assertNotNull("Should be able to convert received body to a string", tidyMarkup);
-
+ String resultingRDF = in.getBody(String.class);
+ System.out.println(resultingRDF);
+ //InputStream toInputStream = IOUtils.toInputStream(resultingRDF);
+ //Model parse = Rio.parse(toInputStream, "http://mock.foo/bar", RDFFormat.RDFXML);
+ //assertEquals(parse.size(), 10);
}
}
@@ -89,10 +47,7 @@ public class Any23DataFormatBasicTest extends CamelTestSupport {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
- from("direct:start").marshal().any23("http://pizza.example.com").to("mock:result");
- //from("direct:start").unmarshal().any23().to("mock:result");
- // from("direct:start").marshal().tidyMarkup();
- // from("direct:start").unmarshal().tidyMarkup().to("mock:result");
+ from("direct:start").marshal().any23("http://mock.foo/bar").to("mock:result");
}
};
}
diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23TestSupport.java b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23TestSupport.java
new file mode 100644
index 0000000..04d4f6a
--- /dev/null
+++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/any23/Any23TestSupport.java
@@ -0,0 +1,45 @@
+package org.apache.camel.dataformat.any23;
+
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import org.apache.camel.util.IOHelper;
+
+/*
+ * 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.
+ */
+public final class Any23TestSupport {
+
+ private Any23TestSupport() {
+ // Utility class
+ }
+
+ public static String loadFileAsString(File file) throws Exception {
+ StringBuilder fileContent = new StringBuilder();
+ BufferedReader input = IOHelper.buffered(new FileReader(file));
+ try {
+ String line = null;
+ while ((line = input.readLine()) != null) {
+ fileContent.append(line);
+ fileContent.append(System.lineSeparator());
+ }
+ } finally {
+ input.close();
+ }
+ return fileContent.toString();
+ }
+}
diff --git a/components/camel-any23/src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html b/components/camel-any23/src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html
new file mode 100644
index 0000000..c09a89b
--- /dev/null
+++ b/components/camel-any23/src/test/resources/org/apache/camel/dataformat/any23/microformat/vcard.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <!-- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta name="robots" content="index,follow" />
+ <link rel="stylesheet" href="/styles/default.css" type="text/css" media="all" />
+ <title>Review of: Perfume: The Story of a Murderer - Reviews - Revyu.com</title>
+ <meta name="description" content="Review of Perfume: The Story of a Murderer. Rated 5/5 (Very Good) by mgaved on 14 Jan 2007. Based on Suskind's book, a historical fantasy - to call it just a murder story would be a shame as there's more in it th..." />
+ <meta name="keywords" content="cinema, film, films-from-books, france, history, movies, smells, review, reviews, revyu" />
+ <link rel="meta" type="application/rdf+xml" title="RDF/XML" href="/reviews/0b03069358e6c718167e09119f7709dc50fb3f6e/about/rdf" /><script type="text/javascript" src="http://ff.kis.v2.scr.kaspersky-labs.com/FD126C42-EBFA-4E12-B309-BB3FDD723AC1/main.js" charset="UTF-8"></script><script language="JavaScript" type="text/javascript" src="/js/popup_launcher.js">
+ </script>
+ </head>
+ <body>
+ <div id="page">
+ <div id="siteheader">
+ <span id="sitelogo"><a href="/" title="Home - Revyu.com"><img src="/images/revyu-logo.png" alt="[Revyu Logo] Revyu.com - Review Anything" border="0" style="vertical-align:middle;"/></a></span>
+ <div id="navmainlinks">
+ <h1 id="navcategorylinks"><a href="/" title="Home - Revyu.com">Home</a> |
+ <a href="/browse/" title="Browse for Things - Revyu.com">Browse Things</a> |
+ <a href="/search/" title="Search for Things - Revyu.com">Search Things</a> | <a href="/people/" title="People - Revyu.com">Browse People</a></h1>
+ <h2 id="navfunctionlinks"><a href="/login/" title="Login - Revyu.com">Login</a>/<a href="/register/" title="Register - Revyu.com">Register</a> | <a href="/new/" title="Start a New Review">New Review</a></h2>
+ </div>
+ </div><div id="pagecontent">
+ <div class="hreview">
+ <h1 class="summary">Review of: Perfume: The Story of a Murderer</h1>
+ <span title="Rated 5 out of 5 (Very Good)">
+ <img src="/images/fullstar.gif" class="fullstar" alt="Filled Star - Denotes One Point" /><img src="/images/fullstar.gif" class="fullstar" alt="Filled Star - Denotes One Point" /><img src="/images/fullstar.gif" class="fullstar" alt="Filled Star - Denotes One Point" /><img src="/images/fullstar.gif" class="fullstar" alt="Filled Star - Denotes One Point" /><img src="/images/fullstar.gif" class="fullstar" alt="Filled Star - Denotes One Point" />
+ </span>
+ <span class="invisible"><span class="rating">5</span>/<span class="best">5</span> (minimum <span class="worst">1</span>)</span>
+ <h2 style="display: inline">by <a href="/people/mgaved" title="mgaved" class="reviewer vcard"><span class="fn">mgaved</span></a> on <span class="dtreviewed" title="2007-01-14T05:20:08-08:00">14 Jan 2007</span></h2>
+ <p class="reviewbody description">Based on Suskind's book, a historical fantasy - to call it just a murder story would be a shame as there's more in it than that. What a lovely and challenge idea - making a film about smells - something that the author captures well in the book but I was worried wouldn't transfer well to the screen. However my fears were allayed from the beginning. The film does a wonderful job of using amazing cinematography and soundscapes to really bring ho [...]
+ <br />
+ Quite a spooky but intriguing story, beautifully filmed. </p>
+ <p class="permalinks">Review Permalink: <a href="http://revyu.com/reviews/0b03069358e6c718167e09119f7709dc50fb3f6e" title="Permalink: Review of Perfume: The Story of a Murderer" rel="self bookmark permalink">http://revyu.com/reviews/0b03069358e6c718167e09119f7709dc50fb3f6e</a></p>
+ <h2><span class="item"><a href="/things/perfume-the-story-of-a-murderer-1168287603" title="About Perfume: The Story of a Murderer" class="url"><span class="fn">Perfume: The Story of a Murderer</span></a></span></h2>
+ <p>1 Other Review, by... <a href="/reviews/acc27764c4ceb2362ca304c11f360fd51cd3815e" title="Review of Perfume: The Story of a Murderer by Danni on 08 Jan 2007">Danni</a> <br/>Tags: <a href="/tags/cinema" title="Tag cinema" rel="tag">cinema</a> <a href="/tags/film" title="Tag film" rel="tag">film</a> <a href="/tags/films-from-books" title="Tag films-from-books" rel="tag">films-from-books</a> <a href="/tags/france" title="Tag france" rel="tag">france</a> <a href="/tags/history" t [...]
+ <p class="writereview">What do you think of <strong>Perfume: The Story of a Murderer</strong>? <a href="/review.php?stage=2&origin=dp&name=Perfume%3A+The+Story+of+a+Murderer&url=&exists=true&uri=things/perfume-the-story-of-a-murderer-1168287603" title="Write a Review of Perfume: The Story of a Murderer"><strong>Write Your Own Review...</strong></a></p>
+ </div>
+ <div id="navcontext">
+ <ul><li><a href="/review.php?stage=2&origin=dp&name=Perfume%3A+The+Story+of+a+Murderer&url=&exists=true&uri=things/perfume-the-story-of-a-murderer-1168287603" title="Write a Review of Perfume: The Story of a Murderer">Write a Review of<br/><strong>Perfume: The Story of a Murderer</strong></a></li><li><a href="/reviews/0b03069358e6c718167e09119f7709dc50fb3f6e/about/rdf" title="RDF/XML Metadata for this Review of Perfume: The Story of a Murderer">RDF Metadata fo [...]
+ <br/><br/><a href="/reviews/0b03069358e6c718167e09119f7709dc50fb3f6e/about/rdf" title="RDF/XML Metadata for this Review of Perfume: The Story of a Murderer"><img src="/images/rdfmeta.gif" alt="RDF Metadata" /></a></li><li>
+ <img src="/images/delicious.small.gif" alt="[del.icio.us logo]" width="10" height="10" class="savetoimg">
+ <a href="http://del.icio.us/post?url=http%3A%2F%2Frevyu.com%2Freviews%2F0b03069358e6c718167e09119f7709dc50fb3f6e%2Fabout%2Fhtml&title=Review%20of%3A%20Perfume%3A%20The%20Story%20of%20a%20Murderer%20-%20Reviews%20-%20Revyu.com" onclick="window.open('http://del.icio.us/post?v=4&noui&jump=close&url=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(document.title), 'delicious', 'toolbar=no,width=700,height=400'); return false;" title="Add this page to y [...]
+ </li></ul></div>
+ </div>
+ <p> </p>
+ <div id="footer">
+ <p>
+ <strong><a href="/" title="Revyu.com Home Page">Revyu.com</a>:</strong>
+
+ <a href="/site/contact/" title="Contact the Revyu.com Team">Contact</a> |
+ <a href="/site/credits/" title="Credits">Credits</a> |
+ <a href="/site/privacy/" title="Privacy Policy">Privacy Policy</a> |
+ <a href="/site/disclaimer/" title="Disclaimer">Disclaimer</a>
+ </p>
+ </div>
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+ </script>
+ <script type="text/javascript">
+ _uacct = "UA-728407-2";
+ urchinTracker();
+ </script>
+ </body>
+</html>
diff --git a/docs/components/modules/ROOT/pages/any23-dataformat.adoc b/docs/components/modules/ROOT/pages/any23-dataformat.adoc
index 6ce4081..962f3a4 100644
--- a/docs/components/modules/ROOT/pages/any23-dataformat.adoc
+++ b/docs/components/modules/ROOT/pages/any23-dataformat.adoc
@@ -25,13 +25,17 @@ as we really don't want to turn well formed HTML into ugly HTML.
// dataformat options: START
-The Any23 dataformat supports 1 options, which are listed below.
+The Any23 dataformat supports 5 options, which are listed below.
[width="100%",cols="2s,1m,1m,6",options="header"]
|===
| Name | Default | Java Type | Description
+| outputFormat | MODEL | String |
+| configurations | | String |
+| extractors | | String |
+| baseuri | | String |
| contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc.
|===
// dataformat options: END
@@ -51,15 +55,19 @@ When using Spring Boot make sure to use the following Maven dependency to have s
----
-The component supports 2 options, which are listed below.
+The component supports 6 options, which are listed below.
[width="100%",cols="2,5,^1,2",options="header"]
|===
| Name | Description | Default | Type
+| *camel.dataformat.any23.baseuri* | | | String
+| *camel.dataformat.any23.configurations* | | | String
| *camel.dataformat.any23.content-type-header* | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc. | false | Boolean
| *camel.dataformat.any23.enabled* | Whether to enable auto configuration of the any23 data format. This is enabled by default. | | Boolean
+| *camel.dataformat.any23.extractors* | | | String
+| *camel.dataformat.any23.output-format* | | MODEL | String
|===
// spring-boot-auto-configure options: END
diff --git a/platforms/spring-boot/components-starter/camel-any23-starter/src/main/java/org/apache/camel/dataformat/any23/springboot/Any23DataFormatConfiguration.java b/platforms/spring-boot/components-starter/camel-any23-starter/src/main/java/org/apache/camel/dataformat/any23/springboot/Any23DataFormatConfiguration.java
index 423812f..fdc80df 100644
--- a/platforms/spring-boot/components-starter/camel-any23-starter/src/main/java/org/apache/camel/dataformat/any23/springboot/Any23DataFormatConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-any23-starter/src/main/java/org/apache/camel/dataformat/any23/springboot/Any23DataFormatConfiguration.java
@@ -36,6 +36,10 @@ public class Any23DataFormatConfiguration
* enabled by default.
*/
private Boolean enabled;
+ private String outputFormat = "MODEL";
+ private String configurations;
+ private String extractors;
+ private String baseuri;
/**
* Whether the data format should set the Content-Type header with the type
* from the data format if the data format is capable of doing so. For
@@ -44,6 +48,38 @@ public class Any23DataFormatConfiguration
*/
private Boolean contentTypeHeader = false;
+ public String getOutputFormat() {
+ return outputFormat;
+ }
+
+ public void setOutputFormat(String outputFormat) {
+ this.outputFormat = outputFormat;
+ }
+
+ public String getConfigurations() {
+ return configurations;
+ }
+
+ public void setConfigurations(String configurations) {
+ this.configurations = configurations;
+ }
+
+ public String getExtractors() {
+ return extractors;
+ }
+
+ public void setExtractors(String extractors) {
+ this.extractors = extractors;
+ }
+
+ public String getBaseuri() {
+ return baseuri;
+ }
+
+ public void setBaseuri(String baseuri) {
+ this.baseuri = baseuri;
+ }
+
public Boolean getContentTypeHeader() {
return contentTypeHeader;
}