You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/02/10 11:21:54 UTC

[3/4] camel git commit: CAMEL-10811 Provide sample Salesforce connector...

CAMEL-10811 Provide sample Salesforce connector...

... component and example

This adds a `org.foo:salesforce-upsert-contact-connector` connector
component and updates the `camel/connectors/examples/twitter-salesforce-
example` to use it.


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

Branch: refs/heads/master
Commit: c8d2aad1685568ac8cdc59e9e956914435fa9535
Parents: 36c8dff
Author: Zoran Regvart <zo...@regvart.com>
Authored: Thu Feb 9 14:48:12 2017 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Feb 10 11:22:39 2017 +0100

----------------------------------------------------------------------
 connectors/examples/pom.xml                     |    1 +
 .../salesforce-upsert-contact-connector/pom.xml |  151 +
 .../salesforce-authentication.properties.sample |   23 +
 .../foo/salesforce/upsert/contact/Contact.java  | 3317 ++++++++++++++++++
 .../upsert/contact/Contact_CleanStatusEnum.java |   69 +
 .../upsert/contact/Contact_LeadSourceEnum.java  |   63 +
 .../upsert/contact/Contact_LevelEnum.java       |   59 +
 .../Contact_MailingGeocodeAccuracyEnum.java     |   75 +
 .../Contact_OtherGeocodeAccuracyEnum.java       |   75 +
 .../upsert/contact/Contact_SalutationEnum.java  |   63 +
 .../upsert/contact/QueryRecordsContact.java     |   43 +
 .../SalesforceUpsertContactComponent.java       |   30 +
 .../camel/component/salesforce-upsert-contact   |   18 +
 .../main/resources/camel-connector-schema.json  |   25 +
 .../src/main/resources/camel-connector.json     |   20 +
 .../examples/twitter-salesforce-example/pom.xml |    5 +
 .../java/org/foo/MentionAddContractRoute.java   |    4 +-
 .../main/java/org/foo/TweetToContactMapper.java |   48 +
 .../src/main/resources/application.properties   |    9 +
 19 files changed, 4097 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c8d2aad1/connectors/examples/pom.xml
----------------------------------------------------------------------
diff --git a/connectors/examples/pom.xml b/connectors/examples/pom.xml
index 278d76d..2148263 100644
--- a/connectors/examples/pom.xml
+++ b/connectors/examples/pom.xml
@@ -38,6 +38,7 @@
     <module>foo-bar-wine-example</module>
     <module>twitter-mention-connector</module>
     <module>twitter-salesforce-example</module>
+    <module>salesforce-upsert-contact-connector</module>
   </modules>
 
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/c8d2aad1/connectors/examples/salesforce-upsert-contact-connector/pom.xml
----------------------------------------------------------------------
diff --git a/connectors/examples/salesforce-upsert-contact-connector/pom.xml b/connectors/examples/salesforce-upsert-contact-connector/pom.xml
new file mode 100644
index 0000000..26f2f33
--- /dev/null
+++ b/connectors/examples/salesforce-upsert-contact-connector/pom.xml
@@ -0,0 +1,151 @@
+<?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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>connectors-examples</artifactId>
+    <version>2.19.0-SNAPSHOT</version>
+    <relativePath>..</relativePath>
+  </parent>
+
+  <groupId>org.foo</groupId>
+  <artifactId>salesforce-upsert-contact-connector</artifactId>
+  <name>Camel :: Connectors :: Examples :: Salesforce Upsert Contact Connector</name>
+  <description>Salesforce Upsert Contact Connector</description>
+
+  <properties>
+    <camel.version>${project.version}</camel.version>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-salesforce</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-salesforce-starter</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-connector</artifactId>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <!-- add src/generated/java as source directory -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>add-dto-source</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>add-source</goal>
+            </goals>
+            <configuration>
+              <sources>
+                <source>src/generated/java</source>
+              </sources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+
+      <!-- generate connector -->
+      <plugin>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-connector-maven-plugin</artifactId>
+        <version>${camel.version}</version>
+        <executions>
+          <execution>
+            <id>generate-connector</id>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+    </plugins>
+  </build>
+
+  <profiles>
+    <profile>
+      <id>regenerate-dto</id>
+      <activation>
+        <file>
+          <exists>salesforce-authentication.properties</exists>
+        </file>
+      </activation>
+
+      <build>
+        <plugins>
+
+          <!-- read Salesforce authentication properties -->
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>properties-maven-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>read-salesforce-authentication-properties</id>
+                <phase>initialize</phase>
+                <goals>
+                  <goal>read-project-properties</goal>
+                </goals>
+                <configuration>
+                  <files>
+                    <file>salesforce-authentication.properties</file>
+                  </files>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+
+          <!-- generate Contact DTOs -->
+          <plugin>
+            <groupId>org.apache.camel.maven</groupId>
+            <artifactId>camel-salesforce-maven-plugin</artifactId>
+            <version>${camel.version}</version>
+            <executions>
+              <execution>
+                <id>generate-dtos</id>
+                <goals>
+                  <goal>generate</goal>
+                </goals>
+                <configuration>
+                  <version>37.0</version>
+                  <outputDirectory>src/generated/java</outputDirectory>
+                  <packageName>org.foo.salesforce.upsert.contact</packageName>
+                  <includes>Contact</includes>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/c8d2aad1/connectors/examples/salesforce-upsert-contact-connector/salesforce-authentication.properties.sample
----------------------------------------------------------------------
diff --git a/connectors/examples/salesforce-upsert-contact-connector/salesforce-authentication.properties.sample b/connectors/examples/salesforce-upsert-contact-connector/salesforce-authentication.properties.sample
new file mode 100644
index 0000000..7cca838
--- /dev/null
+++ b/connectors/examples/salesforce-upsert-contact-connector/salesforce-authentication.properties.sample
@@ -0,0 +1,23 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+## Example properties needed by the camel-salesforce-maven-plugin to generate
+## DTOs
+camelSalesforce.clientId     = 
+camelSalesforce.clientSecret =
+camelSalesforce.password     =
+camelSalesforce.userName     =