For most users, it will be sufficient to use plugins in public-plugins/mirror to modify existing pages. This has the advantage of leaving the Ensembl code in modules intact. Currently the Object/Factory/Configuration are pluggable but most other scripts are not. Hopefully EnsEMBL/Web/UserConfig.pm will be pluggable in late 2006.
Coding a new Dynamic Page
As in the previous version of Ensembl, standard dynamic pages are created
via a 'view' script in /perl/default, e.g. geneview. However the modules used by this script have been reorganised.
To create a totally new dynamic page (or to replace an old-style dynamic page with the new code), you need the following 5 Perl files:
- view script
- Factory::[datatype] module
- Object::[datatype] module
- Configuration::[datatype] module, containing a subroutine with the same name as the view script
- Component::[datatype] module
The view script will need to be created for each view, but the other modules may already exist. If so, you will need to add your own subroutine to the configuration module and probably make some minor changes to the component module.
- View Script
- In the case of many views, this can be copied from a similar 'new view' and tweaked to reflect the script name and data object type of your view.
- Factory module
- This will use a lot of the same code as the old DataFactory::[datatype]Factory module, but will need some tweaking - compare an existing Factory child module with its DataFactory version for the main changes.
- Object module
- This will use a lot of the same code as the old Data::[datatype] module, especially the subroutines. The first few lines, e.g. 'use' statements, should of course be adapted from a similar Object child module.
- Configuration module
- This module doesn't have an equivalent in the old code, but its structure is very straightforward and should be easy to copy from a similar config module.
- Component module
- This will use a lot of the same output code as the old Renderer::[datatype]::HTML module, but will probably need a fair amount of tweaking, of both the Perl and HTML, to match the new object model and XHTML style.