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 0b7fad12c5e0f09dffb7e164155f7dd47c4809a1 Author: Roberto Flores <betoflo...@gmail.com> AuthorDate: Thu Jun 6 12:29:49 2019 -0500 base structure camel-any23 dataformat --- components/camel-any23/pom.xml | 73 ++++++++ .../src/main/docs/any23-dataformat.adoc | 111 +++++++++++ .../camel/dataformat/any23/any23DataFormat.java | 85 +++++++++ .../tagsoup/TidyMarkupDataFormatAsDomNodeTest.java | 82 +++++++++ .../tagsoup/TidyMarkupDataFormatAsStringTest.java | 72 ++++++++ .../TidyMarkupDataFormatWithUnmarshalTypeTest.java | 37 ++++ .../dataformat/tagsoup/TidyMarkupTestSupport.java | 86 +++++++++ .../src/test/resources/log4j2.properties | 28 +++ .../apache/camel/dataformat/any23/testfile1.html | 38 ++++ .../camel/dataformat/any23/testfile2-evilHtml.html | 77 ++++++++ components/pom.xml | 1 + .../camel/model/dataformat/Any23DataFormat.java | 39 ++++ .../components-starter/camel-any23-starter/pom.xml | 53 ++++++ .../any23DataFormatAutoConfiguration.java | 128 +++++++++++++ .../springboot/any23DataFormatConfiguration.java | 54 ++++++ .../src/main/resources/META-INF/LICENSE.txt | 203 +++++++++++++++++++++ .../src/main/resources/META-INF/NOTICE.txt | 11 ++ .../src/main/resources/META-INF/spring.factories | 19 ++ .../src/main/resources/META-INF/spring.provides | 17 ++ platforms/spring-boot/components-starter/pom.xml | 1 + 20 files changed, 1215 insertions(+) diff --git a/components/camel-any23/pom.xml b/components/camel-any23/pom.xml new file mode 100644 index 0000000..e42a960 --- /dev/null +++ b/components/camel-any23/pom.xml @@ -0,0 +1,73 @@ +<?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. + +--> +<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> + + <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> + + <properties> + </properties> + + <dependencies> + + <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> + </dependencies> +</project> diff --git a/components/camel-any23/src/main/docs/any23-dataformat.adoc b/components/camel-any23/src/main/docs/any23-dataformat.adoc new file mode 100644 index 0000000..74bcfc3 --- /dev/null +++ b/components/camel-any23/src/main/docs/any23-dataformat.adoc @@ -0,0 +1,111 @@ +== Any23 DataFormat +== TidyMarkup DataFormat + +*Available as of Camel version 1.0* + +TidyMarkup is a Data Format that uses the +http://www.ccil.org/~cowan/XML/tagsoup/[TagSoup] to tidy up HTML. It can +be used to parse ugly HTML and return it as pretty wellformed HTML. + +*Camel eats our own -dog food- soap* + +We had some issues in our pdf Manual where we had some +strange symbols. So http://janstey.blogspot.com/[Jonathan] used this +data format to tidy up the wiki html pages that are used as base for +rendering the pdf manuals. And then the mysterious symbols vanished. + +TidyMarkup only supports the *unmarshal* operation +as we really don't want to turn well formed HTML into ugly HTML. + +### TidyMarkup Options + + + +// dataformat options: START +The Any23 dataformat supports 1 options, which are listed below. + + + +[width="100%",cols="2s,1m,1m,6",options="header"] +|=== +| Name | Default | Java Type | Description +| 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 +// spring-boot-auto-configure options: START +=== Spring Boot Auto-Configuration + +When using Spring Boot make sure to use the following Maven dependency to have support for auto configuration: + +[source,xml] +---- +<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-tagsoup-starter</artifactId> + <version>x.x.x</version> + <!-- use the same version as your Camel core version --> +</dependency> +---- + + +The component supports 4 options, which are listed below. + + + +[width="100%",cols="2,5,^1,2",options="header"] +|=== +| Name | Description | Default | Type +| *camel.dataformat.tidymarkup.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.tidymarkup.data-object-type* | What data type to unmarshal as, can either be org.w3c.dom.Node or java.lang.String. Is by default org.w3c.dom.Node | org.w3c.dom.Node | String +| *camel.dataformat.tidymarkup.enabled* | Enable tidymarkup dataformat | true | Boolean +| *camel.dataformat.tidymarkup.omit-xml-declaration* | When returning a String, do we omit the XML declaration in the top. | false | Boolean +|=== +// spring-boot-auto-configure options: END + + + + +### Java DSL Example + +An example where the consumer provides some HTML + +[source,java] +--------------------------------------------------------------------------- +from("file://site/inbox").unmarshal().tidyMarkup().to("file://site/blogs"); +--------------------------------------------------------------------------- + +### Spring XML Example + +The following example shows how to use TidyMarkup +to unmarshal using Spring + +[source,java] +----------------------------------------------------------------------- +<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> + <route> + <from uri="file://site/inbox"/> + <unmarshal> + <tidyMarkup/> + </unmarshal> + <to uri="file://site/blogs"/> + </route> +</camelContext> +----------------------------------------------------------------------- + +### Dependencies + +To use TidyMarkup in your camel routes you need to add the a dependency +on *camel-tagsoup* which implements this data format. + +If you use maven you could just add the following to your pom.xml, +substituting the version number for the latest & greatest release (see +the download page for the latest versions). + +[source,java] +---------------------------------------- +<dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-tagsoup</artifactId> + <version>x.x.x</version> +</dependency> +---------------------------------------- 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 new file mode 100644 index 0000000..d4b1622 --- /dev/null +++ b/components/camel-any23/src/main/java/org/apache/camel/dataformat/any23/any23DataFormat.java @@ -0,0 +1,85 @@ +/* + * 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. + */ +package org.apache.camel.dataformat.any23; + +import java.io.InputStream; +import java.io.OutputStream; + +import org.apache.camel.CamelException; +import org.apache.camel.Exchange; +import org.apache.camel.spi.DataFormat; +import org.apache.camel.spi.DataFormatName; +import org.apache.camel.spi.annotations.Dataformat; +import org.apache.camel.support.service.ServiceSupport; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Dataformat for any23 .. This dataformat is intended to convert HTML from a + * site (or file) into rdf. + */ +@Dataformat("any23") +public class any23DataFormat extends ServiceSupport implements DataFormat, DataFormatName { + + /* + * Our Logger + */ + private static final Logger LOG = LoggerFactory.getLogger(any23DataFormat.class); + + + + /** + * String or Node to return + */ + private Class<?> dataObjectType; + + /** + * What is the default output format ? + */ + private String method; + + @Override + public String getDataFormatName() { + return "any23"; + } + + /** + * Marshal data. Generate RDF. + */ + public void marshal(Exchange exchange, Object object, OutputStream outputStream) throws Exception { + throw new CamelException("Marshalling from Well Formed HTML to ugly HTML is not supported." + + " Only unmarshal is supported"); + } + + /** + * Unmarshal the data + */ + public Object unmarshal(Exchange exchange, InputStream inputStream) throws Exception { + + throw new CamelException("Sin implementaci[on aun"); + } + + @Override + protected void doStart() throws Exception { + // noop + } + + @Override + protected void doStop() throws Exception { + // noop + } +} diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/tagsoup/TidyMarkupDataFormatAsDomNodeTest.java b/components/camel-any23/src/test/java/org/apache/camel/dataformat/tagsoup/TidyMarkupDataFormatAsDomNodeTest.java new file mode 100644 index 0000000..06aa8ae --- /dev/null +++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/tagsoup/TidyMarkupDataFormatAsDomNodeTest.java @@ -0,0 +1,82 @@ +/* + * 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. + */ +package org.apache.camel.dataformat.tagsoup; + +import java.io.File; +import java.util.List; + +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.junit4.CamelTestSupport; +import org.junit.Test; + +public class TidyMarkupDataFormatAsDomNodeTest extends CamelTestSupport { + + @Test + public void testUnMarshalToStringOfXml() throws Exception { + MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class); + resultEndpoint.expectedMessageCount(2); + + /* + * each of these files has a <p>TidyMarkupNode section. (no closing tag) + * + * See the route below, we send the tidyMarkup to xpath and boolean that out. + */ + String badHtml = TidyMarkupTestSupport.loadFileAsString(new File( + "src/test/resources/org/apache/camel/dataformat/tagsoup/testfile1.html")); + String evilHtml = TidyMarkupTestSupport.loadFileAsString(new File( + "src/test/resources/org/apache/camel/dataformat/tagsoup/testfile2-evilHtml.html")); + + template.sendBody("direct:start", badHtml); + template.sendBody("direct:start", evilHtml); + + resultEndpoint.assertIsSatisfied(); + List<Exchange> list = resultEndpoint.getReceivedExchanges(); + for (Exchange exchange : list) { + Message in = exchange.getIn(); + String response = in.getBody(String.class); + + log.debug("Received " + response); + assertNotNull("Should be able to convert received body to a string", response); + + try { + /* + * our route xpaths the existence of our signature "<p>TidyMarkupNode" + * but of course, by the xpath time, it is well formed + */ + assertTrue(response.equals("true")); + } catch (Exception e) { + + fail("Failed to convert the resulting String to XML: " + e.getLocalizedMessage()); + } + + } + } + + @Override + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + public void configure() { + from("direct:start").unmarshal().tidyMarkup().setBody().xpath( + "boolean(//p[contains(text(),'TidyMarkupNode')])", String.class).to("mock:result"); + } + }; + } + +} diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/tagsoup/TidyMarkupDataFormatAsStringTest.java b/components/camel-any23/src/test/java/org/apache/camel/dataformat/tagsoup/TidyMarkupDataFormatAsStringTest.java new file mode 100644 index 0000000..204fd33 --- /dev/null +++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/tagsoup/TidyMarkupDataFormatAsStringTest.java @@ -0,0 +1,72 @@ +/* + * 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. + */ +package org.apache.camel.dataformat.tagsoup; + +import java.io.File; +import java.util.List; + +import org.w3c.dom.Node; + +import org.apache.camel.Exchange; +import org.apache.camel.Message; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.junit4.CamelTestSupport; +import org.junit.Test; + + +public class TidyMarkupDataFormatAsStringTest 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/tagsoup/testfile1.html")); + String evilHtml = TidyMarkupTestSupport.loadFileAsString(new File( + "src/test/resources/org/apache/camel/dataformat/tagsoup/testfile2-evilHtml.html")); + + template.sendBody("direct:start", badHtml); + template.sendBody("direct:start", evilHtml); + + resultEndpoint.assertIsSatisfied(); + List<Exchange> list = resultEndpoint.getReceivedExchanges(); + for (Exchange exchange : list) { + try { + Message in = exchange.getIn(); + Node tidyMarkup = in.getBody(Node.class); + + log.debug("Received " + tidyMarkup); + assertNotNull("Should be able to convert received body to a string", tidyMarkup); + + } catch (Exception e) { + fail("Failed to convert the resulting String to XML: " + e.getLocalizedMessage()); + } + } + } + + @Override + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + public void configure() { + from("direct:start").unmarshal().tidyMarkup().to("mock:result"); + } + }; + } + +} diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/tagsoup/TidyMarkupDataFormatWithUnmarshalTypeTest.java b/components/camel-any23/src/test/java/org/apache/camel/dataformat/tagsoup/TidyMarkupDataFormatWithUnmarshalTypeTest.java new file mode 100644 index 0000000..77ed3ae --- /dev/null +++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/tagsoup/TidyMarkupDataFormatWithUnmarshalTypeTest.java @@ -0,0 +1,37 @@ +/* + * 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. + */ +package org.apache.camel.dataformat.tagsoup; + +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.model.dataformat.TidyMarkupDataFormat; + +/* + * This just tests whether this dataformat is available to UnmarshalType + */ +public class TidyMarkupDataFormatWithUnmarshalTypeTest extends TidyMarkupDataFormatAsStringTest { + + @Override + protected RouteBuilder createRouteBuilder() { + return new RouteBuilder() { + public void configure() { + TidyMarkupDataFormat dataFormat = new TidyMarkupDataFormat(String.class); + from("direct:start").unmarshal(dataFormat).to("mock:result"); + } + }; + } + +} diff --git a/components/camel-any23/src/test/java/org/apache/camel/dataformat/tagsoup/TidyMarkupTestSupport.java b/components/camel-any23/src/test/java/org/apache/camel/dataformat/tagsoup/TidyMarkupTestSupport.java new file mode 100644 index 0000000..2b53585 --- /dev/null +++ b/components/camel-any23/src/test/java/org/apache/camel/dataformat/tagsoup/TidyMarkupTestSupport.java @@ -0,0 +1,86 @@ +/* + * 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. + */ +package org.apache.camel.dataformat.tagsoup; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringReader; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; + +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import org.apache.camel.util.IOHelper; + +public final class TidyMarkupTestSupport { + + private TidyMarkupTestSupport() { + // 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(); + } + + /** + * Convert XML String to a Document. + * + * @param xmlString + * @return document Document + * @throws IOException + * @throws SAXException + * @throws ParserConfigurationException + */ + public static Document stringToXml(String xmlString) throws SAXException, IOException, ParserConfigurationException { + return createDocumentBuilder().parse(new InputSource(new StringReader(xmlString))); + } + + /** + * Static to generate a documentBuilder + * + * @return + * @throws ParserConfigurationException + */ + public static DocumentBuilder createDocumentBuilder() throws ParserConfigurationException { + + DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); + docBuilderFactory.setIgnoringComments(true); + docBuilderFactory.setIgnoringElementContentWhitespace(true); + docBuilderFactory.setCoalescing(true); + docBuilderFactory.setExpandEntityReferences(true); + docBuilderFactory.setNamespaceAware(true); + return docBuilderFactory.newDocumentBuilder(); + } +} diff --git a/components/camel-any23/src/test/resources/log4j2.properties b/components/camel-any23/src/test/resources/log4j2.properties new file mode 100644 index 0000000..57bb91f --- /dev/null +++ b/components/camel-any23/src/test/resources/log4j2.properties @@ -0,0 +1,28 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- + +appender.file.type = File +appender.file.name = file +appender.file.fileName = target/camel-atom-test.log +appender.file.layout.type = PatternLayout +appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n +appender.out.type = Console +appender.out.name = out +appender.out.layout.type = PatternLayout +appender.out.layout.pattern = [%30.30t] %-30.30c{1} %-5p %m%n +rootLogger.level = INFO +rootLogger.appenderRef.file.ref = file diff --git a/components/camel-any23/src/test/resources/org/apache/camel/dataformat/any23/testfile1.html b/components/camel-any23/src/test/resources/org/apache/camel/dataformat/any23/testfile1.html new file mode 100644 index 0000000..b6f4707 --- /dev/null +++ b/components/camel-any23/src/test/resources/org/apache/camel/dataformat/any23/testfile1.html @@ -0,0 +1,38 @@ +<!-- + + 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. + +--> +<html> + <head> + <title>FooBar</title> + <meta name=metatag value=foo> + </head> + + <body onload="foo()" > + <p> + Some text + + <p> + Some more Text + <p>TidyMarkupNode + <img src=filename.jpg> + + <font color="red">Some red text + + </body> + +</HTML> \ No newline at end of file diff --git a/components/camel-any23/src/test/resources/org/apache/camel/dataformat/any23/testfile2-evilHtml.html b/components/camel-any23/src/test/resources/org/apache/camel/dataformat/any23/testfile2-evilHtml.html new file mode 100644 index 0000000..35ec6da --- /dev/null +++ b/components/camel-any23/src/test/resources/org/apache/camel/dataformat/any23/testfile2-evilHtml.html @@ -0,0 +1,77 @@ +<!-- + + 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. + +--> +<html> +<META-START> +John Cowan +<TABLE> +<ROW> +<CELL>SOUPE</CELL> +<CELL>BE EVIL!</CELL></ROW> +DE BALISES</TABLE> +<CORR NEW="U" LOC="PI"/> +<G ID="P1"> +Ecritez une balise ouvrante (sans attributs) +</G> +ou fermante HTML ici, s.v.p.</META-START> +<FONT>X Y <p> ABC </FONT> xyz +QRS<sup>TUV<sub>WXY</sup>Z</sub> + +<p>TidyMarkupNode +<script language="javascript"><p></script> +<table><tbody><tr><th>ABC +</table><nr/> +<meta><meta><meta><meta> +<pre xml:space="default">test</pre> +<test xmlns:xml="http://www.example.org/> +</test><hr/> +(add a random HTML tag above) +<r:r:r:test/> + +<b><i></B></I> +<b> + <p>bbb</b></p> + <p>bbb</b></p> + <p>bbb</b></p> +<blink>&grec; +<p xmlns:xqp="http://www.w3.org/1998/XML"> + <span xqp:space="preserve">~~~</span> +</p></blink> +<html:p xmlns:html="http://...."></p> +<@/><!--Apple logo in PUA--> +<!--comment--comment--> +<!--comment--comment> + +<P>]]> +<P id="7" id="8">M</p> +<p xmlns:a="urn" xmlns:b="urn" + a:id="7" b:id="9">~~~</p> +<p id="a" idref="a"/> BE EVIL! +<extreme sID="a" mood="happy"/> +<extreme eID="a" mood="sad"/> +<math><mi>2</mi><msup>3 + </msup></math> <title> +<verse><seg>When,</seg><seg>in</line> +<line>the beginning</line><line>God created +the heaven and the earth.</line></verse> + +<How/><To/><Markup/><Legibly/> +<Name Name="Name">Name</Name> +<list 4 text </p> +<marquee>foo!</marquee> + \ No newline at end of file diff --git a/components/pom.xml b/components/pom.xml index 4cfd587..afc33ce 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -92,6 +92,7 @@ <module>camel-ahc</module> <module>camel-ahc-ws</module> <module>camel-amqp</module> + <module>camel-any23</module> <module>camel-apns</module> <module>camel-as2</module> <module>camel-asn1</module> diff --git a/core/camel-core/src/main/java/org/apache/camel/model/dataformat/Any23DataFormat.java b/core/camel-core/src/main/java/org/apache/camel/model/dataformat/Any23DataFormat.java new file mode 100644 index 0000000..7dde517 --- /dev/null +++ b/core/camel-core/src/main/java/org/apache/camel/model/dataformat/Any23DataFormat.java @@ -0,0 +1,39 @@ +/* + * 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. + */ +package org.apache.camel.model.dataformat; + + + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; + +import org.apache.camel.model.DataFormatDefinition; +import org.apache.camel.spi.Metadata; + +/** + * Any23 data format is used for parsing data to RDF. + */ +@Metadata(firstVersion = "1.0.0", label = "dataformat,transformation", title = "Any23") +@XmlRootElement(name = "any23") +@XmlAccessorType(XmlAccessType.FIELD) +public class Any23DataFormat extends DataFormatDefinition { + + +} \ No newline at end of file diff --git a/platforms/spring-boot/components-starter/camel-any23-starter/pom.xml b/platforms/spring-boot/components-starter/camel-any23-starter/pom.xml new file mode 100644 index 0000000..5c3558f --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-any23-starter/pom.xml @@ -0,0 +1,53 @@ +<?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. + +--> +<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> + <parent> + <groupId>org.apache.camel</groupId> + <artifactId>components-starter</artifactId> + <version>3.0.0-SNAPSHOT</version> + </parent> + <artifactId>camel-any23-starter</artifactId> + <packaging>jar</packaging> + <name>Spring-Boot Starter :: Camel :: any23</name> + <description>Spring-Boot Starter for Camel Any23 support</description> + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter</artifactId> + <version>${spring-boot-version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-any23</artifactId> + <version>${project.version}</version> + </dependency> + <!--START OF GENERATED CODE--> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-core-starter</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-spring-boot-starter</artifactId> + </dependency> + <!--END OF GENERATED CODE--> + </dependencies> +</project> diff --git a/platforms/spring-boot/components-starter/camel-any23-starter/src/main/java/org/apache/camel/dataformat/any23/springboot/any23DataFormatAutoConfiguration.java b/platforms/spring-boot/components-starter/camel-any23-starter/src/main/java/org/apache/camel/dataformat/any23/springboot/any23DataFormatAutoConfiguration.java new file mode 100644 index 0000000..3caaebc --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-any23-starter/src/main/java/org/apache/camel/dataformat/any23/springboot/any23DataFormatAutoConfiguration.java @@ -0,0 +1,128 @@ +/* + * 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. + */ +package org.apache.camel.dataformat.any23.springboot; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.RuntimeCamelException; +import org.apache.camel.dataformat.any23.any23DataFormat; +import org.apache.camel.spi.DataFormat; +import org.apache.camel.spi.DataFormatCustomizer; +import org.apache.camel.spi.DataFormatFactory; +import org.apache.camel.spi.HasId; +import org.apache.camel.spring.boot.CamelAutoConfiguration; +import org.apache.camel.spring.boot.DataFormatConfigurationProperties; +import org.apache.camel.spring.boot.util.CamelPropertiesHelper; +import org.apache.camel.spring.boot.util.ConditionalOnCamelContextAndAutoConfigurationBeans; +import org.apache.camel.spring.boot.util.GroupCondition; +import org.apache.camel.spring.boot.util.HierarchicalPropertiesEvaluator; +import org.apache.camel.support.IntrospectionSupport; +import org.apache.camel.util.ObjectHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") +@Configuration +@Conditional({ConditionalOnCamelContextAndAutoConfigurationBeans.class, + any23DataFormatAutoConfiguration.GroupConditions.class}) +@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration") +@EnableConfigurationProperties({DataFormatConfigurationProperties.class, + any23DataFormatConfiguration.class}) +public class any23DataFormatAutoConfiguration { + + private static final Logger LOGGER = LoggerFactory + .getLogger(any23DataFormatAutoConfiguration.class); + @Autowired + private ApplicationContext applicationContext; + @Autowired + private CamelContext camelContext; + @Autowired + private any23DataFormatConfiguration configuration; + @Autowired(required = false) + private List<DataFormatCustomizer<any23DataFormat>> customizers; + + static class GroupConditions extends GroupCondition { + public GroupConditions() { + super("camel.dataformat", "camel.dataformat.any23"); + } + } + + @Bean(name = "any23-dataformat-factory") + @ConditionalOnMissingBean(any23DataFormat.class) + public DataFormatFactory configureany23DataFormatFactory() throws Exception { + return new DataFormatFactory() { + @Override + public DataFormat newInstance() { + any23DataFormat dataformat = new any23DataFormat(); + if (CamelContextAware.class + .isAssignableFrom(any23DataFormat.class)) { + CamelContextAware contextAware = CamelContextAware.class + .cast(dataformat); + if (contextAware != null) { + contextAware.setCamelContext(camelContext); + } + } + try { + Map<String, Object> parameters = new HashMap<>(); + IntrospectionSupport.getProperties(configuration, + parameters, null, false); + CamelPropertiesHelper.setCamelProperties(camelContext, + dataformat, parameters, false); + } catch (Exception e) { + throw new RuntimeCamelException(e); + } + if (ObjectHelper.isNotEmpty(customizers)) { + for (DataFormatCustomizer<any23DataFormat> customizer : customizers) { + boolean useCustomizer = (customizer instanceof HasId) + ? HierarchicalPropertiesEvaluator.evaluate( + applicationContext.getEnvironment(), + "camel.dataformat.customizer", + "camel.dataformat.any23.customizer", + ((HasId) customizer).getId()) + : HierarchicalPropertiesEvaluator.evaluate( + applicationContext.getEnvironment(), + "camel.dataformat.customizer", + "camel.dataformat.any23.customizer"); + if (useCustomizer) { + LOGGER.debug( + "Configure dataformat {}, with customizer {}", + dataformat, customizer); + customizer.customize(dataformat); + } + } + } + return dataformat; + } + }; + } +} \ No newline at end of file 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 new file mode 100644 index 0000000..06565e8 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-any23-starter/src/main/java/org/apache/camel/dataformat/any23/springboot/any23DataFormatConfiguration.java @@ -0,0 +1,54 @@ +/* + * 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. + */ +package org.apache.camel.dataformat.any23.springboot; + +import javax.annotation.Generated; +import org.apache.camel.spring.boot.DataFormatConfigurationPropertiesCommon; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Any23 data format is used for parsing data to RDF. + * + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Generated("org.apache.camel.maven.packaging.SpringBootAutoConfigurationMojo") +@ConfigurationProperties(prefix = "camel.dataformat.any23") +public class any23DataFormatConfiguration + extends + DataFormatConfigurationPropertiesCommon { + + /** + * Whether to enable auto configuration of the any23 data format. This is + * enabled by default. + */ + private Boolean enabled; + /** + * 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. + */ + private Boolean contentTypeHeader = false; + + public Boolean getContentTypeHeader() { + return contentTypeHeader; + } + + public void setContentTypeHeader(Boolean contentTypeHeader) { + this.contentTypeHeader = contentTypeHeader; + } +} \ No newline at end of file diff --git a/platforms/spring-boot/components-starter/camel-any23-starter/src/main/resources/META-INF/LICENSE.txt b/platforms/spring-boot/components-starter/camel-any23-starter/src/main/resources/META-INF/LICENSE.txt new file mode 100644 index 0000000..6b0b127 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-any23-starter/src/main/resources/META-INF/LICENSE.txt @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. + diff --git a/platforms/spring-boot/components-starter/camel-any23-starter/src/main/resources/META-INF/NOTICE.txt b/platforms/spring-boot/components-starter/camel-any23-starter/src/main/resources/META-INF/NOTICE.txt new file mode 100644 index 0000000..2e215bf --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-any23-starter/src/main/resources/META-INF/NOTICE.txt @@ -0,0 +1,11 @@ + ========================================================================= + == NOTICE file corresponding to the section 4 d of == + == the Apache License, Version 2.0, == + == in this case for the Apache Camel distribution. == + ========================================================================= + + This product includes software developed by + The Apache Software Foundation (http://www.apache.org/). + + Please read the different LICENSE files present in the licenses directory of + this distribution. diff --git a/platforms/spring-boot/components-starter/camel-any23-starter/src/main/resources/META-INF/spring.factories b/platforms/spring-boot/components-starter/camel-any23-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000..77190b5 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-any23-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,19 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- + +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +org.apache.camel.dataformat.any23.springboot.any23DataFormatAutoConfiguration diff --git a/platforms/spring-boot/components-starter/camel-any23-starter/src/main/resources/META-INF/spring.provides b/platforms/spring-boot/components-starter/camel-any23-starter/src/main/resources/META-INF/spring.provides new file mode 100644 index 0000000..04d05f9 --- /dev/null +++ b/platforms/spring-boot/components-starter/camel-any23-starter/src/main/resources/META-INF/spring.provides @@ -0,0 +1,17 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- +provides: camel-any23 diff --git a/platforms/spring-boot/components-starter/pom.xml b/platforms/spring-boot/components-starter/pom.xml index 71a2e7c..a1c5f71 100644 --- a/platforms/spring-boot/components-starter/pom.xml +++ b/platforms/spring-boot/components-starter/pom.xml @@ -105,6 +105,7 @@ <module>camel-ahc-starter</module> <module>camel-ahc-ws-starter</module> <module>camel-amqp-starter</module> + <module>camel-any23-starter</module> <module>camel-apns-starter</module> <module>camel-as2-starter</module> <module>camel-asn1-starter</module>