Re: [Catalyst] PathPart help

2007-11-16 Thread Jonas Alves
On 11/16/07, Jason Kohles <[EMAIL PROTECTED]> wrote:
> On Nov 16, 2007, at 11:11 AM, Christopher H. Laco wrote:
>
> sub has_user : Chained('id|name|email') NoPathPart CaptureArgs(0) { }
> sub edit : Chained('has_user') PathPart('edit') Args(0) { }
>

That NoPathPart you already have with an empty PathPart('').

-- 
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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


RE: [Catalyst] Fancy graphing -> like Google Finance, anybody done it?

2007-11-16 Thread Dylan Vanderhoof
I wonder if something like this could be made to work with RRD (and not perform 
like ass)

-D

> -Original Message-
> From: Mesdaq, Ali [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 16, 2007 11:19 AM
> To: The elegant MVC web framework; The elegant MVC web framework
> Subject: RE: [Catalyst] Fancy graphing -> like Google
> Finance, anybody done it?
>
>
> http://www.fusioncharts.com/
> Super easy and pretty fancy. But not sure it can do exact
> google finance
> type stuff.
>
> Thanks,
> --
> Ali Mesdaq
> Security Researcher II
> Websense Security Labs
> http://www.WebsenseSecurityLabs.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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Fancy graphing -> like Google Finance, anybody done it?

2007-11-16 Thread Ricardo Botelho de Sousa
Hello,
On Friday 16 November 2007 20:04:35 Hartmaier Alexander wrote:
> I do network monitoring graphs, great links guys!

I'd like to promote plotkit
  http://www.liquidx.net/plotkit/

Which I haven't had the chance to use yet!

regards
-- 
ServiSMART  Ricardo Sousa
servimos o seu negócio  tel: +351 96 298 0989

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


Re: [Catalyst] Fancy graphing -> like Google Finance, anybody done it?

2007-11-16 Thread Dave Rolsky

On Fri, 16 Nov 2007, Steve Atkins wrote:


Open flash chart. It's flash, but you don't have to write any flash.
http://teethgrinder.co.uk/open-flash-chart/


Funny you should mention this. I'm about to upload a distro to CPAN which 
provides a high-level API for generating data for OFC. The Perl API it 
comes with is garbage, and the data format is insane, but it makes pretty 
graphs so I decided to try to make a nice API for it.


It's called Chart::OFC and I'll upload it later today, I think.


-dave

/*===
VegGuide.Orgwww.BookIRead.com
Your guide to all that's veg.   My book blog
===*/

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


RE: [Catalyst] Fancy graphing -> like Google Finance, anybody done it?

2007-11-16 Thread Hartmaier Alexander
I do network monitoring graphs, great links guys!
Thanks!

-Alex

-Original Message-
From: Mesdaq, Ali [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 16, 2007 8:19 PM
To: The elegant MVC web framework; The elegant MVC web framework
Subject: RE: [Catalyst] Fancy graphing -> like Google Finance, anybody done it?

http://www.fusioncharts.com/
Super easy and pretty fancy. But not sure it can do exact google finance
type stuff.

Thanks,
--
Ali Mesdaq
Security Researcher II
Websense Security Labs
http://www.WebsenseSecurityLabs.com
--


-Original Message-
From: Dustin Suchter [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 16, 2007 10:08 AM
To: The elegant MVC web framework
Subject: [Catalyst] Fancy graphing -> like Google Finance, anybody done
it?

I know it is easy enough to generate graphics in Perl and Catalyst.
I've also seen a few ways to do DHTML/AJAX style menus in Catalyst
apps. I'd like to implement something like Google Finance's charts
in a reporting system as part of a Catalyst app I'm building.

Personally, I don't care if the back-end uses XML or not, but I
would like to see dynamic graphical information like this chart:
http://tinyurl.com/2n4kbt

I don't mind heavy JavaScript usage but I'd like to keep my core
language to just Perl, i.e. I don't want to have to write any Java
or Flash.

Anybody done this before? Anybody seen this done somewhere else before?

-d

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


 TO REPORT THIS AS SPAM, PLEASE CLICK THE FOLLOWING LINK: 
https://www.mailcontrol.com/sr/Tor6huKAjdTOZyQh3pxe626olFd+YxExX78Qca3db
!!BuD6YSup4eud+uJlWsRGWR4vaJT7Qgb+TSKJfjwai3eg0rMsRa!8NNdJxaXi+DXG6r7tF1
+l!XNRzFHVtL1hgGmH+Y79XS9yRgPhEG3wDDDz1I0fkPv5JJWudzCwMP7nqzBcd5IkwiLI0m
cqMRYEonuTFzL7bmwKAAmygwhHxQJXLigAXOcvr  

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

*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then delete 
this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Fancy graphing -> like Google Finance, anybody done it?

2007-11-16 Thread Dustin Suchter
I know it is easy enough to generate graphics in Perl and Catalyst.
I've also seen a few ways to do DHTML/AJAX style menus in Catalyst
apps. I'd like to implement something like Google Finance's charts
in a reporting system as part of a Catalyst app I'm building.

Personally, I don't care if the back-end uses XML or not, but I
would like to see dynamic graphical information like this chart:
http://tinyurl.com/2n4kbt

I don't mind heavy JavaScript usage but I'd like to keep my core
language to just Perl, i.e. I don't want to have to write any Java
or Flash.

Anybody done this before? Anybody seen this done somewhere else before?

-d

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


RE: [Catalyst] Fancy graphing -> like Google Finance, anybody done it?

2007-11-16 Thread Mesdaq, Ali
http://www.fusioncharts.com/
Super easy and pretty fancy. But not sure it can do exact google finance
type stuff.

Thanks,
--
Ali Mesdaq
Security Researcher II
Websense Security Labs
http://www.WebsenseSecurityLabs.com
--


-Original Message-
From: Dustin Suchter [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 16, 2007 10:08 AM
To: The elegant MVC web framework
Subject: [Catalyst] Fancy graphing -> like Google Finance, anybody done
it?

I know it is easy enough to generate graphics in Perl and Catalyst.
I've also seen a few ways to do DHTML/AJAX style menus in Catalyst
apps. I'd like to implement something like Google Finance's charts
in a reporting system as part of a Catalyst app I'm building.

Personally, I don't care if the back-end uses XML or not, but I
would like to see dynamic graphical information like this chart:
http://tinyurl.com/2n4kbt

I don't mind heavy JavaScript usage but I'd like to keep my core
language to just Perl, i.e. I don't want to have to write any Java
or Flash.

Anybody done this before? Anybody seen this done somewhere else before?

-d

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


 TO REPORT THIS AS SPAM, PLEASE CLICK THE FOLLOWING LINK: 
https://www.mailcontrol.com/sr/Tor6huKAjdTOZyQh3pxe626olFd+YxExX78Qca3db
!!BuD6YSup4eud+uJlWsRGWR4vaJT7Qgb+TSKJfjwai3eg0rMsRa!8NNdJxaXi+DXG6r7tF1
+l!XNRzFHVtL1hgGmH+Y79XS9yRgPhEG3wDDDz1I0fkPv5JJWudzCwMP7nqzBcd5IkwiLI0m
cqMRYEonuTFzL7bmwKAAmygwhHxQJXLigAXOcvr  

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


Re: [Catalyst] PathPart help

2007-11-16 Thread Jason Kohles

On Nov 16, 2007, at 11:11 AM, Christopher H. Laco wrote:


Interesting twist. Reminds me of the RHOX stuff..

users/id/
users/name/

etc. Damnit. Now you have me thinking again. That setup is a great
reason to keep REST and web controllers seperated. :/




The only problem with it is that I would love to be able to do this,  
but so far I haven't come up with a reasonable way to say 'chain from  
any of these controllers'.   i.e. it would be really nice to be able  
to do this:


sub base : Chained('/') PathPart('users') CaptureArgs(0) { }

sub id : Chained('base') PathPart('id') CaptureArgs(1) { }
sub name : Chained('base') PathPart('name') CaptureArgs(1) { }
sub email : Chained('base') PathPart('email') CaptureArgs(1) { }

And then be able to base later controllers on any of these, something  
like:


sub edit : Chained('id','name','email') PathPart('edit') Args(0) { }

I would also be nice to be able to have chain elements that didn't  
correspond to URLs, so you could do something like this:


sub has_user : Chained('id|name|email') NoPathPart CaptureArgs(0) { }
sub edit : Chained('has_user') PathPart('edit') Args(0) { }


I keep planning to dig into the dispatcher and figure out how to  
implement this (and multiple PathParts), but never enough TUITs...


--
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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Fancy graphing -> like Google Finance, anybody done it?

2007-11-16 Thread Steve Atkins


On Nov 16, 2007, at 10:07 AM, Dustin Suchter wrote:


I know it is easy enough to generate graphics in Perl and Catalyst.
I've also seen a few ways to do DHTML/AJAX style menus in Catalyst
apps. I'd like to implement something like Google Finance's charts
in a reporting system as part of a Catalyst app I'm building.

Personally, I don't care if the back-end uses XML or not, but I
would like to see dynamic graphical information like this chart:
http://tinyurl.com/2n4kbt

I don't mind heavy JavaScript usage but I'd like to keep my core
language to just Perl, i.e. I don't want to have to write any Java
or Flash.

Anybody done this before? Anybody seen this done somewhere else  
before?


Open flash chart. It's flash, but you don't have to write any flash.
http://teethgrinder.co.uk/open-flash-chart/

WebFX also has a nice client-side chart widget, but I don't know
whether it does anything interactive.
http://webfx.eae.net/dhtml/chart/demo.html

Cheers,
  Steve


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


Re: [Catalyst] Switching between different databases during a session

2007-11-16 Thread Matt S Trout
On Thu, Nov 15, 2007 at 07:01:53PM -0800, Andrew Peebles wrote:
> Andrew Peebles wrote:
> >I've been searching and experimenting and have not found a solution ...
> >
> >I have multiple instances of a database (each in a separate sqlite db 
> >file), same schema, different data.  Each represents a snapshot of 
> >something at a particular time.  During a session, user wants switch 
> >among these databases.  I am trying to add a method to my Model 
> >(Catalyst::Model::DBIC::Schema) that takes a new connection string, 
> >and switches to that database ... all things otherwise remaining the 
> >same.  Seems relatively simple, but I just ain't getting it.  Lots of 
> >hints on the list, but nothing I can find that's helping.
> >
> >I've tried a lot of variants on something like this:
> >
> >package SMART::Model::SMARTDB;
> >
> >use strict;
> >use base 'Catalyst::Model::DBIC::Schema';
> >
> >my $dsn = $ENV{MY_DSN} ||= 
> >'dbi:SQLite:/auto/project/tools/metadot/html/cgi/SMART/smart.db';
> >
> >__PACKAGE__->config(
> >   schema_class => 'SMARTDB',
> >   connect_info => [
> >   $dsn,
> >   '',
> >   '',
> >   {AutoCommit => 1},
> > ],
> >);
> >
> >sub switch {
> >   my $self = shift;
> >   my $dsn  = shift;
> >
> >   my $connect_info = [ @{$self->{connect_info}} ];
> >   $$connect_info[0] = $dsn;
> >
> >   my $schema = $self->clone();
> >   $schema->connection(@$connect_info);
> >   $self->schema($schema);
> >}
> >
> >1;
>
> Well ... in fact the code above works like a charm.  I had a problem in 
> another part of my environment that was making this look like it didn't 
> work, but it does.  Be nice to add this piece of code to one of the 
> Cookbooks somewhere, maybe.

Maybe if you rewrote it to use Catalyst::Component::InstancePerContext it'd
make a good cookbook entry.

Your current approach is, frankly, scary - you're mutating a global object
without regard for what the next request is going to expect. I wouldn't let
this code anywhere near a production system.

-- 
  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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] PathPart help

2007-11-16 Thread Matt S Trout
On Thu, Nov 15, 2007 at 11:47:34AM -0800, Les Fletcher wrote:
> I have question about setting up PathPart's and Chaining.  I am trying 
> to set something that has the following look:
> 
> /namespace/ => This lists out a list of objects
> /namespace/ => displays detail information about the object with the 
> numeric id=
> /namespace//edit => brings up a form to edit object with numeric id=
> /namespace/create => brings up a form to create a new object
> 
> When the Chained actions are printed out everything looks fine, but when 
> I goto "/namespace/create" it matches the "/namespace/" view 
> action.  Needless to say, there isn't an object with the numeric id of 
> "create."

Try upgrading to absolute latest Catalyst, I'm sure somebody patched this.

If that doesn't help, I'd suggest using

/namespace/id//edit

which is what I always use anyway, in case I need to change to string ids
later (slightly obsessive future-proofing but I've long since decided it's
not paranoia and the requirements changes -are- out to get me :).

-- 
  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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] PathPart help

2007-11-16 Thread Christopher H. Laco
Matt S Trout wrote:
> On Thu, Nov 15, 2007 at 11:47:34AM -0800, Les Fletcher wrote:
>> I have question about setting up PathPart's and Chaining.  I am trying 
>> to set something that has the following look:
>>
>> /namespace/ => This lists out a list of objects
>> /namespace/ => displays detail information about the object with the 
>> numeric id=
>> /namespace//edit => brings up a form to edit object with numeric id=
>> /namespace/create => brings up a form to create a new object
>>
>> When the Chained actions are printed out everything looks fine, but when 
>> I goto "/namespace/create" it matches the "/namespace/" view 
>> action.  Needless to say, there isn't an object with the numeric id of 
>> "create."
> 
> Try upgrading to absolute latest Catalyst, I'm sure somebody patched this.
> 
> If that doesn't help, I'd suggest using
> 
> /namespace/id//edit

Interesting twist. Reminds me of the RHOX stuff..

users/id/
users/name/

etc. Damnit. Now you have me thinking again. That setup is a great
reason to keep REST and web controllers seperated. :/


-=Chris



signature.asc
Description: OpenPGP digital signature
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Storing DateTime in session causes warning

2007-11-16 Thread Jason Kohles

On Nov 16, 2007, at 6:39 AM, Tobias Kremer wrote:


Tobias Kremer wrote:
I'm storing a DateTime object in $c->session and I just realized  
that

this is causing the following warning on every request:

"Use of uninitialized value in subroutine entry at ../../lib/ 
Storable.pm

(autosplit into ../../lib/auto/Storable/_freeze.al) line 290."



What version of DateTime::Locale do you guys have?
0.32 had a bug in it that didn't play nice with storable, so make  
sure you

have the latest.


I'm on v0.35, so unfortunately it's not the culprit :(

Maybe not that specific bug, but I was unable to recreate the problem  
with 0.41...


--
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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] [ANNOUNCE] DBIx::Class 0.08008

2007-11-16 Thread Ash Berlin
Has jut hit CPAN. Expect it on your mirrors by tomorrow (if its not, 
then pick a mirror that doesn't suck.)


Changes for this version duplicated below:

0.08008 2007-11-16 14:30:00
   - Fixed join merging bug (test from Zby)
   - When adding relationships, it will throw an exception if you 
get the

 foreign and self parts the wrong way round in the condition
   - ResultSetColumn::func() now returns all results if called in list
 context; this makes things like func('DISTINCT') work as expected
   - Many-to-many relationships now warn if the utility methods would
 clash
   - InflateColumn::DateTime now accepts an extra parameter of timezone
 to set timezone on the DT object (thanks Sergio Salvi)
   - Added sqlt_deploy_hook to result classes so that indexes can be
 added.
   - Added startup checks to warn loudly if we appear to be running on
 RedHat systems from perl-5.8.8-10 and up that have the 
bless/overload

 patch applied (badly) which causes 2x -> 100x performance penalty.
 (Jon Schutz)
   - ResultSource::reverse_relationship_info can distinguish between
 sources using the same table
   - Row::insert will now not fall over if passed duplicate related 
objects

   - Row::copy will not fall over if you have two relationships to the
 same source with a unique constraint on it

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


Re: [Catalyst] Storing DateTime in session causes warning

2007-11-16 Thread Tobias Kremer
Quoting Jason Kohles <[EMAIL PROTECTED]>:

>  Tobias Kremer wrote:
>  I'm storing a DateTime object in $c->session and I just realized
>  that
>  this is causing the following warning on every request:
> 
>  "Use of uninitialized value in subroutine entry at ../../lib/
>  Storable.pm
>  (autosplit into ../../lib/auto/Storable/_freeze.al) line 290."
> >
> >> What version of DateTime::Locale do you guys have?
> >> 0.32 had a bug in it that didn't play nice with storable, so make
> >> sure you
> >> have the latest.
> >
> > I'm on v0.35, so unfortunately it's not the culprit :(
> >
> Maybe not that specific bug, but I was unable to recreate the problem
> with 0.41...

My DateTime version is 0.41, too. DateTime::Locale is a separate module
with v0.35 being the latest version.

--Tobias

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


Re: [Catalyst] Storing DateTime in session causes warning

2007-11-16 Thread Ruben Fonseca

On Fri, 2007-11-16 at 12:39 +0100, Tobias Kremer wrote:
> > > Tobias Kremer wrote:
> > > > I'm storing a DateTime object in $c->session and I just realized that
> > > > this is causing the following warning on every request:
> > > >
> > > > "Use of uninitialized value in subroutine entry at ../../lib/Storable.pm
> > > > (autosplit into ../../lib/auto/Storable/_freeze.al) line 290."
> 
> > What version of DateTime::Locale do you guys have?
> > 0.32 had a bug in it that didn't play nice with storable, so make sure you
> > have the latest.
> 
> I'm on v0.35, so unfortunately it's not the culprit :(

Just to report I'm feeling the same symptom on 0.35 too. Didn't try
earlier versions. On a specific case, this warning is causing me an
error when passing the DateTime object from the session to the database.

Ruben


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


Re: [Catalyst] PathPart help

2007-11-16 Thread Jason Kohles

On Nov 15, 2007, at 11:31 PM, Les Fletcher wrote:

That one seems to use as explicit "view" at the end of the url  
instead of having the identifier be the last piece of the url.


To have one without the 'view', just use an empty PathPart like  
'default' below...


The one problem with your design though, is the trouble with being  
able to support either an id or an argument (like 'create') as the  
second item in the field.  Because of the problems with that, I  
usually use an explicit 'id' part to identify where the id starts,  
like so...


sub base : Chained('/') PathPart('namespace') CaptureArgs(0) { }

sub id : Chained('base') PathPart('id') CaptureArgs(1) {
my ( $self, $c, $id ) = @_;
$c->stash->{ 'object' } $c->model( 'MyModel' )->find( $id );
}

sub edit : Chained('id') PathPart('edit') Args(0) { }

sub view : Chained('id') PathPart('view') Args(0) { }

sub default : Chained('id') PathPart('') Args(0) {
my ( $self, $c ) = @_;
$c->forward( 'view' );
}

sub create : Chained('base') PathPart('create') Args(0) { }

This way things that you can do without a specific object (like  
'create', 'list', 'search') just get chained to 'base', while things  
that require an object ('edit', 'view', 'delete') get chained to 'id',  
which is responsible for finding and stashing the object (I also  
usually put the access control stuff there to determine if the user is  
allowed to view/edit/delete that object.)




Peter Karman wrote:

Les Fletcher wrote on 11/15/07 1:47 PM:

I have question about setting up PathPart's and Chaining.  I am  
trying

to set something that has the following look:

/namespace/ => This lists out a list of objects
/namespace/ => displays detail information about the object  
with the

numeric id=
/namespace//edit => brings up a form to edit object with numeric
id=
/namespace/create => brings up a form to create a new object




This controller implements that exact API:

http://search.cpan.org/~karman/Catalyst-Controller-Rose-0.04/lib/Catalyst/Controller/Rose/CRUD.pm




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



--
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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Storing DateTime in session causes warning

2007-11-16 Thread Tobias Kremer
> > Tobias Kremer wrote:
> > > I'm storing a DateTime object in $c->session and I just realized that
> > > this is causing the following warning on every request:
> > >
> > > "Use of uninitialized value in subroutine entry at ../../lib/Storable.pm
> > > (autosplit into ../../lib/auto/Storable/_freeze.al) line 290."

> What version of DateTime::Locale do you guys have?
> 0.32 had a bug in it that didn't play nice with storable, so make sure you
> have the latest.

I'm on v0.35, so unfortunately it's not the culprit :(

--Tobias

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