rename TreeOfTexts to less annoying stemmaweb
[scpubgit/stemmatology.git] / stemmaweb / lib / stemmaweb / Controller / Relation.pm
1 package stemmaweb::Controller::Relation;
2 use Moose;
3 use namespace::autoclean;
4
5 BEGIN { extends 'Catalyst::Controller' }
6
7
8 =head1 NAME
9
10 stemmaweb::Controller::Relation - Controller for the relationship mapper
11
12 =head1 DESCRIPTION
13
14 The stemma analysis tool with the pretty colored table.
15
16 =head1 METHODS
17
18  GET relation/$textid
19  
20 Renders the application for the text identified by $textid.
21
22 =head2 index
23
24 The relationship editor tool.
25
26 =cut
27
28 sub index :Path :Args(1) {
29         my( $self, $c, $textid ) = @_;
30         my $m = $c->model('Directory');
31         my $tradition = $m->tradition( $textid );
32         my $table = $tradition->collation->make_alignment_table();
33         my $witlist = map { $_->{'witness'} } @{$table->{'alignment'}};
34         $c->stash->{witnesses} = $witlist;
35         $c->stash->{alignment} = $table;
36         $c->stash->{template} = 'relate.tt';    
37 }
38
39 =head2 end
40
41 Attempt to render a view, if needed.
42
43 =cut
44
45 sub end : ActionClass('RenderView') {}
46
47 =head1 AUTHOR
48
49 Tara L Andrews
50
51 =head1 LICENSE
52
53 This library is free software. You can redistribute it and/or modify
54 it under the same terms as Perl itself.
55
56 =cut
57
58 __PACKAGE__->meta->make_immutable;
59
60 1;