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

Oracle Forms together with JVx/Swing (modernization)

The good old Oracle Forms UI does not look really cool. Of course, you can use nice icons and choose the right colors, but the controls are not fancy compared to swing controls.

If you try to to migrate from Oracle Forms to Java, wouldn't it be great to migrate one screen after the other. Or better, create new screens with Java and integrate them in your existing Oracle Forms application. Use both technologies as long as is necessary.

Don't think that you have to migrate the whole Oracle Forms application, migrate step by step. It is absolutely possible to use your new screens in your Oracle Forms aplication or as separate application without Forms. Save time, money and don't replace your existing Oracle Forms developers.

You would like to see how this can look like?


The first screenshot shows a standard Java swing application, with a simple master/detail and some editors:

JVx Swing UI

JVx Swing UI



The next screenshot shows the same screen (without source code changes) used in an Oracle Forms application:

Forms with Java screen

Forms with Java screen



You are right, it is great to embedd the same Java screen, but the Look and Feel is not very cool. Do you know that Java has some nice LaF's? Here is the same screen with Nimbus Look and Feel:

Oracle Forms Nimbus LaF

Oracle Forms Nimbus LaF

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.