This is an automated email from the ASF dual-hosted git repository.
dgriffon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git
The following commit(s) were added to refs/heads/master by this push:
new a4eecbad4 UNOMI-826 : remove mailchimp from unomi (#663)
a4eecbad4 is described below
commit a4eecbad4ca5e3487f6be8b8fb2f4ad83a7e6a91
Author: David Griffon <[email protected]>
AuthorDate: Mon May 13 17:13:46 2024 +0200
UNOMI-826 : remove mailchimp from unomi (#663)
---
extensions/pom.xml | 1 -
extensions/unomi-mailchimp/actions/pom.xml | 47 ---
.../actions/AddVisitorToMailChimpListAction.java | 55 ---
.../RemoveVisitorFromMailChimpListAction.java | 54 ---
.../UnsubscribeVisitorFromMailChimpListAction.java | 63 ---
.../actions/AddVisitorToMailChimpListAction.json | 20 -
.../RemoveVisitorFromMailChimpListAction.json | 20 -
.../UnsubscribeVisitorFromMailChimpListAction.json | 20 -
.../resources/OSGI-INF/blueprint/blueprint.xml | 53 ---
extensions/unomi-mailchimp/karaf-kar/pom.xml | 81 ----
.../karaf-kar/src/main/feature/feature.xml | 30 --
extensions/unomi-mailchimp/pom.xml | 38 --
extensions/unomi-mailchimp/rest/pom.xml | 120 ------
.../unomi/mailchimp/rest/MailChimpEndPoint.java | 67 ----
extensions/unomi-mailchimp/services/pom.xml | 116 ------
.../apache/unomi/mailchimp/services/HttpUtils.java | 153 --------
.../unomi/mailchimp/services/MailChimpResult.java | 28 --
.../unomi/mailchimp/services/MailChimpService.java | 73 ----
.../services/internal/MailChimpServiceImpl.java | 434 ---------------------
.../resources/OSGI-INF/blueprint/blueprint.xml | 46 ---
.../org.apache.unomi.mailchimpconnector.cfg | 26 --
manual/src/main/asciidoc/builtin-event-types.adoc | 12 +-
.../src/main/asciidoc/connectors/connectors.adoc | 2 -
.../asciidoc/connectors/mailchimp-connector.adoc | 100 -----
manual/src/main/asciidoc/index.adoc | 2 -
.../main/resources/etc/custom.system.properties | 14 -
26 files changed, 3 insertions(+), 1672 deletions(-)
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 7d44f616c..c12d6f8be 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -36,7 +36,6 @@
<module>geonames</module>
<module>router</module>
<module>salesforce-connector</module>
- <module>unomi-mailchimp</module>
<module>weather-update</module>
<module>web-tracker</module>
<module>groovy-actions</module>
diff --git a/extensions/unomi-mailchimp/actions/pom.xml
b/extensions/unomi-mailchimp/actions/pom.xml
deleted file mode 100644
index 981d68821..000000000
--- a/extensions/unomi-mailchimp/actions/pom.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?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.unomi</groupId>
- <artifactId>unomi-mailchimp-connector</artifactId>
- <version>2.5.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>unomi-mailchimp-connector-actions</artifactId>
- <name>Apache Unomi :: Extensions :: MailChimp Connector :: Actions</name>
- <description>A connector between Apache Unomi and MailChimp
API</description>
- <packaging>bundle</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.unomi</groupId>
- <artifactId>unomi-api</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.unomi</groupId>
- <artifactId>unomi-mailchimp-connector-services</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git
a/extensions/unomi-mailchimp/actions/src/main/java/org/apache/unomi/mailchimp/actions/AddVisitorToMailChimpListAction.java
b/extensions/unomi-mailchimp/actions/src/main/java/org/apache/unomi/mailchimp/actions/AddVisitorToMailChimpListAction.java
deleted file mode 100644
index 152e72b71..000000000
---
a/extensions/unomi-mailchimp/actions/src/main/java/org/apache/unomi/mailchimp/actions/AddVisitorToMailChimpListAction.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.unomi.mailchimp.actions;
-
-import org.apache.unomi.api.Event;
-import org.apache.unomi.api.actions.Action;
-import org.apache.unomi.api.actions.ActionExecutor;
-import org.apache.unomi.api.services.EventService;
-import org.apache.unomi.mailchimp.services.MailChimpResult;
-import org.apache.unomi.mailchimp.services.MailChimpService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public class AddVisitorToMailChimpListAction implements ActionExecutor {
- private static Logger logger =
LoggerFactory.getLogger(AddVisitorToMailChimpListAction.class);
- private MailChimpService mailChimpService;
-
- public void setMailChimpService(MailChimpService mailChimpService) {
- this.mailChimpService = mailChimpService;
- }
-
- @Override
- public int execute(Action action, Event event) {
-
- MailChimpResult result =
mailChimpService.addToMCList(event.getProfile(), action);
- switch (result) {
-
- case UPDATED:
- logger.info("The visitor has been successfully added in
MailChimp list and subscribed");
- break;
- case NO_CHANGE:
- logger.info("The visitor is already in the MailChimp list and
subscribed");
- break;
- default:
- break;
- }
- return EventService.NO_CHANGE;
- }
-}
diff --git
a/extensions/unomi-mailchimp/actions/src/main/java/org/apache/unomi/mailchimp/actions/RemoveVisitorFromMailChimpListAction.java
b/extensions/unomi-mailchimp/actions/src/main/java/org/apache/unomi/mailchimp/actions/RemoveVisitorFromMailChimpListAction.java
deleted file mode 100644
index c83fbbb73..000000000
---
a/extensions/unomi-mailchimp/actions/src/main/java/org/apache/unomi/mailchimp/actions/RemoveVisitorFromMailChimpListAction.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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.unomi.mailchimp.actions;
-
-import org.apache.unomi.api.Event;
-import org.apache.unomi.api.actions.Action;
-import org.apache.unomi.api.actions.ActionExecutor;
-import org.apache.unomi.api.services.EventService;
-import org.apache.unomi.mailchimp.services.MailChimpResult;
-import org.apache.unomi.mailchimp.services.MailChimpService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RemoveVisitorFromMailChimpListAction implements ActionExecutor {
- private static Logger logger =
LoggerFactory.getLogger(RemoveVisitorFromMailChimpListAction.class);
- private MailChimpService mailChimpService;
-
- public void setMailChimpService(MailChimpService mailChimpService) {
- this.mailChimpService = mailChimpService;
- }
-
- @Override
- public int execute(Action action, Event event) {
- MailChimpResult result =
mailChimpService.removeFromMCList(event.getProfile(), action);
- switch (result) {
-
- case REMOVED:
- logger.info("The visitor has been successfully removed from
MailChimp list");
- break;
- case NO_CHANGE:
- logger.info("Visitor was not part of the list");
- break;
- default:
- break;
- }
- return EventService.NO_CHANGE;
-
- }
-}
diff --git
a/extensions/unomi-mailchimp/actions/src/main/java/org/apache/unomi/mailchimp/actions/UnsubscribeVisitorFromMailChimpListAction.java
b/extensions/unomi-mailchimp/actions/src/main/java/org/apache/unomi/mailchimp/actions/UnsubscribeVisitorFromMailChimpListAction.java
deleted file mode 100644
index e02664f99..000000000
---
a/extensions/unomi-mailchimp/actions/src/main/java/org/apache/unomi/mailchimp/actions/UnsubscribeVisitorFromMailChimpListAction.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.unomi.mailchimp.actions;
-
-import org.apache.unomi.api.Event;
-import org.apache.unomi.api.actions.Action;
-import org.apache.unomi.api.actions.ActionExecutor;
-import org.apache.unomi.api.services.EventService;
-import org.apache.unomi.mailchimp.services.MailChimpResult;
-import org.apache.unomi.mailchimp.services.MailChimpService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class UnsubscribeVisitorFromMailChimpListAction implements
ActionExecutor {
- private static Logger logger =
LoggerFactory.getLogger(UnsubscribeVisitorFromMailChimpListAction.class);
- private MailChimpService mailChimpService;
-
- public void setMailChimpService(MailChimpService mailChimpService) {
- this.mailChimpService = mailChimpService;
- }
-
- @Override
- public int execute(Action action, Event event) {
- MailChimpResult result =
mailChimpService.unsubscribeFromMCList(event.getProfile(), action);
- switch (result) {
-
- case UPDATED:
- logger.info("The visitor has been successfully unsubscribed
from MailChimp list");
- break;
- case NO_CHANGE:
- logger.info("Visitor is already unsubscribed");
- break;
- case REMOVED:
- logger.info("Visitor was not part of the list");
- break;
-
- default:
- break;
- }
- return EventService.NO_CHANGE;
-
- }
-}
-
-
-
-
-
diff --git
a/extensions/unomi-mailchimp/actions/src/main/resources/META-INF/cxs/actions/AddVisitorToMailChimpListAction.json
b/extensions/unomi-mailchimp/actions/src/main/resources/META-INF/cxs/actions/AddVisitorToMailChimpListAction.json
deleted file mode 100644
index d1d64211c..000000000
---
a/extensions/unomi-mailchimp/actions/src/main/resources/META-INF/cxs/actions/AddVisitorToMailChimpListAction.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "metadata": {
- "id": "addVisitorToMailChimpListAction",
- "name": "Add the visitor to a MailChimp list",
- "description": "This action add the visitor to a defined MailChimp list",
- "systemTags": [
- "event",
- "availableToEndUser"
- ],
- "readOnly": true
- },
- "actionExecutor": "addVisitorToMailChimpList",
- "parameters": [
- {
- "id": "listIdentifier",
- "type": "string",
- "multivalued": false
- }
- ]
-}
diff --git
a/extensions/unomi-mailchimp/actions/src/main/resources/META-INF/cxs/actions/RemoveVisitorFromMailChimpListAction.json
b/extensions/unomi-mailchimp/actions/src/main/resources/META-INF/cxs/actions/RemoveVisitorFromMailChimpListAction.json
deleted file mode 100644
index 7cbcf329b..000000000
---
a/extensions/unomi-mailchimp/actions/src/main/resources/META-INF/cxs/actions/RemoveVisitorFromMailChimpListAction.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "metadata": {
- "id": "removeVisitorFromMailChimpListAction",
- "name": "Remove a visitor from a MailChimp List",
- "description": "Remove the visitor from a defined MailChimp list",
- "systemTags": [
- "event",
- "availableToEndUser"
- ],
- "readOnly": true
- },
- "actionExecutor": "removeVisitorFromMailChimpList",
- "parameters": [
- {
- "id": "listIdentifier",
- "type": "string",
- "multivalued": false
- }
- ]
-}
diff --git
a/extensions/unomi-mailchimp/actions/src/main/resources/META-INF/cxs/actions/UnsubscribeVisitorFromMailChimpListAction.json
b/extensions/unomi-mailchimp/actions/src/main/resources/META-INF/cxs/actions/UnsubscribeVisitorFromMailChimpListAction.json
deleted file mode 100644
index ea2dc954b..000000000
---
a/extensions/unomi-mailchimp/actions/src/main/resources/META-INF/cxs/actions/UnsubscribeVisitorFromMailChimpListAction.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "metadata": {
- "id": "unsubscribeVisitorFromMailChimpListAction",
- "name": "Unsubscribe a visitor from a MailChimp List",
- "description": "Unsubscribe the visitor from a defined MailChimp list",
- "systemTags": [
- "event",
- "availableToEndUser"
- ],
- "readOnly": true
- },
- "actionExecutor": "unsubscribeVisitorFromMailChimpList",
- "parameters": [
- {
- "id": "listIdentifier",
- "type": "string",
- "multivalued": false
- }
- ]
-}
diff --git
a/extensions/unomi-mailchimp/actions/src/main/resources/OSGI-INF/blueprint/blueprint.xml
b/extensions/unomi-mailchimp/actions/src/main/resources/OSGI-INF/blueprint/blueprint.xml
deleted file mode 100644
index d7376d683..000000000
---
a/extensions/unomi-mailchimp/actions/src/main/resources/OSGI-INF/blueprint/blueprint.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?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.
- -->
-
-<blueprint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
-
- <reference id="mailChimpService"
-
interface="org.apache.unomi.mailchimp.services.MailChimpService"/>
-
- <service interface="org.apache.unomi.api.actions.ActionExecutor">
- <service-properties>
- <entry key="actionExecutorId" value="addVisitorToMailChimpList"/>
- </service-properties>
- <bean
class="org.apache.unomi.mailchimp.actions.AddVisitorToMailChimpListAction">
- <property name="mailChimpService" ref="mailChimpService"/>
- </bean>
- </service>
-
- <service interface="org.apache.unomi.api.actions.ActionExecutor">
- <service-properties>
- <entry key="actionExecutorId"
value="removeVisitorFromMailChimpList"/>
- </service-properties>
- <bean
class="org.apache.unomi.mailchimp.actions.RemoveVisitorFromMailChimpListAction">
- <property name="mailChimpService" ref="mailChimpService"/>
- </bean>
- </service>
-
- <service interface="org.apache.unomi.api.actions.ActionExecutor">
- <service-properties>
- <entry key="actionExecutorId"
value="unsubscribeVisitorFromMailChimpList"/>
- </service-properties>
- <bean
class="org.apache.unomi.mailchimp.actions.UnsubscribeVisitorFromMailChimpListAction">
- <property name="mailChimpService" ref="mailChimpService"/>
- </bean>
- </service>
-
-</blueprint>
diff --git a/extensions/unomi-mailchimp/karaf-kar/pom.xml
b/extensions/unomi-mailchimp/karaf-kar/pom.xml
deleted file mode 100644
index efdccf9fa..000000000
--- a/extensions/unomi-mailchimp/karaf-kar/pom.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?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.unomi</groupId>
- <artifactId>unomi-mailchimp-connector</artifactId>
- <version>2.5.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>unomi-mailchimp-connector-karaf-kar</artifactId>
- <name>Apache Unomi :: Extensions :: MailChimp Connector :: Apache Karaf
Feature and KAR archive</name>
- <description>This is a simple Apache Unomi plugin.</description>
- <packaging>kar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.unomi</groupId>
- <artifactId>unomi-api</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.unomi</groupId>
- <artifactId>unomi-mailchimp-connector-services</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.unomi</groupId>
- <artifactId>unomi-mailchimp-connector-rest</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.unomi</groupId>
- <artifactId>unomi-mailchimp-connector-actions</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.karaf.tooling</groupId>
- <artifactId>karaf-maven-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
-
<includeTransitiveDependency>false</includeTransitiveDependency>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
-
- <plugins>
- <plugin>
- <groupId>org.apache.karaf.tooling</groupId>
- <artifactId>karaf-maven-plugin</artifactId>
- <configuration>
- <startLevel>85</startLevel>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/extensions/unomi-mailchimp/karaf-kar/src/main/feature/feature.xml
b/extensions/unomi-mailchimp/karaf-kar/src/main/feature/feature.xml
deleted file mode 100644
index 6c043b217..000000000
--- a/extensions/unomi-mailchimp/karaf-kar/src/main/feature/feature.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
- ~ 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.
- -->
-<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.1"
name="unomi-mailchimp-connector-karaf-feature">
- <feature name="unomi-mailchimp-connector-karaf-kar"
version="${project.version}"
- description="Apache Unomi :: Extensions :: MailChimp Connector ::
Apache Karaf Feature">
- <details>Connect Apache Unomi to MailChimp API</details>
- <feature>unomi-kar</feature>
- <configfile
finalname="/etc/org.apache.unomi.mailchimpconnector.cfg">mvn:org.apache.unomi/unomi-mailchimp-connector-services/${project.version}/cfg/mailchimpconnectorcfg</configfile>
- <bundle
start-level="90">mvn:org.apache.unomi/unomi-mailchimp-connector-services/${project.version}</bundle>
- <bundle
start-level="90">mvn:org.apache.unomi/unomi-mailchimp-connector-rest/${project.version}</bundle>
- <bundle
start-level="90">mvn:org.apache.unomi/unomi-mailchimp-connector-actions/${project.version}</bundle>
- </feature>
-</features>
-
-
diff --git a/extensions/unomi-mailchimp/pom.xml
b/extensions/unomi-mailchimp/pom.xml
deleted file mode 100644
index 5d1f219bd..000000000
--- a/extensions/unomi-mailchimp/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?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.unomi</groupId>
- <artifactId>unomi-extensions</artifactId>
- <version>2.5.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>unomi-mailchimp-connector</artifactId>
- <name>Apache Unomi :: Extensions :: MailChimp Connector</name>
- <description>Connector with the MailChimp API service</description>
- <packaging>pom</packaging>
-
- <modules>
- <module>services</module>
- <module>rest</module>
- <module>actions</module>
- <module>karaf-kar</module>
- </modules>
-</project>
diff --git a/extensions/unomi-mailchimp/rest/pom.xml
b/extensions/unomi-mailchimp/rest/pom.xml
deleted file mode 100644
index 3937b4094..000000000
--- a/extensions/unomi-mailchimp/rest/pom.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-<?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">
- <parent>
- <groupId>org.apache.unomi</groupId>
- <artifactId>unomi-mailchimp-connector</artifactId>
- <version>2.5.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>unomi-mailchimp-connector-rest</artifactId>
- <name>Apache Unomi :: Extensions :: MailChimp Connector :: REST API</name>
- <description>REST API for the Apache Unomi Context Server extension that
integrates with MailChimp</description>
- <packaging>bundle</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.unomi</groupId>
- <artifactId>unomi-api</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-frontend-jaxws</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-frontend-jaxrs</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-transports-http</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.cxf</groupId>
- <artifactId>cxf-rt-rs-security-cors</artifactId>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-json-provider</artifactId>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.cmpn</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.unomi</groupId>
- <artifactId>unomi-mailchimp-connector-services</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>buildnumber-maven-plugin</artifactId>
- <version>1.4</version>
- <configuration>
- <format>{0}-{1,date,short}-{1,time,short}</format>
- <items>
- <item>scmVersion</item>
- <item>timestamp</item>
- </items>
- </configuration>
- <executions>
- <execution>
- <phase>validate</phase>
- <goals>
- <goal>create</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
-
<Implementation-Build>${buildNumber}</Implementation-Build>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git
a/extensions/unomi-mailchimp/rest/src/main/java/org/apache/unomi/mailchimp/rest/MailChimpEndPoint.java
b/extensions/unomi-mailchimp/rest/src/main/java/org/apache/unomi/mailchimp/rest/MailChimpEndPoint.java
deleted file mode 100644
index 18025489e..000000000
---
a/extensions/unomi-mailchimp/rest/src/main/java/org/apache/unomi/mailchimp/rest/MailChimpEndPoint.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * 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.unomi.mailchimp.rest;
-
-import org.apache.cxf.rs.security.cors.CrossOriginResourceSharing;
-import org.apache.unomi.mailchimp.services.MailChimpService;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.Reference;
-
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import java.util.HashMap;
-import java.util.List;
-
-
-@WebService
-@Produces(MediaType.APPLICATION_JSON + ";charset=UTF-8")
-@CrossOriginResourceSharing(
- allowAllOrigins = true,
- allowCredentials = true
-)
-@Path("/mailchimp")
-@Component(service=MailChimpEndPoint.class,property =
"osgi.jaxrs.resource=true")
-public class MailChimpEndPoint {
-
- @Reference
- private MailChimpService mailChimpService;
-
- public MailChimpEndPoint() {
- System.out.println("Initializing MailChimpEndPoint service
endpoint...");
- }
-
- /**
- * This function return the available MailChimp lists ID and Name
- *
- * @return The Lists of MailChimp List
- */
- @GET
- @Path("/")
- public List<HashMap<String, String>> getAllLists() {
- return mailChimpService.getAllLists();
- }
-
- @WebMethod(exclude = true)
- public void setMailChimpService(MailChimpService mailChimpService) {
- this.mailChimpService = mailChimpService;
- }
-}
-
diff --git a/extensions/unomi-mailchimp/services/pom.xml
b/extensions/unomi-mailchimp/services/pom.xml
deleted file mode 100644
index 67d543dea..000000000
--- a/extensions/unomi-mailchimp/services/pom.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?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.unomi</groupId>
- <artifactId>unomi-mailchimp-connector</artifactId>
- <version>2.5.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>unomi-mailchimp-connector-services</artifactId>
- <name>Apache Unomi :: Extensions :: MailChimp Connector :: Services</name>
- <description>Service implementation for Apache Unomi that integrates with
MailChimp</description>
-
- <packaging>bundle</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.unomi</groupId>
- <artifactId>unomi-api</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient-osgi</artifactId>
- <type>bundle</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore-osgi</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- <version>20240303</version>
- </dependency>
-
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.6</version>
- </dependency>
- <dependency>
- <groupId>org.apache.servicemix.bundles</groupId>
- <artifactId>org.apache.servicemix.bundles.joda-time</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
-
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
- <Import-Package>
- *
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
- <file>
-
src/main/resources/org.apache.unomi.mailchimpconnector.cfg
- </file>
- <type>cfg</type>
-
<classifier>mailchimpconnectorcfg</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git
a/extensions/unomi-mailchimp/services/src/main/java/org/apache/unomi/mailchimp/services/HttpUtils.java
b/extensions/unomi-mailchimp/services/src/main/java/org/apache/unomi/mailchimp/services/HttpUtils.java
deleted file mode 100644
index 70290a4c5..000000000
---
a/extensions/unomi-mailchimp/services/src/main/java/org/apache/unomi/mailchimp/services/HttpUtils.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * 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.unomi.mailchimp.services;
-
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.http.client.methods.*;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.message.BasicHeader;
-import org.apache.http.protocol.HTTP;
-import org.apache.http.util.EntityUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.Map;
-
-/**
- * Created by dsalhotra on 27/06/2017.
- */
-public class HttpUtils {
-
- private static Logger logger = LoggerFactory.getLogger(HttpUtils.class);
-
- public static CloseableHttpClient initHttpClient() {
- return HttpClients.createDefault();
- }
-
- public static JsonNode executePatchRequest(CloseableHttpClient httpClient,
String url, Map<String, String> headers, String body) {
- HttpPatch httpPatch = new HttpPatch(url);
-
- addHeaders(headers, httpPatch);
-
- return addBodyAndExecuteRequest(httpClient, body, httpPatch);
- }
-
- public static JsonNode executePostRequest(CloseableHttpClient httpClient,
String url, Map<String, String> headers, String body) {
- HttpPost httpPost = new HttpPost(url);
-
- addHeaders(headers, httpPost);
-
- return addBodyAndExecuteRequest(httpClient, body, httpPost);
- }
-
- public static JsonNode executeGetRequest(CloseableHttpClient httpClient,
String url, Map<String, String> headers, boolean allow404Response) {
- HttpGet httpGet = new HttpGet(url);
-
- addHeaders(headers, httpGet);
-
- return executeRequest(httpClient, httpGet, allow404Response);
- }
-
- public static JsonNode executeDeleteRequest(CloseableHttpClient
httpClient, String url, Map<String, String> headers) {
- HttpDelete httpDelete = new HttpDelete(url);
-
- addHeaders(headers, httpDelete);
-
- return executeRequest(httpClient, httpDelete, false);
- }
-
- private static JsonNode addBodyAndExecuteRequest(CloseableHttpClient
httpClient, String body, HttpEntityEnclosingRequestBase request) {
- try {
- StringEntity stringEntity = new StringEntity(body);
- stringEntity.setContentType(new BasicHeader(HTTP.CONTENT_TYPE,
"application/json"));
- request.setEntity(stringEntity);
-
- return executeRequest(httpClient, request, false);
- } catch (UnsupportedEncodingException e) {
- logger.error("Error when executing request", e);
- return null;
- }
- }
-
- private static JsonNode executeRequest(CloseableHttpClient httpClient,
HttpRequestBase request, boolean allow404Response) {
- try {
- CloseableHttpResponse response = httpClient.execute(request);
-
- return extractResponse(response, allow404Response);
- } catch (IOException e) {
- logger.error("Error when executing request", e);
- return null;
- }
- }
-
- private static JsonNode extractResponse(CloseableHttpResponse response,
boolean allow404Response) {
- if (response != null) {
- int statusCode = response.getStatusLine().getStatusCode();
- if (((statusCode >= 400) && !allow404Response) ||
(allow404Response && (statusCode >= 400 && statusCode != 404 ))) {
- EntityUtils.consumeQuietly(response.getEntity());
- logger.error("Error when communicating with MailChimp server,
response code was {} and response message was {}", statusCode,
response.getStatusLine().getReasonPhrase());
- return null;
- }
-
- String responseString;
- if (statusCode == 204) {
- // The response is build for the delete member, because the
Api return no content
- responseString = ("{ \"response\": \" " +
response.getStatusLine().toString() + "\" }");
- } else {
- // Other request
- try {
- responseString =
EntityUtils.toString(response.getEntity());
- } catch (IOException e) {
- EntityUtils.consumeQuietly(response.getEntity());
- logger.error("Error when parsing entity response", e);
- return null;
- }
- }
-
- ObjectMapper objectMapper = new ObjectMapper();
- try {
- JsonNode jsonNode = objectMapper.readTree(responseString);
-
- EntityUtils.consumeQuietly(response.getEntity());
-
- return jsonNode;
- } catch (IOException e) {
- EntityUtils.consumeQuietly(response.getEntity());
- logger.error("Error when parsing response with ObjectMapper",
e);
- return null;
- }
- }
- return null;
- }
-
- private static void addHeaders(Map<String, String> headers,
HttpRequestBase httpRequestBase) {
- for (String key : headers.keySet()) {
- httpRequestBase.addHeader(key, headers.get(key));
- }
- }
-}
-
-
-
-
-
diff --git
a/extensions/unomi-mailchimp/services/src/main/java/org/apache/unomi/mailchimp/services/MailChimpResult.java
b/extensions/unomi-mailchimp/services/src/main/java/org/apache/unomi/mailchimp/services/MailChimpResult.java
deleted file mode 100644
index 22919f7a3..000000000
---
a/extensions/unomi-mailchimp/services/src/main/java/org/apache/unomi/mailchimp/services/MailChimpResult.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.unomi.mailchimp.services;
-
-/**
- * This enum is use to get the result of the interaction with MailChimp
- */
-public enum MailChimpResult {
- UPDATED,
- REMOVED,
- ERROR,
- SUCCESS,
- NO_CHANGE
-}
diff --git
a/extensions/unomi-mailchimp/services/src/main/java/org/apache/unomi/mailchimp/services/MailChimpService.java
b/extensions/unomi-mailchimp/services/src/main/java/org/apache/unomi/mailchimp/services/MailChimpService.java
deleted file mode 100644
index 68f8c779c..000000000
---
a/extensions/unomi-mailchimp/services/src/main/java/org/apache/unomi/mailchimp/services/MailChimpService.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.unomi.mailchimp.services;
-
-
-import org.apache.unomi.api.Profile;
-import org.apache.unomi.api.actions.Action;
-
-import java.util.HashMap;
-import java.util.List;
-
-public interface MailChimpService {
-
- /**
- * This function will get all MailChimp lists.
- *
- * @return a List of MailChimp lists with the name and the id.
- */
- List<HashMap<String, String>> getAllLists();
-
- /**
- * This function will add the current visitor to a MailChimp list.
- *
- * @param profile the Unomi profile to add to the list @see
org.apache.unomi.api.Profile
- * @param action the action used to call this method, to retrieve
parameters @see org.apache.unomi.api.actions.Action
- * @return true if the visitor is successfully added to a MailChimp list.
- */
- MailChimpResult addToMCList(Profile profile, Action action);
-
- /**
- * This function will remove the current visitor from a MailChimp list.
- *
- * @param profile the Unomi profile to remove from the list @see
org.apache.unomi.api.Profile
- * @param action the action used to call this method, to retrieve
parameters @see org.apache.unomi.api.actions.Action
- * @return true if the visitor is successfully removed to a MailChimp list.
- */
- MailChimpResult removeFromMCList(Profile profile, Action action);
-
- /**
- * This function will unsbscribe the current visitor to a MailChimp list.
- *
- * @param profile the Unomi profile to unsubscribe from the list @see
org.apache.unomi.api.Profile
- * @param action the action used to call this method, to retrieve
parameters @see org.apache.unomi.api.actions.Action
- * @return true if the visitor is successfully unsbscribed to a MailChimp
list.
- */
- MailChimpResult unsubscribeFromMCList(Profile profile, Action action);
-
- /**
- * This function will update merge properties of MailChimp list.
- *
- * @param profile the Unomi profile to unsubscribe from the list @see
org.apache.unomi.api.Profile
- * @param action the action used to call this method, to retrieve
parameters @see org.apache.unomi.api.actions.Action
- * @return true if the visitor is successfully unsbscribed to a MailChimp
list.
- */
- MailChimpResult updateMCProfileProperties(Profile profile, Action action);
-}
-
-
diff --git
a/extensions/unomi-mailchimp/services/src/main/java/org/apache/unomi/mailchimp/services/internal/MailChimpServiceImpl.java
b/extensions/unomi-mailchimp/services/src/main/java/org/apache/unomi/mailchimp/services/internal/MailChimpServiceImpl.java
deleted file mode 100644
index 28de32572..000000000
---
a/extensions/unomi-mailchimp/services/src/main/java/org/apache/unomi/mailchimp/services/internal/MailChimpServiceImpl.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * 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.unomi.mailchimp.services.internal;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.unomi.api.Profile;
-import org.apache.unomi.api.actions.Action;
-import org.apache.unomi.mailchimp.services.HttpUtils;
-import org.apache.unomi.mailchimp.services.MailChimpResult;
-import org.apache.unomi.mailchimp.services.MailChimpService;
-import org.joda.time.DateTime;
-import org.joda.time.format.DateTimeFormat;
-import org.json.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class MailChimpServiceImpl implements MailChimpService {
-
- private static Logger logger =
LoggerFactory.getLogger(MailChimpServiceImpl.class);
-
- private static final String ACCEPT = "Accept";
- private static final String AUTHORIZATION = "Authorization";
- private static final String LISTS = "lists";
- private static final String ID = "id";
- private static final String NAME = "name";
- private static final String MERGE_FIELDS = "merge_fields";
- private static final String EMAIL_TYPE = "email_type";
- private static final String EMAIL_ADDRESS = "email_address";
- private static final String EMAIL = "email";
- private static final String ERRORS = "errors";
- private static final String LIST_IDENTIFIER = "listIdentifier";
- private static final String STATUS = "status";
- private static final String SUBSCRIBED = "subscribed";
- private static final String UNSUBSCRIBED = "unsubscribed";
- private static final String TAG = "tag";
- private static final String TYPE = "type";
- private static final String UNOMI_ID = "unomiId";
- private static final String MC_SUB_TAG_NAME = "mcSubTagName";
- private static final String ADDR_1 = "addr1";
- private static final String ADDR_2 = "addr2";
- private static final String CITY = "city";
- private static final String COUNTRY = "country";
- private static final String STATE = "state";
- private static final String ZIP = "zip";
- private static final String ADDRESS = "address";
- private static final String DATE_FORMAT = "date_format";
- private static final String OPTIONS = "options";
- private static final String DATE = "date";
- private static final String MC_MM_DD_YYYY = "MM/DD/YYYY";
- private static final String MM_DD_YYYY = "MM/dd/yyyy";
- private static final String DD_MM_YYYY = "dd/MM/yyyy";
- private static final String BIRTHDAY = "birthday";
- private static final String MC_MM_DD = "MM/DD";
- private static final String MM_DD = "MM/dd";
- private static final String DD_MM = "dd/MM";
- private static final String SEPARATOR_CHARS_PROPERTIES = ",";
- private static final String SEPARATOR_CHARS_PROPERTY = "<=>";
-
- private String apiKey;
- private String urlSubDomain;
- private Map<String, List<Map<String, String>>> listMergeFieldMapping;
- private Boolean isMergeFieldsActivate;
- private CloseableHttpClient httpClient;
-
-
- @Override
- public List<HashMap<String, String>> getAllLists() {
- List<HashMap<String, String>> mcLists = new ArrayList<>();
- if (isMailChimpConnectorConfigured()) {
- JsonNode response = HttpUtils.executeGetRequest(httpClient,
getBaseUrl() + "/lists", getHeaders(), false);
- if (response != null) {
- if (response.has(LISTS) && response.get(LISTS).size() > 0) {
- for (JsonNode list : response.get(LISTS)) {
- if (list.has(ID) && list.has(NAME)) {
- HashMap<String, String> mcListInfo = new
HashMap<>();
- mcListInfo.put(ID, list.get(ID).asText());
- mcListInfo.put(NAME, list.get(NAME).asText());
- mcLists.add(mcListInfo);
- } else {
- logger.warn("Missing mandatory information for
list, {}", list.asText());
- }
- }
- } else {
- logger.debug("No list to return, response was {}",
response.asText());
- }
- }
- }
- return mcLists;
- }
-
- @Override
- public MailChimpResult addToMCList(Profile profile, Action action) {
- if (!isMailChimpConnectorConfigured() || profile.getProperty(EMAIL) ==
null) {
- logger.error("The visitor does not have an email address");
- return MailChimpResult.ERROR;
- }
-
- String listIdentifier = (String)
action.getParameterValues().get(LIST_IDENTIFIER);
- JsonNode currentMember = isMemberOfMailChimpList(profile,
listIdentifier);
- JSONObject mergeFields = new JSONObject();
-
- if (currentMember != null && currentMember.has(STATUS)) {
- JSONObject body = new JSONObject();
- if (currentMember.get(STATUS).asText().equals(UNSUBSCRIBED)) {
- logger.debug("The visitor is already in the MailChimp list,
his status is unsubscribed");
- body.put(STATUS, SUBSCRIBED);
- }
-
- if (isMergeFieldsActivate &&
addProfilePropertiesToMergeFieldsObject(profile, listIdentifier, mergeFields)
== MailChimpResult.SUCCESS) {
- body.put(MERGE_FIELDS, mergeFields);
- }
- return updateSubscription(listIdentifier, body.toString(),
currentMember, true);
- }
-
- JSONObject userData = new JSONObject();
- userData.put(EMAIL_TYPE, "html");
- userData.put(EMAIL_ADDRESS, profile.getProperty(EMAIL).toString());
- userData.put(STATUS, SUBSCRIBED);
-
- if (isMergeFieldsActivate) {
- addProfilePropertiesToMergeFieldsObject(profile, listIdentifier,
mergeFields);
- }
- userData.put(MERGE_FIELDS, mergeFields);
-
- JsonNode response = HttpUtils.executePostRequest(httpClient,
getBaseUrl() + "/lists/" + listIdentifier + "/members", getHeaders(),
userData.toString());
- if (response == null || (response.has(ERRORS) &&
response.get(ERRORS).size() > 0)) {
- logger.error("Error when adding user to MailChimp list, list
identifier was {} and response was {}", listIdentifier, response);
- return MailChimpResult.ERROR;
- }
-
- return MailChimpResult.UPDATED;
- }
-
- @Override
- public MailChimpResult removeFromMCList(Profile profile, Action action) {
- if (!isMailChimpConnectorConfigured() || profile.getProperty(EMAIL) ==
null) {
- return MailChimpResult.ERROR;
- }
-
- String listIdentifier = (String)
action.getParameterValues().get(LIST_IDENTIFIER);
- if (StringUtils.isBlank(listIdentifier)) {
- logger.warn("Couldn't get the list identifier from Unomi");
- return MailChimpResult.ERROR;
- }
-
- JsonNode currentMember = isMemberOfMailChimpList(profile,
listIdentifier);
- if (currentMember == null) {
- return MailChimpResult.NO_CHANGE;
- }
-
- JsonNode response = HttpUtils.executeDeleteRequest(httpClient,
getBaseUrl() + "/lists/" + listIdentifier + "/members/" +
currentMember.get(ID).asText(), getHeaders());
- if (response == null || (response.has(ERRORS) &&
response.get(ERRORS).size() > 0)) {
- logger.error("Couldn't remove the visitor from the MailChimp list,
list identifier was {} and response was {}", listIdentifier, response);
- return MailChimpResult.ERROR;
- }
-
- return MailChimpResult.REMOVED;
- }
-
- @Override
- public MailChimpResult unsubscribeFromMCList(Profile profile, Action
action) {
- if (!isMailChimpConnectorConfigured() || profile.getProperty(EMAIL) ==
null) {
- return MailChimpResult.ERROR;
- }
-
- String listIdentifier = (String)
action.getParameterValues().get(LIST_IDENTIFIER);
- if (StringUtils.isBlank(listIdentifier)) {
- logger.warn("Couldn't get the list identifier from Unomi");
- return MailChimpResult.ERROR;
- }
-
- JsonNode currentMember = isMemberOfMailChimpList(profile,
listIdentifier);
- if (currentMember == null) {
- return MailChimpResult.REMOVED;
- }
- if (currentMember.get(STATUS).asText().equals(UNSUBSCRIBED)) {
- return MailChimpResult.NO_CHANGE;
- }
-
- JSONObject body = new JSONObject();
- body.put(STATUS, UNSUBSCRIBED);
- return updateSubscription(listIdentifier, body.toString(),
currentMember, false);
- }
-
-
- @Override
- public MailChimpResult updateMCProfileProperties(Profile profile, Action
action) {
- if (!isMailChimpConnectorConfigured() || profile.getProperty(EMAIL) ==
null) {
- return MailChimpResult.ERROR;
- }
-
- String listIdentifier = (String)
action.getParameterValues().get(LIST_IDENTIFIER);
- if (StringUtils.isBlank(listIdentifier)) {
- logger.warn("MailChimp list identifier not found");
- return MailChimpResult.ERROR;
- }
-
- JsonNode currentMember = isMemberOfMailChimpList(profile,
listIdentifier);
- if (currentMember == null) {
- logger.warn("The visitor was not part of the list");
- return MailChimpResult.NO_CHANGE;
- }
-
-
- JSONObject mergeFields = new JSONObject();
- MailChimpResult result =
addProfilePropertiesToMergeFieldsObject(profile, listIdentifier, mergeFields);
- if (result != MailChimpResult.SUCCESS) {
- return result;
- }
-
- JSONObject body = new JSONObject();
- body.put(MERGE_FIELDS, mergeFields);
-
- JsonNode response = HttpUtils.executePatchRequest(httpClient,
getBaseUrl() + "/lists/" + listIdentifier + "/members/" +
currentMember.get(ID).asText(), getHeaders(), body.toString());
- if (response == null || (response.has(ERRORS) &&
response.get(ERRORS).size() > 0)) {
- logger.error("Error when updating visitor properties to MailChimp
list, list identifier was {} and response was {}", listIdentifier, response);
- return MailChimpResult.ERROR;
- }
-
- return MailChimpResult.UPDATED;
- }
-
- private MailChimpResult addProfilePropertiesToMergeFieldsObject(Profile
profile, String listIdentifier, JSONObject mergeFields) {
- if (listMergeFieldMapping.isEmpty()) {
- logger.error("List of merge fields is not correctly configured");
- return MailChimpResult.ERROR;
- }
-
- JsonNode mergeFieldsDefinitions = getMCListProperties(listIdentifier);
- if (mergeFieldsDefinitions == null) {
- logger.error("Could not get MailChimp list's merge fields");
- return MailChimpResult.ERROR;
- }
-
- for (JsonNode mergeFieldDefinition :
mergeFieldsDefinitions.get(MERGE_FIELDS)) {
- if (mergeFieldDefinition.has(TAG) &&
mergeFieldDefinition.has(TYPE)) {
- String mcTagName = mergeFieldDefinition.get(TAG).asText();
- if (listMergeFieldMapping.containsKey(mcTagName)) {
- List<Map<String, String>> fields =
listMergeFieldMapping.get(mcTagName);
- for (Map<String, String> fieldInfo : fields) {
- String unomiId = fieldInfo.get(UNOMI_ID);
- if (profile.getProperty(unomiId) != null) {
- switch (mergeFieldDefinition.get(TYPE).asText()) {
- case ADDRESS:
- if (mergeFields.has(mcTagName)) {
-
mergeFields.getJSONObject(mcTagName).put(fieldInfo.get(MC_SUB_TAG_NAME),
profile.getProperty(unomiId));
- } else {
- JSONObject address = new JSONObject();
- address.put(ADDR_1, "");
- address.put(ADDR_2, "");
- address.put(CITY, "");
- address.put(COUNTRY, "");
- address.put(STATE, "");
- address.put(ZIP, "");
-
address.put(fieldInfo.get(MC_SUB_TAG_NAME), profile.getProperty(unomiId));
- mergeFields.put(mcTagName, address);
- }
- break;
- case DATE:
- if (mergeFieldDefinition.has(OPTIONS) &&
mergeFieldDefinition.get(OPTIONS).has(DATE_FORMAT)) {
- mergeFields.put(mcTagName,
formatDate(mergeFieldDefinition.get(OPTIONS).get(DATE_FORMAT).asText(),
profile.getProperty(unomiId)));
- }
- break;
- case BIRTHDAY:
- if (mergeFieldDefinition.has(OPTIONS) &&
mergeFieldDefinition.get(OPTIONS).has(DATE_FORMAT)) {
- mergeFields.put(mcTagName,
formatDate(mergeFieldDefinition.get(OPTIONS).get(DATE_FORMAT).asText(),
profile.getProperty(unomiId)));
- }
- break;
- default:
- mergeFields.put(mcTagName,
profile.getProperty(unomiId));
- break;
- }
- }
- }
- if
(mergeFieldDefinition.get(TYPE).asText().equals(ADDRESS) &&
mergeFields.has(mcTagName)
- &&
(StringUtils.isBlank(mergeFields.getJSONObject(mcTagName).get(ADDR_1).toString())
- ||
StringUtils.isBlank(mergeFields.getJSONObject(mcTagName).get(ZIP).toString())
- ||
StringUtils.isBlank(mergeFields.getJSONObject(mcTagName).get(CITY).toString())
- ||
StringUtils.isBlank(mergeFields.getJSONObject(mcTagName).get(COUNTRY).toString())))
{
- mergeFields.remove(mcTagName);
- logger.warn("Can't map the address property {}, one of
the mandatory field is missing (addr1, zip, city, country)", mcTagName);
- }
- } else {
- logger.warn("Found property {} in MC list, if you need
this property please update mapping or add the property to your MC list",
mcTagName);
- }
- }
- }
-
- return MailChimpResult.SUCCESS;
- }
-
- private String formatDate(String mcDateFormat, Object date) {
- DateTime dateTime = new DateTime(date);
- if (StringUtils.contains(mcDateFormat, "/YYYY")) {
- return
DateTimeFormat.forPattern((mcDateFormat.equals(MC_MM_DD_YYYY) ? MM_DD_YYYY :
DD_MM_YYYY)).print(dateTime);
- } else {
- return DateTimeFormat.forPattern((mcDateFormat.equals(MC_MM_DD) ?
MM_DD : DD_MM)).print(dateTime);
- }
- }
-
-
- private JsonNode getMCListProperties(String listIdentifier) {
- JsonNode currentMergeFields = HttpUtils.executeGetRequest(httpClient,
getBaseUrl() + "/lists/" + listIdentifier + "/merge-fields", getHeaders(),
false);
- if (currentMergeFields == null ||
!currentMergeFields.has(MERGE_FIELDS)) {
- logger.error("Can't find merge_fields from the response, the
response was {}", currentMergeFields);
- return null;
- }
-
- return currentMergeFields;
- }
-
-
- private void initHttpClient() {
- if (httpClient == null) {
- httpClient = HttpUtils.initHttpClient();
- }
- }
-
- private boolean isMailChimpConnectorConfigured() {
- if (StringUtils.isNotBlank(apiKey) &&
StringUtils.isNotBlank(urlSubDomain)) {
- initHttpClient();
- return true;
- }
- logger.error("MailChimp extension isn't correctly configured, please
check cfg file.");
- return false;
- }
-
- private JsonNode isMemberOfMailChimpList(Profile profile, String
listIdentifier) {
- String email = profile.getProperty(EMAIL).toString().toLowerCase();
- String md5Hex = DigestUtils.md5Hex(email);
-
- JsonNode response = HttpUtils.executeGetRequest(httpClient,
getBaseUrl() + "/lists/" + listIdentifier + "/members/" + md5Hex, getHeaders(),
true);
- if (response != null) {
- if (response.has(EMAIL_ADDRESS)) {
- if
(response.get(EMAIL_ADDRESS).asText().toLowerCase().equals(email)) {
- return response;
- }
- }
- }
- return null;
- }
-
- private MailChimpResult updateSubscription(String listIdentifier, String
jsonData, JsonNode member, boolean toSubscribe) {
- JsonNode response = HttpUtils.executePatchRequest(httpClient,
getBaseUrl() + "/lists/" + listIdentifier + "/members/" +
member.get(ID).asText(), getHeaders(), jsonData);
- if (response != null) {
- if (response.has(STATUS)) {
- String responseStatus = response.get(STATUS).asText();
- if ((toSubscribe && responseStatus.equals(SUBSCRIBED)) ||
(!toSubscribe && responseStatus.equals(UNSUBSCRIBED))) {
- return MailChimpResult.UPDATED;
- } else {
- return MailChimpResult.NO_CHANGE;
- }
- }
- }
- logger.error("Couldn't update the subscription of the visitor");
- return MailChimpResult.ERROR;
- }
-
- private String getBaseUrl() {
- return "https://" + urlSubDomain + ".api.mailchimp.com/3.0";
- }
-
- private HashMap<String, String> getHeaders() {
- HashMap<String, String> headers = new HashMap<>();
- headers.put(ACCEPT, "application/json");
- headers.put(AUTHORIZATION, "apikey " + apiKey);
- return headers;
- }
-
- public void setApiKey(String apiKey) {
- this.apiKey = apiKey;
- }
-
- public void setUrlSubDomain(String urlSubDomain) {
- this.urlSubDomain = urlSubDomain;
- }
-
- public void setListMergeFieldMapping(String listMergeFields) {
- this.listMergeFieldMapping = new HashMap<>();
- if (StringUtils.isNotBlank(listMergeFields)) {
- String mergeFields[] = StringUtils.split(listMergeFields,
SEPARATOR_CHARS_PROPERTIES);
- if (mergeFields.length > 0) {
- for (String mergeField : mergeFields) {
- if (StringUtils.isNotBlank(mergeField)) {
- String mergeFieldInfo[] =
StringUtils.split(mergeField, SEPARATOR_CHARS_PROPERTY);
- if (mergeFieldInfo.length > 0) {
- Map<String, String> fieldInfo = new HashMap<>();
- fieldInfo.put(UNOMI_ID, mergeFieldInfo[0]);
- if (mergeFieldInfo.length == 3) {
- fieldInfo.put(MC_SUB_TAG_NAME,
mergeFieldInfo[2]);
- }
-
- String mcTagName = mergeFieldInfo[1];
- if (listMergeFieldMapping.containsKey(mcTagName)) {
-
listMergeFieldMapping.get(mcTagName).add(fieldInfo);
- } else {
- List<Map<String, String>> fields = new
ArrayList<>();
- fields.add(fieldInfo);
- listMergeFieldMapping.put(mcTagName, fields);
- }
- }
- }
- }
- }
- }
- }
-
- public void setIsMergeFieldsActivate(Boolean isMergeFieldsActivate) {
- this.isMergeFieldsActivate = isMergeFieldsActivate;
- }
-}
diff --git
a/extensions/unomi-mailchimp/services/src/main/resources/OSGI-INF/blueprint/blueprint.xml
b/extensions/unomi-mailchimp/services/src/main/resources/OSGI-INF/blueprint/blueprint.xml
deleted file mode 100644
index 6f8847066..000000000
---
a/extensions/unomi-mailchimp/services/src/main/resources/OSGI-INF/blueprint/blueprint.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?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.
- -->
-
-
-<blueprint xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
- xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
-
- <cm:property-placeholder
persistent-id="org.apache.unomi.mailchimpconnector" update-strategy="reload">
- <cm:default-properties>
- <cm:property name="mailChimpConnector.apiKey" value=""/>
- <cm:property name="mailChimpConnector.url.subDomain" value=""/>
- <cm:property name="mailChimpConnector.list.merge-fields.mapping"
value=""/>
- <cm:property name="mailChimpConnector.list.merge-fields.activate"
value="true"/>
- </cm:default-properties>
- </cm:property-placeholder>
-
- <bean id="mailChimpServiceImpl"
class="org.apache.unomi.mailchimp.services.internal.MailChimpServiceImpl">
- <property name="apiKey" value="${mailChimpConnector.apiKey}"/>
- <property name="urlSubDomain"
value="${mailChimpConnector.url.subDomain}"/>
- <property name="listMergeFieldMapping"
value="${mailChimpConnector.list.merge-fields.mapping}"/>
- <property name="isMergeFieldsActivate"
value="${mailChimpConnector.list.merge-fields.activate}"/>
- </bean>
-
- <service id="mailChimpService" ref="mailChimpServiceImpl"
interface="org.apache.unomi.mailchimp.services.MailChimpService" />
-</blueprint>
-
-
-
-
diff --git
a/extensions/unomi-mailchimp/services/src/main/resources/org.apache.unomi.mailchimpconnector.cfg
b/extensions/unomi-mailchimp/services/src/main/resources/org.apache.unomi.mailchimpconnector.cfg
deleted file mode 100644
index ce8252668..000000000
---
a/extensions/unomi-mailchimp/services/src/main/resources/org.apache.unomi.mailchimpconnector.cfg
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# 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.
-#
-mailChimpConnector.apiKey=${org.apache.unomi.mailchimp.apiKey:-yourApiKey}
-mailChimpConnector.url.subDomain=${org.apache.unomi.mailchimp.url.subDomain:-us16}
-# MC address type mapping format
-# unomiId<=>mcTagName<=>mcSubTagName
-# MC other type mapping format
-# unomiId<=>mcTagName
-# The following is a complete example of mapping if you wish to use it please
make sure to create/replace MailChimp tag name
-mailChimpConnector.list.merge-fields.mapping=${org.apache.unomi.mailchimp.list.merge-fields.mapping:-firstName<=>FNAME,lastName<=>LNAME,company<=>COMPANY,phoneNumber<=>PHONE,jobTitle<=>JOBTITLE,address<=>ADDRESS<=>addr1,city<=>ADDRESS<=>city,zipCode<=>ADDRESS<=>zip,countryName<=>ADDRESS<=>country,birthDate<=>BIRTHDATE,income<=>NUMBER}
-# If you wish you can stop the mapping by setting the following property to
false
-mailChimpConnector.list.merge-fields.activate=${org.apache.unomi.mailchimp.list.merge-fields.activate:-true}
diff --git a/manual/src/main/asciidoc/builtin-event-types.adoc
b/manual/src/main/asciidoc/builtin-event-types.adoc
index 9c0c18695..ef9c2b3b8 100644
--- a/manual/src/main/asciidoc/builtin-event-types.adoc
+++ b/manual/src/main/asciidoc/builtin-event-types.adoc
@@ -570,7 +570,7 @@ Based on the structure of the following object: Event
===== Example
In this example, a user-generated a consent modification when visiting the
home page, possibly by interacting with a consent form that captured his
preferences.
-Different consent types were present on the page and he decided to GRANT the
“mailchimp” consent.
+Different consent types were present on the page and he decided to GRANT the
“tracking” consent.
image::modify-consent-event-type.png[]
@@ -605,12 +605,6 @@ image::modify-consent-event-type.png[]
"title": "Allow tracking",
"description": "If approved we are allowed to track the
visitor"
},
- {
- "typeIdentifier": "mailchimp",
- "activated": true,
- "title": "Mailchimp",
- "description": "desc"
- },
{
"typeIdentifier": "newsletter1",
"activated": true,
@@ -635,12 +629,12 @@ image::modify-consent-event-type.png[]
"target": {
"itemType": "consent",
"scope": "digitall",
- "itemId": "mailchimp"
+ "itemId": "tracking"
},
"properties": {
"consent": {
"scope": "digitall",
- "typeIdentifier": "mailchimp",
+ "typeIdentifier": "tracking",
"status": "GRANTED",
"statusDate": "2020-01-31T20:10:00.463Z",
"revokeDate": "2022-01-30T20:10:00.463Z"
diff --git a/manual/src/main/asciidoc/connectors/connectors.adoc
b/manual/src/main/asciidoc/connectors/connectors.adoc
index 4d9ac8200..def921626 100644
--- a/manual/src/main/asciidoc/connectors/connectors.adoc
+++ b/manual/src/main/asciidoc/connectors/connectors.adoc
@@ -17,8 +17,6 @@ Apache Unomi provides the following connectors:
* <<Salesforce Connector,Salesforce CRM connector>>
-* <<MailChimp Connector,Mailchimp connector>>
-
==== Call for contributors
We are looking for help with the development of additional connectors. Any
contribution (large or small) is more than
diff --git a/manual/src/main/asciidoc/connectors/mailchimp-connector.adoc
b/manual/src/main/asciidoc/connectors/mailchimp-connector.adoc
deleted file mode 100644
index 22f5bcd99..000000000
--- a/manual/src/main/asciidoc/connectors/mailchimp-connector.adoc
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// 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.
-//
-=== MailChimp Connector
-
-This extension has 3 actions:
-
- * Add a visitor into a defined Mailchimp list.
- * Remove a visitor from a defined Mailchimp list.
- * Unsubscribe a visitor from a defined Mailchimp list.
-
-==== Getting started
-
-. Create a new MailChimp account: https://login.mailchimp.com/signup/
-
-. Generate a new API Key, or get the default:
https://usX.admin.mailchimp.com/account/api/
-
-. Configure the MailChimp Connector Basic in the
`etc/unomi.custom.system.properties` file and add/change the following settings:
-+
-[source]
-----
-org.apache.unomi.mailchimp.apiKey=${env:UNOMI_MAILCHIMP_APIKEY:-yourApiKey}
-org.apache.unomi.mailchimp.url.subDomain=${env:UNOMI_MAILCHIMP_URL_SUBDOMAIN:-us16}
-----
-+
-. Before starting configure the mapping between Apache Unomi profile
properties and MailChimp member properties. +
- The mapping can't be use with multitued properties. You need to setup your
MailChimp properties first in the MailChimp administration.
-+
-[source]
-----
- Go to: lists/
- Select the triggered list
- Settings
-----
-+
-
-+
-Then in the cfg file
`org.apache.unomi.mailchimp.list.merge-fields.activate={Boolean} if you like to
activate the mapping feature.`
-+
-
-+
-This is the property to configure for the mapping, the format is as shown.
`org.apache.unomi.mailchimp.list.merge-fields.mapping={Apache Unomi property
ID}<=>{MailChimp Tag name}`
-+
-
-+
-[NOTE]
-===============================
-there is a particular format for the address `{Apache Unomi property
ID}<=>{MailChimp Tag name}<=>{MailChimp tag sub entry}`
-===============================
-+
-
-+
-MailChimp supported type are:
-+
-
-+
-* Date `The format is (DD/MM/YYYY) or (MM/DD/YYYY)`
-
-* Birthday `The format is (DD/MM) or (MM/DD)`
-
-* Website or Text `They are text`
-
-* Number `The number will be parse into a Integer`
-
-* Phone `The North American format is not supported, use international`
-
-* Address
-+
-[NOTE]
-===============================
-Street, City, Country and Zip are mandatory properties, otherwise the address
property will be skipped.
-===============================
-
-+
-
-[source]
-----
- address<=>ADDRESS<=>addr1,
- city<=>ADDRESS<=>city,
- zipCode<=>ADDRESS<=>zip,
- countryName<=>ADDRESS<=>country
-----
-+
-
-. Deploy into Apache Unomi using the following commands from the Apache Karaf
shell: +
-[source]
-----
- feature:repo-add
mvn:org.apache.unomi/unomi-mailchimp-connector-karaf-kar/${project.version}/xml/features
- feature:install unomi-mailchimp-connector-karaf-kar
-----
diff --git a/manual/src/main/asciidoc/index.adoc
b/manual/src/main/asciidoc/index.adoc
index 616712320..49ada8ad2 100644
--- a/manual/src/main/asciidoc/index.adoc
+++ b/manual/src/main/asciidoc/index.adoc
@@ -116,8 +116,6 @@ include::connectors/connectors.adoc[]
include::connectors/salesforce-connector.adoc[]
-include::connectors/mailchimp-connector.adoc[]
-
== Developers
include::building-and-deploying.adoc[]
diff --git a/package/src/main/resources/etc/custom.system.properties
b/package/src/main/resources/etc/custom.system.properties
index 6c0dfc15f..72f42330e 100644
--- a/package/src/main/resources/etc/custom.system.properties
+++ b/package/src/main/resources/etc/custom.system.properties
@@ -428,20 +428,6 @@
org.apache.unomi.sfdc.session.timeout=${env:UNOMI_SFDC_SESSION_TIMEOUT:-900000}
# Consent Mapping Example: unomiConsentId<=>SFDCPropertyId
org.apache.unomi.sfdc.fields.consents=${env:UNOMI_SFDC_FIELDS_CONSENTS:-}
-#######################################################################################################################
-## MailChimp connector settings
##
-#######################################################################################################################
-org.apache.unomi.mailchimp.apiKey=${env:UNOMI_MAILCHIMP_APIKEY:-yourApiKey}
-org.apache.unomi.mailchimp.url.subDomain=${env:UNOMI_MAILCHIMP_URL_SUBDOMAIN:-us16}
-# MC address type mapping format
-# unomiId<=>mcTagName<=>mcSubTagName
-# MC other type mapping format
-# unomiId<=>mcTagName
-# The following is a complete example of mapping if you wish to use it please
make sure to create/replace MailChimp tag name
-org.apache.unomi.mailchimp.list.merge-fields.mapping=${env:UNOMI_MAILCHIMP_LIST_MERGEFIELDS_MAPPING:-firstName<=>FNAME,lastName<=>LNAME,company<=>COMPANY,phoneNumber<=>PHONE,jobTitle<=>JOBTITLE,address<=>ADDRESS<=>addr1,city<=>ADDRESS<=>city,zipCode<=>ADDRESS<=>zip,countryName<=>ADDRESS<=>country,birthDate<=>BIRTHDATE,income<=>NUMBER}
-# If you wish you can stop the mapping by setting the following property to
false
-org.apache.unomi.mailchimp.list.merge-fields.activate=${env:UNOMI_MAILCHIMP_LIST_MERGEFIELDS_ACTIVATE:-true}
-
#######################################################################################################################
## Weather update connector settings
##
#######################################################################################################################