1 package SGN
::Controller
::Metadata
;
3 use namespace
::autoclean
;
7 SGN::Controller::Metadata - stuff involving C<CXGN::Metadata>
13 use File
::Spec
::Functions
'catfile';
15 BEGIN { extends
'Catalyst::Controller' }
17 =head2 download_md_file
19 Public path: /metadata/file/<file_id>/download
21 Download a static file pointed to by a
22 L<CXGN::Metadata::Schema::MdFiles> row.
26 sub download_md_file
: Chained
('get_md_file') PathPart
('download') Args
(0) {
27 my ( $self, $c ) = @_;
29 $c->stash->{download_filename
} = $c->stash->{md_file
}->path;
30 $c->forward('/download/download');
33 # chain root (/metadata/file/<file_id>) for doing things with MdFiles
34 sub get_md_file
: Chained
('/') PathPart
('metadata/file') CaptureArgs
(1) {
35 my ( $self, $c, $id ) = @_;
38 $c->stash->{md_file
} = $c->dbic_schema('CXGN::Biosource::Schema')
39 ->resultset('MdFiles')
40 ->find({ file_id
=> $id })