Updating Vaadin 7 Shared Environment

Introduction

Vaadin 7 is an active project still in development.  New releases come out regularly with bug fixes (mostly browser compatibility).  New versions come out with new functionality, etc.

When using the Vaadin 7 shared environment, the version of Vaadin must be the same across the portal.

The reason is the compiled WidgetSets.  When you compile the WidgetSet, the compiled JavaScript is for the version of Vaadin that is being compiled against.  If you compile the WidgetSet using Vaadin 7.2.7, the code will not work so well against 7.2.6 or 7.3.

Keeping the version of Vaadin in sync in your portal has been difficult, but you have a tool to help you complete this task, the Vaadin 7 Control Panel.

Upgrading Vaadin

So upgrading the Vaadin 7 shared environment takes a couple of steps:

  1. Download the new version of Vaadin.
  2. Replace the existing Vaadin theme/widgetset currently in the portal with the new files from the new distribution.
  3. Recompile the custom themes and the widgetset using the deployed Add Ons.
  4. Replace the Vaadin jars for all Vaadin portlets with the version from the distribution.
  5. Restart the portal so the new jars take effect.

Except for the last step, The Vaadin 7 Control Panel will take care of all of these things automatically, you just have to enable a setting and then follow the upgrade procedure.

Enabling the Portlet Auto Update Feature

The portlet Auto Update feature is enabled/disabled in the Settings page of the Vaadin 7 Control Panel:

Settings

Check the "Update Portlets during version change." to enable the Auto Update feature.

NOTE: I recommend checking the "Automatically Compile WidgetSet on version change." checkbox.  Otherwise you must update and then manually compile the widgetset.  Since both must be done, why not save yourself some clicks and do it all at once?

Choosing The Version

The Overview page shows the currently installed Vaadin 7 version as well as the current stable version.  Note that to get this information, your server makes an HTTP request to vaadin.com; if your firewall does not allow this outbound traffic, you will not see a value for the stable version.

Click the Change Version link to change the version.

Again to populate this list, your server will open an HTTP connection to vaadin.com.  If your firewall will not allow this connection, you will not get a list to display from.

That's okay, though, just follow the directions in the note to download the Vaadin 7 archive from vaadin.com manually and upload it using the form at the bottom.

Select the version from the list that you want to install:

After selecting your version, click the Change Version button to go to the next page.

NOTE: There are alpha, beta, pre-release and nightly builds of Vaadin available for download, but the Vaadin 7 Control Panel does not show these for installation.  You can use the manual approach to install one of these versions if you'd like.  Personally I don't believe that you should be trying to use non-stable versions of Vaadin in your portal (you will have enough to worry about using the stable versions).

You have one more chance to reconsider the upgrade.  Click Cancel to return to the Overview page or Change Version to start the upgrade process.

The upgrade process will update the status message at the top and the progress bar so you know what is going on during the upgrade.  A detailed log window appears below to provide all information relative to the upgrade steps.

When the upgrade process is done, you can click Done to return to the Overview page, but if you haven't enabled automatic WidgetSet compilation, click on the Compile Widgetset button and complete the widgetset compile.

Conclusion

When you are done with the upgrade process, the Overview page will reflect the upgraded version of Vaadin:

Note that after upgrading Vaadin 7, you should restart the application server.  This ensures that the correct version of Vaadin is being used by all Vaadin portlets.

As you can see, upgrading Vaadin 7 using the Vaadin 7 Control Panel just couldn't be easier.  And this is something you're going to want to do to keep up with all of the fixes for supported browsers.