[Catalyst] looking for suggestion on both cron and pm

2008-01-11 Thread Fayland Lam
generally I do have several corn scripts. so I want to get $user both in 
MyApp and cron scripts.

what I tried to do is soemthing like that:

the first is a base module which contains schema cache and tt2 and others.

package Foorum::Adaptor::Base;

sub new {
   my $self = shift;
  
   my $params = {};

   return bless $params => $self;
}
sub config {
   my $self = shift;

   return $self->{config} if ($self->{config});

   my $config = LoadFile("$path/../../../foorum.yml");
   my $extra_config = LoadFile("$path/../../../foorum_local.yml");
   $config = { %$config, %$extra_config };
   $self->{config} = $config;
   return $self->{config};
}
sub schema {
   my $self = shift;

   return $self->{schema} if ($self->{schema});
   my $config = $self->config();

   $self->{schema}
   = Foorum::Schema->connect( $config->{dsn}, $config->{dsn_user},
   $config->{dsn_pwd}, { AutoCommit => 1, RaiseError => 1, 
PrintError => 1 },

   );
   return $self->{schema};
}
...
Check Attachment for more details.

then a User adaptor module:

package Foorum::Adaptor::User;

use strict;
use warnings;
use base 'Foorum::Adaptor::Base';

sub get {
   my ( $c, $cond ) = @_;

   my $cache_key = 'user|' . Object::Signature::signature($cond);
   my $cache_val = $c->cache->get($cache_key);

   if ($cache_val) {
   return $cache_val;
   }

   $cache_val = get_user_from_db( $c, $cond );
   return unless ($cache_val);

   $c->cache->set( $cache_key, $cache_val, 7200 );# two hours
   return $cache_val;
}

and others. more see attachment.

at last:

package Foorum::Model::User;

use strict;
use warnings;
use base 'Catalyst::Model::Adaptor';
__PACKAGE__->config( class => 'Foorum::Adaptor::User' );

1;

so that we can do in MyApp:

my $user = $c->model('User')->get( { username => $username } );

or cron script:

use Foorum::Adaptor::User;
my $user_model = new Foorum::Adaptor::User();
my $user = $user_model->get( { user_id => 1 } );

is those code correct? or there is another way to do it?

Thanks.

--
Fayland Lam // http://www.fayland.org/ 
Foorum based on Catalyst // http://www.foorumbbs.com/ 

package Foorum::Adaptor::Base;

use strict;
use warnings;
use YAML qw/LoadFile/;# config
use Foorum::Schema;   # schema
use TheSchwartz;  # theschwartz
use Template; # template
use Template::Stash::XS;
use File::Spec;
use Cwd qw/abs_path/;
my ( undef, $path ) = File::Spec->splitpath(__FILE__);

sub new {
my $self = shift;

my $params = {};
return bless $params => $self;
}

sub base_path {
my $self = shift;

return $self->{path} if ( $self->{path} );
$self->{path} = abs_path("$path/../../../");

return $self->{path};
}

sub config {
my $self = shift;

return $self->{config} if ($self->{config});

my $config = LoadFile("$path/../../../foorum.yml");
my $extra_config = LoadFile("$path/../../../foorum_local.yml");
$config = { %$config, %$extra_config };
$self->{config} = $config;
return $self->{config};
}

sub schema {
my $self = shift;

return $self->{schema} if ($self->{schema});
my $config = $self->config();

$self->{schema}
= Foorum::Schema->connect( $config->{dsn}, $config->{dsn_user},
$config->{dsn_pwd}, { AutoCommit => 1, RaiseError => 1, PrintError => 1 
},
);
return $self->{schema};
}

*default_cache_backend = \&cache;
sub cache {
my $self = shift;

return $self->{cache} if ($self->{cache});
my $config = $self->config();

my %params = %{ $config->{cache}{backends}{default} };
my $class  = delete $params{class};

eval("use $class;");## no critic (ProhibitStringyEval)
unless ($@) {
$self->{cache} = $class->new( \%params );
}

return $self->{cache};
}

sub theschwartz {
my $self = shift;

return $self->{theschwartz} if ($self->{theschwartz});
my $config = $self->config();

$self->{theschwartz} = TheSchwartz->new(
databases => [
{   dsn  => $config->{theschwartz_dsn},
user => $config->{theschwartz_user} || $config->{dsn_user},
pass => $config->{theschwartz_pwd} || $config->{dsn_pwd},
}
],
verbose => 0,
);

return $self->{theschwartz};
}

sub tt2 {
my $self = shift;

return $self->{tt2} if ($self->{tt2});
my $config = $self->config();

$self->{tt2} = Template->new(
{   INCLUDE_PATH => ["$path/../../../templates"],
PRE_CHOMP=> 1,
POST_CHOMP   => 1,
STASH=> Template::Stash::XS->new,
}
);
return $self->{tt2};
}

sub error_log {
my ( $self, $level, $text ) = @_;

return unless ($text);

my $schema = $self->schema();
$schema->resultset('LogError')->create(
{   level => $level || 'debug',
text => $text,
time => \'NOW()',#'
}
);
}

1;
__END__

=pod

=head1 NAME

Foorum::Adaptor::Base - base module

Re: [Catalyst] Serving html pages

2008-01-11 Thread Martin Ellison
I have a similar problem, but I am on shared hosting and I do not have
access to httpd.conf, only to the local .htaccess files. I have the static
plugin set up so we are delivering HTML, image files and other static pages
via Catalyst, but similarly to Alejandro I would like to serve up the pages
directly from Apache.

I have tried using mod_rewrite but it seems to be an invention of the
Adversary designed to lead us into despair. Has anyone managed to serve
static files directly using just .htaccess?

On 12/01/2008, Alejandro Imass <[EMAIL PROTECTED]> wrote:
>
> Usually you would try to serve your static content directly with your
> Web Server and let only the dynamic part with Catalyst. For example
> you could have a configuration in your apache vhost as such:
>
> Suppose your app's name is vdc...
>
> 
>
> [...]
>
> # root of your app
> DocumentRoot /var/www/vdc/root
>
> # Aliases
> Alias /static /var/www/vdc/root/static
> Alias /other-static-files /var/vdc/whatever
> Alias / /var/www/vdc/script/vdc_cgi.pl
>
> # The Catalyst part is via mod_perl
> 
> SetHandler modperl
> PerlResponseHandler vdc
> 
>
> # The static content is served by apache directly
> 
> SetHandler default-handler
> 
> 
> SetHandler default-handler
> 
>
> # main app directory conf
> 
> DefaultLanguage es
> AddHandler cgi-script .pl
> AllowOverride None
> Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
> Order allow,deny
> Allow from all
> 
>
> # personal error file
> ErrorLog /var/log/apache2/vdc-error.log
>
> # personal log file
> LogLevel warn
> CustomLog /var/log/apache2/vdc-access.log combined
> ServerSignature On
>
>
> 
>
> On Jan 11, 2008 10:27 AM, Marcello Romani <[EMAIL PROTECTED]> wrote:
> > Emmanuel Quevillon ha scritto:
> > > Hi,
> > >
> > > I am quite new with catalyst and I'd like to know how I could serve
> some
> > > html pages (actually documentation) e.g.:
> > > www.myapp.com/docs/index.html ?
> > >
> > > When I try to integrate such link in my template page, Pages are not
> > > served and as mentioned in the C::P::Static::Simple it does not serve
> > > .html file.
> > >
> > > Is there any magic thing to do without changing
> > > MyApp->config->{static}->{ignore_extensions} ?
> > >
> > > Thanks a lot
> > >
> > > Regards
> > >
> >
> > If I recall correctly, the default is to serve as static files only the
> > ones under root/static, so try to put doc/ there.
> >
> > P.S.: Please don't start a new thread under an existing one.
> >
> > HTH
> >
> > --
> > Marcello Romani
> > Responsabile IT
> > Ottotecnica s.r.l.
> > http://www.ottotecnica.com
> >
> >
> > ___
> > List: Catalyst@lists.scsys.co.uk
> > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> > Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> > Dev site: http://dev.catalyst.perl.org/
> >
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>



-- 
Regards,
Martin
([EMAIL PROTECTED])
IT: http://methodsupport.com Personal: http://thereisnoend.org
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Serving html pages

2008-01-11 Thread Alejandro Imass
Usually you would try to serve your static content directly with your
Web Server and let only the dynamic part with Catalyst. For example
you could have a configuration in your apache vhost as such:

Suppose your app's name is vdc...



[...]

# root of your app
DocumentRoot /var/www/vdc/root

# Aliases
Alias /static /var/www/vdc/root/static
Alias /other-static-files /var/vdc/whatever
Alias / /var/www/vdc/script/vdc_cgi.pl

# The Catalyst part is via mod_perl

SetHandler modperl
PerlResponseHandler vdc


# The static content is served by apache directly

SetHandler default-handler


SetHandler default-handler


# main app directory conf

DefaultLanguage es
AddHandler cgi-script .pl
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all


# personal error file
ErrorLog /var/log/apache2/vdc-error.log

# personal log file
LogLevel warn
CustomLog /var/log/apache2/vdc-access.log combined
ServerSignature On




On Jan 11, 2008 10:27 AM, Marcello Romani <[EMAIL PROTECTED]> wrote:
> Emmanuel Quevillon ha scritto:
> > Hi,
> >
> > I am quite new with catalyst and I'd like to know how I could serve some
> > html pages (actually documentation) e.g.:
> > www.myapp.com/docs/index.html ?
> >
> > When I try to integrate such link in my template page, Pages are not
> > served and as mentioned in the C::P::Static::Simple it does not serve
> > .html file.
> >
> > Is there any magic thing to do without changing
> > MyApp->config->{static}->{ignore_extensions} ?
> >
> > Thanks a lot
> >
> > Regards
> >
>
> If I recall correctly, the default is to serve as static files only the
> ones under root/static, so try to put doc/ there.
>
> P.S.: Please don't start a new thread under an existing one.
>
> HTH
>
> --
> Marcello Romani
> Responsabile IT
> Ottotecnica s.r.l.
> http://www.ottotecnica.com
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


RE: [Catalyst] Re-enable digest mode?

2008-01-11 Thread Lampert, Hugh
Well, I respectfully submit that the purpose of a digest is so people can 
archive the mailing list themselves in their e-mail systems, one digest per 
day.  An RSS feed does not easily allow this, and for a busy list like this 
one, a subscriber might receive many messages per day, the number of which 
could rapidly increase into the thousands in the inbox.  Filtering these many 
messages into a folder, as you suggest, will more than likely mean that for me 
they will never get looked at at all, as I receive many, many emails that 
require my attention every day.

I use Outlook for my corporate mail system and I know your opinion of the way 
it works Matt.  I like to keep up with Catalyst as much as possible but not 
enough to have to monitor an RSS feed or thousands of individual e-mails in my 
business mailbox. I have an alternate suggestion.  Re-enable digests for those 
who subscribe to the traditional function of a "mailing list" and don't want to 
be flooded by individual e-mails, and revoke and block the subscriptions of 
those who subscribe but don't know how to respond properly and spam the list by 
responding improperly to the digest.

I have already unsubscribed from the Catalyst list for my personal mail box, 
which collects on a somewhat limited portable micro drive.  If I can't get a 
digest I guess I will have to unsubscribe from the list from my corporate mail 
box as well, as I don't want to awkwardly manage thousands of individual 
e-mails.  While I can make some time to scan the subjects of the digest when it 
comes into my mailbox during my work day, I'm afraid I will not have time to 
monitor yet another RSS feed, so it will be so long Catalyst info.  Too bad for 
me, I guess.

Interestingly, I will continue to subscribe to the DBIx-Class list, as the 
digest for that has NOT been turned off as of yet.  Are the subscribers to that 
list just more intelligent?


Hugh Lampert
IT Specialist
Information Technology (3261)
Landesbank Baden-Württemberg
New York Branch
280 Park Avenue, 31st Floor - West Building
New York, NY 10017
Phone: (212) 584-1775
Fax:   (212) 584-1799
Email: [EMAIL PROTECTED]
Web:   www.LBBW.com
-Original Message-
From: Matt S Trout [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 11, 2008 12:45 PM
To: The elegant MVC web framework
Subject: Re: [Catalyst] Re-enable digest mode?

On Fri, Jan 11, 2008 at 09:52:58AM -0500, Lampert, Hugh wrote:
> Up until this week I was receiving the Catalyst list e-mails in digest form.  
> This week I'm getting individual e-mails.  When I checked the list server 
> options it told me digest mode had been disabled by the administrator.  It's 
> hard for me to process multiple individual e-mails from the Catalyst list 
> along with my other e-mail; is there any way digest mode could be re-enabled?

No.

People consistently sign up to digests and then reply to them, spamming the 
list with a day's worth of messages for a second time and blowing away any hope 
of threading.

You can get a feed from

http://grokbase.com/group/[EMAIL PROTECTED]

(which being a Catalyst-powered site is probably going to archive this list 
pretty much indefinitely :)

or you can configure your mail setup to siphon the messages off into a folder. 
Both approaches will give you all the advantages of digests without leaving us 
with the traffic/noise disadvantages.

A mailing list lives and dies by the quality of its postings (and for every one 
digest user there are dozens more people searching the archives), so disabling 
digests was a conscious choice to optimise for signal/noise ratio.

If you don't have a useful mail client and don't want to take a feed, I have a 
(somewhat hacky) script I use to handle sorting that needs nothing but an IMAP 
connection to talk down (and some perl :); I'll send a copy on request.

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Disclaimer:
"This message is for the named person's use only. It may contain confidential, 
proprietary or legally privileged 
information. The above information has been prepared for information purposes 
only. The above does not constitute
an offer, recommendation or solicitation to buy or sell, nor is it an official 
confirmation of terms. While the 
information herein has been obtained from sources believed to be reliable, 
Landesbank Baden-Württemberg makes 
no representation that it is accurate or complete and it should not be relied 
upon as such. Neither Landesbank

Re: [Catalyst] process a restored request

2008-01-11 Thread Jonas Alves
On Jan 11, 2008 6:27 PM, Matt S Trout <[EMAIL PROTECTED]> wrote:
> On Tue, Jan 08, 2008 at 02:58:17PM -0500, [EMAIL PROTECTED] wrote:
> > Hi,
> > in my application, if a client issues a request after say 30 minutes of
> > inactivity, I want to answer his request only after successfull
> > authentication.
> >
> > Ideally, I would simply serialize $c->request in the session, ask for
> > authentication, then if successfull restore the stored request to $c and 
> > call
> > $c->dispatch. But after playing around a bit, it appears not to be that
> > simple (the context is stored in the request as '_context', the body seems
> > fetched only on-demand, dispatch seems to need some prepare_* methods to be
> > called).
> >
> > I searched the list and only found this proposition for a similar mechanism:
> > http://lists.scsys.co.uk/pipermail/catalyst/2007-February/012256.html
> >
> > Am I missing an easier way of doiing this?
>
> Yes.
>
> Don't try and serialize $c->req, just dump any POST data back out into
> hidden fields in the login form, don't change the URL, and have the login
> form processed in a forward() from auto or similar rather than doing a
> detach. This is how I handle "user needs to log in to continue" across the
> board and it makes life much simpler.
>
> i.e. something like
>
> sub auto :Private {
>   my ($self, $c) = @_;
>   unless ($c->user_exists) {
> unless ($c->forward('try_login')) {
>   $c->detach('show_login_form');
>   return 0;
> }
>   }
>   return 1;
> }
>
> sub try_login :Private {
>   my ($self, $c) = @_;
>   my $b = $c->req->body_parameters;
>   return 0 unless $b->{__username};
>   return $c->authenticate({
>username => $b->{__username}
>password => $b->{__password}
>  });
> }
>

And how do you handle file uploads? Do you save them in the session?

-- 
Jonas

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] POD viewer

2008-01-11 Thread J. Shirley
On Jan 11, 2008 2:01 AM, Zukoff <[EMAIL PROTECTED]> wrote:

> Hello!
>
> I've got an error:
> [error] Caught exception in CatalystAdvent->begin "Can't locate object
> method "now" via package "DateTime" (perhaps you forgot to load
> "DateTime"?) at /tmp/test/Script/../lib/CatalystAdvent.pm line 57."
>
> I've fixed it adding use DateTime;
>
> Then i've stopped at: [error] Couldn't forward to command
> "/calendar/index": Invalid action or component.
>
> What could it be?
>
> On Fri, 2008-01-11 at 00:59 -0600, Jonathan Rockway wrote:
> > Silly quoting below, so I'm top posting.  Take that!
> >
> > Anyway, the Catalyst Advent Calendar is basically a POD server.  Is it
> > pretty?  No... but it is something you can cargo cult if you want.
> >
> >
> http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/CatalystAdvent/
> >
> > Regards,
> > Jonathan Rockway
> >
> > On Wed, 2008-01-09 at 08:19 +0100, Dami Laurent (PJ) wrote:
> > > >-Message d'origine-
> > > >De : Ashley [mailto:[EMAIL PROTECTED]
> > > >Envoyé : mercredi, 9. janvier 2008 04:05
> > > >À : The elegant MVC web framework
> > > >Objet : [Catalyst] POD viewer
> > > >
> > > >Through a somewhat shallow search (difficult terms to search out
> > > >effectively) of the archives and search.CPAN I can't find if anyone
> > > >has hacked up a Cat based POD viewer/Controller; like the modperl
> > > >Apache one but, one hopes, without the (early?) security issues.
> > > >
> > > >I want to be able to share internal POD at work to encourage both its
> > > >reading and writing.
> > > >
> > > >Thanks!
> > > >-Ashley
> > > >
> >
> > The lack of a one-line attribution makes it impossible to cleanly reply
> > to this message (while keeping fragments from both your reply and the
> > original question).   Try to avoid this kthx.
> >
> > >
> > > Hi Ashley,
> > >
> > > I've hacked up a pod viewing app : see Pod::POM::Web. It's not a
> Catalyst app, but it's a web app, sitting in mod_perl or cgi-bin or its own
> Http server, and serving all pod installed in your @INC.
> > >
> > > Enjoy,
> > >
> > > Laurent Dami
> > >
> > > ___
> > > List: Catalyst@lists.scsys.co.uk
> > > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> > > Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> > > Dev site: http://dev.catalyst.perl.org/
> > >
> > ___
> > List: Catalyst@lists.scsys.co.uk
> > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> > Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> > Dev site: http://dev.catalyst.perl.org/
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>


I did a bunch of pod rendering with table of content work for the Cat site
(still hasn't been released, trying to get a finalized ToC rendering and I
suck at typography and UI).

You can play with the generation at:
http://dev.catalyst.perl.org/repos/Catalyst/branches/site-notrac/podbuilder

Or, take a look at the finished product:
http://catsite.toeat.com/docs/Catalyst-Manual-Intro.html

Happy to help with anything that you need... I'd like to actually get this
work done but my motivation has tapered off.

-J

-- 
J. Shirley :: [EMAIL PROTECTED] :: Killing two stones with one bird...
http://www.toeat.com
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] process a restored request

2008-01-11 Thread Matt S Trout
On Tue, Jan 08, 2008 at 02:58:17PM -0500, [EMAIL PROTECTED] wrote:
> Hi,
> in my application, if a client issues a request after say 30 minutes of 
> inactivity, I want to answer his request only after successfull 
> authentication.
> 
> Ideally, I would simply serialize $c->request in the session, ask for 
> authentication, then if successfull restore the stored request to $c and call 
> $c->dispatch. But after playing around a bit, it appears not to be that 
> simple (the context is stored in the request as '_context', the body seems 
> fetched only on-demand, dispatch seems to need some prepare_* methods to be 
> called).
> 
> I searched the list and only found this proposition for a similar mechanism:
> http://lists.scsys.co.uk/pipermail/catalyst/2007-February/012256.html
> 
> Am I missing an easier way of doiing this?

Yes.

Don't try and serialize $c->req, just dump any POST data back out into
hidden fields in the login form, don't change the URL, and have the login
form processed in a forward() from auto or similar rather than doing a
detach. This is how I handle "user needs to log in to continue" across the
board and it makes life much simpler.

i.e. something like

sub auto :Private {
  my ($self, $c) = @_;
  unless ($c->user_exists) {
unless ($c->forward('try_login')) {
  $c->detach('show_login_form');
  return 0;
}
  }
  return 1;
}

sub try_login :Private {
  my ($self, $c) = @_;
  my $b = $c->req->body_parameters;
  return 0 unless $b->{__username};
  return $c->authenticate({
   username => $b->{__username}
   password => $b->{__password}
 });
}

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Gentoo Catalyst overlay: repository moved!

2008-01-11 Thread Matt S Trout
On Wed, Jan 09, 2008 at 06:06:05PM +0100, Michele Beltrame wrote:
> Hello!
> 
> The Catalyst-related ebuilds (along with some others) are now part of the
> perl-exprimental Gentoo overlay.
> 
> If you're using layman, please delete the old "catalystframework" overlay and
> add "perl-experimental" instead.
> 
> If you fetch the ebuilds with Subversion, please update your repository 
> addess to:
> 
> http://overlays.gentoo.org/svn/proj/perl/perl-experimental/
> 
> Old repository and overlay will not be maintained any more.

After we're sure we're happy with the new stuff, could the old one's ebuilds
all be changed to throw an error saying where the new location is?

Seems like a good way to make sure people don't lose out on important
upgrades ...

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re-enable digest mode?

2008-01-11 Thread Andrew Rodland
On Friday 11 January 2008 11:45:27 am Matt S Trout wrote:
> You can get a feed from
>
> http://grokbase.com/group/[EMAIL PROTECTED]
>
> (which being a Catalyst-powered site is probably going to archive this
> list pretty much indefinitely :)
>
> or you can configure your mail setup to siphon the messages off into a
> folder. Both approaches will give you all the advantages of digests without
> leaving us with the traffic/noise disadvantages.

If you like looking at things on the web (or if you think that NNTP is a good 
way to view a mailing list), GMANE also carries this list, 
as 'gmane.comp.web.catalyst.general'.

Andrew

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Windows XAMPP Install - What happened to ngmedia.net?

2008-01-11 Thread Matt S Trout
On Thu, Jan 10, 2008 at 09:27:18AM -0600, Collin Condray wrote:
> I am attempting to install Catalyst on my Windows machine using the
> XAMPP distribution. One of the steps in the Windows install
> instructions in the Catalyst wiki
> (http://dev.catalystframework.org/wiki/Faq_ref#bi.1) is add the
> repository on the home.ngmedia.net server. However, it appears that
> the ngmedia.net domain has expired. Is there another place where these
> files are located or is there an updated set of instructions on how to
> install Catalyst on Windows and avoid common gotchas?

You could try the http://ppm.tcool.org/ repo.

We've no idea what happened to NG Media; they used to be run by Christian
Hansen but he left there a couple years ago now (and has since dropped out
of site entirely, sadly ...)

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re-enable digest mode?

2008-01-11 Thread Matt S Trout
On Fri, Jan 11, 2008 at 09:52:58AM -0500, Lampert, Hugh wrote:
> Up until this week I was receiving the Catalyst list e-mails in digest form.  
> This week I'm getting individual e-mails.  When I checked the list server 
> options it told me digest mode had been disabled by the administrator.  It's 
> hard for me to process multiple individual e-mails from the Catalyst list 
> along with my other e-mail; is there any way digest mode could be re-enabled?

No.

People consistently sign up to digests and then reply to them, spamming the
list with a day's worth of messages for a second time and blowing away any
hope of threading.

You can get a feed from

http://grokbase.com/group/[EMAIL PROTECTED]

(which being a Catalyst-powered site is probably going to archive this
list pretty much indefinitely :)

or you can configure your mail setup to siphon the messages off into a
folder. Both approaches will give you all the advantages of digests without
leaving us with the traffic/noise disadvantages.

A mailing list lives and dies by the quality of its postings (and for every
one digest user there are dozens more people searching the archives), so
disabling digests was a conscious choice to optimise for signal/noise ratio.

If you don't have a useful mail client and don't want to take a feed, I have
a (somewhat hacky) script I use to handle sorting that needs nothing but an
IMAP connection to talk down (and some perl :); I'll send a copy on request.

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re-enable digest mode?

2008-01-11 Thread Lampert, Hugh
Up until this week I was receiving the Catalyst list e-mails in digest form.  
This week I'm getting individual e-mails.  When I checked the list server 
options it told me digest mode had been disabled by the administrator.  It's 
hard for me to process multiple individual e-mails from the Catalyst list along 
with my other e-mail; is there any way digest mode could be re-enabled?


Thanks!

Hugh Lampert
IT Specialist
Information Technology (3261)
Landesbank Baden-Württemberg
New York Branch
280 Park Avenue, 31st Floor - West Building
New York, NY 10017
Phone: (212) 584-1775
Fax:   (212) 584-1799
Email: [EMAIL PROTECTED]
Web:   www.LBBW.com

-Original Message-
From: Emmanuel Quevillon [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 11, 2008 8:38 AM
To: The elegant MVC web framework
Subject: [Catalyst] Serving html pages

Hi,

I am quite new with catalyst and I'd like to know how I could serve some html 
pages (actually documentation) e.g.:
www.myapp.com/docs/index.html ?

When I try to integrate such link in my template page, Pages are not served and 
as mentioned in the C::P::Static::Simple it does not serve .html file.

Is there any magic thing to do without changing 
MyApp->config->{static}->{ignore_extensions} ?

Thanks a lot

Regards

--
-
Emmanuel Quevillon
Biological Software and Databases Group
Institut Pasteur
+33 1 44 38 95 98
tuco at_ pasteur dot fr
-

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Disclaimer:
"This message is for the named person's use only. It may contain confidential, 
proprietary or legally privileged 
information. The above information has been prepared for information purposes 
only. The above does not constitute
an offer, recommendation or solicitation to buy or sell, nor is it an official 
confirmation of terms. While the 
information herein has been obtained from sources believed to be reliable, 
Landesbank Baden-Württemberg makes 
no representation that it is accurate or complete and it should not be relied 
upon as such. Neither Landesbank
Baden-Württemberg nor any employee herein guarantees the information contained 
in this message. No confidentiality 
or privilege is waived or lost by any mistransmission. If you receive this 
message in error, please immediately 
delete it and all copies of it from your system, destroy any hard copies of it 
and notify the sender. You are 
not entitled to, directly or indirectly, use, disclose, distribute,print, or 
copy any part of this message if 
you are not the intended recipient.Any views expressed in this message are 
those of the individual sender, except
where the sender specifies and with authority, states them to be the views of 
Landesbank Baden-Wurttemberg."


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Serving html pages

2008-01-11 Thread Marcello Romani

Emmanuel Quevillon ha scritto:

Hi,

I am quite new with catalyst and I'd like to know how I could serve some 
html pages (actually documentation) e.g.:

www.myapp.com/docs/index.html ?

When I try to integrate such link in my template page, Pages are not 
served and as mentioned in the C::P::Static::Simple it does not serve 
.html file.


Is there any magic thing to do without changing 
MyApp->config->{static}->{ignore_extensions} ?


Thanks a lot

Regards



If I recall correctly, the default is to serve as static files only the 
ones under root/static, so try to put doc/ there.


P.S.: Please don't start a new thread under an existing one.

HTH

--
Marcello Romani
Responsabile IT
Ottotecnica s.r.l.
http://www.ottotecnica.com

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] hostname

2008-01-11 Thread Jason Kohles

On Jan 11, 2008, at 5:29 AM, Carl Johnstone wrote:


cookie_domain => the_host()
in the MyApp config, but when I try to start the server it gives an  
error telling that I can't use the method "req" because $c is  
undefined.


I'd be curious about why you wanted the cookie domain in the config  
anyway!




I think the idea was something along the lines of...

MyApp->config->{ 'session' }->{ 'cookie_domain' } = MyApp->request- 
>header->( 'host' );




I presume you've got a bit of code like:

$c->response->cookies->{'foo'} = { domain => $c- 
>config('cookie_domain') };


In which case why couldn't you just do

$c->response->cookies->{'foo'} = { domain => $c->req->hostname };

But anyway, what I need is working because I can avoid setting a  
domain name for the cookie.


Yeah exactly, setting the domain in the cookie to match the domain  
requested is pretty pointless anyway as that's what browsers do by  
default. About the only time you need to send a domain back is when  
you want to set a cookie across all subdomains or similar. Eg:  
{ domain => '.example.com' }





In which case you could still do something in Root/auto if you wanted  
to modify it...


my $domain_re = join( '|', qw(
mydomain.com
myotherdomain.com
foo.com
example.com
) );

sub auto : Private {
my ( $self, $c ) = @_;

if ( $c->request->header( 'host' ) =~ /(\.(?:$domain_re))$/ ) {
$c->config->{ 'session' }->{ 'cookie_domain' } = $1;
}

return 1;
}

--
Jason Kohles, RHCA RHCDS RHCE
[EMAIL PROTECTED] - http://www.jasonkohles.com/
"A witty saying proves nothing."  -- Voltaire



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Serving html pages

2008-01-11 Thread Emmanuel Quevillon

Hi,

I am quite new with catalyst and I'd like to know how I 
could serve some html pages (actually documentation) e.g.:

www.myapp.com/docs/index.html ?

When I try to integrate such link in my template page, Pages 
are not served and as mentioned in the C::P::Static::Simple 
it does not serve .html file.


Is there any magic thing to do without changing 
MyApp->config->{static}->{ignore_extensions} ?


Thanks a lot

Regards

--
-
Emmanuel Quevillon
Biological Software and Databases Group
Institut Pasteur
+33 1 44 38 95 98
tuco at_ pasteur dot fr
-

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] hostname

2008-01-11 Thread Octavian Rasnita

From: "Carl Johnstone" <[EMAIL PROTECTED]>


cookie_domain => the_host()
in the MyApp config, but when I try to start the server it gives an error 
telling that I can't use the method "req" because $c is undefined.


I'd be curious about why you wanted the cookie domain in the config 
anyway!


I presume you've got a bit of code like:

$c->response->cookies->{'foo'} = { domain => 
$c->config('cookie_domain') };


In which case why couldn't you just do

$c->response->cookies->{'foo'} = { domain => $c->req->hostname };



I needed the domain name for setting the session in MyApp.pm.

Octavian


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] hostname

2008-01-11 Thread Carl Johnstone

cookie_domain => the_host()
in the MyApp config, but when I try to start the server it gives an error 
telling that I can't use the method "req" because $c is undefined.


I'd be curious about why you wanted the cookie domain in the config anyway!

I presume you've got a bit of code like:

$c->response->cookies->{'foo'} = { domain => $c->config('cookie_domain') };

In which case why couldn't you just do

$c->response->cookies->{'foo'} = { domain => $c->req->hostname };

But anyway, what I need is working because I can avoid setting a domain 
name for the cookie.


Yeah exactly, setting the domain in the cookie to match the domain requested 
is pretty pointless anyway as that's what browsers do by default. About the 
only time you need to send a domain back is when you want to set a cookie 
across all subdomains or similar. Eg: { domain => '.example.com' }



Carl


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


RE: [Catalyst] POD viewer

2008-01-11 Thread Zukoff
Hello!

I've got an error:
[error] Caught exception in CatalystAdvent->begin "Can't locate object
method "now" via package "DateTime" (perhaps you forgot to load
"DateTime"?) at /tmp/test/Script/../lib/CatalystAdvent.pm line 57."

I've fixed it adding use DateTime;

Then i've stopped at: [error] Couldn't forward to command
"/calendar/index": Invalid action or component.

What could it be?

On Fri, 2008-01-11 at 00:59 -0600, Jonathan Rockway wrote:
> Silly quoting below, so I'm top posting.  Take that!
> 
> Anyway, the Catalyst Advent Calendar is basically a POD server.  Is it
> pretty?  No... but it is something you can cargo cult if you want.
> 
> http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/CatalystAdvent/
> 
> Regards,
> Jonathan Rockway
> 
> On Wed, 2008-01-09 at 08:19 +0100, Dami Laurent (PJ) wrote:
> > >-Message d'origine-
> > >De : Ashley [mailto:[EMAIL PROTECTED] 
> > >Envoyé : mercredi, 9. janvier 2008 04:05
> > >À : The elegant MVC web framework
> > >Objet : [Catalyst] POD viewer
> > >
> > >Through a somewhat shallow search (difficult terms to search out  
> > >effectively) of the archives and search.CPAN I can't find if anyone  
> > >has hacked up a Cat based POD viewer/Controller; like the modperl  
> > >Apache one but, one hopes, without the (early?) security issues.
> > >
> > >I want to be able to share internal POD at work to encourage both its  
> > >reading and writing.
> > >
> > >Thanks!
> > >-Ashley
> > >
> 
> The lack of a one-line attribution makes it impossible to cleanly reply
> to this message (while keeping fragments from both your reply and the
> original question).   Try to avoid this kthx.
> 
> > 
> > Hi Ashley,
> > 
> > I've hacked up a pod viewing app : see Pod::POM::Web. It's not a Catalyst 
> > app, but it's a web app, sitting in mod_perl or cgi-bin or its own Http 
> > server, and serving all pod installed in your @INC.
> > 
> > Enjoy, 
> > 
> > Laurent Dami
> > 
> > ___
> > List: Catalyst@lists.scsys.co.uk
> > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> > Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> > Dev site: http://dev.catalyst.perl.org/
> > 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] hostname

2008-01-11 Thread Knut-Olav Hoven
On Thursday 10 January 2008 21:15:25 Octavian Rasnita wrote:
> From: "Ash Berlin" <[EMAIL PROTECTED]>
>
> > How did you get to a function in MyApp.pm during a request
> >
> > # in MyApp.pm
> >
> > sub foobarbaz {
> >my ($c) = @_;
> > }
> >
> > # In controller code.
> > $c->foobarbaz();
> >
> > Make sense?
>
> Not really.
>
> I've tried (in MyApp.pm):
>
> sub the_host {
> my ($c) = @_;
> return $c->req->hostname;
> }
>
> and then I've tried to use
>
> cookie_domain => the_host()
> in the MyApp config, but when I try to start the server it gives an error
> telling that I can't use the method "req" because $c is undefined.

You could use MyApp::Root::auto to lookup the hostname from the request and 
set it in config as you wish.

Example:

# MyApp::Root;
sub auto : Private {
  my ( $self, $c ) = @_;
  $c->config->{cookie_domain} = $c->req->hostname;
}

>
> But anyway, what I need is working because I can avoid setting a domain
> name for the cookie.
>
> Octavian
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/



-- 
Knut-Olav Hoven
Systemutvikler   mob: +47 986 71 700
Linpro AShttp://www.linpro.no/


signature.asc
Description: This is a digitally signed message part.
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: POD viewer

2008-01-11 Thread Aristotle Pagaltzis
* Ashley <[EMAIL PROTECTED]> [2008-01-11 08:15]:
> I don't know if the code is pretty yet but the presentation is
> quite nice.

The Pod::Xhtml module used internally is really pretty terrible,
though. It is written for one use-case and one use-case only. As
long as you don’t try to do anything non-trivial, it’ll work OK,
but beware if you want to do anything interesting, like extract
and convert parts of the document.

Regards,
-- 
Aristotle Pagaltzis // 

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/