[Templates] Apache::Template and TT2ServiceModule directive doesn't work insidea Location block

2003-07-25 Thread Christopher L. Everett




Am I doomed to use one and only one service
module? It would be nice
to have something like this in my httpd.conf with the service module 
varying by Location block:

 Include conf/physemp.affiliate.tt2.conf

 Location /affiliate/report/basic_stats
 Options ExecCGI
 SetHandler perl-script

 TT2ServiceModule Physemp::Template::Report::UserAccount

 PerlHandler Apache::Template
 /Location

Is there another way of doing the same thing? Or should I start
writing 
plugins instead?






Re: [Templates] Processing a template stored in a variable.

2003-07-25 Thread Andy Wardley
Travis Spencer wrote:
 I am trying to process a template that is stored in a TT variable. 
[...]
 my $mainTemplate = '[% PROCESS embTemplate %]'; 

The eval filter is your friend.

  [% embTemplate | eval %]

HTH
A


___
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates


Re: [Templates] Template Toolkit verion 2.10

2003-07-25 Thread Andy Wardley
Simon Wilcox wrote:
 I'm getting a build failure on 2.10, in t/autoform.t :

Don't sweat it.  Autoformat seems to be very variable about the output
it generates.  I disabled the tests for Perl 5.8.0 because they go 
all over the place.  Perhaps I should do the same for 5.6.1, or just 
remove them altogeher?...

A


___
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates


Re: [Templates] PDF templates

2003-07-25 Thread Alex McLintock
At 00:45 25/07/03, Fong, Anna wrote:
I'd like to create a PDF template that I can use on a Unix server and 
populate the template from a database to create new PDFs for future 
editions of this report.  I do have Perl and DBI installed, though 
probably not the versions required by Template-Toolkit.
OK, here is what I would probably do.

I've been using a piece of Apache software called FOP which takes a 
particular XML format - XSL:FO and converts it to PDF (or other print formats)

Now you could use TemplateToolkit to help generate the XSL:FO files. There 
is nothing in TemplateToolkit that means it has to generate html - it can 
generate XML too.

Now your main problem is that XSL:FO is complicated, and that FOP is a java 
program. You could potentially kick off a new FOP java instance whenever 
you had a PDF to generate, or create some kind of server which processed 
XSL:FO files whenever they were available.

The template needs to be XSL:FO rather than PDF - and there is no generic 
way of converting PDF to XSL:FO.

PS I don't see why TemplateToolkit shouldn't work with old versions of perl 
and DBI.

Goodluck

Alex





Available for java/perl/C++/web development in London, UK or nearby.
Apache FOP, Cocoon, Turbine, Struts,XSL:FO, XML, Tomcat, JSP
http://www.OWAL.co.uk/
___
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates


RE: [Templates] PDF templates

2003-07-25 Thread Dan Muey
 At 00:45 25/07/03, Fong, Anna wrote:
 I'd like to create a PDF template that I can use on a Unix server and
 populate the template from a database to create new PDFs for future 
 editions of this report.  I do have Perl and DBI installed, though 
 probably not the versions required by Template-Toolkit.
 


Here's what I do all the time:

Genereate the html :

my $html = makehtml();
my $pdf = makepdf($html);
Then I runt that through htmldoc via qx() and print an application/pdf header it 
actually looks more like this:
#!/usr/bin/perl -w
 use strict;
 use CGI qw(:standard); 

 print header('application/pdf');
 print makepdf(makehtml());

 sub makehtml { do database/TT thing here and returnt the results }
 sub makepdf { run it through htmldoc like their wite describes and voila! }


HTH
Dmuey

___
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates


[Templates] Apache::Template perl directory configuration

2003-07-25 Thread Christopher L. Everett




I wish to reuse various templates in toto between different URLs but have different 
means of providing the information I fill the template with depending
on the uri. 

So far, I've tried using TT2PluginBase and TT2ServiceModule directives
inside 
Location blocks inside my apache configuration file. For example, with
TT2PluginBase
I'm getting this error:

Syntax error on line 27 of
/home/ceverett/apache/conf/physemp.affiliate.loc.conf:
TT2PluginBase not allowed here

using this conf snippet:

 TT2Params all
 TT2Headers size
 TT2Trim On

 Location /affiliate/report/
 Options ExecCGI
 SetHandler perl-script

 AuthType Physemp::Auth
 AuthName Affiliate

 TT2PluginBase Physemp::Template::Plugin::User # == line
27 here

 PerlHandler Apache::Template
 /Location

 Location /account_exec/report/
 Options ExecCGI
 SetHandler perl-script

 AuthType Physemp::Auth
 AuthName Affiliate

 TT2PluginBase Physemp::Template::Plugin::Admin # == line
27 here

 PerlHandler Apache::Template
 /Location

I get the same type error using the
TT2ServiceModule directive inside a Location 
block.

I'm using TT 2.10, Apache::Template 0.06, Apache 1.3.27 and mod_perl
1.28. 

Is there a relatively straightforward way of modifying Apache::Template
behavior 
per directory/location block?

Also, the Apache::Template docs don't say where specific configuration
directives 
are allowed/forbidden. Ought I assume that _all_ TT2* directives are
forbidden 
inside Directory/Location blocks?





Re: [Templates] Template Toolkit verion 2.10

2003-07-25 Thread Kenny Gatdula
After I ignore the tests, and make install, I ran t/date.t by hand. This was on 5.6.1 
and 5.8 on Win32. I happily ignored the failures, but, thought you'd like to know.

Kenny

Failed Test  Stat Wstat Total Fail  Failed  List of Failed
---
t\autoform.t   251   4.00%  21
t\date.t   331   3.03%  25
14 tests skipped.
Failed 2/90 test scripts, 97.78% okay. 2/2471 subtests failed, 99.92% okay.
NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0xff'
Stop.


Argument  isn't numeric in localtime at t/date.t line 66, DATA line 1.
MATCH FAILED
 input: [[% USE day = date(format = '%A', locale = 'en_GB') %]\n[% day.format(
'4:20:00 9-13-2000') %]\n]
expect: [Wednesday]
output: [Tuesday]
FAILED 25:  - template text 11 did not match expected
not ok 25 - template text 11 did not match expected

At 05:24 PM 7/24/2003 +0100, Andy Wardley wrote:

Version 2.10 of the Template Toolkit is now available.  It is working 
its way around CPAN.  In the mean time, it is available from the usual
place:

  http://tt2.org/download/Template-Toolkit-2.10.tar.gz

Changes below.

Enjoy!
A

#
# Version 2.10 - 24th July 2003
#

* Merged in Darren's branch to add the define_vmethod() methods to
  Template::Context and Template::Stash.

* Applied patch from Axel Gerstmair for minor fixes to Makefile.PL,
  t/gd.t and t/date.t.
  http://template-toolkit.org/pipermail/templates/2003-April/004545.html

* Added undefined() method to the Stash which get() calls if a variable
  value is undefined.  Currently just returns '' to implement existing
  behaviour, but it provides a method hook for subclasses to redefine.

* Fixed a minor bug which prevented the Stash from being subclassable
  by removing references to __PACKAGE__

___
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates