EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only

Introduction to EGL Projects

By Jiyong Huang posted Wed April 01, 2020 09:17 PM

  
For those of you who are learning about EGL, here is an overview of EGL projects to help you get started...

A project is a container for a group of related files. An EGL project is an enhanced project that you will be using to hold EGL source files in your application.

The structure of an EGL project is simple. By default, it contains two top-level folders, EGLSource and WebContent. You should create all EGL source files under the EGLSource folder. EGL will generate these source files into JavaScript or Java, depending upon whether the code will run in a browser or on an application server. You should create all Web resources such as cascading style sheets, images, and icons under the WebContent folder. EGL will deploy these Web resources with your HTML file.

You can use EGL to develop both client-side and server-side code by doing the following:
  • Define a Web page that runs in a browser by creating an EGL Rich UI handler part
  • Define business logic that runs on an application server such as Apache Tomcat by creating an EGL service part
  • Define data and logic in EGL records and libraries that can be used by both Rich UI handlers as well as by services.
Within an EGL project, we recommend that you use packages to separate your client from your server code. At deployment time, you can use EGL deployment descriptors to control which parts to deploy and which Web projects to deploy to.

You can define your Web application code in either a single EGL project or in multiple ones. If your application is small and will probably not contain code that will be shared by other applications, putting your code in a single project provides simplicity and ease of use. On the other hand, if your application is complex, you can use multiple projects to help organize your code and allow parts such as libraries, records, and services to be easily shared across projects.

When programming in EGL, you only need to be concerned about EGL code, not about generated Java, JavaScript, or HTML. Therefore, resources containing generated code do not show up in your project when using the Project Explorer. If you want to see these resources for some reason, you can do so by using the Navigator view.

Creating an EGL project

When you are ready to develop some code, begin by creating an EGL project to hold your files. There are several ways to invoke the New EGL Project wizard:

  • Click on the New EGL Project icon, fourth in the toolbar
  • Click on File > New > EGL Project
  • Right click in the Project Explorer. Then click New > EGL Project.

In most cases, you can specify a project name in the New EGL Project dialog, and click Finish.

Setting project dependencies

When you create a new project, the New EGL Project wizard adds two project dependencies - com.ibm.egl.rui_1.0.2 and com.ibm.egl.rui.dojo.runtime.google_1.3.2 - by default. These projects are already loaded into your workspace; you can see them in the Project Explorer. These dependencies allow the EGL Rich UI and Dojo widgets to be accessible from your project when you develop a Web page using an EGL Rich UI handler.

If you need to reference additional EGL code in another project, you need to add a dependency on that project. To do so from the New EGL Project wizard,

  • Click the Next button after specifying a project name.
  • On the EGL Settings page, select the additional project that this project will reference. In this example, it is reallyUsefulProject.
  • Click Finish.

Your new project can now access code in reallyUsefulProject.

You can add a new project dependency in an existing project as well. To do so,

  • In the Project Explorer, right click on your project name, like myProject, then click Properties.
  • Click EGL Build Path.
  • Select the project that myProject will reference, like reallyUsefulProject.
  • Click OK.

In myProject, you can now use code from reallyUsefulProject.

I hope that you have found this introduction to EGL projects helpful in getting started. Stay tuned to this blog for upcoming posts on useful topics such as developing with Dojo widgets, defining and calling services, and deploying EGL projects.
0 comments
3 views

Permalink