[Catalyst] Is it possible somehow to mix and match path parts using Chained?

Devin Austin devin.austin at gmail.com
Tue Jun 9 18:00:18 GMT 2009

On Tue, Jun 9, 2009 at 11:55 AM, Dennis Daupert <ddaupert at gmail.com> wrote:

> I have a requirement to be able to do things like this:
> A user creates "actionitems" which are just task notes.
> An actionitem might not be associated with a project,
> or a meeting, or assigned to another user, etc. Later,
> it might be attached to a meeting; then all actionitems
> associated with that meeting can be listed; individual items
> can be updated, etc. Also, there might be several meetings
> associated with a given project. We want to list those,
> list the actionitems associated with particular projects,
> etc.
> I have a lot of this worked out using Chained, but there's a problem.
> I've got controller classes like:
> C::P::Actionitems
> C::P::Meetings
> C::P::Users::Profile::Actionitems
> C::P::Users::Profile::Meetings
> C::P::Users::Profile::Meetings::Actionitems
> etc
> It gets  yukkie fast. I'm looking for a way to, -- as the
> documentation says -- "redispatch a chain through any controller
> or namespace you want," and I'd certainly like to stay DRY. I need to be
> able to mix and match methods, so I can serve URLs like these:
> /project/list                       # self explanatory
> /meeting/list                       # self explanatory
> /project/*/meeting/list             # meetings associated to a project
> /user/*/project/list                # projects user is member of
> /user/*/actionitem/create           # unassociated item
> /user/*/actionitem/*/edit           # unassociated item
> /user/*/meeting/*/actionitem/list   # items associated to a meeting
> /user/*/meeting/*/actionitem/*/edit # edit a particular meeting's item
> /user/*/project/*/meeting/*/actionitem/*/edit # yada yada
> In this scenario, actions may be endpoints in some situations, links in
> others.
> To put it another way, is there a way to have actions like these, and use
> Chained to dispatch around?
> C::P::Users
> C::P::Actionitems
> C::P::Meetings
> C::P::Projects
> Is this even possible to do using Chained? If not, what would be
> recommended?
> /dennis
> _______________________________________________
> List: Catalyst at 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/
> Are you creating plugins for each of those user actions? C::P:: is the
plugin naming convention.  I could have missed something though.

Anyway, check out this Chained tutorial I've written, it covers the type of
chaining you want to do.  Not quite as in depth as your example, but there
is a "nested" chain, so I'm sure you could figure it out from there.  If
not, you have the list :-)




-- =

Devin Austin
http://www.dreamhost.com/r.cgi?326568/hosting.html - Host with DreamHost!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090609/49848=

More information about the Catalyst mailing list