Our Blog > Blog Detail

Web Content Viewer- Asponte Custom Skin

Actions

Enhancing the Developer Experience:Portal Tagging and Rating REST API

  • Created By: Chris Knight
  • Updated: June 22, 2016
  • Tags: tagging, portal, rest, api, rating, developer, wcm

Introduction

While trying to leverage the tagging and rating widgets, we were struggling with trying to mix jQuery with the necessary dojo widget that we only needed for the purpose of the tagging widget.  We started down the road of leveraging the SPI for tagging which can be found here:

http://public.dhe.ibm.com/software/dw/lotus/portal_javadoc/80/portal/spi_docs/com/ibm/portal/cp/tagging/TagModelController.html

 

While trying to leverage the create method of TagModelController, I ran across a result in google search for a page in the infocenter I had not previously seen.  Through some navigation, I came across this:

 

https://www.ibm.com/support/knowledgecenter/SSYJ99_8.0.0/admin/tag_rate_api_rest.html

 

Tagging REST API example

The infocenter shows how this API can be leveraged, here's an example of what we used.  

 

I posted to the following URL:

/wps/mycontenthandler?uri=tm:ts:all

 

And in the post, sent in the body of the request:

<?xml version="1.0" encoding="UTF-8"?><atom:feed xmlns:atom="http://www.w3.org/2005/Atom" 
   xmlns:xhtml="http://www.w3.org/1999/xhtml"   
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xmlns:creation-context=
      "http://www.ibm.com/xmlns/prod/websphere/portal/v6.1.0/portal-creation-context" 
   xmlns:trc="http://www.ibm.com/xmlns/prod/websphere/portal/v7.0/portal-tag-rate-comment" 
   xmlns:cp="http://www.ibm.com/xmlns/prod/websphere/portal/v7.0/portal-contextual-portal" 
   xmlns:portal="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0.1/portal-model" 
   xmlns:thr="http://purl.org/syndication/thread/1.0" 
   xmlns:model="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0.1/portal-model-elements" 
   xmlns:base="http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/ibm-portal-composite-base" 
   xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" 
   xml:base="http://localhost/wps/poc">
      <atom:author>
         <atom:name>IBM WebSphere Portal/8.0</atom:name>
      </atom:author>
      <atom:title>IBM WebSphere Portal Model Feed</atom:title>
      <atom:link href="." rel="self" type="application/atom+xml"/>
      <atom:entry creation-context:private="false">
         <atom:title xml:lang="en_US">CMKTest</atom:title>
         <atom:id>uuid of the wcm item</atom:id>
         <atom:link portal:uri="rm:wcm:oid:uuid of the wcm item" rel="replies" href="example.org" />         
      </atom:entry>
</atom:feed>

Note that for our use case, this was a WCM item so for the id we were using uuid values.

Also, for the 

<atom:link portal:uri="rm:wcm:oid:uuid of the wcm item" rel="replies" href="example.org" />         

I had to leverage the search center portlet to see what the format of the portal:uri tag was supposed to be.  In the case of a WCM item, that uri can just be rm:wcm:oid:uuid.

 

Contact Form- Asponte Custom Skin

Actions

Contact Us

*
*


Submit
Call Us 888-926-9434
Complementary Content
${loading}