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

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.

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.

JVx 1.2 is out

We released JVx 1.2 today - as planned ;-)

The binaries are available on SourceForge or via Maven central. We also updated our Archetype to version 1.2.0 and it should be available in Maven central in the next days.

We told you that the release contains about 90 tickets. The real number of changes is 123.
Check the changelog for a complete list.

Next version will be 2.0

We did decide that version 1.2 is the last release before 2.0. It's not because of new killer features or big API changes.
The higher version number should represent the maturity of JVx.

JVx was started in 2008 and the low version numbers were fine for our own goals, but our users asked for bigger steps. If we compare our 1.2 with other frameworks, we could use 5.0 without problems.

The version 2.0 will be a smaller feature release that changes MetaData handling on server-side. We'll introduce a new caching mechanism that allows manual change of storage metadata.

We plan the release for the end of this year - without guarantee.

We also plan maintenance releases starting with 2.0

Currently, we don't fix bugs in old JVx releases. We only fix bugs in our development version. We offer nightly builds and maven snapshots and we thought that's enough, but some users want to keep old releases. No worries, we'll do our best to make you happy!

Create CSV files of JVx storages

Our AbstractStorage implementations have a writeCSV feature already implemented and you can call this method via action call mechanism. But sometimes you need different CSV exports or ZIP archives with different CSV files. You simply need control over the export.

There's a small project with the name AES Storage Export that could help you solving CSV export problems. It has one simple class that takes one or more storages and exports data as UTF-8 CSV files. All CSV files will be added to a zip archive (optionally AES encrypted)

Simple use the class in an server action and create your custom CSV exports.

Test case:

StorageExport export = new StorageExport();

ICondition condFilter = new GreaterEquals("ID", BigDecimal.valueOf(10)).and(new LessEquals("ID", BigDecimal.valueOf(20)));

StorageEntry entryColumns = new StorageEntry("columns.csv", createStorage(), condFilter);
entryColumns.setColumnNames("ID", "VALUE");

StorageEntry entryColumnsStorage = new StorageEntry("columns_storage.csv", createStorage(), condFilter);
entryColumnsStorage.setColumnNames(createColumnStorage(), "NAME");

export.add(new StorageEntry("first.csv", createStorage()));
export.add(new StorageEntry("filtered.csv", createStorage(), condFilter));
export.add(entryColumns);
export.add(entryColumnsStorage);
export.setPassword("testcase");
export.setSeparator(",");

File fiTemp = new File(System.getProperty("java.io.tmpdir"), "aesarchive.zip");

RemoteFileHandle rfh = new RemoteFileHandle();
export.export(rfh.getOutputStream());

FileUtil.save(fiTemp, rfh.getInputStream());

System.out.println(fiTemp);

Project news

Some years ago, we started a project with the name OnlineHelp. It was used to create simple online help pages for applications. The project was implemented with GXT 2.1 and was really useful. It's still useful but the technology is old, and GXT is not our best friend. Of course newer versions are really fancy, but the license is not the best for commercial applications.

Some month ago, we decided to switch completely from GXT to vaadin - all our projects. The first project was our webUI and we make good progress. We're near to a first release, but we have no definite date for it (Q4/13 should be possible). The second project is the online help. We make good progress and have a first preview:

Online Help with vaadin

Online Help with vaadin

The style is similar to our new web application style but not a big change compared to our old online help, because our users like it:

Online Help with GXT

Online Help with GXT

The new style is fresh but not too much... We added some new features like full-text search and topic navigation (previous, next). It's a first preview and not more!

The project has now it's own project page and is not anymore a sub project of JVx. The license is still Apache 2.0.

Maven deployment via Ant

We are no Maven lovers, because it helps to forget how things work. But we think the dependency management is useful. It's great for developers who need specific library versions without managing them manually.

The user aspect is one thing, but nobody tells you that it's not trivial to release libraries. One problem is the pre-deployment process. Before you are able to deploy your jar files, you have to do a lot of things like GPG key generation, publishing GPG key, find the right repository, prepare your build, special pom cration and so on.

If you already have release builds with version numbers, javadoc and source archives, you'll save a lot of time. If you don't have complete and clean release builds - see you later.

Let's start with a good documentation about requirements:
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide

Of course, it assumes that you'll use Sonatype as your repository, but all others are not too different.

This posting is not a complete documentation. It simply shows the problems we had.

Our simple pom files:
pom.xml (jvxall)
pom.xml (jvxclient)

The first is with dependencies and the second without, because our client doesn't have dependencies.

The real problems started with the integration in our ant script, because the documentation of Maven plugins were awful. It's easier to read the source code than to find out how plugins work. One example: Read following plugin documentation and tell me the valid values for "types" and "classifier". There are no examples on the page! Google around and copy/paste a little bit - awful!

Here's a working ant call

<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
            uri="antlib:org.apache.maven.artifact.ant"
            classpath="${build}/maven/maven-ant-tasks-2.1.3.jar" />

<condition property="gpgexecutable"
     value="C:\Program Files\GNU\GnuPG\pub\gpg.exe" else="gpg">
    <and>
        <os family="Windows" />
   </and>
</condition>

<artifact:mvn>
    <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file" />
    <arg value="-Durl=${mvn.url}" />
    <arg value="-DrepositoryId=${mvn.id}" />
    <arg value="-DpomFile=${maven.tmp}/jvxall/pom.xml" />
    <arg value="-Dfile=${mvn.jvx.jar}" />
    <arg value="-Dfiles=${mvn.jvx.sources.jar},${mvn.jvx.javadoc.jar}" />
    <arg value="-Dclassifiers=sources,javadoc" />
    <arg value="-Dtypes=jar,jar" />
    <arg value="-Pgpg" />
    <arg value="-Dgpg.executable=${gpgexecutable}" />
</artifact:mvn>

Above call submits e.g. jvx-1.1.jar, jvx-1.1-javadoc.jar and jvx-1.1-sources.jar to the repository.

Why one call instead of 3 separate calls, as described in the documentation?

Short: It's better :)
Long: It's better to submit all dependent files in one "maven session". Above call creates a new maven project and if you call this command per file, there's no logical connection between them. If you plan to deploy snapshot releases - forget it - it doesn't work with different calls because every upload gets a new buildnumber. But all files need the same buildnumber! Such deployments can't be used. If you read the Sonatype document, you saw that "deploy" task didn't deploy javadoc and sources! The "stage" task did. I'm not sure, but I think they had the same problem with separate uploads! Trust me, above call works with snapshots and final releases.

Our naming conventions

<property name="mvn.jvx.jar" value="${release}/maven/${release.name}-${versionnumber}${maven.version.postfix}.jar" />
<property name="mvn.jvx.sources.jar" value="${release}/maven/${release.name}-${versionnumber}${maven.version.postfix}-sources.jar" />
<property name="mvn.jvx.javadoc.jar" value="${release}/maven/${release.name}-${versionnumber}${maven.version.postfix}-javadoc.jar" />

(${maven.version.postfix} is -SNAPSHOT for snapshot releases and empty for final releases)

Repository Id, URL

${mvn.id} = sonatype-nexus-staging
${mvn.url} = https://oss.sonatype.org/service/local/staging/deploy/maven2

Other problems?

Proxy settings for Maven, Use an external GPG key, Autentication.

If you copy the following settings.xml to <users.home>/.m2 and modify it to fit your needs, it should solve all problems:

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

<settings>
  <servers>
    <server>
      <id>sonatype-nexus-snapshots</id>
      <username>username</username>
      <password>password</password>
    </server>
    <server>
      <id>sonatype-nexus-staging</id>
      <username>username</username>
      <password>password</password>
    </server>
  </servers>
  <profiles>
    <profile>
      <id>gpg</id>
      <properties>
        <gpg.passphrase>gpgkey</gpg.passphrase>
      </properties>
    </profile>
  </profiles>
  <proxies>
    <proxy>
      <id>firewall</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>10.0.0.1</host>
      <port>3128</port>
      <username></username>
      <password></password>
      <nonProxyHosts>localhost,127.0.0.1</nonProxyHosts>
    </proxy>
    <proxy>
      <id>firewall-2</id>
      <active>true</active>
      <protocol>https</protocol>
      <host>10.0.0.1</host>
      <port>3128</port>
      <username></username>
      <password></password>
      <nonProxyHosts>localhost,127.0.0.1</nonProxyHosts>
    </proxy>
  </proxies>
</settings>

We configured the proxy via ant build.xml

<target name="proxy.check">
  <condition property="proxy.enabled">
    <and>
      <socket server="10.0.0.1" port="3128"/>
    </and>
  </condition>
</target>

<target name="proxy" depends="proxy.check" if="proxy.enabled">
  <property name="proxy.host" value="10.0.0.1"/>
  <property name="proxy.port" value="3128"/>
  <property name="proxy.user" value=""/>
  <property name="proxy.pass" value=""/>
   
  <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
            proxyuser="${proxy.user}" proxypassword="${proxy.password}"/>
</target>

Simply add "proxy" task as dependency of another task.

Maybe it's easier to release libraries with other build systems or maybe it works out-of-the-box with Maven itself, but the whole process is really bad.

Good luck!