> > We have also heard something about OpenInteract, which is based on
> > Template Toolkit - may be it would be simplier to use it?
>
> It does sound like a possible good choice for your purposes, since it
> combines a basic application structure with Template Toolkit integration
and
> an object/relational mapping tool (SPOPS) for data management.

It seems to be interesting application.
We developed many content management systems for sites with more than one
access rights levels and more than one databases as storage of content
(MySQL and Oracle, if be precise).
May be we will use it, although it (SPOPS-0.50) don't want be compiled on my
home WinXP environment.
Errors while SPOPS make test
---------------------------------------------------
t\30_dbi............ok 4/18se of uninitialized value in string at
C:/TEMP/SPOPS-
0.50/blib/lib/SPOPS/DBI.pm line 634.
SPOPS::DBI::_save_insert (634) >> Insert failed! Args:  $VAR1 = {
          'db' => bless( {}, 'DBI::db' ),
          'is_add' => 1,
          'table' => 'spops_test',
          'skip_cache' => 1,
          'field' => [
                       'spops_goop',
                       'spops_id',
                       'spops_name',
                       'spops_num'
                     ],
          'value' => [
                       'oopie doop',
                       42,
                       'MyProject',
                       241
                     ],
          'return_sth' => 1
        };
---------------------------------------------------
and if I make install, I get a similar errors while do
oi_manage --package=INITIAL install_sql

> Personally, the way I would do this is to write the config stuff you're
> doing in XML as straight Perl data structures (nested hashes and arrays).
I
> would do all of the database processing in standard Perl modules, and only
> use TT to display results and editing forms.  If your TT templates seem
> messy, it may be because you're trying to do too much application logic in
> them.  It's best to avoid things like the DBI plugin and do all the real
> work before you run the template.

All logic performed in Perl modules, templates contains [% IF %] and [%
FOREACH %] tags only for designers as I wrote in previous letter. DBI plugin
in TT just for exmaple, in real scenario it is more simpler -

$self->{res}{rows} = $self->{dbh}->selectall_hashref("select * from test");

Our main goal:
Programmer write script with "logic" tags kinda
<edit sql...>
<delete sql..>
and choose from many "usability" tags, which are good looking, designers
made HTML blocks
<table_edit>
or
<single_row_edit>

BTW, Template Toolkit future version offers such ability

[%# Logic %]

[% XML %]
<edit sql...>
<delete sql..>
<select sql..>

[%# Design %]

<table_edit>
[% FOREACH %]
  <single_row_edit>
[% END %]

</table_edit>
[% END %]

-------------------------------
Sergey "BeerBong" Polyakov
Chief of WebZavod
http://www.webzavod.ru

Reply via email to