1 package TreeOfTexts::Controller::Root;
3 use namespace::autoclean;
4 use TreeOfTexts::Model::Analysis qw/ run_analysis /;
6 BEGIN { extends 'Catalyst::Controller' }
9 # Sets the actions in this controller to be registered with no prefix
10 # so they function identically to actions created in MyApp.pm
12 __PACKAGE__->config(namespace => '');
16 TreeOfTexts::Controller::Root - Root Controller for TreeOfTexts
20 [enter your description here]
30 sub index :Path :Args(0) {
31 my ( $self, $c ) = @_;
33 my $file = $c->path_to( 't', 'data', 'florilegium.xml' );
34 my $stemma = $c->path_to( 't', 'data', 'stemma_a.dot' );
35 my( $svg, $variant_data ) = run_analysis( $file, $stemma );
36 $c->stash->{svg} = $svg;
37 $c->stash->{variants} = $variant_data;
38 $c->stash->{template} = 'index.tt';
43 Standard 404 error page
48 my ( $self, $c ) = @_;
49 $c->response->body( 'Page not found' );
50 $c->response->status(404);
55 Attempt to render a view, if needed.
59 sub end : ActionClass('RenderView') {}
67 This library is free software. You can redistribute it and/or modify
68 it under the same terms as Perl itself.
72 __PACKAGE__->meta->make_immutable;