lacuna nodes need to be marked as such on read
[scpubgit/stemmatology.git] / TreeOfTexts / lib / TreeOfTexts / Controller / Root.pm
CommitLineData
dbcf12a6 1package TreeOfTexts::Controller::Root;
2use Moose;
3use namespace::autoclean;
4use TreeOfTexts::Model::Analysis qw/ run_analysis /;
5
6BEGIN { extends 'Catalyst::Controller' }
7
8#
9# Sets the actions in this controller to be registered with no prefix
10# so they function identically to actions created in MyApp.pm
11#
12__PACKAGE__->config(namespace => '');
13
14=head1 NAME
15
16TreeOfTexts::Controller::Root - Root Controller for TreeOfTexts
17
18=head1 DESCRIPTION
19
20[enter your description here]
21
22=head1 METHODS
23
24=head2 index
25
26The root page (/)
27
28=cut
29
30sub index :Path :Args(0) {
31 my ( $self, $c ) = @_;
32
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';
39}
40
41=head2 default
42
43Standard 404 error page
44
45=cut
46
47sub default :Path {
48 my ( $self, $c ) = @_;
49 $c->response->body( 'Page not found' );
50 $c->response->status(404);
51}
52
53=head2 end
54
55Attempt to render a view, if needed.
56
57=cut
58
59sub end : ActionClass('RenderView') {}
60
61=head1 AUTHOR
62
63Tara L Andrews
64
65=head1 LICENSE
66
67This library is free software. You can redistribute it and/or modify
68it under the same terms as Perl itself.
69
70=cut
71
72__PACKAGE__->meta->make_immutable;
73
741;