It's all about the answers!

Ask a question

How to get the changes in an eclilpse plugin on delivery


N. VD (842634) | asked Feb 03 '15, 10:32 a.m.
 Hi Forum,

I have managed to create a server-side plugin when a user delivers something.
I dont know how to get the changes within the changeset?

this is the code to list the changesets:

DeliverOperationData data = (DeliverOperationData) operationData;
       List<?> changeSetHandles = data.getChangeSetHandles(); 
How can i see what's in the changesets?
(when an enterprise extension named 'naming convention' is changed, the delivery should be blocked)

One answer



permanent link
Ralph Schoon (63.1k33646) | answered Feb 03 '15, 11:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Maybe this helps? https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/, however it looks only at the change sets. There are however other posts that look a bit deeper at SCM: https://rsjazz.wordpress.com/?s=scm

Comments
N. VD commented Feb 03 '15, 12:53 p.m.

 Hi Ralph. I have read the posts you suggested and am able to get the IChangeSethandle interfaces, but i still do not see what changes are made on the files... Can you provide me with some more information please? 


sam detweiler commented Feb 03 '15, 1:59 p.m.

Handles are persistent pointers to objects.. to get the actual object, you need to use one of the Auditable resolvers to get the data out of the database..

here is a call I use in one server side plugin.. this for workitem related info
// Get the full state of the parent work item so we can edit it
            IWorkItem workingCopy = (IWorkItem) fWorkItemServer.getAuditableCommon().resolveAuditable(workItem, IWorkItem.FULL_PROFILE, monitor).getWorkingCopy();

and here using the item service
fItemService = getService(IRepositoryItemService.class);
IProjectArea projectArea = (IProjectArea) fItemService.fetchItem(operation.getProcessArea().getProjectArea(), new String[]{IProjectArea.NAME_PROPERTY_ID});

then the objects are populated and you use the object class instead of the object HANDLE class.


Ralph Schoon commented Feb 04 '15, 2:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I only have what I blogged about, sorry. Another source, maybe could be http://thescmlounge.blogspot.de/ , maybe if you search the web, there could be code snippets out there.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.