Document Information

Last modified:
2008/01/14 16:02 by ecker

Migration Support (migrating to 0.7.x versions)

qooxdoo 0.7 has an improved migration support. Migrating skeleton-based application to the newest qooxdoo release is now easier than ever before.

Some migration steps transform the syntax tree of the JavaScript files. To transform the syntax tree back into JavaScript a pretty printer is used. This means the formatting of the original files will be changed. You can however customize the output of the pretty printer using some configration parameters.

If you had built the API viewer in your previous version of qooxdoo, all the API files will be migrated as well, creating lots of spurious entries in the migration log. You can avoid this by running make distclean prior to make migration. As all the “made” files will be out of date after migration this is a good idea anyway.

Migration from qooxdoo 0.6.4 or newer

With 0.6.4 the Makefiles have been reorganized. This allows us to add additional make target to the skeletons without the need to change the existing application Makefiles. Follow those steps to migrate to the newest qooxdoo version 0.7.x:

  1. Backup your project.
  2. Download and unpack the qooxdoo SDK (0.7.x)
  3. Point the QOOXDOO_PATH and QOOXDOO_URI variables in your application Makefile to the new qooxdoo version.
  4. add a QOOXDOO_VERSION variable to your application Makefile. This variable must contain the original qooxdoo version of your application.
  5. optionally, you can customize the pretty printer using the Makefile variable PRETTY_PRINT_OPTIONS. This variable holds options for the pretty printer.
  6. call make migration

Now all JavaScript files should get updated. A full log of the migration process is saved into a file named migration.log in the Makefile’s directory.

Migration from qooxdoo 0.7 pre-releases

To migrate the pre-releases (0.7-pre, etc.!) to the newest 0.7 release the following steps are needed:

  1. Backup your project.
  2. Download and unpack the qooxdoo SDK (0.7.x)
  3. Point the QOOXDOO_PATH and QOOXDOO_URI variables in your application Makefile to the new qooxdoo version.
  4. add a QOOXDOO_VERSION variable to your application Makefile. Attention: This variable must set to 0.6.6 in order to perform a successful migration
  5. optionally, you can customize the pretty printer using the Makefile variable PRETTY_PRINT_OPTIONS. This variable holds options for the pretty printer.
  6. call make migration

Now all JavaScript files should get updated. A full log of the migration process is saved into a file named migration.log in the Makefile’s directory.

Migration from qooxdoo 0.6.3 or older

For qooxdoo releases 0.6.3 or older the migrator script of the new qooxdoo release (0.7.x) must be executed directly. The migrator is a Python program, which is located at QOOXDOO/frontend/framework/tool/migrator.py.

Make sure you made a backup of your existing application!

To migrate all your application classes invoke the migrator script from the top level directory of your application with the following options:

$ migrator.py  --class-path source/class --from-version=0.6.3
  • –from-version must contain the original qooxdoo version of your application
  • –class-path is the root directory of your application’s JavaScript class files

The format of the pretty-printed files can be customized by the pretty printer options documented in Code Style.

The JavaScript files are now migrated to the current qooxdoo version. As a second step it is highly recommended to update the existing Makefile used for your application. It is best to take the Makefile from the skeleton folder in the new qooxdoo release, copy it to your application folder and modify it to fit your application’s requirements. Make sure the usual make and make build commands run properly with your new Makefile.

Migration of applications not based on skeleton

If the JavaScript classes of your application to be migrated are organized in namespaces just like qooxdoo or the skeletons, the project can be migrated using the same approach as skeleton-based qooxdoo projects older than 0.6.4.

If the JavaScript files are organized in a different way, each file has to be migrated individually (see next paragraph).

The migrator is not able to process files containing more than one class definition.

Migration of individual files

It is possible to migrate individual files using the migrator script. This functionality can be very useful, to preview how the migrated files would look like after migration.

To migrate just one file call the migrator like this:

$ migrator.py --from-version=0.6.4 --input source/class/custom/Application.js

This prints the migrated file content to the console. The original file will not be changed.

It is of course possible to redirect the result of the migration into an output file:

$ migrator.py --from-version=0.6.4 --input source/class/custom/Application.js > Application.migrated.js

That way source/class/custom/Application.js remains unchanged and Application.migrated.js contains the migrated version.

Command line options for the migrator

Execute the following command to see a full description of available options:

$ ./migrator.py --help

usage: migrator.py [options]

options:
  -h, --help            show this help message and exit
  -v, --verbose         Verbose output mode.
  --class-encoding=ENCODING
                        Encoding of the files to migrate.

  Migrator Options:
    -m MAKEFILE, --from-makefile=MAKEFILE
                        Makefile of the skeleton project to migrate (optional)
    --from-version=VERSION
                        qooxdoo version used for the project e.g. '0.6.3'
    -i FILE.js, --input=FILE.js
                        Migrate just one JavaScript file. Writes the generated
                        file to STDOUT.
    --class-path=DIRECTORY
                        Define a class path.

  Pretty printer options:
    --pretty-print-indent-string=PRETTYPINDENTSTRING
                        String used for indenting source code; escapes
                        possible (e.g. "\t"; default: "  ")
    --pretty-print-newline-before-open-curly=[aAnNmM]
                        Defines whether "{" will always [aA] or never [nN] be
                        on a new line; the default is mixed [mM] behaviour
                        according to complexity of the enclosed block
    --pretty-print-indent-before-open-curly
                        Indent "{" (default: False)
    --pretty-print-inline-comment-padding=PRETTYPCOMMENTSINLINEPADDING
                        String used between the end of a statement and a
                        trailing inline comment (default: "  ")
    --pretty-print-indent-align-block-with-curlies
                        Align a block of code with its surrounding curlies
                        (obviously not with the opening curly when it is not
                        on a new line); use in combination with --pretty-
                        print-indent-before-open-curly, otherwise the result
                        might look weird (default: False)

Information

Last modified:
2008/01/14 16:02 by ecker

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.