Lotus Quickr – How to Add Group Membership

This is the first article of the complete four useful tricks on Lotus Quickr 8.1.1 WebSphere Portal version. This article will talk about how to add the group membership in the Quickr.

The first thing you need to understand is the Places Services REST API.

The Quickr REST Places services are accessible through this URL: <hostURL>/myqcs/rest/places/feed, i.e. http://localhost:10038/myqcs/rest/places/feed

Once you hit that URL, if you provide the correct username and password, you will see this

If you view the sources, you will see this

Scroll to the very bottom…

For each of the Place entry, there are other REST URLs for the entry, roles, and members, even the document libraries.

Now, we look at the entry feed

You see bunch of place parameters which you can change, using the POST REST call

For our case, we will focus on the roles entry

Now, open the roles URL, then you will see this

Depends on which Role you want to edit the members, the URL will be different.  For example, let’s say we want to add member for the “Contributor” role, then we should use the “related” URL of the “Contributor” role (see below)

Take note on this URL, since we are going to use this one in our code

Now, how does Quickr handle this REST Call?

Basically Quickr 8.1.1 handles the REST Call through the “rest.placeservices” Enterprise Application

The code is all there, so in the next section, we will change some of the codes (extend the Java Classes) to meet our requirement

This EAR is basically a Web Application, supported by Struts and Abdera framework  (see below)

This is the Struts.xml file content

The above shows the section of the struts-config.xml of this Web application.

Well, just take note on those action mappings, as we just need to extend those action mappings

So, where is the modification?

The above section mentions to change the action mappings. Well, this is the struts mapping after changes

Notice on the “/places/feed” and “/places/*/roles/*/members”. The first one is NOT used in this use case, but the second one is.

The files above contain the new Java classes used for this modification

This is the change of the “NTUCStrutsPlaceMembersForRole”

Force it to call the “NTUCPlaceServiceImpl” instead of the “PlaceServiceImpl” class

This is the “addMemberToApplication” function implementation.

Take note on this section

It splits the memberInfo by ‘|’, that means that now the REST API client must follow this pattern: <memberDN>|<memberType>

Okay fine.., so how do we deploy this code then?

Two things to deploy, first one is the “struts-config.xml” file

Just replace it to the location as shown above

Secondly is the classes files, just deploy to the location as shown below

So, how are we testing it?

We create one simple Java Program (“TestAddMember.java”)

After added, then we see the result

Advertisement
  1. No trackbacks yet.

You must be logged in to post a comment.
Follow

Get every new post delivered to your Inbox.