Skip to content

Commit

Permalink
Deprecate old Catalyst app. Start to rewrite in Dancer2.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Cross committed Oct 1, 2015
1 parent 3e78cf6 commit b89c848
Show file tree
Hide file tree
Showing 119 changed files with 1,932 additions and 3,182 deletions.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions Literature.cat/Makefile.PL
@@ -0,0 +1,21 @@
#!/usr/bin/env perl
# IMPORTANT: if you delete this file your app will not work as
# expected. You have been warned.
use inc::Module::Install;

name 'Literature';
all_from 'lib/Literature.pm';

requires 'Catalyst::Runtime' => '5.80013';
requires 'Catalyst::Plugin::ConfigLoader';
requires 'Catalyst::Plugin::Static::Simple';
requires 'Catalyst::Action::RenderView';
requires 'Catalyst::Plugin::StackTrace';
requires 'parent';
requires 'Config::General'; # This should reflect the config file format you've chosen
# See Catalyst::Plugin::ConfigLoader for supported formats
catalyst;

install_script glob('script/*.pl');
auto_install;
WriteAll;
File renamed without changes.
68 changes: 68 additions & 0 deletions Literature.cat/lib/Literature.pm
@@ -0,0 +1,68 @@
package Literature;

use strict;
use warnings;

use Catalyst::Runtime 5.80;

# Set flags and add plugins for the application
#
# -Debug: activates the debug mode for very useful log messages
# ConfigLoader: will load the configuration from a Config::General file in the
# application's home directory
# Static::Simple: will serve static files from the application's root
# directory

use parent qw/Catalyst/;
use Catalyst qw/
-Debug
ConfigLoader
Static::Simple
StackTrace
AutoCRUD
/;
our $VERSION = '0.01';

# Configure the application.
#
# Note that settings in literature.conf (or other external
# configuration file that you set up manually) take precedence
# over this when using ConfigLoader. Thus configuration
# details given here can function as a default configuration,
# with an external configuration file acting as an override for
# local deployment.

__PACKAGE__->config( name => 'Literature' );

# Start the application
__PACKAGE__->setup();


=head1 NAME
Literature - Catalyst based application
=head1 SYNOPSIS
script/literature_server.pl
=head1 DESCRIPTION
[enter your description here]
=head1 SEE ALSO
L<Literature::Controller::Root>, L<Catalyst>
=head1 AUTHOR
Dave Cross
=head1 LICENSE
This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut

1;
File renamed without changes.
19 changes: 19 additions & 0 deletions Literature.cat/lib/Literature/Schema.pm
@@ -0,0 +1,19 @@
package Literature::Schema;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use base 'DBIx::Class::Schema';

__PACKAGE__->load_namespaces;


# Created by DBIx::Class::Schema::Loader v0.07001 @ 2010-09-12 14:05:58
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TuzB0spCqLGoM61gRH1APQ


# You can replace this text with custom content, and it will be preserved on regeneration
1;
112 changes: 112 additions & 0 deletions Literature.cat/lib/Literature/Schema/Result/Actor.pm
@@ -0,0 +1,112 @@
package Literature::Schema::Result::Actor;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use base 'DBIx::Class::Core';

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 NAME
Literature::Schema::Result::Actor
=cut

__PACKAGE__->table("actor");

=head1 ACCESSORS
=head2 id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
=head2 name
data_type: 'varchar'
is_nullable: 0
size: 255
=head2 born
data_type: 'datetime'
datetime_undef_if_invalid: 1
is_nullable: 1
=head2 died
data_type: 'datetime'
datetime_undef_if_invalid: 1
is_nullable: 1
=head2 imdb
data_type: 'char'
is_nullable: 1
size: 15
=cut

__PACKAGE__->add_columns(
"id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"name",
{ data_type => "varchar", is_nullable => 0, size => 255 },
"born",
{
data_type => "datetime",
datetime_undef_if_invalid => 1,
is_nullable => 1,
},
"died",
{
data_type => "datetime",
datetime_undef_if_invalid => 1,
is_nullable => 1,
},
"imdb",
{ data_type => "char", is_nullable => 1, size => 15 },
);
__PACKAGE__->set_primary_key("id");

=head1 RELATIONS
=head2 actor_roles
Type: has_many
Related object: L<Literature::Schema::Result::ActorRole>
=cut

__PACKAGE__->has_many(
"actor_roles",
"Literature::Schema::Result::ActorRole",
{ "foreign.actor" => "self.id" },
{ cascade_copy => 0, cascade_delete => 0 },
);


# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:16:15
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Em+SljLhA9AucfhfRCwjkw



# You can replace this text with custom content, and it will be preserved on regeneration

sub display_name {
my $self = shift;
return $self->name || '';
}

1;



# You can replace this text with custom content, and it will be preserved on regeneration
1;
123 changes: 123 additions & 0 deletions Literature.cat/lib/Literature/Schema/Result/ActorRole.pm
@@ -0,0 +1,123 @@
package Literature::Schema::Result::ActorRole;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

use strict;
use warnings;

use base 'DBIx::Class::Core';

__PACKAGE__->load_components("InflateColumn::DateTime");

=head1 NAME
Literature::Schema::Result::ActorRole
=cut

__PACKAGE__->table("actor_role");

=head1 ACCESSORS
=head2 actor
data_type: 'integer'
is_foreign_key: 1
is_nullable: 0
=head2 production
data_type: 'integer'
is_foreign_key: 1
is_nullable: 0
=head2 fictional_character
data_type: 'integer'
is_foreign_key: 1
is_nullable: 0
=cut

__PACKAGE__->add_columns(
"actor",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
"production",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
"fictional_character",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
);
__PACKAGE__->set_primary_key("actor", "production", "fictional_character");

=head1 RELATIONS
=head2 actor
Type: belongs_to
Related object: L<Literature::Schema::Result::Actor>
=cut

__PACKAGE__->belongs_to(
"actor",
"Literature::Schema::Result::Actor",
{ id => "actor" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);

=head2 production
Type: belongs_to
Related object: L<Literature::Schema::Result::Production>
=cut

__PACKAGE__->belongs_to(
"production",
"Literature::Schema::Result::Production",
{ id => "production" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);

=head2 fictional_character
Type: belongs_to
Related object: L<Literature::Schema::Result::FictionalCharacter>
=cut

__PACKAGE__->belongs_to(
"fictional_character",
"Literature::Schema::Result::FictionalCharacter",
{ id => "fictional_character" },
{ is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);


# Created by DBIx::Class::Schema::Loader v0.07010 @ 2012-01-16 19:08:29
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ax7FCmo8QD+zTFfZ6v7mUA



# You can replace this text with custom content, and it will be preserved on regeneration

sub display_name {
my $self = shift;

return $self->actor->name . ' played ' .
$self->fictional_character->name . ' in ' .
$self->production->title . ' (' .
$self->production->made_by . ', ' .
$self->production->year . ')';
}

1;



# You can replace this text with custom content, and it will be preserved on regeneration
1;

0 comments on commit b89c848

Please sign in to comment.