This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

Category: Development

Vaadin UI application frame and windows

Our custom Vaadin application frame isn't a MDI. It's "web SDI" . We didn't show popup windows aka internal frames with work-screen content. We did embedd the content directly into the web page. But we changed the default implementation a little bit because it makes sense to show popup windows for modal work-screens. Modal frames are important for database applications. Such frames could be used for showing record details, for creating new records, ...

So it makes sense that our application frame supports such specific work-screens. And the good news is that we've support for this.

It could look like following screenshot:

Modal frame

Modal frame


It's a screenshot from one of our test applications. The feature isn't generally available yet, but it will be part of the next VisionX release.

VisionX Update 2.0.121

Great news for all VisionX users!

The current update release 2.0.121 is available for download. Please check your download area.

The release is more than just an update release. It contains all currently available features. We wrote about some of them:

Repeating frames
IDE integration
QR Codes
Features for developers
Ready made solutions

It contains current JVx, ProjX libraries and source code.

If you miss some features after upgrading, please contact our product support because previous versions provided features without valid license. If the features are already licensed, no worries.

We have a product and feature overview for you.

Master Thesis - JVx Mobile und iOS

Die Master Thesis von Stefan Fessler steht nun öffentlich zur Verfügung. Das Thema war

Design und Implementierung einer Multi-Touch optimierten iOS App für das JVx ERP Applikation Framework

Im Zuge seiner Arbeit wurde der iOS Client für JVx entwickelt. Das Projekt steht unter der Apache Lizenz 2.0 zur Verfügung.

Die Arbeit ist zugleich eine gute Dokumentation und erklärt Designentscheidungen sowie deren Umsetzung.

VisionX RnD news - IDE integration

We want to tell you some fantastic news from our RnD team: The next big step for VisionX will be an IDE integration feature.

Our team is working very hard to reach the goals. The result will be an Eclipse plugin that connects to VisionX and allows bidirectional communication. We won't embedd VisionX in Eclipse because it makes no sense for us, but we'll use the whole power of the IDE.

What will be supported?

  • Event links (Eclipse)

    A click on an event action string will jump to the right method.

    databook.eventValuesChanged().addListener(this, "doValuesChanged");

    The click on doValuesChanged will jump to the method in the work-screen.

  • Call links (Eclipse)

    A click on an action/object call will jump to the right method, in the right life-cycle object.

    getConnection().callAction("getLicenseInformation");

    The click on getLicenseInformation will jump to the method in the life-cycle object.

  • DataBook links (Eclipse)

    A click on the name of a databook will jump to the storage definition, in the life-cycle object.

    RemoteDataBook rdb = new RemoteDataBook();
    rdb.setDataSource(dataSource);
    rdb.setName("users");
    rdb.open();

    The click on users will jump to the DBStorage definition, in the the life-cycle object.

  • Auto completion (Eclipse)

    We'll offer auto completion for table columns, event methods, action/object calls, ...

    databook.getRowDefinition().getColumnDefinition("DESCRIPTION").getDataType().setCellEditor(VisionXUtil.MULTILINE_EDITOR);

    It'll be possible to get a list of all available columns, like DESCRIPTION.

  • Column checks (Eclipse)

    We'll check if all column names are valid and will show compiler warnings/errors.

  • Jump to Eclipse

    It'll be possible, with VisionX, to jump to the source code of e.g. actions, component definitions or databooks in Eclipse. We'll introduce some new Buttons in VisionX, for that feature.

    VisionX E-Plug

    VisionX E-Plug

  • Jump to VisionX

    It'll be possible, with Eclipse, to highlight selected GUI components directly in VisionX.

No worries, we have more features for you!

The IDE integration will be available as optional VisionX module.

JVx' VaadinUI and Liferay "self-contained" packages

If you are Liferay User and Vaadin Portlet developer, you know that Liferay has Vaadin bundled. If you develop a Vaadin portlet, you should use the bundled Vaadin version, otherwise it'll be a problem after a deployment.

We solved the problem in JVx' VaadinUI by extending Vaadin. Our implementation allows different Vaadin versions independent of Liferay. Some days ago, Matti Tahvonen posted an article about Using "self-contained" approach to package Vaadin portlets. This is an interesting article because it's exactly what we tried to do :) and we thought that Vaadin developers have a better solution for the problem!

And of course, their solution is better than ours :) But we are like copy cats and we changed our solution because it reduced code and made it easier for us to maintain our codebase. Our idea was not far away from the recommended solution, but we did too much.

To find out what Vaadin did in their archetype, we followed their posted instructions. We found two steps that could be ignored. The first step was the creation of a custom maven profile because it was possible to add all properties to the pom.xml of the project. The second step was the configuration of the profile in Eclipse. Not needed if properties were added to pom.xml.

And after creating the project, we had the recommended solution and it was absoutely trivial. Simply extend VaadinPortlet, extend VaadinPortletService and override getStaticFileLocation. The created source code:

public class CustomVaadinPortlet extends VaadinPortlet {

private static final long serialVersionUID = -13615405654173335L;

private class CustomVaadinPortletService extends VaadinPortletService {

    /**
     *
     */

    private static final long serialVersionUID = -6282242585931296999L;

    public CustomVaadinPortletService(final VaadinPortlet portlet,
            final DeploymentConfiguration config) throws ServiceException {
        super(portlet, config);
    }
   
    /**
     * This method is used to determine the uri for Vaadin resources like theme
     * or widgetset. It's overriden to point to this web application context,
     * instead of ROOT context
     */

    @Override
    public String getStaticFileLocation(final VaadinRequest request) {
        return request.getContextPath();
    }

}

@Override
protected VaadinPortletService createPortletService(
        final DeploymentConfiguration deploymentConfiguration)
        throws ServiceException {
    final CustomVaadinPortletService customVaadinPortletService = new CustomVaadinPortletService(
            this, deploymentConfiguration);
    customVaadinPortletService.init();
    return customVaadinPortletService;
}

}

To be honest... our solution contained a little bit more code but it worked. We've used our new knowledge to improve our solution, because it should be possible to use "self-contained" and "shared" approach without additional source code. We introduced a context parameter to switch between modes. Vaadin could do the same, but currently it's not implemented.

Our new solution is as simple as the original Vaadin source code and the most important thing is that it works with our ant build.

Maven omg

It was a very simple task. The library Twitter4j (4.0.1) was compiled for Java 6 and I need a 1.5 compatible version. So, I thought it shouldn't be a problem to compile the project with 1.5 compatibility :)
Twitter4j is available via git and after cloning and switching to 4.0.1 everything was available. I tried to import the maven project with Eclipse (Kepler) and got many problems because of missing libraries. WTF?

Shouldn't maven solve all dependency problems? I didn't try to fix problems with Eclipse because it could be a maven plugin problem. So I tried maven itself with jdk 1.5 and some minutes later I got other exceptions because Twitter4j source was written with Java 6 syntax (@Override with interface methods).
So I had to use Java 6 with 1.5 target option... After modifying pom.xml of twitter4j-core, the build had another problem: All test cases failed :) . So I had to use the command-line property -Dmaven.test.skip=true to ignore unit tests.

Finally I got my 1.5 compatible Twitter4j library.

But it was an awful task because maven bundled with Eclipse didn't work as expected. It's horrible if tools that should save time, waste time. I still don't like maven. IMHO it's still to complex compared to other build tools.
A build tool shouldn't be as complex as developing software.

Nowadays everything has to work with our IDEs, but what happens if it doesn't?

I'm a researcher and love solving problems but is it that complex to keep things simple?
Software has to be simple to help us and we - developers - have to write simple software/frameworks/libraries.

Instead of creating simple software, many developers try to write millions LoC. Don't do that because no one can handle such code-bases in the future.

Just sayin'

VisionX compared to RAD

We started with VisionX as RAD tool because we tried to solve common problems with database development. If you create applications with access to databases, you know what I mean. It's horrible to do the same boring things multiple times. You have to create table definitions, create screens, bind models to controllers or views, use or don't use ORM, implement business logic, ...
The most interesting part is business logic because all other things are not that complex (of course, database modelling is not a trivial task).

Today I'm conviced that VisionX is the evolution of RAD.

Why do I think that?

Usually, RAD tools offer an all-in-one solution for developing applications. They contain IDE features but aren't an IDE. A RAD tool is more like a lightweight IDE with some useful addons like database modeler, GUI editor and debugger. Some RAD tools offer SCM integration, Test automation and other ALM methods.

RAD is not the right definition for VisionX because it's more than that. It doesn't show you the source code directly because an IDE is better for that. Why shouldn't we use an IDE for editing source code? VisionX doesn't offer SCM features because there are enough good tools available.

VisionX primarily supports Eclipse as IDE and all available SCM tools but not directly linked with VisionX. VisionX is not open source but it uses open source frameworks and all built applications are available with their source code. We didn't re-invent the wheel but tried to allow end-users to create their own applications without being a developer.
We think it's better to use the best tools, instead of creating something similar. You decide what's the best tool.

VixionX wasn't designed for developers. It was designed for end users. This is a big difference compared to RAD tools.

But VisionX is not limited to end users, because it creates and reads Java source code. Every Java developer can work with VisionX but with familiar development tools like Eclipse. The tool offers a WYSIWYG editor and has some useful addons, but it goes a few steps further.
VisionX doesn't need a database modeler because an end user doesn't know what a database(model) is. The user knows which data is needed, like Phone number, currency, description. The user also knows if a selection field is needed or an image should be shown. But primary key, foreign key and constraints are totally unknown.

You can compare VisionX with Excel because the user enters data and the application decides what is shown. But there's no hidden magic because VisionX simply works with generated and interpreted source code. If you change the source code, VisionX takes care of it.

And another big difference to RAD tools is, that VisionX creates modern 3-tier applications following single-sourcing approach. It's the only tool that creates an application that runs without source code changes as Desktop application, native HTML5 application in modern web browsers and as native smartphone app. It offers live preview on all targets and it has a unique reporting included. It's not based on XML files or meta information. It's based on Word or Excel templates. Every end user is able to create a word or excel file.

VisionX is a tool, designed for end users but a developer will love it because it helps to do all the boring work and under the hood it's still a modern development tool.

Our Live-Ticker implementation - World cup 2014

We got a lot of (positive) feedback for our live ticker in Packung! It's great to see actual results depending on the current score :)

We started our live ticker in 2008 with a simple implementation in Java. The solution simply sniffed results from standard html pages. It was easy to get results because result pages didn't use Ajax. It was harder in 2010 and 2012 because Ajax was heavily used. But we found some pages without Ajax.

What's the problem with Ajax? It's not possible to get the complete html content with one simple http request with Java. You need a "browser" that handles javascript and async calls.

We didn't find a html page with live results this year, which didn't use Ajax or Flash. So we thought about a clever solution because we won't pay for "free content". And of course, our betting game is free and we don't earn money. But what's a clever solution? The task is simple: Grab results from existing live-ticker website (be aware of Ajax) - but how?

The solution is simple: Use a browser :)

But Java doesn't offer a browser control, doesn't it? Yes, JavaFX does!

In 2008 we played around with QT webkit control of QT Jambi (but the project is not active) because it was a nice browser control. The problem was that it didn't work headless and our application server was a linux box without X-Server. This year, we had the same restrictions because our server is a linux box and still no X-Server. We thought that JavaFX could be the right solution for us...

BUT it doesn't work headless enough - not with latest release. It will be better in upcoming releases and/or custom JavaFX builds because there is a Glass windowing component called Monocle. But this was the right challenge for us.

Our current solution runs on Linux, without a real X-Server. It's a JavaFX WebView/WebEngine that reads data from a public live-ticker.

How our solution works?

Install important linux packages:

yum install xorg-x11-server-Xvfb xorg-x11-xauth gcc glib2 glib2-devel libtiff libtiff-devel libjpeg-devel cairo cairo-devel pango pango-devel redhat-lsb

optional if available

yum install redhat-lsb-graphics

Download and install ATK

wget ftp://ftp.muug.mb.ca/mirror/centos/6/os/x86_64/Packages/atk-1.30.0-1.el6.x86_64.rpm
wget ftp://ftp.muug.mb.ca/mirror/centos/6/os/x86_64/Packages/atk-devel-1.30.0-1.el6.x86_64.rpm
rpm -Uvh *.rpm

and GTK+

wget http://ftp.gnome.org/pub/gnome/sources/gtk+/2.18/gtk+-2.18.2.tar.gz
tar -xvf gtk+-2.18.2.tar.gz
cd gtk+-2.18.2
./configure
make
make install

Start Xvfb:

Xvfb :99 &

Start application:

#!/bin/sh
export DISPLAY=:99
export LD_LIBRARY_PATH=/usr/local/lib
./jdk1.8.0_05/bin/java -jar livescore.jar >> liveupdate.log 2>> liveupdate_err.log &

The application itself is trivial. It's a class with main method:

/**
 * Starts the application.
 *
 * @param pArgs the application parameters
 */

public static void main(String[] pArgs)
{
    new Livescore();
}

/**
 * Creates a new instance of <code>Livescore</code> and starts the update procedure.
 */

public Livescore()
{
    super();

    fxPanel = new JFXPanel();
       
    Platform.runLater(new Runnable()
    {
        public void run()
        {
            fxPanel.setScene(new Scene(new BorderPane(), 800, 600));
               
            browser = new SimpleBrowser();
            browser.load();
        }
    });
       
    start();
}

We need the JFXPanel because JavaFX needs a scene, otherwise it'll throw Exceptions. We don't need the instance for other things.

The SimpleBrowser class is similar to this snippet:

/**
 * Loads the configured website.
 */

public void load()
{
    if (view == null)
    {
        view = new WebView();
        engine = view.getEngine();

        engine.load("http://live-ticker.url");
    }
    else
    {
        engine.reload();
    }

    if (thCheck == null)
    {
        thCheck = new Thread(new Runnable()
        {
            public void run()
            {
                try
                {
                    while (Thread.currentThread() == thCheck)
                    {
                        Platform.runLater(new Runnable()
                        {
                            public void run()
                            {
                                checkResults();
                            }
                        });
                       
                        Thread.sleep(10000);
                    }
                }
                catch (InterruptedException ie)
                {
                    //stop
                }
               
                thCheck = null;
            }
        });
        thCheck.start();
    }
}

That's it. We got two "silent" Exceptions

java.lang.NullPointerException
  at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:57)
  at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:36)
  at java.lang.reflect.Field.get(Field.java:387)
  at com.sun.javafx.webkit.theme.ScrollBarThemeImpl.getFieldValue(ScrollBarThemeImpl.java:397)
 ...
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
  at com.sun.javafx.webkit.theme.ScrollBarThemeImpl.thumbPosition(ScrollBarThemeImpl.java:267)
  at com.sun.javafx.webkit.theme.ScrollBarThemeImpl.getThumbPosition(ScrollBarThemeImpl.java:352)
  at com.sun.webkit.Timer.twkFireTimerEvent(Native Method)
  at com.sun.webkit.Timer.fireTimerEvent(Timer.java:66)
  at com.sun.webkit.Timer.notifyTick(Timer.java:47)
  at javafx.scene.web.WebEngine$PulseTimer$2.pulse(WebEngine.java:1154)
  ...

after the application start, because of some scrolling problems, but these Exceptions had no effect (in our solution).

The solution would rock with a real headless JavaFX but it's ok for us.

Twitter Storage in action

We re-activated our Twitter storage for Packung! 2014. The old implementation was based on twitter4j 2.1.7 and since Twitter API changes, our implementation stopped to work. After a library update to twitter4j 4.0.1 and some smaller changes, everything is fine again.

The storage in action:

Twitter Storage implementation

Twitter Storage implementation

The storage extends the standard AbstractMemStorage of JVx.

JVx 2.0.2

We've released JVx 2.0.2 last friday and you should know that it's available :)

It's a smaller update with bugfixes and some improvements. One new feature is the support for an additional row in the databook. We use this row for searching records.

Other interesting features, from the changelog, are

  • added listener to IConnection for notifications about property changes
  • DBAccess isModified introduced
  • register value changed of single column
  • register key event listener for certain key
  • DataBookBuilder introduced
  • ICloseable introduced
  • Set ORDER BY as property of DBStorage
  • new selection modes: CURRENT_ROW_DESELECTED, CURRENT_ROW_SETFILTER
    CURRENT_ROW_DESELECTED_SETFILTER
  • CommonUtil.close introduced

Have fun ;-)