Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 154876 - extract trac.core plug-in from trac.ui
Summary: extract trac.core plug-in from trac.ui
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Steffen Pingel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 151899 151907
Blocks:
  Show dependency tree
 
Reported: 2006-08-23 11:45 EDT by Mik Kersten CLA
Modified: 2006-09-08 09:48 EDT (History)
1 user (show)

See Also:


Attachments
updated Team Project Set (574 bytes, text/plain)
2006-08-23 15:51 EDT, Steffen Pingel CLA
no flags Details
mylar/context/zip (26.83 KB, application/octet-stream)
2006-08-29 16:05 EDT, Steffen Pingel CLA
no flags Details
mylar/context/zip (49.19 KB, application/octet-stream)
2006-09-08 09:48 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 Mik Kersten CLA 2006-08-23 11:45:59 EDT
I have created a new project called org.eclipse.mylar.trac.core, so you can now extract your core API and we can make it accessible via the headless tasks.core API.
Comment 1 Steffen Pingel CLA 2006-08-23 11:50:32 EDT
Great. Since I still have pending changes for the rich editor implementation in my workspace I'd rather make the split when these have been resolved.
Comment 2 Mik Kersten CLA 2006-08-23 11:54:35 EDT
No problem.  Don't forget to make sure that all of the packages of trac.core get exported (via the Runtime tab of the MANIFEST.MF editor).
Comment 3 Steffen Pingel CLA 2006-08-23 12:15:45 EDT
Note: add core to Team Project Set
Comment 4 Steffen Pingel CLA 2006-08-23 15:51:19 EDT
Created attachment 48518 [details]
updated Team Project Set
Comment 5 Mik Kersten CLA 2006-08-24 13:19:58 EDT
Patch applied.
Comment 6 Mik Kersten CLA 2006-08-28 23:18:37 EDT
Steffen: I'm raising the priority of this since it will enable use of Trac via the headless frameworks, and should be a straightforward move. 
Comment 7 Steffen Pingel CLA 2006-08-29 14:48:56 EDT
I have moved the core and the model package to the Trac core plug-in (not committed, yet). 

I am not sure which classes in org.eclipse.mylar.trac should be moved to the core plug-in such as TracTask, TracRepositoryConnector, Trac*Handler, TracAttributeFactory, Trac*Query? Looking at the Bugzilla plug-in I noticed that BugzillaTask and BugzillaRepositoryConnector are (still) located in the UI plug-in.

I am also thinking about renaming the following  packages:

 org.eclipse.mylar.internal.trac         ->  org.eclipse.mylar.internal.trac.ui
 org.eclipse.mylar.internal.trac.core ->  org.eclipse.mylar.internal.trac.core.server

Mik, could you please advise? 
 
Comment 8 Mik Kersten CLA 2006-08-29 15:13:37 EDT
You should move as much as you can without coupling to the UI.  You can consider the use case to be a server side application that wants to query Trac but does not use any of the Eclipse UI facilities.

Yes, the mylar.internal.trac package in the trac.ui package should be renamed to mylar.internal.trac.ui.

I wouldn't bother renaming to trac.core.server, because trac.core will be largely about connecting to the server, so that naming should probably come from class naming conventions.  We still need to resolve bug 149940, so just use what you think is right and that will provide good input to the Connector naming conventions.
Comment 9 Steffen Pingel CLA 2006-08-29 16:05:17 EDT
I have moved the packages mentioned in comment #7. I was not able to move TracRepositoryConnector and dependent classes since it needs the RepositoryManager and TaskList instances that are managed by TasksUiPlugin:

 * TasksUiPlugin.getRepositoryManager()
 * TasksUiPlugin.getTaskListManager().getTaskList()
 
Once these become accessible from core TracRepositoryConnector, TracTask, TracTaskExternalizer Trac*Handler, TracQuery and TracQueryHit can be moved to trac.core.
Comment 10 Steffen Pingel CLA 2006-08-29 16:05:21 EDT
Created attachment 48997 [details]
mylar/context/zip
Comment 11 Mik Kersten CLA 2006-09-03 03:56:01 EDT
Is it possible to instantiate those classes with a TaskList instance, or pass that instance to the methods that need it?  And consider doing the same for RepositoryManager?  Using that approach, rather than a central entry point, can make for easier unit testing and better encapsulation...
Comment 12 Steffen Pingel CLA 2006-09-03 10:38:08 EDT
Yes, I certainly agree that getting rid of accessing singletons as much as we can is the way to go. This will take quite a bit of refactoring but this shouldn't be too hard. I am not sure about classes extending AbstractRepositoryConnector as these are created through an extension point. We may need a setTaskList() and setRepositoryManager() method here. In most other cases extending signatures (e.g. AbstractQueryHit.getOrCreateCorrespondingTask(TaskList)) should do it.
Comment 13 Mik Kersten CLA 2006-09-07 22:03:27 EDT
Yes, supporting turned out to be a big refactoring, but it's done now.  BugzillaRepositoryConnector is now in bugzilla.core, and TracRepositoryConnector has been updated accordingly.  So go ahead and try to extract it following the Bugzilla example and let me know if anything blocks you.
Comment 14 Steffen Pingel CLA 2006-09-08 09:48:03 EDT
I have moved the remaining classes with only minor hiccups. 

The implementation of the repository attribute serialization needs to be cleaned (I think TracRepositoryConnector should not depend on TracCorePlugin) but this will be addressed as part of bug 150680.
Comment 15 Steffen Pingel CLA 2006-09-08 09:48:07 EDT
Created attachment 49712 [details]
mylar/context/zip