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"
}