Application of AJAX technology and Java Platform ...

6 downloads 76051 Views 550KB Size Report
Application of AJAX technology and Java Platform, Enterprise. Edition in the contemporary internet applications. Developing a tutoring/training service.
Application of AJAX technology and Java Platform, Enterprise Edition in the contemporary internet applications. Developing a tutoring/training service. D.CZUBAK, W. ZABIEROWSKI, A. NAPIERALSKI Abstract- This article and application constitutes an analysis of the latest trends in creating Internet applications based on Java Platform, Enterprise Edition standard. It also provides closer look at the most popular technologies, such as AJAX, JSF or EJB 3.0 and open source tools used to create such solutions. The main objective was to configure and build a modern Internet application – a training service based on these technologies and tools, and to demonstrate its wide applicability and the possibility of configuring it for different platforms.

II. Environment Below are quoted an open solution tools which were used to create this solution. These solutions are configurable with a lot of documentation and online support. •

Java Platform Enterprise Edition



EclipsePlatform



Java EE 5 SDK (JDK 6 Update 3 z Java EE 5 SDK Update 3)

Keywords- JEE, AJAX, EJB 3.0, JSF, enterprise applications



JBoss Application Server

I. Introduction



MySQL Database

In this article an application of AJAX and Java Platform Enterprise Edition is presented. When creating a rich user application it is more quickly and with less effort using the Java EE platform. Java Platform, Enterprise Edition is a set of coordinated technologies. It reduces the cost and complexity of developing and managing applications. It gives more capabilities that provide fast, stable, secure and complete Java platform for enterprise.



Enterprise Architect

Java Platform, Enterprise Edition is also the latest version of the premier platform for developing enterprise applications. Here are some highlights: −

Easier development. There is less code to write. Whenever it is possible the defaults are used and annotations are used extensively to reduce the need for deployment descriptor.



EJB 3.0 makes programming with Enterprise JavaBeans technology is simpler.



JavaServer Faces, AJAX and more. Building web applications is made easier with JSF technology. JEE supports rich thin-client technologies such as AJAX which is crucial for building Web 2.0 applications.

III. Used technologies This article provides a closer look at the most popular and open source technologies used to create this solution. For example: Enterprise JavaBeans 3.0 This technology is server-side component architecture for JEE. It enables simplified and rapid development of secure, transactional, distributed, and portable enterprise applications. EJB 3.0 defines the new simplified EJB API. It is also targeted at ease of development. EJB 3.0 specification includes also the new Java Persistence API for the management of persistence and object/relational mapping with JEE. Example of implemented and component and its annotations: @Stateful @Name(“moduleSearch”) @Scope(ScopeType.SESSION) @Restrict(“#{identity.loggedIn}”)

used

a

statefull

public class ModuleSearchingAction ModuleSearching {

implements

@PersistenceContext private EntityManager em; Example of implemented and used an entity component and its annotations:

It is a rich component library for JSF. RichFaces is also an advanced framework for easily integrating AJAX capabilities into business application development. RichFaces includes strong support for the skinnability of JSF applications. RichFaces takes full advantage of the benefits of the JSF. Below are presented all solutions we can create using RichFaces:

@Entity @Scope(SESSION) @Name(“user”) @Table(name=”Users”) @Length(min = 6, max = 15, message = “Login at least 6 signs”) @Pattern(regex = “^\\w*$”, message = “incorrect name”) public String getUsername() {return username;} Using this technology lets write software components (like the examples above) that execute business logic that runs on the server. JavaServer Faces This technology simplifies building user interface. Web applications can be quickly build by developers with various skill levels. These applications can be building by assembling reusable UI components in a page. These components can also be connected to an application data source. Including a JSF to xhtml page:



IV. Frameworks An open source frameworks used to create this solution: RichFaces

Figure 1. Examples of RichFaces framework components.

JBoss Seam It is an application framework for building Web 2.0 applications by unifying and integrating technologies such as AJAX Java Server Faces, Enterprise Java Beans, Java Portlets or Business Process Management. Seam has been designed from the ground up to eliminate complexity at the architecture and the API level. It is also the first application framework for EJB 3.0 •

Generating application skeleton in Seam

The Seam distribution includes a command line utility that makes it very easy to set up an Eclipse Project. It generate also some simple Seam skeleton code. Example of simple project Seam skeleton:

en pl de register.password=Hasło -> file messages_pl.properties register.password=Password->file messages_en.properties Figure 2. Simple project Seam skeleton. •

Facelets

Seam navigation

It is JavaServer Faces View Definition Framework

Seam lets the user freely navigate via the back, forward and refresh buttons. It is the responsibility of the application to ensure that conversational state remains internally consistent when this occurs. Example of pages.xml file which includes navigation of application:

login-



Internationalisation

This framework is backed by JavaServer Faces as the industry standard. Facelets is being developed as open source under Sun's guidance, it can work with any JSF 1.2 compliant implementation or MyFaces. JSF is a templating framework too. We can made templates and templates client files. It allow to reduce amount lines of code. Below are presented template file and template client file: Template file example





Template client file example



Content of Main Page

Main Page

V. Architecture Enterprise architect it is a perfect solution to model and manage complex information. It was used to design and visualize software which was created. It has support for all 13 UML 2 diagrams and more. Below are examples of diagrams.

ones. It presents the most important technologies, frameworks and libraries that were used for the purposes of building the application. Describes the rationale for choosing them, as well as their main qualities. Another aim was to describe the whole architecture and presents all the guaranteed possibilities of using the application. It also gives an overview of the functionality of the whole system. Another part of this article describes the method of building the application and provides examples from the source code. It also shows which elements technologies and solutions given were applied to. It can also be observed how the assumptions presented were met and how all the functionalities were assured. It also contains a description of different encountered problems and the methods according to which they were resolved.

VII. Application - what is in it? This is a Web Based Course and Content Management System. Users who use this system can:

Figure 3. Examples of UML diagrams(created using Enterprise Architect) . VI. Description The aim was also to present certain solutions that make it possible to build modern and complex Internet applications faster and with less difficulty. It describes the presented problem and gives the central propositions of both the thesis and the constructed application. Presents and describes all the applied tools. It also shows how they were used and what interesting solutions can be achieved by using them. It was also very important to substantiate the choices and indicate other solutions that could well replace the proposed



register and manage their account



create public and private groups



compose content



manage content



publish documents in pdf



search content, groups, users



use intuitive interface



and use many other possibilities

It is also: •

use open source tools



presents the most important technologies, frameworks and libraries for JEE and AJAX



show methods of building application

It is a web-based training and e-learning solution that employs a simple and intuitive user interface. These way both technical and non-technical training managers can easily create and manage interactive training

courses, learning content and learning programs for users. VIII. References [1] JAVA EE TECHNOLOGIES AT A GLANCE http://java.sun.com/javaee/technologies/, 02-09-2008 [2] ENTERPRISE JAVABEANS TECHNOLOGY http://java.sun.com/products/ejb/, 02-09-2008 [3] JAVASERVER FACES TECHNOLOGY http://java.sun.com/javaee/javaserverfaces/, 02-09-2008 [4] ENTERPRISE ARCHITECT http://www.sparxsystems.com.au/,02-09-2008 [5] RICHFACES http://www.jboss.org/jbossrichfaces/,02-09-2008 [6] JBOSS SEAM http://www.seamframework.org/,02-09-2008 http://docs.jboss.org/seam/1.2.1.GA/reference/en/html/i ndex.html, 02-09-2008 [7] FACELETS https://facelets.dev.java.net/,02-09-2008