| CARVIEW |
|
greenbox
|
| Summary | Code Generator Framework based on Jakarta Velocity and Metamodel |
|---|---|
| Categories | None |
| License | Lesser General Public License (LGPL) |
| Owner(s) | alegomes, beljug, edgarsilva, esilva |
Greenbox - Code Generator Tools
Introduction | Motivation | Subprojects | Staff| Greenbox aims to free you of copy/paste development. If sometimes you
find coding as a repetitive and tedious process, you should try it out.
Just find the repetitive code pattern, create a template for it, and
let it do the hard work for you! |
Greenbox Plugin for NetBeans 5.5 GA
Greenbox Plugin for NetBeans 5.5 GA is available for download Here
New Features
a) Now you can select the Velocity Directory where templates are located
b) You can change database settings for default SessionFactory properties in Hibernate Layer
c) Some fixes of Application generated
Developer Spotlight: New Core Developer Vinicius Dudel Mayer
![]() |
Vinicius Mayer has a BS Degree in Systems' Information from UNIJUI (Ijui, RS, Brazil). He is member of
Greenbox Core Developers team, he works for AdvancedIT developing Java Applications using Java Server Faces Technology, Spring Framework, Hibernate and Portlets.
Vinicius is responsible for some enhancements on Greenbox Core Framework, NetBeans Plugin and now he's acting as Greenbox's SCM Manager,
organizing builds, releases and sources management. He lives in Porto Alegre, south region in Brazil.
If you wanna contact him, please visit his blog on BlogSpot.
|
Don't forget Velocity Templates
Everything generated by Greenbox is based on their Velocity Templates, so you must download it as well. To download it, please Click here
Greenbox Plugin for NetBeans 5.5 New Features
Remember that you have to download the default Velocity templates used by Greenbox, the templates you have to inform on last step, before you click on "Generate Sources" button, you have to set this folder path, as you can see in the following image:
Bugs Reported
When you create an application and you try to run it you can see an error, it happens because Greenbox uses a file called database.properties located on your WEB-INF folder inside your netbeans project. Then with this build you have the ability to change it, and you can fill with your own settings , see the following image:

Please, any comments use our mailing-list, We will apreciate help you with any necessary information.
New Greenbox Plugin for NetBeans 5.5
Basically we fixed some bugs, in addition to this the new Greenbox NetBeans plugin can to run in NetBeans 5.5 properlly .
Now we have only 3 NBMs files, and the application generated by Greenbox have a new webdesign, using all CSS and tableless principles.
Click here to Download the newest release.
Feel you free to send comments or open issues about this new release.
Introduction
Greenbox is...
- a simple idea in how to develop software faster, easier and better! You tell it what you want and it generates code for your, with your preferred technologies, such as PHP, Ruby or even .NET, with your architecture, patterns and idioms.
- a simple code generator framework based on Velocity templates and a metamodel schema. The Greenbox framework helps you to read metadata from a database schema, POJOs annotations or XMI files, and use it to fill a set o Velocity templates for code generation, as figure 1 shows.
- an umbrella for other projects:
- Greenbox Framework
- GreenboxThin IDE
- GreenboxDB NetBeans IDE Plugin
- GreenboxAnnotations NetBeans IDE Plugin
- GreenboWX
- Greenbox Ant Tasks
- Greenbox Java Patterns

Figure 1 - Greenbox system
Additional Informations, Tips and Tricks
You can see additional informations in some blogs, look the following list:
- https://weblogs.java.net/blog/edgars/
- https://www.edgarsilva.com.br/greenbox
- https://edgarsilva.com.br/?cat=3 (Português do Brasil)
Installation Process
Is really easy to install Greenbox, first of all you should decide if you will use the NetBeans Plugin or the Framework. If you wanna use the Framework, just download the jar file here, and everything is ok.
If you want to use NetBeans 5.5 Plugin pay atention on the following steps:
Step 1 - Download the latest snapshot here
Step 2 - Unzip the zip file on any folder you want.
Step3 - You will have 3 NBM's Files, these are Plugins you should install on NetBeans.
Step 4- Go On NetBeans and look Menu Tools/Update Center, choose the "Install Manually NBMs" and add all of them, from this point the hardest thing is to press next until you could see the finish button :)
Creating a New Greenbox Project
- Go to File/New Project, select Greenbox and click on Project in the list in the right side.
- Give some name to your Project and click in finish.
- Create some Greenbox Pojo in some package, for example: test.country.Country
- Look the following code to this Greenbox Pojo:
package test.country;
import greenbox.Greenbox;
import greenbox.GreenboxField;@Greenbox(tableName="country")
public class Country {
@GreenboxField(primaryKey="yes",columnName="id",label="Id")
private Integer countryId;
@GreenboxField(columnName="name",label="Name")
private String name;
@GreenboxField(columnName="population",label="Population")
private Long population;
} - Click with mouse right-button over your Java file, and select "Run Greenbox for Java Server Faces, Spring and Hibernate"
- Check All Elements in the Window to generate the respective file
- On the last step click in the button "Generate Files"
- Run your Application
Look the Use Case Generated

Image 1 - The Listing Page

Image 2 - Creating a new Country
Image 3 - Listing the Records from Database
Motivation
A bunch of problems emerge when processes of any kind (software, engineerin, automotive...) are based on people. First of all, human work is error prone, always. Humans get sick. Humans' productivity depends of humor factors. People replacement causes spend of time when the new person should learn how to work, and so forth.
The fact is that these problems grow the production cost and, because of that, factories started to replace the human hard force by machines. When repetitive and easy programable tasks are done by machines, humans have more and more time to concentrate on the process optimization to the production improvement.
Software industry
Even in a sofware development process we can find the above scenario. Who has never spent hours doing copy/paste programming? There are two kind of copy/paste programming:
(b) when you just want to have a code template to base on.
(b.2) to automatically generate code
Code generation
But, an automatic code generation should be planned. An architecture must be designed.
Well, we could elaborate such a software architecture and program its generation for you. However, it would be only one more automatic code generation tool.
One software architecture doesn't fit all projects in the world. Each project has its own carachteristics, and the designed architecture must support that. So, it doesn't make sense if we propose a generic framework for every application you will be involved with. In face of that, we choose to let you decide what is going to be generated
The Greenbox project
Our goal is to develop a code generation tool not fixed to any kind of component. We can find out on the web a lot of tools to generate DAOs, JSFs, EJBs, Struts and so forth, but it's hard to find anything that can help you to generate code for your business purpose, and that's the main Greenbox goal.
Briefly, Greenbox is about:
- How to create software reducing human participation.
- How to develop software easier, faster better, enabling real productivity such as Borland Delphi, PowerBuilder and others.
- How to create and offer architectures based on sucessful frameworks used in the world.
- Such as robot, the knowledge is provided by humans about what they should do.
- Ok, we can have humans working yet, but with a very specific role, checking results, changing small things and so on,
Anything you want. Greenbox is not hardcoded with any fixed architecture, set of components or code style. It's up to you to tell it how the code is going to be generated. When you teach Greenbox how to fit in your needs, you are hands free to do the intelectual (and not the mechanical) job.
We have seen in the market a lot of tools targeted to code generation. However, there are two main problems with those tools:
- They generate only a little piece of a whole cake.
- You have to agree with its desing strategies.
Greenbox let you to generate not only DAO, EJB, JSF or any Java code, but also SQL scripts, internationalization bundles, configuration files etc, etc, etc.
Subprojects
- GreenBox Framework: the base framework itself, that reads database schema or XMI file and generates (according to Velocity templates) many elements of your application (pojo, DAO, delegate, Hibernate .hbm, Spring Context, JSF forms and lists, tableless CSS and so on).
- GreenBoxThin IDE: Tool built with Thinlet.
- GreenBoxDB NetBeans IDE Plugin: NetBeans Plugin using Database
- GreenBoxAnnotation NetBeans IDE: Create applications based on Annotations inside NetBeans.
Staff
- Alexandre Gomes - alegomes at dev dot java dot net
- Edgar Silva - edgarsilva at dev dot java dot net
- Fabiano Franz
- Lucas Balensiefer
- Ricardo Ferreira
- Rodrigo Urubatan - urubatan at dev dot java dot net
- Vinicius Dudel Mayer
Sponsors
![]() |
![]() |
![]() |
![]() |
| Powered by CollabNet | Feedback |
FAQ |
Press |
Developer tools
© 1995 - 2007 CollabNet. CollabNet is a registered trademark of CollabNet, Inc. |





