Added:
/trunk/server/Changes
/trunk/server/Makefile.PL
/trunk/server/README
/trunk/server/lib/SysFink/Web
/trunk/server/lib/SysFink/Web/Controller
/trunk/server/lib/SysFink/Web/Controller/Root.pm
/trunk/server/lib/SysFink/Web/Controller/Table.pm
/trunk/server/lib/SysFink/Web/Controller/Test.pm
/trunk/server/lib/SysFink/Web/ControllerBase.pm
/trunk/server/lib/SysFink/Web/Model
/trunk/server/lib/SysFink/Web/Model/WebDB.pm
/trunk/server/lib/SysFink/Web/View
/trunk/server/lib/SysFink/Web/View/JSON.pm
/trunk/server/lib/SysFink/Web/View/TT.pm
/trunk/server/lib/SysFink/Web.pm
/trunk/server/root
/trunk/server/root/css
/trunk/server/root/css/base.css
/trunk/server/root/favicon.ico
/trunk/server/root/img
/trunk/server/root/lib
/trunk/server/root/lib/config
/trunk/server/root/lib/config/main
/trunk/server/root/lib/config/main.example
/trunk/server/root/lib/config/url
/trunk/server/root/lib/site
/trunk/server/root/lib/site/html
/trunk/server/root/lib/site/wrapper
/trunk/server/root/robots.txt
/trunk/server/root/src
/trunk/server/root/src/error.tt2
/trunk/server/root/src/index.tt2
/trunk/server/root/src/table
/trunk/server/root/src/table/data.tt2
/trunk/server/root/src/table/index.tt2
/trunk/server/root/src/test
/trunk/server/root/src/test/index.tt2
/trunk/server/root/static
/trunk/server/script
/trunk/server/script/sysfink_web_cgi.pl
/trunk/server/script/sysfink_web_create.pl
/trunk/server/script/sysfink_web_fastcgi.pl
/trunk/server/script/sysfink_web_server.pl
/trunk/server/script/sysfink_web_test.pl
/trunk/server/t/web
/trunk/server/t/web/01app.t
/trunk/server/t/web/02pod.t
/trunk/server/t/web/03podcoverage.t
/trunk/server/utils/start-server-dev.sh
Modified:
/trunk/server/t/harness.pl
/trunk/server/utils/test-new.sh
=======================================
--- /dev/null
+++ /trunk/server/Changes Wed Jan 20 07:40:19 2010
@@ -0,0 +1,4 @@
+This file documents the revision history for Perl extension SysFink::Web.
+
+0.01 2010-01-20 14:17:28
+ - initial revision, generated by Catalyst
=======================================
--- /dev/null
+++ /trunk/server/Makefile.PL Wed Jan 20 07:40:19 2010
@@ -0,0 +1,20 @@
+#!/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 'SysFink-Web';
+all_from 'lib/SysFink/Web.pm';
+
+requires 'Catalyst::Runtime' => '5.80014';
+requires 'Catalyst::Plugin::ConfigLoader';
+requires 'Catalyst::Plugin::Static::Simple';
+requires 'Catalyst::Action::RenderView';
+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;
=======================================
--- /dev/null
+++ /trunk/server/README Wed Jan 20 07:40:19 2010
@@ -0,0 +1,1 @@
+Run script/sysfink_web_server.pl to test the application.
=======================================
--- /dev/null
+++ /trunk/server/lib/SysFink/Web/Controller/Root.pm Wed Jan 20 07:40:19
2010
@@ -0,0 +1,59 @@
+package SysFink::Web::Controller::Root;
+
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+
+
+# Sets the actions in this controller to be registered with no prefix
+# so they function identically to actions created in Web.pm
+
+__PACKAGE__->config->{namespace} = '';
+
+=head1 NAME
+
+SysFink::Web::Controller::Root - Root Controller for SysFink::Web
+
+=head1 DESCRIPTION
+
+SysFink root path action.
+
+=head1 METHODS
+
+=cut
+
+=head2 default
+
+=cut
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+
+ $c->stash->{template} = 'index.tt2';
+}
+
+=head2 end
+
+Attempt to render a view, if needed.
+
+=cut
+
+sub end : ActionClass('RenderView') {}
+
+
+=head1 SEE ALSO
+
+L<SysFink::Web>, L<Catalyst::Controller>
+
+=head1 AUTHOR
+
+Michal Jurosz <m...@mj41.cz>
+
+=head1 LICENSE
+
+This file is part of SysFink. See L<SysFink> license.
+
+=cut
+
+
+1;
=======================================
--- /dev/null
+++ /trunk/server/lib/SysFink/Web/Controller/Table.pm Wed Jan 20 07:40:19
2010
@@ -0,0 +1,56 @@
+package SysFink::Web::Controller::Table;
+
+use strict;
+use warnings;
+use base 'CatalystX::Controller::TableBrowser';
+
+=head1 NAME
+
+SysFink::Web::Controller::Table - Catalyst Controller
+
+=head1 DESCRIPTION
+
+Catalyst Controller for SysFink simple table browsing.
+
+=head1 METHODS
+
+=cut
+
+
+sub db_schema_base_class_name {
+ return 'WebDB';
+}
+
+sub db_schema_class_name {
+ return 'SysFink::Web::Model::WebDB';
+}
+
+
+=head2 index
+
+Base table browser action.
+
+=cut
+
+sub index : Path {
+ my $self = shift;
+ return $self->base_index( @_ );
+}
+
+
+=head1 SEE ALSO
+
+L<SysFink::Web>, L<Catalyst::Controller>
+
+=head1 AUTHOR
+
+Michal Jurosz <m...@mj41.cz>
+
+=head1 LICENSE
+
+This file is part of SysFink. See L<SysFink> license.
+
+=cut
+
+
+1;
=======================================
--- /dev/null
+++ /trunk/server/lib/SysFink/Web/Controller/Test.pm Wed Jan 20 07:40:19
2010
@@ -0,0 +1,47 @@
+package SysFink::Web::Controller::Test;
+
+use strict;
+use warnings;
+use base 'SysFink::Web::ControllerBase';
+
+=head1 NAME
+
+SysFink::Web::Controller::Test - Catalyst Controller
+
+=head1 DESCRIPTION
+
+Catalyst Controller for SysFink Web developing.
+
+=head1 METHODS
+
+=cut
+
+=head2 index
+
+Base action.
+
+=cut
+
+sub index : Path {
+ my ( $self, $c, $params, @args ) = @_;
+
+ $self->dumper( $c, $c->config );
+ }
+
+
+=head1 SEE ALSO
+
+L<SysFink::Web>, L<Catalyst::Controller>
+
+=head1 AUTHOR
+
+Michal Jurosz <m...@mj41.cz>
+
+=head1 LICENSE
+
+This file is part of SysFink. See L<SysFink> license.
+
+=cut
+
+
+1;
=======================================
--- /dev/null
+++ /trunk/server/lib/SysFink/Web/ControllerBase.pm Wed Jan 20 07:40:19 2010
@@ -0,0 +1,65 @@
+package SysFink::Web::ControllerBase;
+
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+
+use Data::Page::HTML qw();
+use DBIx::Dumper qw();
+use Data::Dumper qw();
+
+=head1 NAME
+
+SysFink::Web::Controller::Report - Catalyst Controller
+
+=head1 DESCRIPTION
+
+Base class for some SysFink::Web::Controller::*.
+
+=head1 METHODS
+
+=cut
+
+sub dadd {
+ my $self = shift;
+ my $c = shift;
+ my $str = shift;
+ $c->stash->{ot} .= $str;
+}
+
+
+sub dumper {
+ my $self = shift;
+ my $c = shift;
+
+ return unless $c->log->is_debug;
+
+ foreach my $val ( @_ ) {
+ my $var_type = ref($val);
+ if ( $var_type =~ /^SysFink\:\:Web\:\:Model/ ) {
+ $c->stash->{ot} .= "dump_row:\n";
+ $c->stash->{ot} .= DBIx::Dumper::dump_row( $val );
+ } else {
+ #$c->stash->{ot} .= "normal dumper: \n";
+ $c->stash->{ot} .= Data::Dumper::Dumper( $val );
+ }
+ }
+}
+
+
+=head1 SEE ALSO
+
+L<SysFink::Web>, L<Catalyst::Controller>
+
+=head1 AUTHOR
+
+Michal Jurosz <m...@mj41.cz>
+
+=head1 LICENSE
+
+This file is part of SysFink. See L<SysFink> license.
+
+=cut
+
+
+1;
=======================================
--- /dev/null
+++ /trunk/server/lib/SysFink/Web/Model/WebDB.pm Wed Jan 20 07:40:19 2010
@@ -0,0 +1,18 @@
+package SysFink::Web::Model::WebDB;
+
+use strict;
+use warnings;
+use base 'Catalyst::Model::DBIC::Schema';
+
+__PACKAGE__->config(
+ schema_class => 'SysFink::DB::SchemaAdd',
+ connect_info => [
+ SysFink::Web->config->{db}->{dbi_dsn},
+ SysFink::Web->config->{db}->{user},
+ SysFink::Web->config->{db}->{pass},
+ { AutoCommit => 1 },
+ ],
+);
+
+
+1;
=======================================
--- /dev/null
+++ /trunk/server/lib/SysFink/Web/View/JSON.pm Wed Jan 20 07:40:19 2010
@@ -0,0 +1,37 @@
+package SysFink::Web::View::JSON;
+
+use base 'Catalyst::View::JSON';
+use strict;
+
+=head1 NAME
+
+SysFink::Web::View::JSON - SysFink JSON Site View
+
+=head1 SYNOPSIS
+
+See L<SysFink::Web>
+
+=head1 DESCRIPTION
+
+SysFink JSON Site View.
+
+=cut
+
+__PACKAGE__->config({
+ #allow_callback => 1, # defaults to 0
+ #callback_param => 'cb', # defaults to 'callback'
+ expose_stash => [ qw(data ot) ], # defaults to everything
+ #no_x_json_header => 1,
+});
+
+=head1 AUTHOR
+
+Michal Jurosz <m...@mj41.cz>
+
+=head1 LICENSE
+
+This file is part of SysFink. See L<SysFink> license.
+
+=cut
+
+1;
=======================================
--- /dev/null
+++ /trunk/server/lib/SysFink/Web/View/TT.pm Wed Jan 20 07:40:19 2010
@@ -0,0 +1,44 @@
+package SysFink::Web::View::TT;
+
+use base 'Catalyst::View::TT';
+use strict;
+
+=head1 NAME
+
+SysFink::Web::View::TT - SysFink TT (TemplateToolkit) Site View
+
+=head1 SYNOPSIS
+
+See L<SysFink::Web>
+
+=head1 DESCRIPTION
+
+SysFink TT Site View.
+
+=cut
+
+__PACKAGE__->config({
+ CATALYST_VAR => 'c',
+ INCLUDE_PATH => [
+ SysFink::Web->path_to( 'root', 'src' ),
+ SysFink::Web->path_to( 'root', 'lib' )
+ ],
+ PRE_PROCESS => 'config/main',
+ WRAPPER => 'site/wrapper',
+ ERROR => 'error.tt2',
+ TIMER => 0,
+ TEMPLATE_EXTENSION => '.tt2',
+ #COMPILE_DIR => '/tmp/SysFink/cache',
+});
+
+=head1 AUTHOR
+
+Michal Jurosz <m...@mj41.cz>
+
+=head1 LICENSE
+
+This file is part of SysFink. See L<SysFink> license.
+
+=cut
+
+1;
=======================================
--- /dev/null
+++ /trunk/server/lib/SysFink/Web.pm Wed Jan 20 07:40:19 2010
@@ -0,0 +1,79 @@
+package SysFink::Web;
+
+use strict;
+use warnings;
+
+use lib 'libext';
+
+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/
+ StackTrace
+ ConfigLoader
+ Static::Simple
+/;
+our $VERSION = '0.01';
+
+# Configure the application.
+#
+# Note that settings in sysfink_web.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.
+
+SysFink::Web->config(
+ 'name' => 'SysFink::Web',
+ 'default_view' => 'TT',
+ 'Plugin::ConfigLoader' => { file => 'conf/sysfink.conf', },
+ 'static' => {
+ #logging => 1,
+ #debug => 1,
+ mime_types => {
+ t => 'text/plain', # Show test files, as text plain. BY mime
type it si 'application/x-troff'.
+ },
+ },
+);
+
+# Start the application
+__PACKAGE__->setup();
+
+
+=head1 NAME
+
+SysFink::Web - Catalyst based application
+
+=head1 SYNOPSIS
+
+ script/sysfink_web_server.pl
+
+=head1 DESCRIPTION
+
+[enter your description here]
+
+=head1 SEE ALSO
+
+L<SysFink::Web::Controller::Root>, L<Catalyst>
+
+=head1 AUTHOR
+
+root
+
+=head1 LICENSE
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+1;
=======================================
--- /dev/null
+++ /trunk/server/root/css/base.css Wed Jan 20 07:40:19 2010
@@ -0,0 +1,255 @@
+body {
+ margin: 0.5em;
+ padding: 0;
+ font-family: tahoma, arial, helvetica, geneva, sans-serif;
+ color: #000000;
+ background-color: #f5f5f5;
+ font-size: 90%; /* TODO */
+}
+
+h1 {
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h2 {
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h3 {
+ font-weight: bold;
+}
+
+a:link {
+ text-decoration: none;
+ color: #0000FF;
+}
+
+a:visited {
+ text-decoration: none;
+ color: #0000FF;
+}
+
+a:hover {
+ text-decoration: underline;
+ color: #FF0000;
+}
+
+th {
+ font-weight: bold;
+ color: #000000;
+ background-color: #D3DCE3;
+}
+
+hr {
+ color: #666666;
+ background-color: #666666;
+ border: 0;
+ height: 1px;
+}
+
+form {
+ padding: 0;
+ margin: 0;
+ display: inline;
+}
+
+textarea {
+ overflow: visible;
+ height: 8em;
+}
+
+fieldset {
+ margin-top: 1em;
+ border: #686868 solid 1px;
+ padding: 0.5em;
+ background-color: #E5E5E5;
+}
+
+fieldset fieldset {
+ margin: 0.8em;
+}
+
+fieldset legend {
+ background-color: transparent;
+}
+
+/* buttons in some browsers (eg. Konqueror) are block elements,
+ this breaks design */
+button {
+ display: inline;
+}
+
+table caption,
+table th,
+table td {
+ padding: 0.1em 0.5em 0.1em 0.5em;
+ margin: 0.1em;
+ vertical-align: top;
+}
+
+.red {
+ color: red;
+}
+
+img,
+input,
+select,
+button {
+ vertical-align: middle;
+}
+
+/* even table rows 2,4,6,8,... */
+table tr.even th,
+table tr.even {
+ background-color: #E5E5E5;
+ text-align: left;
+}
+
+/* odd table rows 1,3,5,7,... */
+table tr.odd th,
+table tr.odd {
+ background-color: #D5D5D5;
+ text-align: left;
+}
+
+table tr.even_err th,
+table tr.even_err {
+ background-color: #ffddd3;
+ text-align: left;
+}
+
+table tr.odd_err th,
+table tr.odd_err {
+ background-color: #ffcaba;
+ text-align: left;
+}
+
+/* marked tbale rows */
+table tr.marked th,
+table tr.marked {
+ background-color: #FFCC99;
+}
+
+table td.ok,
+table td.ok a {
+ color: green;
+}
+
+table td.err,
+table td.err a {
+ font-family: "Courier New", Courier, monospace;
+ color: red;
+ font-weight: bold;
+}
+
+table tr.even td.ok {
+ background-color: #c4ecc3;
+}
+
+table tr.odd td.ok {
+ background-color: #a7eca6;
+}
+
+table tr.even td.err,
+table tr.even_err td.err {
+ background-color: #ffddd3;
+}
+
+table tr.odd td.err,
+table tr.odd_err td.err {
+ background-color: #ffcaba;
+}
+
+table tr.odd:hover,
+table tr.odd:hover th,
+table tr.hover th,
+table tr.odd:hover td,
+table tr.odd_err:hover td,
+table tr.hover {
+ background-color: #fffcb2;
+}
+
+table tr.even:hover,
+table tr.even:hover th,
+table tr.even:hover td ,
+table tr.even_err:hover td {
+ background-color: #fffdcd;
+}
+
+.tblHeader {
+ background-color: #D0DCE0;
+ font-weight: bold;
+ color: #000000;
+}
+
+table.data {
+ margin: 3px 0;
+}
+
+.error_bar {
+ color: red;
+ font-weight: bold;
+ margin: 10px 0 20px 0;
+}
+
+.pages {
+ margin: 0 1em;
+ padding: 10px 0;
+ font-weight: bold;
+}
+.pages span.text {
+ margin-right: 1em;
+}
+.pages a, .pages span.a, .pages .a-arrow {
+ margin: 2px;
+ padding: 3px 5px;
+ border: 1px solid #5a84ae;
+}
+.pages a.arrow, .pages span.a-arrow {
+ margin: 0 1em;
+ padding: 0px 5px 1px 5px;
+}
+.pages span.a-arrow {
+ color: grey;
+ background-color: #F5F5F5;
+ border-color: grey;
+}
+
+.pages a:hover {
+ color: black;
+ background-color: #d0dce0;
+ border-color: #024082;
+ text-decoration: none;
+}
+.pages .selected {
+ color: white;
+ background-color: #5a84ae;
+}
+
+ul.menu li {
+ margin: 0.5em;
+}
+
+#footer {
+ border-top: 1px solid #d3dce3;
+ border-bottom: 1px solid #d3dce3;
+ margin: 1.5em 0px 1em 0px;
+ padding: 0.3em 1em 0.25em 1em;
+ text-align: right;
+ font-size: 90%;
+}
+
+.nav {
+ margin: 0.8em 0;
+}
+
+.footinfo {
+ margin: 0.5em 0 0.5em 0;
+}
+
+h1.table, h2.table, h3.table {
+ margin: 0;
+ padding: 0;
+}
=======================================
--- /dev/null
+++ /trunk/server/root/favicon.ico Wed Jan 20 07:40:19 2010
Binary file, no diff available.
=======================================
--- /dev/null
+++ /trunk/server/root/lib/config/main Wed Jan 20 07:40:19 2010
@@ -0,0 +1,27 @@
+[% # config/main
+ #
+ # This is the main configuration template which is processed before
+ # any other page, by virtue of it being defined as a PRE_PROCESS
+ # template. This is the place to define any extra template variables,
+ # macros, load plugins, and perform any other template setup.
+
+ IF c.debug;
+ # define a debug() macro directed to Catalyst's log
+ MACRO debug(message) CALL c.log.debug(message);
+ END;
+
+ # define a data structure to hold sitewide data
+ site = {
+ title => 'SysFink web',
+ poweredby => 'Powered by <a
href="http://sysfink.mj41.cz/">SysFink</a>.',
+ before_body_end =>'',
+ };
+
+ # load up any other configuration items
+ PROCESS config/url;
+
+ # set defaults for variables, etc.
+ DEFAULT
+ message = 'There is no message';
+
+-%]
=======================================
--- /dev/null
+++ /trunk/server/root/lib/config/main.example Wed Jan 20 07:40:19 2010
@@ -0,0 +1,27 @@
+[% # config/main
+ #
+ # This is the main configuration template which is processed before
+ # any other page, by virtue of it being defined as a PRE_PROCESS
+ # template. This is the place to define any extra template variables,
+ # macros, load plugins, and perform any other template setup.
+
+ IF c.debug;
+ # define a debug() macro directed to Catalyst's log
+ MACRO debug(message) CALL c.log.debug(message);
+ END;
+
+ # define a data structure to hold sitewide data
+ site = {
+ title => 'My TapTinder reports',
+ poweredby => 'Powered by <a
href="http://taptinder.org/">TapTinder</a>.',
+ before_body_end => '', # Google Analytics javascript
+ };
+
+ # load up any other configuration items
+ PROCESS config/url;
+
+ # set defaults for variables, etc.
+ DEFAULT
+ message = 'There is no message';
+
+-%]
=======================================
--- /dev/null
+++ /trunk/server/root/lib/config/url Wed Jan 20 07:40:19 2010
@@ -0,0 +1,11 @@
+[% base = c.req.base;
+
+ site.url = {
+ base = base
+ home = "${base}"
+ }
+
+ site.r_url = {
+ base = '/'
+ }
+-%]
=======================================
--- /dev/null
+++ /trunk/server/root/lib/site/html Wed Jan 20 07:40:19 2010
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
dir="ltr">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso8859-1" />
+ <title>[% IF title %][% title %] - [% END %][% IF title !=
site.title %][% site.title %][% END %]</title>
+ <link rel="shortcut icon" href="[%+ site.r_url.base %]favicon.ico" />
+ <link rel="stylesheet" type="text/css" href="[%+
site.r_url.base %]css/base.css" />
+</head>
+<body>
+<h1 class="title">[% title or site.title %]</h1>
+[% IF error %]
+<div class="error_bar">
+<ul>
+<li><div class=error>[% error %]</div></li>
+</ul>
+</div>
+[% END -%]
+[% content %]
+[% IF c.debug && ot # TODO %]
+<pre>[% ot | html %]</pre>
+[% END %]
+<div id="footer">[% site.poweredby %]</div>
+[% site.before_body_end %]
+</body>
+</html>
=======================================
--- /dev/null
+++ /trunk/server/root/lib/site/wrapper Wed Jan 20 07:40:19 2010
@@ -0,0 +1,8 @@
+[% IF template.name.match('\.(css|js|txt)');
+ debug("Passing page through as text: $template.name");
+ content;
+ ELSE;
+ debug("Applying HTML page layout wrappers to $template.name\n");
+ content WRAPPER site/html;
+ END;
+-%]
=======================================
--- /dev/null
+++ /trunk/server/root/robots.txt Wed Jan 20 07:40:19 2010
@@ -0,0 +1,2 @@
+User-agent: *
+Disallow: /
=======================================
--- /dev/null
+++ /trunk/server/root/src/error.tt2 Wed Jan 20 07:40:19 2010
@@ -0,0 +1,14 @@
+[% META title = 'TapTinder Catalyst/TT Error' %]
+<p>
+ An error has occurred. We're terribly sorry about that, but it's
+ one of those things that happens from time to time. Let's just
+ hope the developers test everything properly before release...
+</p>
+<p>
+ Here's the error message, on the off-chance that it means something
+ to you: <span class="error">[% error %]</span>
+</p>
+<p>
+ Try to send useful report to <a
href="mailto:sys...@mj41.cz">sys...@mj41.cz</a>
+ or patch to <a
href="http://code.google.com/p/sysfink/">code.google.com/p/sysfink/</a> .
Thank you.
+</p>
=======================================
--- /dev/null
+++ /trunk/server/root/src/index.tt2 Wed Jan 20 07:40:19 2010
@@ -0,0 +1,10 @@
+<h2>Bookmarks:</h2>
+<ul class=menu>
+<li><a href="/diff">Diffs</a></li>
+</ul>
+
+<h2>Browsing:</h2>
+<ul class=menu>
+<li><a href="/table">Table browser</a></li>
+</ul>
+
=======================================
--- /dev/null
+++ /trunk/server/root/src/table/data.tt2 Wed Jan 20 07:40:19 2010
@@ -0,0 +1,58 @@
+[% DEFAULT title = 'Table: ' _ table_name -%]
+
+<div class=nav><a href="javascript:history.back();">Back</a>, <a href="[%
c.uri_for('/') %]">homepage</a> or <a href="[% index_uri %]">list of
tables</a>.</div>
+
+<table class=data>
+<tr>
+[% FOREACH col_title IN col_titles -%]
+ <th>[% col_title -%]</th>
+[% END -%]
+</tr>
+[% IF data_error %]
+ <tr class=even><td colspan=[% col_titles.size() %]>[%
data_error %]</td></tr>
+[% ELSE %]
+ [% FOREACH row IN rows -%]
+ <tr class="[% IF loop.count() % 2 %]even[% ELSE %]odd[% END %][%
IF row.selected %] marked[% END %]">
+ [% FOREACH col_name IN col_names -%]
+ [% full_col_name = 'me_' _ col_name %]
+ [% IF row.data.$full_col_name != undef %]
+ <td>
+ [% IF rels.out.$col_name.0 -%]
+ <a href="[% uri_for_related( 'out',
rels.out.$col_name, row.data.$full_col_name ) %]">[% data_for_related(
col_name, row.data ) %]</a>
+ [% ELSE -%]
+ [% row.data.$full_col_name | html %]
+ [% END -%]
+ </td>
+ [% ELSE -%]
+ <td> </td>
+ [% END -%]
+ [% END -%]
+ </tr>
+ [% END -%]
+[% END -%]
+
+</table>
+
+[% pager_html %]
+
+[% IF rels.in -%]
+Links here:
+ [% num = 0 %]
+ [% FOREACH rel = rels.in %]
+ [%- IF num != 0 %],
+ [%- IF num % 5 == 0 %]<br />[% END %]
+ [% END %]
+ <a href="[% uri_for_related( 'in', rel ) %]">[% rel.1 _ '.' _ rel.2 |
html %]</a>
+ [%- num = num + 1 -%]
+ [%- END -%]
+[% END %]
+
+[% IF msgs %]
+<div class=messages>
+<ul>
+[% FOREACH msg IN msgs -%]
+<li>[% msg %]</li>
+[% END -%]
+</ul>
+</div>
+[% END -%]
=======================================
--- /dev/null
+++ /trunk/server/root/src/table/index.tt2 Wed Jan 20 07:40:19 2010
@@ -0,0 +1,15 @@
+[% DEFAULT title = 'Table browser' -%]
+
+<div class=nav><a href="javascript:history.back();">Back</a> or <a
href="[% c.uri_for('/') %]">homepage</a>.</div>
+
+<table class=data>
+<tr>
+<th> </th><th>Table</th>
+</tr>
+[% FOREACH table IN tables -%]
+ <tr class="[% IF loop.count() % 2 %]even[% ELSE %]odd[% END %]">
+ <td align=right>[% loop.count() %]</td>
+ <td><a href="[% table.uri %]">[% table.name | html %]</a></td>
+ </tr>
+[% END -%]
+</table>
=======================================
--- /dev/null
+++ /trunk/server/root/src/test/index.tt2 Wed Jan 20 07:40:19 2010
@@ -0,0 +1,4 @@
+[% DEFAULT title = 'Test' -%]
+
+<div class=nav><a href="javascript:history.back();">Back</a> or <a
href="[% c.uri_for('/') %]">homepage</a>.</div>
+
=======================================
--- /dev/null
+++ /trunk/server/script/sysfink_web_cgi.pl Wed Jan 20 07:40:19 2010
@@ -0,0 +1,37 @@
+#!/usr/bin/env perl
+
+BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
+
+use strict;
+use warnings;
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+use SysFink::Web;
+
+SysFink::Web->run;
+
+1;
+
+=head1 NAME
+
+sysfink_web_cgi.pl - Catalyst CGI
+
+=head1 SYNOPSIS
+
+See L<Catalyst::Manual>
+
+=head1 DESCRIPTION
+
+Run a Catalyst application as a cgi script.
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
=======================================
--- /dev/null
+++ /trunk/server/script/sysfink_web_create.pl Wed Jan 20 07:40:19 2010
@@ -0,0 +1,85 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use Getopt::Long;
+use Pod::Usage;
+eval "use Catalyst::Helper;";
+
+if ($@) {
+ die <<END;
+To use the Catalyst development tools including catalyst.pl and the
+generated script/myapp_create.pl you need Catalyst::Helper, which is
+part of the Catalyst-Devel distribution. Please install this via a
+vendor package or by running one of -
+
+ perl -MCPAN -e 'install Catalyst::Devel'
+ perl -MCPANPLUS -e 'install Catalyst::Devel'
+END
+}
+
+my $force = 0;
+my $mech = 0;
+my $help = 0;
+
+GetOptions(
+ 'nonew|force' => \$force,
+ 'mech|mechanize' => \$mech,
+ 'help|?' => \$help
+ );
+
+pod2usage(1) if ( $help || !$ARGV[0] );
+
+my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech =>
$mech } );
+
+pod2usage(1) unless $helper->mk_component( 'SysFink::Web', @ARGV );
+
+1;
+
+=head1 NAME
+
+sysfink_web_create.pl - Create a new Catalyst Component
+
+=head1 SYNOPSIS
+
+sysfink_web_create.pl [options] model|view|controller name [helper]
[options]
+
+ Options:
+ -force don't create a .new file where a file to be created exists
+ -mechanize use Test::WWW::Mechanize::Catalyst for tests if available
+ -help display this help and exits
+
+ Examples:
+ sysfink_web_create.pl controller My::Controller
+ sysfink_web_create.pl -mechanize controller My::Controller
+ sysfink_web_create.pl view My::View
+ sysfink_web_create.pl view MyView TT
+ sysfink_web_create.pl view TT TT
+ sysfink_web_create.pl model My::Model
+ sysfink_web_create.pl model SomeDB DBIC::Schema MyApp::Schema
create=dynamic\
+ dbi:SQLite:/tmp/my.db
+ sysfink_web_create.pl model AnotherDB DBIC::Schema MyApp::Schema
create=static\
+ dbi:Pg:dbname=foo root 4321
+
+ See also:
+ perldoc Catalyst::Manual
+ perldoc Catalyst::Manual::Intro
+
+=head1 DESCRIPTION
+
+Create a new Catalyst Component.
+
+Existing component files are not overwritten. If any of the component
files
+to be created already exist the file will be written with a '.new' suffix.
+This behavior can be suppressed with the C<-force> option.
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
=======================================
--- /dev/null
+++ /trunk/server/script/sysfink_web_fastcgi.pl Wed Jan 20 07:40:19 2010
@@ -0,0 +1,79 @@
+#!/usr/bin/env perl
+
+BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' }
+
+use strict;
+use warnings;
+use Getopt::Long;
+use Pod::Usage;
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+use SysFink::Web;
+
+my $help = 0;
+my ( $listen, $nproc, $pidfile, $manager, $detach, $keep_stderr );
+
+GetOptions(
+ 'help|?' => \$help,
+ 'listen|l=s' => \$listen,
+ 'nproc|n=i' => \$nproc,
+ 'pidfile|p=s' => \$pidfile,
+ 'manager|M=s' => \$manager,
+ 'daemon|d' => \$detach,
+ 'keeperr|e' => \$keep_stderr,
+);
+
+pod2usage(1) if $help;
+
+SysFink::Web->run(
+ $listen,
+ { nproc => $nproc,
+ pidfile => $pidfile,
+ manager => $manager,
+ detach => $detach,
+ keep_stderr => $keep_stderr,
+ }
+);
+
+1;
+
+=head1 NAME
+
+sysfink_web_fastcgi.pl - Catalyst FastCGI
+
+=head1 SYNOPSIS
+
+sysfink_web_fastcgi.pl [options]
+
+ Options:
+ -? -help display this help and exits
+ -l -listen Socket path to listen on
+ (defaults to standard input)
+ can be HOST:PORT, :PORT or a
+ filesystem path
+ -n -nproc specify number of processes to keep
+ to serve requests (defaults to 1,
+ requires -listen)
+ -p -pidfile specify filename for pid file
+ (requires -listen)
+ -d -daemon daemonize (requires -listen)
+ -M -manager specify alternate process manager
+ (FCGI::ProcManager sub-class)
+ or empty string to disable
+ -e -keeperr send error messages to STDOUT, not
+ to the webserver
+
+=head1 DESCRIPTION
+
+Run a Catalyst application as fastcgi.
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
=======================================
--- /dev/null
+++ /trunk/server/script/sysfink_web_server.pl Wed Jan 20 07:40:19 2010
@@ -0,0 +1,160 @@
+#!/usr/bin/env perl
+
+BEGIN {
+ $ENV{CATALYST_ENGINE} ||= 'HTTP';
+ $ENV{CATALYST_SCRIPT_GEN} = 39;
+ require Catalyst::Engine::HTTP;
+}
+
+use strict;
+use warnings;
+use Getopt::Long;
+use Pod::Usage;
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+
+my $debug = 0;
+my $fork = 0;
+my $help = 0;
+my $host = undef;
+my $port = $ENV{SYSFINK_WEB_PORT} || $ENV{CATALYST_PORT} ||
3000;
+my $keepalive = 0;
+my $restart = $ENV{SYSFINK_WEB_RELOAD} || $ENV{CATALYST_RELOAD} |
| 0;
+my $background = 0;
+my $pidfile = undef;
+
+my $check_interval;
+my $file_regex;
+my $watch_directory;
+my $follow_symlinks;
+
+my @argv = @ARGV;
+
+GetOptions(
+ 'debug|d' => \$debug,
+ 'fork|f' => \$fork,
+ 'help|?' => \$help,
+ 'host=s' => \$host,
+ 'port|p=s' => \$port,
+ 'keepalive|k' => \$keepalive,
+ 'restart|r' => \$restart,
+ 'restartdelay|rd=s' => \$check_interval,
+ 'restartregex|rr=s' => \$file_regex,
+ 'restartdirectory=s@' => \$watch_directory,
+ 'followsymlinks' => \$follow_symlinks,
+ 'background' => \$background,
+ 'pidfile=s' => \$pidfile,
+);
+
+pod2usage(1) if $help;
+
+if ( $debug ) {
+ $ENV{CATALYST_DEBUG} = 1;
+}
+
+# If we load this here, then in the case of a restarter, it does not
+# need to be reloaded for each restart.
+require Catalyst;
+
+# If this isn't done, then the Catalyst::Devel tests for the restarter
+# fail.
+$| = 1 if $ENV{HARNESS_ACTIVE};
+
+my $runner = sub {
+ # This is require instead of use so that the above environment
+ # variables can be set at runtime.
+ require SysFink::Web;
+
+ SysFink::Web->run(
+ $port, $host,
+ {
+ argv => \@argv,
+ 'fork' => $fork,
+ keepalive => $keepalive,
+ background => $background,
+ pidfile => $pidfile,
+ }
+ );
+};
+
+if ( $restart ) {
+ die "Cannot run in the background and also watch for changed files.\n"
+ if $background;
+
+ require Catalyst::Restarter;
+
+ my $subclass = Catalyst::Restarter->pick_subclass;
+
+ my %args;
+ $args{follow_symlinks} = 1
+ if $follow_symlinks;
+ $args{directories} = $watch_directory
+ if defined $watch_directory;
+ $args{sleep_interval} = $check_interval
+ if defined $check_interval;
+ $args{filter} = qr/$file_regex/
+ if defined $file_regex;
+
+ my $restarter = $subclass->new(
+ %args,
+ start_sub => $runner,
+ argv => \@argv,
+ );
+
+ $restarter->run_and_watch;
+}
+else {
+ $runner->();
+}
+
+1;
+
+=head1 NAME
+
+sysfink_web_server.pl - Catalyst Testserver
+
+=head1 SYNOPSIS
+
+sysfink_web_server.pl [options]
+
+ Options:
+ -d -debug force debug mode
+ -f -fork handle each request in a new process
+ (defaults to false)
+ -? -help display this help and exits
+ -host host (defaults to all)
+ -p -port port (defaults to 3000)
+ -k -keepalive enable keep-alive connections
+ -r -restart restart when files get modified
+ (defaults to false)
+ -rd -restartdelay delay between file checks
+ (ignored if you have Linux::Inotify2 installed)
+ -rr -restartregex regex match files that trigger
+ a restart when modified
+ (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
+ -restartdirectory the directory to search for
+ modified files, can be set mulitple times
+ (defaults to '[SCRIPT_DIR]/..')
+ -follow_symlinks follow symlinks in search directories
+ (defaults to false. this is a no-op on Win32)
+ -background run the process in the background
+ -pidfile specify filename for pid file
+
+ See also:
+ perldoc Catalyst::Manual
+ perldoc Catalyst::Manual::Intro
+
+=head1 DESCRIPTION
+
+Run a Catalyst Testserver for this application.
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
=======================================
--- /dev/null
+++ /trunk/server/script/sysfink_web_test.pl Wed Jan 20 07:40:19 2010
@@ -0,0 +1,53 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use Getopt::Long;
+use Pod::Usage;
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+use Catalyst::Test 'SysFink::Web';
+
+my $help = 0;
+
+GetOptions( 'help|?' => \$help );
+
+pod2usage(1) if ( $help || !$ARGV[0] );
+
+print request($ARGV[0])->content . "\n";
+
+1;
+
+=head1 NAME
+
+sysfink_web_test.pl - Catalyst Test
+
+=head1 SYNOPSIS
+
+sysfink_web_test.pl [options] uri
+
+ Options:
+ -help display this help and exits
+
+ Examples:
+ sysfink_web_test.pl http://localhost/some_action
+ sysfink_web_test.pl /some_action
+
+ See also:
+ perldoc Catalyst::Manual
+ perldoc Catalyst::Manual::Intro
+
+=head1 DESCRIPTION
+
+Run a Catalyst action from the command line.
+
+=head1 AUTHORS
+
+Catalyst Contributors, see Catalyst.pm
+
+=head1 COPYRIGHT
+
+This library is free software. You can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
=======================================
--- /dev/null
+++ /trunk/server/t/web/01app.t Wed Jan 20 07:40:19 2010
@@ -0,0 +1,11 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 2;
+
+use lib 'lib';
+use lib 'libext';
+
+BEGIN { use_ok 'Catalyst::Test', 'SysFink::Web' }
+
+ok( request('/')->is_success, 'Request should succeed' );
=======================================
--- /dev/null
+++ /trunk/server/t/web/02pod.t Wed Jan 20 07:40:19 2010
@@ -0,0 +1,13 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+use lib 'lib';
+use lib 'libext';
+
+eval "use Test::Pod 1.14";
+plan skip_all => 'Test::Pod 1.14 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+
+all_pod_files_ok();
=======================================
--- /dev/null
+++ /trunk/server/t/web/03podcoverage.t Wed Jan 20 07:40:19 2010
@@ -0,0 +1,13 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+use lib 'lib';
+use lib 'libext';
+
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+
+all_pod_coverage_ok();
=======================================
--- /dev/null
+++ /trunk/server/utils/start-server-dev.sh Wed Jan 20 07:40:19 2010
@@ -0,0 +1,14 @@
+if [ -z "$1" ]; then
+ echo "start-server-dev.sh 1 .. normal Engine"
+ echo "start-server-dev.sh 2 .. normal Prefork::Engine"
+ exit
+fi
+
+export DBIC_TRACE=1
+export CATALYST_PORT=5000
+
+if [ "$1" = "2" ]; then
+ export CATALYST_ENGINE='HTTP::Prefork'
+fi
+
+perl script/sysfink_web_server.pl -r -d
=======================================
--- /trunk/server/t/harness.pl Tue Jan 12 13:19:36 2010
+++ /trunk/server/t/harness.pl Wed Jan 20 07:40:19 2010
@@ -10,6 +10,7 @@
't/tconf/*',
't/scan/*',
't/utils/*',
+ 't/web/*',
);
my @tests = map { glob($_) } (@ARGV ? @ARGV : @default_tests);
=======================================
***Additional files exist in this changeset.***