<div class="gmail_quote">On Tue, Jun 9, 2009 at 2:00 PM, Devin Austin <span dir="ltr"><<a href="mailto:devin.austin@gmail.com">devin.austin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Are you creating plugins for each of those user actions? C::P:: is the plugin naming convention. I could have missed something though.</blockquote><div><br>Hi Devin,<br><br>No, I'm not creating plugins. You didn't miss something; I did. I'm just creating controllers. My bad. <br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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 :-)<br>
<br><a href="http://www.catalyzed.org/2009/05/chained-the-awesomesauce.html" target="_blank">http://www.catalyzed.org/2009/05/chained-the-awesomesauce.html</a><br></blockquote><div><br>You've written a really good and useful article. I wish I'd run into it a few months ago. I've spent a lot of time reading up on Chained, and working out method flows, so I am at least over the initial shock of the steep (to some of us mortals) learning curve. I don't have a "Eureka!" yet, tho. Let me see if I can clarify the problem I'm having. <br>
<br>In many of the examples I've seen, where you have a url like /account/*org/*,<br>they show a parent controller, and a child controller. For example, on the catalyst wiki, <a href="http://dev.catalyst.perl.org/wiki/gettingstarted/howtos/chainedexamples">http://dev.catalyst.perl.org/wiki/gettingstarted/howtos/chainedexamples</a>:<br>
<br>==========================================<br>package MyApp::Controller::Account;<br><br># match /account<br>sub base :Chained("/") :PathPart("account") :CaptureArgs(0) {}<br><br># match /account/*<br>
sub id :Chained("base") :PathPart("") :CaptureArgs(1) {}<br><br>package MyApp::Controller::Account::Org;<br><br># match /account/org<br>sub base :Chained("/account/base") :PathPart("org") :CaptureArgs(0) {}<br>
<br># match /account/org/*<br>sub id :Chained("base") :PathPart("") :CaptureArgs(1) {}<br>==========================================<br><br>But I have a situation where I need to flow thru methods that aren't tightly bound to a parent/child relationship. Or I need to be able to create parent/child methods 'on the fly.'<br>
<br>In the scenario above, /account is anchored to the root url, /. Makes sense, you have to start somewhere, right? As a user, I want to create actionitems, and since they belong to me, I'm initially ok with a parent User controller class in which base is anchored to '/' and a child Actionitems controller class. (But that gets me into trouble later...)<br>
<br>MyApp::User;<br>MyApp::User::Actionitem;<br><br>I have my CRUD methods for actionitems in the child class. This is fine for 'items that are unassociated to meetings or projects. But when I tell the 'item it now is attached to Meeting 37, and the meeting leader does a search on Actionitems people have attached to the meeting, things get complicated. Let's say the team leader is user # 16. She logs into her /user/profile, clicks on 'meetings,' selects meeting 37, and does a search for actionitems people have sent to that meeting. Now we need a method flow like this:<br>
<br>/user/16/meeting/37/actionitem/list<br><br>The list displays. Each 'item has links to edit, delete, reassign, yada yada.<br>But my CRUD methods for actionitems are all located in MyApp::User::Actionitem. I haven't figured out how to flow thru the User class to get $user_obj, then Meeting class to pick up $meeting_obj, and finally Actionitem class to get you know what. <br>
<br>And when we throw /projects/ into the mix, we get even more complicated. <br><br>Have I succeeded in making the issue clear? Or have I convinced you I'm completely insane? (Or maybe both...)<br><br>/dennis<br><br>
<br></div></div>