Re: [Catalyst] creating a model
On 4 Jan 2007, at 07:54, Octavian Rasnita wrote: Well, the single difference seems to be that I use the latest build (819). So all this bitching from you about how terribly hard to install Catalyst is may actually turn out to be an AS bug. That would strike me as funny, albeit it doesn't make life any easier for you. Sigh. -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ 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] Accessing action URIs outside of Catalyst app
On 3 Jan 2007, at 20:21, Brian Kirkbride wrote: Hello all, Is there a best practice way to maintain a map of URLs used in a Catalyst application. To clarify, I need to map actions to URLs outside of Catalyst (CRON jobs, Emailers, etc) and won't have access to $c-uri_for or the $c-dispatcher. If you need to do this, your design is broken. Step back. Explain what you're trying to achieve. -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ 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] Catalyst::Plugin::Authentication w/ multiple stores
Hi everyone, I am resending this previous post from December because I got no replies - maybe it was the Xmas thing, maybe I'm just stupid. Do the Catalyst::Plugin::Authentication developers or anyone using Catalyst have any idea... (see below) -- original post -- Does anyone know how to configure Catalyst::Plugin::Authentication with multiple stores? The docs are very ambiguous on this and when I follow them as best I can it doesn't work. I use C::P::A::Store::LDAP as my first store and try to authenticate users with that but I would like Catalyst to also try a secondary store, C::P::A::Store::DBIC, if the user doesn't exist in the LDAP tree. Am I misunderstanding C::P::A's feature of being able to use multiple stores? In MyApp.pm: use Catalyst qw/ -Debug ConfigLoader Static::Simple StackTrace Authentication Authentication::Store::LDAP Authentication::Store::DBIC Authentication::Credential::Password Authorization::Roles Authorization::ACL Session Session::Store::FastMmap Session::State::Cookie /; In myapp.yml: authentication: store: Catalyst::Plugin::Authentication::Store::LDAP stores: ldap: Catalyst::Plugin::Authentication::Store::LDAP dbic: Catalyst::Plugin::Authentication::Store::DBIC ldap: ldap_server: pdc.domain.com ldap_server_options: version: 3 binddn: cn=adsearchuser,cn=Users,dc=domain,dc=com bindpw: adsearchpassword user_basedn: cn=Users,dc=domain,dc=com user_scope: sub user_filter: ((objectclass=user)(samaccountname=%s)) user_field: samaccountname dbic: user_class: Schema::User user_field: username password_field: password password_type: hashed password_hash_type: SHA-1 Is there something incorrect here? Thanks, Leandro ___ 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] Browser window/tab independent sessions
Hi, Maybe I didn't understand well the question, but if the user wants to create a session that works only in a certain window, but doesn't work in the other windows, a simple cookie can be used if its expiry date is set to 0. This way the cookie won't be saved, but it will be memorised by the current window of the browser, and if the browser window is closed, the session ID is lost, and the user must log in again for creating another session. Same thing if he wants to use another window. Isn't this what is needed? Octavian - Original Message - From: Hermida, Leandro [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Monday, January 08, 2007 3:48 PM Subject: RE: [Catalyst] Browser window/tab independent sessions -Original Message- From: Perrin Harkins [mailto:[EMAIL PROTECTED] Sent: Friday, January 05, 2007 22:26 To: [EMAIL PROTECTED]; The elegant MVC web framework Subject: Re: [Catalyst] Browser window/tab independent sessions On Fri, 2007-01-05 at 20:44 +, Ian Docherty wrote: Does anyone try to keep different state information in different browser windows/tabs? Back in the old days, when we used to make websites with our stone knives and bear skins, we used to keep state information in hidden form fields and query strings. These techniques have none of the global state problems that cookies do. Putting things that are specific to a window/tab in a cookie-based session is a pet peeve of mine actually, since it can break things so spectacularly. If you check, you'll see that all of the major web sites like Yahoo and Amazon are careful to avoid this kind of issue (multiple tabs don't interfere with each other) and they generally seem to use the old-school techniques. How would I create these URI's for each window. I suppose I would have to have a 'create new window' button in the application that generated a new window with a unique window_session? Users are not going to like that. You'll never be able to get something like this working without becoming totally dependent on JavaScript to manipulate your URLs and tell you when new windows are opening. At that point, the hidden form fields will look really easy by comparison. - Perrin The way cookies work for holding application state has the limitation of being for every window/tab of that browser type (someone please correct me if I am wrong). Use Catalyst::Plugin::Session::State::URI to pass the session IDs through the URI but please read the POD on security issues related to this!!! I also had to write an app sometime ago where I didn't use cookies so I just passed the session ID in form hidden fields (for POSTs) and in the URI (for GETs). Then each browser window/tab will have its own independent session no prob.. Leandro ___ 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/ ___ 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] sane AJAX strategy
On 1/6/07, Bill Moseley [EMAIL PROTECTED] wrote: On Fri, Jan 05, 2007 at 12:24:37PM +0100, Daniel McBrearty wrote: I just started using AJAX (or AHAH actually ... ) a little. I like the lightness it gives but I've been slow to pick up because I want to be sure that pages work without js, and I haven't figured out a generic method yet. I'm sure others are ahead of me on this ... Typical scenario without AJAX : form button submits to URL, which triggers a single Cat action, which is rendered by a single template, usually of the same name. That's simple, just a one-to-one relationship. When we use AJAX, things look very similar, EXCEPT that only a part of a page is loaded. This implies that for the non-js user of the same page, multiple actions and templates have been combined so that the result is identical, even though the whole page loaded. When you say above only part of a page is loaded are you talking about the content part and not the headers, footers, and menus -- or talking about part of the content such as just a new row in a table or updating a single field in a form? It could be either ... usually some part of the content, but it could be all of it. I am talking here though about scenarios where it's more AHAH than AJAX ... the function that makes the request just sticks it as-is into the page, rather than doing some kind of decode on it. Mostly because that seems simpler, and I like simple ... Not sure exactly what you are asking for, but I'll explain what I do if that helps -- and besides I'm no fan of being warnocked. Ha ... I had to look that up, I'd not heard of Warnock before. I ask silly questions sometimes, but silly questions sometimes turn out to be useful, so I don't take it personally ... (grin) ... though I appreciate the response. I don't use that much AJAX, but I do use it for, say, displaying the next page of a list or sorting a table by a column by clicking on a column heading, or selecting a different tab to limit a table's display to a category of some type. My templates are already split up quite a bit. So, I have templates that know how to display tabs, table column headings, and how to build the table. When I update a table (e.g. next page) the same controller code is called for both AJAX and for non-ajax requests (it's the same request url) and the same template is called (derived from the controller's action name). ok ... so does the the controller know that the req is ajax? how? an added argument like ?ajax=true perhaps ... ? I use the typical TT wrapper method to build my entire page from headers, footers, banners, menus, etc. But, the TT wrapper code can detect it's an AJAX request from the request headers and knows to only build the content (i.e. the table with data I'm sorting), but not the entire page. Then my end action also knows it's an ajax request and then returns using JSON. right. so in this case there is a generic [% IF ajax %] in your template code that suppresses headers, footers and so on? which will be fine if you are getting all the content, but not part of it, I guess ? Since I use common template code for generating tabs and table headers and use the same urls for my ajax requests it's easy for javascript to search the DOM and create the events for the ajax requests. That way my HTML markup doesn't have to do anything specific for the ajax calls. That's the commonly recommended method, of course, keeping the behavior and html separate. For AJAX requests that don't update the entire page content, like an auto-complete search box, I still use the same controller as for the non-ajax request but then the controller has a little extra code to return just the search results not the entire new content -- it's just one extra line of code in most cases. Not always the most efficient method (since I end up returning more columns than is really needed for the ajax update), but so far has not been an problem. so do you typically use the same controller action, and have a flag to tell it to act differently? Of course, for updating a single field in a form (e.g. type in a zip code and city and state are automatically filled in) I use a separate controller that just handles the ajax code. In that case there's no need for an extra template since it's just updating existing markup -- the controller just returns JSON. So, I try to write as much as possible without coding specifics for the ajax calls. It's the standard recommendation to write the code for non-ajax usage, then add that behavior on page load. And, then I divide my templates into small enough parts that can be used for ajax and non-ajax calls based on how the request comes in. Thanks for the feedback. It's been enough to feed my thoughts a bit. I'll go and have a play with the code and see what comes out. Daniel -- Daniel McBrearty email : danielmcbrearty at gmail.com www.engoi.com : the multi - language vocab trainer BTW : 0873928131
Re: [Catalyst] How about the catalyst scalability
On 5 Jan 2007, at 10:08, Mao DengFeng-e13751 wrote: Hi, all We try to develop a large web application like www.etoys.com. Catalyst can sustain that or not? I can't find the real large application using catalyst. Who can provide a sample to me? http://dev.catalyst.perl.org/wiki/LiveApplications also: http://vox.com/ :) -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ 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] Browser window/tab independent sessions
Hermida, Leandro wrote: snip The way cookies work for holding application state has the limitation of being for every window/tab of that browser type (someone please correct me if I am wrong). Use Catalyst::Plugin::Session::State::URI to pass the session IDs through the URI but please read the POD on security issues related to this!!! I also had to write an app sometime ago where I didn't use cookies so I just passed the session ID in form hidden fields (for POSTs) and in the URI (for GETs). Then each browser window/tab will have its own independent session no prob.. Leandro I used URI session variables previously where cookies were not available. It occurs to me that if the are being used to have separate sessions for each tab or window then the security issues could be eliminated by making the session a combination of a cookie (fixed for all windows/tabs) and the URI parameter (different for all windows/tabs). I still don't know how to ensure each new window/tab gets it's own unique session in the URI however? Regards Ian Docherty (IcyDee) ___ 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] Browser window/tab independent sessions
Ian Docherty wrote: I used URI session variables previously where cookies were not available. It occurs to me that if the are being used to have separate sessions for each tab or window then the security issues could be eliminated by making the session a combination of a cookie (fixed for all windows/tabs) and the URI parameter (different for all windows/tabs). I still don't know how to ensure each new window/tab gets it's own unique session in the URI however? There's no need to do that. Just put the data you want to preserve in the URI rather than putting the session ID there. - Perrin ___ 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] Browser window/tab independent sessions
Octavian Rasnita wrote: Hi, Maybe I didn't understand well the question, but if the user wants to create a session that works only in a certain window, but doesn't work in the other windows, a simple cookie can be used if its expiry date is set to 0. This way the cookie won't be saved, but it will be memorised by the current window of the browser, and if the browser window is closed, the session ID is lost, and the user must log in again for creating another session. Same thing if he wants to use another window. Isn't this what is needed? Octavian No, setting it to 0 just ensures that when the *browser* is closed the cookie is removed. A cookie set in one window is available to all windows of that browser and all windows/tabs have the same cookie (and hence the same session). Regards Ian C. Docherty (IcyDee) ___ 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] Advent calendar - day 15
Hi, it's late for additions to the advent calendar, I know, anyway here I go. On day 15 Kieren Diment says I have been unable to get the range request output for this server, but would be interested to hear how. Using Winamp and moving around the cursor while playing causes range requests to be sent to the streaming server, which then handles them correctly. HTH. -- Marcello Romani Responsabile IT Ottotecnica s.r.l. http://www.ottotecnica.com ___ 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] Browser window/tab independent sessions
Well, it seems that Internet Explorer doesn't work that way. Here are the steps: I have opened a window with the main page of the site. No cookie file was created. I have logged on. No cookie file was created, even though it was sent, and the login was successful. I have opened another window with the same main URL. It asked again for the username and the password, so the session was not available to the second window. I have logged on using another username. No session file was created but the login was successful this time also. Octavian - Original Message - From: Ian Docherty [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Monday, January 08, 2007 5:37 PM Subject: Re: [Catalyst] Browser window/tab independent sessions Octavian Rasnita wrote: Hi, Maybe I didn't understand well the question, but if the user wants to create a session that works only in a certain window, but doesn't work in the other windows, a simple cookie can be used if its expiry date is set to 0. This way the cookie won't be saved, but it will be memorised by the current window of the browser, and if the browser window is closed, the session ID is lost, and the user must log in again for creating another session. Same thing if he wants to use another window. Isn't this what is needed? Octavian No, setting it to 0 just ensures that when the *browser* is closed the cookie is removed. A cookie set in one window is available to all windows of that browser and all windows/tabs have the same cookie (and hence the same session). Regards Ian C. Docherty (IcyDee) ___ 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/ ___ 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] [Fwd: [Chicago-talk] Chicago.pm Meeting - 16th January 2007 - Catalyst, The Elegant MVC Web Framework]
Hey guys. If you happen to be in Chicago and not on the chicago-talk mailing list, you might be interested in this. I'm giving a Catalyst talk that will be screencast style (except you get to ask questions). If you can make it, I'd love to see you there. Regards, Jonathan Rockway Original Message Subject: [Chicago-talk] Chicago.pm Meeting - 16th January 2007 - Catalyst, The Elegant MVC Web Framework Date: Sun, 7 Jan 2007 12:13:32 -0600 From: Joshua McAdams [EMAIL PROTECTED] Reply-To: Chicago.pm chatter [EMAIL PROTECTED] To: Chicago.pm chatter [EMAIL PROTECTED], [EMAIL PROTECTED] Join Chicago.pm on January 16th for an evening of Catalyst, a modern framework for making web applications without the pain usually associated with web development. Jonathan will be talking in-depth about developing Catalyst applications, a topic that he knows very well. He is a contributor to Catalyst, maintains numerous Catalyst plug-ins, and is rumored to be writing a book on the subject. Date: Tuesday January 16th 2007 Time: 7:00 p.m. Where: Performics @ 180 N La Salle 12th Floor RSVP: By noon January 15th to [EMAIL PROTECTED] The official meeting starts at 7, but there is talk of a group getting together before (or after) for a social. You guys can nail down the details on that :) Also, don't forget the Chicago.pm meeting to be held this Tuesday January 9th at IIT in Wheaton. Andy Lester, Pete Krawzcyk, and myself each have each picked four modules to present in a session called New Modules For The New Year. Check out http://chicago.pm.org/ for more information. See you there, Josh * BTW, I still have a few Perl Mongers t-shirts to distribute to people. I'll be bringing them to each of these meetings, so try to be there if you are still without your shirts! ___ Chicago-talk mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/chicago-talk -- package JAPH;use Catalyst qw/-Debug/;($;=JAPH)-config(name = do { $,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //, ;$;]-[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;-setup; ___ 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] Browser window/tab independent sessions
On 08/01/07, Octavian Rasnita [EMAIL PROTECTED] wrote: Well, it seems that Internet Explorer doesn't work that way. Here are the steps: I have opened a window with the main page of the site. No cookie file was created. I have logged on. No cookie file was created, even though it was sent, and the login was successful. I have opened another window with the same main URL. It asked again for the username and the password, so the session was not available to the second window. I have logged on using another username. No session file was created but the login was successful this time also. To see better what's happening, try using a browser plugin that will let you view current cookies, or use javascript to display the current cookies. IE might not be creating the actual cookie file immediately on each page view. Carl ___ 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] Browser window/tab independent sessions
Octavian Rasnita wrote: Well, it seems that Internet Explorer doesn't work that way. Sometimes it does. It depends on whether you open new windows from the File menu or an existing browser (or right click on a link) or by starting a new browser from your IE icon. No cookie file was created. No cookie file is ever created for session cookies, but that doesn't mean the cookie isn't available to other windows. - Perrin ___ 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] How about the catalyst scalability
Matt S Trout wrote: On 5 Jan 2007, at 10:08, Mao DengFeng-e13751 wrote: Hi, all We try to develop a large web application like www.etoys.com. Catalyst can sustain that or not? I can't find the real large application using catalyst. Who can provide a sample to me? http://dev.catalyst.perl.org/wiki/LiveApplications also: http://vox.com/ :) /me votes for marcus to open source iusethis so that everyone can see a real application that has actual users. Or, maybe Vox wants to go open source (like Livejournal). Either way, the community would welcome the contribution! :) Regards, Jonathan Rockway -- package JAPH;use Catalyst qw/-Debug/;($;=JAPH)-config(name = do { $,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //, ;$;]-[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;-setup; ___ 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] Accessing action URIs outside of Catalyst app
Matt S Trout wrote: On 3 Jan 2007, at 20:21, Brian Kirkbride wrote: Hello all, Is there a best practice way to maintain a map of URLs used in a Catalyst application. To clarify, I need to map actions to URLs outside of Catalyst (CRON jobs, Emailers, etc) and won't have access to $c-uri_for or the $c-dispatcher. If you need to do this, your design is broken. Perhaps, but I ascribe that to it being in transition :) Step back. Explain what you're trying to achieve. Automated emails sent out to users need to provide them with a list of different webapp URLs. These actions are asynchronous from the webapp itself. I have a number of scripts (a few are legacy dinosaurs) that need webapp URLs as well. If I choose to change /cancel to /account/cancel later on, I'd like to do it in one place. I realize that without parsing the controllers' actions I can't expect the outside code to get those URLs. I would also rather not use MyApp.pm in simple scripts that only need my model logic and a URL, and in some cases I can't. My hope was to configure the URL mapping in a config file, which could be accessed by my webapp and outside scripts. Something like this: sub cancel : Args(1) : Path($urlmap-{account_cancel}) { # action } This, of course, does not work because attributes do not evaluate their arguments. Perhaps my solution is to subclass the Dispatcher to allow for: sub cancel : Args(1) : FromURLMap('account_cancel') { # action } That wouldn't be too hard. Thoughts? Best, Brian ___ 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] HTML to plain text conversion
On 08/01/07, Xavier Robin [EMAIL PROTECTED] wrote: Hello, Do you know a (catalyst plugin|perl module|external tool) that converts HTML to plain text? I mean, keeping some formatting (especially lists and links...), not just stripping HTML tags... I tried Template::Plugin::HtmlToText that fits well into TT, but the links are lost. Lists are well rendered, though. Something like this should work: my $scrubber = HTML::Scrubber-new( allow = [qw/ a ul ol li /] ); my $text = $scrubber-scrub( $html ); Carl ___ 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] Binary Conversion
Hi, I want to conver a number to binary. I installed Math::BigInt, and get this error when trying to plugin in the main controller: Can't locate Catalyst/Plugin/Math/BigInt.pm ... in /lib/usr/lib/perl5/5.8.5/i386-linux-thread-multi .. eventhough the installion is good. And I checked if the module installed. There is a BigInt.pm in /lib /usr/lib/perl5/5.8.5/Math , and bigint.pm (lowercase) in /lib /usr/lib/perl5/5.8.5 I'm not sure why I get the error. Then, I try to plugin in the controller that needs the functions, no compiling error, but runtime error when I try to use the function, such as $x-as_bin(); this is my code: my $x = 10; $c-stash-{mybinary} = $x-as_bin(); Please help me to get this right. Also, I could not install Bundle::Math Thank you. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ 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] Accessing action URIs outside of Catalyst app
On 8 Jan 2007, at 16:59, Brian Kirkbride wrote: Matt S Trout wrote: On 3 Jan 2007, at 20:21, Brian Kirkbride wrote: Hello all, Is there a best practice way to maintain a map of URLs used in a Catalyst application. To clarify, I need to map actions to URLs outside of Catalyst (CRON jobs, Emailers, etc) and won't have access to $c-uri_for or the $c-dispatcher. If you need to do this, your design is broken. Perhaps, but I ascribe that to it being in transition :) Step back. Explain what you're trying to achieve. Automated emails sent out to users need to provide them with a list of different webapp URLs. These actions are asynchronous from the webapp itself. I have a number of scripts (a few are legacy dinosaurs) that need webapp URLs as well. If I choose to change /cancel to /account/cancel later on, I'd like to do it in one place. I realize that without parsing the controllers' actions I can't expect the outside code to get those URLs. I would also rather not use MyApp.pm in simple scripts that only need my model logic and a URL, and in some cases I can't. Explain can't in a form that doesn't make me feel you've just completely missed the point of achieve and told me what you're trying (failing) to implement :) My hope was to configure the URL mapping in a config file, which could be accessed by my webapp and outside scripts. Something like this: sub cancel : Args(1) : Path($urlmap-{account_cancel}) { # action } This, of course, does not work because attributes do not evaluate their arguments. Perhaps my solution is to subclass the Dispatcher to allow for: sub cancel : Args(1) : FromURLMap('account_cancel') { # action } That wouldn't be too hard. Thoughts? Yeah, Catalyst already has an implementation for this - package MyApp::Controller::Foo; ... sub cancel :Action :Args(1) { ... } then in myapp.conf Controller Foo Action cancel Path /cancel /Action /Controller You can apply any attribute like that, although setting Args or similar from the config file might be considered unwise. -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ 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] Binary Conversion
On 1/8/07, Will Smith [EMAIL PROTECTED] wrote: Hi, I want to conver a number to binary. I installed Math::BigInt, and get this error when trying to plugin in the main controller: Can't locate Catalyst/Plugin/Math/BigInt.pm ... in /lib/usr/lib/perl5/5.8.5/i386-linux-thread-multi .. eventhough the installion is good. And I checked if the module installed. There is a BigInt.pm in /lib /usr/lib/perl5/5.8.5/Math , and bigint.pm (lowercase) in /lib /usr/lib/perl5/5.8.5 I'm not sure why I get the error. Then, I try to plugin in the controller that needs the functions, no compiling error, but runtime error when I try to use the function, such as $x-as_bin(); this is my code: my $x = 10; $c-stash-{mybinary} = $x-as_bin(); Please help me to get this right. Also, I could not install Bundle::Math Thank you. If you're on Debian (Etch) or derivatives, the perl-modules package contains Math::BigInt. How did you install the library? You could also check if the installation directory for that module is included in @INC. Also, I think the module names and packages are case-sensitive... Regards, Juan M. Paredes A. ___ 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] Accessing action URIs outside of Catalyst app
On 8 Jan 2007, at 18:12, Brian Kirkbride wrote: Matt S Trout wrote: On 8 Jan 2007, at 16:59, Brian Kirkbride wrote: Matt S Trout wrote: On 3 Jan 2007, at 20:21, Brian Kirkbride wrote: Hello all, Is there a best practice way to maintain a map of URLs used in a Catalyst application. To clarify, I need to map actions to URLs outside of Catalyst (CRON jobs, Emailers, etc) and won't have access to $c-uri_for or the $c-dispatcher. If you need to do this, your design is broken. Perhaps, but I ascribe that to it being in transition :) Step back. Explain what you're trying to achieve. Automated emails sent out to users need to provide them with a list of different webapp URLs. These actions are asynchronous from the webapp itself. I have a number of scripts (a few are legacy dinosaurs) that need webapp URLs as well. If I choose to change /cancel to /account/cancel later on, I'd like to do it in one place. I realize that without parsing the controllers' actions I can't expect the outside code to get those URLs. I would also rather not use MyApp.pm in simple scripts that only need my model logic and a URL, and in some cases I can't. Explain can't in a form that doesn't make me feel you've just completely missed the point of achieve and told me what you're trying (failing) to implement :) I'd like to routinely send an email to a user telling them to pay for something, including a link to a page in my webapp allowing them to do so. I just use Catalyst::Engine::JobQueue::POE (or in older apps a script that's the moral equivalent) and uri_for for that. My hope was to configure the URL mapping in a config file, which could be accessed by my webapp and outside scripts. Something like this: sub cancel : Args(1) : Path($urlmap-{account_cancel}) { # action } This, of course, does not work because attributes do not evaluate their arguments. Perhaps my solution is to subclass the Dispatcher to allow for: sub cancel : Args(1) : FromURLMap('account_cancel') { # action } That wouldn't be too hard. Thoughts? Yeah, Catalyst already has an implementation for this - package MyApp::Controller::Foo; ... sub cancel :Action :Args(1) { ... } then in myapp.conf Controller Foo Action cancel Path /cancel /Action /Controller You can apply any attribute like that, although setting Args or similar from the config file might be considered unwise. Perfect, I had missed that this type of URL to action mapping was possible with the :Action attribute. I have no interest in placing Args or other attributes in the config. This should work fine for me. :Action isn't -required-, you just need at least one attribute. :Action is the long-standing traditional no-op attribute (:Private isn't valid with any other attrs) so I tend to add it to all of them so if I delete the :Args for whatever reason or don't have one in the first place things don't go batshit on me :) -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ 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] Accessing action URIs outside of Catalyst app
On Mon, Jan 08, 2007 at 12:12:07PM -0600, Brian Kirkbride wrote: I'd like to routinely send an email to a user telling them to pay for something, including a link to a page in my webapp allowing them to do so. C::P::Scheduler? That's what I use so I can use c.uri_for() in my email templates. -- Bill Moseley [EMAIL PROTECTED] ___ 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] HTML to plain text conversion
Xavier Robin scribbled on 1/8/07 11:14 AM: Do you know a (catalyst plugin|perl module|external tool) that converts HTML to plain text? I mean, keeping some formatting (especially lists and links...), not just stripping HTML tags... I use the w3m tool: % w3m -dump file.html file.txt I like it because it preserves tables pretty well. -- Peter Karman . http://peknet.com/ . [EMAIL PROTECTED] ___ 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] Binary Conversion
On 8 Jan 2007, at 18:30, Will Smith wrote: I install the module through CPAN. Still not sure I get the compiling error if the Math::BigInt included in the main controller. Do you know any other module that can do conversion from integer to binary in Catalyst? MyApp.pm is not a controller, it's the application class. You should *NOT* have any actions in this class. See Joel's e-mail pointing out the mistake you've almost certainly made loading the module. There's nothing wrong with Math::BigInt - you're just loading it wrong. I'd suggest getting a copy of Programming Perl to read through or revisiting the perl man pages for more info. -- Matt S Trout, Technical Director, Shadowcat Systems Ltd. Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ + ___ 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] sane AJAX strategy
On Mon, Jan 08, 2007 at 04:04:14PM +0100, Daniel McBrearty wrote: I am talking here though about scenarios where it's more AHAH than AJAX ... the function that makes the request just sticks it as-is into the page, rather than doing some kind of decode on it. Mostly because that seems simpler, and I like simple ... Right, I use AJAX to mean both. ok ... so does the the controller know that the req is ajax? how? an added argument like ?ajax=true perhaps ... ? I look at the request headers. =cut sub is_ajax { my $c = shift; my $headers = $c-req-headers; return $headers-header('x-prototype-version') || ( ($headers-header('x-requested-with')||'') eq 'XMLHttpRequest' ); } right. so in this case there is a generic [% IF ajax %] in your template code that suppresses headers, footers and so on? Kind of. Something like this -- I capture the tables into page.just_table and then: SWITCH page.type || template.type; CASE 'text'; # render as-is. Page is not html content; CASE 'html'; content WRAPPER page/html.html + page/layout.html# standard site layout + includes/tabs.html # include tabs, if available + includes/pager.html;# also page navigation CASE 'ajax_table'; # just return the content of the table page.just_table; END; For AJAX requests that don't update the entire page content, like an auto-complete search box, I still use the same controller as for the non-ajax request but then the controller has a little extra code to return just the search results not the entire new content -- it's just one extra line of code in most cases. Not always the most efficient method (since I end up returning more columns than is really needed for the ajax update), but so far has not been an problem. so do you typically use the same controller action, and have a flag to tell it to act differently? Yes, kind of. Some things are common enough (like search boxes) so I have a method for it. So a controller that shows a list of users (possibly limited by a search) looks like this: sub list : Path { my ($self, $c, $limit ) = @_; my $options = $self-search_options( $c, $limit ); return if $c-ajax_search( $options, qw/ first_name last_name email / ); $c-paged_list( $options ); } search_options parses out the parameters from the request -- $option is basically: $options-{class}-search( $options-{criteria} ) kind of thing. Then ajax_search() does the query and uses a template to format for the auto-complete javascript. paged_list() is just a method to generate a list based on rows and columns and how it should be sorted. Not very helpful without seeing all the code, I suppose, but it's just stuff I use in a bunch of controllers so it's factored out. -- Bill Moseley [EMAIL PROTECTED] ___ 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] C::V::PDF? (Anybody have one?)
On Mon, Jan 08, 2007 at 09:21:33AM -0800, Dylan Vanderhoof wrote: I figured I'd ask here real quickly before I try to write one. Anybody made a Catalyst::View::PDF of some sort? It looks like I'm going to have to be dealing with some PDF output, so I figured I'd avoid reinventing the wheel if at all possible. I use htmldoc to generate a few pdfs. It's quick and easy. http://www.htmldoc.org/ -- Bill Moseley [EMAIL PROTECTED] ___ 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] Generating iCalendar
Anyone generating text/calendar output? Are you using Data::ICal? Have an example of generating events? Grrr, CPAN. Someday I'm going to install a module and it will suck down the entire CPAN in dependencies! Not sure I need prefork to generate ical files. cpan install Data::ICal::DateTime Unsatisfied dependencies detected during [S/SI/SIMONW/Data-ICal-DateTime-0.65.tar.gz] - Test::LongString Data::ICal Unsatisfied dependencies detected during [R/RG/RGARCIA/Test-LongString-0.11.tar.gz] - Test::Builder::Tester gpg: WARNING: unsafe ownership on configuration file `/home/moseley/.gnupg/gpg.conf' gpg: Signature made Sun 03 Dec 2006 03:27:14 PM PST using DSA key ID 10F54327 gpg: external program calls are disabled due to unsafe options file permissions gpg: keyserver communications error: general error gpg: Can't check signature: public key not found == BAD/TAMPERED signature detected! == Unsatisfied dependencies detected during [J/JE/JESSE/Data-ICal-0.11.tar.gz] - Class::ReturnValue Text::vFile::asData Unsatisfied dependencies detected during [J/JE/JESSE/Class-ReturnValue-0.53.tar.gz] - Test::Inline Unsatisfied dependencies detected during [A/AD/ADAMK/Test-Inline-2.105.tar.gz] - Class::Autouse Pod::Tests File::Flat Algorithm::Dependency Unsatisfied dependencies detected during [A/AD/ADAMK/File-Flat-0.96.tar.gz] - prefork File::NCopy Then after all that: t/00.load...ok 1/11# Testing Data::ICal::DateTime 0.65 t/00.load...ok t/01.parse..ok t/01.parse_recurringCan't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.8.8/Data/ICal.pm line 159. # Looks like your test died before it could output anything. t/01.parse_recurringdubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-4 Failed 4/4 tests, 0.00% okay t/02.complicatedCan't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.8.8/Data/ICal.pm line 159. # Looks like your test died before it could output anything. t/02.complicateddubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-7 Failed 7/7 tests, 0.00% okay t/03.recurrence-id..Can't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.8.8/Data/ICal.pm line 159. # Looks like your test died before it could output anything. t/03.recurrence-id..dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-8 Failed 8/8 tests, 0.00% okay t/04.all_dayCan't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.8.8/Data/ICal.pm line 159. # Looks like your test died before it could output anything. t/04.all_daydubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-24 Failed 24/24 tests, 0.00% okay t/05.palm_floating..Can't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.8.8/Data/ICal.pm line 159. # Looks like your test died before it could output anything. t/05.palm_floating..dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-13 Failed 13/13 tests, 0.00% okay t/05.palm_floating_recurCan't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.8.8/Data/ICal.pm line 159. # Looks like your test died before it could output anything. t/05.palm_floating_recurdubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-13 Failed 13/13 tests, 0.00% okay t/pod-coverage..skipped all skipped: Test::Pod::Coverage 1.04 required for testing POD coverage t/pod...ok -- Bill Moseley [EMAIL PROTECTED] ___ 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] Generating iCalendar
gpg: WARNING: unsafe ownership on configuration file `/home/moseley/.gnupg/gpg.conf' gpg: Signature made Sun 03 Dec 2006 03:27:14 PM PST using DSA key ID 10F54327 gpg: external program calls are disabled due to unsafe options file permissions gpg: keyserver communications error: general error gpg: Can't check signature: public key not found == BAD/TAMPERED signature detected! == The alternative is installing modules that the CPAN mirror has tampered with. Although in this case, gpg is just confused. Do you run CPAN as root (you don't need to anymore)? -- package JAPH;use Catalyst qw/-Debug/;($;=JAPH)-config(name = do { $,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //, ;$;]-[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;-setup; ___ 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] Browser window/tab independent sessions
From: Carl Franks [EMAIL PROTECTED] To see better what's happening, try using a browser plugin that will let you view current cookies, or use javascript to display the current cookies. IE might not be creating the actual cookie file immediately on each page view. I already use a browser plugin that allows me to see all the headers sent or received. The cookie is set and returned by the browser, and it is not saved on the disk. If the cookie has an expiry date in the future, it is saved imediately for any request. Octavian ___ 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] Browser window/tab independent sessions
On Mon, 2007-01-08 at 23:34 +0200, Octavian Rasnita wrote: And I think this is what is wanted, because I can't see other needs for having 2 separate sessions on the same computer. Go back and read the original post again. The problem is with storing non-global information, like the current search term, in global storage, i.e. a cookie or something tied to a session ID in a cookie. If you try opening multiple windows on amazon.com, with separate searches in each, they will not interfere with each other. You can page through each separately, and your search terms are maintained. This is true regardless of how you opened the window. That's what this person is trying to achieve. - Perrin ___ 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] Browser window/tab independent sessions
Perrin Harkins [EMAIL PROTECTED] wrote on 01/08/2007 04:11:47 PM: On Mon, 2007-01-08 at 23:34 +0200, Octavian Rasnita wrote: And I think this is what is wanted, because I can't see other needs for having 2 separate sessions on the same computer. Go back and read the original post again. The problem is with storing non-global information, like the current search term, in global storage, i.e. a cookie or something tied to a session ID in a cookie. If you try opening multiple windows on amazon.com, with separate searches in each, they will not interfere with each other. You can page through each separately, and your search terms are maintained. This is true regardless of how you opened the window. That's what this person is trying to achieve. It has already been answered I thought. Cookies are not the answer. Either place the information unique to each window in url or forms. There is a reason Amazon's urls look like: http://www.amazon.com/magazine-newspaper-subscriptions/b/ref=gw_br_zi/002-9304302-2417612?%5Fencoding=UTF8node=599858 instead of: http://www.amazon.com/magazine-newspaper-subscriptions/ =/ ___ 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] Not getting passed arguments in $c-user methods
Hi, I'm fairly new with Catalyst, so please forgive me if this is obvious. I'm using a DBIx::Class Person class for the authentication store. I've extended this Person class using a custom component. (This is running on mod_perl 1.29 and Apache 1.3.33 on Debian stable.) That all works well enough, I can access the class and its methods via $c-user. However, the methods are not getting any arguments other than $self. In a catalyst action I tried this code: --- $c-log-info( $c-user-return_arg('first') ); my $user_obj = $c-model('MacWebDB::Person')-find( $c-user-person_id() ); $c-log-info( $user_obj-return_arg('second') ); --- where the return_arg method is added to Person via a component: --- package UMN::MAC::DBIx::Person; use base qw( DBIx::Class ); __PACKAGE__-load_components( qw( Person_Component PK::Auto Core ) ); [...] package DBIx::Class::Person_Component; use base qw( DBIx::Class ); sub return_arg { my ($self, $arg) = @_; return arg: $arg; } 1; --- Then in the log, I find this: [info] arg: [info] arg: second So in both calls, I'm getting the correct method, but only the second version receives any arguments. I'm using the following plugins: use Catalyst qw/ -Debug ConfigLoader Static::Simple Email HTML::Widget Session Session::Store::FastMmap Session::State::Cookie Authentication Authentication::Store::DBIC Authentication::Credential::Password Authorization::Roles / ; Thanks for any suggestions. -Steve ___ 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] C::V::PDF? (Anybody have one?)
On Mon, Jan 08, 2007 at 09:21:33AM -0800, Dylan Vanderhoof wrote: I figured I'd ask here real quickly before I try to write one. Anybody made a Catalyst::View::PDF of some sort? It looks like I'm going to have to be dealing with some PDF output, so I figured I'd avoid reinventing the wheel if at all possible. What is the nature of the PDFs you need to create? Image centric - Text centric Private(For sale) - Public Dynamic(User driven) - Static High Res. - Fast Download (Low Res.) The projects I'm involved with generate PDFs that fall primarily on the left of those, except the last one where we have to be on both sides! ;) Other, more specific, needs you have for the PDFs you're making may be helpful. -- Nate Nuss ___ 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] C::V::PDF? (Anybody have one?)
-Original Message- From: Nathaniel Nuss [mailto:[EMAIL PROTECTED] Sent: Monday, January 08, 2007 7:49 PM To: The elegant MVC web framework Subject: Re: [Catalyst] C::V::PDF? (Anybody have one?) What is the nature of the PDFs you need to create? Image centric - Text centric Private(For sale) - Public Dynamic(User driven) - Static High Res. - Fast Download (Low Res.) The projects I'm involved with generate PDFs that fall primarily on the left of those, except the last one where we have to be on both sides! ;) Other, more specific, needs you have for the PDFs you're making may be helpful. -- Nate Nuss Mostly on the right side. Primarily for reports. The biggest gain is being able to do things like page breaks in PDF that don't really apply to an HTML medium. I suppose when it comes down to it, I should be searching CPAN for a PDF module that does what I want and starting from there. -Dylan ___ 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] Browser window/tab independent sessions
Octavian Rasnita wrote: And I think this is what is wanted, because I can't see other needs for having 2 separate sessions on the same computer. There is no need for having two separate sessions if you can guarantee the user will ALWAYS be able to finish one task before starting another. That works beautifully in theory, not so well in real life. Practical case one: database of users for an ISP. A helpdesk operator is going through his tickets, looking up one user at a time, when a phone call comes in. He now either has to deal with the customer without looking them up (practically impossible), or he has to abandon the session where he half completed the processing of the ticket in order to look up the customer. Both alternatives are unappealing. Practical case two: a webshop where items can be customised. (i.e. first you choose a widget, then you specify the color, case design, ram size, two wheels or four, Let us say all of those choices affect the price). As long as your customers go through the shop one widget at a time, everything is fine. But if he goes through two different sessions at a time because he wants to comparison shop, they have a problem. If *all* your state is in the cookie, it is simply impossible for them to do that. There are very good reasons why PART of the session information should be unique to each tab, and PART of it should be common. Deciding which part belongs where requires knowledge of the problem domain, and thinking through of common usage scenarios. Saying Oh, that problem is solved by choosing browser X is completely unacceptable in the real world. In the real world, you can NOT choose which browser all the people using your application will run, nor can you afford to turn away those who run different browsers. ___ 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/