Using the API to determine when a changeset was delivere
Hi,
I'm using the jazz plain client to read the contents of a stream or workspace. I use the following API calls to get there:-
IWorkspaceManager.findWorkspacesByName
IWorkspaceManager.getWorkspaceConnection
IWorkspaceConnection.getComponents
IWorkspaceConnection.configuration
IConfiguration.childEntriesForRoot
Once I work through the heirachy I end up with a load of IFolder and IFileItem.
From IFileItem/IFolder how can I find out the last changeset to modify that file and most importantly, in my case, when that changeset was delivered to my stream/workspace?
Cheers,
Michael Baylis
IBM Hursley
I'm using the jazz plain client to read the contents of a stream or workspace. I use the following API calls to get there:-
IWorkspaceManager.findWorkspacesByName
IWorkspaceManager.getWorkspaceConnection
IWorkspaceConnection.getComponents
IWorkspaceConnection.configuration
IConfiguration.childEntriesForRoot
Once I work through the heirachy I end up with a load of IFolder and IFileItem.
From IFileItem/IFolder how can I find out the last changeset to modify that file and most importantly, in my case, when that changeset was delivered to my stream/workspace?
Cheers,
Michael Baylis
IBM Hursley
3 answers
To find the changeSets that affected a particular file or folder, you use IWorkspaceConnection.changeHistory(component) to get an IChangeHistory object.
IChangeHistory.getHistoryFor will return IChangeHistoryEntryChange objects that reference the changeSets that modify the file/folder.
Unfortunately the entries returned here do not give you the date the changeSet was introduced to the workspace or stream.
Starting in 5.0.1 Sprint 1 which will be available in the next week or so, Story 304215 introduces changes so that when you use IWorkspaceConnection.changeHistory(), the IChangeHistory.recent, getHistoryDescriptor and getHistoryDescriptors will return IChangeHistoryEntryChange objects that do contain the dates the changeSet was introduced to the stream.
Here, you would first use getHistoryFor to find the changeSet id, and then search through the history returned from getHistoryDescriptors to find that changeSet and get the delivery date from there.
IChangeHistory.getHistoryFor will return IChangeHistoryEntryChange objects that reference the changeSets that modify the file/folder.
Unfortunately the entries returned here do not give you the date the changeSet was introduced to the workspace or stream.
Starting in 5.0.1 Sprint 1 which will be available in the next week or so, Story 304215 introduces changes so that when you use IWorkspaceConnection.changeHistory(), the IChangeHistory.recent, getHistoryDescriptor and getHistoryDescriptors will return IChangeHistoryEntryChange objects that do contain the dates the changeSet was introduced to the stream.
Here, you would first use getHistoryFor to find the changeSet id, and then search through the history returned from getHistoryDescriptors to find that changeSet and get the delivery date from there.