Getting Started with Eclipse

From JRapid

Jump to: navigation, search



Working with JRapid and Eclipse makes rapid development a simple task! Go through this short guide and have a running application in a few minutes.

JRapid generates fully functional standard Java web applications based on a high level model definition that you provide. This application definition is written in AML, (JRapid Application Modeling Language), an XML-based format. The AML can be easily generated through our web-based point and click designer or typed in. It is based on the principles of MDD.

When working with the JRapid Eclipse Plugin all you have to do is model your application in the Main.xml file using the AML elements. This file contains the application definition and is used as an input for the code generator. When changes are made to this file, it is automatically synchronized with the JRapid Project hosted in the development cloud server, and a code generation is executed. When the generation finishes, all the newly created and updated files are downloaded to you local Eclipse workspace and the application running on the development cloud server is refreshed.

Hands On

For our example we'll be creating a simple contact management system using the JRapid Eclipse plugin. The application will store contacts and companies, and will allow you to link a contact to a particular company.

You must first register at JRapid in order to use the JRapid Eclipse plugin.

If you already have a valid JRapid user, go ahead and install the Eclipse plugin following these instructions.

Once the plugin is installed, click on the File -> New -> Other menu option and select the JRapid Project wizard.


Complete your login information and hit tab.


Once you get authenticated you may continue to the next page. The wizard lists your existing projects. By default, when you register at JRapid, a new empty project is created. Let's use this for this tutorial. Note that another option is to create a new project, but we'll leave this for another time.


Click the Finish button to finalize this wizard. The project synchronization begins. Switch to the Console pane in order to see the progress of this process. This may take a little longer the first time the project is downloaded.


Once the project synchronization is finished, the JRapid plugin prompts for a location to download the required libraries.


Choose a location on your disk and let the libraries be downloaded. This will create an Eclipse User Library that will be included in the project's build path.

Expand your project in the Eclipse Package Explorer and have a look at the structure of your new project. It looks just like any other standard Java web application.


Switch to the JRapid Manager pane. You will see your recently downloaded project listed there and the State column with the value Full Sync.


This means the JRapid Plugin will upload any files you change in your project to the cloud servers. And even more, you will receive any file updated or created on the server in your local workspace. Note that, when using a free shared development server, you are only allowed to upload changes to the Main.xml file.

Creating the first entity

Let's create some entities! Double click the Main.xml file to open it in the editor.


For our first entity, add the following highlighted code after the panel definition and hit CTRL + S to save the changes. Note the message displayed in the JRapid Console view as the file gets uploaded to the cloud.


Now right click on the editor with the Main.xml file opened and select JRapid -> Generate App Files, or hit CTRL + G. This will trigger the code generation on the cloud.


First, the generator is executed and the JRapid Console shows a list of the files being created.


When the generation process is finished, the JRapid Plugin receives all the updated files and saves them into your local workspace.


Preview your Application

With our Company entity created, let's jump to preview our application on the cloud development server. Click on the Preview button at the Eclipse toolbar while you've got focus on the Main.xml file in the editor.


This will open the default application Panel in your browser. Open the Company list by clicking on the Main -> Company menu option.


Go ahead and create a new Company record. Click on the Add button of the list and an empty Company form will be displayed. Fill in the fields.


Click OK to save the new Company record. The form is closed and the list refreshed to show the existing records. As you can see, your app is already running in the cloud development environment!


Go back to your Eclipse workspace and edit your project's Main.xml file. Let's add a new City property to our Company entity. Then hit CTRL + S to save the changes and CTRL + G to run the code generation.


Switch back to your browser and refresh the web page. Again, open the Company list. Note that a new City column is shown.


Double click on the only record in order to open the form. The City field is shown in the form as well. Enter the City for your record and click on the OK button.


The list displays the data entered for the new field in its corresponding column.


Create and Relate the Contact Entity

Now, go back to your Eclipse workspace and create the Contact entity. Add the following code to your Main.xml file.


Save and generate and then go back to your browser and refresh the web page. Click on the Main menu option and you will see that the new Contact entity is listed there. Click on it to open the Contact list.


Add a new Contact record by clicking on the Add button and completing the form. You may see that a relationship between the Contact and Company entities has been established, and the company form lists the existing records.


Once you click OK the list refreshes and shows the new contact record.


This was just a quick introduction to some simple JRapid features. If you want to learn more take a look at the JRapid Library, the JRapid Wiki or at the JRapid Manual.

See also

Personal tools