In one of my recent projects we had a requirement where a user should have the possibility to save "favourites". In our case the item that the user should "save" was a WCM content item.
To implement that functionality we decided to use the tagging feature of WebSphere Portal. Since we wanted to avoid custom coding and at at the same time business users needed to be able to change the setup easily we chose to leverage the Portal Tagging REST API and use DDC to display the data.
The ATOM feed we wanted to parse is the following:
Our goal was to show the item name and the URL for the tagged content item. While most of the implementation was straight forward chosen the right URL for the data source was a bit tricky.
Displaying the data with DDC
We started of using the full URL including the host name. Since the REST call requires authentication this did not work since the LTPA token was not passed through. It turned out that it was good enough to just use the URI for the data source (uri=rm:empty?tmparam=tm:name:favorite&scope=PERSONAL).
To pass the variables use the following snipped in the presentation template:
[Plugin:ListRenderingContext extension-id="ibm.portal.ddc.xml" attribute="source=rm:empty" attribute1="sourceParams=tmparam=tm:name:favorite&scope=PERSONAL" profile="ibm.portal.atom"]
Showing the item name was easy since we just had to read the "title" element. To read the URL to the content item we had to parse the following with the atom:entry:
<atom:link portal:uri="wcm:oid:f606e3ed-4713-4c04-90aa-b4aec4ef7eb8" href="/wps/mypoc/!ut/p/digest!xjnC7lOLx8yFeONXp6AB5w/wcm/oid:f606e3ed-4713-4c04-90aa-b4aec4ef7eb8" type="text/html"/>
To do that we added the following expression to the resource environment properties:
The other option would have been to read the URI - in that case the Portal namespace needs to be added to the properties
Open on the ToDo List is to implement the read operation also with DDC when someone is tagging an element.
Thanks also to Thomas Steinheber for his support during the implementation!