1 package SGN
::Controller
::Genefamily
::Manual
;
6 SGN::Controller::Genefamily::Manual - Catalyst controller for pages dealing with
7 manually curated gene families (aka 'locusgroup')
13 BEGIN { extends
"Catalyst::Controller"; }
14 with
'Catalyst::Component::ApplicationAttribute';
19 isa
=> 'DBIx::Class::Schema',
24 shift->_app->dbic_schema( 'CXGN::Phenome::Schema' )
27 =head2 view_genefamily
29 Public path: /genefamily/manual/<locusgroup_id>/view
31 View a gene family (locusgroup) detail page.
33 Chained off of L</get_genefamily> below.
37 sub view_genefamily
: Chained
('get_genefamily') PathPart
('view') Args
(0) {
38 my ( $self, $c, $action) = @_;
39 my $genefamily = $c->stash->{genefamily
};
41 $c->forward('get_genefamily_extended_info');
44 my $logged_user = $c->user;
45 my $person_id = $logged_user->get_object->get_sp_person_id if $logged_user;
46 my $curator = $logged_user->check_roles('curator') if $logged_user;
47 my $submitter = $logged_user->check_roles('submitter') if $logged_user;
48 my $sequencer = $logged_user->check_roles('sequencer') if $logged_user;
49 my $dbh = $c->dbc->dbh;
53 ###Check if a gene family page can be printed###
54 my $genefamily_id = $genefamily ?
$genefamily->get_locusgroup_id : undef ;
56 # print message if locusgroup_id is not valid
57 unless ( $genefamily_id =~ m
/^\d+$/ ) {
58 $c->throw_404( "No gene family exists for that identifier." );
60 unless ( $genefamily ) {
61 $c->throw_404( "No gene family exists for that identifier." );
65 my $owner_id = $c->stash->{owner_id
} || undef ;
66 if ( $genefamily && ($curator || $person_id && ( $person_id == $owner_id ) ) ) {
69 my $members = $genefamily->get_locusgroup_members;
73 template
=> '/genefamily/manual/index.mas',
76 genefamily
=> $genefamily,
78 submitter
=> $submitter,
79 sequencer
=> $sequencer,
80 person_id
=> $person_id,
82 genefamily
=> $genefamily,
84 is_owner
=> $is_owner,
87 locus_add_uri
=> $c->uri_for( '/ajax/locus/associate_locus' ),
92 =head1 PRIVATE ACTIONS
96 Chain root for fetching a locusgroup object to operate on.
98 Path part: /genefamily/manual/<locusgroup_id>
102 sub get_genefamily
: Chained
('/') PathPart
('genefamily/manual') CaptureArgs
(1) {
103 my ($self, $c, $locusgroup_id) = @_;
104 $c->stash->{genefamily
} = CXGN
::Phenome
::LocusGroup
->new($self->schema, $locusgroup_id);
108 sub get_genefamily_extended_info
: Private
{
109 my ( $self, $c ) = @_;
110 #$c->forward('get_genefamily_members');
114 __PACKAGE__
->meta->make_immutable;