Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 151900 - Trac connector: implement attachment support
Summary: Trac connector: implement attachment support
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 enhancement (vote)
Target Milestone: 0.7   Edit
Assignee: Steffen Pingel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-26 15:21 EDT by Steffen Pingel CLA
Modified: 2006-08-22 19:47 EDT (History)
3 users (show)

See Also:


Attachments
Modifies signature of IAttachmentHandler (3.80 KB, patch)
2006-08-02 12:11 EDT, Steffen Pingel CLA
no flags Details | Diff
mylar/context/zip (1.27 KB, application/octet-stream)
2006-08-02 12:11 EDT, Steffen Pingel CLA
no flags Details
Trac attachment handler (17.61 KB, text/plain)
2006-08-21 20:55 EDT, Steffen Pingel CLA
no flags Details
mylar/context/zip (5.98 KB, application/octet-stream)
2006-08-21 20:55 EDT, Steffen Pingel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2006-07-26 15:21:47 EDT
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.
Comment 1 Steffen Pingel CLA 2006-08-02 12:11:03 EDT
Created attachment 47237 [details]
Modifies signature of IAttachmentHandler

Pass the RepositoryAttachment object instead of an integer attachment id.
Comment 2 Steffen Pingel CLA 2006-08-02 12:11:40 EDT
Created attachment 47238 [details]
mylar/context/zip
Comment 3 Mik Kersten CLA 2006-08-03 03:04:23 EDT
Patch applied.
Comment 4 Steffen Pingel CLA 2006-08-18 12:33:45 EDT
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).
 
Comment 5 Mik Kersten CLA 2006-08-18 21:41:25 EDT
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?
Comment 6 Steffen Pingel CLA 2006-08-19 17:22:01 EDT
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.
Comment 7 Robert Elves CLA 2006-08-21 19:00:55 EDT
re: comment#5, fix and test is now in HEAD.
Comment 8 Mik Kersten CLA 2006-08-21 19:06:48 EDT
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
Comment 9 Steffen Pingel CLA 2006-08-21 19:13:42 EDT
(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.

Comment 10 Steffen Pingel CLA 2006-08-21 20:55:47 EDT
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.
Comment 11 Steffen Pingel CLA 2006-08-21 20:55:49 EDT
Created attachment 48348 [details]
mylar/context/zip
Comment 12 Mik Kersten CLA 2006-08-22 19:28:20 EDT
Patch applied.  

Steffen, feel free to close your own reports once you have resolved them.
Comment 13 Steffen Pingel CLA 2006-08-22 19:47:48 EDT
Fixed.