Re: [Catalyst] New Apress book shipping now from Amazon.com

2009-07-11 Thread Francesc Romà i Frigolé
Both links below point to amazon.co.uk which still doesn't have the book.
Maybe you could point as well to amazon.com: The USA site already has the
book, and it's cheaper. Although I don't know how much the shipping is going
to be compared to the UK site.

Francesc



On Thu, Jul 9, 2009 at 1:21 PM, Kieren Diment dim...@gmail.com wrote:


 On 09/07/2009, at 9:08 PM, Tomas Doran wrote:

  Thomas L. Shinnick wrote:

 Anybody going to have one of those link to Amazon from here and we'll
 get a donation links on their web page.  (hint hint) Hmm,
 http://books.perl.org/ should, but doesn't...?
 (I'll wait until tomorrow before ordering)


 http://www.enlightenedperl.org/



 Or for those of you without javascript or with adblock plus, you can buy it
 from the link at  http://catalystframework.org





 ___
 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/

___
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] 5.80005: $c-req-remote_user and apache: excluding actions from authentication

2009-06-19 Thread Francesc Romà i Frigolé
On Wed, Jun 10, 2009 at 6:13 PM, Tomas Doran bobtf...@bobtfish.net wrote:


  Both perceptually and numerically. Since the deployment documentation
 recommends not serving static files with catalyst I assumed it was normal.


 I'd still recommend serving your CSS/JS/icons directly through apache, it
 is more efficient.

 But for things like document downloads with access control etc, then just
 using:


 http://search.cpan.org/~flora/Catalyst-Plugin-Static-Simple-0.21/lib/Catalyst/Plugin/Static/Simple.pm#serve_static_file_$file_pathhttp://search.cpan.org/%7Eflora/Catalyst-Plugin-Static-Simple-0.21/lib/Catalyst/Plugin/Static/Simple.pm#serve_static_file_$file_path

 very much works 'well enough' until you have lots (10s) of concurrent
 downloads.



t0m,

Sorry for taking so long to reply. I didn't have time to do some tests until
yesterday.

You were right and I was wrong: I couldn't find any measurable difference
between serving files directly with apache or with
Catalyst::Plugin::Static::Simple on the conditions we had discussed. I've
been repeating the test during last 24h to see if there where any
differences depending on server conditions, but results have remained
consistent. I tested with relatively small files (around 1MB) because the
impact of tcp slow start should be more noticeable. I'm not concerned about
smaller files since I don't have any privacy issues for things like CSS and
icons.

Therefore I don't have any reason anymore to use HTTP auth, which will make
my setup much simpler :)

I don't have any notes on how I tested last time, so I don't know what went
wrong. I'll write what I did this time for future reference. It's a really
simple test

1) created application TestDownload with catalyst 5.8005

2) set logging for Catalyst::Plugin::Static::Simple in lib/TestDownload.pm,
to be able to verify whether files are being served by catalyst or apache.
Added line __PACKAGE__-config-{static}-{logging} = 1;

3) put a few images and an html file that displays the images in
root/static. I called the html file test.htm (not html) so that
C:P:Static::Simple doesn't ignore it.

4) ln -s root/static root/public

5) Edit apache's .htaccess to send to catalyst the contents of the static
directory but not the public directory

AddHandler fastcgi-script .pl
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} /static/
RewriteRule ^(.*)$ script/testdownload_fastcgi.pl/$1 [QSA,L]

6) with Firefox 3, open the uri static/test.htm and public/test.htm. Check
in the logs that I get the traces from C:P:Static:Simple for the files under
static/ but not for the files under public/ .

Measured network statistics with firebug.

Results: On a 6MB cable connection across the Atlantic, for downloading the
html and 5 images of about 5MB total, it takes about 11s +/- 2s. The results
are distributed randomly in this range, they are highly correlated for both
scenarios. Sometimes the files served by catalyst arrive a few 100 ms faster
than the ones served by apache, sometimes is the other way around. The 5
images are downloaded in parallel, which is relevant for my usage scenario.

Sometimes the application is not running, and it needs to be restarted,
which takes about 5s extra, but that's not relevant for this test.

I hope this can be useful for somebody else.

Thanks again to all who replied.

Francesc
___
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] ajax character encoding issue solved, but WHY?

2009-06-19 Thread Francesc Romà i Frigolé
On Fri, Jun 19, 2009 at 6:23 AM, seasproc...@gmail.com wrote:


 The problem was fixed by calling utf8::decode on the data prior to sending
 back via ajax. BUT WHY?

 I am using the JSON view to render ajax responses, and it sets the charset
 header correctly to UTF-8. Of course, even when you decode, perl still
 represents as internal utf8. But why should this be necessary?



I had exactly the same problem and solution using Catalyst::Controller::REST
with the JSON serializer. Still in my list of 'big mysteries to be solved'.


I hadn't discovered Catalyst::Plugin::Unicode back then, I wonder if using
it would help, haven't tried myself yet.

Cheers
Francesc
___
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] 5.80005: $c-req-remote_user and apache: excluding actions from authentication

2009-06-10 Thread Francesc Romà i Frigolé
On Tue, Jun 9, 2009 at 10:26 PM, Tomas Doran bobtf...@bobtfish.net wrote:

 This (and the ugly password box) is why most 'internet' websites implement
 auth with a login form - you can be a lot more flexible about the level of
 user-authenticity you require at each stage...



Thanks for the explanation. There are two reasons why I'm considering HTTP
auth despite it's lack of flexibility. I'd be happy to hear about
altrenatives.

1) static performance: serving static files directly from apache is much
faster than through catalyst. I find it specially noticeable with big files
like large pictures and pdfs. Some of the files should not be public. If I
do authentication in catalyst I can't serve them directly from apache.

2) dynamic/AJAX laziness: pages that use XMLHttpRequest stop working when
authentication expires. Unless I manually detect the condition and allow the
user to re-authenticate. Using HTTP auth should let the browser take care of
this.

Regards,
Francesc
___
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] SOLVED Re: 5.80005: $c-req-remote_user and apache: excluding actions from authentication

2009-06-10 Thread Francesc Romà i Frigolé
2009/6/9 Francesc Romà i Frigolé
francesc.roma+catal...@gmail.comfrancesc.roma%2bcatal...@gmail.com



 I'm trying the new feature $c-req-remote_user introduced in 5.80005. I'd
 like to know if it is possible to tell apache, in a .htaccess file, to not
 ask authentication for a certain set of URIs (for example matching /public/)

 I'm on a shared account in asmallorange.com ( apache 1.3.41). I'm using
 fastcgi.



I found a workaround for this scenario. Instead of setting up fastcgi in
.haccess at the root of the application, I make two different directories
for public and private, with different authentication rules. My directory
structure is like this

public_html/myapp/static(soft link to MyApp/static)
public_html/myapp/public
public_html/myapp/public/script (soft link to MyApp/script)
public_html/myapp/private
public_html/myapp/private/script(soft link to MyApp/script)


The .htaccess in the public directory is like this

AddHandler fastcgi-script .pl

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ script/myapp_fastcgi.pl/public/$1 [QSA,L]

Similarly in the private directory:

AddHandler fastcgi-script .pl

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ script/myapp_fastcgi.pl/private/$1 [QSA,L]

Auth stuf [...]


Also, in the static directory I could leave some things public ( css,
javascript, icons...) but make other private ( uploads, reports, ...) by
placing a .htaccess file requiring authentication in each corresponding
directory.

It's not a very flexible or elegant approach, but it seems to work.

Regards,
Francesc
___
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] FormFu vs. FormBuilder ...

2009-06-10 Thread Francesc Romà i Frigolé
On Wed, Jun 10, 2009 at 9:00 AM, Kiffin Gish kiffin.g...@planet.nl wrote:

 What are the advantages/disadvantages for choosing between
 Catalyst::Controller::FormBuilder and Catalyst::Controller::HTML:FormFu?



FormBuilder is popular because is an older and stable project. It doesn't
seem very active anymore though.

FormFu is popular among the Catalyst community because it is has a more
modern design and an active community. It's API might not be as stable
though. Since it has a more modular design it seems easier to extend and
people are implementing extra layers of lazyness (abstraction) on top of it.
For example the ability to automagically get/set values from a DBIx::Class
Catalyst model.


--
 Kiffin Gish kiffin.g...@planet.nl
 Gouda, The Netherlands



Francesc
Barcelona, The Catalan Countries
___
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] 5.80005: $c-req-remote_user and apache: excluding actions from authentication

2009-06-10 Thread Francesc Romà i Frigolé
On Wed, Jun 10, 2009 at 11:07 AM, Charlie Garrison garri...@zeta.org.auwrote:



 You might be looking for mod_auth_tkt. There is also x-sendfile but I don't
 have experience with that one.




mod_auth_tkt looks interesting but I wonder if it would interrupt the normal
flow of the application in case the session expires.

from http://www.openfusion.com.au/labs/mod_auth_tkt/


Requests without a valid ticket are redirected to a configurable URL which
 is expected to validate the user and generate a ticket for them. This
 package includes a Perl module and working CGI scripts for generating the
 cookies, as well as contributed classes for PHP and Python environments.



For example, imagine it expires while a user is filling out a lengthly form
and a drop down menu triggers an XMLHttpRequest. Would she be redirected to
the authentication form and loose all the information already typed?
___
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] 5.80005: $c-req-remote_user and apache: excluding actions from authentication

2009-06-10 Thread Francesc Romà i Frigolé
On Wed, Jun 10, 2009 at 11:17 AM, Tomas Doran bobtf...@bobtfish.net wrote:


 On 10 Jun 2009, at 09:40, Francesc Romà i Frigolé wrote:

 1) static performance: serving static files directly from apache is much
 faster than through catalyst. I find it specially noticeable with big files
 like large pictures and pdfs. Some of the files should not be public. If I
 do authentication in catalyst I can't serve them directly from apache.


 Nod so.

 Look at mod_sendfile, which implements lighty's X-SendFile


Google thinks you meant mod_xsendfile: http://tn123.ath.cx/mod_xsendfile/

It looks very interesting but I wonder if my shared host provider
(asmallorange) would agree to install it.



 2) dynamic/AJAX laziness: pages that use XMLHttpRequest stop working when
 authentication expires. Unless I manually detect the condition and allow the
 user to re-authenticate. Using HTTP auth should let the browser take care of
 this.


Erm, the reason that this will never fail with HTTP auth is that http auth
 never expires (well, it always lasts one browser session), and the browser
 sends the auth credentials with each request.


Good point 




 You can get the same effect by setting the correct options on your session
 cookie.



I'll look into that then. Thanks
___
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] SOLVED Re: 5.80005: $c-req-remote_user and apache: excluding actions from authentication

2009-06-10 Thread Francesc Romà i Frigolé
On Wed, Jun 10, 2009 at 11:20 AM, Tomas Doran bobtf...@bobtfish.net wrote:


 On 10 Jun 2009, at 10:04, Francesc Romà i Frigolé wrote:


 Also, in the static directory I could leave some things public ( css,
 javascript, icons...) but make other private ( uploads, reports, ...) by
 placing a .htaccess file requiring authentication in each corresponding
 directory.


 Why not just totally exclude public things from going into Catalyst at all?




Yes, that is what I'm doing, I should have said it more explicitly. I don't
make the application root directory ( /public_html/myapp) go through
Catalyst. Only the subdirectories that have an explicit .htaccess do. So
everything is static unless stated otherwise. There is no .htaccess in
/public_html/myapp



 BTW, auth doesn't have to be configured in .htaccess, in fact, I'd only do
 that if you have to, as re-reading htaccess files can end up fairly
 expensive.



I'm on a shared hosting. I'm trying to find out if I can get a reasonable
performance serving non public static files. With the setup I described
there is at most one .htaccess file that needs to be read for each request:
either it redirects dynamic stuff to catalyst ( different .htaccess for
public or private ) or serves a public static file (no .htaccess to be read)
or serves static private files (no catalyst, static/private/.htaccess)

cheers
___
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] 5.80005: $c-req-remote_user and apache: excluding actions from authentication

2009-06-10 Thread Francesc Romà i Frigolé
On Wed, Jun 10, 2009 at 1:55 PM, Tomas Doran bobtf...@bobtfish.net wrote:

You're worrying about the efficiency of pushing bytes around, but you're
 using shared hosting.

 Surely this is premature optimisation?



t0m,

The applications I'm writing are expected to have a relatively small number
of users. From my experience so far the performance is quite good on a
shared hosting as long as I serve the static content from outside Catalyst.
Otherwise performance degrades significantly since each user has to deal
with a few static files that weight a few MB each.

This approach works for me as long as the static content requires no
authentication or the whole site requires authentication. It just have to
edit a single .htaccess file.

My concern is to keep the setup as simple as possible, and I find this
configuration very advantageous compared to dedicated/virtual hosting since
I don't have to take care of the servers (we are a small team with more
programming than systems administration experience)

Now I'm facing a new situation which is that some parts of the Catalyst
application have to be public. Since it's not a very different situation
than what I had been doing so far I think is legitimate to expect to be able
to solve it with similar tools.

I'm very grateful to you and kmx and Charlie for your help. Thanks to you
(and a bit of research and experimentation on my own) I've learned that for
achieving this goal I will have to sacrifice some flexibility: I should
design my applications in a way that there is only two paths that lead to
secure content (one that goes through catalyst and one that is static). In
this way I can solve the problem with a simple directory structure and two
.htaccess files. The layout of the public files/actions is not restricted. I
can't have paths to actions that behave differently depending on whether or
not the user has logged in.

For completeness sake I'll also say that there is a trivial solution that
avoids this trade off in flexibility: to set up a guest account. But I
don't like this solution because it would annoy guest users.

Through this discussion I've learned valuable knowledge which will help me
make design and planning decisions.

Thanks again to all for your replies,
Francesc
___
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] 5.80005: $c-req-remote_user and apache: excluding actions from authentication

2009-06-10 Thread Francesc Romà i Frigolé
On Wed, Jun 10, 2009 at 5:33 PM, Tomas Doran bobtf...@bobtfish.net wrote:

 Francesc Romà i Frigolé wrote:

 The applications I'm writing are expected to have a relatively small
 number of users. From my experience so far the performance is quite good on
 a shared hosting as long as I serve the static content from outside
 Catalyst. Otherwise performance degrades significantly since each user has
 to deal with a few static files that weight a few MB each.


 Hmm, well, this strikes me as weird.

 I have a 100Mb link (shared with other people) between myself and my live
 environment, and I thought I'd do a very quick test.

 I tarred up 182Mb of crap.

 Static apache: 11.19M/s

 Put into a newly generated TestApp in root/static, running with the
 development server: 11.18M/s

 So I think you're doing something severely non-optimum (or your shared
 hosting machines are totally swamped) if you're seeing significant
 performance degredation.

 Do you see the same issues when testing locally, or just and your shared
 host, and what technique are you using to serve these static files?



Thanks for taking the time for testing this. I did my tests some months ago
with smaller files (1-5 MB) and I don't remember the exact results now, but
I clearly remember that it made a very significant difference. Both
perceptually and numerically. Since the deployment documentation recommends
not serving static files with catalyst I assumed it was normal.

I won't have time today, but I tomorrow I'll do more tests and report the
results

cheers
Francesc
___
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] 5.80005: $c-req-remote_user and apache: excluding actions from authentication

2009-06-09 Thread Francesc Romà i Frigolé
Hello,

This is more of an apache question than a Catalyst one, but I'd appreciate
some help.

I'm trying the new feature $c-req-remote_user introduced in 5.80005. I'd
like to know if it is possible to tell apache, in a .htaccess file, to not
ask authentication for a certain set of URIs (for example matching /public/)

I'm on a shared account in asmallorange.com ( apache 1.3.41). I'm using
fastcgi.

Regards,
Francesc
___
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] 5.80005: $c-req-remote_user and apache: excluding actions from authentication

2009-06-09 Thread Francesc Romà i Frigolé
On Tue, Jun 9, 2009 at 7:53 PM, Tomas Doran bobtf...@bobtfish.net wrote:

 Francesc Romà i Frigolé wrote:

 This is more of an apache question than a Catalyst one, but I'd appreciate
 some help.

 I'm trying the new feature $c-req-remote_user introduced in 5.80005. I'd
 like to know if it is possible to tell apache, in a .htaccess file, to not
 ask authentication for a certain set of URIs (for example matching /public/)


 Yes, it is.

 Location /public
   Satisfy Any
   Allow from All
 /Location

 should do what you want.



Thanks Tomas, but I get the error:  .htaccess: Location not allowed here

This is because Location is not an htaccess directive. See
http://httpd.apache.org/docs/1.3/mod/core.html#location

I also tried with FilesMatch which it is allowed, but it doesn't seem to
work (which makes sense because I'm not actually matching any file but a
catalyst action )




 Also, if you haven't seen it yet:

 http://search.cpan.org/~bobtfish/Catalyst-Plugin-Authentication-0.10012/lib/Catalyst/Authentication/Credential/Remote.pmhttp://search.cpan.org/%7Ebobtfish/Catalyst-Plugin-Authentication-0.10012/lib/Catalyst/Authentication/Credential/Remote.pm



It looks very interesting. From your explanation

# in your Controller/Root.pm you can implement auto-login in this way
sub begin : Private {
my ( $self, $c ) = @_;

unless ($c-user_exists) {
# authenticate() for this module does not need any user info
# as the username is taken from $c-req-remote_user and
# password is not needed

unless ($c-authenticate( {} )) {
  # return 403 forbidden or kick out the user in other way
};
}
}


it seems that it should be possible to tell apache that authentication is
optional, but I don't know how to do that. How can I make apache ask for a
username/password but not return a 401 Authorization Required error?

Thanks,
Francesc
___
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] RFC: new helper api

2009-06-05 Thread Francesc Romà i Frigolé
On Thu, Jun 4, 2009 at 4:51 AM, Devin Austin devin.aus...@gmail.com wrote:

 Howdy all,

 I've put together an RFC for the new Catalyst::Helper API.
 The body text is located below, but it is also available here in a pretty
 formatted version:
 http://www.codedright.net/2009/06/rfc-catalysthelper-api.html



Hi Devin,

Thanks for working on this. I think you are on the right path :)

This are two examples of things I think Catalyst::Helper should do, and it
looks like it would, if your RFC where implemented:

1) It should be possible to create an application with catalyst version X
and then run the catalyst helper again on catalyst version  X  (assuming it
doesn't use any feature of the newer version). Right now if an application
has been created with Catalyst 5.8, running it with 5.7 is not just a matter
of changing the line use Catalyst::Runtime 5.80;

2) It should be possible to incrementally change parts of the themes both
for a specific application, or in general, for all the applications that I'm
developing.

For example, a possible approach could be, if I do catalyst.pl MyApp -theme
cheesy, and I have a local theme configuration, let's say I have the files
wrapper.tt and css/forms.css in the directory ~/.catalyst/themes/cheesy. In
this case it should use the default catalyst configuration files for the
theme cheesy except for my local theme files. Also, if MyApp already
exists, it should respect the local changes made to the theme for that
application.

I don't understand the part about generating DBIC schemas. Right now when I
need to change the schema because the sql has changed during development I
do this:

rm seminar.db
sqlite3 seminar.db  seminar.sql
./script/seminar_create.pl model DB DBIC::Schema Seminar::Schema
create=static components=InflateColumn::FS  dbi:SQLite:seminar.db

What are you proposing to change/improve?

regards,
Francesc
___
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] Catalyst - any good AJAX tutes?

2009-03-06 Thread Francesc Romà i Frigolé
On Fri, Mar 6, 2009 at 6:43 AM, kakim...@tpg.com.au wrote:


 hello there,

  I would like to use AJAX in my catalyst app. Any good references/tutes
 to recommend?

 thanks.

 K. akimoto


Hello,

Depends on what do you want to do with AJAX. For example, if you want to do
forms, I think it is a bit more complicated than suggested in previous
replies.

Ideally, for forms, you'd like to have some modules that magically
initialize your forms with data from your model, then render a nice form
with your favorite JS toolkit, using  AJAX for things like auto-complete
with data from your model, validate the forms both on the client and on the
server, and then update your model with the user submitted data.

So far, I haven't found anything that does this for my tools of choice:
DBIx::Class + Dojo

There is HTML::FormFu::Dojo which sounds promising but hasn't been released
yet. Check it out here: http://code.google.com/p/html-formfu/

cheers
Francesc
___
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] Template::Plugin::Latex 3.00_05 and catalyst

2008-02-29 Thread Francesc Romà i Frigolé
Thanks Jon,

Unfortunately it didn't work for me :(

I'm using catalyst 5.7012-r2 on gentoo

Francesc

On Thu, Feb 28, 2008 at 10:30 PM, Jon Schutz [EMAIL PROTECTED]
wrote:


  The weird thing is that the workaround doesn't work for me with
  version 3 of the T:P:Latex, but if I force  (in the T:P:Latex code,
  not in my application) the return value of the system call to be 0,
  then it works. The hack proposed in the catalyst calendar looks like
  this, and I can't see anything that would make it work only for a
  particular version of a plugin.
 
   {
 no warnings 'redefine';  # right here, you can tell bad things
  will happen
 local *Template::Latex::system = sub {
 
   my $ret = system(@_);
 
   # guesstimate whether the system call was successful or not
 
   return 0 if ( guess == OK );
   return $ret;
 } if $c-engine =~ /^Catalyst::Engine::HTTP/;
 
 
  Any ideas why it doesn't work?

 Not sure, but I have successfully used Template::Plugin::Latex 3.00_05
 in Catalyst dev server using a patch for the system() problem previously
 posted on the catalyst-dev list, which I have attached.  Seems others
 may not have had the same success as me, so YMMV.


 --

 Jon SchutzMy tech notes http://notes.jschutz.net
 Chief Technology Officerhttp://www.youramigo.com
 YourAmigo


 -- Forwarded message --
 From: Jon Schutz [EMAIL PROTECTED]
 To: Development of the elegant MVC web framework 
 [EMAIL PROTECTED]
 Date: Sun, 28 Oct 2007 17:51:04 +1030
 Subject: Re: [Catalyst-dev] Fix for system() returning -1 on dev server
 On Sat, 2007-10-27 at 12:46 -0400, Andy Grundman wrote:

   optional_http-server.t + live_fork.t already tests for this and was
   failing the tests for system() and backticks return codes.  Post-patch
   it passes system() and still fails backticks exit code.
 
  Hmm, even with the patch both the system and backticks tests fail for
  me.  The output is the same with or without the patch:
 

 Well, I checked with vanilla 5.8.8, vanilla 5.9.5 and RHEL5
 perl-5.8.8-24, and on all systems I got the same - prepatch both system
 () and backticks fail, and postpatch system() is fixed but backticks
 still fails.

 Nevertheless, I thought I'd have a look at the backticks problem as
 well, and implement the double-fork approach - the main process forks
 and reaps its child inline, which happens without delay because all the
 child does is fork again and exit, so there is no need for any SIG{CHLD}
 handling at all.

 Attached is suggested patch against svn 7075, with which I get all tests
 passing on optional_http-server and optional_http-server-restart. (And
 yes, my app still works too!)  Please give it a try and see if you have
 more success.

 --

 Jon

 ___
 Catalyst-dev mailing list
 [EMAIL PROTECTED]
 http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev

 ___
 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/


___
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] Template::Plugin::Latex 3.00_05 and catalyst

2008-02-28 Thread Francesc Romà i Frigolé
Hello,

Andrew Ford has made available developer's releases of the next
version of the Template::Plugin::Latex. Version 3 has several nice
improvements over version 2: it detects if the latex file need more
compilation runs and it provides a TT filter for latex encoding, among
other features.

You can get it here:
http://search.cpan.org/~andrewf/Template-Plugin-Latex-3.00_05/

I'm trying to use this version from within Catalyst, and I doesn't
work, probably due to the bug in the standaralone server where all
system calls return -1. This bug and a workaround are discussed here:
http://catalyst.perl.org/calendar/2006/12

The weird thing is that the workaround doesn't work for me with
version 3 of the T:P:Latex, but if I force  (in the T:P:Latex code,
not in my application) the return value of the system call to be 0,
then it works. The hack proposed in the catalyst calendar looks like
this, and I can't see anything that would make it work only for a
particular version of a plugin.

 {
   no warnings 'redefine';  # right here, you can tell bad things
will happen
   local *Template::Latex::system = sub {

 my $ret = system(@_);

 # guesstimate whether the system call was successful or not

 return 0 if ( guess == OK );
 return $ret;
   } if $c-engine =~ /^Catalyst::Engine::HTTP/;


Any ideas why it doesn't work?
Thanks,
Francesc

___
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] So, what do we want in the -next- book?

2008-02-19 Thread Francesc Romà i Frigolé
John's book has been very useful, and still is, as I'm now using it as a
reference, even though as others have pointed out it's more of a tutorial
than a reference.

Still, there are some topics I wish they were covered at more depth: the
fundamental stuff and the more advanced stuff.

Fundamental: knowledge of TT and DBIx::Class are needed to really take
advantage of catalyst. While there is a book on TT, afaik there is none on
DBIx::Class. I know that those are independent projects and it is possible
to use catalyst with other views and ORMs, but this two are the de facto
standards in this community. OTH I prefer thin books, so maybe, what I'm
actually asking for is a DBIx::Class book :)

Advanced: AJAX and forms. dynamic web pages are more than hot web topics.
There are many options available for catalyst, and none of them seem nearly
as standard as TT or DBIC, so it would be nice to have a book explaining
the different options for building complex interactive forms. Since those
are in fact hot topics there is a lot of literature that covers them, I just
don't know how relevant they are when it comes to developing with catalyst.
If there are relevant books I'd be happy to hear about them.


On Feb 18, 2008 7:17 PM, Matt S Trout [EMAIL PROTECTED] wrote:

 Since a fair few of you will now have John's book, I figured it was time
 to ask what you'd want from a second book.

 I guess the existing one provides a pretty good tutorial style, so we
 should
 be looking at something more in-depth / intermediate to advanced.

 What do you guys think?

 --
  Matt S Trout   Need help with your Catalyst or DBIx::Class
 project?
   Technical Director
 http://www.shadowcat.co.uk/catalyst/
  Shadowcat Systems Ltd.  Want a managed development or deployment
 platform?
 http://chainsawblues.vox.com/
 http://www.shadowcat.co.uk/servers/

 ___
 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/

___
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/