Source

wormbase /

Filename Size Date modified Message
attic
bin
build
conf
design
lib
mockups
root
script
src
t
util
147 B
50.2 KB
6.0 KB
2.3 KB
1.5 KB
350 B
111 B
55 B
0 B
78.4 KB
339 B
3.4 KB
Run script/wormbase_server.pl to test the application.

Add StackTrace as an option to the Application: lib/WormBase.pm


# Create a model for the gene class
script/wormbase_create.pl model Gene

# And a controller
script/wormbase_create.pl controller Gene

# Add a simple list method to the Gene controller that
# serves to list all genes in a little table

# Create a TT helper for views
script/wormbase_create.pl view TT TT

# Create a TT template page for Gene page list
mkdir root/src/gene
copy the list.tt2 from MyApp (note that we're missing boatloads of files that were created in the demo by TTSite


use the inline View
script/wormbase_create.pl view TT::Inline TT

$c->view('TT::Inline')->render();




Modules:
Catalyst::View::TT - allows independent rendering of templates

my $output = $c->view('TT')->render(
    $c, 'mytemplate.tt', \%args
);






Installing Catalyst and dependencies (Mac OS X, intel)

1. Fetch Catalyst (5.7008)

> cd ~/src
> curl -O http://search.cpan.org/CPAN/authors/id/M/MR/MRAMBERG/Catalyst-Runtime-5.7008.tar.gz

> cd ~/build
> tar xzf ../src/Catalyst*
> cd Catalyst*

Or, better yet, via CPAN:
 sudo perl -MCPAN -e shell
 cpan> install Task::Catalyst
 cpan> install Catalyst::Devel
 cpan> install Template

Install extra modules

Catalyst::Plugin::Session::Store::FastMmap
Catalyst::Model::Adaptor
Catalyst::Controller::REST

XML::SAX



Third party libraries
---------------------------
Install BioPerl
// This script will build and install bioperl in a local path
./install/bioperl.sh  // See script for details.

-- For optional modules, choose [i] interactive.
-- For "Install [a]ll Bioperl scripts, [n]one, or choose groups [i]nteractively? [a]" choose none.

install GBrowse
./install/gbrowse.sh // see the script...
NOTE: this FAILS on Mac OSX.  The INSTALLSITESCRIPT option in Makefile.PL needs to be set to $OPTIONS{BIN}



Models:
One of the problems of the current approach is that get_params() cannot act easily as a search.
It *assumes* that it will be able to retrieve an object which may be incorrect.






DEPLOYMENT






Overall flow.

1. Request from user: /gene/ID/species

2. Controller action called:

WormBase::Web::Controller::species()

3. Model instantiated by controller method:

species():  $model= $c->model('Gene');

Instantiating the model's new() method also ends up fetching the objects.

4. 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.