Repository: incubator-unomi
Updated Branches:
  refs/heads/master 593238d3c -> 901631784


UNOMI-12: Updated samples to add target and tags.


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

Branch: refs/heads/master
Commit: 9016317846e5f198158f8d10d68ce41543d6a2f5
Parents: 593238d
Author: Chris Laprun <[email protected]>
Authored: Tue Jan 12 17:13:42 2016 +0100
Committer: Chris Laprun <[email protected]>
Committed: Wed Jan 13 12:23:48 2016 +0100

----------------------------------------------------------------------
 .../actions/IncrementTweetNumberAction.java                   | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/90163178/samples/tweet-button-plugin/src/main/java/org/apache/unomi/samples/tweet_button_plugin/actions/IncrementTweetNumberAction.java
----------------------------------------------------------------------
diff --git 
a/samples/tweet-button-plugin/src/main/java/org/apache/unomi/samples/tweet_button_plugin/actions/IncrementTweetNumberAction.java
 
b/samples/tweet-button-plugin/src/main/java/org/apache/unomi/samples/tweet_button_plugin/actions/IncrementTweetNumberAction.java
index 5a2cd7e..9b888d5 100644
--- 
a/samples/tweet-button-plugin/src/main/java/org/apache/unomi/samples/tweet_button_plugin/actions/IncrementTweetNumberAction.java
+++ 
b/samples/tweet-button-plugin/src/main/java/org/apache/unomi/samples/tweet_button_plugin/actions/IncrementTweetNumberAction.java
@@ -29,6 +29,7 @@ import org.apache.unomi.api.services.EventService;
 import org.apache.unomi.api.services.ProfileService;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -37,6 +38,8 @@ import java.util.List;
 public class IncrementTweetNumberAction implements ActionExecutor {
     private static final String TWEET_NB_PROPERTY = "tweetNb";
     private static final String TWEETED_FROM_PROPERTY = "tweetedFrom";
+    private static final String TARGET = "profiles";
+
     private ProfileService service;
 
     public int execute(Action action, Event event) {
@@ -48,11 +51,15 @@ public class IncrementTweetNumberAction implements 
ActionExecutor {
             // create tweet number property type
             PropertyType propertyType = new PropertyType(new 
Metadata(event.getScope(), TWEET_NB_PROPERTY, TWEET_NB_PROPERTY, "Number of 
times a user tweeted"));
             propertyType.setValueTypeId("integer");
+            propertyType.setTagIds(Collections.singleton("social"));
+            propertyType.setTarget(TARGET);
             service.createPropertyType(propertyType);
 
             // create tweeted from property type
             propertyType = new PropertyType(new Metadata(event.getScope(), 
TWEETED_FROM_PROPERTY, TWEETED_FROM_PROPERTY, "The list of pages a user tweeted 
from"));
             propertyType.setValueTypeId("string");
+            propertyType.setTagIds(Collections.singleton("social"));
+            propertyType.setTarget(TARGET);
             propertyType.setMultivalued(true);
             service.createPropertyType(propertyType);
 

Reply via email to