Coder Social home page Coder Social logo

optimus's Introduction

Grails Optimus Plugin

Grails Optimus Plugin lets you create some of the most popular artifacts that are not part of the Grails automation and scaffolding but are important to consider when building a Java Web/Grails application, such as log configuration, unit tests, services, logging and responsive and asynchronous views.

To get started, you need to install the plugin by adding the following line in the grails-app/conf/BuildConfig.groovy file:

plugins {
    ...
    compile ':optimus:0.1'
}

You must have at least one domain class with some constraints, for example:

package mypackage

class Person {

    String name
    String lastName
    Date birthdate
    Boolean enabled

    static constraints = {
        name blank:false, size:1..100
        lastName blank:false, size:1..100
    }

}

Then, you can generate the corresponding artifacts by executing the optimus-all command:

grails optimus-all Person

The command will tell you about what artifacts have been created, such as config files, unit tests, services, controllers, log files and views:

$ grails optimus-all Person
| Finished generation of 'config.properties' file
| Finished generation of 'Config.groovy' file
| Finished generation of 'DataSource.groovy' file
| Finished generation of config artifacts
| Finished generation of constraints unit tests
| Finished generation of ListUtils class file
| Finished generation of service class files
| Finished generation of mock classes
| Finished generation of 'list-max' service unit tests
| Finished generation of 'list-offset' service unit tests
| Finished generation of 'list-sort-order' service unit tests
| Finished generation of 'list' service unit tests
| Finished generation of 'create' service unit tests
| Finished generation of 'update' service unit tests
| Finished generation of 'get' service unit tests
| Finished generation of 'delete' service unit tests
| Finished generation of service unit tests
| Finished generation of 'list' service logs
| Finished generation of 'create' service logs
| Finished generation of 'update' service logs
| Finished generation of 'get' service logs
| Finished generation of 'delete' service logs
| Finished generation of service logs
| Finished generation of cracking service
| Finished generation of controller class files
| Finished generation of 'index' controller unit tests
| Finished generation of 'content' controller unit tests
| Finished generation of 'list' controller unit tests
| Finished generation of 'create' controller unit tests
| Finished generation of 'save' controller unit tests
| Finished generation of 'edit' controller unit tests
| Finished generation of 'update' controller unit tests
| Finished generation of 'delete' controller unit tests
| Finished generation of controller unit tests
| Finished generation of 'index' files
| Finished installation of Optimus templates
| Finished generation of 'content' templates
| Finished generation of 'list' templates
| Finished generation of 'form' templates
| Finished generation of views artifacts
| Finished generation of artifacts
$

You can try the generated artifacts by executing the test-app and run-app commands. For the tests, you can realize that all the class domain constraints, services and controllers have their respective unit tests, and when you run the application, you will see that the views have been built with the 3.0.0 version of the Twitter Bootstrap framework (http://getbootstrap.com/) and they are AJAX-based. Also, you will see some logs in the console output.

You can see the full documentation at http://satvaimal.github.io/optimus/

optimus's People

Contributors

burtbeckwith avatar satvaimal avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.