camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: CAMEL-9541: Do readme file for camel-core also
Date Thu, 18 Aug 2016 15:20:39 GMT
Repository: camel
Updated Branches:
  refs/heads/master 9752c5863 -> e590e75da


CAMEL-9541: Do readme file for camel-core also


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e590e75d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e590e75d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e590e75d

Branch: refs/heads/master
Commit: e590e75da29f1eb9f8d9e62487652eb96d68090e
Parents: 9752c58
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Thu Aug 18 17:20:18 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Aug 18 17:20:33 2016 +0200

----------------------------------------------------------------------
 camel-core/readme.adoc                          | 149 +++++++++++++++++++
 .../maven/packaging/PrepareReadmeMojo.java      |  76 ++++++----
 2 files changed, 200 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/e590e75d/camel-core/readme.adoc
----------------------------------------------------------------------
diff --git a/camel-core/readme.adoc b/camel-core/readme.adoc
new file mode 100644
index 0000000..22fbc8c
--- /dev/null
+++ b/camel-core/readme.adoc
@@ -0,0 +1,149 @@
+Components
+^^^^^^^^^^
+
+
+
+// components: START
+[width="100%",cols="4,6",options="header"]
+|=======================================================================
+| Component | Description
+
+| link:camel-core[Bean] (camel-core) +
+`bean:beanName` | The bean component is for invoking Java beans from Camel.
+
+| link:camel-core[Binding] (camel-core) +
+`binding:bindingName:delegateUri` | The binding component is used for as a of wrapping an
Endpoint in a contract with a data format.
+
+| link:camel-core[Browse] (camel-core) +
+`browse:name` | The browse component is used for viewsing the messages received on endpoints
that supports BrowsableEndpoint.
+
+| link:camel-core[Class] (camel-core) +
+`class:beanName` | The Class Component is for invoking Java Classes (Java beans) from Camel.
+
+| link:camel-core[Control Bus] (camel-core) +
+`controlbus:command:language` | The controlbus component provides easy management of Camel
applications based on the Control Bus EIP pattern.
+
+| link:camel-core[Data Format] (camel-core) +
+`dataformat:name:operation` | The dataformat component is used for working with Data Formats
as if it was a regular Component supporting Endpoints and URIs.
+
+| link:camel-core[Dataset] (camel-core) +
+`dataset:name` | The dataset component provides a mechanism to easily perform load &
soak testing of your system.
+
+| link:camel-core[Direct] (camel-core) +
+`direct:name` | The direct component provides direct synchronous call to another endpoint
from the same CamelContext.
+
+| link:camel-core[Direct VM] (camel-core) +
+`direct-vm:name` | The direct-vm component provides direct synchronous call to another endpoint
from any CamelContext in the same JVM.
+
+| link:camel-core[File] (camel-core) +
+`file:directoryName` | The file component is used for reading or writing files.
+
+| link:camel-core[Language] (camel-core) +
+`language:languageName:resourceUri` | The language component allows you to send a message
to an endpoint which executes a script by any of the supported Languages in Camel.
+
+| link:camel-core[Log] (camel-core) +
+`log:loggerName` | The log component logs message exchanges to the underlying logging mechanism.
+
+| link:camel-core[Mock] (camel-core) +
+`mock:name` | The mock component is used for testing routes and mediation rules using mocks.
+
+| link:camel-core[Properties] (camel-core) +
+`properties:key` | The properties component is used for using property placeholders in endpoint
uris.
+
+| link:camel-core[Ref] (camel-core) +
+`ref:name` | The ref component is used for lookup of existing endpoints bound in the Registry.
+
+| link:camel-core[REST] (camel-core) +
+`rest:method:path:uriTemplate` | The rest component is used for hosting REST services which
has been defined using the rest-dsl in Camel.
+
+| link:camel-core[REST API] (camel-core) +
+`rest-api:path/contextIdPattern` | The rest-api component is used for providing Swagger API
of the REST services which has been defined using the rest-dsl in Camel.
+
+| link:camel-core[Scheduler] (camel-core) +
+`scheduler:name` | The scheduler component is used for generating message exchanges when
a scheduler fires.
+
+| link:camel-core[SEDA] (camel-core) +
+`seda:name` | The seda component provides asynchronous call to another endpoint from any
CamelContext in the same JVM.
+
+| link:camel-core[Stub] (camel-core) +
+`stub:name` | The stub component provides a simple way to stub out any physical endpoints
while in development or testing.
+
+| link:camel-core[Test] (camel-core) +
+`test:name` | The test component extends the mock component by on startup to pull messages
from another endpoint to set the expected message bodies.
+
+| link:camel-core[Timer] (camel-core) +
+`timer:timerName` | The timer component is used for generating message exchanges when a timer
fires.
+
+| link:camel-core[Validator] (camel-core) +
+`validator:resourceUri` | Validates the payload of a message using XML Schema and JAXP Validation.
+
+| link:camel-core[VM] (camel-core) +
+`vm:name` | The vm component provides asynchronous call to another endpoint from the same
CamelContext.
+
+| link:camel-core[XSLT] (camel-core) +
+`xslt:resourceUri` | Transforms the message using a XSLT template.
+
+|=======================================================================
+// components: END
+
+
+
+
+Data Formats
+^^^^^^^^^^^^
+
+
+
+// dataformats: START
+[width="100%",cols="4,6",options="header"]
+|=======================================================================
+| Data Format | Description
+
+| link:camel-core[GZip] (camel-core) | The Core Camel Java DSL based router
+
+| link:camel-core[Java Object Serialization] (camel-core) | The Core Camel Java DSL based
router
+
+| link:camel-core[String Encoding] (camel-core) | The Core Camel Java DSL based router
+
+| link:camel-core[Zip Deflate Compression] (camel-core) | The Core Camel Java DSL based router
+|=======================================================================
+// dataformats: END
+
+
+
+
+
+Expression Languages
+^^^^^^^^^^^^^^^^^^^^
+
+
+
+// languages: START
+[width="100%",cols="4,6",options="header"]
+|=======================================================================
+| Language | Description
+
+| link:camel-core[Bean method] (camel-core) | For expressions and predicates using a java
bean (aka method call)
+
+| link:camel-core[Constant] (camel-core) | For expressions and predicates using a constant
+
+| link:camel-core[ExchangeProperty] (camel-core) | An expression which extracts the named
exchange property
+
+| link:camel-core[File] (camel-core) | For expressions and predicates using the file/simple
language
+
+| link:camel-core[Header] (camel-core) | An expression which extracts the named exchange
header
+
+| link:camel-core[Ref] (camel-core) | For using a custom expression
+
+| link:camel-core[Simple] (camel-core) | For expressions and predicates using the simple
language
+
+| link:camel-core[Tokenize] (camel-core) | For expressions and predicates using a body or
header tokenizer.
+
+| link:camel-core[XML Tokenize] (camel-core) | For expressions and predicates using a body
or header tokenizer.
+
+| link:camel-core[XPath] (camel-core) | For XPath expressions and predicates
+|=======================================================================
+// languages: END
+
+
+

http://git-wip-us.apache.org/repos/asf/camel/blob/e590e75d/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareReadmeMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareReadmeMojo.java
b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareReadmeMojo.java
index b45ef75..c9a38b4 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareReadmeMojo.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareReadmeMojo.java
@@ -109,12 +109,17 @@ public class PrepareReadmeMojo extends AbstractMojo {
      * @throws MojoFailureException   something bad happened...
      */
     public void execute() throws MojoExecutionException, MojoFailureException {
-        executeComponentsReadme();
-        executeDataFormatsReadme();
-        executeLanguagesReadme();
+        // update readme file in camel-core
+        executeComponentsReadme(true);
+        executeDataFormatsReadme(true);
+        executeLanguagesReadme(true);
+        // update readme file in components
+        executeComponentsReadme(false);
+        executeDataFormatsReadme(false);
+        executeLanguagesReadme(false);
     }
 
-    protected void executeComponentsReadme() throws MojoExecutionException, MojoFailureException
{
+    protected void executeComponentsReadme(boolean core) throws MojoExecutionException, MojoFailureException
{
         Set<File> componentFiles = new TreeSet<>();
 
         if (componentsDir != null && componentsDir.isDirectory()) {
@@ -146,16 +151,23 @@ public class PrepareReadmeMojo extends AbstractMojo {
             // sor the models
             Collections.sort(models, new ComponentComparator());
 
-            // filter out camel-core
+            // filter out unwanted components
             List<ComponentModel> components = new ArrayList<>();
             for (ComponentModel model : models) {
-                if (!"camel-core".equals(model.getArtifactId())) {
+                if (core && "camel-core".equals(model.getArtifactId())) {
+                    components.add(model);
+                } else if (!core && !"camel-core".equals(model.getArtifactId()))
{
                     components.add(model);
                 }
             }
 
-            // update the big readme file in the components dir
-            File file = new File(readmeComponentsDir, "readme.adoc");
+            // update the big readme file in the core/components dir
+            File file;
+            if (core) {
+                file = new File(readmeCoreDir, "readme.adoc");
+            } else {
+                file = new File(readmeComponentsDir, "readme.adoc");
+            }
 
             // update regular components
             boolean exists = file.exists();
@@ -163,11 +175,11 @@ public class PrepareReadmeMojo extends AbstractMojo {
             boolean updated = updateComponents(file, changed);
 
             if (updated) {
-                getLog().info("Updated components/readme.adoc file: " + file);
+                getLog().info("Updated readme.adoc file: " + file);
             } else if (exists) {
-                getLog().debug("No changes to components/readme.adoc file: " + file);
+                getLog().debug("No changes to readme.adoc file: " + file);
             } else {
-                getLog().warn("No components/readme.adoc file: " + file);
+                getLog().warn("No readme.adoc file: " + file);
             }
 
         } catch (IOException e) {
@@ -175,7 +187,7 @@ public class PrepareReadmeMojo extends AbstractMojo {
         }
     }
 
-    protected void executeDataFormatsReadme() throws MojoExecutionException, MojoFailureException
{
+    protected void executeDataFormatsReadme(boolean core) throws MojoExecutionException,
MojoFailureException {
         Set<File> dataFormatFiles = new TreeSet<>();
 
         if (dataFormatsDir != null && dataFormatsDir.isDirectory()) {
@@ -199,13 +211,20 @@ public class PrepareReadmeMojo extends AbstractMojo {
             // filter out camel-core
             List<DataFormatModel> dataFormats = new ArrayList<>();
             for (DataFormatModel model : models) {
-                if (!"camel-core".equals(model.getArtifactId())) {
+                if (core && "camel-core".equals(model.getArtifactId())) {
+                    dataFormats.add(model);
+                } else if (!core && !"camel-core".equals(model.getArtifactId()))
{
                     dataFormats.add(model);
                 }
             }
 
-            // update the big readme file in the components dir
-            File file = new File(readmeComponentsDir, "readme.adoc");
+            // update the big readme file in the core/components dir
+            File file;
+            if (core) {
+                file = new File(readmeCoreDir, "readme.adoc");
+            } else {
+                file = new File(readmeComponentsDir, "readme.adoc");
+            }
 
             // update regular data formats
             boolean exists = file.exists();
@@ -213,11 +232,11 @@ public class PrepareReadmeMojo extends AbstractMojo {
             boolean updated = updateDataFormats(file, changed);
 
             if (updated) {
-                getLog().info("Updated components/readme.adoc file: " + file);
+                getLog().info("Updated readme.adoc file: " + file);
             } else if (exists) {
-                getLog().debug("No changes to components/readme.adoc file: " + file);
+                getLog().debug("No changes to readme.adoc file: " + file);
             } else {
-                getLog().warn("No components/readme.adoc file: " + file);
+                getLog().warn("No readme.adoc file: " + file);
             }
 
         } catch (IOException e) {
@@ -225,7 +244,7 @@ public class PrepareReadmeMojo extends AbstractMojo {
         }
     }
 
-    protected void executeLanguagesReadme() throws MojoExecutionException, MojoFailureException
{
+    protected void executeLanguagesReadme(boolean core) throws MojoExecutionException, MojoFailureException
{
         Set<File> languageFiles = new TreeSet<>();
 
         if (languagesDir != null && languagesDir.isDirectory()) {
@@ -249,13 +268,20 @@ public class PrepareReadmeMojo extends AbstractMojo {
             // filter out camel-core
             List<LanguageModel> languages = new ArrayList<>();
             for (LanguageModel model : models) {
-                if (!"camel-core".equals(model.getArtifactId())) {
+                if (core && "camel-core".equals(model.getArtifactId())) {
+                    languages.add(model);
+                } else if (!core && !"camel-core".equals(model.getArtifactId()))
{
                     languages.add(model);
                 }
             }
 
-            // update the big readme file in the components dir
-            File file = new File(readmeComponentsDir, "readme.adoc");
+            // update the big readme file in the core/components dir
+            File file;
+            if (core) {
+                file = new File(readmeCoreDir, "readme.adoc");
+            } else {
+                file = new File(readmeComponentsDir, "readme.adoc");
+            }
 
             // update regular data formats
             boolean exists = file.exists();
@@ -263,11 +289,11 @@ public class PrepareReadmeMojo extends AbstractMojo {
             boolean updated = updateLanguages(file, changed);
 
             if (updated) {
-                getLog().info("Updated components/readme.adoc file: " + file);
+                getLog().info("Updated readme.adoc file: " + file);
             } else if (exists) {
-                getLog().debug("No changes to components/readme.adoc file: " + file);
+                getLog().debug("No changes to readme.adoc file: " + file);
             } else {
-                getLog().warn("No components/readme.adoc file: " + file);
+                getLog().warn("No readme.adoc file: " + file);
             }
 
         } catch (IOException e) {


Mime
View raw message