Re: [Catalyst] Calendar for Catalyst application?...

2008-02-20 Thread Zbigniew Lukasiak
On Feb 17, 2008 8:14 PM, Alex Povolotsky [EMAIL PROTECTED] wrote:
 Hello!

 I recall I've seen somewhere calendar plugin for catalyst applications,
 but I cannot find one. Maybe someone will point me to a missing link?...

Some very basic support you can get with
Template::Plugin::Calendar::Simple (assuming you use TT).

Zbigniew
http://brudnopis.blogspot.com/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Instant CRUD with DBIC::Schema

2008-02-20 Thread Alex Povolotsky

Hello!

Scaffold seems to be a good thing, but it is using CDBI. Maybe something 
like it with DBIC exists?


Alex.


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Instant CRUD with DBIC::Schema

2008-02-20 Thread Zbigniew Lukasiak
Are you talking about Catalyst::Example::InstantCRUD?  It uses DBIC -
see at CPAN.

It is still a bit outdated though - I have to admit that.  I have
plans to port it to use HTML::FormFu.

Cheers,
Zbigniew

On Wed, Feb 20, 2008 at 4:17 PM, Alex Povolotsky [EMAIL PROTECTED] wrote:
 Hello!

  Scaffold seems to be a good thing, but it is using CDBI. Maybe something
  like it with DBIC exists?

  Alex.


  ___
  List: Catalyst@lists.scsys.co.uk
  Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
  Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
  Dev site: http://dev.catalyst.perl.org/




-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Distributed session storage problems/questions

2008-02-20 Thread Matt Pitts
We have a load balanced application where the proxy does *not* force any
type of sticky session with each backend. The app was running in
production as a single instance (pre load-balanced) and we moved it
behind the proxy to be able to add backends and make it load balanced. I
had the app in test for several weeks as a load-balanced setup using
memcached to store sessions across the 2 backends and I am pretty
confident that the auth areas that relied on session storage were
working fine.

 

As of last night the app throws errors (in UAT) about every other
request when inside an auth area with the 2 backends enabled. I can't
get the actual message as this time, but it basically was a Can't use
12345 as a HASHREF... type of error where '12345' is the ID of the user
I was authenticated as. If I disable one of the backends, clear my
cookies and re-login the entire session works fine. As soon as I
re-enable the other backend I start getting the errors again and it
doesn't matter which backend I use first, they both work independent of
one another. Obviously, the first backend that stores the session works
and the other doesn't, but what I don't know is why. 

 

As I stated above, I'm pretty confident that all the auth areas of the
site were functioning in the load-balanced setup before we went to PROD.
So, I looked at what changed and the only thing that changed related to
session storage was that I added a 2nd memcached backend instance to the
config file. I wondered if this might have been part of the problem, but
I have since dropped back to only one memcached instance, restarted it
and the errors still persist.

 

Here is the relevant config section:

 

session:

  flash_to_stash: 1

  expires: 3600

  memcached_new_args:

data:

  - 10.xxx.xxx.xxx:11211

namespace: tangeroutlet_tangerweb_session_uat

 

In an effort to troubleshoot this I have also tried to implement
memcached storage using C::P::Session::Store::Cache and
C::P::Cache::Memcached, but I haven't gotten this to work yet.

 

I'm hoping that answers to the following questions will guide me to a
solution:

 

1. What is the acceptable way to use memcached for session storage? Is
it using C::P::Session::Store::Memcached or is it
C::P::Session::Store::Cache in conjunction with C::P::Cache::Memcached?

 

2. Is memcached even a good way to store sessions? DBIC seems to be a
popular option, but I figured memcached's considerable speed would make
it the preferred choice.

 

3. When using memcached to store sessions, is it OK to have more than
one backend? At first I didn't think anything about adding another
backend, but then I thought that the 2 memcached instances wouldn't have
the same set of data which would cause problems with sessions, unless of
course the session writes get distributed to all the backends. I've
looked into the source of C::P::Session::Store::Memcached,
Cache::Memcached::Managed and Cache::Memcached and cannot tell if the
writes are spread across all backends. Does anyone know the answer to
this?

 

4. Is it just crazy to run a load balanced setup without some type of
sticky session setup on the proxy? If so, any implementations of this
using Apache 2.x mod_proxy(_balancer) as the frontend would be greatly
appreciated.

 

At this point I think I'd be willing to take a performance hit and store
sessions in DBIC if it's going to work better in a distributed
environment.

 

TIA for any input.

 

v/r

 

-matt pitts

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Distributed session storage problems/questions

2008-02-20 Thread Lars Balker Rasmussen
On Wed, Feb 20, 2008 at 01:08:08PM -0500, Matt Pitts wrote:
 1. What is the acceptable way to use memcached for session storage? Is
 it using C::P::Session::Store::Memcached or is it
 C::P::Session::Store::Cache in conjunction with C::P::Cache::Memcached?

Well, either, really, they do much the same thing.  I wrote CPS::Store::Cache
to avoid the silliness of having two connections to memcached per backend, 
using two different Cache:: modules.

So, if you have the cache working, it should be very easy to set up 
sessions.

 2. Is memcached even a good way to store sessions? DBIC seems to be a
 popular option, but I figured memcached's considerable speed would make
 it the preferred choice.

How important are sessions to you?  If dropping a session once in a bluemoon
is acceptable, memcached is perfectly fine.  In fact, the memcached process
is about as stable as the rest of the machine it runs on, which should 
hopefully be very stable. 

 3. When using memcached to store sessions, is it OK to have more than
 one backend?

YES!  Definitely.  Silly not to.

 At first I didn't think anything about adding another
 backend, but then I thought that the 2 memcached instances wouldn't have
 the same set of data which would cause problems with sessions, unless of
 course the session writes get distributed to all the backends. I've
 looked into the source of C::P::Session::Store::Memcached,
 Cache::Memcached::Managed and Cache::Memcached and cannot tell if the
 writes are spread across all backends. Does anyone know the answer to
 this?

As long as you specify the servers in the same order on all memcached-
clients, they will hash the keys the exact same way, and a set() on
server B will cause a get() on server A to just work(tm).

 4. Is it just crazy to run a load balanced setup without some type of
 sticky session setup on the proxy? If so, any implementations of this
 using Apache 2.x mod_proxy(_balancer) as the frontend would be greatly
 appreciated.

Sticky sessions are annoying.
-- 
Lars Balker RasmussenConsult::Perl

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] RFC - Catalyst::Plugin::UploadProgress (changes to accommodate safari)

2008-02-20 Thread Wade . Stuart

  I am looking for comments from people whom use this plugin.  I have
had some issues getting it to display the upload progress bar realtime with
safari.  After a lot of digging around it appears as though safari does not
allow you to update the DOM while a form containing a fileupload is posted.
Actual usage shows the progress bar for a flash (or not even) right before
the final page reload happens from the form action url.

  The solution I have found and seems to test across all browsers
(ie,ff,safari, opera) is to (yes I know i hate them too) use an invisible
iframe in the form and set the form's target to that iframe.  The jmpl js
needs to be changed to redirect to the action url to achieve the same
redraw of the screen that happens after the non-iframe-target-hacked
version.

My questions are:

Has anyone else seen these issues, or found any other way around them?
Should I just submit a patch for pod describing the issue and workaround
for safari OR change the pod, startEmbeddedProgressBar to accept a target
final target argument and jmpl to allow for the jump?



See below for a working  (safari,ff,ie,opera) example modified from the pod
(without the jmpl/js mods).


 use Catalyst;
MyApp-setup( qw/Static::Simple Cache::FastMmap UploadProgress/ );

# On the HTML page with the upload form, include the progress
# JavaScript and CSS.  These are available via a single method
# if you are lazy.
html
  head
[% c.upload_progress_javascript %]
  /head
  ...

# For better performance, copy these 3 files from the UploadProgress
# distribution to your static directory and include them normally.
html
  head
link href=/static/css/progress.css rel=stylesheet
type=text/css /
script src=/static/js/progress.js
type=text/javascript/script
script src=/static/js/progress.jmpl.js
type=text/javascript/script
  /head
  ...

# Create the upload form with an onsubmit action that creates
# the Ajax progress bar.  Note the empty div following the form
# where the progress bar will be inserted.
form action='/upload'
  method=post
  enctype=multipart/form-data
+  target=target_upload
  onsubmit=return startEmbeddedProgressBar(this)
+ iframe id='target_upload' name='target_upload' src=''
style='width:1px;height:1px;border:0'/iframe

  input type=file name=file /
  input type=submit /
/form
div id='progress'/div

# No special code is required within your application, just handle
# the upload as usual.
sub upload : Local {
my ( $self, $c ) = @_;

my $upload = $c-request-uploads-{file};
$upload-copy_to( '/some/path/' . $upload-filename );
}



Thanks!
Wade Stuart
Fallon Worldwide
P: 612.758.2660
C: 612.877.0385


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Instant CRUD with DBIC::Schema

2008-02-20 Thread Peter Karman


On 02/20/2008 09:17 AM, Alex Povolotsky wrote:
 Hello!
 
 Scaffold seems to be a good thing, but it is using CDBI. Maybe something
 like it with DBIC exists?
 

Also look at CatalystX::CRUD::Model::DBIC. Feedback appreciated.

-- 
Peter Karman  .  [EMAIL PROTECTED]  .  http://peknet.com/


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


RE: [Catalyst] Distributed session storage problems/questions

2008-02-20 Thread Matt Pitts
 -Original Message-
 From: Lars Balker Rasmussen [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, February 20, 2008 1:35 PM
 To: The elegant MVC web framework
 Subject: Re: [Catalyst] Distributed session storage problems/questions
 
 On Wed, Feb 20, 2008 at 01:08:08PM -0500, Matt Pitts wrote:
  1. What is the acceptable way to use memcached for session storage?
 Is
  it using C::P::Session::Store::Memcached or is it
  C::P::Session::Store::Cache in conjunction with
 C::P::Cache::Memcached?
 
 Well, either, really, they do much the same thing.  I wrote
 CPS::Store::Cache
 to avoid the silliness of having two connections to memcached per
 backend,
 using two different Cache:: modules.
 
 So, if you have the cache working, it should be very easy to set up
 sessions.
 
  2. Is memcached even a good way to store sessions? DBIC seems to
be
 a
  popular option, but I figured memcached's considerable speed would
 make
  it the preferred choice.
 
 How important are sessions to you?  If dropping a session once in a
 bluemoon
 is acceptable, memcached is perfectly fine.  In fact, the memcached
 process
 is about as stable as the rest of the machine it runs on, which should
 hopefully be very stable.
 
  3. When using memcached to store sessions, is it OK to have more
than
  one backend?
 
 YES!  Definitely.  Silly not to.
 
  At first I didn't think anything about adding another
  backend, but then I thought that the 2 memcached instances wouldn't
 have
  the same set of data which would cause problems with sessions,
unless
 of
  course the session writes get distributed to all the backends. I've
  looked into the source of C::P::Session::Store::Memcached,
  Cache::Memcached::Managed and Cache::Memcached and cannot tell if
the
  writes are spread across all backends. Does anyone know the answer
to
  this?
 
 As long as you specify the servers in the same order on all memcached-
 clients, they will hash the keys the exact same way, and a set() on
 server B will cause a get() on server A to just work(tm).
 
  4. Is it just crazy to run a load balanced setup without some type
of
  sticky session setup on the proxy? If so, any implementations of
this
  using Apache 2.x mod_proxy(_balancer) as the frontend would be
 greatly
  appreciated.
 
 Sticky sessions are annoying.
 --
 Lars Balker Rasmussen
 Consult::Perl
 
 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-
 archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/

This is very, very helpful information. Much thanks.

v/r

-matt pitts

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Doing work inside the DBIx::Class model

2008-02-20 Thread Cian Barclay
On Wed, Feb 20, 2008 at 4:33 PM, Zbigniew Lukasiak [EMAIL PROTECTED]
wrote:


 He meant result_source:

http://cpan.uwinnipeg.ca/htdocs/DBIx-Class/DBIx/Class/ResultSet.html#result_source



Thanks Zbigniew and Toby, that's just what I needed to know. Is there
a good way to call a class method and get a resultset to use?
I'm using Widget::class_method($schema) to give it the schema
from $self-result_source-schema. Is there a better way to do it?

thanks
Cian
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/