[Catalyst] Chained actions question

Nilson Santos Figueiredo Junior acid06 at gmail.com
Wed Aug 30 03:27:25 CEST 2006

On 8/29/06, leonard.a.jaffe at jpmchase.com <leonard.a.jaffe at jpmchase.com> wrote:
> sub base :Chained('/') PathPart('') CaptureArgs(0) {
> sub drpt : Chained('base') PathPart('dailystatusrpt') CaptureArgs(0) {
> sub view_drpt :Chained('drpt') PathPart('view') Args(0) {}
> sub drpt_year : Chained('base') PathPart('dailystatusrpt') CaptureArgs(1) {
> sub year_view :Chained('drpt_year') PathPart('view') Args(0) {}
> sub drpt_month : Chained('base') PathPart('dailystatusrpt') CaptureArgs(2) {
> sub view_month :Chained('drpt_month') PathPart('view') Args(0) {}
> sub drpt_day : Chained('base') PathPart('dailystatusrpt') CaptureArgs(3) {
> sub day_view :Chained('drpt_day') PathPart('view') Args(0) {
> sub create_drpt :Chained('drpt_day') PathPart('create') Args(0) {
> sub issue : Chained('drpt_day') PathPart CaptureArgs(0) {}
> sub create_issue : Chained('issue') PathPart('add')  Args(0) {

I've never really used chained actions (except when experimenting with
it) because all the code I could come up with looked like this - which
are extremely confusing action definitions IMO.

I think chained actions would work a lot better if there was a way to
chain things in a more abstract way. So that, in this example, you
could have a single 'view' action which would handle all the cases and
the preceeding action would just populate the resultset accordingly or
something to that effect (of course, your reports may actually be
completely different, but in my own use cases it does make a lot of
sense). However, the current way is also useful in some usage cases,
so I think Catalyst should probably have two ways of chaining stuff.

Of course, there might be better was to achieve the same functionality
that I'm not aware of. For now, I need to forward things around and do
it a little backwards (e.g. /dailystatusrpt/view/2005/10/08). It's
kind of counter intuitive, but it works.

-Nilson Santos F. Jr.

More information about the Catalyst mailing list