Document Information

Last modified:
2007/06/01 10:11 by thron7

Migration Support

This document describes migration support for release 0.6.4 and 0.6.5. For info on migration to prior qooxdoo releases, please consult the following articles:

In order to simplify the migration of existing applications based on previous qooxdoo releases to a newer release, qooxdoo comes with convenient migration scripts. Of course, the dynamic nature of JavaScript and your personal coding style will not allow for a completely automatic process for any release change. But even a semi-automatic process that requires your manual action significantly reduces the total amount of work and is less error-prone. The script output contains detailed information in form of a checklist, including line numbers in the original files.

Make sure you met the Requirements for using the python-based migration scripts.

In the following command you need to replace some placeholders with your indiviual values:

  • APPLICATION_CLASSES_DIRECTORY is the relative or absolute path to the directory that contains the JavaScript files you would like to migrate
  • TARGETVERSION is the qooxdoo release number you would like to migrate to
  • $qx denotes the the folder of your new qooxdoo version (SVN checkout or SDK) that you would like to migrate to
$qx/frontend/framework/tool/generator.py --class-path APPLICATION_CLASSES_DIRECTORY \
  --migrate-source --migration-target TARGETVERSION

You can only jump from one release version to the immediately following release version. For migrations that involve multiple qooxdoo releases, the step above has to be repeated for any intermediate version.

To migrate for example from 0.6.1 to 0.6.5 you have to execute the following commands:

$qx/frontend/framework/tool/generator.py --class-path APPLICATION_CLASSES_DIRECTORY \
--migrate-source --migration-target 0.6.2

$qx/frontend/framework/tool/generator.py --class-path APPLICATION_CLASSES_DIRECTORY \
--migrate-source --migration-target 0.6.3

$qx/frontend/framework/tool/generator.py --class-path APPLICATION_CLASSES_DIRECTORY \
--migrate-source --migration-target 0.6.4

$qx/frontend/framework/tool/generator.py --class-path APPLICATION_CLASSES_DIRECTORY \
--migrate-source --migration-target 0.6.5

Suppose you are inside the skeleton folder. The following command would migrate all your JavaScript class files in the source/class folder to qooxdoo 0.6.5 (implicitly from version 0.6.4 as mentioned above):

$qx/frontend/framework/tool/generator.py --class-path source/class \
  --migrate-source --migration-target 0.6.5

After the migration, do not forget to edit your application’s Makefile to point to the folder of the new qooxdoo version.

The structure of the Makefiles have been reworked and substantially improved by release 0.6.4. You cannot continue to use the existing Makefiles without changes for 0.6.4. You have the choice between the following two options:

  • Do some minor fixes to the existing Makefile of your application or
  • Upgrade to a new Makefile that now includes support for internationalization and is also the basis for future qooxdoo application development

We strongly argue to chose the latter option! Maybe you are on a tight time schedule and you cannot afford to upgrade to the new Makefile now, and therefore you may want to do the quick fixes? Fair enough, but remember that without upgrading to the Makefiles of 0.6.4 you cannot take advantage of the most significant improvements of release 0.6.4 (like internationalization, etc.). It should not be to hard to transfer your individual settings over to the new Makefile.

For more detailed info on the options of the generator script, please consult the article for generator.py.

The migration support is much more powerful in versions 0.6.2 and above than the older scripts that only supported simple replacements based on regular expressions. The new migration is based on the actual parse tree of the JavaScript input files and allows for very sophisticated changes.

As a drawback, the migration support does not fully support other input files than pure JavaScript files (.js file extension) any longer. To be fair, it has never been a good idea to mix different languages (e.g. html markup and JavaScript).

The qooxdoo project itself did not follow this rule in its early days. The mixture of code in the demo files is still a relict of this shortcoming and ought to be cleaned up. We have learned from these mistakes and have already introduced powerful yet easy-to-use skeletons as a starting point for custom application development. Applications based on this preferred structure can be easily migrated to newer qooxdoo versions, because the entire application is made up of pure JavaScript class files. For all applications that still have relevant JavaScript code interwoven with say html or php, the best strategy would be to first extract the JavaScript code into separate (class) files and then do the script-based migration support.

But it is possible to use the purely regexp based part of the migration data to also update HTML, PHP or other files. In this case you define additional migration inputs, which could look like this:

$qx/frontend/framework/tool/generator.py --class-path source/class \
  --migration-input source/html --migrate-source --migration-target 0.6.5

You can use multiple script and migration inputs.

Usually it is helpful to permanently save the output to a file on your harddisk in addition to reading the infos on the screen. You can easily use tee for this:

cd frontend
framework/tool/generator.py --class-path APPLICATION_CLASSES_DIRECTORY \
  --migrate-source --migration-target TARGETVERSION | tee FILENAME

This will output all info to the console, as before, but also logs it to FILENAME.

Information

Last modified:
2007/06/01 10:11 by thron7

Account

Not logged in

 
 

Job Offers

To further improve qooxdoo we are seeking javascript developers. Read more...

Rich Ajax Platform (RAP)

RAP uses qooxdoo, Java and the Eclipse development model to build rich web applications. Read more...

qooxdoo Web Toolkit (QWT)

Similar to GWT this framework allows to create impressive qooxdoo applications just using Java. Read more...

Pustefix

Pustefix is a MVC-based web application framework using Java and XML/XSLT. Read more...

 
SourceForge.net Logo

Bad Behavior has blocked 0 potential spam attempts in the last 7 days.