Document Information

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

Migration Support 0.6.3 and below

Substantial changes to migration support have been introduced with qooxdoo 0.6.2 and 0.6.4. This document describes migration support for releases 0.6.2 and 0.6.3. For older qooxdoo releases, please consult previous versions of this article.

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:

  • JS_SCRIPT_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 --script-input JS_SCRIPT_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.

As an example the following command migrates all your JavaScript files in the source/class folder to qooxdoo 0.6.3 (implicitely from version 0.6.2 as mentioned above):

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

For more options please consult the article for generator.py.

The migration support is much more powerful in the 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 regexp based migration data to also update HTML, PHP or other files. In this case you can define additional migration inputs. This could look like this:

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

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 --script-input JS_SCRIPT_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.