Re: [Catalyst] Announce: Website In A Box

2007-03-20 Thread Kieren Diment

On 20/03/07, Jon [EMAIL PROTECTED] wrote:


 After that all started OK, but on the home page it came up with the
 warning:

 read_file '/users/jon/public_html/WIAB/trunk/WIAB/t/content/index.pod' -
 sysopen: No such file or directory
 at
/users/jon/public_html/WIAB/trunk/WIAB/script/../lib/WIAB/Model/Content.pm
line 43

 Guess I'd better read the docs now!

...caused by wiab_local.yml being used in preference to wiab.yml when
running via script/wiab_server.pl.



Thanks for the Makefile.PL reports.  I think I should tag the project as
alpha for a little while :)

There are a few undocumented gotchas, but it should be mostly stable,  In
the tradition of very few docs and you need to know your way around a
catalyst app.  Now there's a stable test suite and reasonable test coverage,
development should be reasonably steady.
___
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] Help needed with Unicode

2007-03-20 Thread Mario Minati
Hello @all,

now it's my time to make my Catalyst app Unicode aware and I (like some 
others) ran into a Unicode problem.

I read the article from the calender 2006 and read the unicode chapter in 
Daminas Advanced Perl Programming hence I don't manage to get it working.

What I have:
- Catalyst, TT, DBIx::Class app that needs to deal with german umlauts.
- Plugin Unicode::Encoding loaded.
- Postgres database with UTF8 enabled (ENCODING = 'UTF8').
- Browser is FF2, it says encoding is UTF8, mode is standard compliant 
(translated from what it says in german).
- Plugin I18N loaded, with a german po file.
- Useing the inwork HTML-Widget replacement FormFu with I18N and a german 
language module in lexicon style.
- No german umlauts are html-escaped (that's why we make unicode, right?)

Now my problems:
- text with german umlauts from tt templates is shown as expected
- text with german umlauts from po file is shown as expected
- text with german umlauts from lexicon style pm files is currupted, it is 
shown as expected, when Unicode::Encoding is disabled, so this might due to a 
double encoding - but why? 
(lexicon = perlmode loading = encoding by default, po file = no encoding at 
first place ?, I realy don't know.)
- when submitting form input Catalyst dies with an error:
[info] *** Request 207 (0.139/s) [14828] [Tue Mar 20 16:29:05 2007] ***
[error] Caught exception in engine utf8 \xE4 does not map to Unicode 
at /usr/local/share/perl/5.8.8/Catalyst/Plugin/Unicode/Encoding.pm line 73.
(The formdata is submitted through ajax/xmlhttprequest, is that a possible 
source for that problem?)

I would be very thankfull for every hint on how to hunt these things down.

By the way I usually send some debug messages with 'warn' to the console, as 
catalysts logging is not available in other modules (is it somehow?). Is that 
unicode save, or do I see crap on the console?

Greets,
Mario Minati

___
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] Help needed with Unicode

2007-03-20 Thread Carl Franks

On 20/03/07, Mario Minati [EMAIL PROTECTED] wrote:


- text with german umlauts from lexicon style pm files is currupted, it is


Does your .pm file have use utf8; ?
It's necessary for when you have UTF-8 in perl source files.

Cheers,
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] RFC: Would this be useful to anyone?

2007-03-20 Thread John Napiorkowski
I have a version of Catalyst::Model::DBIC::Schema where I hacked in some code 
to automatically look at the query string and perform some limits and sorting.  
Basically if it sees a something like:

...?[table].page=1[table].max-results=10[table].order-by=[column].[direction]

It will automatically create a new resultset object with the correct limits.  
It can also do (very unoptimized) searches with something like

...?[table].search=[text to search in the table]

I'm adding in the ability to set a start and end range, as well with something 
like

...?[table].start-index=10[table].end-index=100

I was wondering if the community thinks this could be useful, or if it would be 
more useful in some other state.  I know that this kind of resultset limiting 
is something I do all the time and I assume it's the case for others.

Right now I have this integrated with my Schema classes, as I mentioned above, 
but I am not sure it's the best thing to do.  Although it will DWIM when I do 
$c-Model('table') it doesn't help me if that resultset has one to many 
relationships that also need to be limited.  So I have this also as a DBIC 
component in order to handle this for me.

I was thinking perhaps we'd prefer to have this as a separate model that you'd 
pass a resultset and a $c-request to to get the limited resultset, instead of 
so much magic:

my $fullrs = $c-Model('Table');
$c-forward($c-Model('LimitResultSet'), [$fullrs, $c-request]);

## Now $fullrs has been limited as described above

I was thinking to use $c-forward because I tend to use forward when I am 
implementing a command or pipeline style design pattern, but this could also 
easily be:

my $fullrs = $c-Model('Table');

my $pagedrs = $c-Model('LimitResultSet')-build($fullrs, $c-request)


Or something similar If people preferred:

Then again maybe it would just be better to keep it as a raw DBIC component:

my $pagedrs = $fullrs-search_by_query($c-request);

This would have the benefit of working reasonally well will people using CGI.pm 
outside of Catalyst.  This is sort of what I am doing now, I have a component 
and my hacked Catalyst model calls it to save myself a bit of trouble.  The only


Any thoughts?

BTW, one thing that is making this hard for me to make cross database is that 
in the full text search Postgres requires ILIKE to make the search case 
insensitive, unlike ever other database.  Right now in my DBIC code I do:

foreach my $keyword ( split(/\s/, $value) ) 
{
my @keywords = split(',', $keyword);

push @array, [

-or = [ {$column = {'ILIKE' = [ map { '%'.$_.'%' } @keywords 
]} } ],
];
}

to build the correct data structure for searching.  Does anyone out there know 
if there is a neat cross database way to do this, or do I need to explicitly 
check for Postgres and use ILIKE instead of like?

--john





 

It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/

___
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] Help needed with Unicode

2007-03-20 Thread Mario Minati
Am Dienstag 20 März 2007 16:52 schrieb Carl Franks:
 On 20/03/07, Mario Minati [EMAIL PROTECTED] wrote:
  - text with german umlauts from lexicon style pm files is currupted, it
  is

 Does your .pm file have use utf8; ?
 It's necessary for when you have UTF-8 in perl source files.

Waow that did the trick for my first problem. 
I thought it would only be necessary if you have var names with umlauts. Now I 
know better ;-) 

thank you,
Mario

PS: 
The formfu validation works fine and I think I'm gone start with 
the 'repeatable' stuff in this week. would you prefer a different name for 
it.

___
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] Changing the request-user_agent

2007-03-20 Thread Adeola Awoyemi

Hi all,

Is it possible to change the request-user_agent? I am writing some  
tests where I want to set the user_agent before making the request  
and have my app behave differently depending on the user agent.


Thanks,

Adeola.


___
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] Changing the request-user_agent

2007-03-20 Thread Simon Wilcox
On Tue, 20 Mar 2007, Adeola Awoyemi wrote:

 Is it possible to change the request-user_agent? I am writing some
 tests where I want to set the user_agent before making the request
 and have my app behave differently depending on the user agent.

You mean in Catalyst::Test ?

Looks to me as though you can't as it stand right now, there's no way to
access the $agent outside of the package.

Patches welcome I'm sure :-)

S.

___
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] Help needed with Unicode

2007-03-20 Thread Mario Minati
Am Dienstag 20 März 2007 17:07 schrieb Renaud Drousies:
  (The formdata is submitted through ajax/xmlhttprequest, is that a
  possible source for that problem?)

 That was for me.

 Which request headers are you sending when doing the ajax call?
 If you are not doing so yet, try using application/x-www-form-urlencoded;
 charset=UTF-8.

Firebug says:

-- request header --
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 
Content-Type: application/x-www-form-urlencoded 

-- response header --
Content-Type: text/html; charset=utf-8 
X-Catalyst: 5.7006

For me that looks ok.
Or do I need a charset=utf-8 in the _header_? 

Greets,
Mario Minati

___
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] Help needed with Unicode

2007-03-20 Thread Mario Minati
Am Dienstag 20 März 2007 17:16 schrieb Dave Rolsky:
 On Tue, 20 Mar 2007, Mario Minati wrote:
  Am Dienstag 20 März 2007 16:52 schrieb Carl Franks:
  On 20/03/07, Mario Minati [EMAIL PROTECTED] wrote:
  - text with german umlauts from lexicon style pm files is currupted, it
  is
 
  Does your .pm file have use utf8; ?
  It's necessary for when you have UTF-8 in perl source files.
 
  Waow that did the trick for my first problem.
  I thought it would only be necessary if you have var names with umlauts.
  Now I know better ;-)

 A good rule with Unicode is Unicode anywhere, then Unicode everywhere.
 It's not worth trying to sometimes encode things and sometimes not. Just
 encode all incoming data as utf8, all the time. Submit everything as UTF8,
 all the time.

I'm trying to achieve that ;-)

Greets,
Mario

___
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] Help needed with Unicode

2007-03-20 Thread Renaud Drousies
 Am Dienstag 20 März 2007 17:07 schrieb Renaud Drousies:
  (The formdata is submitted through ajax/xmlhttprequest, is that a
  possible source for that problem?)

 That was for me.

 Which request headers are you sending when doing the ajax call?
 If you are not doing so yet, try using
 application/x-www-form-urlencoded;
 charset=UTF-8.

 Firebug says:

 -- request header --
 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
 Content-Type: application/x-www-form-urlencoded

 -- response header --
 Content-Type: text/html; charset=utf-8
 X-Catalyst: 5.7006

 For me that looks ok.
 Or do I need a charset=utf-8 in the _header_?


I'd still explicitely set the request character set. If you don't do so,
it will be handled with the default character set of your server. (correct
me if i'm wrong)

Regards,
Renaud


___
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] YAML config embedded path_to mysql_read_default_file

2007-03-20 Thread apv
Worked perfectly, thanks. Sorry I didn't extrapolate from the docs to  
just try it. Once you showed it, it seemed obvious.


-Ashley

On Monday, Mar 19, 2007, at 05:51 US/Pacific, Jason Kohles wrote:


On Mar 18, 2007, at 7:26 PM, apv wrote:

So, I would like to use a mysql connection file instead of putting  
the password and user in the config file. Can I get a path_to to work  
with this? I did Google and check the lists but couldn't find an  
answer. Where the __HERE__ is is where the  
mysql_read_default_file=(path_to) goes.


  Model::DBIC:
schema_class: MyApp::Schema::DBIC
connect_info:
   - dbi:mysql:opendevil;__HERE__;
   - ~
   - ~



If you are using Catalyst::Plugin::ConfigLoader to load your  
configuration (if you aren't sure then you probably are, it's the  
default), then you can do this...


Model::DBIC:
  schema_class: MyApp::Schema::DBIC
  connect_info:
-  
dbi:mysql:opendevil;mysql_read_default_file=__path_to(configfile.cfg)__



___
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] Help needed with Unicode

2007-03-20 Thread Mario Minati
Am Dienstag 20 März 2007 19:12 schrieb Renaud Drousies:
  Am Dienstag 20 März 2007 17:07 schrieb Renaud Drousies:
   (The formdata is submitted through ajax/xmlhttprequest, is that a
   possible source for that problem?)
 
  That was for me.
 
  Which request headers are you sending when doing the ajax call?
  If you are not doing so yet, try using
  application/x-www-form-urlencoded;
  charset=UTF-8.
 
  Firebug says:
 
  -- request header --
  Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
  Content-Type: application/x-www-form-urlencoded
 
  -- response header --
  Content-Type: text/html; charset=utf-8
  X-Catalyst: 5.7006
 
  For me that looks ok.
  Or do I need a charset=utf-8 in the _header_?

 I'd still explicitely set the request character set. If you don't do so,
 it will be handled with the default character set of your server. (correct
 me if i'm wrong)

I played a little with the FF2 settings and changed the coding to utf-8 and 
guess what, suddently it work as it should be.

So I think you might be right I have to force charset even in the request 
header, but I don't know yet how to achieve that in Dojo, but I'll find out.

I'll post my results, stay tuned.

Greets,
Mario

___
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] RFC: Would this be useful to anyone?

2007-03-20 Thread Mario Minati
Am Dienstag 20 März 2007 16:50 schrieb John Napiorkowski:
 I have a version of Catalyst::Model::DBIC::Schema where I hacked in some
 code to automatically look at the query string and perform some limits and
 sorting.  Basically if it sees a something like:

 ...?[table].page=1[table].max-results=10[table].order-by=[column].[direct
ion]

 It will automatically create a new resultset object with the correct
 limits.  It can also do (very unoptimized) searches with something like

 ...?[table].search=[text to search in the table]

 I'm adding in the ability to set a start and end range, as well with
 something like

 ...?[table].start-index=10[table].end-index=100

 I was wondering if the community thinks this could be useful, or if it
 would be more useful in some other state.  I know that this kind of
 resultset limiting is something I do all the time and I assume it's the
 case for others.

 Right now I have this integrated with my Schema classes, as I mentioned
 above, but I am not sure it's the best thing to do.  Although it will DWIM
 when I do $c-Model('table') it doesn't help me if that resultset has one
 to many relationships that also need to be limited.  So I have this also as
 a DBIC component in order to handle this for me.

 I was thinking perhaps we'd prefer to have this as a separate model that
 you'd pass a resultset and a $c-request to to get the limited resultset,
 instead of so much magic:

 my $fullrs = $c-Model('Table');
 $c-forward($c-Model('LimitResultSet'), [$fullrs, $c-request]);

 ## Now $fullrs has been limited as described above

 I was thinking to use $c-forward because I tend to use forward when I am
 implementing a command or pipeline style design pattern, but this could
 also easily be:

 my $fullrs = $c-Model('Table');

 my $pagedrs = $c-Model('LimitResultSet')-build($fullrs, $c-request)


 Or something similar If people preferred:

 Then again maybe it would just be better to keep it as a raw DBIC
 component:

 my $pagedrs = $fullrs-search_by_query($c-request);

 This would have the benefit of working reasonally well will people using
 CGI.pm outside of Catalyst.  This is sort of what I am doing now, I have a
 component and my hacked Catalyst model calls it to save myself a bit of
 trouble.  The only


 Any thoughts?

The idea is quite fascinating.

I would go for a solution where you make a subclass in the DBIC namespace to 
avoid any function calls at all. You would just need one connect function to 
give the $c handle to the DBIC subclass, but maybe you can patch the Model 
function to autoconnect the model with $c if the model isa 'DBIC::subclass'.

If that would take to much freedom the search_by_query would be my way.


 BTW, one thing that is making this hard for me to make cross database is
 that in the full text search Postgres requires ILIKE to make the search
 case insensitive, unlike ever other database.  Right now in my DBIC code I
 do:

 foreach my $keyword ( split(/\s/, $value) )
 {
 my @keywords = split(',', $keyword);

 push @array, [

 -or = [ {$column = {'ILIKE' = [ map { '%'.$_.'%' }
 @keywords ]} } ], ];
 }

 to build the correct data structure for searching.  Does anyone out there
 know if there is a neat cross database way to do this, or do I need to
 explicitly check for Postgres and use ILIKE instead of like?

I don't know any.

Greets,
Mario Minati

___
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] creating action classes for chained actions, trouble with overriding -match

2007-03-20 Thread John Napiorkowski
Hi,

I've been working on some action classes that are primarily used by chained 
actions (although they could be used otherwise) and running into some confusion 
about overriding the -match method.

It seems like if you have an action chain with several actions that have action 
classes, the -match method of the terminal action is the only one that gets 
run.  For example:

Does anyone know if this is correct?  Or am I just doing something wrong?  
Seems strange that I can hook into execute but not match but that just might be 
me.

Thanks!
--John




 

We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 

___
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] creating action classes for chained actions, trouble with overriding -match

2007-03-20 Thread John Napiorkowski


- Original Message 
From: John Napiorkowski [EMAIL PROTECTED]
To: catalyst@lists.rawmode.org
Sent: Tuesday, March 20, 2007 4:07:29 PM
Subject: [Catalyst] creating action classes for chained actions, trouble with 
overriding -match

Hi,

I've been working on some action classes that are primarily used by chained 
actions (although they could be used otherwise) and running into some confusion 
about overriding the -match method.

It seems like if you have an action chain with several actions that have action 
classes, the -match method of the terminal action is the only one that gets 
run.  For example:

Does anyone know if this is correct?  Or am I just doing something wrong?  
Seems strange that I can hook into execute but not match but that just might be 
me.

Thanks!
--John

I may have answered my own question.  A peer pointed me to:

http://search.cpan.org/src/MRAMBERG/Catalyst-Runtime-5.7007/lib/Catalyst/DispatchType/Chained.pm

and down in a method called 'recurse_match' it does indeed seem like match is 
only called against the endpoint in a chain.  So I guess I'd like to find out 
if anyone knows the reasoning behind this.  I think ideally if an action class 
can over ride match, this should be allowed for all types of actions.  Or I am 
just not smart enough to know why not :)

Thanks!
John




 

We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 

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





 

Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front

___
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] Re: Announce: Website In A Box

2007-03-20 Thread Kieren Diment

OK, some people pointed out problems with the Makefile.PL and the structure
of the tarball, so there's already a 0.011 release at
http://websiteinabox.googlecode.com/files/WIAB-0.011.tar.gz

Thanks for the feedback to date.

On 20/03/07, Kieren Diment [EMAIL PROTECTED] wrote:


I'm pleased to announce the slightly hurried release of Website In A Boxversion
0.01.  WIAB gives you a basic content management system for individuals
and small groups.  There are still bugs, but the basic application works
with lighttpd and apache using FastCGI.  Basic configurations for these
options are in the t/optional*fastcgi* tests.

TODOs in rough of importance:

Complete User docs for people new to catalyst.
Provision of help pages for logged in users (user docs above)
Clean up templates so that theming is easy for designers.
Style data entry /user admin forms
WYSYWIG editor tool (dojo)
Improved caching for online deployment
Transparent offline deployment (via wget?).
Give user control of ordering of subdirectories (dojo drag lists)
Alternative menu styles

It's available from http://code.google.com/p/websiteinabox/




___
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] Re: Announce: Website In A Box

2007-03-20 Thread Christopher H. Laco
Where's the shopping cart? :-)



signature.asc
Description: OpenPGP digital signature
___
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] Help needed with Unicode

2007-03-20 Thread Mario Minati
Am Dienstag 20 März 2007 17:35 schrieb Bill Moseley:
 On Tue, Mar 20, 2007 at 04:40:57PM +0100, Mario Minati wrote:
  now it's my time to make my Catalyst app Unicode aware and I (like some
  others) ran into a Unicode problem.
 
  - Postgres database with UTF8 enabled (ENCODING = 'UTF8').

 By the way:

 Are you setting DBD::Pg's pg_enable_utf8?

That was also missing.
Thank you.

For those who are interested: 

package glue::Model::glueDB;

use strict;
use base 'Catalyst::Model::DBIC::Schema';

__PACKAGE__-config(
schema_class = 'glueDB',
connect_info = [
'dbi:Pg:dbname=glue',
'xxx',
'xxx',
{AutoCommit=1,
pg_enable_utf8 = 1},
],
);

1;

Greets,
Mario

___
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] Help needed with Unicode

2007-03-20 Thread Mario Minati
Am Dienstag 20 März 2007 20:03 schrieben Sie:
 Am Dienstag 20 März 2007 19:12 schrieb Renaud Drousies:
   Am Dienstag 20 März 2007 17:07 schrieb Renaud Drousies:
(The formdata is submitted through ajax/xmlhttprequest, is that a
possible source for that problem?)
  
   That was for me.
  
   Which request headers are you sending when doing the ajax call?
   If you are not doing so yet, try using
   application/x-www-form-urlencoded;
   charset=UTF-8.
  
   Firebug says:
  
   -- request header --
   Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
   Content-Type: application/x-www-form-urlencoded
  
   -- response header --
   Content-Type: text/html; charset=utf-8
   X-Catalyst: 5.7006
  
   For me that looks ok.
   Or do I need a charset=utf-8 in the _header_?
 
  I'd still explicitely set the request character set. If you don't do so,
  it will be handled with the default character set of your server.
  (correct me if i'm wrong)

 I played a little with the FF2 settings and changed the coding to utf-8 and
 guess what, suddently it work as it should be.

 So I think you might be right I have to force charset even in the request
 header, but I don't know yet how to achieve that in Dojo, but I'll find
 out.

 I'll post my results, stay tuned.

Finally I figured out howto set the header with dojo to request a specific 
charset. For those who are interested:

var x = new dojo.io.FormBind({
headers: { 'accept-charset': 'utf-8'},
// reference the form
formNode: dojo.byId('[% form.id %]'),
preventCache: true,
load: function(load, data, e) {
// what to do when the form finishes
// for example, populate a DIV:
dojo.byId([% form.id %]).disable=false;
_container_.setContent(data);
},
error: function(type, err) {
dojo.debug(Error during FormBind: + err.message);
}
});

After defineing the accept-charset header the form setting still worked when 
changing the FF2 setting to an other encoding.

:D

Greets,
Mario Minati

___
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] Re: Announce: Website In A Box

2007-03-20 Thread Nigel Metheringham


On 20 Mar 2007, at 21:43, Christopher H. Laco wrote:


Where's the shopping cart? :-)


In the canal?

Actually I thought you had it at present.

--
[ Nigel Metheringham   [EMAIL PROTECTED] ]
[ - Comments in this message are my own and not ITO opinion/policy - ]



___
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] Changing the request-user_agent

2007-03-20 Thread Bogdan Lucaciu
On Tuesday 20 March 2007 18:48, Adeola Awoyemi wrote:
 s it possible to change the request-user_agent? I am writing some  
 tests where I want to set the user_agent before making the request  
 and have my app behave differently depending on the user agent.

http://search.cpan.org/dist/WWW-Mechanize/lib/WWW/Mechanize.pm#%24mech-%3Eagent_alias(_%24alias_)

I'm sure this works with Test::WWW::Mechanize::Catalyst as well

-- 
Bogdan Lucaciu
http://www.wiz.ro

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