[Catalyst] Re: Catalyst Digest, Vol 22, Issue 26

张淼 yourselfzm at gmail.com
Thu May 24 07:36:34 GMT 2007


__PACAKGE__->deny_access_unless( "/foo/bar", [qw/admin user/] );

The "user" can't access /foo/bar.
What's the matter with it?
Thanks!


2006/12/8, catalyst-request at lists.rawmode.org <
catalyst-request at lists.rawmode.org>:
>
> Send Catalyst mailing list submissions to
>         catalyst at lists.rawmode.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.rawmode.org/mailman/listinfo/catalyst
> or, via email, send a message with subject or body 'help' to
>         catalyst-request at lists.rawmode.org
>
> You can reach the person managing the list at
>         catalyst-owner at lists.rawmode.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Catalyst digest..."
>
>
> Today's Topics:
>
>    1. Re: Re: AJAX under application/xhtml+xml (John Napiorkowski)
>    2. Re: Re: AJAX under application/xhtml+xml (Daniel McBrearty)
>    3. Mason configuration in YAML (Marc Logghe)
>    4. Authorization::ACL - basic question (Will Smith)
>    5. Re: Request for comments: model class for REST queries
>       (Adam Jacob)
>    6. Re: Re: AJAX under application/xhtml+xml (Ashley Pond V)
>    7. Re: Mason configuration in YAML (Kevin Old)
>    8. Re: Request for comments: model class for REST queries
>       (Christopher Heschong)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 7 Dec 2006 06:10:58 -0800 (PST)
> From: John Napiorkowski <jjn1056 at yahoo.com>
> Subject: Re: [Catalyst] Re: AJAX under application/xhtml+xml
> To: The elegant MVC web framework <catalyst at lists.rawmode.org>
> Message-ID: <555936.23651.qm at web30414.mail.mud.yahoo.com>
> Content-Type: text/plain; charset=3Diso-8859-1
>
> --- Ashley Pond V <apv at sedition.com> wrote:
>
> > On Wednesday, Dec 6, 2006, at 21:06 US/Pacific, A.
> > Pagaltzis wrote:
> > > * apv <apv at sedition.com> [2006-12-07 01:35]:
> > >> Does anyone have sample code of anything AJAXy
> > (don't care
> > >> about the library or if it's hand rolled) that
> > runs under
> > >> application/xhtml+xml?
> > >
> > > Why do you want to serve that?
> > Just to be a tough guy. :) Trying to stay on top of
> > things,
> > I suppose. "Do it right." Start to move into the
> > sort of space
> > jrock was talking about on another thread where you
> > can serve
> > all your content in the same way and let the
> > presentation layers
> > decide the rest.
> > >
> > >> By default Prototype puts out incompatible script
> > tags and
> > >> I know in the past some of y'all said you like
> > other libraries
> > >> better anyway.
> > >
> > > jQuery works OOTB in real XHTML. Go take a look at
> > the docs on
> > > the website. If the tutorial and code samples
> > don't make you Want
> > > Now, nothing I say will be able to. :-)
> > >
> > > (Don't miss the handy reference at
> > <http://visualjquery.com> if
> > > you go for it.)
> > That's great. I looked at it quite awhile back but
> > never
> > played with it. I'll give it a spin.
>
> Just another thumbs up for Jquery.  I found I could
> use this for almost everything I do javascript-wise.
> There is a companion project called 'Interface' which
> has a whole bunch of additional dynamic controls if
> you need them.  The community is very active as well.
>
> --john
>
> >
> >
> > -Ashley
> > (I just realized I upper-cased Ajax before, sigh).
> >
> >
> > _______________________________________________
> > List: Catalyst at lists.rawmode.org
> > Listinfo:
> > http://lists.rawmode.org/mailman/listinfo/catalyst
> > Searchable archive:
> >
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> > Dev site: http://dev.catalyst.perl.org/
> >
>
>
>
>
>
> _________________________________________________________________________=
___________
> Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try it
> now.
>
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 7 Dec 2006 16:53:33 +0100
> From: "Daniel McBrearty" <danielmcbrearty at gmail.com>
> Subject: Re: [Catalyst] Re: AJAX under application/xhtml+xml
> To: "The elegant MVC web framework" <catalyst at lists.rawmode.org>
> Message-ID:
>         <9cf113670612070753s5bb2e5f6x810533bff50b3b41 at mail.gmail.com>
> Content-Type: text/plain; charset=3DISO-8859-1; format=3Dflowed
>
> i just looked at the tutorial, a lot more clear and to the point than
> other libs I have looked at. Think I'm gonna go with it.
>
>
> On 12/7/06, John Napiorkowski <jjn1056 at yahoo.com> wrote:
> > --- Ashley Pond V <apv at sedition.com> wrote:
> >
> > > On Wednesday, Dec 6, 2006, at 21:06 US/Pacific, A.
> > > Pagaltzis wrote:
> > > > * apv <apv at sedition.com> [2006-12-07 01:35]:
> > > >> Does anyone have sample code of anything AJAXy
> > > (don't care
> > > >> about the library or if it's hand rolled) that
> > > runs under
> > > >> application/xhtml+xml?
> > > >
> > > > Why do you want to serve that?
> > > Just to be a tough guy. :) Trying to stay on top of
> > > things,
> > > I suppose. "Do it right." Start to move into the
> > > sort of space
> > > jrock was talking about on another thread where you
> > > can serve
> > > all your content in the same way and let the
> > > presentation layers
> > > decide the rest.
> > > >
> > > >> By default Prototype puts out incompatible script
> > > tags and
> > > >> I know in the past some of y'all said you like
> > > other libraries
> > > >> better anyway.
> > > >
> > > > jQuery works OOTB in real XHTML. Go take a look at
> > > the docs on
> > > > the website. If the tutorial and code samples
> > > don't make you Want
> > > > Now, nothing I say will be able to. :-)
> > > >
> > > > (Don't miss the handy reference at
> > > <http://visualjquery.com> if
> > > > you go for it.)
> > > That's great. I looked at it quite awhile back but
> > > never
> > > played with it. I'll give it a spin.
> >
> > Just another thumbs up for Jquery.  I found I could
> > use this for almost everything I do javascript-wise.
> > There is a companion project called 'Interface' which
> > has a whole bunch of additional dynamic controls if
> > you need them.  The community is very active as well.
> >
> > --john
> >
> > >
> > >
> > > -Ashley
> > > (I just realized I upper-cased Ajax before, sigh).
> > >
> > >
> > > _______________________________________________
> > > List: Catalyst at lists.rawmode.org
> > > Listinfo:
> > > http://lists.rawmode.org/mailman/listinfo/catalyst
> > > Searchable archive:
> > >
> > http://www.mail-archive.com/catalyst@lists.rawmode.org/
> > > Dev site: http://dev.catalyst.perl.org/
> > >
> >
> >
> >
> >
> >
> _________________________________________________________________________=
___________
> > Any questions? Get answers on any topic at www.Answers.yahoo.com.  Try
> it now.
> >
> > _______________________________________________
> > List: Catalyst at lists.rawmode.org
> > Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> > Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> > Dev site: http://dev.catalyst.perl.org/
> >
>
>
> --
> Daniel McBrearty
> email : danielmcbrearty at gmail.com
> www.engoi.com : the multi - language vocab trainer
> BTW : 0873928131
>
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 7 Dec 2006 17:16:42 +0100
> From: "Marc Logghe" <Marc.Logghe at DEVGEN.com>
> Subject: [Catalyst] Mason configuration in YAML
> To: "The elegant MVC web framework" <catalyst at lists.rawmode.org>
> Message-ID:
>         <0C528E3670D8CE4B8E013F6749231AA6D3DACF at ANTARESIA.be.devgen.com>
> Content-Type: text/plain; charset=3D"us-ascii"
>
> Hi there,
> I am struggling with the configuration of the Mason view in YAML.
> I have this:
> View::Mason:
>   comp_root: __path_to(mason/root)__
>   data_dir: __path_to(mason/data)__
>
> But as it seems, it is never taken into account. I have also tried
> forcing an array ref, whithout any succes:
> View::Mason:
>   -
>     comp_root: __path_to(mason/root)__
>     data_dir: __path_to(mason/data)__
>
> What am I doing wrong ?
> Regards,
> Marc
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.scsys.co.uk/pipermail/catalyst/attachments/20061207/7d260c70=
/attachment-0001.htm
>
> ------------------------------
>
> Message: 4
> Date: Thu, 7 Dec 2006 09:09:24 -0800 (PST)
> From: Will Smith <willbelair at yahoo.com>
> Subject: [Catalyst] Authorization::ACL - basic question
> To: catalyst <catalyst at lists.rawmode.org>
> Message-ID: <20061207170924.4751.qmail at web54510.mail.yahoo.com>
> Content-Type: text/plain; charset=3D"iso-8859-1"
>
> Hi, sorry if I ask a question that has been answered.
> How could I block out the whole set of actions instead of setting for
> each. For example:
> instead of doing authorization for each of action in books,pm controller
> such as:
> __PACKAGE__->deny_access_unless(
>              "/books/delete",
>              [qw/adminr/],
>          );
> __PACKAGE__->deny_access_unless(
>              "/books/edit",
>              [qw/admin/],
>          );
>
> Is there a general way do block the whole "/books" ? I've tried that and
> it hung.
>
> Thank you
>
>
> ---------------------------------
> Everyone is raving about the all-new Yahoo! Mail beta.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.scsys.co.uk/pipermail/catalyst/attachments/20061207/3de6217d=
/attachment-0001.htm
>
> ------------------------------
>
> Message: 5
> Date: Thu, 7 Dec 2006 09:28:57 -0800
> From: Adam Jacob <adam at stalecoffee.org>
> Subject: Re: [Catalyst] Request for comments: model class for REST
>         queries
> To: The elegant MVC web framework <catalyst at lists.rawmode.org>
> Message-ID: <20061207172857.GA2008 at stalecoffee.org>
> Content-Type: text/plain; charset=3Dus-ascii
>
> On Wed, Dec 06, 2006 at 10:08:08AM -0500, Christopher Heschong wrote:
> > Hi, I've created a simple library to make calls to REST services, along
> > with an associated Catalyst model, and wanted to get some feedback.  The
> > class itself is called CRUST and basically it's just some very simple
> glue
> > for URI, LWP, XML::Simple (although any other serialization formatters
> are
> > supported). GET and POST are supported of course.
>
> My first thought is that you are going to need to support the full range
> of HTTP Methods.  At the very least, you will need: GET, POST, PUT and
> DELETE.  You probably want to support OPTIONS and HEAD as well.
>
> > Here's an example of how I might use it to talk to Yahoo! Answers:
> >
> >   # Create a CRUST model
> >   package MyApp::Model::Amazon;
> >   use base 'Catalyst::Model::CRUST';
> >
> >   __PACKAGE__->config(
> >     base =3D> 'http://answers.yahooapis.com/AnswersService/V1/',
> >     query =3D> { appid =3D> 'YahooDemo' }
> >   );
>
> The query part might be better named "params", since that's what
> Catalyst uses.
>
> >   # Meanwhile in a controller nearby
> >   $c->stash->{answers} =3D $c->model('YahooAnswers')->get(
> 'questionSearch',
> >       query =3D> $c->req->param('query')
> >   );
>
> Ew!  Do they really have URLs like questionSearch and getByCategory?
> Very un-RESTful.
>
> > Does anyone find this useful?  SVN snapshot is available:
> >   http://svn.screwdriver.net/repos/code/CRUST
> >
> > Should this sort of thing being uploaded to CPAN?  Anyone want to review
> > the code beforehand?
>
> Something like this is both useful and good.  I'm not certain what the
> best way to implement it is.  I'll try and find some time to look at
> your code soon.
>
> Adam
>
>
>
>
> ------------------------------
>
> Message: 6
> Date: Thu, 7 Dec 2006 10:22:40 -0800
> From: Ashley Pond V <apv at sedition.com>
> Subject: Re: [Catalyst] Re: AJAX under application/xhtml+xml
> To: The elegant MVC web framework <catalyst at lists.rawmode.org>
> Message-ID: <EC9121F1-861F-11DB-BD7E-003065B0FEEE at sedition.com>
> Content-Type: text/plain; charset=3DUS-ASCII; format=3Dflowed
>
> On Thursday, Dec 7, 2006, at 07:53 US/Pacific, Daniel McBrearty wrote:
> > i just looked at the tutorial, a lot more clear and to the point than
> > other libs I have looked at. Think I'm gonna go with it.
>
> I had a little proof of concept Ajax demo up in about 10 minutes; just
> as long as it took to skim the docs. I haven't played with the other
> libraries but I think jQuery is super nice and especially readable.
> Skimming the base code, it also looks really cleanly done. Terrific.
>
> -Ashley
> --
>
>
>
>
> ------------------------------
>
> Message: 7
> Date: Thu, 7 Dec 2006 14:37:17 -0500
> From: "Kevin Old" <kevinold at gmail.com>
> Subject: Re: [Catalyst] Mason configuration in YAML
> To: "The elegant MVC web framework" <catalyst at lists.rawmode.org>
> Message-ID:
>         <69d3ac770612071137l190295b8u2bee349677673d1 at mail.gmail.com>
> Content-Type: text/plain; charset=3DISO-8859-1; format=3Dflowed
>
> Hi Mark,
>
> I'm pretty sure you need to do it like this:
>
> In your YAML file specify comp_root and data_dir:
>
> comp_root: __path_to(mason/root)__
> data_dir: __path_to(mason/data)__
>
> then in Mason.pm you can use it like this:
> package MyApp::View::Mason;
>
> use base 'Catalyst::View::Mason';
>
> __PACKAGE__->config->{DEBUG} =3D 'all';
> __PACKAGE__->config->{comp_root} =3D $c->config->{comp_root};
> __PACKAGE__->config->{data_dir} =3D $c->config->{data_dir};
>
> 1;
>
> Catalyst::View::Mason doesn't look for these by default (like
> Catalyst::Plugin::Session, for instance) which is why you have to
> specify them in the Mason.pm.
>
> HTH,
> Kevin
>
> On 12/7/06, Marc Logghe <Marc.Logghe at devgen.com> wrote:
> >
> >
> > Hi there,
> > I am struggling with the configuration of the Mason view in YAML.
> > I have this:
> > View::Mason:
> >   comp_root: __path_to(mason/root)__
> >   data_dir: __path_to(mason/data)__
> >
> > But as it seems, it is never taken into account. I have also tried
> forcing
> > an array ref, whithout any succes:
> > View::Mason:
> >   -
> >     comp_root: __path_to(mason/root)__
> >     data_dir: __path_to(mason/data)__
> >
> > What am I doing wrong ?
> > Regards,
> > Marc
> > _______________________________________________
> > List: Catalyst at lists.rawmode.org
> > Listinfo:
> > http://lists.rawmode.org/mailman/listinfo/catalyst
> > Searchable archive:
> > http://www.mail-archive.com/catalyst@lists.rawmode.org/
> > Dev site: http://dev.catalyst.perl.org/
> >
> >
> >
>
>
> --
> Kevin Old
> kevinold at gmail.com
>
>
>
> ------------------------------
>
> Message: 8
> Date: Thu, 7 Dec 2006 15:14:19 -0500
> From: Christopher Heschong <chris at wiw.org>
> Subject: Re: [Catalyst] Request for comments: model class for REST
>         queries
> To: The elegant MVC web framework <catalyst at lists.rawmode.org>
> Message-ID: <21D7D128-3378-4E74-924B-35AED69D4709 at wiw.org>
> Content-Type: text/plain; charset=3D"us-ascii"
>
> Adam, thanks for the feedback and suggestions!  See below for more
> comments:
>
> On Dec 7, 2006, at 12:28 PM, Adam Jacob wrote:
>
> > On Wed, Dec 06, 2006 at 10:08:08AM -0500, Christopher Heschong wrote:
> >> Hi, I've created a simple library to make calls to REST services,
> >> along
> >> with an associated Catalyst model, and wanted to get some
> >> feedback.  The
> >> class itself is called CRUST and basically it's just some very
> >> simple glue
> >> for URI, LWP, XML::Simple (although any other serialization
> >> formatters are
> >> supported). GET and POST are supported of course.
> >
> > My first thought is that you are going to need to support the full
> > range
> > of HTTP Methods.  At the very least, you will need: GET, POST, PUT and
> > DELETE.  You probably want to support OPTIONS and HEAD as well.
>
>
> Thanks.  There are ->get and ->post methods already, plus ->request
> ($method, ...) for any other method LWP supports if you need those.
> But it's probably a good idea to add them as methods by default.
> Although what would you really expect to get back from OPTIONS?  I'm
> sort of expecting some XML or something back now.
>
> >
> >> Here's an example of how I might use it to talk to Yahoo! Answers:
> >>
> >>   # Create a CRUST model
> >>   package MyApp::Model::Amazon;
> >>   use base 'Catalyst::Model::CRUST';
> >>
> >>   __PACKAGE__->config(
> >>     base =3D> 'http://answers.yahooapis.com/AnswersService/V1/',
> >>     query =3D> { appid =3D> 'YahooDemo' }
> >>   );
> >
> > The query part might be better named "params", since that's what
> > Catalyst uses.
>
> Another good point, will fix.
>
> >
> >>   # Meanwhile in a controller nearby
> >>   $c->stash->{answers} =3D $c->model('YahooAnswers')->get
> >> ( 'questionSearch',
> >>       query =3D> $c->req->param('query')
> >>   );
> >
> > Ew!  Do they really have URLs like questionSearch and getByCategory?
> > Very un-RESTful.
>
> (No comment... it's better than Amazon IMHO)
>
> >> Does anyone find this useful?  SVN snapshot is available:
> >>   http://svn.screwdriver.net/repos/code/CRUST
> >>
> >> Should this sort of thing being uploaded to CPAN?  Anyone want to
> >> review
> >> the code beforehand?
> >
> > Something like this is both useful and good.  I'm not certain what the
> > best way to implement it is.  I'll try and find some time to look at
> > your code soon.
> >
> > Adam
>
>
> One thought that crossed my mind was to make methods like:
>
> $c->model('whatever')->get_questionSearch( [params] )
> $c->model('whatever')->post_questionSearch( [params] )
>
> or just
>
> $c->model('whatever')->questionSearch( [params] ) #default to GET
>
>
> instead of what I have now:
>
> $c->model('whatever')->get('questionSearch(params =3D> ...);
> $c->model('whatever')->post('questionSearch(params =3D> ...);
>
> A bit of AUTOLOAD should do the trick, but would the above syntax be
> better or worse?
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: smime.p7s
> Type: application/pkcs7-signature
> Size: 2409 bytes
> Desc: not available
> Url :
> http://lists.scsys.co.uk/pipermail/catalyst/attachments/20061207/bb60481e=
/smime.bin
>
> ------------------------------
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>
>
> End of Catalyst Digest, Vol 22, Issue 26
> ****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070524/6772b=
e37/attachment-0001.htm


More information about the Catalyst mailing list