<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>I implemented application-specific an Application-specific action, and found the "MyAction" construct to be a little odd. So I took a run at extending the ActionClass parser to look for a local app version ("MyApp::Action::Foo") first, then to fall back to the Catalyst version ("Catalyst::Action::Foo") if that's not present. You can still use "+My::Full::Path" to force a particular selection (such as to skip over an app version for some reason).</div><div><br></div><div>Is there a reason that this wasn't tried before?</div><div><br></div><div>I hope this helps. I'd appreciate feedback, and can provide the tests and doc if this is interesting enough to proceed. Catalyst is a neat system, and I appreciate the hard work of those who have made it what it is today.</div><div><br></div><div>Cheers,</div><div><br></div><div>Bruce</div><div><br></div><div>diff -rc /Library/Perl/5.8.8/Catalyst/Controller.pm Catalyst/Controller.pm</div><div>*** /Library/Perl/5.8.8/Catalyst/Controller.pm<span class="Apple-tab-span" style="white-space:pre">        </span>2009-04-02 14:07:54.000000000 -0700</div><div>--- Catalyst/Controller.pm<span class="Apple-tab-span" style="white-space:pre">        </span>2009-04-03 11:13:10.000000000 -0700</div><div>***************</div><div>*** 318,325 ****</div><div>&nbsp;&nbsp;</div><div>&nbsp;&nbsp;sub _parse_ActionClass_attr {</div><div>&nbsp;&nbsp; &nbsp; &nbsp;my ( $self, $c, $name, $value ) = @_;</div><div>! &nbsp; &nbsp; unless ( $value =~ s/^\+// ) {</div><div>! &nbsp; &nbsp; &nbsp; $value = join('::', $self->_action_class, $value );</div><div>&nbsp;&nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp;return ( 'ActionClass', $value );</div><div>&nbsp;&nbsp;}</div><div>--- 318,344 ----</div><div>&nbsp;&nbsp;</div><div>&nbsp;&nbsp;sub _parse_ActionClass_attr {</div><div>&nbsp;&nbsp; &nbsp; &nbsp;my ( $self, $c, $name, $value ) = @_;</div><div>! &nbsp; &nbsp; if ( substr($value,0,1) eq '+' )</div><div>! &nbsp; &nbsp; {</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; $value = substr($value,1);</div><div>! &nbsp; &nbsp; }</div><div>! &nbsp; &nbsp; else&nbsp;</div><div>! &nbsp; &nbsp; {</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; eval {</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Check our app first...</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $appclass = Catalyst::Utils::class2appclass($self);</div><div>! &nbsp; &nbsp;&nbsp;</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Catalyst::Utils::ensure_class_loaded( "${appclass}::Action::${value}" );</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $value = "${appclass}::Action::${value}";</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # $c->log->debug("Succeeded in loading $value");</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; };</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; if ( $@ )</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # We take any error to mean "class doesn't exist", so fall back</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # to one in the Catalyst hierarchy.</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $value = join('::', $self->_action_class, $value );</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # $c->log->debug("Failed app version, falling back to $value");</div><div>! &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp;&nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp;return ( 'ActionClass', $value );</div><div>&nbsp;&nbsp;}</div><div><br></div><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>---</div><div>Bruce McKenzie</div><div><a href="mailto:brucem@dynamicrange.com">brucem@dynamicrange.com</a></div><div><br></div></div></span><br class="Apple-interchange-newline"> </div><br></body></html>