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 2016/05/26 15:06:28 UTC

camel git commit: Added camel-slack docs to Gitbook

Repository: camel
Updated Branches:
  refs/heads/master e8b27bfcb -> f15176341


Added camel-slack docs to Gitbook


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

Branch: refs/heads/master
Commit: f15176341812d2a7db60d0369ad844ca06ca86c1
Parents: e8b27bf
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu May 26 17:05:53 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu May 26 17:05:53 2016 +0200

----------------------------------------------------------------------
 components/camel-slack/src/main/docs/slack.adoc | 134 +++++++++++++++++++
 docs/user-manual/en/SUMMARY.md                  |   1 +
 2 files changed, 135 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f1517634/components/camel-slack/src/main/docs/slack.adoc
----------------------------------------------------------------------
diff --git a/components/camel-slack/src/main/docs/slack.adoc b/components/camel-slack/src/main/docs/slack.adoc
new file mode 100644
index 0000000..08563b8
--- /dev/null
+++ b/components/camel-slack/src/main/docs/slack.adoc
@@ -0,0 +1,134 @@
+[[Slack-SlackComponent]]
+Slack Component
+~~~~~~~~~~~~~~~
+
+*Available as of Camel 2.16*
+
+The�*slack*�component allows you to connect to an instance
+of�http://www.slack.com/[Slack]�and delivers a message contained in the
+message body via a pre
+established�https://api.slack.com/incoming-webhooks[Slack incoming
+webhook].
+
+Maven users will need to add the following dependency to their `pom.xml`
+for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-slack</artifactId>
+    <version>x.x.x</version>
+    <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+[[Slack-URIformat]]
+URI format
+^^^^^^^^^^
+
+To send a message to a channel.
+
+[source,java]
+------------------------
+slack:#channel[?options]
+------------------------
+
+To send a direct message to a slackuser.
+
+[source,java]
+-------------------------
+slack:@username[?options]
+-------------------------
+
+[[Slack-Options]]
+Options
+^^^^^^^
+
+
+// component options: START
+The Slack component supports 1 options which are listed below.
+
+
+
+{% raw %}
+[width="100%",cols="2s,1m,8",options="header"]
+|=======================================================================
+| Name | Java Type | Description
+| webhookUrl | String | The incoming webhook URL
+|=======================================================================
+{% endraw %}
+// component options: END
+
+
+
+// endpoint options: START
+The Slack component supports 7 endpoint options which are listed below:
+
+{% raw %}
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| channel | producer |  | String | *Required* The channel name (syntax name) or slackuser (syntax userName) to send a message directly to an user.
+| iconEmoji | producer |  | String | Use a Slack emoji as an avatar
+| iconUrl | producer |  | String | The avatar that the component will use when sending message to a channel or user.
+| username | producer |  | String | This is the username that the bot will have when sending messages to a channel or user.
+| webhookUrl | producer |  | String | The incoming webhook URL
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
+| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+|=======================================================================
+{% endraw %}
+// endpoint options: END
+
+
+[[Slack-SlackComponent.1]]
+SlackComponent
+^^^^^^^^^^^^^^
+
+The SlackComponent with XML must be configured as a Spring or Blueprint
+bean that contains the incoming webhook url for the integration as a
+parameter.
+
+[source,xml]
+-----------------------------------------------------------------------------------------------------------------------
+<bean id="slack" class="org.apache.camel.component.slack.SlackComponent">
+    <property name="webhookUrl" value="https://hooks.slack.com/services/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"/>
+</bean>
+-----------------------------------------------------------------------------------------------------------------------
+
+For Java you can configure this using Java code.
+
+[[Slack-Example]]
+Example
+^^^^^^^
+
+A CamelContext with Blueprint could be as:
+
+[source,xml]
+---------------------------------------------------------------------------------------------------------------------------
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy">
+
+    <bean id="slack" class="org.apache.camel.component.slack.SlackComponent">
+        <property name="webhookUrl" value="https://hooks.slack.com/services/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"/>
+    </bean>
+
+    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+        <route>
+            <from uri="direct:test"/>
+            <to uri="slack:#channel?iconEmoji=:camel:&amp;username=CamelTest"/>
+        </route>
+    </camelContext>
+
+</blueprint>
+---------------------------------------------------------------------------------------------------------------------------
+
+[[Slack-SeeAlso]]
+See Also
+^^^^^^^^
+
+* link:configuring-camel.html[Configuring Camel]
+* link:component.html[Component]
+* link:endpoint.html[Endpoint]
+* link:getting-started.html[Getting Started]
+

http://git-wip-us.apache.org/repos/asf/camel/blob/f1517634/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index 3808fe8..9c50528 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -238,6 +238,7 @@
     * [SIP](sip.adoc)
     * [SJMS](sjms.adoc)
     * [SJMS Batch](sjms-batch.adoc)
+    * [Slack](slack.adoc)
     * [Telegram](telegram.adoc)
     * [Twitter](twitter.adoc)
     * [Websocket](websocket.adoc)