CAMEL-10472 Update Salesforce component to support recent items REST API

 - added documentation.
 - updates by
camel-package-maven-plugin:prepare-spring-boot-auto-configuration to the
SalesforceComponentConfiguration.java.

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

Branch: refs/heads/master
Commit: 679b09982d889ad5de6a24a0baf9ad916f4fd3b7
Parents: 4e3b2f7
Author: Zoran Regvart <zo...@regvart.com>
Authored: Tue Nov 22 18:48:41 2016 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Wed Nov 23 09:44:01 2016 +0100

----------------------------------------------------------------------
 .../SalesforceComponentConfiguration.java       | 15 +++++++++++++++
 .../src/main/docs/salesforce-component.adoc     | 20 +++++++++++++++++++-
 2 files changed, 34 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/679b0998/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java
----------------------------------------------------------------------
diff --git 
a/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java
 
b/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java
index 30b68c5..91f478c 100644
--- 
a/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java
+++ 
b/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java
@@ -394,6 +394,13 @@ public class SalesforceComponentConfiguration {
          * Replay IDs to start from per channel name.
          */
         private Map initialReplayIdMap;
+        /**
+         * Limit on number of returned records. Applicable to some of the API,
+         * check the Salesforce documentation.
+         * 
+         * @param limit
+         */
+        private Integer limit;
 
         public PayloadFormat getFormat() {
             return format;
@@ -676,6 +683,14 @@ public class SalesforceComponentConfiguration {
         public void setInitialReplayIdMap(Map initialReplayIdMap) {
             this.initialReplayIdMap = initialReplayIdMap;
         }
+
+        public Integer getLimit() {
+            return limit;
+        }
+
+        public void setLimit(Integer limit) {
+            this.limit = limit;
+        }
     }
 
     public static class SalesforceLoginConfigNestedConfiguration {

http://git-wip-us.apache.org/repos/asf/camel/blob/679b0998/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc
----------------------------------------------------------------------
diff --git 
a/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc
 
b/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc
index a3d062f..089ca7c 100644
--- 
a/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc
+++ 
b/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc
@@ -68,6 +68,7 @@ field
 results) using result link returned from the 'query' API
 * search - Runs a Salesforce SOSL query
 * limits - fetching organization API usage limits
+* recent - fetching recent items
 
 For example, the following producer endpoint uses the upsertSObject API,
 with the sObjectIdName parameter specifying 'Name' as the external id
@@ -218,6 +219,22 @@ from("direct:querySalesforce")
     .endChoice()
 
-----------------------------------------------------------------------------------------------------
 
+[[Salesforce-RecentItems]]
+Using Salesforce Recent Items API
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To fetch the recent items use `salesforce:recent` operation. This operation 
returns an `java.util.List` of
+`org.apache.camel.component.salesforce.api.dto.RecentItem` objects 
(`List<RecentItem>`) that in turn contain
+the `Id`, `Name` and `Attributes` (with `type` and `url` properties). You can 
limit the number of returned items
+by specifying `limit` parameter set to maximum number of records to return. 
For example:
+
+[source,java]
+-----------------------------------------------------------------------------------------------------
+from("direct:fetchRecentItems")
+    to("salesforce:recent")
+        .split().body()
+            .log("${body.name} at ${body.attributes.url}");
+-----------------------------------------------------------------------------------------------------
 
 [[Salesforce-CamelSalesforceMavenPlugin]]
 Camel Salesforce Maven Plugin
@@ -275,7 +292,7 @@ The Salesforce component supports 16 options which are 
listed below.
 
 
 // endpoint options: START
-The Salesforce component supports 41 endpoint options which are listed below:
+The Salesforce component supports 42 endpoint options which are listed below:
 
 {% raw %}
 [width="100%",cols="2,1,1m,1m,5",options="header"]
@@ -297,6 +314,7 @@ The Salesforce component supports 41 endpoint options which 
are listed below:
 | initialReplayIdMap | common |  | Map | Replay IDs to start from per channel 
name.
 | instanceId | common |  | String | Salesforce1 Analytics report execution 
instance ID
 | jobId | common |  | String | Bulk API Job ID
+| limit | common |  | Integer | Limit on number of returned records. 
Applicable to some of the API check the Salesforce documentation.
 | maxBackoff | common |  | long | Maximum backoff interval for Streaming 
connection restart attempts for failures beyond CometD auto-reconnect.
 | notifyForFields | common |  | NotifyForFieldsEnum | Notify for fields 
options are ALL REFERENCED SELECT WHERE
 | notifyForOperationCreate | common |  | Boolean | Notify for create operation 
defaults to false (API version = 29.0)

Reply via email to