Question

I try to post an activity entry with the ActivityService class. I want that all my followers and myself can see it.

this.

ActivityStreamService service = new ActivityStreamService();
service.postEntry("@me", "@all", "", jsonObject, header);

I saw my entry but not my follower

With this.

ActivityStreamService service = new ActivityStreamService();
service.postEntry("@public", "@all", "", jsonObject, header);

My follower saw the entry, but I do not see this.

Have anybody an idea which one is the correct combination?

Was it helpful?

Solution

There are a couple of ways... 1 - You can use the Distribution method http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Connections+4.5+API+Documentation#action=openDocument&res_title=Distributing_events_ic45&content=pdcontent openSocial : { "deliverTo":[ {"objectType":"person", "id":"tag:example.org,2011:jane"} ] }

*You will need a special j2ee role in order to distribute this content (trustedApplication Role in WidgetContainer Application)

2 - You can use the ublog http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Connections+4.5+API+Documentation#action=openDocument&res_title=Posting_microblog_entries_ic45&content=pdcontent

POST to my board: /ublog/@me/@all { "content": "A new test post" }

3 - Otherwise, you need to do multiple posts

This means than the event would have to be sent separately to each user that is to receive the event. In order to ensure that this can be done more efficiently, an extension to the the Open Social spec allows for a few means of distribution in the data model

I hope this helps.

OTHER TIPS

As well as the openSocial JSON object, you could use to JSON object

For example this JSON snippet:

    "to":[
      {"objectType":"person", "id":"@me"}.
      {"objectType":"person", "id":"@public"}
      {"objectType":"community", "id":"xxx-xx-xxx0x0x0x0x0x"}
    ]

...can be produced by updating your jsonObject like so:

    // @me
    JsonJavaObject meJson = new JsonJavaObject();
    meJson.put("objectType","person");
    meJson.put("id","@me");

    // @public
    JsonJavaObject publicJson = new JsonJavaObject();
    publicJson.put("objectType","person");
    publicJson.put("id","@public");

    // Community
    JsonJavaObject communityJson = new JsonJavaObject();
    communityJson.put("objectType","community");
    communityJson.put("id","xxx-xx-xxx0x0x0x0x0x");

    // Shove them all in a list
    List<JsonJavaObject> toJson = new ArrayList<JsonJavaObject>();
    toJson.add(meJson);
    toJson.add(publicJson);
    toJson.add(communityJson);

    // add to: [...] to the root JsonJavaObject 
    jsonObject.put("to", toJson ) ;

Also: Here's a video on adding a user to the trustedExternalApplication role.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top