Grails UI plugins - grails

I'm doing web project using Java EE framework.
I want to use Grails UiPerformance plugin in my project.
Can I use that plugin for user interface design?
I would like to know what is the purpose of this plugin?

There are a few reasons why this is not the plugin you want. The purpose of the plugin is described here - it's to improve page loading performance and deals with gzipping, minification, bundling, etc.
The primary reason is that it has nothing to do with interface design. And if you do want a plugin for static resource handling, the asset-pipeline plugin is the current best option.

Related

Creating Grails shared libraries

I'm working on a multi-module project right now, where most of the modules are designed to have their own Web interface (REST API, Web pages, etc.) done using Grails. There are a few classes that I want to be utilized by different (all) modules. If this were a straightforward Java project, I would just create a new Maven project (using archetype:generate), deploy/install, and just import it on the modules accordingly. How do I do this with Grails? Is this one of the things Grails plugins are meant to address?
Since you are talking about a jar/lib artifact it would be best to use a local Maven repository where you build your maven project to then resolve it as a dependency for your modules within your BuildConfig.groovy.
Nothing is stopping you from using a Grails plugin to provide this resource, but that seems a bit overkill since Grails plugins are intended to do so much more.
It looks to me that you want to have a multi-project build or a Mavenized Grails project or separate plugins.
Use a Grails multi-project-build
Guide: http://grails.org/doc/2.1.0/ref/Command%20Line/create-multi-project-build.html
Straight Maven integration
Guide : http://grails.org/doc/latest/guide/commandLine.html#antAndMaven
I have a basic introduction video here: https://www.youtube.com/watch?v=tqGN61hiciE
Separate Grails plugins
You could still use separate Grails plugins and reference them in your main application.

Using grails-mail-plugin outside Grails app

Is it possible to use a grails plugin outside a grails application?
I would like to use the functionality of grails-mail-plugin in a simple groovy/gradle app.
I found some information about binary plugins but I'm not sure how to define the dependency to an official grails plugin.
Thanks!
I don't think you could use any Grails plugin itself outside the Grails environment, usually there is a ton of Grails-specific assumptions built into the plugins' code.
If your Groovy application uses Spring, you could migrate the most important functionality out of it.
For this, you will have to get into the innards of the source code of the plugin (e.g. how it uses the Spring Mail package for example) which not may be very quick or easy work.
If your requirements are simple, you may be better of with building a standalone solution, possibly, directly on top of JavaMail.
If you already have a heterogeneous architecture, you may build a separate Grails application/module which only does mailing functionality (possibly through the Async Mail plugins database tables) in integration with the module you build in pure Groovy.

Is there a way to separate the mercury code from all the bundled third party libraries?

I suppose it is for the simplicity of installation and distribution that mercury is bundled together with third party libraries in the same .js file.
This is good for small projects i guess, that will not have many dependencies to third party libraries, but I don't feel comfortable bundling a bunch of jquery UI plugins together with its own version of jquery along with the mercury code.
Is there a way to create a distribution that does not include these libraries, so that the developer takes care personally about delivering the needed dependencies?
This is all in an effort to create a grails plugin that will include mercury, much the same way as you do it in rails.
I'm assuming that you mean to ask if it's possible to have the javascript code and other client-side assets from the mercury project be distributed as part of a plugin, but not the dependencies that mercury includes in it's repository (tsk, tsk).
You're best bet is likely to simply copy over the files into a new project (looks like you have one) and leave out the jQuery (and any other) dependencies. You can safely depend on these resources by declaring them in your BuildConfig.groovy as plugins. This means that the jQuery plugin will be installed automatically when they install your plugin (unless they already have it installed).
You'll also probably want to look into integrating with the resources plugin, in order to deliver your javascript and images in an optimized way, and easy for plugin consumers to use.

What features does the Struts2 development plugin for your IDE offer?

This concerns the state of Struts2 framework tooling, although currently I use no IDE plug-in, preferring to create projects with maven from scratch. At one time I did use the Netbeans Struts2 plugin but stopped when support lapsed for a time between IDE releases.
It is important to know the state of current tooling and so ask:
What features are offered by the Struts2 IDE framework plugin for your IDE(s)?
Are there any design issues with the plugin? (flaws such as wanting to include old or outdated libraries)
This answer applies to the the Netbeans plugin found here: http://plugins.netbeans.org/plugin/39218 (at time of writing the last updated was : 2011-12-17)
Features
When Starting a new project. File > New Project > Web Application
You now have the option of adding struts2 support, which can product a struts2 demo project.
Not tested, but should assist in validation.xml files.
Issues and Limitations
There is no support to create sources in a Maven Web application.
If you use annotations for validation the plug-in does not help.
There is no more support in struts.xml than provided by the IDE naturally. I would have really liked to see property suggestions at the very least, and it would have been very nice to see a list of name values when in a struts.xml constant tag. The IDE does do auto completion in applicationContext.xml where it expects a class, this would be really helpful in struts.xml for the class attribute of the action tag (among other places).
There is an annoying issue of the plug-in creating struts.xml files with a special icon but when creating new xml documents this icon does not apply (should be applied on the basis of the dtd) so you need to copy and paste the file to get the icon and then change the contents.
It only provides struts2 version 2.0.14 or 2.2.3
Over all I do not recommend this plug-in over a standard Maven Project and manually adding the dependencies.

Compiled and signed grails plug-in

Is it possible to compile and sign grails plug-in? I am thinking about distributing my application logic using grails plug-in architecture and I do not want my client to be able to read that easily .groovy or to modify it. Is it possible to package it somehow or at least distribute only compiled .class?
Yes. you need to think more traditional Java.
Create a JAR with your logic in it and sign the jar. Put the minimum Groovy code in the plugin. You have not stated where the logic is if it's a controller or GORM object so I am not sure what you looking for 100%.
Hope this helps.
It is possible to compile and package groovy/java code into a jar and then use it in a grails app. (as Scott suggests) but these classes can not directly benefit from grails ie. no way to declare grails service, domain class or controller in a separate jar.
There is an issue in grails jira describing the same problem:
http://jira.codehaus.org/browse/GRAILS-4956
Since Grails 1.4 M1 there are binary plugins, I assume this is exactly what you need. I'm not sure if signing is supported in any way, but it's at least possible to distribute the plugin without its sources.

Resources