Community
Participate
Working Groups
Provide an implementation of IAttachmentHandler for uploading and downloading of task contexts. IAttachmentHandler may need to be changed since Trac does not have a unique attachment id but uses per ticket filenames.
Created attachment 47237 [details] Modifies signature of IAttachmentHandler Pass the RepositoryAttachment object instead of an integer attachment id.
Created attachment 47238 [details] mylar/context/zip
Patch applied.
I have a simple implementation of IAttachmentHandler for attaching contexts (context retrieval requires IOfflineTaskHandler). There are few unresolved problems though: * Trac repositories accessed through the web do not support attachments, so an CoreException with an IStatus that has its severity set to Info is thrown download/uploadAttachment(). This will cause an error dialog to be displayed (see ContextAttachWizard.performFinish()). A message dialog would be more appropriate or disabling the action in the first place. * AbstractRepositoryConnector.attachContext() invokes task.setSyncState(RepositoryTaskSyncState.OUTGOING) but does not reset the task state in case of an exception. * Attachment uploading does not work when a repository is accessed anonymously (see bug 154372).
Regarding points 1 & 3: how about we add canUpload(TaskRepository) and canDownload(TaskRepository) methods to IAttachmentHandler? These can do the appropriate check and the UI respond with a MessageDialog as you suggest. Rob: regarding point 2, could create a failing test for this and then fix?
Bug 154372 and bug 154441 address the issues mentioned in point 1 and 3. I'll attach the attachment handler for Trac when the pending patches have been merged. The patch will require the latest revision of the Trac XmlRpc plug-in that includes a small enhancement to the attachment api (http://trac-hacks.org/changeset/1154). I guess we should mention that in the release notes or on the wiki page.
re: comment#5, fix and test is now in HEAD.
Steffen: is this resolved now? I've added a note to the New & Noteworthy. You should also update: http://wiki.eclipse.org/index.php/Mylar_FAQ#Trac_Connector_troubleshooting
(In reply to comment #8) > Steffen: is this resolved now? No, the actual implementation for Trac is still missing :). I am currently working on test cases and will attach the patch later today.
Created attachment 48347 [details] Trac attachment handler Currently only uploading of contexts is supported as downloading will require RepositoryTaskData and IOfflineTaskHandler. Mik, this patch should fix the test failures.
Created attachment 48348 [details] mylar/context/zip
Patch applied. Steffen, feel free to close your own reports once you have resolved them.
Fixed.