[Catalyst] Session timeout and re-Authentication from a Frame
> > A couple of Login/authentication questions: > > As expected, when using frames, when a session times out and displays the > Login page, it does so in the frame that is the target for that request. > Is there any easy trick to be able to get that Login screen to use '_top' > as the target? perhaps an intermediary Login response page that can set the > target then request the proper Login page... although I'd have to play > around to make such a thing work, and was wondering is anyone else already > had a solution/code I could leverage? window.parent.location = Given the response already has it's target window, the Login screen will just get rendered there. I was thinking of a solution that maybe writes an intermediary response page that onLoad() sets the location and target to _TOP then calls the real Login page. In asking the mailing list, I was wondering whether anyone else has already covered that ground rather all of us busting out new stuff. As an evolution to the Authentication mechanism, I was wondering whether anyone had broached maybe? I stopped using frames a long time ago :) The use of Frames in this situation seemed to have merit. Its a Shopping Cart component... that has a JavaScript-driven expandable menu with quite a few hundred possible nodes. I wanted to avoid the latency dealing with the menu every time the consumer expanded/collapsed a node... or viewed the asssociated products. Still, any other thoughts on that sort of thing would also be welcome. As an evolution to the Authentication mechanism, I was wondering whether anyone had tackled the below. > On a further note, with re-authentication after session timeout, it'd be > good to be able to 'park' the original request while the re-authentication > occurs, then continue to process it. Assume in this context that all state > would be persisted against the User (as opposed to the session-id). > ...maybe a response that then pops a temporary window to re-authenticate in > - thus helping to preserve the underlying targets for the parked then > subsequently executed request. Any ideas or code that can be leveraged? _ Advertisement: Senior Management roles paying $80k+ Search now at www.seek.com.au http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eexecutive%2Eseek%2Ecom%2Eau%2F%3Ftracking%3Dsk%3Ahet%3Ase%3Anine%3A0%3Ahot%3Atext&_t=763838044&_r=seek_may07_snrmanagement&_m=EXT ___ List: Catalyst@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/
[Catalyst] Session timeout and re-Authentication from a Frame
Hi A couple of Login/authentication questions: As expected, when using frames, when a session times out and displays the Login page, it does so in the frame that is the target for that request. Is there any easy trick to be able to get that Login screen to use '_top' as the target? perhaps an intermediary Login response page that can set the target then request the proper Login page... although I'd have to play around to make such a thing work, and was wondering is anyone else already had a solution/code I could leverage. On a further note, with re-authentication after session timeout, it'd be good to be able to 'park' the original request while the re-authentication occurs, then continue to process it. Assume in this context that all state would be persisted against the User (as opposed to the session-id). ...maybe a response that then pops a temporary window to re-authenticate in - thus helping to preserve the underlying targets for the parked then subsequently executed request. Any ideas or code that can be leveraged? regards SteveH _ Advertisement: Senior Management roles paying $80k+ Search now at www.seek.com.au http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eexecutive%2Eseek%2Ecom%2Eau%2F%3Ftracking%3Dsk%3Ahet%3Ase%3Anine%3A0%3Ahot%3Atext&_t=763838044&_r=seek_may07_snrmanagement&_m=EXT ___ List: Catalyst@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/
[Catalyst] How do I have Catalyst access a Controller based on only part of the PATH_INFO
Hi I'm used to (albeit a recent Catalyst convert) creating a Controller based on the whole name of the PATH_INFO, e.g. http://localhost:3000/some/structure/like/this being: package my_app::Controller::some::structure::like::this In a file my_app/lib/my_app/Controller/some/structure/like/this.pm How would I have a Controller like: package my_app::Controller::some::structure In a file my_app/lib/my_app/Controller/some/structure.pm and be able to access the remaining "like/this" via PATH_INFO. In case you are wondering why... I was wanting to have a catalogue menu hit back into the app at a common point, and use the remaining PATH_INFO to indicate the specifics of selection made. This seems like it'd be pretty ordinary to be able to do... just that I can't see how to from the Catalyst documentation. It's probably a case of me not being able to see the wood for the trees ... or it being something obvious yet documented in an implicit way dunno going nuts Steve _ Advertisement: Its simple! Sell your car for just $30 at carsales.com.au http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801577%2Fpi%5F1005244%2Fai%5F838588&_t=762955845&_r=tig_may07&_m=EXT ___ List: Catalyst@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/
Re: [Catalyst] FOREACH problem
Dmitri, In answer to your: What am I doing wrong? Cast the hash assignment as an array, otherwise it's scalar and you'd get the number of elements in the array instead of the array contents. @someArray = qw/ 1 2 3 4 /; %someHash = (); of the array ## @{$someHash{key}} = @someArray; ## use Data::Dumper; print Dumper(\%someHash); ...nothing wrong with the other solution offerred of using an array ref i.e. $c->stash->{categoriesToDelete} = [EMAIL PROTECTED]; ...although, best if you know what was causing your actual problem. Message: 6 Date: Sun, 6 May 2007 16:39:23 +0200 From: "Dmitri Pissarenko" <[EMAIL PROTECTED]> Subject: [Catalyst] FOREACH problem To: catalyst@lists.rawmode.org Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hello! I have an action, which should do following: It reads from the GET parameter a string with record IDs, i. e. "1,2,3,". Then, this action should fetch from the database the records with these IDs. Finally, it should pass the resulting array to another page, in which these records are displayed using [% FOREACH cat IN categoriesToDelete -%] [% cat.name %] [% END -%] Now I have the problem that in the page with FOREACH nothing is displayed, even though categoriesToDelete contains some data. The code is this: sub form_deleteSeveralCategories : Local { my ($self, $c) = @_; # fetch IDs as string my $categoryIdsAsSingleString = $c->request->params->{categoryIds}; # convert string to array of individual IDs my @categoryIds = split (/,/, $categoryIdsAsSingleString); # read records from the database and store them in @categoriesToDelete my @categoriesToDelete = map { # $_ is the ID of the record $c->model('TimeTrackingAppDB::Category')->find($_); } @categoryIds; foreach (@categoriesToDelete) { $c->log->debug('cat: ' . $_); }; # pass the parameters to the page with FOREACH $c->stash->{categoryIds} = $categoryIdsAsSingleString; $c->stash->{categoriesToDelete} = @categoriesToDelete; ... > > categoriesToDelete is passed to form_deleteSeveralCategories.tt2 very > well, since "[% categoriesToDelete %]" is displayed as "2" (number of > elements in the array). > > But nothing in displayed in the FOREACH loop. > > What am I doing wrong? > _ Advertisement: Looking for a home loan? Compare 2,000 mortgages at RateCity http://direct.ninemsn.com.au/adclick/CID=02fd7e1a ___ List: Catalyst@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/
Re: [Catalyst] many Views that may include common display fragments
Again, thanks... and it's great to see such diversity in Catalyst usage and help offerred. To reiterate part of the problem.. in the final View that composes the (final) page, I'd want to include HTML fragments that were created by common functions (that could create them for other pages too). Trouble is, things came unstuck when I forward('someCommonFunction' ... which fires the controller to fetch the data, then it's associated View to actually create the HTML fragment; it would normally be plugged into response body, however the (Seamstress) resultant Tree object is also Stash'able or returned and the body could get ignored... when the forward() returns, I'd have the Tree (html'able) fragment that I could stitch into the main doc's html tree that is then finally rendered as_html(). -- that's where it comes unstuck... it can't seem to recurse that stuff. Note that I'm using Seamstress (as opposed to TT). regards SteveH _ Advertisement: Its simple! Sell your car for just $30 at carsales.com.au http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801577%2Fpi%5F1005244%2Fai%5F838588&_t=754951090&_r=tig&_m=EXT ___ List: Catalyst@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/
Re: [Catalyst] many Views that may include common display fragments
> Ugh... Assume that the view gets everything from controller. Then this > controller is the thing that should gather everything together before > shipping it to the view. Let the template decide the form, let the > controller decide the content. That's fair enough, but say you've got 20 possible page elements of which typically 5 or 6 are included in the final page. Would you still suggest that the Controller should initialize any data for all 20 elements onto the stash? What if some of those elements are relatively expensive to generate? What Steve wants is some way of being able to decide in the View which of those elements are included and load them accordingly. The best solution I can come up with is passing coderefs into your view which can then be run to retrieve the data would something like this work? $c->stash->{'get_most_popular'} = sub { return $c->model('DB')->some_expensive_db_op(); }; Carl Thanks all for your interest and comments. One significant issue with this one also is that many of the things to be assembled on the final page could appear on many different pages. So the issue is around how to generalise those common functions, to be accessible (optionally) from many pages. ...unfortunately, and as a stop-gap measure, the easiest and most robust way of handling it has been to bloat the Seamstress skeleton.pm with it -- i.e. lots of pre-parsed html fragments and logic that will optionally flesh them out and bolt them into the main doc as appropriate. ...sort of blows away some of the Controller/View separation ... but the final skeleton seems to be the only place that things are brought together again Please let me know if I'm missing something fundamental here... but at face value, I couldn't see any intrinsic capability for that sort of thing... much needed in enterprise (size/complexity) applications... to avoid going the WebSphere/Portal route. The app I'm working on is a CRM one... with various dashboard status, hot-list and other fragments that need displaying on many different pages. SteveH _ Advertisement: 1000s of Sexy Singles online now at Lavalife - Click here http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Flavalife9%2Eninemsn%2Ecom%2Eau%2Fclickthru%2Fclickthru%2Eact%3Fid%3Dninemsn%26context%3Dan99%26locale%3Den%5FAU%26a%3D27782&_t=762229680&_r=lavalife_apr07_1000sexysingles&_m=EXT ___ List: Catalyst@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/
[Catalyst] A View that may include elements optionally returned from other funcs
Hi all, (preamble) I've been working for a couple of months now on the strategy, constraints and designs for using Catalyst for a portal CRM app. I chose to use Seamstress rather than TT, as it seems a more contemporary approach - at least the notion of workig with the HTML tree compared to using another mini language (anyway, perhaps if the related doco was more extensive, example-wise, then I'm sure Seamstress would get a larger following). Anyway the dilema I have is: With Catalyst, how do I compose a html document from multiple sources. For example I have many Boxes of data, the creation of which I'd like to generalise, and optionally include some/none/all in any finally composed page/document (and positioned at for examle, tags in any doc they could appear in)... like a menu or a hot-list or other things that may be common to many documents/pages. At face value, Catalysts model of a Controller to crunch/prepare the data then a View to render a doc/page, seems to promote a 1-document per view notion. For this sort of er, Portal app I'm working on, I'd like to when composing a page, identify whether or not particular common elements (say, boxes of data) should be included, and then merely call out to some common functoin to build the things which I then stitch them in at the appropriate place in the final doc. Seems to me that at the point in processing I need to intervene (the final page's View), the doc is the compiled/hash representing the html doc tree. I can certainly look_down() and replace_content() in that tree how though can I call some other function that will return the appropriate structure to stitch in. If they were their own View, they would parse a doc fragment (or even a larger doc with lots of common fragments) into a tree in it's new()... then I'd call in to some function that would build and return me the structure that I could push/replace/splice in to the tree I'm composing. Although I'm a well experienced programmer from way back :(from the old top-down days though), I am still struggling to get my head around the whole interitence and calling model of the Catalyst OO framework... in who does what to who, when, for how much, and where did they meet. Hopefully what I'm trying to do is pretty 101 stuff, and someone with the right Catalyst/Seamstress stuff can 'show me the way'... as I'm going nuts trying out different things from Google'ing. regards Steve _ Advertisement: Visit LetsShop.com to WIN Fabulous Books Weekly http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fwww%2Eletsshop%2Ecom%2FLetsShopBookClub%2Ftabid%2F866%2FDefault%2Easpx&_t=751480117&_r=HM_Tagline_books&_m=EXT ___ List: Catalyst@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/