[sysfink] r207 committed - server - web switch TableBrowser -> CWebMagic

1 view
Skip to first unread message

sys...@googlecode.com

unread,
Feb 22, 2010, 11:09:22 AM2/22/10
to sys...@googlegroups.com
Revision: 207
Author: mj41.cz
Date: Mon Feb 22 08:08:41 2010
Log: server - web switch TableBrowser -> CWebMagic
http://code.google.com/p/sysfink/source/detail?r=207

Added:
/trunk/server/lib/SysFink/Web/Controller/CWM.pm
/trunk/server/root/src/cwm
/trunk/server/root/src/cwm/data.tt2
/trunk/server/root/src/cwm/index.tt2
Deleted:
/trunk/server/root/src/table
Modified:
/trunk/server/lib/SysFink/DB/DBIxClassBase.pm
/trunk/server/lib/SysFink/DB/SchemaAdd.pm
/trunk/server/root/css/base.css
/trunk/server/root/src/index.tt2
/trunk/server/t/base/modules-ext.t
/trunk/server/utils/start-server-dev.sh

=======================================
--- /dev/null
+++ /trunk/server/lib/SysFink/Web/Controller/CWM.pm Mon Feb 22 08:08:41 2010
@@ -0,0 +1,56 @@
+package SysFink::Web::Controller::CWM;
+
+use strict;
+use warnings;
+use base 'CatalystX::Controller::CWebMagic';
+
+=head1 NAME
+
+SysFink::Web::Controller::CWM - Catalyst Controller
+
+=head1 DESCRIPTION
+
+Catalyst Controller for SysFink magic web application part.
+
+=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::ControllerX::CWebMagic>.
L<DBIx::Class::CWebMagic>
+
+=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/root/src/cwm/data.tt2 Mon Feb 22 08:08:41 2010
@@ -0,0 +1,40 @@
+[% 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>
+[% IF table_header_html %]
+ [% table_header_html %]
+[% ELSE %]
+<tr>
+ [% FOREACH col_title IN col_titles -%]
+ <th>[% col_title -%]</th>
+ [% END -%]
+</tr>
+[% END -%]
+[% IF data_error %]
+ <tr class=even><td colspan=[% all_colspan_sum %]>[%
data_error %]</td></tr>
+[% ELSE %]
+ [% IF table_content_html %]
+ [% table_content_html %]
+ [% END -%]
+[% END -%]
+</table>
+
+[% pager_html %]
+
+[% IF rels_html -%]
+<div class=rels>
+ [% rels_html %]
+</div>
+[% END -%]
+
+[% IF msgs %]
+<div class=messages>
+<ul>
+[% FOREACH msg IN msgs -%]
+<li>[% msg %]</li>
+[% END -%]
+</ul>
+</div>
+[% END -%]
=======================================
--- /dev/null
+++ /trunk/server/root/src/cwm/index.tt2 Mon Feb 22 08:08:41 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>&nbsp;</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>
=======================================
--- /trunk/server/lib/SysFink/DB/DBIxClassBase.pm Wed Jul 15 12:38:01 2009
+++ /trunk/server/lib/SysFink/DB/DBIxClassBase.pm Mon Feb 22 08:08:41 2010
@@ -1,6 +1,6 @@
package SysFink::DB::DBIxClassBase;

use base qw/DBIx::Class/;
-__PACKAGE__->load_components(qw/ViewMD Core/);
+__PACKAGE__->load_components(qw/CWebMagic Core/);

1;
=======================================
--- /trunk/server/lib/SysFink/DB/SchemaAdd.pm Wed Jan 20 07:54:03 2010
+++ /trunk/server/lib/SysFink/DB/SchemaAdd.pm Mon Feb 22 08:08:41 2010
@@ -2,29 +2,22 @@

use base 'SysFink::DB::Schema';

-# ViewMD - view metadata
+# CWebMagic metadata

package SysFink::DB::Schema::aud;
-__PACKAGE__->cols_in_foreign_tables( [ qw/aud_id user_id date/ ] );
-
-package SysFink::DB::Schema::aud_status;
-__PACKAGE__->cols_in_foreign_tables( [ qw/name/ ] );
-
-package SysFink::DB::Schema::aud_status;
-__PACKAGE__->cols_in_foreign_tables( [ qw/name/ ] );
+__PACKAGE__->cwm_col_type({ 'date' => 'G', });

package SysFink::DB::Schema::machine;
-__PACKAGE__->restricted_cols( { 'ip' => 1, } );
-__PACKAGE__->cols_in_foreign_tables( [ qw/name/ ] );
-
-package SysFink::DB::Schema::mconf_sec;
-__PACKAGE__->cols_in_foreign_tables( [ qw/mconf_sec_id name mconf_id/ ] );
-
-package SysFink::DB::Schema::path;
-__PACKAGE__->cols_in_foreign_tables( [ qw/path/ ] );
+__PACKAGE__->cwm_col_auth({ 'ip' => 'R', });
+
+package SysFink::DB::Schema::mconf_change;
+__PACKAGE__->cwm_col_type({ 'date' => 'G', });

package SysFink::DB::Schema::user;
-__PACKAGE__->restricted_cols( { 'passwd' => 1, } );
-__PACKAGE__->cols_in_foreign_tables( [ qw/login/ ] );
+__PACKAGE__->cwm_col_auth({
+ 'passwd' => 'R',
+ 'who' => 'R',
+} );
+

1;
=======================================
--- /trunk/server/root/css/base.css Wed Jan 20 07:40:19 2010
+++ /trunk/server/root/css/base.css Mon Feb 22 08:08:41 2010
@@ -87,6 +87,7 @@
padding: 0.1em 0.5em 0.1em 0.5em;
margin: 0.1em;
vertical-align: top;
+ white-space: nowrap;
}

.red {
=======================================
--- /trunk/server/root/src/index.tt2 Wed Jan 20 07:40:19 2010
+++ /trunk/server/root/src/index.tt2 Mon Feb 22 08:08:41 2010
@@ -5,6 +5,6 @@

<h2>Browsing:</h2>
<ul class=menu>
-<li><a href="/table">Table browser</a></li>
+<li><a href="/cwm">See web magic</a></li>
</ul>

=======================================
--- /trunk/server/t/base/modules-ext.t Wed Jan 20 07:26:46 2010
+++ /trunk/server/t/base/modules-ext.t Mon Feb 22 08:08:41 2010
@@ -25,5 +25,5 @@
use_ok 'DBD::SQLite';

# TapTinder imported
- use_ok 'DBIx::Class::ViewMD';
-}
+ use_ok 'DBIx::Class::CWebMagic';
+}
=======================================
--- /trunk/server/utils/start-server-dev.sh Wed Jan 20 07:40:19 2010
+++ /trunk/server/utils/start-server-dev.sh Mon Feb 22 08:08:41 2010
@@ -6,6 +6,7 @@

export DBIC_TRACE=1
export CATALYST_PORT=5000
+export CATALYST_DEBUG=1

if [ "$1" = "2" ]; then
export CATALYST_ENGINE='HTTP::Prefork'

Reply all
Reply to author
Forward
0 new messages