Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 174864 - Support Automatic Repository Creation
Summary: Support Automatic Repository Creation
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Shawn Minto CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 152212 (view as bug list)
Depends on: 149607
Blocks:
  Show dependency tree
 
Reported: 2007-02-20 16:08 EST by Shawn Minto CLA
Modified: 2007-02-22 17:20 EST (History)
2 users (show)

See Also:


Attachments
userManaged repositories (15.50 KB, patch)
2007-02-21 17:43 EST, Shawn Minto CLA
no flags Details | Diff
mylar/context/zip (8.02 KB, application/octet-stream)
2007-02-21 17:43 EST, Shawn Minto CLA
no flags Details
Double Click Patch (943 bytes, patch)
2007-02-21 19:25 EST, Shawn Minto CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shawn Minto CLA 2007-02-20 16:08:53 EST
It would be nice to have the support for automatic repository creation so that a repository that only has 1 instance (e.g. local tasks) could be created automatically on startup.  

Currently, this can't be done since the repositories are read after the connectors are loaded.  This means that if the plug-in that wants the automatically created repository attempts to do this, it will always create a new repository since there are no repositories of that kind on startup.
Comment 1 Shawn Minto CLA 2007-02-21 14:26:29 EST
I think that this should be supported through part of the org.eclipse.mylar.tasks.ui.repositories extension point.  To support this, I would add an optional element called automaticCreation.  This would have attributes that specify the details for the automatically created repository such as the name, url, etc that are necessary to create the repository.

After the repositories are read, the TasksUiPlugin would check the list of automatically created repositories and if they do not already exist, create them.

It would also be beneficial to have an attribute that specifies whether the user can create the repository.  If this is true, the repository wizard will be unchanged, but if it is false and the user is not allowed to create the repository, the repository type is left out of the list.
Comment 2 Mik Kersten CLA 2007-02-21 15:33:10 EST
The design you propose sounds very good.  I think we can just go with "autoCreate=true" for an automatically created repository, and that will behave as you specified.  Then we also add the ability to specify "autoManage=true", which means that the user can not manage the repository (can not delete, does not show up in creation wizard).
Comment 3 Eugene Kuleshov CLA 2007-02-21 16:17:11 EST
I wonder if we should allow to import/export repository templates (in addition to specifying them in the extension point)
Comment 4 Shawn Minto CLA 2007-02-21 17:42:16 EST
It turns out that there was already an addAutomatic boolean in the template extension point that we could use.  It turns out that this functionality was never implemented.  To have this work, I had to add a loop over all of the templates in the start method of TasksUiPlugin to ensure that these repositories are created on startup.

As for userManaged, I added an attribute to the RepositoryConnector extension.  If this is set to false, then the user is unable to modify the task repository in any way.  This was done by disabling the actions on in the TaskRepositoriesView if userManaged = false on the connector.
Comment 5 Shawn Minto CLA 2007-02-21 17:43:01 EST
Created attachment 59520 [details]
userManaged repositories
Comment 6 Shawn Minto CLA 2007-02-21 17:43:03 EST
Created attachment 59521 [details]
mylar/context/zip
Comment 7 Eugene Kuleshov CLA 2007-02-21 18:28:38 EST
We also need to make it easier to create new repositories when linked trough org.eclipse.mylar.tasks.ui.projectLinkProviders extension point.

See http://wiki.eclipse.org/index.php/Mylar_Integrator_Reference#Mapping_from_projects_to_Task_Repositories

It seems like AbstractTaskRepositoryLinkProvider should have some API for creating new repositories. Probably should just return repository template instance. That could be used from [Add Repository] action in Project preferences. 

Then TaskUI could iterate trough all workbench projects on startup and ask link providers for these repository templates.
Comment 8 Mik Kersten CLA 2007-02-21 18:41:45 EST
Looks great Shawn, patch applied.  I'll leave this open for now because we may want to add some additional UI (e.g. have a disabled/gray icon on the repositories that are automatically added).

Eugene: that sounds like it could be a good idea, but it should probably go on a separate bug report?  I also have a bit of concern about the performance of iterating through every project on startup, even if this is done asynchrnously, so maybe as a first pass it could be user initiated via a wizard.  But then there's the risk of nobody using that wizard.
Comment 9 Eugene Kuleshov CLA 2007-02-21 18:49:10 EST
bug 175064
Comment 10 Shawn Minto CLA 2007-02-21 19:25:47 EST
Created attachment 59532 [details]
Double Click Patch

Thanks for applying the patch.  I just realized that I missed the double click case.  Here is a very small patch to fix that.
Comment 11 Robert Elves CLA 2007-02-21 20:11:24 EST
Is bug#152212 a duplicate?
Comment 12 Mik Kersten CLA 2007-02-21 20:45:42 EST
*** Bug 152212 has been marked as a duplicate of this bug. ***
Comment 13 Mik Kersten CLA 2007-02-21 20:50:36 EST
Patch applied and verified, nice work.
Comment 14 Eugene Kuleshov CLA 2007-02-21 20:51:55 EST
We still need that lazy creation
Comment 15 Shawn Minto CLA 2007-02-22 11:11:46 EST
I will agree that prompting the user for credentials would be nice for this facility, but I don't think that it is required as part of the solution to this bug.  However, when the facility for prompting users for credentials is added, the case of automatic repository creation might require special attention.
Comment 16 Mik Kersten CLA 2007-02-22 17:20:33 EST
Created bug 175205 for credentials prompt.  Anything left here?