streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sblack...@apache.org
Subject [30/41] git commit: STREAMS-158 | Updated processor to check for null
Date Thu, 04 Sep 2014 17:12:18 GMT
STREAMS-158 | Updated processor to check for null


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

Branch: refs/heads/pp
Commit: d60854add0d709c8c9fd13cde4feb502cd88bf85
Parents: 16563aa
Author: mfranklin <mfranklin@apache.org>
Authored: Mon Aug 25 12:08:47 2014 -0400
Committer: mfranklin <mfranklin@apache.org>
Committed: Mon Aug 25 12:08:47 2014 -0400

----------------------------------------------------------------------
 .../sysomos/conversion/SysomosBeatActivityConverter.java      | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/d60854ad/streams-contrib/streams-provider-sysomos/src/main/java/org/apache/streams/sysomos/conversion/SysomosBeatActivityConverter.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-sysomos/src/main/java/org/apache/streams/sysomos/conversion/SysomosBeatActivityConverter.java
b/streams-contrib/streams-provider-sysomos/src/main/java/org/apache/streams/sysomos/conversion/SysomosBeatActivityConverter.java
index ce48dfb..90df7fc 100644
--- a/streams-contrib/streams-provider-sysomos/src/main/java/org/apache/streams/sysomos/conversion/SysomosBeatActivityConverter.java
+++ b/streams-contrib/streams-provider-sysomos/src/main/java/org/apache/streams/sysomos/conversion/SysomosBeatActivityConverter.java
@@ -42,7 +42,7 @@ public class SysomosBeatActivityConverter {
     public Activity convert(BeatApi.BeatResponse.Beat beat) {
         Activity converted = new Activity();
         converted.setId(beat.getDocid());
-        converted.setVerb("posted");
+        converted.setVerb("post");
         converted.setContent(beat.getContent());
         converted.setTitle(beat.getTitle());
         converted.setPublished(new DateTime(beat.getTime()));
@@ -74,7 +74,8 @@ public class SysomosBeatActivityConverter {
             object.setObjectType("tweet");
             object.setId(getObjectId(lowerMediaType, "tweet", beat.getTweetid()));
         } else if ("FACEBOOK".equals(mediaType)) {
-            actor.setId(getPersonId(lowerMediaType, mappedTags.get("FBID").getValue()));
+            String fbid = mappedTags.containsKey("FBID") ? mappedTags.get("FBID").getValue()
: "";
+            actor.setId(getPersonId(lowerMediaType, fbid));
             actor.setDisplayName(beat.getTitle());
             actor.setUrl(beat.getHost());
             object.setObjectType("post");
@@ -128,7 +129,7 @@ public class SysomosBeatActivityConverter {
         Map<String, BeatApi.BeatResponse.Beat.Tag> tags = Maps.newHashMap();
         for(BeatApi.BeatResponse.Beat.Tag tag : beat.getTag()) {
             if(tag.getSystemType() != null) {
-                tags.put(tag.getSystemType(), tag);
+                tags.put(tag.getSystemType().trim(), tag);
             }
         }
         return tags;


Mime
View raw message