How to archive access groups programmatically
One answer
Likely Yes. The code below is untested and might not work but could be some kind of stating point.
// Not sure that worksIAccessGroupService accessGroupService = (IAccessGroupService) teamRepository.getClientLibrary(IAccessGroupService.class);
accessGroup = (IAccessGroup) accessGroup.getWorkingCopy();//com.ibm.team.process.internal.common.service.IAccessGroupServiceaccessGroupService.archive(accessGroup);//accessGroupClientService.archiveAcccessGroup(accessGroup, monitor)accessGroupClientService.save(accessGroup, monitor);
I know this works:
IAccessGroupClientService accessGroupClientService = (IAccessGroupClientService) teamRepository.getClientLibrary(IAccessGroupClientService.class);
And you can find accessGroups using IAuditableCommon.
Comments
Hi Ralph,
Thanks for the response.
IAccessGroupService accessGroupService = (IAccessGroupService) teamRepository
.getClientLibrary(IAccessGroupService.class);
I am working on a client side application, above code always returns me null. It's not able to fetch proper service object.
While I face some difficulty in getting it working with alternative approach suggested.
accessGroupClientService.archiveAcccessGroup(group, rtcBean.getProgressMonitor()); {Error: Method is undefined }
I am using RTC 6.0.2 java libraries. Am I missing something?
I am working on a client side application, above code always returns me null. It's not able to fetch proper service object.
While I face some difficulty in getting it working with alternative approach suggested.
accessGroupClientService.archiveAcccessGroup(group, rtcBean.getProgressMonitor()); {Error: Method is undefined }
I am using RTC 6.0.2 java libraries. Am I missing something?
I searched the code and IAccessGroupService is only used in the server API using getService(). If is however the only API I found that allows to archive and delete AccessGroups. I might have overlooked something.
If you set up the development environment with the SDK as explained in the Extensions Workshop, you can search the API. I don't have the time to search the API for you. I spent as much time as I could.
I had another quick look. The IAccessGroupService is not easily accessible. You can get the IAccessGroupClientService
IAccessGroupClientService accessGroupClientService = (IAccessGroupClientService) teamRepository
.getClientLibrary(IAccessGroupClientService.class);
Which internally uses IAccessGroupService but does not expose the API to archive and delete access groups.
You can look up how that class gets the IAccessGroupService and try to get it in a similar way, but it is basically using internal APIs if you achieve that goal.