Saturday, September 26, 2015

Eclipse plugin :no menu in Extension when right clicks

I'm looking at eclipse plugin and I met a problem in extension view : I can't access to the extension menu when I did right click.

I have also the following warning in Extensions View : No schema found for the “org.eclipse.ui.menus” extension point

To solves it,  I add Eclipse RCP Target Components ( see )

  1. In Eclipse, go to Help > Install New Software... 
  2. Update site:
  3. Choose "Eclipse RCP Target Components" and press Next to install them

Now the menu appears :

Eclipse IDE for Java Developers
Version: Mars Release (4.5.0)

Sunday, September 20, 2015

Grails 3 and IDE support

I'm looking at support of grails 3 by the IDE.
To now, here is an overview :
  • Eclipse : none support, plug-in disappeared from STS.
  • Intellij : appears to be support but you to pay licensing ...
  • Netbeans : begins of support
The good point is Netbeans 8.0.2 recognizes Grails 3 project.So, i was able to create a new Grails 3 project.You can launch you application and there is also syntax highlights in GSP.
However, it's just the beginning and it needs some works.But, you can begin to practice with Grails 3.

One comment, under Eclipse, you can import Grails project as a Gradle project like said in documentation.But, I didn't find how to have syntax highlights in GSP.

Friday, September 18, 2015

Upgrade Grails 2.5.0 to 2.5.1

I successfully upgrade Grails to the version 2.5.1It's quite simple.You only have to follow the release note about plugins update.
I met only one problem.I had this warning : Script 'Upgrade' not found.

To solve that issue, you have to select 3 (SetGrailsVersion) ant it will make the update.

|Running pre-compiled script
|Script 'Upgrade' not found, did you mean:
   1) MigrateDocs
   2) IntegrateWith
   3) SetGrailsVersion
   4) InstallDependency
   5) DependencyReport
Please make a selection or enter Q to quit: 3

With this update, I solved the following error :

Wednesday, September 16, 2015

How to import files in GRAILS ?

In business web site, we often used to import config files.There are many way to achieve this in GRAILS.In this paper, we will talk about two possibilities but not about batch because it doesn't work for me in GRAILS 2.5.0.

An IHM to import file

You can import files with a classical html form like the following :

A form example : form.gsp

Below, here is an example of Grails upload form by using g:uploadForm tags.This form, when submit, calls the init action from the admin controller.It passed files in parameter with Input tag.The input file with the parameter multiple will permit to upload severeal files.

<g:uploadForm action="init" controller="admin">
    <form role="form">
        <div class="form-group">
            <label for="files">Choix du fichier à parser</label>
            <input type="file" id="files" name="files[]" multiple>
            <p class="help-block">Vous devez choisir un fichier httpd.conf</p>
        <div class="form-group">
            <label for="machinename">Nom de la machine</label>
            <input type="text" class="form-control" id="machinename" name="machinename"      placeholder="" value="">
        <button type="submit" class="btn btn-info">Submit</button>


For example, to parse a file, you could do the following :
class AdminController {
   def init() {
        if (request instanceof MultipartHttpServletRequest) {
            request.getFiles("files[]").each { file ->
      "init() file to parse:" + file.originalFilename)
                       InputStream inputStream = file.inpustream
                       BufferedReader = new BufferedReader(new InputStreamReader(inputStream))

                        try {
                            String ldapUser = EMPTY
                            String ldapPwd = EMPTY
                            String ldapHost = EMPTY
                            String ldapPort = EMPTY

                            while ((line = br.readLine()) != null) {


The arry files[] will contain all import files.You have to notice that file is type of org.springframework.web.multipart.MultiPartFile and not

Import files automaticaly

An other way, is to import files automaticaly. You just have to do a method in the controller like the following :

class AdminController {
    def reloadData() {
        def path = "E:\\projet\\toolprod\\import\\""reloadData() Initializing application from httpd.conf files in machine directory ...")
        new File(path).listFiles().findAll{
            if (it.isDirectory()) {
      "reloadData() Machine name ( Directory name ) :" +
                String machineName =
                log.debug("reloadData() files list:" + it.listFiles())
                for (File f : it.listFiles()) {




Then you need to access at the following url : http://localhost:8080/appli/admin/reloadData
After that, it's easy to make a crontab with a curl to make automatisation ...