Repository: incubator-unomi
Updated Branches:
  refs/heads/master 759aab52c -> 9742f7bb8


UNOMI-129 : Allow multiple profile properties Add/Update/Delete through an event


Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/9742f7bb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/9742f7bb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/9742f7bb

Branch: refs/heads/master
Commit: 9742f7bb8e8ac017488eb304f54c153ad2f12104
Parents: 759aab5
Author: Abdelkader Midani <[email protected]>
Authored: Wed Oct 11 18:12:38 2017 +0200
Committer: Abdelkader Midani <[email protected]>
Committed: Wed Oct 11 18:12:38 2017 +0200

----------------------------------------------------------------------
 ...g.apache.unomi.persistence.elasticsearch.cfg |   2 +-
 .../unomi/persistence/spi/PropertyHelper.java   |  15 ++-
 .../AllEventToProfilePropertiesAction.java      |  12 +--
 .../actions/EvaluateProfileAgeAction.java       |   4 +-
 .../actions/EventToProfilePropertyAction.java   |   7 --
 .../actions/SetEventOccurenceCountAction.java   |  12 +--
 .../baseplugin/actions/SetPropertyAction.java   |  18 +---
 .../actions/UpdateProfilePropertiesAction.java  | 105 +++++++++++++++++++
 .../actions/updateProfilePropertiesAction.json  |  18 ++++
 .../updateProfilePropertiesEventCondition.json  |  23 ++++
 .../cxs/rules/updateProfileProperties.json      |  23 ++++
 .../resources/OSGI-INF/blueprint/blueprint.xml  |  17 +--
 12 files changed, 207 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/9742f7bb/persistence-elasticsearch/core/src/main/resources/org.apache.unomi.persistence.elasticsearch.cfg
----------------------------------------------------------------------
diff --git 
a/persistence-elasticsearch/core/src/main/resources/org.apache.unomi.persistence.elasticsearch.cfg
 
b/persistence-elasticsearch/core/src/main/resources/org.apache.unomi.persistence.elasticsearch.cfg
index e55d93e..a77b34e 100644
--- 
a/persistence-elasticsearch/core/src/main/resources/org.apache.unomi.persistence.elasticsearch.cfg
+++ 
b/persistence-elasticsearch/core/src/main/resources/org.apache.unomi.persistence.elasticsearch.cfg
@@ -15,7 +15,7 @@
 # limitations under the License.
 #
 
-cluster.name=contextElasticSearch
+cluster.name=contextElasticSearch_amidani
 # The elasticSearchAddresses may be a comma seperated list of host names and 
ports such as
 # hostA:9300,hostB:9300
 # Note: the port number must be repeated for each host.

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/9742f7bb/persistence-spi/src/main/java/org/apache/unomi/persistence/spi/PropertyHelper.java
----------------------------------------------------------------------
diff --git 
a/persistence-spi/src/main/java/org/apache/unomi/persistence/spi/PropertyHelper.java
 
b/persistence-spi/src/main/java/org/apache/unomi/persistence/spi/PropertyHelper.java
index ff7d0c0..39b7580 100644
--- 
a/persistence-spi/src/main/java/org/apache/unomi/persistence/spi/PropertyHelper.java
+++ 
b/persistence-spi/src/main/java/org/apache/unomi/persistence/spi/PropertyHelper.java
@@ -40,8 +40,7 @@ public class PropertyHelper {
 
     public static boolean setProperty(Object target, String propertyName, 
Object propertyValue, String setPropertyStrategy) {
         try {
-            String parentPropertyName =  null;
-            Object parentTarget = null;
+            String parentPropertyName;
             if(setPropertyStrategy!=null && 
setPropertyStrategy.equals("remove")){
                 if(resolver.hasNested(propertyName)) {
                     parentPropertyName = propertyName.substring(0, 
propertyName.lastIndexOf('.'));
@@ -129,4 +128,16 @@ public class PropertyHelper {
         }
 
     }
+
+    public static Object getValueByTypeId(Object propertyValue, String 
valueTypeId) {
+        if(("boolean".equals(valueTypeId)) ) {
+            return getBooleanValue(propertyValue);
+        } else if("integer".equals(valueTypeId)) {
+            return getInteger(propertyValue);
+        } else {
+            return propertyValue.toString();
+        }
+    }
+
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/9742f7bb/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/AllEventToProfilePropertiesAction.java
----------------------------------------------------------------------
diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/AllEventToProfilePropertiesAction.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/AllEventToProfilePropertiesAction.java
index e11478f..cd538b5 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/AllEventToProfilePropertiesAction.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/AllEventToProfilePropertiesAction.java
@@ -22,7 +22,6 @@ 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.api.services.PrivacyService;
 import org.apache.unomi.api.services.ProfileService;
 
 import java.util.HashMap;
@@ -31,20 +30,15 @@ import java.util.Map;
 public class AllEventToProfilePropertiesAction implements ActionExecutor {
 
     private ProfileService profileService;
-    private PrivacyService privacyService;
 
     public void setProfileService(ProfileService profileService) {
         this.profileService = profileService;
     }
 
-    public void setPrivacyService(PrivacyService privacyService) {
-        this.privacyService = privacyService;
-    }
-
-    @SuppressWarnings({ "unchecked", "rawtypes" })
+    @SuppressWarnings({"unchecked", "rawtypes"})
     public int execute(Action action, Event event) {
         boolean changed = false;
-        Map<String, Object> properties = new HashMap<String,Object>();
+        Map<String, Object> properties = new HashMap<String, Object>();
         if (event.getProperties() != null) {
             properties.putAll(event.getProperties());
         }
@@ -53,7 +47,7 @@ public class AllEventToProfilePropertiesAction implements 
ActionExecutor {
         try {
             Object targetProperties = 
BeanUtilsBean.getInstance().getPropertyUtils().getProperty(event.getTarget(), 
"properties");
             if (targetProperties instanceof Map) {
-                properties.putAll( (Map)targetProperties );
+                properties.putAll((Map) targetProperties);
             }
         } catch (Exception e) {
             // Ignore

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/9742f7bb/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/EvaluateProfileAgeAction.java
----------------------------------------------------------------------
diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/EvaluateProfileAgeAction.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/EvaluateProfileAgeAction.java
index cf3c199..b8f60df 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/EvaluateProfileAgeAction.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/EvaluateProfileAgeAction.java
@@ -32,9 +32,9 @@ public class EvaluateProfileAgeAction implements 
ActionExecutor {
     @Override
     public int execute(Action action, Event event) {
         boolean updated = false;
-        if(event.getProfile().getProperty("birthDate") != null) {
+        if (event.getProfile().getProperty("birthDate") != null) {
             Integer y = Years.yearsBetween(new 
DateTime(event.getProfile().getProperty("birthDate")), new 
DateTime()).getYears();
-            if(event.getProfile().getProperty("age") == null || 
event.getProfile().getProperty("age") != y){
+            if (event.getProfile().getProperty("age") == null || 
event.getProfile().getProperty("age") != y) {
                 updated = true;
                 event.getProfile().setProperty("age", y);
             }

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/9742f7bb/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/EventToProfilePropertyAction.java
----------------------------------------------------------------------
diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/EventToProfilePropertyAction.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/EventToProfilePropertyAction.java
index 19dc57c..32f8a9b 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/EventToProfilePropertyAction.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/EventToProfilePropertyAction.java
@@ -21,19 +21,12 @@ 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.api.services.PrivacyService;
 
 /**
  * A action to copy an event property to a profile property
  */
 public class EventToProfilePropertyAction implements ActionExecutor {
 
-    private PrivacyService privacyService;
-
-    public void setPrivacyService(PrivacyService privacyService) {
-        this.privacyService = privacyService;
-    }
-
     public int execute(Action action, Event event) {
         String eventPropertyName = (String) 
action.getParameterValues().get("eventPropertyName");
         String profilePropertyName = (String) 
action.getParameterValues().get("profilePropertyName");

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/9742f7bb/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetEventOccurenceCountAction.java
----------------------------------------------------------------------
diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetEventOccurenceCountAction.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetEventOccurenceCountAction.java
index 7f5e31a..cd1b5e3 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetEventOccurenceCountAction.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetEventOccurenceCountAction.java
@@ -55,18 +55,18 @@ public class SetEventOccurenceCountAction implements 
ActionExecutor {
         conditions.add(eventCondition);
 
         Condition c = new 
Condition(definitionsService.getConditionType("eventPropertyCondition"));
-        c.setParameter("propertyName","profileId");
+        c.setParameter("propertyName", "profileId");
         c.setParameter("comparisonOperator", "equals");
-        c.setParameter("propertyValue",event.getProfileId());
+        c.setParameter("propertyValue", event.getProfileId());
         conditions.add(c);
 
         if (pastEventCondition.getParameter("numberOfDays") != null) {
             int i = (Integer) pastEventCondition.getParameter("numberOfDays");
 
             Condition timeCondition = new 
Condition(definitionsService.getConditionType("eventPropertyCondition"));
-            timeCondition.setParameter("propertyName","timeStamp");
-            timeCondition.setParameter("comparisonOperator","greaterThan");
-            timeCondition.setParameter("propertyValueDateExpr","now-"+i+"d");
+            timeCondition.setParameter("propertyName", "timeStamp");
+            timeCondition.setParameter("comparisonOperator", "greaterThan");
+            timeCondition.setParameter("propertyValueDateExpr", "now-" + i + 
"d");
 
             conditions.add(timeCondition);
         }
@@ -75,7 +75,7 @@ public class SetEventOccurenceCountAction implements 
ActionExecutor {
 
         long count = persistenceService.queryCount(andCondition, 
Event.ITEM_TYPE);
 
-        Map<String,Object> pastEvents = (Map<String,Object>) 
event.getProfile().getSystemProperties().get("pastEvents");
+        Map<String, Object> pastEvents = (Map<String, Object>) 
event.getProfile().getSystemProperties().get("pastEvents");
         if (pastEvents == null) {
             pastEvents = new LinkedHashMap<>();
             event.getProfile().getSystemProperties().put("pastEvents", 
pastEvents);

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/9742f7bb/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java
----------------------------------------------------------------------
diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java
index 3771114..00793fa 100644
--- 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/SetPropertyAction.java
@@ -18,12 +18,9 @@
 package org.apache.unomi.plugins.baseplugin.actions;
 
 import org.apache.unomi.api.Event;
-import org.apache.unomi.api.PropertyType;
 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.api.services.PrivacyService;
-import org.apache.unomi.api.services.ProfileService;
 import org.apache.unomi.persistence.spi.PropertyHelper;
 
 import java.text.SimpleDateFormat;
@@ -31,24 +28,13 @@ import java.util.TimeZone;
 
 public class SetPropertyAction implements ActionExecutor {
 
-    private PrivacyService privacyService;
-    private ProfileService profileService;
-
-    public void setPrivacyService(PrivacyService privacyService) {
-        this.privacyService = privacyService;
-    }
-
-    public void setProfileService(ProfileService profileService) {
-        this.profileService = profileService;
-    }
-
     public int execute(Action action, Event event) {
         boolean storeInSession = 
Boolean.TRUE.equals(action.getParameterValues().get("storeInSession"));
 
         String propertyName = (String) 
action.getParameterValues().get("setPropertyName");
 
         Object propertyValue = 
action.getParameterValues().get("setPropertyValue");
-        if(propertyValue == null) {
+        if (propertyValue == null) {
             propertyValue = 
action.getParameterValues().get("setPropertyValueMultiple");
         }
         Object propertyValueInteger = 
action.getParameterValues().get("setPropertyValueInteger");
@@ -60,7 +46,7 @@ public class SetPropertyAction implements ActionExecutor {
                 propertyValue = 
PropertyHelper.getInteger(propertyValueInteger);
             }
             if (setPropertyValueMultiple != null) {
-               propertyValue = setPropertyValueMultiple;
+                propertyValue = setPropertyValueMultiple;
             }
             if (setPropertyValueBoolean != null) {
                 propertyValue = 
PropertyHelper.getBooleanValue(setPropertyValueBoolean);

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/9742f7bb/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/UpdateProfilePropertiesAction.java
----------------------------------------------------------------------
diff --git 
a/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/UpdateProfilePropertiesAction.java
 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/UpdateProfilePropertiesAction.java
new file mode 100644
index 0000000..b4b6c7b
--- /dev/null
+++ 
b/plugins/baseplugin/src/main/java/org/apache/unomi/plugins/baseplugin/actions/UpdateProfilePropertiesAction.java
@@ -0,0 +1,105 @@
+/*
+ * 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.plugins.baseplugin.actions;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.unomi.api.Event;
+import org.apache.unomi.api.Profile;
+import org.apache.unomi.api.PropertyType;
+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.api.services.ProfileService;
+import org.apache.unomi.persistence.spi.PropertyHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class UpdateProfilePropertiesAction implements ActionExecutor {
+
+    public static final String PROPS_TO_ADD = "propertiesToAdd";
+    public static final String PROPS_TO_UPDATE = "propertiesToUpdate";
+    public static final String PROPS_TO_DELETE = "propertiesToDelete";
+    Logger logger = 
LoggerFactory.getLogger(UpdateProfilePropertiesAction.class.getName());
+
+    private ProfileService profileService;
+    private EventService eventService;
+
+    public int execute(Action action, Event event) {
+
+        Profile target = event.getProfile();
+
+        String targetProfileId = (String) event.getProperty("targetProfileId");
+        if (StringUtils.isNotBlank(targetProfileId) && event.getProfile() != 
null && !targetProfileId.equals(event.getProfile().getItemId())) {
+            target = profileService.load(targetProfileId);
+            if (target == null) {
+                logger.warn("No profile found with Id : {}. Update skipped.", 
targetProfileId);
+                return EventService.NO_CHANGE;
+            }
+        }
+
+        boolean isProfileUpdated = false;
+
+        Map<String, Object> propsToAdd = (HashMap<String, Object>) 
event.getProperties().get(PROPS_TO_ADD);
+        for (String prop : propsToAdd.keySet()) {
+            PropertyType propType = profileService.getPropertyType(prop);
+            if (propType != null) {
+                isProfileUpdated = PropertyHelper.setProperty(target, 
"properties." + prop, PropertyHelper.getValueByTypeId(propsToAdd.get(prop), 
propType.getValueTypeId()), "setIfMissing") || isProfileUpdated;
+            }
+        }
+        Map<String, Object> propsToUpdate = (HashMap<String, Object>) 
event.getProperties().get(PROPS_TO_UPDATE);
+        for (String prop : propsToUpdate.keySet()) {
+            PropertyType propType = profileService.getPropertyType(prop);
+            if (propType != null) {
+                isProfileUpdated = PropertyHelper.setProperty(target, 
"properties." + prop, PropertyHelper.getValueByTypeId(propsToUpdate.get(prop), 
propType.getValueTypeId()), "alwaysSet") || isProfileUpdated;
+            }
+        }
+        List<String> propsToDelete = (List<String>) 
event.getProperties().get(PROPS_TO_DELETE);
+        for (String prop : propsToDelete) {
+            PropertyType propType = profileService.getPropertyType(prop);
+            if (propType != null) {
+                isProfileUpdated = PropertyHelper.setProperty(target, 
"properties." + prop, null, "remove") || isProfileUpdated;
+            }
+        }
+
+        if ((StringUtils.isNotBlank(targetProfileId) || (event.getProfile() != 
null && StringUtils.isNotBlank(event.getProfile().getItemId()))) && 
isProfileUpdated) {
+            profileService.save(target);
+            Event profileUpdated = new Event("profileUpdated", null, target, 
null, null, target, new Date());
+            profileUpdated.setPersistent(false);
+            int changes = eventService.send(profileUpdated);
+            if ((changes & EventService.PROFILE_UPDATED) == 
EventService.PROFILE_UPDATED) {
+                profileService.save(target);
+            }
+        }
+        return isProfileUpdated ? EventService.PROFILE_UPDATED : 
EventService.NO_CHANGE;
+
+    }
+
+    public void setProfileService(ProfileService profileService) {
+        this.profileService = profileService;
+    }
+
+    public void setEventService(EventService eventService) {
+        this.eventService = eventService;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/9742f7bb/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/updateProfilePropertiesAction.json
----------------------------------------------------------------------
diff --git 
a/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/updateProfilePropertiesAction.json
 
b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/updateProfilePropertiesAction.json
new file mode 100644
index 0000000..21a46d1
--- /dev/null
+++ 
b/plugins/baseplugin/src/main/resources/META-INF/cxs/actions/updateProfilePropertiesAction.json
@@ -0,0 +1,18 @@
+{
+  "metadata": {
+    "id": "updateProfilePropertiesAction",
+    "name": "updateProfilePropertiesAction",
+    "description": "Update multiple profile properties",
+    "systemTags": [
+      "profileTags",
+      "demographic",
+      "availableToEndUser",
+      "allowMultipleInstances"
+    ],
+    "readOnly": true
+  },
+  "actionExecutor": "updateProfileProperties",
+  "parameters": [
+
+  ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/9742f7bb/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/updateProfilePropertiesEventCondition.json
----------------------------------------------------------------------
diff --git 
a/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/updateProfilePropertiesEventCondition.json
 
b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/updateProfilePropertiesEventCondition.json
new file mode 100644
index 0000000..14204a9
--- /dev/null
+++ 
b/plugins/baseplugin/src/main/resources/META-INF/cxs/conditions/updateProfilePropertiesEventCondition.json
@@ -0,0 +1,23 @@
+{
+  "metadata": {
+    "id": "updateProfilePropertiesEventCondition",
+    "name": "updateProfilePropertiesEventCondition",
+    "description": "",
+    "systemTags": [
+      "profileTags",
+      "event",
+      "condition",
+      "eventCondition"
+    ],
+    "readOnly": true
+  },
+  "parentCondition": {
+    "type": "eventTypeCondition",
+    "parameterValues": {
+      "eventTypeId": "updateProfileProperties"
+    }
+  },
+
+  "parameters": [
+  ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/9742f7bb/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/updateProfileProperties.json
----------------------------------------------------------------------
diff --git 
a/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/updateProfileProperties.json
 
b/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/updateProfileProperties.json
new file mode 100644
index 0000000..4b5cd3e
--- /dev/null
+++ 
b/plugins/baseplugin/src/main/resources/META-INF/cxs/rules/updateProfileProperties.json
@@ -0,0 +1,23 @@
+{
+  "metadata" : {
+    "id": "updateProfileProperties",
+    "name": "Update profile properties",
+    "description" : "Update profile properties",
+    "readOnly":true
+  },
+
+  "condition" : {
+    "type": "updateProfilePropertiesEventCondition",
+    "parameterValues": {
+    }
+  },
+
+  "actions" : [
+    {
+      "type": "updateProfilePropertiesAction",
+      "parameterValues": {
+      }
+    }
+  ]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/9742f7bb/plugins/baseplugin/src/main/resources/OSGI-INF/blueprint/blueprint.xml
----------------------------------------------------------------------
diff --git 
a/plugins/baseplugin/src/main/resources/OSGI-INF/blueprint/blueprint.xml 
b/plugins/baseplugin/src/main/resources/OSGI-INF/blueprint/blueprint.xml
index e355308..360b776 100644
--- a/plugins/baseplugin/src/main/resources/OSGI-INF/blueprint/blueprint.xml
+++ b/plugins/baseplugin/src/main/resources/OSGI-INF/blueprint/blueprint.xml
@@ -151,7 +151,6 @@
         </service-properties>
         <bean 
class="org.apache.unomi.plugins.baseplugin.actions.AllEventToProfilePropertiesAction">
             <property name="profileService" ref="profileService"/>
-            <property name="privacyService" ref="privacyService"/>
         </bean>
     </service>
 
@@ -159,17 +158,23 @@
         <service-properties>
             <entry key="actionExecutorId" value="eventToProfileProperty"/>
         </service-properties>
-        <bean 
class="org.apache.unomi.plugins.baseplugin.actions.EventToProfilePropertyAction">
-            <property name="privacyService" ref="privacyService"/>
-        </bean>
+        <bean 
class="org.apache.unomi.plugins.baseplugin.actions.EventToProfilePropertyAction"/>
     </service>
 
     <service auto-export="interfaces">
         <service-properties>
             <entry key="actionExecutorId" value="setProperty"/>
         </service-properties>
-        <bean 
class="org.apache.unomi.plugins.baseplugin.actions.SetPropertyAction">
-            <property name="privacyService" ref="privacyService"/>
+        <bean 
class="org.apache.unomi.plugins.baseplugin.actions.SetPropertyAction"/>
+    </service>
+
+    <service auto-export="interfaces">
+        <service-properties>
+            <entry key="actionExecutorId" value="updateProfileProperties"/>
+        </service-properties>
+        <bean 
class="org.apache.unomi.plugins.baseplugin.actions.UpdateProfilePropertiesAction">
+            <property name="profileService" ref="profileService"/>
+            <property name="eventService" ref="eventService"/>
         </bean>
     </service>
 

Reply via email to