Manage memberships in Activities with WSadmin

From my blog @ e-office

One of my colleagues Talitha came with a question to become
owner of an activity. Currently she is replacing Pauline. She allso
needed owner rights on a few activities owned by Pauline.

For now Pauline wasn’t around, so she couldn’t delegate owner access
to Talitha, so I gave the wsadmin commands to administer Activities a go.

con10:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin # !782
./wsadmin.sh -lang jython -username wasadmin -password jibbajabbapassword -port 8880

talitha=MemberService.fetchMemberByName(“Talitha Hiemstra” )
// Fetch the new owner of the activity
pauline=MemberService.fetchMemberByName(“Pauline Huijzer” )
// Fetch the current owner of the activity

ActivityService.fetchActivitiesOwnedByMember(pauline)
// Fetch all the activities owned by Pauline

You will get them in a nice “list” of all the activities owned by Pauline.

[{createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=9DEG0A6482142BD5A1BAFB3AE4BF75000313, modifiedBy=Eline Roelfsema, isCompleted=false, modifiedDate=February 9, 2009 8:25:21 AM CET, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=December 9, 2008 3:38:07 PM CET}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=CB2G0A6482148C6D604016D9755895000142, modifiedBy=Talitha Hiemstra, isCompleted=false, modifiedDate=February 11, 2009 8:52:36 AM CET, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=October 6, 2008 12:11:08 PM CEST}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=C03G0A6482142378A24E533036432B000267, modifiedBy=Talitha Hiemstra, isCompleted=false, modifiedDate=February 11, 2009 9:02:53 AM CET, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=November 13, 2008 3:52:55 PM CET}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=240G0A6482142378A24E533036432B0000B9, modifiedBy=Gerard van Reeken, isCompleted=false, modifiedDate=February 11, 2009 8:52:36 AM CET, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=November 6, 2008 4:44:25 PM CET}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=058G0A6482148F1FEB81155CB380B20000A2, modifiedBy=Pauline Huijzer, isCompleted=false, modifiedDate=January 12, 2009 1:36:13 PM CET, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=January 12, 2009 10:17:04 AM CET}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=D0DG0A648214CF481D90E02427DC65000900, modifiedBy=Talitha Hiemstra, isCompleted=false, modifiedDate=February 11, 2009 8:52:37 AM CET, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=September 4, 2008 2:18:12 PM CEST}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=B18G0A648214CE3163832B3B422AEA000672, modifiedBy=Activities Administrator, isCompleted=true, modifiedDate=October 2, 2008 9:52:07 AM CEST, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=September 26, 2008 2:36:37 PM CEST}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=A25G0A6482143B97A487BBAF07E352000148, modifiedBy=Pauline Huijzer, isCompleted=false, modifiedDate=January 21, 2009 5:51:40 PM CET, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=December 12, 2008 5:23:37 PM CET}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=E8CG0A6482143B97A487BBAF07E352000101, modifiedBy=Pauline Huijzer, isCompleted=false, modifiedDate=February 11, 2009 9:02:54 AM CET, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=December 12, 2008 12:00:44 PM CET}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=543G0A648214CF481D90E02427DC650005D0, modifiedBy=Pauline Huijzer, isCompleted=true, modifiedDate=September 23, 2008 12:37:03 PM CEST, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=August 27, 2008 4:20:50 PM CEST}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=69CG0A6482142AADA75E25B841F0E0000017, modifiedBy=Pauline Huijzer, isCompleted=true, modifiedDate=October 14, 2008 1:41:18 PM CEST, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=September 29, 2008 3:36:52 PM CEST}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=AA8G0A648214A61C9FE9A72CA297C90000BE, modifiedBy=Pauline Huijzer, isCompleted=true, modifiedDate=October 24, 2008 1:14:53 PM CEST, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=October 20, 2008 1:31:46 PM CEST}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=C14G0A648214CF481D90E02427DC65000746, modifiedBy=Pauline Huijzer, isCompleted=true, modifiedDate=September 3, 2008 3:16:33 PM CEST, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=September 1, 2008 8:48:44 AM CEST}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=ABFG0A6482A6FF86E5C11300DD88470003E0, modifiedBy=Activities Administrator, isCompleted=true, modifiedDate=March 10, 2008 4:11:27 PM CET, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=December 13, 2007 2:45:03 PM CET}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=07AG0A6482A694F8CACC7E280F49EA0001F8, modifiedBy=Activities Administrator, isCompleted=true, modifiedDate=December 17, 2007 10:07:20 AM CET, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=October 12, 2007 11:00:20 AM CEST}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=EC2G0A6482A6145F970ACC379CCF7A0001CD, modifiedBy=Activities Administrator, isCompleted=true, modifiedDate=December 17, 2007 11:15:36 AM CET, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=November 12, 2007 1:02:25 PM CET}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=5C9G0A6482A694F8CACC7E280F49EA00093F, modifiedBy=Activities Administrator, isCompleted=true, modifiedDate=December 5, 2007 9:19:16 AM CET, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=October 25, 2007 8:43:46 AM CEST}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=446G0A6482A62A1E9EFC1AFB961F960004E4, modifiedBy=Pauline Huijzer, isCompleted=true, modifiedDate=August 17, 2007 7:48:29 AM CEST, isTunedOut=true, isTemplate=false, isDeleted=false, createdDate=August 7, 2007 1:50:51 PM CEST}, {createdBy=Pauline Huijzer, name=bladdiebladdieproject, activityId=85FG0A6482A62A1E9EFC1AFB961F960002DD, modifiedBy=Pauline Huijzer, isCompleted=true, modifiedDate=August 7, 2007 9:26:25 AM CEST, isTunedOut=false, isTemplate=false, isDeleted=false, createdDate=August 7, 2007 9:26:25 AM CEST}]

myactivity=ActivityService.fetchActivityById(“C03G0A6482142378A24E533036432B000267”)
// Save the activity where it is about in the var myactivity

From the LC 2.0 info center

AccessControlService.setOwnerAccess( java.util.Vector activities, java.util.Hashtable owner)

from java.util import Vector
// The command to set access of an activity excepts an Vector
newActivities=Vector()
// the var myactivity is an HashMap, so we have to create a
// vector ourselfs
newActivities.add(myactivity)

AccessControlService.setOwnerAccess(newActivities,talitha)
// Make Talitha owner of the activity

AccessControlService.fetchAccess(myactivity)
// Check if all memberships are now ok

Talitha allready had access to this activity but only as a member. Setting
the access to owner will replace her previous access rules, you don’t have
to delete any rights and then apply the new ones.

Previous output of AccessControlService.fetchAccess(myactivity)

SNAP
{memberId=7DBG0A6482142378A24E533036432B000409, displayName=Talitha Hiemstra, loginNames=[talitha hiemstra, talitha.hiemstra@e-office.com], !staticProfile=false, externalId=0DC81DBF-0623-6B29-C125-74E90044E67C, email=Talitha.Hiemstra@e-office.com, memberType=person, role=member}]
!SNAP

Current output of AccessControlService.fetchAccess(myactivity)

SNAP
{memberId=7DBG0A6482142378A24E533036432B000409, displayName=Talitha Hiemstra, loginNames=[talitha hiemstra, talitha.hiemstra@e-office.com], staticProfile=false, externalId=0DC81DBF-0623-6B29-C125-74E90044E67C, email=Talitha.Hiemstra@e-office.com, memberType=person, role=owner}]
!SNAP

This entry was posted in lotus connections and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Please leave these two fields as-is:

Protected by Invisible Defender. Showed 403 to 807,335 bad guys.