List Info

Thread: Re: Deleting links when expiring stories




Re: Deleting links when expiring stories
user name
2007-06-07 15:32:40
>> ***            $m->comp(
'/related_list_print.mc' );   ****
>
> This code, in lib/Bric/Util/Burner.pm, is in a Perl
module,
> not in a template, so $m isn't a global variable.
> $m is an HTML::Mason thing, available inside
templates.
>
> I'm not sure what this '/related_list_print.mc'
template is.
> Does it really have to be a template, or is it just
some
> Perl code? If it's a template, uh.... I'm not sure
> how to set it up to run from there. You might want
> to put it somewhere in the UI code, under comp/
> since that's HTML::Mason (but not a normal Bricolage
template  
> environment).

Well, the file /lib/Bric/App/Authz.pm makes a call for the
error  
templates on line 163.

     $HTML::Mason::Commands::m->comp('/errors/403.mc',
                                     perm => $chk_perm,
                                     obj => $obj);

So in Burner.pm, I'm trying to use

package HTML::Mason::Commands qw(m);
use HTML::Mason::Commands::m;

Followed by

             $HTML::Mason::Commands::m->comp( '/ 
related_list_print.mc' );

Later in the file.

However, I'm getting this error in the bric_queued log:

Can't locate object method "comp" via package  
"HTML::Mason::Commands::m" (perhaps you forgot to
load  
"HTML::Mason::Commands::m"?) at
/usr/local/bricolage/lib/Bric/Util/ 
Burner.pm line 1252.

So I'm obviously doing something wrong.

-Matt

Re: Deleting links when expiring stories
user name
2007-06-08 04:37:22
On Thu, 7 Jun 2007, Matt Rolf wrote:
>> not in a template, so $m isn't a global variable.
>> $m is an HTML::Mason thing, available inside
templates.
[...]
> Well, the file /lib/Bric/App/Authz.pm makes a call for
the error templates on 
> line 163.
>
>   $HTML::Mason::Commands::m->comp('/errors/403.mc',
>                                   perm =>
$chk_perm,
>                                   obj => $obj);

Ah okay, right.


> So in Burner.pm, I'm trying to use
>
> package HTML::Mason::Commands qw(m);
> use HTML::Mason::Commands::m;

Wow, no. 
   Package declarations don't have a list of options after
them,
so you don't put qw(m) there. You're just stating which
package the following code belongs in, that's all. You
don't
even want to have that.
   $HTML::Mason::Commands::m is a package variable, not a
package,
so you don't `use' it. Normally you just refer to it with
$m;
adding the HTML::Mason::Commands explicitly says which $m
you're referring to.


> Followed by
>
>           $HTML::Mason::Commands::m->comp(
'/related_list_print.mc' );
>
> Later in the file.
>
> However, I'm getting this error in the bric_queued
log:

bric_queued isn't running inside the Bricolage web
application.
It's a daemon running on its own. So it's not handling
webpage
requests itself, right, so it's not using
mod_perl/HTML::Mason
for running the application; it's not a web application
context.
(How do things get published, then?
lib/Bric/Util/Burner/Mason.pm
sets up Mason interpreters itself to burn the templates!)
   The thing above from Authz (in chk_authz) is presumably
only ever called from parts of Bricolage where it's being
run
within a mod_perl/HTML::Mason web application,
so this $m would be set up then.
   What is the template '/related_list_print.mc'? Does it
really
have to be a template? I'm confused about what exactly
that's
doing. If it's just some Perl code, you could put it right
there where you're trying to call the template. I don't
really
understand what it would be trying to output, as a
*template*.

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )