Re: [Catalyst] HTML encoding parameters

2014-06-29 Thread Charlie Garrison
Good evening,

On 28/06/14 at 8:13 PM -0700, bill hauck  wrote:

>Is there a module that does this to all parameters at once? 

You want one of these (there are more on cpan too):

  https://metacpan.org/pod/HTML::Scrubber
  https://metacpan.org/pod/HTML::Lint


Charlie

-- 
   Charlie Garrison  
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt


___
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] Can't detach from root / create action object

2013-11-27 Thread Charlie Garrison

Good morning,

On 27/11/13 at 2:51 PM -, Craig Chant 
 wrote:


Or are there two single argument signatures to detach() one 
takes an Action object and one takes a URL path string?


Being pedantic here, but it doesn't accept a URL path; it 
accepts an action path. Often they are the same, but they don't 
need to be.


# in Root Controller
sub my_list :Path('list') { ... }

You would pass /my_list to detach, but the URL for that action 
would be /list.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Name suggestions for a project management system

2013-09-08 Thread Charlie Garrison

Good morning,

On 8/09/13 at 10:53 AM +0300, Kamen Naydenov  wrote:


So, any suggestions?

"TaskCat" - Task (catalyst|cat)
And you can use cat for mascot for free ;-)


I'm at prototype stage for a Catalyst-based voicemail frontend 
for Asterisk. I chose Catast for the name. (catast.org)


So what about Catask for your project?

Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Populate Log4perl config from Catalyst perl hooks

2013-04-22 Thread Charlie Garrison

Good morning,

On 22/04/13 at 3:57 PM -, Anthony Gladdish 
 wrote:


It's turned on by default, yet enabling/disabling it before 
initialising the new log object, doesn't appear to fix:


I don't know what else to suggest. This is an (slightly 
modified) example that works for us:


log4perl.appender.CLIENTLOG.filename=sub { require MyApp; return 
MyApp->path_to('client.log'); }


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Populate Log4perl config from Catalyst perl hooks

2013-04-22 Thread Charlie Garrison
Good evening,

On 22/04/13 at 11:38 AM -, Anthony Gladdish 
 wrote:

>No, neither removing the backslash or adding the require statement has worked.

You haven't by chance disabled `allow_code` in Log::Log4perl config?


Charlie

-- 
   Ꮚ Charlie Garrison ♊ 
   
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Populate Log4perl config from Catalyst perl hooks

2013-04-22 Thread Charlie Garrison

Good evening,

On 22/04/13 at 10:25 AM -, Anthony Gladdish 
 wrote:



Then in my Log4perl config:

log4perl.appender.LOGFILE.layout.ConversionPattern=\sub { return 
MyApp::Cat::my_test_hook(); }

Unfortunately, this only prints " \sub { return MyApp::Cat::my_test_hook(); } " 
in my log file!

Can anyone see how I may be able to fix this?


I don't think you want the escape (backslash); use this instead:

  log4perl.appender.LOGFILE.layout.ConversionPattern=sub { 
return MyApp::Cat::my_test_hook(); }


Or maybe this:

  log4perl.appender.LOGFILE.layout.ConversionPattern=sub { 
require MyApp::Cat; return MyApp::Cat::my_test_hook(); }



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Slash character in argument of request URL

2013-04-08 Thread Charlie Garrison

Good evening,

On 8/04/13 at 12:28 PM +0200, Jaro Zajonc 
 wrote:



I'd expect that Catalyst would create 3 arguments out of it, however it
will unescape last argument, and so I will have 4 arguments in reality.


Are you sure Catalyst is unescaping the argument and not the web 
server itself? We had that problem with apache, so 
double-encoded the arg. But then we switched to lighttpd and 
then double-encoding was a problem. Plus the dev boxes handling 
it differently again we just made sure to avoid having slash in 
the args (we encoded the whole arg to be free of any 'special' characters).


I'm interested in how others have handled this though since the 
encoding we're doing makes for a very long arg.


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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::ActionRole::RequireSSL under development server

2012-04-16 Thread Charlie Garrison

Good morning,

On 16/04/12 at 11:11 AM -0700, Rippl, Steve 
 wrote:



We're just upgrading to Catalyst 5.9 from 5.8, and therefore switching from
the old Catalyst::Plugin::RequireSSL to Catalyst::ActionRole::RequireSSL.
The old module would detect when is was running under the standalone
server and so was fine under development.  Catalyst::ActionRole::RequireSSL
doesn't seem to play nicely under the development server when hitting an
action requiring SSL.  Am I doing something wrong?  Are there some settings
in the config somewhere to disable that under debug or something?  I want
to avoid having different versions of the Controllers themselves between
dev and production.


I could be way off here, but it might be a conflict with other 
modules. I don't recall specific reason why, but I'm in process 
of creating a version of HTML::FormFu which works as a role 
rather than extended in controller base class. It was 
conflicting with another ActionRole (can't recall which one 
right now).



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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 5.90010 server must be in CWD to run?

2012-02-22 Thread Charlie Garrison

Good afternoon,

On 22/02/12 at 10:48 AM -0800, Louis Erickson 
 wrote:


Which suggests there is, indeed a bug, as there's a Makefile.PL 
in the same directory as lib, right where catalyst.pl put it.


Given the additional information you provided, it's possible 
for someone else to debug this and maybe help solve the problem.


I'm far from understanding the internals in this case, but I 
think it's the Makefile that's wanted, not Makefile.PL. Try 
running `perl Makefile.PL` to create the Makefile.


Of course, those who understand better might want to 
clarify/correct that.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] ”Non-root configuration” of lighttpd::FastCGI doesn't work with Catalyst-Runtime-5.90002

2011-12-07 Thread Charlie Garrison

Good morning,

I'm opening an old thread that is related to a problem I'm 
having, my issue seems to also be related to "[Catalyst] 
Plack::Hanlder::FCGI Bug?", and change in v5.90007.


On 2/10/11 at 11:14 PM +0900, N.A.  wrote:

I'm not sure why, but for my case removing  
'Plack::Middleware::LighttpdScriptNameFix' from  'Catalyst.pm' works.


Maybe "LighttpdScriptNameFix" is not requied because
my lighttpd is version 1.4.28 and I'm not mount my app under the root path 
("/").

I hope there could be some switch to turn off this 'module'(middleware?) !!


I've got the opposite problem from that solved in v5.90007. I'm 
running lighttpd/1.4.26 (on centos) so the LighttpdScriptNameFix 
middleware should not be needed. But when I updated staging 
server, our app broke, and applying LighttpdScriptNameFix 
unconditionally fixed it (edited apply_default_middlewares in Catalyst.pm).


I don't understand SCRIPT_NAME and PATH_INO well enough to know 
what *should* be happening. Where should I look to figure out 
why the LighttpdScriptNameFix middleware still needs to be applied?


I have tried setting use_request_uri_for_path to both 0 & 1 and 
doesn't make any difference.


The lighttpd.conf file contains:

  $HTTP["url"] !~ "^/(static/|http-bind/)" {
fastcgi.server  = (
"" =>
   ( "local" =>
 (
"socket" => "/path/to/app-fastcgi.socket",
"check-local" => "disable",
 )
)
)
  }

Any suggestions?

Thanks,
Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Tutorial Woes on OS X

2011-09-22 Thread Charlie Garrison

Good morning,

On 22/09/11 at 3:58 PM -0400, Bill Birkett 
 wrote:


I'm trying to run the Catalyst Tutorial on OS X. I installed 
VirtualBox and the tutorial according to the instructions on 
the shadowcat website. Everything seems to work, except there 
is no network connection, only the local loopback, lo 127.0.0.1.


Why do you need to install in a VM? Why not just install for 
OSX? You probably want your own perl (not system's perl) but 
that's easy to do with perlbrew.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Can the latest Catalyst version from CPAN be installed under Windows?

2011-09-09 Thread Charlie Garrison

Good morning,

On 9/09/11 at 6:00 AM -0700, John Napiorkowski 
 wrote:


If you install all your cpan dependencies into your perlbrew 
managed perl you'd have to reinstall perlbrew from scratch if 
you want to truly test your build system.  For me, I like to 
test my build by building everything from the start and I can 
do that by either just deleting my local lib directory or 
creating a new local lib.  Also if you work on multiple 
projects, or support several different cpan modules, I find it 
prudent to have one local lib per project  for everything to 
be cleanly separated.  I realize that leads to a lot of 
possible duplication, but hard drive space is pretty cheap nowadays.


Thanks for all that. I can understand all those benefits but not 
sure they apply in my case. I'm treating perlbrew as a 
heavy-handed local::lib and since it's working for me I'll leave 
it as-is.


Thanks again,
Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Can the latest Catalyst version from CPAN be installed under Windows?

2011-09-08 Thread Charlie Garrison

Good afternoon,

On 8/09/11 at 6:21 PM -0700, John Napiorkowski 
 wrote:


2) Create and activate a local::lib where you dependencies will 
go (in other words never install stuff into the perlbrew 
managed Perl)


What is the reason for not installing into perlbrew managed 
libs? I've got perlbrew setup almost exclusively for Catalyst, 
so why do the extra modules need to be installed elsewhere?



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Complete example for autocomplete with HTML::FormFu, please

2011-06-19 Thread Charlie Garrison

Good evening,

On 19/06/11 at 12:18 AM +0400, Alex Povolotsky  wrote:

I'm trying to make a form with autocomplete text edit field; I 
do understand general workflow but I still miss some 
simple-but-complete example.


Can anyone please provide me with one? JQuery would be the best.


Ripped and simplified from code I'm using. So can't say it's a 
complete example, but should have all the elements you need to 
make it work.


<http://jqueryui.com/demos/autocomplete/>


package MyApp::Controller::REST;
use Moose;
use namespace::autoclean;

extends qw'Catalyst::Controller::REST';

sub usernames :Chained('') :PathPart('usernames') 
:ActionClass('REST') { }

sub usernames_GET : Local {
my ( $self, $c ) = @_;
my $query  ||= $c->req->params->{query}  || '';
my $limit  ||= $c->req->params->{limit}  || 250;

my $usernames = $c->model('DBIC::User')->search(
  { username => {'-like', "\%$query\%"}  },
  { order_by => 'username',rows=>$limit  }
);
my @usernames_list = map { {value => $_->id, label => 
$_->username} } $usernames->all;


$self->status_ok(
$c,
entity => \@usernames_list,
);
}

__PACKAGE__->meta->make_immutable;
1;


## edit.yml
...
  - type: Hidden
name: user_id
constraints:
  - SingleValue
  - Integer
  - type: Block
nested_name: user
elements:
- type: Text
  name: username
  label: User
  model_config:
read_only: 1

## edit.tt2
...
$(document).ready(function(){
$("#form_user\\.username").autocomplete({
minLength: 2,
source: function( request, response ) {
$.getJSON( "[% c.uri_for_action('/rest/usernames') 
%]", {

query: request.term
}, response );
},
select: function( event, ui ) {
    $( "#form_user\\.username" ).val( ui.item.label );
$( "#form_user_id" ).val( ui.item.value );
return false;
},
});
});



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] long poll AJAX

2011-06-09 Thread Charlie Garrison

Good morning,

On 10/06/11 at 12:33 AM -, John Karr  wrote:

The discussion I am attempting to start is about DBI models and 
not the merits of ORM vs DBI, but about doing DBI models well.


What does this have to do with "long poll AJAX"?

Why are you not using DBIx::Class? I don't know DBIx::Simple but 
maybe all you're wanting is to wrap that with a Catalyst model 
in which case look at Catalyst-Model-Adaptor.


<http://search.cpan.org/dist/Catalyst-Model-Adaptor/>

I really can't see how this has any bearing on "long poll AJAX" 
so start a new thread if you want to continue discussing this.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Forms with multiple buttons?

2011-04-12 Thread Charlie Garrison

Good morning,

On 12/04/11 at 7:50 AM -0500, John M. Dlugosz 
 wrote:



I've chosen Catalyst::Controller::HTML::FormFu to use with my app.


I'd suggest asking this on the HTML::FormFu list.


How would I have a form with multiple buttons?  For example "revert",
"preview", and "commit"?   The latter two want the same textarea to be
sent, so are part of the same form.


Unless I'm missing something in your requirements, you would 
just use multiple Submit elements in your form config. As long 
as each has a different name then you can check req->params to 
know which button was used to submit the form.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Suggestions for sending email from cron job using'Catalyst' templates?

2011-04-11 Thread Charlie Garrison

Good morning,

On 11/04/11 at 6:58 PM +0300, Octavian Rasnita 
 wrote:



The TT templates used by the Catalyst app might contain many things
like c.user, c.uri_for_action, may display images, may depend on other
templates which are loaded automaticly when those templates are
specified in the app config file. So there is no sane way of using
those wrapper templates for sending email from a cron job.


That was the conclusion I was reaching; I wanted feedback from 
others before I tried to make my own garden path.



so you'll need to make a web request in order to have the same
context variable and it would affect much the performance if you'll
load the Cat app just for sending email. You can do it this way, but...
it isn't a way I prefer to do this thing.


Being a daily cron job, loading the app once isn't too much of 
an issue. But I couldn't really see what the advantage was 
either. All my other cron jobs have been able to use models only 
(DBIC), and I was thinking I could just use TT outside Catalyst 
as well, but I hadn't thought through all the ctx dependancies 
in the templates.



Whenever you will find that a template used in the Cat app can't be
used in a cron job, split that template into smaller templates, and for
the templates that use the Catalyst context create another version that
doesn't use it. Then make a template that include those templates which
work in the Cat app and another template that works in the cron job.


Or find all uses of ctx in the templates and supply sane values 
(or methods) in template_vars to replace the standard Catalyst 
ctx. That seems like a maintenance nightmare though.



If there are too many parts of the template that needs to be changed,
it is a better idea to create a separate entire template for using it
in the external program.


I'll consider this idea. Since it's just email templates they 
are not as complex. I'm not sure what the benefit will be 
though. Except for not having to take a FastCGI process, I can't 
see what the benefit of a 'smart' cron job is. I may as well 
just send a http request to the app.


I seem to recall a few cron/schedule packages to use within Cat 
apps. The only one I can find right now is 
Catalyst::Plugin::Scheduler, which I don't really care for since 
it just piggybacks on user requests. Can anyone suggest any others?



The alternative of sharing the templates among the Cat app and other
external program would involve using templates that don't depend on the
Catalyst app, and this can be done easily, but we would miss many
features offered by the Catalyst context, and we probably need to share
too few templates to prefer to lose those features.


Yep, I agree. I can certainly do it all outside Cat context, but 
not sure it's worth the maintenance headache. So unless someone 
else comes up with clever suggestion I'll just move all the 
logic to a controller action.


Which just leaves whether to use a scheduler within Catalyst, or 
just have a cron job send a request. Are there any best 
practices for that I should be aware of?


Thanks,
Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Suggestions for sending email from cron job using 'Catalyst' templates?

2011-04-11 Thread Charlie Garrison

Good morning,

On 11/04/11 at 9:20 PM +0930, Jon Schutz 
 wrote:



That was my thought.  Usage is essentially...

use strict;
use warnings;
use HTTP::Request;

BEGIN {
$ENV{CATALYST_ENGINE} = 'Embeddable';
}

require MyApp;
my $response;
MyApp->handle_request(HTTP::Request->new('GET',
'http://localhost/send/email'), \$response);


Thanks for clarifying. And other than not tying up a FastCGI 
process, what is the advantage of that approach over just 
sending a request via http?


Thanks,
Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Suggestions for sending email from cron job using 'Catalyst' templates?

2011-04-11 Thread Charlie Garrison

Good evening,

On 11/04/11 at 10:34 AM +0930, Jon Schutz 
 wrote:



Perhaps fire up your app from the cron job using
Catalyst::Engine::Embeddable?


Thanks, didn't know about that one; I'll have a look.

Hmm, the documentation is a bit sparse; I can't see how to get 
$c (or $app). I can't see anything in the test files either 
which show how to get the app object. Do you have an example you 
could share?


Or should I just start the embeddable instance and then do a 
handle_request to process the email sending?


Thanks,
Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Suggestions for sending email from cron job using 'Catalyst' templates?

2011-04-10 Thread Charlie Garrison

Good evening,

First, I may not be approaching this the right way at all. So 
I'm happy to take any suggestions for a better way to do what I need.


I've got a daily task (cron job currently) which sends emails to 
users. I want to use existing TT templates to generate the email 
content. I'm using Mail::Builder::Simple for the message 
creation & sending.


All the simple tests are working fine, until I want to use the 
existing template setup that I've been using to send email from 
within Catalyst. Specifically, the wrapper template (with 
header, footer, etc) makes fairly extensive use of c.uri_for and 
c.uri_for_action. And of course the Catalyst context is not 
available from the cron job (at least no way that I could find).


One option is to move all the logic to a controller action and 
just have the cron job make an http request. That doesn't seem 
like the right approach though.


Does anyone have suggestions on how I can use my existing 
template structure and still be able to use `c` from a cron job? 
Or should I use a completely different approach?


Thanks,
Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] help with :Path and config

2011-04-08 Thread Charlie Garrison

Good evening,

On 8/04/11 at 6:22 AM -0500, John M. Dlugosz 
 wrote:


Thanks.  I found that mentioned in the COntroller docs, once 
you mentioned it.  However, it also refers to :PathPrefix as 
well as :Local, :Path, etc, which I've not seen documented 
elsewhere.  What's that?


Different ways of defining actions, I don't think I can explain 
better than the docco. Maybe if you ask some specific questions...


I know they are mentioned in more than one place in the docco, 
so keep reading (or ask Google).


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] help with :Path and config

2011-04-08 Thread Charlie Garrison
Good evening,

On 8/04/11 at 4:18 AM -0500, John M. Dlugosz  wrote:

>method index($c) :Path($url_name) :Args(0) {}

I don't think variable are allowed in method attributes, maybe someone else 
will correct me.

>However, the debug screen tells me that the Loaded Path action is 
>"/admin/$url_name".  Why did it 
>take the stuff in parens as a literal string, when I didn't use any kind of 
>quotes around it?  An 
>example in the manual is
>sub bar : Path('foo/bar') { }
>which shows that it is quoted normally:  not :Path(foo/bar).

And that also shows the path as a string, not a variable. 

To achieve what you want, change the config:

__PACKAGE__->config->{path} = '/secret_path';

method index($c) :Path  {}


Charlie

-- 
   Ꮚ Charlie Garrison ♊ 
   
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Requesting example code for postfix and Email::Sender

2011-03-21 Thread Charlie Garrison

Good morning,

On 21/03/11 at 11:17 AM -0700, Kutbuddin Doctor 
 wrote:



All of the Transport examples are either SMTP or sendmail.


Postfix is sendmail compatibile as far as injecting into the 
local mail queue. All distros I've seen for postfix will replace 
`sendmail` with a version that injects into postfix queue.


So that's why you haven't found any docco specific to using 
postfix; it's the same as using sendmail.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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/FastCGI process management

2011-03-10 Thread Charlie Garrison

Good morning,

On 10/03/11 at 12:06 PM -, gvim  wrote:


Downloaded daemontools but on my Centos5.5 machine the install produced an 
error:


Did you ask Google about it?

<http://www.google.com/search?q=daemontools%20/usr/bin/ld:%20errno:%20TLS%20definition%20in%20/lib64/libc.so.6%20section%20.tbss%20mismatches%20non-TLS%20reference%20in%20envdir.o>

Do any of those seem applicable in your case?

I don't know much about the internals of daemontools; we're just 
users of it here (& have been for close to a decade). We've 
never had any install problems (or at least none that weren't 
easily solved).



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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/FastCGI process management

2011-03-08 Thread Charlie Garrison

Good afternoon,

On 9/03/11 at 2:16 AM -, gvim  wrote:

So, if there any others out there using nginx/cgiwrap-fcgi.pl 
can you tell me what you're using to manage the processes. I've 
heard that a persistent environment needs more process 
management than vanilla CGI so can't deploy this app until I'm 
confident I can manage processes properly.


I'm not using nginx/cgiwrap-fcgi.pl, but for fastcgi process 
management I doubt it matters which http server is being used. I 
suggest (& use) daemontools.


http://cr.yp.to/daemontools.html

The run script can be as simple as:

---
#!/bin/sh

exec 2>&1
exec setuidgid appuser envdir ./env 
/home/appuser/myapp/script/myapp_fastcgi.pl -e -l 127.0.0.1:3010

---


The env dir can contain files to populate environment variable, eg:

$ cat /service/catalyst-appuser/env/PERL5LIB
/home/appuser/lib/perl5/

$ cat /service/catalyst-appuser/env/CATALYST_DEBUG
0


We were already using daemontools for a number of other 
services, so adding catalyst process management was simple.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Browser Detection?

2011-03-06 Thread Charlie Garrison

Good morning,

On 6/03/11 at 5:36 AM -0600, John M. Dlugosz 
 wrote:


I'd like to set flags based on what that contains, like "send 
SVG images".  Where would I put that in MyApp so it gets called 
some time before rendering the view?


I do browser detection (checking) in the `auto` method (so I can 
redirect to 'upgrade browser' page). But it could also be done 
in the `end` method if you just want to put stuff in stash for 
the view. If you've got a base method that all other actions 
chain from (which seems to be current best practices) then you 
could put it there too.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Details of config options

2011-02-28 Thread Charlie Garrison
Good morning,

On 28/02/11 at 7:10 AM -0600, John M. Dlugosz  wrote:

> A module documented to put
>
>disposition hostless
>
>in the myapp.conf file.  But, what is the equivalent __PACKAGE__->config( 
>syntax for the MyApp.pm 
>file?  I can't find documentation on how the names are mapped, and I've even 
>seen different syntax 
>in different guides.
>
>What's the correct rule?

I think you're looking for this:

__PACKAGE__->config( 
'Plugin::SmartURI' => { disposition => 'hostless' }, 
);


Charlie

-- 
   Ꮚ Charlie Garrison ♊ 
   
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt


___
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] Weird problem with Catalyst::Authentication, and redirects

2011-01-26 Thread Charlie Garrison

Good morning,

On 26/01/11 at 8:15 PM +0700, Ben van Staveren 
 wrote:



-) check if all relevant modules are up to date.
-) try with a different browser
-) create a simple app and try this particular code there.
I would do this if it wasn't for the fact that this code has 
worked just fine for the past year, and I haven't done any 
updates or upgrades for the last 2 weeks. And the problem is, 
if this is something that is due to C::A getting it's knickers 
in a twist, that's a showstopper for me because I can't go and 
tell my end-users "yeah just clear your cache and try another 
browser", they'd lynch me on the spot.


I'll give it another shot, see what happens.


Did you update Catalyst-Action-RenderView, maybe you're running 
into one of these:


0.16 2011-01-05 19:28:00 GMT
- Fix bug accidentally introduced in the last version with response
  3xx statuses.

0.15 2011-01-04 14:19:36 CET
- Don't delegate to a view if the response body is set to `undef'.


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Retrieve all users belong to a category and all its sub categories

2010-12-17 Thread Charlie Garrison

Good afternoon,

On 18/12/10 at 1:47 AM +0530, linuxsupport 
 wrote:



OK, I switched to Tree::NestedSet.

Can someone give me real example, its not working for me.


Can I suggest you move this to the DBIx::Class mailing list. I 
expect you'll get more responses there. And show what you're 
trying that's not working, otherwise look at the tests for real examples.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Retrieve all users belong to a category and all its sub categories

2010-12-16 Thread Charlie Garrison

Good morning,

On 16/12/10 at 11:15 AM -0500, Hauck, William B. 
 wrote:


Not sure how to do it in a DBIC-like fashion, but these few 
links show you how to do it in SQL for PostgreSQL and MySQL.  
Oracle and DB2 have hierarchical functionality built-in.


http://www.postgresql.org/docs/8.4/static/queries-with.html

http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

http://onlamp.com/lpt/a/5007


I haven't been following this thread closely, but I think one of 
the DBIC::Tree modules is what OP is looking for:


<http://search.cpan.org/perldoc?DBIx::Class::Tree::AdjacencyList>
<http://search.cpan.org/perldoc?DBIx::Class::Tree::NestedSet>


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Question about Chained Controller

2010-11-16 Thread Charlie Garrison

Good morning,

On 15/11/10 at 10:49 PM -0200, Eden Cardim 
 wrote:



When your requirements pile up, auto is going to become a big block of
monolithic code, and your methods are going to have enormous sequences of
attributes. Plus, I find it more logical to have the checking code
closer to where it's required, as opposed to having to maintain the
attributes scattered around the app then locate and edit the related
code in auto.


Thanks for the feedback. That's sort-of how I originally was 
coding it, but I had duplicated code for base and base_auth 
chained actions; that didn't seem right either. I was still 
pretty steep on the learning curve at that point. I'll go back 
and re-think some of my design decisions.


Thanks again for the clarification.


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Question about Chained Controller

2010-11-15 Thread Charlie Garrison

Good morning,

On 15/11/10 at 2:53 PM -0200, Eden Cardim  wrote:


"Charlie" == Charlie Garrison  writes:


Charlie> I've never bothered to find out why, but I've run into
Charlie> situations where $c->user_exists returns true and $c->user
Charlie> returns false. I just check for defined($c->user) instead
Charlie> and that solved it for me.

Probably a mangled session?


Could be. I found a problem with my browser changing session 
cookie value to old/expired value after two requests. The 
user_exists problem was probably before I finally debugged the 
browser problem. FYI, the browser (OmniWeb) devs have 
acknowledged my bug report but have been unable to reproduce the 
problem (& fix it).




Charlie> I also agree with other users that auto is a better place
Charlie> to do that check.

Chaining is a lot more powerful because it allows you to distribute
responsibilities hierarchically throughout several actions:


I use a :AuthRequired method attribute and check for that in 
auto method. Is there anything inherently wrong with that 
method? I got the technique from someone on this list a while back.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Question about Chained Controller

2010-11-14 Thread Charlie Garrison

Good afternoon,

On 15/11/10 at 10:03 AM +0800, woosley. xu.  wrote:


Caught exception in SEA::Controller::User->get "Can't call method "id"
on an undefined value


What is the problem with this code?


I've never bothered to find out why, but I've run into 
situations where $c->user_exists returns true and $c->user 
returns false. I just check for defined($c->user) instead and 
that solved it for me.


I also agree with other users that auto is a better place to do 
that check.



First I use this piece of code to make sure that a user is logged in, if
not, the use will be forward to the login page, and I assume after login, it
will return back to the original page


You need to handle that yourself. Save the current URI in the 
session before redirecting to login page, and then redirect to 
session-saved URI after successful $c->authenticate.


  $c->session->{login_back} = $c->req->uri
  unless ($c->action =~ /^(login|logout|rest\/)/ || 
$c->action eq '/');


And then after authenticate (simplified code, may not work as-is):

  $c->response->redirect( delete $c->session->{login_back} || 
$c->uri_for_action('/index') );



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] CatalystX::Declare stash problem

2010-10-25 Thread Charlie Garrison
Good afternoon,

On 25/10/10 at 10:57 PM -0700, Alan Humphrey  wrote:

>If I use the stash method I get an error:
>
>   $ctx->stash( data => $ctx->model("BirdWebDB::Orders")->search({
>'me.taxonomic_order' => {'not' => undef},

You're probably getting caught by list context; use search_rs instead:

$ctx->stash( data => $ctx->model("BirdWebDB::Orders")->search_rs({ 
  'me.taxonomic_order' => {'not' => undef},
  


Charlie

-- 
   Ꮚ Charlie Garrison ♊ 
   
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Handling long-running processes (was Re: Logging is not immediate)

2010-10-19 Thread Charlie Garrison

Good afternoon,

On 20/10/10 at 11:48 AM +1100, Toby Corkindale 
 wrote:



I still haven't played with Comet-style server-push much. Anyone else using it?


I didn't spend much time looking at comet, but I have been 
looking into BOSH and have determined it will work for us. It 
depends on XMPP though (which we were already doing) so it may 
not be the best fit. Since we've already got XMPP we chose to 
use BOSH for pushing page updates to users. Out Cat app (or 
model within Cat) is just an XMPP client (or will be when I 
finish that part of project). Have a look at Strophe for 
javascript implementation of BOSH; makes the whole thing pretty easy.


Note, XMPP is not just for chat; it's great for all sorts of 
live/push updates.


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] New install getting "Wide character in syswrite" error

2010-09-22 Thread Charlie Garrison
Good morning,

On 22/09/10 at 4:35 PM +0100, Tomas Doran  wrote:

>On 22 Sep 2010, at 14:53, Charlie Garrison wrote:
>>I think I already submitted a patch for this; yep, r13505.
>>
>>t0m, any chance of a new release of C::P::Session::State::URI? 
>>In the meantime I'll apply the above patch to the new dev's machine.
>
>This adds a test which fails. You appear to have forgotten to commit your 
>additions to the test 
>application?
>
>But sure as soon as that's fixed up :)

Hmm, I somehow managed to miss one of the test files when committing. I'll get 
that fixed up. 

Thanks,
Charlie

-- 
   Ꮚ Charlie Garrison ♊ 
   
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] New install getting "Wide character in syswrite" error

2010-09-22 Thread Charlie Garrison

Good evening,

On 22/09/10 at 7:24 AM -0600, Larry Leszczynski 
 wrote:



May be totally related but I have seen those symptoms when the body of a
POST request gets read earlier in the request than usual, and then looks
empty when it is supposed to be read (so the Content-Length is zero
instead of whatever it should be).  In my case I was calling
$c->req->param inside prepare_path, and it seemed like it was sucking in
the whole POST body, leaving it empty for when it needed to be accessed
later.


Thanks for that. I thought this issue seemed familiar. Fingers 
in too many pies and I just couldn't remember where I had seen 
it recently. It's an issue with Catalyst::Plugin::Session::State::URI.


I don't have access to the problem machine right now, but I'm 
sure this will fix it.


@@ -320,7 +320,7 @@
 if ( my $param = $c->_session_plugin_config->{param} )
 {   # use param style rewriting

-if ( my $sid = $c->request->param($param) ) {
+if ( my $sid = $c->request->query_parameters->{$param} 
) {

 $c->_sessionid_from_uri($sid);
 $c->_tried_loading_session_id(0);
 $c->log->debug(qq/Found sessionid "$sid" in query parameters/)


I think I already submitted a patch for this; yep, r13505.

t0m, any chance of a new release of C::P::Session::State::URI? 
In the meantime I'll apply the above patch to the new dev's machine.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] New install getting "Wide character in syswrite" error

2010-09-22 Thread Charlie Garrison

Good evening,

On 22/09/10 at 10:21 AM +0100, Tomas Doran 
 wrote:



How is this deployed? I mean, is this with the test server, or other?


Using myapp_server.pl; eg:

$ ./script/myapp_server.pl -k --port 3124

There was a test error when installing 
Catalyst::Plugin::Unicode::Encoding. I downgraded Encode to 
v2.39 and then Catalyst::Plugin::Unicode::Encoding installed cleanly.


Aha: https://rt.cpan.org/Ticket/Display.html?id=61456

Upgrading LWP fixes the tests issue..


Yep. Upgrading LWP, Encode and C::P::Unicode::Encoding to latest 
versions was successful.



Can you try version 1.0 of Unicode::Encoding to see if this fixes your issue?


I tried that before doing above upgrade. It didn't fix the problem.

I'm not getting the "Wide character in syswrite" error now, but 
the symptoms still persist. Also, once the problem starts the 
test server won't respond to any further requests; requires a 
restart. Canceling the current request results in following error:


Caught exception in engine "Wrong Content-Length value: 52"

Any other suggestions?

Thanks,
Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] New install getting "Wide character in syswrite" error

2010-09-21 Thread Charlie Garrison

Good afternoon,

I setup an installation of our app for a new developer last 
night and keep getting the 'Caught
exception in engine "Wide character in syswrite at...' error 
when making POST requests. Reading through the archives I expect 
this is a Unicode encoding problem. But I can't figure out where 
I'm going wrong with the new setup. (Note, the app works fine on 
4 other workstations/servers, so I'm guessing it's a problem 
specific to this one setup.)


There was a test error when installing 
Catalyst::Plugin::Unicode::Encoding. I downgraded Encode to 
v2.39 and then Catalyst::Plugin::Unicode::Encoding installed cleanly.


The plugin list is:

__PACKAGE__->setup(qw/
ConfigLoader
AutoCRUD
Static::Simple
Params::Nested
I18N
Unicode::Encoding
Cache::HTTP

Session
Session::Store::DBIC
Session::State::Cookie
Session::State::URI

Authentication
Authorization::Roles
Authorization::ACL
RequireSSL
Cache
/);

What else can I try to resolve this problem?

Thanks,
Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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 weird initialization with Apache

2010-09-10 Thread Charlie Garrison

Good morning,

On 10/09/10 at 5:47 PM +0200, Albert Vila  wrote:


When I restart the apache server, this method is called twice. The
first one, it dumps all the configuration propertly, but the second
one, it only prints the parameters from the __PACKAGE__->config main
method.


This is going a way back in memory, and at the time it was with 
apache1 and mod_perl. Due to some apache/mod_perl internals 
startup code gets run twice. So any code which *must* only run 
once needed special handling during startup.


It sounds like you're running into the 'restart twice' problem:

<http://www.google.com/search?q=apache%20mod_perl%20setup%20runs%20twice>


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] App breaks after updating to Catalyst::Plugin::Session::State::URI v0.14

2010-08-19 Thread Charlie Garrison

Good morning,

On 19/08/10 at 6:32 PM +0100, Ash Berlin 
 wrote:



   if ( my $sid = $c->request->parameters->{$param} ) {


Try changing parameters to query_parameters. It sounds like 
hitting params is causing it to read the body and mess things 
up when it comes to read the body again.


Will do. And that fixes it, thanks.


Also if you could see to creating a (failing) regression test this would help.


I've been working on that. But apparently I don't know how to 
create a POST request with body parameters using Test::WWW::Mechanize::Catalyst.


I'm trying to use something like this:

 $m->post_ok("http://localhost/uri/body_param";,
   
{content_type=>'application/x-www-form-urlencoded',content=>"body_param=value"},
   "post request");

Any quick suggestions on what I'm doing wrong?


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] App breaks after updating to Catalyst::Plugin::Session::State::URI v0.14

2010-08-19 Thread Charlie Garrison

Good morning,

On 19/08/10 at 9:12 AM -0700, Bryan Opfer  wrote:


I have the same exact behavior in my app after upgrading to 0.14.  So,
I don't think it is just your app.  Interestingly, if I remove "param"
from my config and use the mode where the session id is appended to
the URI, then things work fine.  But, if I use the session id in the
param, it breaks just like your app.


We're hitting the same thing then. I've just been playing with 
C::P::Session::State::URI code and found that if I change line 
323 from:


if ( my $sid = $c->request->param($param) ) {

to:

if ( my $sid = 0 ) {

then the problem goes away. So without knowing more about Cat 
internals I would conclude that calling $c->request->param 
during `prepare_path` is creating problems elsewhere. I also tried:


if ( my $sid = $c->request->parameters->{$param} ) {

And that fails as well.

I've tried following the code logic but I'm quickly getting lost 
in all the different prepare_* methods spread among Catalyst.pm 
and the different C::Engine modules.


For now I've changed C::P::Session::State::URI with `sub 
prepare_action {...]` rather than `prepare_path` and my app is 
working. Hopefully someone with some better ideas than me can 
suggest what the proper fix is.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] App breaks after updating to Catalyst::Plugin::Session::State::URI v0.14

2010-08-19 Thread Charlie Garrison

Good morning,

On 19/08/10 at 1:17 PM +0100, Ash Berlin 
 wrote:



   Caught exception in engine "Wrong Content-Length value: "



I see this error occasionally when I restart a server and the 
client is in the middle of a request and retries. Does this 
error happen every time? Including once you close the browser 
and using lwp-request etc.?


I've tested with different clients and different servers; the 
behavior is consistent. I upgrade to C::P::Session::State::URI 
v0.14 and the problem starts. I downgrade to 
C::P::Session::State::URI v0.13 and the problem goes away.


I failed to mention in my original message; the problem 
manifests with POST requests. I'm not sure whether GET requests 
are immune, but POST requests with size >0 will always fail.


At this point I don't know whether to approach this as bug with 
C::P::Session::State::URI or with my app. Or how to determine 
which it might be. I can dive into the debugger, but I was 
hoping someone with better knowledge of Catalyst internals might 
have some ideas where I should look first.


Thanks,
Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] App breaks after updating to Catalyst::Plugin::Session::State::URI v0.14

2010-08-19 Thread Charlie Garrison

Good evening,

I updated heaps of modules on my dev server last night, and my 
app broke horribly. Various errors in the log, common one being:


Caught exception in engine "Wrong Content-Length value: "

I reverted to a backup and updated modules in small batches. The 
error returned when updating 
Catalyst::Plugin::Session::State::URI v0.14.


The change notes indicate a couple things I probably should 
focus on:


- Fix behaviour when debug is turned on by wrapping prepare_path
  rather than prepare_action (RT#56753).
- Fix for loading the session ID with a cookie for some actions
  and Session::State::URI for others (RT#57620)

I'm guessing the error is due to the change from prepare_action 
to prepare_path but I don't know enough about the C::Engine 
internals to figure out what the real problem is. Or maybe it's 
not even a problem with C::Engine, and that's just where 
exception gets thrown.


During my testing I determined the issue happens when running 
under both myapp_server and myapp_fastcgi. (So I don't think 
it's an issue specific to C::Engine::HTTP or C::Engine::FastCGI.)


Can anyone help with the debug process from here? What should I 
try next? What other info should I provide?


Plugin list is:

__PACKAGE__->setup(qw/
ConfigLoader
AutoCRUD
Static::Simple
Params::Nested
I18N
Unicode::Encoding
Cache::HTTP

Session
Session::Store::DBIC
Session::State::Cookie
Session::State::URI

Authentication
Authorization::Roles
Authorization::ACL
RequireSSL

Cache
/);


Just using C::P::Session::State::URI v0.13 for now is fine. But 
I'd like to get this solved before pushing changes to production.


Thanks,
Charlie

--
Ꮚ Charlie Garrison   
♊  Garrison Computer Services  <http://www.garrison.com.au>

()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
〠   http://www.ietf.org/rfc/rfc1855.txt

___
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] Store something in the stash at startup

2010-08-18 Thread Charlie Garrison

Good evening,

On 18/08/10 at 11:04 AM +0100, Tomas Doran 
 wrote:



Does this make sense how this would work? I'm not saying you want this
facility _right now_, just that when you come to want it, it's nice if
your template is already flexible - which is why I'd try to have the
controller pass all the data your template is going to operate on into
the template, rather than have the template reaching into the model..


Thinking about all this a bit more... as a rule of thumb should 
I never call $c methods from the view? Is that an indication 
there is flawed logic elsewhere and all data the view needs 
should really be in the stash.


I just checked one view template to see how I was using the 
context object, and I make calls to 7 different methods, some of 
which I don't think I could easily stash due to parameters that 
get passed (eg. uri_for_action).


So if there are some context methods that I really do want to 
use, that means I've already got requirement for the context in 
my view, so why not just use context as much as needed.


Note, I'm not challenging the idea of putting (most) everything 
in stash, just trying to get a handle on the line between using 
methods from context and data in stash. My usage currently has 
large gray area (eg. c.user vs user); where should I draw the line?


Thanks again,
Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Store something in the stash at startup

2010-08-18 Thread Charlie Garrison

Good evening,

On 18/08/10 at 11:04 AM +0100, Tomas Doran 
 wrote:



Does this make sense how this would work? I'm not saying you want this
facility _right now_, just that when you come to want it, it's nice if
your template is already flexible - which is why I'd try to have the
controller pass all the data your template is going to operate on into
the template, rather than have the template reaching into the model..


Great explanation, thanks. I'll keep all that in mind moving forward.

It didn't make sense to me (& in one case had race-condition, 
don't recall specifics)


Errr?


As I said, I don't recall specifics. And it's quite possible it 
was developer error while tackling the learning curve. And also 
why I was hoping to get some clarification (eg. the above), I 
realized it was possible I taught myself some foundation 
concepts which were not accurate.


Thanks again for the examples.


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Store something in the stash at startup

2010-08-17 Thread Charlie Garrison

Good afternoon,

On 17/08/10 at 4:24 PM +0100, Tomas Doran 
 wrote:



On 17 Aug 2010, at 15:50, Charlie Garrison wrote:


I was suggesting the Moose attribute as way of storing the 
model in $c to be easier to reference from templates.


I highly recommend taking the model instance and stashing it 
(as is being done already), rather than making an attribute on 
the context object, as this is less flexible...


I.e. if you are saying [% c.model('Foo').thing %] or [% 
c.foo.thing %] then this is less flexible (as you can't 
override foo for part of your site) than $c->stash(foo => 
$c->model('Foo')) in your perl code, then [% foo.thing %] in 
your template.


I'm not sure I understand why it's less flexible. I use 
attributes on the context object to store objects that are 
needed *everywhere* in the app. I was following the logic of 
$c->user which stores the current $user. The objects stored in 
the context attributes are still models, and as such can be flexible.


It didn't make sense to me (& in one case had race-condition, 
don't recall specifics) to store all those objects in the stash 
for each request. So I'm using this as an opportunity to learn...


If the stash or the context attribute are simply storing a model 
object, what is the advantage to storing in stash over context 
attribute? If it's the model that I would want to 
override/extend, why does it matter whether it's accessed via 
stash or via context attribute?


And thanks for the input so far, always fun to learn more.  :-)


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Store something in the stash at startup

2010-08-17 Thread Charlie Garrison

Good morning,

On 17/08/10 at 8:59 AM -0500, w...@serensoft.com wrote:


On Tue, Aug 17, 2010 at 6:23 AM, Tomas Doran  wrote:


No, it wouldn't. The adaptor you showed has a lifetime of the application,
and so it won't be recreated each request.




Hmm, this is interesting. Are you referring to the "Moose goodness" of

has "menu_data" => (
is => "ro",
isa => "HashRef",
default => sub { shift->config->{menu_data} }, #pull data from config
);

Is that the part you're referring to as application-lifetime?


No, he's referring to a part of one of the OP's messages that I 
missed, specifically:



package BRK::Model::Menu;
use strict;
use warnings;
use base 'Catalyst::Model::Adaptor';


Using Catalyst::Model::Adaptor as base for a model class will 
create the model (or class referred to by model) once for each 
app run.  There are also two other Adaptor modules for creating 
models for each request or for each call to $c->model. Choose 
the one appropriate for the desired model life-cycle; once for 
each app run, once for each request, or once each time $c->model 
is called.


Octavian, has your question been answered? At this point in the 
discussion I'm not clear where the problem is and what you need 
to solve. I would have thought that by using 
Catalyst::Model::Adaptor your app would be working as desired, 
but I may be missing the point.


I was suggesting the Moose attribute as way of storing the model 
in $c to be easier to reference from templates.


This is where I got confused:

On 17/08/10 at 8:27 AM +0300, Octavian Rasnita 
 wrote:



I load and store this object in the stash on each request in the Root::auto : 
Private method with:

$c->stash(menu => $c->model('Menu'));

But this would re-create the menu object on each request, and this takes time.


Since the model is created with Catalyst::Model::Adaptor, it's 
only instantiated once. So the only thing happening with the 
code above is adding the already-existing model to the stash for 
each request.


I also agree with t0m's comment about premature optimization. 
Unless you know there is a performance problem there then I 
doubt there is anything to fix.


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Store something in the stash at startup

2010-08-16 Thread Charlie Garrison
Good afternoon,

On 17/08/10 at 8:27 AM +0300, Octavian Rasnita  
wrote:

>$c->stash(menu => $c->model('Menu'));
>
>But this would re-create the menu object on each request, and this takes time.
>
>The data structure of the menu is loaded only at startup by the do() in the 
>configuration file, but 
>then it is used on each request to re-create the menu object.

Are you looking for this:

http://search.cpan.org/perldoc?Catalyst::Model::Adaptor

Specifically:

"Note that NotMyApp::SomeClass is instantiated at application startup time."


Charlie

-- 
   Ꮚ Charlie Garrison ♊ 
   
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Store something in the stash at startup

2010-08-16 Thread Charlie Garrison

Good evening,

On 16/08/10 at 11:05 AM +0300, Octavian Rasnita 
 wrote:


I have a module that creates an object (a menu) and I want to 
store it in the stash when the application starts.
Where is the recommended place to create this object and store 
it in the stash if I want that object created just once at app startup?


Should I override a certain method in MyApp.pm and create the object there?


Does it need to be in stash? How about a method in MyApp.pm that 
supplies the data? Eg.


sub menu_data {
my $self = shift; # same as $c
return {
item1 => 'some data',
};
}

Or just use some Moose goodness instead:

has "menu_data" => (
is => "ro",
isa => "HashRef",
default => sub { shift->config->{menu_data} }, #pull data 
from config

);

And then later in your template:

[% c.menu_data.item_1 %]


If you really do want the data in the stash, then create the 
object at app startup and then assign it to stash on each request:


after 'prepare_action' => sub {
my $c = shift;
$c->stash( menu_data => $c->menu_data_object );
}



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] restore session manually

2010-07-05 Thread Charlie Garrison

Good evening,

On 5/07/10 at 9:31 AM +0200, Bernhard Bauch  wrote:


ah..
i think more important is to restore the users session..
to have $c->user() available after getting the session parameter...
so maybe i need to hook into - or call a function of - 
Catalyst-Plugin-Authentication ?


That seems to be over-complicating the problem. The Session 
plugins already handle all of that, so either use one of the 
existing Session::State plugins or create your own. Then all the 
session/user/etc stuff should 'just work'.


Restoring the session some other way (later in the execution 
cycle) is asking for problems when some part of your app is 
expecting the session to already be restored, before your upload 
action has a chance to do it. Eg. if request requires 
authenticated user for the upload action, and user is restored 
along with the session, and session/user is restored from the 
upload action . pain ensues.


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] restore session manually

2010-07-05 Thread Charlie Garrison

Good evening,

On 5/07/10 at 8:47 AM +0200, Bernhard Bauch  wrote:


yes i already thought about using Session::State::URI  for this problem.
but i don't want to enable State::URI for the rest of the app.
it is just this one action that needs to restore the session from the parameter.


I don't find having Session::State::URI enabled for the whole 
app to be a problem. What is your concern about having it? If 
it's because of the URL rewriting, then just add 
no_rewrite_if_cookie to your session config.



i'd like fake a session restore, like State::URI does from the param, or 
State::Cookie from the cookie value..


Rather than re-inventing the wheel, copy what 
Session::State::URI (or Session::State::Cookie) does for 
restoring the session. Or just subclass Session::State::URI and 
make it a noop for all except a couple of selected actions.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] restore session manually

2010-07-02 Thread Charlie Garrison

Good morning,

On 2/07/10 at 10:30 AM +0200, Bernhard Bauch  wrote:

i'm trying to use this super nice jquery file uploader with 
progress bar (http://www.uploadify.com/).



[...]



the problem is i did not manage to restore the session from the session-id 
manually.
i did try to call some of the functions of Plugin::Session manually, but it did 
not work out.


Use Session::State::URI, eg.

  use Catalyst qw/ 
Session
Session::Store::FastMmap
Session::State::Cookie
Session::State::URI


And in your javascript, tell uploadify which session_id to use:

$('#uploadify').uploadify({

'scriptData'  : {'session.id': '[% c.sessionid %]' },
...

Note, I generate the javascript in my template file, so the 
session_id becomes hard-coded in each page. You could also read 
the current cookie session and pass that in instead.


Also, I did that code ages ago, there could be some other config 
data elsewhere that I'm not remembering. Eg. I'm not sure why 
the scriptData is using session.id rather than session_id.


I also seem to recall having to put in an exception somewhere 
for my upload action, again don't recall what that way. If you 
get stuck let me know and I'll dig through my code some more.


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Repeatedly creating sessions

2010-06-24 Thread Charlie Garrison

Good evening,

On 24/06/10 at 2:30 AM -0700, Paul Makepeace  wrote:


Any tips or suggestions on what this might be? Anyone else seen it?
Debug tips next time we catch it?


I've seen behaviour like that with two of the apps here, but it 
only seems to be happening with one particular browser (OmniWeb 
on Mac) so I don't think our problem is with Catalyst. I did 
detailed logging and communicated with OmniSoftware support; 
they agreed it looked a browser problem.


Thought I'd chime in just in case the problem we're having is 
with Catalyst instead of the browser. Load the following modules 
to help with debugging:


CatalystX::Debug::RequestHeaders
CatalystX::Debug::ResponseHeaders

And I'm keen to hear what you find with LiveHTTPHeaders.


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Refactoring question

2010-05-27 Thread Charlie Garrison

Good morning,

On 27/05/10 at 11:09 AM -0400, Steve  wrote:









Don't we have rules for this list that posts should not be in 
html format? Or are they just guidelines?


<http://www.catb.org/~esr/faqs/smart-questions.html#formats>

"Send plain text mail, not HTML. (It's not hard to turn off HTML.)"

In either case Steve, your posts are not easy to read through 
all the html.


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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] Alternatives to Catalyst ?

2010-04-27 Thread Charlie Garrison

Good morning,

On 27/04/10 at 1:22 PM +0100, Dermot  wrote:


That comment was obviously tongue in cheek but there was an
underlining point that access via sub-routine reference is slower than
access via a hash. Toby was quick to point out that as far as he knew
$req->param->{} was the referred method.  Now that doesn't break
encapsulation and I'm assuming that it will be faster access method
than $req->params(). I could be wrong. I haven't benchmarked. I am
simply following the logic that subroutine references are slower that
hash lookups. Is it really so wrong to want to use params->{} over
params()?  You may call it premature optimisation (as if is a dirty
word) but to me it's just a good habit that has the benefits of being
a bit faster.

So just in case you missed it, when I said:

...but if I'm breaking the encapsulation in some ways that's going to
bite me later, I'd steer
clear.

I meant, "I'd don't want break encapsulation".

I hope that clear things up and you can stop talking about me as if
I'm not here :)


That didn't clear things up for me, and I thought I had some 
clarity already. So I guess one of us is (still) confused.


I thought it was an issue of:

$req->param(...)

vs:

$req->params->{...}

Note, one is plural, the other is not. The param method is for 
legacy CGI.pm compatibility, and as such, is slower. The params 
method returns a hash, and of course one then does direct hash lookups.


The params method is an alias for parameters. And since it 
simply returns a hash it is relatively speedy and encapsulates 
the internal parameters access (hash or whatever) within C::Request.


And for those who like juggling with sharp knives with one hand, 
they could skip both param and params methods and use:


$req->{parameters}->{...}


So as long as one doesn't need CGI.pm compat, use 
$req->params->{...} as the 'best practices' approach. It's not 
slower like $req->param(...) is, but still offers the desired encapsulation.


Have I got that right or am I still confused?

My mental clue sheet looks like this:

$req->param(...) will return one value (scalar or array), 
the way I'm used to with CGI.pm.
$req->params->{...} returns multiple values in a hash, 
which I can then reference by key.


One thing this discussion did help me with was some confusion 
that HTML::FormFu threw in there for me. In my mind, I kept 
confusing its $form->param(...) (& related) methods with 
$req->params->{...}. This discussion has resulted in me 
reviewing my usage of all various param(s) methods and I've 
found a few things to fix (or improve).


I hope I've got it right now.  :-)


Charlie

--
   Ꮚ Charlie Garrison ♊ 

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt

___
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::Plugin::Prototype: current state?

2010-03-22 Thread Charlie Garrison

Good morning,

Thanks for the reply, and that means much of my previous message 
can be ignored.


On 22/03/10 at 12:28 PM -, Oliver Gorwits 
 wrote:



On 22/03/2010 11:32, Charlie Garrison wrote:

What part of AutoCRUD is accessed outside the /autocrud path?


You might be misunderstanding how AutoCRUD works. The "/autocrud"
base is just a default - you can set this to something else or even
"". That means I cannot tell you what paths to protect, you need to
work it out for yourself, although they will be self-contained.


The "self-contained" part is what I really wanted to know. I'm 
aware the base can change to something else; I'm fine with that.



If you want to control access on a per-table basis, then your ACLs
are based on path parts which are constructed on the fly from your
DB schema and table names, and there is a risk you will get it
wrong. It's not even easy for me to document, because schema and
table names are not transposed literally into the path.


Thanks, but I'm just looking for a shotgun (all or nothing) approach.


I think you're a little wide of the mark here. There are many CRUD
solutions for Catalyst/DBIC, each with strengths and weaknesses. As
t0m put it very well in another thread:

"AutoCRUD is very simple and easy to use, works like a charm and
also gives you absolutely no configurability."


The easy to use part is why I chose it. I wanted something easy 
for my customers to use, and easy for me to implement. And 
AutoCRUD meets those criteria *very* well.



If you want tight control over how your CRUD works then build the
CRUD yourself using one of the other frameworks[1]. Please don't
criticize AutoCRUD for not addressing a given feature - there are
any number of use cases where the plugin is perfectly adequate.


Sorry, it was not meant as a criticism. Apologies if it came 
across that way. It was my confusion on what the target audience 
for it is. I honestly don't see the benefit as a 'developers 
tool'. That is only my opinion. I do see great benefit for 
end-users though. I can see lots of work has gone into AutoCRUD 
it's great for what it does.


So, apologies if I wasn't clear; it's really been "one of those 
days". I like AutoCRUD; I just want to make sure I'm using it 
the right way. And there seemed to be conflicting information 
which just confused me.


Thanks again for your reply, hopefully I've cleared up why I 
made my comments.


Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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::Plugin::Prototype: current state?

2010-03-22 Thread Charlie Garrison

Good evening,

On 22/03/10 at 4:41 AM -0700, Ovid 
 wrote:



I can't answer these questions. I can only refer you to the rt queue discussion:

https://rt.cpan.org/Ticket/Display.html?id=55742


Thanks, that answered some things, but also just made others 
even more confusing.


Your comment:


This is because the author made it clear that authz was not a design
concern and the internal URLs vary widely.  Rather than risk opening up
a hole to the database, separating this is much safer.


But the author says in the RT ticket:


Having said that, you should be able to match on the AutoCRUD paths
within your custom ACL role because they are quite predictable:

/autocrud/* - obviously just your admins
/autocrud// will be the page for any table


So, while the URLs may vary widely, they are "quite predictable".

Maybe this discussion went off track about being able to specify 
different authz for different portions of AutoCRUD. I'm happy 
with a simple 'any admin can access the whole db' approach. In 
which case the ACL for /autocrud should be sufficient. Or am I 
missing something?


In that ticket the AutoCRUD author also states:


This has more to do with the philosophy of AutoCRUD. It's meant as a
tool for the application developer more than the end user, so I have
never focused on authZ.


And that sort of makes sense, but who is the end-user? Is it my 
$customer, or is it their users of the site? For me, the 
end-user is my $customer and I want to give them full access to 
the database. And AutoCRUD seems like a simple way to achieve 
that. For the app developer, AutoCRUD seems like a toy; I need 
much better/direct db access than is available via AutoCRUD.


So, for the developer, AutoCRUD is a weak tool, and for the 
end-user there is no 'proper' support for authz. There seems to 
be a big gap. Anyway, for now I'm going with the comment 
"AutoCRUD paths ... are quite predictable", and rely on the ACL 
plugin to give the desired authz.


I didn't see creating a separate app and securing it at the 
server level as being a big deal (for me, your mileage may vary).


Between the different devs (& even some developers), the test 
server, production server, etc. it's not trivial to simply "add 
another app". Of course it's doable, but I'd prefer to spend my 
efforts on app development than helping designers 
install/configure a second app.


So, thanks for bringing up this issue. It has made me aware of 
some limitations that I hadn't looked at before.


And if anyone thinks that using the Auth::ACL plugin for 
protecting direct db access (eg. /autocrud) is a bad idea, 
please share your thoughts.


Thanks,
Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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::Plugin::Prototype: current state?

2010-03-22 Thread Charlie Garrison

Good evening,

On 22/03/10 at 3:09 AM -0700, Ovid 
 wrote:


Actually, after some discussion with the AutoCRUD author, it 
was generally agreed it would be safer to not integrate 
AutoCRUD directly into my app.  A different app running on a 
different domain/subdomain and setting security at the server 
level seems more appropriate. This is because the author made 
it clear that authz was not a design concern and the internal 
URLs vary widely.  Rather than risk opening up a hole to the 
database, separating this is much safer.


I'd really like to get more info on that. Looking at all the 
actions for my app in the debug output on startup, I can see 
lots of private and chained actions for AutoCRUD, and they are 
all under the /autocrud path. What part of AutoCRUD is accessed 
outside the /autocrud path?


AutoCRUD is very nice convenience, but it's not so nice to 
warrant running a separate app for it. To me, *having* to run a 
separate app indicates a design flaw. And if that's the case 
then I need to look at alternate solutions. (Note, I'm not 
against server-level auth, and I use it for other things outside 
my app, but within the app.)


Is the author on this list? Can you provide any further insight 
into why authz for the /autocrud path is not sufficient? I'm 
somewhat baffled that a tool which effectively allows full 
access to the DBIC model doesn't at least consider authz as part 
of the design.


Sorry, there's lots of red flags waving around and I'm not sure 
whether I should pay attention to them.


Thanks,
Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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::Plugin::Prototype: current state?

2010-03-20 Thread Charlie Garrison

Good morning,

On 20/03/10 at 9:02 AM -0700, Ovid 
 wrote:



1.  It breaks my app badly.
You can connect to your server at http://curtis-poes-computer-3.local:3000
[warn] Calling $c->view() will return a random view unless you specify one of:
[warn] * $c->config(default_view => "the name of the default view to use")
[warn] * $c->stash->{current_view} # the name of the view to use for this 
request
[warn] * $c->stash->{current_view_instance} # the instance of the view to use 
for this request
[warn] NB: in version 5.81, the "random" behavior will not work at all.
[error] Caught exception in 
Veure::View::AutoCRUD::JSON->process "must provide object to 
convert at /Library/Perl/5.10.1/Catalyst/View/JSON.pm line 44"


I can't tell why from the docs.  This is low priority for me, so I
stopped using it as I don't (yet) need this feature.


The fix is given in the warning message, eg:

__PACKAGE__->config(default_view => 'TT'); # or whatever the 
name of your view is.


Then you have a 'default' view for your app and Catalyst doesn't 
need to choose one at random. AutoCRUD is adding another view 
and Catalyst doesn't know which one to use by default.


Assigning a default_view in config is good practice anyway; it's 
not just an issue with AutoCRUD. Add it now, and don't get 
bitten later when the same problem crops up with something else 
(eg. adding a view for sending emails).



3.  It's not clear from the docs (to me) how to restrict access.

I'm using Catalyst::Controller::ActionRole and a custom role to ensure
that certain urls can only be accessed by those with admin 
privileges. I can't tell how to hook this into AutoCRUD. I 
suppose I could write a

custom subclass of the plugin, so this is the least of my issues.


How about using C::P::Authorization::ACL, eg:

__PACKAGE__->deny_access_unless(
"/autocrud",
[qw/admin/], # user must have role 'admin'
);

I balked at adding C::P::Authorization::ACL to my app just for 
AutoCRUD, but I couldn't find a better way of adding auth 
restrictions to AutoCRUD. Maybe someone else will suggest 
something more elegant. (I seem to recall reading something a 
while back about performance degradation with 
C::P::Authorization::ACL; can anyone clarify?)



Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Empty pdf file/ using Catalyst::View::PDF::Reuse

2010-03-09 Thread Charlie Garrison

Good afternoon,

On 6/03/10 at 4:51 PM +0800, Lupin Deterd 
 wrote:



I'm using View::PDF::Reuse to create/generate pdf, and though it
successfully create one but it's empty, following is code/template.
-- template/receipt.tt2 --

[% pdf.prFont('Helvetica-Bold') %]
[% pdf.prFontSize(50) %]


[% y = 500 %]
[% FOREACH item IN list %]
[% pdf.prText(100,y,item) %]
[% y = y - 13 %]
[% END %]


Try printing something other than `item`, eg. just a simple 
scalar "test value", to ensure you're not simply printing blank values.


Also, try ending with pdf.prPage(). I was having problems with 
blank PDFs and that may have fixed it; I can't recall exactly, I 
tried heaps of methods before getting it all working right with 
multi-page PDFs.



Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Which C::View::PDF should I use?

2010-03-08 Thread Charlie Garrison

Good evening,

On 8/03/10 at 10:27 AM +0200, Octavian Rasnita 
 wrote:


Unfortunately I don't know if it can help me, because I am 
blind and I can't see if the manually configured positions are 
displayed correctly. That's why I was hoping that there is a 
solution that works like the common TT templating system.


Wow, that certainly would make it more challenging. And I can't 
think of any way around needing to see where the values get 
printed. I'm having to position them through trial and error. 
(My current solution feels *very* hackish.)


Sorry I can't offer anything more useful.


Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Which C::View::PDF should I use?

2010-03-07 Thread Charlie Garrison

Good evening,

On 8/03/10 at 8:41 AM +0200, Octavian Rasnita 
 wrote:


Do you know if there is a way of creating PDFs in the same way 
the HTML templates are created, by just putting a variable name 
in a certain place and render that pdf file by replacing that 
variable with its value? (Without needing to specify the 
position where those variables will be placed)


I don't. That's exactly what I was hoping to do, but I couldn't 
find a way to do it (without expensive commercial solutions, or 
without using hand-crafted PDF 'forms').


I've got a form config which $customer can change (add fields, 
etc) and I've included X/Y coords as part of the config. That 
was the only way I could get it working in limited time I've got.


I can share code with you if it will help (maybe offlist would 
be better).



Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Which C::View::PDF should I use?

2010-03-07 Thread Charlie Garrison

Good morning,

On 8/03/10 at 9:06 AM +1100, Chris  wrote:


I've found that a simple way to put values into a PDF is to use PDF
forms - position the form fields in the appropriate location in the
template doc, and to generate the output update the form fields and
write a 'flattened' version of the doc. This means you can use visual
tools to layout the doc, and your code doesn't need to know anything
except the field names.


Thanks for that tip. And I later realized thats where I got 
confused with my first read-through of the docco (thinking I 
could do a simple 'replace value'). For this project though, 
it's not practical for someone to create a PDF 'form'. I've got 
an action generating a blank html form which $customer can print 
to pdf (hopefully they can at least do that, I'm still working 
through it with them) which PDF::Reuse loads as the template.


I'm still working out how to best specify the X/Y coords for 
each value though. I've got it all working; the hard part is 
next, explaining it all to the customer.


Thanks,
Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Which C::View::PDF should I use?

2010-03-06 Thread Charlie Garrison

Good morning,

On 6/03/10 at 6:58 AM -0800, Bill Moseley  wrote:


Thanks, that was a good intro. It looks like I could almost get away with a 
simple LaTeX table for
the form. But I can see myself getting bogged down by the 
details; I think latex is going to be "too hard" for this 
project. I may still come back to it as best option though.


If your needs are pretty simple there's HTMLDOC. I've used it for
simple reports and invoices.
http://www.easysw.com/htmldoc/


Thanks for that. I've looked at various html 2 pdf tools (I used 
html2ps for a project about 10 years ago). But lack of even 
basic CSS support makes the them useless for creating "pretty" PDFs.


In reality, this project doesn't really need PDF output (HTML 
would work fine), but $customer says it's a requirement, so I've 
got to make it work for creating "pretty" PDFs.


Thanks again for all the input.

Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Which C::View::PDF should I use?

2010-03-05 Thread Charlie Garrison

Good afternoon,

On 6/03/10 at 2:40 PM +1100, Kieren Diment  wrote:

Depends how specific your layout requirements are and the kind 
of document you want to produce.  LaTeX is pretty 
straightforward really, but you don't really have the fine 
grained control that other document formats have, so if you 
have exotic layout requirements it's going to be annoying.


http://stp.lingfil.uu.se/~zrajm/nerd/LaTeX/quickguide.html is a 
good enough start.  You don't need to know all of that.


Thanks, that was a good intro. It looks like I could almost get 
away with a simple LaTeX table for the form. But I can see 
myself getting bogged down by the details; I think latex is 
going to be "too hard" for this project. I may still come back 
to it as best option though.


And it was good to get the LaTeX basics, I can start thinking 
about how I can use it for the next project.


Thanks again for the info.

Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Which C::View::PDF should I use?

2010-03-05 Thread Charlie Garrison

Good afternoon,

On 5/03/10 at 1:32 PM -0800, S.A. Kiehn  wrote:

I am not a very experienced developer, but I was able to learn 
and use PDF::Reuse. I made a PDF template (11 page report) that 
I needed to intersperse data throughout. Using 
Catalyst::View::PDF::Reuse I was able to achieve a good result. 
I believe it is intended to be a reuse (of a PDF template) 
rather than a PDF creation tool, but it would work for that as 
well.  To use with a report was a little tougher as I had to 
be creative to do wrapping. It is probably best to use where 
the location to place values on a template remains consistent 
(invoice, certificate).


And I apparently mis-read the POD before. I thought there was a 
function to *replace* text in an existing PDF with values from 
my app. (I should not have stared researching this so late in 
the day.)


So how do people insert values into an existing PDF? Do you have 
to determine X/Y position for each value to be added to the PDF?


I was expecting to be able to replace a unique string from the 
PDF with a value from my app. For some reason I though 
Catalyst::View::PDF::Reuse was doing more magic than it really is.


Is there a simpler approach (other than C::V::PDF::Reuse) for 
creating PDFs with values from my app?


Once I hand this app to my customer, they need to be able to add 
new fields to a dynamically generated form config. My plan was 
to have a html 'template' version of the form with unique values 
for each field, which the customer can print to PDF and then 
re-use in the app.


Is there some way to determine the X/Y position of existing text 
in the PDF at runtime?



On 5/03/10 at 11:15 AM +0100, Felix Antonius Wilhelm Ostmann 
 wrote:



We use simple View::TT and then a Filter:
[%- USE Latex; FILTER latex("pdf") -%]


Can anyone advise how long the learning curve is for latex (for 
basic usage)? Would I be better off spending my time learning that?



Thanks,
Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Which C::View::PDF should I use?

2010-03-05 Thread Charlie Garrison

Good evening,

On 5/03/10 at 11:15 AM +0100, Felix Antonius Wilhelm Ostmann 
 wrote:



We use simple View::TT and then a Filter:

[%- USE Latex; FILTER latex("pdf") -%]

Its perfekt!


I like that conceptually, but just to be clear, that is latex 
code being converted to PDF, correct? Due to time constraints I 
can't learn another formatting language for this project. I may 
choose to learn it for another project though (which does have 
more complex PDF requirements).



Tomas Doran schrieb:
They're both being used successfully by people as far as I 
know, so pick whichever one appeals most :)


So for now I'll follow t0m's advice and choose one of the 
C::V::PDF modules.


Thanks to both of you for the feedback.


Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Which C::View::PDF should I use?

2010-03-04 Thread Charlie Garrison

Good afternoon,

Both of these seem to be almost identical.

Catalyst::View::PDF::Reuse
Catalyst::View::PDF::API2

Is one better to use than the other? C::V::PDF::API2 has been 
updated more recently, but other than that I can't see why I 
would choose one over the other.


Or is really a choice of PDF::Reuse vs PDF::API2 which then 
dictates the View to use? It looks like PDF::Reuse might be a 
wrapper for PDF::API2, but I'm not really sure.


I'm not looking to create PDFs from code, I'll be using an 
existing PDF and replacing values. And both C::V::P::Reuse & 
C::V::P::API2 seem to handle that in effectively the same way.


Thanks,
Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Automatic passing of objects to DBIx::Class

2010-02-28 Thread Charlie Garrison

Good evening,

On 28/02/10 at 8:58 AM +0200, Ido Perlmuter  wrote:


I've been racking my brain trying to find a way to automatically pass an
object, for the matter the Catalyst::Request object, to DBIx::Class methods.
I cannot and will not pass it myself every time I call a method in my
schema. While I do believe the model and the app should be completely
separated, further information must flow between the two.


I think you're looking for ACCEPT_CONTEXT or InstancePerContext. 
That's how I solved passing values from Catalyst to DBIC.


<http://www.google.com/search?q=Catalyst%20ACCEPT_CONTEXT>
<http://search.cpan.org/perldoc?Catalyst::Component::InstancePerContext>

I seem to recall reading that you should decide what data/values 
your DBIC model needs, and then only pass those in 
ACCEPT_CONTEXT, rather than passing whole objects like $c->req. 
That way when you use a different front-end, you don't have to 
mock a $c->req object, you simply pass the values the DBIC 
schema requires.


In your example you want the "user ID and the user IP" so grab 
those from $c->req during ACCEPT_CONTEXT (or 
build_per_context_instance) and pass them to your schema.



Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] jQuery gotcha

2010-01-31 Thread Charlie Garrison

Good afternoon,

On 31/01/10 at 8:13 PM -0800, S.A. Kiehn  wrote:

Found a change in the latest jQuery (1.4.1) from the previous 
release I used (1.3.2) that affected  a Catalyst app of mine.  
Regarding form field submissions, jQuery now submits multiple 
checkbox (or select) values with the variable name followed by 
the array "[]" brackets (probably to appease PHP).  I had a 
problem with a previous working app and used firebug to look at 
my JSON post and found the brackets.


In some of the info about the new version, they talk about the 
new feature:


<http://jquery14.com/day-01>

Nested param serialization (jQuery.param() Documentation, 
Commit 1, Commit 2)


jQuery 1.4 adds support for nested param serialization in 
jQuery.param, using the approach popularized by PHP, and 
supported by Ruby on Rails. For instance, {foo: ["bar", "baz"]} 
will be serialized as “foo[]=bar&foo[]=baz”.


In jQuery 1.3, {foo: ["bar", "baz"]} was serialized as 
“foo=bar&foo=baz”. However, there was no way to encode a 
single-element Array using this approach. If you need the old 
behavior, you can turn it back on by setting the traditional 
Ajax setting (globally via jQuery.ajaxSettings.traditional or on 
a case-by-case basis via the traditional flag).


So rather than changing the name of params you use, change the 
behaviour of jQuery instead:


<http://api.jquery.com/jQuery.param/>

jQuery.ajaxSettings.traditional = true;

Note, I haven't tried the above yet. But I think that's because 
MyApp uses Params::Nested which effectively normalizes the param 
names for $c->req, so the extra brackets haven't been an issue.


In either case, I had forgotten about that factoid in the 
release docco; thanks for the notice.



Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Where is the form field lost?

2010-01-30 Thread Charlie Garrison
Good morning,

On 25/01/10 at 7:28 PM +1100, Charlie Garrison  wrote:

>Hmm, sounds like I may have just volunteered for Cookbook doc patch, or
>at least an entry on my blog 

I've done a write-up of my experiences (and views) of using 
DBIx::Class::InflateColumn::FS:

<http://www.riverviews.com.au/perl/dbic-ic-fs.html>


Charlie

-- 
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Where is the form field lost?

2010-01-26 Thread Charlie Garrison

Good morning,

On 26/01/10 at 7:56 PM +0200, Octavian Rasnita 
 wrote:



From: "Charlie Garrison" 



_fs_column_dirs
 Returns the sub-directory components for a given file name.
Override it to provide a deeper directory tree or change the algorithm.


That's true, but I still don't know how can I store the path to the file.


Don't store it, retrieve it via the file field combined with the 
config (column_info) for the file field; add a method like this:


sub fs_file_path {
my ($self, $column) = @_;
my $fh = $self->$column;
return $fh->relative( 
$self->result_source->column_info($column)->{fs_column_path} )->stringify;

}

And if you only have one file field, then create a second method 
and call it instead (eg, for field named 'image'):


sub image_path  { shift->fs_file_path('image'); }



If in the file field I store just the file name, I need to create a second
column just for storing the random path for each file upload field.


Nope, use a method, no need to store the value in the db.


If I will store the random path and the file name in the same column like
/e3/e3434ae1b/The original file name.pdf


You don't need to store a random path either; Override the 
_fs_column_dirs & fs_file_name methods to name the file the way 
you want (& store it in the sub-directory you want).



then each time I would need to create a subroutine that takes this file name
and gets only the original file name for printing it on the 
page, but I think this is the most simple way though.


I'm not following that, you would only create the subroutine 
once. If you are writing lots of apps and need to the same 
functionality then either create a base class or role and put 
the sub there.



Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Where is the form field lost?

2010-01-25 Thread Charlie Garrison

Good evening,

On 25/01/10 at 11:30 AM +0200, orasn...@gmail.com wrote:


If I remember well, the algorithm for deletion made a single deletion
and then did a last() thinking that if one file was deleted, all the
files were deleted. I think there was a little comment there that tells
that. Although I didn't need to store the files in different dirs, I've
noticed that that piece of code won't work in case of more directories
used, however I don't think it is so hard to patch it for solving that
issue.


That's the issue and that's what I was going to patch. But 
IC::FS was a better solution (at least in my case).



Thank you for the code you sent. I will analyse it better to see if I
can use another way, but what I would like to avoid is exactly to need
writing too much code like this in order to use the module, so I don't
want to need writing those wrappers for each file column nor a separate
subroutine that provides the file name. But maybe I will be able to
create one in the inflator...


Those wrappers aren't needed; it was just a convenience to make 
usage from TT easier.



However I am not sure the way InflateColumn::FS works is compatible
with HTML::FormFu. I think a better way would be the style used by
InflateColumn::File eventually with a more flexible storage, or
InflateColumn::FS should be changed so it should get the ID of the row
after it is stored in the DB.


I use HTML::FF, but not for any file uploads, so I have no idea 
what sort of compatibility is needed (or available). I don't 
recall any difference between IC::File and IC::FS in relation to 
how files are assigned to columns. Hmm, there is a vague memory 
that with IC::File I had to create a hashref and store that 
instead, so again IC::FS is a win for simplicity.



But in the second case, I don't know how I could store the real file
name and the random path to the file without using more fields in the
table.


Create a fs_file_name method and have it assign the name? Maybe 
HTML::FF upload element doesn't allow any flexibility there. I 
know that I was able to use the supplied file name, but I was 
also passing around the $req->upload object so it was easy for 
me to grab the file name. In the end I decided I didn't want 
that anyway.



Anyway, back to the main issue, the biggest problem is HTTP::Body
steals the file upload fields if no files were attached.


Sorry, can't help with that. I'm not sure I understand the issue 
either; if there is no upload field then just assign undef to 
the file column. Ahh, cause HTML::FF is doing it all for you. 
While I find HTML::FF is a great solution for many cases, there 
are also many cases where it needs manual intervention; this may 
be one of them.


I just had a look at HTML::FormFu::Element::File and I don't see 
how it's doing anything to assist with creating the hashref 
required by IC::File. Is HTML::FormFu::Model::DBIC handling that?



Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Where is the form field lost?

2010-01-25 Thread Charlie Garrison

Good evening,

On 25/01/10 at 8:08 AM +0200, orasn...@gmail.com wrote:


From: "Charlie Garrison" 
On 24/01/10 at 10:47 PM +0200, Octavian Rasnita  wrote:


I had some problems with InflateColumn::File a few weeks ago which
were going to be hard for me to work around. I asked about it on IRC
and was told *not* to use the broken InflateColumn::File and use
InflateColumn::FS instead.


Can you tell about those problems? I hope I won't create them in the inflator I 
want to create.


I don't recall exactly, but IC::File had problems with multiple 
'file' columns. I remember, the delete part was completely 
broken if all files were not in the same directory. I was trying 
to patch IC::File so that deleting would work; I was advised to 
use IC::FS rather than trying to fix IC::File. (I don't recall 
who said that, sorry.)



Not only did InflateColumn::FS resolve my main issue; it also fixed a
couple of frustrating niggles. I found InflateColumn::FS to be more
robust all around.


I have also tried InflateColumn::FS but the thing I don't like is that
it creates random directories and this is good from a security point of
view, but for ease of use I like the way InflateColumn::File create the
target dirs.


One of the reasons I found IC::FS so much better, was the extra 
control for things like how files are named/stored on disk. From 
the POD:


fs_file_name
  Provides the file naming algorithm. Override this method to 
change it.
  This method is called with two parameters: The name of the 
column and the column_info object.


_fs_column_dirs
  Returns the sub-directory components for a given file name. 
Override it to provide a deeper directory tree or change the algorithm.


Eg (example from myApp; I used a different naming scheme in the 
end, but this shows the flexibility of IC::FS):


sub fs_file_name {
my ($self, $column, $column_info) = @_;
my MIME::Type $img_mimetype = 
MIME::Types->new->type($self->mime_type); #'image/jpeg'

my $size = $column eq 'media_full_file'  ?
'full' :
   $column eq 'media_thumb_file' ?
'thumb' :
   $column eq 'media_orig_file'  ?
'orig' :
'';
return sprintf("%05d-%s_%s.%s",
$self->user->id,
$self->name,
$size,
$img_mimetype->subType)
}

I ended up using something very close to the original method, I 
just wanted to add the file extension:


sub fs_file_name {
my ($self, $column, $column_info) = @_;
my MIME::Type $img_mimetype = 
MIME::Types->new->type($self->mime_type); #'image/jpeg'

return sprintf("%s.%s", DBIx::Class::UUIDColumns->get_uuid, 
$img_mimetype->subType)
}

I'm sure it's possible to use the original file name (from 
upload param), but I didn't want to use that anyway. So again, 
IC:FS was an easy win for me.


Note, I find the sub-dirs created with IC::FS much more 
desirable than putting them all in one directory (for scaling 
reasons). I was looking at ways of patching IC:File to do that 
since I wasn't looking forward to many thousands of directory 
entries in my media dir. And if I find that two-letter sub dirs 
isn't enough (I hope we get that big), I can easily change that 
by overriding _fs_column_dirs.



With InflateColumn::File the original file name is also used when it is
stored on the disk, and I just need to put a link to that static file,
without needing to create a column for storing the MIME type of the
file and without needing to use code for getting the file and giving it
to those that request it. If it is possible to do that with
InflateColumn::FS, please tell me.


Create a method that returns the file path and call that when 
you need to create URL pointing to the file:


sub fs_file_path {
my ($self, $column) = @_;
my $fh = $self->$column;
return $fh->relative( 
$self->result_source->column_info($column)->{fs_column_path} )->stringify;

}

And I created some wrapper methods for each column:

sub media_full_file_path  { 
shift->fs_file_path('media_full_file');  }
sub media_thumb_file_path { 
shift->fs_file_path('media_thumb_file'); }
sub media_orig_file_path  { 
shift->fs_file_path('media_orig_file');  }


In my template:

[%  img_full_src   = 
c.uri_for("/static/media/${user_image.media_full_file_path}" );

img_thumb_src  = 
c.uri_for("/static/media/${user_image.media_thumb_file_path}");
-%]

Note, fs_file_path return a two-part path, so the value needs to 
be passed as part of first arg to uri_for. Otherwise, if passed 
as second arg, the slash will get encoded and things may not 
work as expected.




If you're going to upload an HTML::FF inflator module tp CPAN, I
suggest

Re: [Catalyst] Where is the form field lost?

2010-01-24 Thread Charlie Garrison

Good morning,

On 24/01/10 at 10:47 PM +0200, Octavian Rasnita 
 wrote:


I made a InflateColumn::FileUpload inflator similar to 
InflateColumn::File, which also works with HTML::FormFu and it 
has an additional feature.


I had some problems with InflateColumn::File a few weeks ago 
which were going to be hard for me to work around. I asked about 
it on IRC and was told *not* to use the broken 
InflateColumn::File and use InflateColumn::FS instead.


Not only did InflateColumn::FS resolve my main issue; it also 
fixed a couple of frustrating niggles. I found InflateColumn::FS 
to be more robust all around.



I didn't want to load this inflator to CPAN until I solve this issue, but if 
you or somebody else wants, I can send you the source code.


If you're going to upload an HTML::FF inflator module tp CPAN, I 
suggest making it work with InflateColumn::FS instead (or at 
least in addition to InflateColumn::File).



Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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::View::Email stopped working

2010-01-19 Thread Charlie Garrison

Good morning,

On 19/01/10 at 10:33 AM -0500, Hans Dieter Pearcey 
 wrote:



It's a bug in C::V::Email.  I'm not sure who's fixing it.  Downgrading to 0.13
should fix it.


Thanks for the info. Since this is just an issue on my dev box 
and I don't need email sending immediately I'll wait to see if 
bug fix happens soon; otherwise I'll downgrade as you suggest.


Thanks again.

Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Catalyst::View::Email stopped working

2010-01-19 Thread Charlie Garrison

Good morning,

I'm getting errors like the following when sending emails from 
my app (it was working fine previously):


Caught exception in MMM::View::Email::Template->process "Can\'t 
locate object method "is_simple" via package "sendmail" (perhaps 
you forgot to load "sendmail"?) at 
/Library/Perl/5.8.8/Email/Sender/Simple.pm line 100."


When trying to find out exactly where the problem was; I noted 
that backend is no longer using Email::Send like it used to (& 
the documentation says), eg:


# Setup how to send the email
# all those options are passed directly to Email::Send
sender => {
mailer => 'SMTP',
# mailer_args is passed directly into Email::Send
mailer_args => {
Host => 'smtp.example.com', # defaults to localhost
username => 'username',
password => 'password',
}

C::V::Email now seems to be using Email::Sender instead. And I'm 
having trouble working out the correct config options I should 
be using. I've got 'mailer' set to 'SMTP' and there should be a 
$transport for that in Email::Sender. I'm using the following 
config (for local test server):




mailer  SMTP

    Host192.168.1.5





Is this a bug with C::V::Email or Email::Sender, or am I doing 
something wrong?



Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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::Plugin::Email not working

2009-12-02 Thread Charlie Garrison

Good afternoon,

On 2/12/09 at 8:51 PM -0500, Meeko  wrote:


SELinux is disabled (see below).  Also, on the same machine I have several
other non-Catalyst perl apps that I use Net::SMTP to send e-mail with, and
they work fine so I know that e-mail can get out on this machine.  There's
just something about Catalyst::Plugin::Email that is not sending them, and
leaving no visible errors/warnings/logs that I can find to try to figure out
why.


How about wrapping the $c->email() statement in eval {} and 
checking for errors? I don't know if that will help but easy 
enough to test.


Charlie

--
   Ꮚ Charlie Garrison ♊ 
   〠 PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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 Charlie Garrison

Good evening,

On 10/06/09 at 11:59 AM +0200, Francesc Romà i Frigolé 
 wrote:



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


Expiration time is configurable. You can also have the session 
timeout renewed on each request (send new auth_tkt cookie) if 
that suits your needs.


So just set a long expiration and update cookie more often than 
expiry duration.



Charlie

--
   Charlie Garrison  
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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 Charlie Garrison

Good evening,

On 10/06/09 at 10:40 AM +0200, 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.


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


<http://www.openfusion.com.au/labs/mod_auth_tkt/>


Charlie

--
   Charlie Garrison  
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] The Netiquette thread (OT)

2009-04-28 Thread Charlie Garrison
Good afternoon,

On 28/04/09 at 1:09 PM -0700, Bill Moseley  wrote:

>All will be fine once a native Mutt app for the iPhone comes out.

You could always ssh back to your main machine and use Mutt there.  ;-)

(Control key is a bugger to use though.)

Charlie

-- 
   Charlie Garrison  
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Apache's

2009-04-15 Thread Charlie Garrison

Good morning,

On 15/04/09 at 1:24 PM +0100, Ben Vinnerd 
 wrote:


I pass a flag to Apache when i start it up, e.g. -Dhello. Any 
ideas how i can check this from within a Catalyst app?


If using mod_perl, then inside your IfDefine block, do a 
PerlSetEnv (or maybe a PerlSetVar), eg:


PerlSetEnv SERVER_MODE "test"

And then just check for key %ENV to see if the -D flag was 
applicable for that request.


The same technique should work with fast_cgi but you'll need to 
use SetEnv rather than PerlSetEnv (unless fast_cgi has 
PerlSetEnv equivalent).


Charlie

--
   Charlie Garrison  
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Newbie Question about Database

2009-01-19 Thread Charlie Garrison

Good afternoon,

On 19/01/09 at 8:11 PM -0500, Robert L Cochran 
 wrote:



I also wonder if Catalyst can make use of a .my.cnf file if there is
one. Why is this important? Because you can keep your connection
password private.


You can pass a path to a "user defaults" file as part of the DBI 
connect string. I don't recall the syntax though.



Charlie

--
   Charlie Garrison  
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] [again] die() in an action chain : does not break the chain !

2008-03-14 Thread Charlie Garrison

Good evening,

On 14/3/08 at 8:54 AM +0100, Dami Laurent (PJ) 
<[EMAIL PROTECTED]> wrote:



Sorry, I already asked the same question a couple of days ago, but
probably I was not clear enough.
My problem is that if there is an exception at the entry point of an
action chain, processing nevertheless continues until the endpoint of
the chain.



I thought Jonas gave a pretty good answer:


On 11/3/08 at 5:03 PM -, Jonas Alves <[EMAIL PROTECTED]> wrote:


Probably you need to catch it and call detach.


I even made a note about his answer since it's something I had 
wondered about. And it's such an easy/obvious solution.


Of course you may be asking something else. But it looks like a 
'detach' added to your actions would do the trick.


Charlie

--
   Charlie Garrison  <[EMAIL PROTECTED]>
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] OT: Recommendations for big-time hosting

2008-02-24 Thread Charlie Garrison

Good afternoon,

On 24/2/08 at 3:29 PM -0600, Brian Kirkbride 
<[EMAIL PROTECTED]> wrote:


So what's you recommendation for absolutely bullet-proof 
hosting that let's you sleep at night?  I'm talking pro-active 
monitoring, upgrades, patches, backups, redundancy setup, 
architecture planning and growth.  Everything you might need.  
Staff that understands why you'd need Nginx or Lighttpd in 
front and what FastCGI is.  People that can handle tuning 
Postgres instead of just slapping MySQL with a stock config on 
your box.


I would recommend Make-Tracks Secure Hosting, but I'm biased (I 
work there).


<http://www.make-tracks.com>

We use a co-lo facility in Sydney, but have access data to 
centres around the world. And we are a small company but we 
focus on customer requirements and quality service rather than 
just trying to fill the racks.


We started as a shared hosting provider, but most of our 
customers have outgrown that and our focus has been moving to 
managed hosting. If you want to know more, feel free to contact 
me at <[EMAIL PROTECTED]>.



Charlie

--
   Charlie Garrison  <[EMAIL PROTECTED]>
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] Development environments and performance

2008-01-26 Thread Charlie Garrison

Good afternoon,

On 16/1/08 at 10:03 PM -, Ian Docherty 
<[EMAIL PROTECTED]> wrote:


The other reason was that I eventually was hoping to serve 
several clients from the same machine, running multiple copies 
of the same application (but perhaps different versions) and 
knew I could not do this with Apache mod-perl but could do so 
with fast-cgi, hence my reason for going down that path.


Been away for a week so catching up on old threads and wanted to 
clarify this point for the archives.


It IS possible to run multiple apache/mod_perl processes on one 
machine to support different catalyst apps/versions. It requires 
use of a frontend proxy server but it's easy to setup and works well.


I use that technique for both staging and productions apps on 
the one machine.



Charlie

--
   Charlie Garrison  <[EMAIL PROTECTED]>
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

___
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] [OT] ASP.NET MVC

2007-12-12 Thread Charlie Garrison
Good afternoon,

On 12/12/07 at 2:42 AM -0600, Jonathan Rockway <[EMAIL PROTECTED]> wrote:

>On Wed, 2007-12-12 at 09:18 +0200, Octavian Rasnita wrote:
>> 
>> I haven't read anywhere that : Local is deprecated, and I use it very often. 
>> Why is it deprecated? I found it works very well, and it is the most simple 
>> solution.
>
>Who told you this?  It's not.

On 11/12/07 at 7:59 AM -0800, John Napiorkowski <[EMAIL PROTECTED]> wrote:

>Then we also have :Local, which is also considered
>somewhat deprecated in favor of :Path, :Default which

I was confused too and wondered why I should stop using :Local.


Charlie

-- 
   Charlie Garrison  <[EMAIL PROTECTED]>
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

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


Re: [Catalyst] configurable base url?

2007-12-07 Thread Charlie Garrison

Good afternoon,

On 7/12/07 at 9:32 AM -0800, Pablo Collins 
<[EMAIL PROTECTED]> wrote:









Thanks guys for your help.


I'm not sure what the list rules state, but I would appreciate 
it if messages could at least contain a non-empty plain-text 
part. While I have no trouble reading html, I don't like using 
my brain to parse messages that way.



Charlie

--
   Charlie Garrison  <[EMAIL PROTECTED]>
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

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


Re: [Catalyst] Re: CMS Revisited

2007-11-29 Thread Charlie Garrison

Good morning,

On 28/11/07 at 6:51 PM -, Matt S Trout 
<[EMAIL PROTECTED]> wrote:



Did you have a look at the shadowcat site codebase I posted in the last
thread about CMSes as open code for people to make a start from?


Took me a while to find it. So in case anyone else is looking 
for it I think the message being referenced is:


<http://www.mail-archive.com/[EMAIL PROTECTED]/msg06878.html>


Charlie

--
   Charlie Garrison  <[EMAIL PROTECTED]>
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

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