0

In IBM Connections (versions 4.0 and 4.5), I'm posting JSON like that shown at the bottom of the question to activity streams.
The "title" field in the data uses a custom title template, defined in the "com.ibm.lconn.news.nls.templatePlaceholders.properties" file as:

GENERAL.kudos.boards.entry.created={actor} created the {activityEntry} entry in the {Target} board.

The title template is processed, but various characters (such as ampersands and quotes) get double-encoded before the title appears in the Connections UI.

For example, the JSON shown below produces an activity-stream entry that looks like this in the Connections UI:

Scott Leis created the Entry 9 & test entry in the Scott's Test Activity board.

And if I make a GET request to check the JSON on the server, part of the entry title containing the ampersand looks like this, with the ampersand double-encoded:

Entry 9 & test

How do I prevent such characters from being double-encoded?

The original JSON is below.
I have also tried encoding the ampersand as & in the JSON before posting, but that causes it to be triple-encoded in the UI.

{
    "target":{
        "objectType":"task-list",
        "id":"35bf524b-1651-48d4-afea-e8a428f8f1ff",
        "displayName":"Scott's Test Activity",
        "url":"https://server.company.net.au/kudosboards/#board/35bf524b-1651-48d4-afea-e8a428f8f1ff"
    },
    "generator":{
        "id":"kudos"
    },
    "actor":{
        "id":"@me"
    },
    "connections":{
        "broadcast":"false",
        "isPublic":"true",
        "rollupid":"urn:lsid:lconn.ibm.com:activities.unknown:5b824624-01be-49bc-9485-d75f09ba0098",
        "saved":"false",
    },
    "title":"${kudos.boards.entry.created}",
    "updated":"2014-04-23T03:50:00.000Z",
    "object":{
        "summary":"",
        "objectType":"entry",
        "id":"5b824624-01be-49bc-9485-d75f09ba0098",
        "displayName":"Entry 9 & test",
        "url":"https://server.company.net.au/kudosboards/#board/35bf524b-1651-48d4-afea-e8a428f8f1ff"
    },
    "verb":"post"
}
Scott Leis
  • 2,810
  • 6
  • 28
  • 42
  • have you tried encoding the & before posting? – Paul Bastide Apr 23 '14 at 12:00
  • @PaulBastide - Yes I have. That causes triple-encoding in the UI. I've also added this detail as an edit to the question. – Scott Leis Apr 23 '14 at 23:41
  • is the file on a Linux machine and did you edit it with Windows? maybe dos2unix or unix2dos would show extra characters? I'll ping someone to look at it – Paul Bastide Apr 24 '14 at 13:24
  • @PaulBastide - The Connections server I'm using for testing is Linux. I'm editing my JSON before posting in a 3rd-party Windows text editor, and posting it to Connections using RESTClient in Firefox on Windows. Also, I get the same double-encoded result from activity stream entries created via the SBT Java API running on the Connections server. – Scott Leis Apr 26 '14 at 11:04
  • chatted with the Architect, they are going to look at it, and most likely it's a part of processing the update when it's received. – Paul Bastide Apr 26 '14 at 20:32
  • you'll have to open a PMR to get a Fix for it, but yes it is an issue. – Paul Bastide Apr 30 '14 at 12:14

0 Answers0