source: extensions/net.sf.basedb.examples/trunk/README

Last change on this file was 6306, checked in by Nicklas Nordborg, 2 years ago

References #1317: is moving to https

Fixed links in the documentation of Example code.

  • Property svn:mime-type set to text/x-trac-wiki
File size: 5.2 KB


  1. BASE 3.10 or later.


This package contains a few simple variants of Hello world applications in the form of extensions to the BASE web client. The package installs several examples into the Extensions -> Hello world examples menu:

  • Hello world! - A basic example using only javascript
  • Hello factory world! - An example that uses a custom action factory
  • Greetings Root! - An example of a custom action factory with parameters
  • Hello JSP world! - Uses a JSP file to display the message instead of javascript
  • Hello X-JSP world! - Another variant of a JSP file
  • Hello Servlet world! - Uses a servlet to generate the message
  • Hello Servlet world (alternate)! - Uses an alternative servlet path

There are also a few toolbar button extensions:

  • More info - A toolbar button on all single-item toolbars and displays some information in a popup window about the current item.
  • Annotation filter - A toolbar button on all list pages for annotatable items which allows a user to show only items with/without annotations.

And a edit/save extension:

  • Sample history data - Two extensions that works together. The first adds a tab to the "Edit sample" dialog were the user can select a file to link with the sample. The second extensions attaches to the save event and saves the link.
  • Last updated by - An on-save extension that creates an any-to-any link between any item and the currently logged in user. This is a very simple logging feature that stores information about the last update to an item.

And some extra list columns:

  • Owner registration date - Adds a list column that display the registration date of the owner of the item. The column is added to all list pages that list items that have an owner.
  • Onwer email - Adds a list column that display the email address of the owner of the item. This uses a custom formatter to create mailto links on the web page and a formatter that convert to upper case when exporting. The column is added to all list pages that list items that have an owner.
  • Data files - Adds a column to the raw bioassay list that display the data files that are attached to each raw bioassay. This uses a custom action factory and illustrates the possibility to create fullblown HTML for the web page, and a text-only variant for the table exporter.

Item overview extensions:

  • Loader that add the owner of an item to the overview.
  • Validator that check that the owner has an URL and that it is valid.
  • Loader that load the role membership of users.
  • Validator that check that a user is a member of at least one role.
  • A extra information section which display some information about the currently selected node and item.

Logging extensions:

  • A logging extension that write information about created, updated and deleted items to stdout. The logger is based on the default database logger.

A custom extension point:

  • A simple example of defining a custom extension point. There is one implementation provided in this package, but the main purpose of the extension point is to make it easier for other extensions to test and implement custom extension points.

This package contains the following plug-ins:

  • An importer that pretends to be able to import samples. It will accept any file, but doesn't do anything. Main purpose is to show parameter handling with plug-ins.
  • An analyser plug-in that does some bogus calculations on a bioassay set. Main purpose is to show how a plug-in can access analysed data, do some calculations and store the result as a new bioassay set.


  1. Download the base-examples-*.tar.gz file.
  2. Unpack the downloaded file to a directory of your choice.
  3. Copy the 'base-examples.jar' file to your BASE plug-ins directory as configured in the base.config[plugins.dir] setting.
  4. Go to 'Administrate->Plug-ins & Extensions->Overview' page.
  5. Run the installation wizard and select to install 'base-examples.jar'.
  6. The Hello X-JSP world example requires that the X-JSP compiler is installed on the server. Read in the documentation how to do this.
  7. Done. You may have to use 'BASE->Reload permissions' from the menu to see the 'Extensions' menu.


To compile this package you also need:

  1. Ant 1.8
  2. Java 1.8

Follow these instructions:

  1. Type ant download-lib to automatically download the BASE core JAR file that are neeed for compilation. You can also do this manually by copying the base-core-3.x.jar and base-webclient-3.x.jar files from the BASE installation directory (<basedir>/www/WEB-INF/lib/) to the ./lib/compile directory.
  1. Type 'ant' to compile the code and generate the 'base-examples.jar' file in the project directory. This file can be installed into BASE following the intructions above.
  1. Use 'ant package' to create a downloadable tar.gz.

  1. If you create a file called '' and enter a the path to the plug-ins directory under the key 'base.plugins', you can simply type 'ant install' to copy the examples to the BASE plug-ins directory.
Note: See TracBrowser for help on using the repository browser.