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

JVx EE Source Code is available

The scource code is online. Thanks to Stefan for his great work!

Check out the project page.

In the coming weeks we will finalize the documentation and build the binaries.

You find the JPA integration and a complete example application in the repository.
Have fun.

JVx EE

Our new project is created and we are preparing the source upload.

JVx EE

What is JVx EE?

It's the integration of JPA 2.0 in JVx. Create professional backend software with JVx and use your domain model which is already available in your Java EE based web application. With JVx EE you can use the configured EntityManager and JPA implementation of your web application. Reuse your existing DAOs or EAOs without changes in your application.

With JVx EE it is possible to create a standard JVx application that is connected to your domain model, e.g.:

JPAStorage jpaAddress = new JPAStorage(Address.class);
jpaAddress.setEntityManager(getEntityManager());
jpaAddress.open();

or with a custom EAO

CustomerEAO eaoCustomer = new CustomerEAO();
eaoCustomer.setEntityManager(getEntityManager());

JPAStorage jpaCustomer = new JPAStorage(Customer.class);
jpaCustomer.setEntityManager(getEntityManager());
jpaCustomer.getJPAAccess().setExternalEAO(eaoCustomer);
jpaCustomer.open();

Do you need a professional backend application for your existing web frontend? Use JVx and your problems are solved. You get all advantages of JavaEE in your JVx application.

JVx EE is licensed under Apache License 2.0.

Do you have any questions? Let me know.

Javeleon Eclipse Plugin

If you use Javeleon for JVx applications and your preferred IDE is Eclipse, check out our new Eclipse plugin. It is the inofficial Javeleon plugin for Eclipse. The name of the plugin is Javilion Plugin. It is available on SourceForge and it is released under Apache License 2.0.

The plugin has two helpful features:

  • Reload Javeleon manually

    Simply reload Javeleon whenever you want.

  • Automatic Reload after resource file update

    The current Javeleon version(s) does not reload when you change a resource file like .properties, .xml, ... If you enable the Javilion plugin in your Eclipse project, reload happens automatically.

If you want to use the plugin, use the following instructions, because we have not setup an updatesite right now!

  • Download the plugin
  • Copy the jar to the dropins or plugins directory of your Eclipse installation
  • Restart Eclipse
  • Add Javilion nature to your project: right mouse click on your project, Javilion/Add nature
  • Right click on your project to verify that Javilion is added:

    Javilion Plugin

    Popup menu

  • Configure your application run configuration and add the port property to your javaagent, e.g.:

    -javaagent:D:\javeleon.jar=nbjdk=default;profile=java;port=9999

    The port 9999 is the default setting. If you need another port, configure it in your .project file:

    <buildCommand>
        <name>com.sibvisions.eclipse.javilion.JavilionBuilder</name>
        <arguments>
            <dictionary>
                <key>port</key>
                <value>1234</value>
            </dictionary>
        </arguments>
    </buildCommand>

    It is a little bit tricky, because we don't have a configuration UI for the plugin right now.

If you use the plugin together with a Javeleon ReloadListener (-Djaveleon.reload.listener=app.MyListener), you feel the full power of Javeleon.

VisionX 1.1.1 is released

We released VisionX 1.1.1 as little Thank you to our customers. Thanks for the great Feedback and for all the compliments!

The new release contains many improvements and solves some ugly problems.

The details

  • Application reload in Browsers

    It is not necessary to clear the Java or Browser cache. The application now reloads automatically.

  • Data export

    The simple export of records now creates valid CSV files. Simply open it with Excel or other Office suites.

  • Install the database without freeze

    VisionX had a problem with opened database connections, because the installation waits until all resources are freed. In the current release, VisionX closes all opened connections during installation. The database installation now runs smoothly.

  • Translation update

    We updated the English translation.

  • Tomcat Settings

    If you reused a Tomcat setting, the port is set to 80. Now the stored port is used.

  • User Management

    Now it is possible to customize the User Management screen.

  • Form screen validation

    If you close a form screen but not all required fields are filled, you get only one information dialog.

  • Default table sort

    If you sort a table with different columns and different sort orders, it is saved now.

  • Edit data table

    We found a potential freeze during screen update and changed the display of the data type.

  • Action editor

    A value change command does not create a new insert command anymore.

Have fun with this fantastic release.

JVx 1.1 beta1 is available

It is available from the project page.

What's different?

This beta release is an update release and contains not a lot of new features.

  • CSV Export uses client locale

    Before 1.1, we used a semicolon ";" as separator. Now we use a locale specific separator. This solves country specific data export problems.

  • Modal Internal Frames on MacOSX

    We solved the problem with resizable modal internal frames on MacOSX. Now the resizebox is always visible.

  • UITable readonly

    Now it is possible to set an UITable readonly independent of the IDataBook.

  • API changes

    We reverted the API change, made in JVx 1.0, because the implementation was not very clever. Now it is possible to extend the DBStorage and have full database independent support. In JVx 1.0 you had to extend the default DBStorage and the specific MySqlDBStorage and the specific PostgreSqlDBStorage.... was not very developer friendly. With JVx 1.1 you have the same features but without development overhead.

    Old:

    DBStorage dbs = getDBAccess().createStorage();
    dbs.open();

    New:

    DBStorage dbs = new DBStorage();
    dbs.setDBAccess(getDBAccess());
    dbs.open();

Check the Changelog for a complete list, and use our Forum to talk with us ;-)

PDF change metadata

Sometimes it is useful to change PDF Metadata.
The following code snipped is based on Add an image to an existing PDF

HashMap<String, String> hmpInfo = new HashMap<String, String>();
hmpInfo.put("Title", "CV");
hmpInfo.put("Author", "rjahn");

PdfDictionary dictTrailer = pdr.getTrailer();

if (dictTrailer != null && dictTrailer.isDictionary())
{
        PdfObject objInfo = PdfReader.getPdfObject(dictTrailer.get(PdfName.INFO));
       
        if (objInfo != null && objInfo.isDictionary())
        {
                PdfDictionary infoDic = (PdfDictionary)objInfo;
               
                for (Map.Entry<String, String>entry : hmpInfo.entrySet())
                {
                        if (entry.getValue().length() == 0)
                        {
                                infoDic.remove(new PdfName(entry.getKey()));
                        }
                        else
                        {
                                infoDic.put(new PdfName(entry.getKey()),
                                 new PdfString(entry.getValue(), PdfObject.TEXT_UNICODE));
                        }
                }
        }
}

pdr.getCatalog().remove(PdfName.METADATA);

Add an image to an existing PDF

Do you know the problem: You got a PDF document and want to add an image to a single page, but you have no printer/scanner.

Normally jPdf Tweak solves simple PDF problems, but it is not possible to add a simple image to a PDF file :( . It supports watermarks, but it is not supported to set the position or page.

I wrote some lines of code to solve my problem:

PdfReader pdr = new PdfReader("D:\\test.pdf");

PdfStamper pds = new PdfStamper(pdr, new FileOutputStream("D:\\test_image.pdf"));

PdfContentByte pcbPosition;

PdfGState pgsTransparency;

Image img;

for (int i = 1, anz = pdr.getNumberOfPages(); i <= anz; i++)
{
        //only first page
        if (i == 1)
        {
                pcbPosition = pds.getOverContent(i);
   
                pgsTransparency = new PdfGState();
                pgsTransparency.setFillOpacity(100 / 100f);
               
                img = Image.getInstance(FileUtil.getContent("D:\\image.png"));
               
                //x: 0 = left
                //y: 0 = bottom
                img.setAbsolutePosition(500f, 250f);
                //70 is 100%
                img.scalePercent(10);
                img.setRotationDegrees(0);
               
                pcbPosition.saveState();

                pcbPosition.setGState(pgsTransparency);
                pcbPosition.addImage(img);
       
                pcbPosition.restoreState();
        }
}

pds.close();

Use the current iText version or iText 4.2.0 (friendly license).

Oracle Forms and JVx - simply great

Oracle Forms is a great technology/platform to write database applications (for Oracle DBs) - There is no doubt!

But nobody knows how long it will exist! Oracle tries to replace Forms with ADF and or APEX, since years. APEX has limited functionality, ADF is too complex and is very "special"!

Have you ever tried to migrate an Oracle Forms Application to Java or .NET? Good luck :)
There are several tools that allows "automatic migration". But this is not more than an attempt!
Simple and small Forms Applications are surely migrated to another technology, but what is with the more important - large - applications?

We are not magicians, but have a modern technolgogy which enables a gradual migration.

Why is Oracle Forms so successful?
It is simple and does its job. You create User Interfaces for your Oracle Database very fast and ready for production. With JVx we offer a framework that solves the same problems but it is UI and database independent, is 100% Java and is Open Source.

And more...
Use JVx in your Forms applications.

Every developer knows that it is not so easy to replace a full-blown application with another one. Would it be cool to use existing features and Oracle Forms User Interfaces and integrate/implement new features and User Interfaces with JVx. Of course it would be very cool, but you need exactly one application that is consistent and still "simply works"!

And after all your Forms features are migrated, simply use a JVx application without Forms. You have no effort to switch, because it does not matter whether JVx runs with or without Forms!

Are you curious?

I assure you that no other framework is better suited than JVx.

Why?

  • Re-use your existing database logic (triggers, packages, views, functions, procedures) without changes.

    It is possible but not necessary to move your business logic to the server tier (middleware). Of course, it is recommended, if you plan to replace your Oracle database with antother database system. To be honest... Oracle has a damn good RDBMS.

  • Why sould you create tons of source code and use ORMs if your data model is clean.

    I'm sure you want maintainable applications - as usual?

  • Money, money, money

    Use your preferred Open Source application server and don't pay expensive license fees.

  • And one of the most important things: You don't need a new development team.

    What happens if you decide to replace your Forms Application with ADF? Have your developers the needed skils?

Do you need an example?

Oracle Forms with JVx

Oracle Forms with JVx

The example uses JVx UI (layout, panel, table, button), the generic model, a remote connection and life-cycle objecs as usual. Not bad ;-)

And if you want to develop faster than ever before, use VisionX on top. You have never used a better Application development tool!

JavaFx 2.0 - TableView connected to a Database

We made some tests with TableView and missed productivity features like Load-on-demand and database support. So we tried to use our DataBooks with a TableView. We need a TableView that is re-usable and shows data from remote storages like databases or csv files. It should support multi-column sorting and of course, load records on demand. A nice feature would be support for edit data without boilerplate code.

Our first simple use-case: Show records from a database table

The result:

TableView with IDataBook

TableView with IDataBook

The implementation is not finished and is more a PoC, but it works great! The source code is available here.
It is also possible to edit data, but the different datatypes are not yet supported!

Simply use the table view to show dynamic content. Allow editing without additional source code. Don't re-invent the wheel again!

The source code of the test application is available here.

JavaFx 2.0 and Business Applications

JavaFx 2.x has some nice UI components. It has new APIs and it is completely different to Swing. Of course, you can mix JavaFx components with Swing components, but the LaF is not the same! The new styling mechanism of JavaFx are really great.

But for me, its not a big step forward in the evolution. It is another UI library, of course a visually appealing. I miss an application framework or components with built-in support for modern applications. From my point of view, there is not enough focus on business applications. A business application is not a simple table or chart with some nice looking bars. A business app should handle millions of records, should allow keyboard navigation in all variants, should be fast, should save costs and time.

What should be different?

A standard JavaFx 2 application looks very nice because the standard style is modern. Also styling options are better than ever.

For me, the whole API is too much focused on Lists, POJOs, Generics and Object Bindings. Of course, it is cool for small apps, but you waste time with boilerplate code. If you have a database application with 5 simple tables that contains master data, and you need edit screens, you duplicate your source code 5 times because you have no support for dynamic usage. If you work without Generics, it is not really funny because JavaFx uses it everywhere.

Load-on-demand of records is possible if you do it manually, but it is not included in the controls. "Touch-scrolling" would be great. Compared to other UI libraries (swing, swt, qt), you can't change the default operation of UI controls because you don't have access to internal listeners, scrollbars, Behaviour, ... Some parts are customizable but these are more the exception.

The whole event handling is sometimes very complex, because you don't know what event type you have to use, where the type is declared and which event is the correct one. And inner classes are not the best solution for clarity. Because of Generics you have a lot of configuration work and you are not sure if everything works as expected. Without powerful IDEs you have no chance. Sometimes you have events but nothing happened....
That parts are not the real problem because it requires a certain amount of time to understand new classes. But must things always be complex rather than simple?

But it is great to write source code instead of crazy scripts.

What else?

The version number 2 is too high, because it is still not mature. JavaFx shows what is possible (scene graph, effects, web and video content) but it is not simple to use. But maybe it is perfect to combine only some parts with other mature toolkits like Swing or Swt?

It is not the library that bothers me, but it brings little relief for a developer. Why not just use Pivot? Yes... the web view is powerful ;-)

What should be done?

Focus on Business applications. Integrate an application framework that saves development time. Controls should not be so restrictive!