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

JVx with vaadin UI and server-side push

Vaadin supports "push" - since 7.1 - but JVx doesn't have an API for that. It's technology dependent and we usually not need it on client-side of an application. It would be useful for the server-side of JVx applications, but that's a different thing. I want to write about server-side push for UI changes.

If you use threads in your application, to update the UI, it's not a problem if you use a desktop technology like Swing UI. The UI is always up-to-date. If you use vaadin UI, it's not the case, because vaadin UI runs on an application server (= server machine) and vaadin client runs in your browser as Javascript code (= client machine). The thread runs on the server machine and doesn't update the client machine automatically. The client retrieves all changes with next client request. This is sometimes too late. With server-side push it's possible to update the client machine immediate, if you use pure vaadin.

With our next vaadin UI release, it's also possible to use server-side push of vaadin to update the client machine. It's very easy to use and also is technology independent, but we didn't introduce new APIs :)

How it works?

Create a new thread, through your factory and use invokeLater to update the UI. You always should use invokeLater to update the UI (no difference if you use swing or other desktop technologies).

UIComponent.invokeInThread(new Runnable()
{
    public void run()
    {
        try
        {
            while (!ThreadHandler.isStopped())
            {
                Thread.sleep(2000);
                               
                UIComponent.invokeLater(new Runnable()
                {
                    public void run()
                    {
                        iCount++;
                                               
                        label.setText("Push: " + iCount);
                    }
                });
            }
        }
        catch (InterruptedException ie)
        {
            info(ie);
        }
    }
});

If push is enabled, above code pushes the UI changes immediate to the client machines. To enable server-side push, simply add following to your servlet configuration in web.xml:

<init-param>
  <param-name>pushmode</param-name>
  <param-value>automatic | manual</param-value>
</init-param>

<async-supported>true</async-supported>

It's also possible to use vaadin push without JVx' mechanism (pure vaadin). To see how this works, read following issue: Server-side refresh.

And the winner is: SIB Visions

Winner IT/E-Commerce

Winner IT/E-Commerce

  Wir sind seit gestern die Gewinner der Spezialategorie IT/E-Commerce des GEWINN Jungunternehmer Wettbewerbes - 2013.

Wir konnten uns gegen eine sehr starke Konkurrenz durchsetzen und freuen uns dementsprechend über die Auszeichnung.

Zum Gewinn haben unser Produkt VisionX und unsere OpenSource Strategie beigetragen. Als eines der wenigen österreichischen Unternehmen entwickeln wir Technolgien für die Software Entwicklung.

Durch die Auszeichnung wurden auch unsere konsequente Vorgehensweise und unsere hohen Qualitätsansprüche belohnt. Nicht zuletzt deswegen sind wir sehr stolz auf diesen Preis.

 

In feierlichem Ambiente und mit gekonnt witziger Moderation wurde die Preisverleihung durchgeführt.

Prize-giving

Prize-giving

JVx' area redesign

Our new JVx' pages are online: http://www.sibvisions.com/jvx

We reduced everything to a bare minimum and it's now much better than before. We added missing information like usage with Maven, Nightly builds, repositories for our demo application. The demo application is now up-to-date. We replaced our showcase application with our new ERP demo application.

We have a new JVx' video that shows all JVx features and projects like Online Help.

Have fun with JVx :)

Our brand NEW Demo application is online

Our good old showcase application was the first JVx application, developed in 2008. It showed some features of JVx but wasn't a real-world application. And of course, it was a small application :)

Some month ago, we decided to create a new real-world application. And what's better for JVx as an ERP system?
So we developed an ERP application :) It's not too feature-rich but demonstrates the full power of JVx.

It's the first application that contains all projects around JVx. The application runs as Java Applet, Webstart (applet or application mode), HTML5 (based on vaadin 7.1), mobile REST server for mobile clients (native iOS and Android) and our rewritten Online Help. Oh, and the built-in JVx REST interface. The application is a multi-user application with a user/role management.

The ERP system demonstrates a real-world Single Sourcing approach. A fat backend with a smart frontend and it supports mobility strategies.

If you want more information about JVx and UI independent application development, visit our talk at W-JAX (Tuesday, 10:15 to 11:30, room Lillehammer)

Thanks Stefan for your great work!

Try out our new application:

http://demo.sibvisions.org/demoerp/ (Applet)
http://demo.sibvisions.org/demoerp/web/ui (vaadin based)
http://demo.sibvisions.org/demoerp/help/ (vaadin based)

Use following credentials (Username = Password):

Manager: manager
Sales person: sales

The whole source code of the application is online and available on SourceForge.

Feel free to send us your feedback!

JVx First Application is available

Our JVx First Application is now available on SourceForge. In the past, we only had zip archives that contained our first application. Now it should be easier for you to start with JVx if you don't use our maven archetype.

The project site is: http://sourceforge.net/projects/jvxfirstapp/

The repository contains an Eclipse project that is ready-to use. The application itself is a database application. Please start the database before you start the application. The database is available and stored in db folder. Simply execute db/startHSqlDB.bat if you use Windows or start it manually on other OS'.

Our First Application is a very simple JVx application and demonstrates first steps without complex use-cases. It simple demonstrates user authentication via XML security manager and CRUD operations with a database table. But the project also contains a JUnit Test that shows how you could test your business logic.

A more complex application will be available in the next days. It's our Demo ERP. This application will demonstrate Swing UI, Vaadin UI, Online Help and more. It's a "real world" showcase that shows the full power of JVx.

VaadinUI 1.0 with JVx Archetype

If you want to use VaadinUI 1.0 with your maven project it's not an easy task because VaadinUI is not available via maven repositories - right now. But I want to show you an easy way to use VaadinUI 1.0 together with JVx Archetype 1.2.0.

Simply create a new maven project (my IDE is Eclipse) based on JVx Archetype 1.2.0. This archetype references JVx 1.2. Older versions are not compatible with Vaadin UI 1.0 - because of new features in JVx' launcher interface. In order to use Vaadin for JVx applications, add following dependencies to the pom.xml of your server project:

<dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-server</artifactId>
        <version>${vaadin.version}</version>
</dependency>
<dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-client-compiled</artifactId>
        <version>${vaadin.version}</version>
</dependency>
<dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-client</artifactId>
        <version>${vaadin.version}</version>
        <scope>provided</scope>
</dependency>
<dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-themes</artifactId>
        <version>${vaadin.version}</version>
</dependency>
<dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.4</version>
        <scope>provided</scope>
</dependency>

Set the global property in parent project pom.xml:

<properties>
        <jvx.version>1.2</jvx.version>
        <vaadin.version>7.0.6</vaadin.version>
</properties>

Because Vaadin runs on server-side, our client has to be deployed on server-side as well. Change pom.xml of your war project:

<dependency>
        <groupId>${project.parent.groupId}</groupId>
        <artifactId>${project.parent.artifactId}-client</artifactId>
        <version>${project.parent.version}</version>
</dependency>

This is not a perfect solution because jvxclient.jar will be added. This lib is not necessary because jvxall.jar is already available - but also not a problem!

The last step is the integration of JVx' VaadinUI. There are many solutions to integrate external libraries but maven is not a friend of external libraries. Using system scrope is evil and such libraries won't be added to war files. Deploying external jars to a local maven repository works but why should we do that? I did decide to use sort of a local maven repository placed in my project with following file structure in my server project:

mvn_repo_project

The integration in pom.xml of server project:

<repositories>
 ...  
 <repository>
    <id>in-project</id>
    <name>External libs</name>
    <url>file://${project.basedir}/lib</url>
 </repository>
</repositories>

Finally we need additional dependencies (server project):

<dependency>
        <groupId>com.sibvisions</groupId>
        <artifactId>jvxvaadin-client</artifactId>
        <version>1.0</version>
   </dependency>
<dependency>
        <groupId>com.sibvisions</groupId>
        <artifactId>jvxvaadin-server</artifactId>
        <version>1.0</version>
   </dependency>
<dependency>
        <groupId>com.sibvisions</groupId>
        <artifactId>jvxvaadin-themes</artifactId>
        <version>1.0</version>
</dependency>

The last integration step is the modification of web.xml in our war project:

<!-- Vaadin UI -->
 
  <servlet>
    <servlet-name>VaadinServlet</servlet-name>
    <servlet-class>com.sibvisions.rad.ui.vaadin.server.VaadinServlet</servlet-class>
               
    <init-param>
      <param-name>UI</param-name>
      <param-value>com.sibvisions.rad.ui.vaadin.impl.VaadinUI</param-value>
    </init-param>
               
    <init-param>
      <param-name>widgetset</param-name>
      <param-value>com.sibvisions.rad.ui.vaadin.ext.ui.Widgetset</param-value>
    </init-param>
               
    <init-param>
      <param-name>main</param-name>
      <param-value>com.sibvisions.apps.myproject.MainApplication</param-value>
    </init-param>
  </servlet>
       
  <servlet-mapping>
    <servlet-name>VaadinServlet</servlet-name>
    <url-pattern>/vaadinui/*</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>VaadinServlet</servlet-name>
    <url-pattern>/VAADIN/*</url-pattern>
  </servlet-mapping>

That's it.

Use the war project together with an application server in Eclipse and enter http://localhost/myproject/vaadinui/ in a web browser to start your application with VaadinUI - with debugging support. Create a war file, deploy it and it will work without problems.

Pair Programming experiment

nofun_nojava Some months ago we were asked if we want to participate a pair programming experiment. The guy who asked was "Code-Cop". Of course, this is not his real name but it's easier for you to understand what he does. He is fanatic about code quality. He likes his code being in order, e.g. nicely formatted, readable, proper named, designed, tested etc. And trust me, these are not just words for him.

Read the full story about Code-Cop and his craftsmanship tour on his blog.

My first thoughts

I did pair/xtreme programming in 2001 and thought it would be nice to do it again. But I thought it could be a risk because I found my own source style and defined my own quality standards over the years. I thought that my quality standard is very high and I'm a professional developer with a lot of experience. You could say that I have a lot of self-confidence... hm... not really bad. What I also learned over the years was that you can't be successful without changes. Every change is a risk because you learn/see something new and maybe you don't like it. But you don't know what you like until you've tried it. This is the most important experience - from my point of view.

So it was great to have this new opportunity and it's always cool to work with same minded people :)

The experiment

We planned to work 3 days with Code-Cop. It was not clear if one person or two persons should work with Code-Cop. We wanted to use the experiment as mechanism of getting input from "outside". The more different perspectives, the better. We had many different tasks for the 3 days, but not all were good because I'm researcher and love playing around with new technologies/frameworks and products. If you do pair programming, you should develop.

I had one task that was open for a while and it frustrated me that it was open. It was the optimization of our JVx build process and fixing some failed test cases. Don't misunderstand me... I hate red test cases and my tests are always green, but it's boring if your tests are green on your developer engine but fail on the build server (different encoding, different OS, ...). Another bad thing was that the build ran about 80 minutes!
The problem were our unit tests because we mixed manual (performance, timeouts, ...) and automatic tests. My plan was a build time around 10 minutes.

The optimization and tuning was the task for one day. Another task was the implementation of a new feature for our product VisionX (a very short task for about a half day). The rest of the time was hardcore coding with Martin, because we have one really complex model class in JVx. Its the MemDataBook class and it grew over the years. It's about 5000 lines with about 3000 LoC. It's a big class but it's not a monster. It's the biggest class in JVx and has the most logic. It was the right class for pair programming :)

How we worked together

We worked together on the same machine with a big external screen, two keyboards and two mice. The first day was a challenge because Code-Cop and I tried to find out who's the top dog :) Not that bad, but it was a big difference to work with another person on the same machine and the same problem (and it didn't help that we are ambitious and dominant). We had different ideas and sometimes different solutions for a problem. I tried to dominate the keyboard because I was used to. One tip: Don't do this, because you don't focus on the problem.

We had great discussions and smaller brainstormings about code quality. It was awesome.

From the second day, everything was in flow because the first day was to get to know the other person. We did our tasks and I had some extra tasks/ideas that could be useful.

pairprogramming The rest of the second day and the third day were reserved for Martin. It was funny to see them in action, because Martin got a "Mouser" and "Keyboarder". It was a long awaited dream of him - a person who understands what he think and can produce source code of his ideas. Of course, they had a tricky task and it wasn't possible to finish the task in two days, but Martin got some new ideas. And last but not least - they had fun!

All 3 days were awesome because Code-Cop was productive from the first minute. We didn't waste time to explain how our framework works. This only is possible if you work with geeks.

Lessons learned

  • It's great to try new things
  • Work with geeks who are professional and have a lot of experience (if you find someone)
  • Use the keyboard and learn most important shortcuts of your IDE. You save time!
  • Don't think you are professional enough. There's always space, but be solution and practice-oriented.

The experiement was awesome and Code-Cop is a pro' geek. We had a great time and I can recommend such experiments.

VisionX 1.2 - Preview II

We know that VisionX 1.2 will be #awesome because it has endless power under the hood. It'll combine productivity features with state-of-the-art technologies. The release is still planned for 2013. But we won't let you wait :)

The brand new preview version of VisionX 1.2 is available as trial and as cloud service. The preview version is not feature complete but contains a lot of new features and of course, many improvements.

A short intro

  • New html5 client based on VaadinUI
    vaadin It's awesome to design an application and see all changes live in your web application. One mouse click is enough to be amazed.
  • Mobile client support is on board

    VisionX has support for native iOS and Android apps. This is a killer feature, because you design your application and your native app is ready without additional steps. We're still working on our native apps because they aren't available in app stores. This needs some additional time. But our open source clients work without problems!

  • Super fast Oracle support

    The last VisionX versions had performance problems with (very) large databases. You had to wait about 10 minutes or more, to select a table. This was so frustrating. The performance is now better than ok. It works without delays!

  • New actions

    We have new actions for tabset and component handling, for environment access (web, desktop, mobile) and much more.

  • New events
    events event_tabs
    We have new events for work-screens and tabsets.
  • Extended reporting syntax

    Our old solution was loop oriented. Loops were used for iterating all records. You had no chance to get the value of a specific record. This is now possible. We now support following: [LOOP@storage#3][YEAR]/[MONTH][LOOP@storage#3]. This placeholder prints the value of YEAR and MONTH from the third record. The short syntax, for one single column is [storage#3!YEAR].

  • Self-joined trees

    It's now possible to create trees with self-joined tables.

  • Environment control
    environment
    It's now possible to hide specific screens on specific environments, e.g. You won't see the user-management screen with html5 mode, but it'll be available in your desktop application. Don't create new roles or new users for that, simply change environment flags via menu management.
  • New LIVE preview wizard
    preview The wizard allows html5, mobile or desktop preview and shows additional information for manually previewing applications.

    VisionX shows scannable QR Code for mobile preview mode.

  • New online help based on Vaadin

    Our new online help system supports full-text search and has a modern style.

Above list is not complete because we have about 250 changes in this version (most are new features).

Simply try the preview and send us your feedback. Every comment is welcome!

Our customers should check their download area!

VaadinUI 1.0

Our new vaadin UI is available. It's the first release and it's awesome.

Get the binaries from our project site. It's licensed under Apache 2.0 and free for all.

The installation is very simple:

  • Download jvxvaadin-1.0.zip
  • Unzip the archive
  • Add all files to your existing JVx application
  • Change Deployment descriptor (web.xml) and replace simpleapp with your application

Have fun ;-)

Vaadin OnlineHelp 1.0

Our new Online Help system is available. It's the first release with our new vaadin UI. It's fully compatible with our old, GXT based, help system.

Get the binaries from our project site. It's licensed under Apache 2.0 and free for all.

The installation is very simple:

  • Download jvxhelp-1.0.zip
  • Unzip the archive
  • Copy the new directory to your application server, e.g. /webapps/
  • Open http://yourserver:port/jvxhelp-1.0/help/

The help content is saved under /structure. The system reads all available files and directories from the structure directory and creates a table of contents.