This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 132393 - Support for Grails plugins
Summary: Support for Grails plugins
Status: NEW
Alias: None
Product: groovy
Classification: Unclassified
Component: Grails (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Janicek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-09 12:32 UTC by schmidtm
Modified: 2013-09-04 09:02 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
this patch allows to create plugins from the grails project context menu, I'm working on other capabilities. (12.01 KB, text/plain)
2008-06-16 16:11 UTC, calavera
Details
adds a window dialog that shows the plugins installed in an app and the available ones into the grails server. It allows to install and uninstall plugins. (49.23 KB, text/plain)
2008-07-01 12:08 UTC, calavera
Details
updated patch (50.81 KB, text/plain)
2008-07-02 22:29 UTC, Petr Hejl
Details
yet another improvement (50.82 KB, text/plain)
2008-07-03 22:51 UTC, Petr Hejl
Details
Thanks for the feedback and the improvements. I've fixed the tabs symcronization errors and I've added a progress bar dialog that's shown when a plugin is been installed (59.79 KB, text/plain)
2008-07-08 15:21 UTC, calavera
Details
I've added a file chooser in order to allow installing plugins from zip files (67.04 KB, text/plain)
2008-07-09 14:52 UTC, calavera
Details
patch iteration (67.73 KB, text/plain)
2008-07-09 21:45 UTC, Petr Hejl
Details
I've fixed PH12, PH13 and PH14 (68.86 KB, text/plain)
2008-07-10 11:48 UTC, calavera
Details
Screenshot of garbled dialog on Mac OS X (27.07 KB, image/png)
2008-07-14 09:25 UTC, schmidtm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description schmidtm 2008-04-09 12:32:40 UTC
To provide a coherent support grails plugins we need to provide:

1.) Some visualization for the "grails list-plugins" command. Possibly let the user pick one and take him to step #2
2.) Let the user install using "grails install-plugin".
3.) Display additional commands in apropriate context.
Comment 1 calavera 2008-06-16 16:11:20 UTC
Created attachment 62881 [details]
this patch allows to create plugins from the grails project context menu, I'm working on other capabilities.
Comment 2 calavera 2008-06-16 16:17:08 UTC
There is an error into the patch, please, could you delete it?, I'll provide a new one when I'll fix it
Comment 3 martin_adamek 2008-06-16 17:26:48 UTC
It's not possible to remove attachment, just create new one. And thanks!
Comment 4 calavera 2008-07-01 12:08:05 UTC
Created attachment 63747 [details]
adds a window dialog that shows the plugins installed in an app and the available ones into the grails server. It allows to install and uninstall plugins.
Comment 5 Petr Hejl 2008-07-02 14:00:53 UTC
Thanks for the patch! However I have few comments for you.
PH01: Plugin should be immutable class (make fields final).
PH02: Plugin brokes equals-hashcode contract. Please override hashCode too.
PH03: If there is no particular reason for custom process handling you should use grails ExecutionSupport with help from
extexecution API. Sample usage is GrailsActionProvider.executeSimpleAction(). Note you can easily assign LineProcessor
to get parsed output from this api.
PH04: PLUGINS_COMPARATOR does not ignore case (as Plugin.equals() do). Perhaps Plugin should implement Comparable and
implementation of Comparable should be consistent with equals().
PH05: I do not understand all that runners in GrailsPluginPanel. These are all executed in the same thread - is there
any need for runnable.
PH06: There is strange synchronization in GrailsPluginPanel (related to that runners). Inside of the Runnable you
synchronize on "this" - maybe what you meant is "GrailsPluginPanel.this".
Comment 6 Petr Hejl 2008-07-02 14:03:07 UTC
Adding patch author on cc. David can you comment?
Comment 7 schmidtm 2008-07-02 17:36:24 UTC
Hi David,

first and foremost - thanks a lot for your patch! Don't get frustrated about us criticizing it ;-)

Alas, I had no chance to get any plugin added to my projects. And this leads me to my proposal to have 
more feedback (progress-bars, grails-server output) about what's going on under the hood.

I managed to get the list of available plugings, choosed one, and after a while it took me to the installed-tab, 
but nothing happened.

In another test i did, i couldn't get the list of available plugins at all and had to close the dialog with the 
close gadget after a couple of minutes. There must be a cancel button beside OK/HELP.

To sum it up: I would love to get this feature in - and we jointly will get there - , but we need more information 
for the user and the Grails server output in the IDE just like the other tasks.
Comment 8 Petr Hejl 2008-07-02 22:28:05 UTC
I've just tuned the patch a bit so I'm attaching it. It is not complete and there are still some issues (wrong items in
list, sometimes not all plugins are listed). Perhaps the UI could be different - some progressbar would be nice. I'm
just sharing what I've done. I have to go sleep now ;)
Comment 9 Petr Hejl 2008-07-02 22:29:02 UTC
Created attachment 63850 [details]
updated patch
Comment 10 Petr Hejl 2008-07-03 22:50:54 UTC
Improved patch - fixed wrongly parsed plugins (causing NPEs in UI).
Comment 11 Petr Hejl 2008-07-03 22:51:42 UTC
Created attachment 63913 [details]
yet another improvement
Comment 12 calavera 2008-07-08 15:21:58 UTC
Created attachment 64093 [details]
Thanks for the feedback and the improvements. I've fixed the tabs symcronization errors and I've added a progress bar dialog that's shown when a plugin is been installed
Comment 13 calavera 2008-07-09 14:52:18 UTC
Created attachment 64182 [details]
I've added a file chooser in order to allow installing plugins from zip files
Comment 14 Petr Hejl 2008-07-09 20:33:54 UTC
Thanks for working on this. I have some additional comments.
PH07: getPluginFromZipFile contains resource leak (zip entry). Very dangerous especially on windows.
PH08: Return value of install-plugin process should be checked and some cleanup/ui notification should be made when != 0
PH09: Interruption exception shouldn't be ignored - somebody is requesting interruption.
PH10: Better handling of ExecutionException is Exceptions.printStackTrace(ex.getCause());
PH11: On cancellation exception similar cleanup as for PH08 should be made.

I'll try to implement at least 07, 09 and 11.

Thanks again for contribution.
Comment 15 Petr Hejl 2008-07-09 20:35:08 UTC
Martin do you think this should be part of 6.5?
Comment 16 Petr Hejl 2008-07-09 21:43:21 UTC
Ok I've fixed all my comments (07-11) + some minor tweaks ;)
I rewrite the GrailsPluginManager.installPlugin() bit to achieve the goal.
What should be done yet:
PH12: change the type of parameters in GrailsPluginManager to GrailsPlugin instead of Object
PH13: split installPlugin to make it more readable
PH14: use final fields wherever possible

Please review the patch for regressions.
Thanks.
Comment 17 Petr Hejl 2008-07-09 21:45:33 UTC
Created attachment 64211 [details]
patch iteration
Comment 18 calavera 2008-07-10 11:48:30 UTC
Created attachment 64239 [details]
I've fixed PH12, PH13 and PH14
Comment 19 Petr Hejl 2008-07-11 16:58:16 UTC
Pushed to main 5a7143662336.
Comment 20 schmidtm 2008-07-14 09:25:25 UTC
Created attachment 64409 [details]
Screenshot of garbled dialog on Mac OS X
Comment 21 schmidtm 2008-07-14 09:31:40 UTC
I verified the patch on my two Mac's (Intel + PPC). It works in principle and i like it, but there are two things i like to bring up:

a) On Mac the JButton named "Install" is only partly visible. See screenshot.

b) The (initial) updating the list of available plugins takes ages even behind fast internet connections. The Console output is a major improvement here,
    but there is no progress-indicator whatsoever. Would it be feasible to hook into the corresponding grails command to get a progess-bar 
    for this operation?


Comment 22 Petr Hejl 2008-07-14 09:40:45 UTC
a) UI definitely needs to be polished
b) I think only indeterminate progress bar is possible here.

I'll look at this.
Comment 23 Quality Engineering 2008-07-17 04:48:49 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #324 build
Changeset: http://hg.netbeans.org/main/rev/5a7143662336
User: phejl@netbeans.org
Log: #132393 Support for Grails plugins
Comment 24 Petr Hejl 2008-07-17 14:07:03 UTC
Polished ui pushed to main f07343dad813.