3 This package is deprecated, do not use in new code.
7 package CXGN
::MasonFactory
;
13 use CatalystX
::GlobalContext
'$c';
18 SGN
::Context
->instance
24 @_ and croak
"new() takes no arguments\n";
25 return CXGN
::MasonFactory
::InterpWrapper
->new(
26 context
=> $class->_context,
33 my $context = $class->_context;
34 return $context->view('BareMason')->render( $context, $comp, { c
=> $context, @_ });
37 package CXGN
::MasonFactory
::InterpWrapper
;
40 has
'context' => ( is
=> 'ro', required
=> 1 );
43 my ( $self, $comp, @args ) = @_;
44 my $context = $self->context;
45 print $context->view('Mason')->render( $context, $comp, { c
=> $context, @args } );
48 __PACKAGE__
->meta->make_immutable;
55 # CXGN::MasonFactory - a factory that returns HTML::Mason::Interp object configured for the CXGN layout.
59 # my $mason = CXGN::MasonFactory->new();
60 # $mason->exec('/my/mason/module, %args);
63 # my $output = CXGN::MasonFactory
64 # ->bare_render( '/my/component.mas',
71 # To create a new Mason object, use CXGN::MasonFactory instead of HTML::Mason. MasonFactory will give you correctly set paths for the CXGN system.
75 # Lukas Mueller E<lt>lam87@cornell.eduE<gt>
77 # =head1 COPYRIGHT & LICENSE
79 # Copyright (c) 2009 The Boyce Thompson Institute for Plant Research
81 # This program is free software; you can redistribute it and/or modify
82 # it under the same terms as Perl itself.
89 # Usage: $mason = CXGN::MasonFactory->new()
90 # $mason->exec("/blabla");
91 # Desc: creates an appropriate HTML::Mason object
92 # Args: optional hash-style list as:
93 # data_dir => additional data tempfile dir to add,
96 # See L<HTML::Mason::Admin> and L<HTML::Mason::Interp>
97 # for more an these arguments.
102 # CXGN::MasonFactory->new->exec('/mycomponent.mas');
109 # Usage: my $output = CXGN::MasonFactory
110 # ->bare_render('/my/component.mas',
115 # Desc : use this method to call a mason component like an
116 # html-generating function
117 # Args : component name, then hash-style list of arguments for the
119 # Ret : string of HTML produced by the component
120 # Side Effects: throws a warning that the page you are using it in
121 # needs to be migrated to all-mason
124 # # in some legacy script
126 # print info_section_html(title => 'Clone & library',
129 # '<center><table><tr><td>'
130 # . CXGN::MasonFactory
131 # ->bare_render('/genomic/clone/clone_summary.mas',
134 # . CXGN::MasonFactory
135 # ->bare_render('/genomic/library/library_summary.mas',
136 # library => $clone->library_object)
137 # . '</td></tr></table>'