Chapter 24. Migrating code from BASE 2 to BASE 3

Table of Contents

24.1. Compiling the code against BASE 3
24.2. Core API changes
24.3. Packaging your plug-in so that it installs in BASE 3

This section gives a brief overview what has changed between BASE 2 and BASE 3 and how to migrate plug-in or extension code to BASE 3. Do not expect that your code can be installed and function as intended right out of the box.

24.1. Compiling the code against BASE 3

All deprecated methods and classes have been removed

Before trying to compile your code against the BASE 3 API we recommend that you make sure that you are not using any deprecated methods or classes from the BASE 2.17 API. So the first step should always be to compile your code against the latest BASE 2.17 release. Fix any warnings according to the instructions in the javadoc. In most cases, there is a simple replacment API that can be used instead. Since the deprecated API has been removed in BASE 3 so has the instructions. You'll need to check with the BASE 2.17 documentation which is located at:

Do not proceed until you are sure that your code is not using any deprecated API.

BASE JAR files have new names

All JAR files with the BASE API has been renamed to better follow the scheme used by many other projects.

Table 24.1. JAR filename changes

Old filename BASE 3 filename
BASE2Core.jar base-core-3.0.0.jar
BASE2CorePlugins.jar base-coreplugins-3.0.0.jar
BASE2Webclient.jar base-webclient-3.0.0.jar
BASE2WSClient.jar base-webservices-client-3.0.0.jar

[Note] Note
Also note that the version number is included in the file name, so the files will change when new versions are released. You'll need to make sure that your build system can handle this. The BASE JAR files can be downloaded from http://base.thep.lu.se/chrome/site/files/base/jars/.

24.2. Core API changes

There are lot's of other changes to the API between BASE 2 and BASE 3. If your code is affected by those changes, you will have to update your code. Since there are many changes, both big and small, it is not possible to list everything here. One good way to find out more about the changes is to use the BASE Trac or ask on the developers mailing list. Some of the major changes are:

  • Removed the Plugin.getAbout() method from the Plugin interface. The information should instead be placed in the META-INF/extensions.xml file inside the JAR file that the plug-in is shipped in.

  • HardwareType, SoftwareType, ProtocolType and FileType has been replaced with ItemSubtype. Additionally, several other items implement the new Subtypable interface. See ticket #1597 (Subtypes of items) for more information.

  • Label has been replaced with Tag. LabeledExtract has been merged with Extract. Hybridization has been replaced with PhysicalBioAssay. Scan and Image has been replaced with DerivedBioAssay. The API for linking parent/child biomaterial has been changed. The pooled property of biomaterials has been removed. The changes are driven by the support for sequencing experiments. The new items are using the new subtype feature. For example, a hybridization in BASE 2 has been converted to a physical bioassay in BASE 3 with the subtype 'Hybridization'. The server admin can define additional subtypes. See ticket #1153 (Handling short read transcript sequence data) for more information.

  • RawBioAssay has a direct link to Extract instead of the arrayIndex property which has been removed.

  • Removed validator and metadata reader properties from DataFileType. This feature is now implemented as extensions. The API is slightly different and classes have been moved around a bit. See Section 27.8.9, “Fileset validators” and ticket #1598 (Use the extensions system for data file validators and metadata readers) for more information.

  • A FileSet may store more than one file for each DataFileType which was not possible before. The API for adding files have changed. See ticket #1604 (Support for multiple files of the same type in a FileSet) for more information.

  • Changes to the FileUnpacker interface. The unpack() method signature has changed and any plug-ins that implement this interface need to be updated. The changes make it possible to get information about the main zip/tar file that is being unpacked. See ticket #978 (Unzipped files never inherit file type specified during upload) for more information.

  • Encrypting passwords before logging in is no longer supported. The SessionControl.login() has been changed to reflect this. While this may seem like a reduction in security it is not. The previously used scheme with MD5 hashes can be cracked by brute-force on a moderate computer today. If additional security is needed we recommend that BASE is installed with HTTPS access only. See ticket #1641 (Use bcrypt for storing passwords instead of MD5) for more information.

24.3. Packaging your plug-in so that it installs in BASE 3

The installation system for plug-ins and extensions has been reworked. We hope that it is easier to install things now. Basically, the plug-in installation wizard has been merged with the extensions installation wizard. If your package contain only extensions it will probably install without changes. Packages with plug-ins need some changes to the XML files.