Digital Edition

SYS-CON.TV
OpenXava 4.0: Rapid Java Web Development
The OpenXava 4.0 has been released recently, with many User Interface improvements

OpenXava is a framework for rapid development of business applications using Java. It is easy to learn and one can have an application up in no time. At the same time, OpenXava is extensible, customizable and the application code is structured in a very pure object oriented way, allowing you to develop arbitrarily complex applications.

The OpenXava approach for rapid development differs from those that use visual environments (like Visual Basic or Delphi) or scripting (like PHP). Instead, OpenXava uses a model-driven development approach, where the core of your application are Java classes that model your problem. This means you can stay productive while still maintaining a high level of encapsulation.


The all-new version of OpenXava, OpenXava 4.0, improves significantly the user experience, producing a Rich Internet Application user interface. Additionally, some interesting improvements has been done for the developers, such as Groovy, JPA 2.0 or Dependency Injection.

The best way to taste the new features of OpenXava 4.0 is downloading it and following the Quick Start guide.
Below you have some of the main new features present in OpenXava 4.0.

Better User Experience
The next screenshot of a simple OpenXava 4.0 module shows some of the new features:

Another new useful feature of OpenXava is the use of dialogs. OpenXava use them for creating and editing reference and collection elements, though the developer can show his own dialogs in his own actions. Moreover, the user has the possibility of hidding and showing any frame in the view. So he can hide any reference, group or collection to adapt the user interface to his necessities and preferences. The next screenshot shows these features:


These are only some of the user interface new features. OpenXava 4.0 has around 40 improvements of the user interface.

More Options for Developers
OpenXava 4.0 allows to use Groovy for coding all the parts of your application, now it uses JPA 2.0, you can use Dependency Injection in you actions and the way for doing typical tasks has been simplified.
For example, you can use Groovy to define you entity, as following:

@Entity
@Table(name="TOrder")
@View(members="""
    year, number, date;
    customer;
    details;
    amount;
    remarks
    """
)
class Order extends Identifiable {
    
    @Column(length=4)
    @DefaultValueCalculator(CurrentYearCalculator.class)
    int year
       
    @Column(length=6)    
    int number
   
    @Required
    @DefaultValueCalculator(CurrentDateCalculator.class)
    Date date    
   
    @ManyToOne(fetch=FetchType.LAZY, optional=false)
    @ReferenceView("Simplest")
    Customer customer   
    
    @OneToMany(mappedBy="parent", cascade=CascadeType.ALL)    
    @ListProperties("""product.number, product.description,
quantity, product.unitPrice, amount""")

    Collection<OrderDetail> details = new ArrayList<OrderDetail>()  
    
    @Stereotype("MEMO")
    String remarks
       
    @Stereotype("MONEY")
    BigDecimal getAmount() {
        BigDecimal result = 0
        details.each { OrderDetail detail ->
            result += detail.amount
        }
        return result
    }
        
    @PrePersist
    void calculateNumber() throws Exception {         
        Query query = XPersistence.getManager()
            .createQuery("select max(o.number) from Order o " +
                    "where o.year = :year")
        query.setParameter("year", year)        
        Integer lastNumber = (Integer) query.getSingleResult()
        this.number = lastNumber == null?1:lastNumber + 1
    }
        
}

You can use the Java standard for Dependency Injection, JSR-330:

public class ChangeActiveYearAction extends ViewBaseAction {
 
    @Inject  // Standard annotation from JSR-330
    private int activeYear; // Getter and setter are not needed
 
    public void execute() throws Exception {
        assert activeYear == 2010; // The value from session object
        activeYear = 2012; // It changes the value of session object
    }
 
}

Thus the activeYear session object is injected in the activeYear field before call to execute(); and after execute() execution the value of the activeYear field is assigned back to the actionYear session object. So, you can change session objects state from inside an action, even with immutable and primitive types.

There are some improvements to the actions that do not add new functionality, but allows you to simplify the coding of some typical cases. For example, now it's easy to add and remove actions programatically from an action thanks to the new methods addActions(), removeActions(), clearActions(), setControllers(), returnToPreviousControllers() and setDefaultControllers() present in BaseAction. Other new methods of BaseAction such as getRequest(), getContext() and getManager() add a lot of possibilities with little effort.

These are only some of the new features for developers. OpenXava 4.0 has around 90 improvements for the developers.

About Javier Paniza
Javier Paniza is the project lead for OpenXava project. He works as software developer at Gestión 400, a software company for public administration in Spain. He has been developing with Java Enterprise since 1998. Also he has been J2EE mentor for development teams in banking projects.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1



ADS BY GOOGLE
Subscribe to the World's Most Powerful Newsletters

ADS BY GOOGLE

Cloud computing delivers on-demand resources that provide businesses with flexibility and cost-savin...
While some developers care passionately about how data centers and clouds are architected, for most,...
Your job is mostly boring. Many of the IT operations tasks you perform on a day-to-day basis are rep...
JETRO showcased Japan Digital Transformation Pavilion at SYS-CON's 21st International Cloud Expo® at...
With 10 simultaneous tracks, keynotes, general sessions and targeted breakout classes, @CloudEXPO an...
Containers and Kubernetes allow for code portability across on-premise VMs, bare metal, or multiple ...
Digital Transformation: Preparing Cloud & IoT Security for the Age of Artificial Intelligence. As au...
"We began as LinuxAcademy.com about five years ago as a very small outfit. Since then we've transiti...
More and more companies are looking to microservices as an architectural pattern for breaking apart ...
CloudEXPO New York 2018, colocated with DXWorldEXPO New York 2018 will be held November 11-13, 2018,...
@DevOpsSummit at Cloud Expo, taking place November 12-13 in New York City, NY, is co-located with 22...
The best way to leverage your Cloud Expo presence as a sponsor and exhibitor is to plan your news an...
DevOpsSummit New York 2018, colocated with CloudEXPO | DXWorldEXPO New York 2018 will be held Novemb...
Organizations planning enterprise data center consolidation and modernization projects are faced wit...
A traditional way of software development efforts reimbursing is pay by the hour, which in case of r...
Adding public cloud resources to an existing application can be a daunting process. The tools that y...
CI/CD is conceptually straightforward, yet often technically intricate to implement since it require...
Fact: storage performance problems have only gotten more complicated, as applications not only have ...
"We do one of the best file systems in the world. We learned how to deal with Big Data many years ag...