Catalyst-View-Excel-Template-Plus-0.03000755000765000024 011365002747 16733 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/Build.PL000444000765000024 137111365002747 20366 0ustar00rbostaff000000000000use Module::Build; use strict; my $build = Module::Build->new( module_name => 'Catalyst::View::Excel::Template::Plus', license => 'perl', requires => { 'Catalyst::Runtime' => '0', 'Excel::Template::Plus' => '0.05', }, optional => { }, build_requires => { 'Test::More' => '0.62', 'Test::Exception' => '0.21', 'parent' => '0', }, create_makefile_pl => 'traditional', recursive_test_files => 1, add_to_cleanup => [ 'META.yml', '*.bak', '*.gz', 'Makefile.PL', ], meta_merge => { resources => { repository => 'http://github.com/stevan/catalyst-view-excel-template-plus/' } }, ); $build->create_build_script; Catalyst-View-Excel-Template-Plus-0.03/Changes000444000765000024 112711365002747 20364 0ustar00rbostaff000000000000Changes for Catalyst::View::Excel::Template::Plus # Date format "%A, %B %d, %Y" 0.03 Sunday, April 25, 2010 - Simple release from the developement release 0.02_2 0.02_2 Tuesday, April 20, 2010 - Last development release was shipped with an old Makefile.PL 0.02_1 Monday, April 19, 2010 - add missing build requirement 'parent' 0.02 Thursday, April 15, 2010 - fixed rt#53781 / NEXT deprecated - fixed rt#42166 / Auto determining template filename broken - Add helper class, Catalyst::Helper::View::Excel::Template::Plus 0.01 Monday, July 9, 2007 - initial releaseCatalyst-View-Excel-Template-Plus-0.03/MANIFEST000444000765000024 53011365002747 20177 0ustar00rbostaff000000000000Build.PL Changes lib/Catalyst/Helper/View/Excel/Template/Plus.pm lib/Catalyst/View/Excel/Template/Plus.pm Makefile.PL MANIFEST This list of files META.yml README t/000_load.t t/001_basic.t t/lib/TestApp.pm t/lib/TestApp/Controller/Root.pm t/lib/TestApp/View/Excel.pm t/pod.t t/pod_coverage.t t/templates/test_one.xml.tmpl t/xls/001_basic.xls Catalyst-View-Excel-Template-Plus-0.03/META.yml000444000765000024 153211365002747 20342 0ustar00rbostaff000000000000--- abstract: 'A Catalyst View for Excel::Template::Plus' author: - 'Stevan Little Estevan.little@iinteractive.comE' build_requires: Test::Exception: 0.21 Test::More: 0.62 parent: 0 configure_requires: Module::Build: 0.36 generated_by: 'Module::Build version 0.3607' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Catalyst-View-Excel-Template-Plus provides: Catalyst::Helper::View::Excel::Template::Plus: file: lib/Catalyst/Helper/View/Excel/Template/Plus.pm Catalyst::View::Excel::Template::Plus: file: lib/Catalyst/View/Excel/Template/Plus.pm version: 0.03 requires: Catalyst::Runtime: 0 Excel::Template::Plus: 0.05 resources: license: http://dev.perl.org/licenses/ repository: http://github.com/stevan/catalyst-view-excel-template-plus/ version: 0.03 Catalyst-View-Excel-Template-Plus-0.03/Makefile.PL000444000765000024 154211365002747 21044 0ustar00rbostaff000000000000# Note: this file was auto-generated by Module::Build::Compat version 0.3607 use ExtUtils::MakeMaker; WriteMakefile ( 'NAME' => 'Catalyst::View::Excel::Template::Plus', 'VERSION_FROM' => 'lib/Catalyst/View/Excel/Template/Plus.pm', 'PREREQ_PM' => { 'Catalyst::Runtime' => '0', 'Excel::Template::Plus' => '0.05', 'Test::Exception' => '0.21', 'Test::More' => '0.62', 'parent' => 0 }, 'INSTALLDIRS' => 'site', 'EXE_FILES' => [], 'PL_FILES' => {}, 'test' => { 'TESTS' => 't/*.t t/lib/*.t t/lib/TestApp/*.t t/lib/TestApp/Controller/*.t t/lib/TestApp/View/*.t t/templates/*.t t/xls/*.t' } ) ; Catalyst-View-Excel-Template-Plus-0.03/README000444000765000024 111411365002747 17745 0ustar00rbostaff000000000000Catalyst::View::Excel::Template::Plus version 0.01 =========================== See the individual module documentation for more information INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES This module requires these other modules and libraries: Catalyst::Runtime Excel::Template::Plus COPYRIGHT AND LICENCE Copyright (C) 2007 Infinity Interactive, Inc. http://www.iinteractive.com This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Catalyst-View-Excel-Template-Plus-0.03/lib000755000765000024 011365002747 17501 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/lib/Catalyst000755000765000024 011365002747 21265 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/lib/Catalyst/Helper000755000765000024 011365002747 22504 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/lib/Catalyst/Helper/View000755000765000024 011365002747 23416 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/lib/Catalyst/Helper/View/Excel000755000765000024 011365002747 24456 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/lib/Catalyst/Helper/View/Excel/Template000755000765000024 011365002747 26231 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/lib/Catalyst/Helper/View/Excel/Template/Plus.pm000444000765000024 217711365002747 27656 0ustar00rbostaff000000000000package Catalyst::Helper::View::Excel::Template::Plus; use strict; use warnings; use Carp qw/ croak /; =head1 NAME Catalyst::Helper::View::Excel::Template::Plus - Helper Class for Catalyst::View::Excel::Template::Plus =head1 SYNOPSIS MyApp_create.pl view Excel Excel::Template::Plus =head1 METHODS =head2 mk_compclass =cut sub mk_compclass { my ( $self, $helper ) = @_; $helper->render_file( 'compclass', $helper->{file} ); } =head1 AUTHOR Robert Bohne Erbo@cpan.orgE =head1 COPYRIGHT AND LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1; __DATA__ =begin pod_to_ignore __compclass__ package [% class %]; use strict; use warnings; use base qw/Catalyst::View::Excel::Template::Plus/; =head1 NAME [% class %] - Excel::Plus View for [% app %] =head1 SEE ALSO See L<[% app %]>. =head1 DESCRIPTION Catalyst Catalyst::View::Excel::Template::Plus View. =head1 AUTHOR [% author %] =head1 LICENSE This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L. =cut 1;Catalyst-View-Excel-Template-Plus-0.03/lib/Catalyst/View000755000765000024 011365002747 22177 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/lib/Catalyst/View/Excel000755000765000024 011365002747 23237 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/lib/Catalyst/View/Excel/Template000755000765000024 011365002747 25012 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/lib/Catalyst/View/Excel/Template/Plus.pm000444000765000024 654111365002747 26436 0ustar00rbostaff000000000000package Catalyst::View::Excel::Template::Plus; use strict; use warnings; use MRO::Compat; use Excel::Template::Plus; use Scalar::Util 'blessed'; use Catalyst::Exception; our $VERSION = '0.03'; our $AUTHORITY = 'cpan:STEVAN'; use base 'Catalyst::View'; __PACKAGE__->mk_accessors(qw[ etp_engine etp_config etp_params ]); sub new { my($class, $c, $args) = @_; my $self = $class->next::method($c, $args); my $config = $c->config->{'View::Excel::Template::Plus'}; $args->{etp_engine} ||= $config->{etp_engine} || 'TT'; $args->{etp_config} ||= $config->{etp_config} || {}; $args->{etp_params} ||= $config->{etp_params} || {}; $self->etp_engine($args->{etp_engine}); $self->etp_config($args->{etp_config}); $self->etp_params($args->{etp_params}); if ( defined $self->config->{TEMPLATE_EXTENSION} && $self->config->{TEMPLATE_EXTENSION} !~ /\./ ){ $c->log->warn(qq/Missing . (dot) in TEMPLATE_EXTENSION ( $class ), the attitude has changed with version 0.02./); } return $self; } sub process { my $self = shift; my $c = shift; my @args = @_; my $template = $self->get_template_filename($c); (defined $template) || die 'No template specified for rendering'; my $etp_engine = $c->stash->{etp_engine} || $self->etp_engine; my $etp_config = $c->stash->{etp_config} || $self->etp_config; my $etp_params = $c->stash->{etp_params} || $self->etp_params; my $excel = $self->create_template_object($c => ( engine => $etp_engine, template => $template, config => $etp_config, params => $etp_params, )); $excel->param( $self->get_template_params($c) ); $c->response->content_type('application/x-msexcel'); $c->response->body($excel->output); } sub create_template_object { my ($self, $c, %options) = @_; Excel::Template::Plus->new( %options ); } sub get_template_filename { my ($self, $c) = @_; $c->stash->{template} || ($c->action . '.xml' . $self->config->{TEMPLATE_EXTENSION}); } sub get_template_params { my ($self, $c) = @_; my $cvar = $self->config->{CATALYST_VAR} || 'c'; return ( $cvar => $c, %{ $c->stash } ); } 1; __END__ =pod =head1 NAME Catalyst::View::Excel::Template::Plus - A Catalyst View for Excel::Template::Plus =head1 SYNOPSIS # use the helper to create your View MyApp_create.pl view Excel Excel::Template::Plus =head1 DESCRIPTION This is a Catalyst View subclass which can handle rendering excel content through Excel::Template::Plus. =head1 CONFIG OPTIONS =over 4 =item I =item I =item I =back =head1 METHODS =over 4 =item B This really just handles consuming the configuration parameters. =item B =item B =item B =item B =back =head1 BUGS All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT. =head1 AUTHOR Stevan Little Estevan.little@iinteractive.comE =head1 CONTRIBUTORS Robert Bohne Erbo@cpan.orgE =head1 COPYRIGHT AND LICENSE Copyright 2007 by Infinity Interactive, Inc. L This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Catalyst-View-Excel-Template-Plus-0.03/t000755000765000024 011365002747 17176 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/t/000_load.t000444000765000024 21011365002747 20767 0ustar00rbostaff000000000000#!/usr/bin/perl use strict; use warnings; use Test::More no_plan => 1; BEGIN { use_ok('Catalyst::View::Excel::Template::Plus'); }Catalyst-View-Excel-Template-Plus-0.03/t/001_basic.t000444000765000024 176711365002747 21174 0ustar00rbostaff000000000000#!/usr/bin/perl use strict; use warnings; use FindBin; use File::Spec; use lib (File::Spec->catdir($FindBin::Bin, 'lib')); use Test::More tests => 6; use Catalyst::Test 'TestApp'; use Test::Excel::Template::Plus qw(cmp_excel_files); BEGIN { use_ok('Catalyst::View::Excel::Template::Plus'); } { my $response = request('http://localhost/test_one'); ok(defined $response, '... got the response successfully'); ok($response->is_success, '... response is a success'); is($response->code, 200, '... response code is 200'); is_deeply( [ $response->content_type ], [ 'application/x-msexcel' ], '... the response content type is application/x-msexcel'); my $excel = $response->content; open FOO, '>', 'temp.xls' || die "Could not write temp file for testing : $!"; print FOO $excel; close FOO; cmp_excel_files("temp.xls", "t/xls/001_basic.xls", '... the generated excel file was correct'); #`open temp.xls`; unlink 'temp.xls'; }Catalyst-View-Excel-Template-Plus-0.03/t/pod.t000444000765000024 25711365002747 20266 0ustar00rbostaff000000000000#!/usr/bin/perl use strict; use warnings; use Test::More; eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; all_pod_files_ok(); Catalyst-View-Excel-Template-Plus-0.03/t/pod_coverage.t000444000765000024 31711365002747 22136 0ustar00rbostaff000000000000#!/usr/bin/perl use strict; use warnings; use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; all_pod_coverage_ok(); Catalyst-View-Excel-Template-Plus-0.03/t/lib000755000765000024 011365002747 17744 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/t/lib/TestApp.pm000444000765000024 64611365002747 22005 0ustar00rbostaff000000000000package TestApp; use strict; use warnings; use FindBin; use Catalyst; use Excel::Template::Plus; use Path::Class; use TestApp::View::Excel; __PACKAGE__->config({ name => 'TestApp', 'View::Excel::Template::Plus' => { etp_config => { INCLUDE_PATH => [ (dir($FindBin::Bin, 'templates' )->stringify . '/'), ] } } }); __PACKAGE__->setup; 1; __END__ Catalyst-View-Excel-Template-Plus-0.03/t/lib/TestApp000755000765000024 011365002747 21324 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/t/lib/TestApp/Controller000755000765000024 011365002747 23447 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/t/lib/TestApp/Controller/Root.pm000444000765000024 44711365002747 25052 0ustar00rbostaff000000000000package TestApp::Controller::Root; use strict; use warnings; use parent 'Catalyst::Controller'; sub test_one : Global { my ($self, $c) = @_; $c->stash->{template} = 'test_one.xml.tmpl'; $c->stash->{message} = 'Hello (Excel) World'; $c->forward('TestApp::View::Excel'); } 1;Catalyst-View-Excel-Template-Plus-0.03/t/lib/TestApp/View000755000765000024 011365002747 22236 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/t/lib/TestApp/View/Excel.pm000444000765000024 17111365002747 23750 0ustar00rbostaff000000000000package TestApp::View::Excel; use strict; use warnings; use base 'Catalyst::View::Excel::Template::Plus'; 1; __END__ Catalyst-View-Excel-Template-Plus-0.03/t/templates000755000765000024 011365002747 21174 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/t/templates/test_one.xml.tmpl000444000765000024 17311365002747 24627 0ustar00rbostaff000000000000 [% message %] Catalyst-View-Excel-Template-Plus-0.03/t/xls000755000765000024 011365002747 20004 5ustar00rbostaff000000000000Catalyst-View-Excel-Template-Plus-0.03/t/xls/001_basic.xls000444000765000024 1300011365002747 22344 0ustar00rbostaff000000000000ࡱ>   AB=\508X"1Arial1Arial1Arial1Arial1Tahoma1 Arial                + ) , *     83ffff̙̙3f3fff3f3f33333f33333\Sheet11Hello (Excel) World  A*+%&?'?(?)?"dXX??U >@ Root EntryWorkbook