Usage of the Extension Point - Build Result Delete Participants
I have published a custom contribution to the build result and also have a contribution provider so it appears in the Build Results view in its own tab(it retreives a zip file via ftp from a host, unzips it locally and formats the files for viewing). The file is too large to store as a contribution as discussed in my other forum questions. That all works great, no issues with that part.
Now I am attempting to delete the files when the build result is deleted. I want to delete the contribution file(small file with ftp connection info) in the repository attached to the result, the zip file residing on the host via ftp and the locally unzipped files. I have written a Build Result Delete Participant, but it doesn't seem to get control at time of delete. It seems via the FAQ page that is by design. That it is only marked for deletion and deleted later? Therefore I cannot do all I want to do? I can only delete the contribution file in the respos? I modeled this after the CompileContributionDeleteParticipant. But I not actually deleting the file yet, just seeing if it gets control before I implement all the other logic. Can I do what I want to do? Is my coding correct and understanding correct? Also I would like to cause a dialog to pop up during the delete because we also have some user specific options the user can select as to what and how to clean various items form the host that were created via the build process. It seems like that cannot be done with the participant if it indeed runs at a later time. Are there any other ways to accomplish what I want to do. Is there a way to add a custom action off the context menu for a build result? Also I get a waring when I code the
|
2 answers
> Is there a way to add a custom action off the context menu for a build result?
Yes, some of Build's own actions are contributed in this way, e.g. the plugin.xml for com.ibm.team.build.ui has:
<extension point="org.eclipse.ui.popupMenus"> Comments Please ignore br tags that were randomly inserted by the forum software.
Steve White
commented Aug 21 '13, 10:41 a.m.
Nick, thnx, I've been able to add a custom action, but I have an additional question based on that. I'm thinking I'd rather associate this to the View like the "Delete" action vs the BuildResult object and use the "viewContribution" tag. I have located the delete action class in the sdk DeleteBuildResultActionDelegate, but I cannot locate the BuildResults View class to reference in the xml. Also I cannot locate the plugin.xml files in the sdk, so if you can either point me to where I can find the plugin.xml files or paste it here that would be great.
Steve White
commented Aug 21 '13, 11:01 a.m.
Nick, is the view class "BuildQueryView" ? I see that in the sdk and it appears that is the src code for what I was calling the BuildResults View
Yes, that's the view class, but the id for the menu to contribute to is different. In the plugin.xml for the UI plugin, we actually contribute the delete action using a viewer contribution, using targetID="com.ibm.team.build.ui.queryViewContextMenu". re "Also I cannot locate the plugin.xml files in the sdk", the SDK just has the Java sources, which are intended to be "mixed in" to a target platform (e.g. P2 repository) containing the "binary" plugins you're compiling against. For any of the client-side/UI plugins, you can also check your RTC Eclipse install under eclipse/plugins. |
Hi Steve, the issue is likely due to adding the delete participant extension in the same plugin as the UI extension. The delete participants extension point is server-side, not UI, JBE or other client-side. I would expect your Eclipse error log to contain an entry complaining about an unknown extension point.
A delete participant extension is called some time after the build gets deleted, when the build result pruner background task runs (by default it's every 15 mins). When a build (IBuildResult) is deleted, it just marks its associated contributions (IBuildResultContributions item) for deletion, which the pruner task discover when it runs. If the item has any contributions matching a delete participant extension, the extension is called to clean them up.
As for cleaning up the file associated with the build, if the file was published to the build result using own of the publishing Ant tasks (filePublisher, artifactFilePublisher, logPublisher) then its content is described by an IContent associated with the BuildResultContribution. These get cleaned up automatically when the referencing item is deleted. The external file on the FTP site would still need to be deleted, of course.
See the extensions workshop article for more on developing / deploying server-side plugins.
https://jazz.net/library/article/634/
|
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.