lunedì 21 settembre 2009

Finally released the "Virtual Objects" in SVN trunk

Roma Framework is strictly based on the POJO Java architecture. Anything is a POJO from the view to the persistence. But in some circumstances it could be better having a lighter way to hide some fields in a form or adding a new action to an existent POJO.

This is the reason because Roma (starting from version 2.0.3) supports the Virtual Objects. Virtual Objects are treated just as real Java Objects but they are declared using a descriptor. Now only XML descriptor is supported but in future it could be planned JSON or other ways.

Virtual Objects, in effects, are declared using the same XML Annotation syntax with minor additions to handle field types, inheritance and other stuff that Roma can't know since the XML descriptor is not backed by a real class file.

Cross language

Virtual object's business logic is written inside the tag using the Scripting Aspect. This means that Virtual Objects are totally decoupled by the Java technology and they can be written in any language supported by the JSR 223.

Hot changes high productivity

Virtual Objects are loaded at run-time and reloaded every time the file is saved. This boost up the productivity since it never requires to restart the JVM!

Indeed changing the signature of a class (add and remove attributes and methods) require always the JVM to restart. This is the reason why the Virtual Objects are strongly suggested to being used to build forms to display.

Web IDE

It's planned for the end of 2009 a powerful graphic editor on the Web to change the virtual objects directly from the running application without the need of an IDE.

Not Just Forms

Even though Virtual Objects makes the difference used in the View Aspect, they can be improve the productivity in any Aspect of Roma. Think for example to a service written entirely in Javascript just creating the XML descriptor and annotating it with the Service Aspect.

Below an example of a Virtual Object that extends the Roma's CustomLogin standard POJO used to make the login. Note that by default the language setted is the Scripting Aspect is JavaScript but you can use any language installed using the JSR 223 implementations.

MyLogin.xml




<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<class xmlns="http://www.romaframework.org/xml/roma" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"
xsd:schemaLocation="http://www.romaframework.org/xml/roma http://www.romaframework.org/schema/v2/roma.xsd" extends="CustomLogin">
<aspects>
<view>
<form>
<area name="main" type="grid" size="1">
<area name="help" />
<area name="fields" type="grid" size="2" />
<area name="actions" type="row" />
</area>
</form>
</view>
<scripting>
me.field("help", "Please insert your account." );
</scripting>
</aspects>
<fields>
<field name="help" type="String">
<aspects>
<view render="html" />
</aspects>
</field>
<field name="additionalCode" type="String">
<aspects>
<validation required="true" min="5" max="5" />
</aspects>
</field>
</fields>
<actions>
<action name="login">
<aspects>
<scripting>if( me.field("additionalCode") == "12345" ) me.parent.login();</scripting>
</aspects>
</action>
<action name="close">
<aspects>
<scripting>org.romaframework.frontend.RomaFrontend.view().close(me.pojo);</scripting>
</aspects>
</action>
<action name="standardLogin">
<aspects>
<scripting>
<![CDATA[
print('Goto standard login...')
org.romaframework.frontend.RomaFrontend.flow().forward("ProjectLogin")
]]>
</scripting>
</aspects>
</action>
</actions>
</class>

In this example the Virtual Object called “MyLogin” makes the following changes to the class CustomLogin that extends:

  • Add a new field called “help” defined as a String and displayed as HTML on top of all fields (see area definition)

  • Add a new field called “additionalCode” defined as a String. This field define some validation rules: it's mandatory and the length must be of 5 characters

  • In the constructor (see the scripting declaration inside the class) the field help is initialized with a welcome message.

  • The login action is overridden to check if the virtual field “additionalCode” is equals to “12345”. Only in this case calls the super.login(). Not the use of “me.parent” that returns the super class.

  • Add a new action called “close” to close the form. Note the use of “me.pojo” to return the real POJO in Roma.

  • Add a new action called “Standard Login” that show the classic Login form.

You can use a Virtual Object such as normal POJO in Roma. To display the Virtual Object just created write:

public void test() {

RomaFrontend.flow().forward(new VObject("MyLogin"), "screen:popup");
}
Or just:
public void test() {

RomaFrontend.flow().forward("MyLogin");
}
The final result is the image on top of this post.

Enjoy!

mercoledì 9 settembre 2009

Uploaded the new Roma Handbook version 642

Uploaded the new Roma Handbook version 642:
  • Documented the new feature about rendering images: now the type can be a java.net.URL to display remote images or images located in the filesystem outside the project
  • New chapter about creating Wizards

venerdì 10 luglio 2009

Released Roma Meta Framework 2.0.0

Main addictions and improvements:

CORE module:
  • Component Aspect: now the IoC is managed by this aspect. Spring impl comes as in bundle.
  • New AspectManager to retrieve the right aspect impl + use of cache to speedup the lookup
  • Support for multiple aspect implementations that can exist in parallel
  • First step to VirtualObjects: refactored all the schema package and created the Reflection implementation
  • Improved speed on first class discovering
  • New Roma class as entry point for the most common user's functions
  • First step to remove Apache XmlBeans to load Roma XML files
  • Support for field's events
  • Removed the need of BackObject using FlowAspect.back()
  • Moved location of Spring files. From WEB-INF to src/META-INF/component
  • Removed manual inclusion of Spring files. Now are red all the files under the src/META-INF/component folder
VALIDATION aspect:
  • Separated from ViewAspect
  • Let to validate any POJO, also not rendered as form
SERIALIZATION aspect:
  • Implemented the new SerializationAspect to marshall/unmarshall objects in different formats (now only JSON and Java binary) and different strategies also pluggable
FRONTEND module:
  • New RomaFrontend class as entry point for the most common user's functions regarding the frontend (view, session, etc.)
  • The new Servlet filter "RomaWebFilter" starts and stops Roma
  • New SearchEngine module to build complex queries using a GUI
  • New GUI wrappers to handle collections as Select
CXF SERVICE module:
  • Support to JSON and JSONP protocols
  • Updated to use the last version of CXF: 2.1.3
JANICULUM module:
  • First version of Janiculum, the alternative to Echo2 View Aspect impl.
  • REST Access
  • Rendering impls are developed using FreeMarker to make easy to extend the framework with new renderers
REPORTING-JASPER module:
  • Upgrade to the last official version
ECHO2 module:
  • Resolved bugs for components inside a TableEdit rendered component
ADMIN module:
  • Fixed management of Base Groups and Base Profiles
USERS module:
  • Assigned primary keys to persistent classes
  • Login by default let the user to select the language between those installed in the application
WIZARDS:
  • Changed the syntax of wizards
  • Launch of module-install.xml ant file on module installation
Modules PERSISTENCE-JPOX, PERSISTENCE-JDO and WORKFLOW-POJO are removed from the official distribution. MAP aspect is renamed in GEO aspect.

mercoledì 25 marzo 2009

Released Roma Meta Framework 1.2.0

Main addictions and improvements:

CORE module:
  • Created CollectionWrapper domain classes to display collections in better way. Now there are two impl: TableWrapper<> and MasterDetailWrapper<>. See the Handbook.pdf to know more.
  • Disable the class checking for hot-updates. Useful in production
  • New refresh of multiple fields in one shot or the entire object
  • Resolved bug on the session management under WebLogic AppServer
VIEW module:
  • New "URL" rendering mode to embed static and dynamic content in forms. Now you can embed HTML files, JSP files and Web sites at all
  • Managed render of collections and arrays using the "OBJECTEMBEDDED" mode
  • Resolved a bug on table ordering
  • Improved Echo2 Table component in order to support the change of the color of the column headers
  • Updated to the stable version 2.1.0 of Echo2
DATANUCLEUS module:
  • Updated to the stable version 1.1.0 of DataNucleus
ADMIN module:
  • Fixed management of Info and InfoCategory instances
  • Created CRUD of GenericValue
JETTY module:
  • Integrated new release of Jetty 6.1.5
  • The script under the user project script/start-jetty.sh (and .bat) now works
CRUD wizard module:
  • CRUD now generate also: factory class (DDD), repository class (DDD), entry in package.jdo file if any

mercoledì 21 gennaio 2009

Released Roma Meta Framework 1.1.1

Starting from January, 21th 2009 is available the new version 1.1.1 of Roma Meta Framework.

Resolved bug on install wizard on Unix, Linux and MacOSX.

martedì 20 gennaio 2009

Released Roma Meta Framework 1.1.0

It contains minor improvements and several bugs fixed. Below the main changes:
  • New history management. Changed from:
  • ViewAspect.show() to FlowAspect.forward() and
  • ViewAspect.close() to FlowAspect.back()
  • Migrated all Roma projects from JPOX to DataNucleus
  • Removed wizard directory. Now all wizards are modules themselves

venerdì 19 dicembre 2008

Released new view aspect implementation "View-Html"

Update your configuration by using the roma console:
> roma check new