Re: [Catalyst] Where best to store database connection information?

2015-02-16 Thread Craig Chant
I have mine in an adaptor class singleton.

Just be aware using this approach means if there is an error and you have debug 
/ trace switched on it outputs the username and password in the debug output!

So always ensure you never leave these flags on when you publish the live 
version.

-Original Message-
From: Adam Witney [mailto:awit...@sgul.ac.uk]
Sent: 16 February 2015 17:25
To: The elegant MVC web framework
Subject: Re: [Catalyst] Where best to store database connection information?


Hi,

Thanks for your replies.

I guess my question was more about any security issue of having the database 
username/password stored in a text file.  And what do people consider best 
practice for this from a security point of view?

Thanks

Adam


 -Original Message-
 From: Octavian Rasnita [mailto:orasn...@gmail.com]
 Sent: 16. februára 2015 17:10
 To: The elegant MVC web framework
 Subject: Re: [Catalyst] Where best to store database connection
 information?

 Catalyst uses Config::General to read .conf files. If Config::General
 is configured with the option -UseApacheInclude, then you can use an
 apache include file.conf in the .conf file to include another file
 from another directory which is not saved by git.

 Or the option -IncludeDirectories can be also useful so all the files
 from the given directory will be included.

 --Octavian

 - Original Message -
 From: David Schmidt davew...@gmx.at
 To: The elegant MVC web framework catalyst@lists.scsys.co.uk
 Sent: Monday, February 16, 2015 6:22 PM
 Subject: Re: [Catalyst] Where best to store database connection
 information?


  the catalyst configloader can load more then just one file.
 
  by default it loads myapp.conf
 
  if a file named myapp_local.conf exists it is loaded aswell.
 
  docs:
  https://metacpan.org/pod/distribution/Catalyst-Plugin-
 ConfigLoader/lib/Catalyst/Plugin/ConfigLoader/Manual.pod#Using-a-local
 -
 configuration-file
 
  On 16 February 2015 at 15:42, Adam Witney awit...@sgul.ac.uk wrote:
  Hi,
 
  I have a Catalyst / DBIx::Class application and I have been storing
  the database connection parameters in a config file which is
  sourced using MYAPP_CONFIG_LOCAL_SUFFIX. But this seems a bit of a
  security
 problem
  having the main password in a text file like this, especially if it
  goes into git.
 
  Is there a recommended or best practice place to store database
  connection information?
 
  Thanks for any help
 
  Adam
 
  ___
  List: Catalyst@lists.scsys.co.uk
  Listinfo:
  http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
  Searchable archive:
  http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
  Dev site: http://dev.catalyst.perl.org/
 
  ___
  List: Catalyst@lists.scsys.co.uk
  Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
  Searchable archive:
  http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
  Dev site: http://dev.catalyst.perl.org/


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

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: Pharos House, 67 High Street, Worthing, West Sussex, BN11 1DN. H L 
Partnership Limited is authorised and regulated by the Financial Conduct 
Authority.


Re: [Catalyst] Catalyst 5.90080 on CPAN!

2015-01-19 Thread Craig Chant
Hi Octavian,

Sounds like a plan, I'll give it a whirl and let you know how it pans out.

Thanks.

Craig.

-Original Message-
From: Octavian Rasnita [mailto:orasn...@gmail.com]
Sent: 19 January 2015 13:42
To: The elegant MVC web framework
Subject: Re: [Catalyst] Catalyst 5.90080 on CPAN!

From: Craig Chant cr...@homeloanpartnership.com


 Thanks Chakkit,

 However, I run Active-State Perl on IIS and have done for 12 years.

 Regards,

 Craig


Catalyst works fine with ActivePerl, so you shouldn't have any problem 
upgrading it.

You can make a backup of your current Perl instalation with Control+C,
Control+V, then do the upgrade. If something horrible happends, you can
revert easy to the old Perl with previous modules you currently have.
And if you'll find problems after upgrading, it may be helpful to ask about 
them on this list.

--Octavian


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has
  the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: Pharos House, 67 High Street, Worthing, West Sussex, BN11 1DN. H L 
Partnership Limited is authorised and regulated by the Financial Conduct 
Authority.

___
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.90080 on CPAN!

2015-01-19 Thread Craig Chant
Hi,

Should I always update my Catalyst and if so, can someone please point me to 
the upgrade step by step documentation.

I remember the last time I re-installed Catalyst due to getting a new PC and 
when firing up my dev machine it refused to run the app because it had been 
developed on a different version of Catalyst.

I've been reluctant to change / upgrade anything ever since and would 
appreciate some guidance as I don't' think just replacing / upgrading the 
Catalyst Runtime will work?

I'm currently running ...

Devel : Version 1.37
Runtime: Version 5.90062

Note: I use Perl Package Manager on Windows IIS, so anything with CLI *nix is 
not helpful.

Many thanks,

Craig (SSPL)

-Original Message-
From: John Napiorkowski [mailto:jjn1...@yahoo.com]
Sent: 09 January 2015 17:18
To: The Elegant MVC Web Framework
Subject: [Catalyst] Catalyst 5.90080 on CPAN!

Hey All!

We just cut 5.90080 release to stable.

Get it = https://metacpan.org/release/JJNAPIORK/Catalyst-Runtime-5.90080

Info and overview =
http://jjnapiorkowski.typepad.com/modern-perl/2015/01/perl-catalyst-590080-released-to-cpan.html

Enjoy and shout out if you see trouble!

jnap

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has
  the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: Pharos House, 67 High Street, Worthing, West Sussex, BN11 1DN. H L 
Partnership Limited is authorised and regulated by the Financial Conduct 
Authority.

___
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.90080 on CPAN!

2015-01-19 Thread Craig Chant
Well I upgrade the runtime and devel modules via PPM.

Noticed I had a few other out-of-date modules that I use so upgraded them also.

DBI, Try::Tiny, DBD::ODBC, Data::Dumper, Moose, JSON, HTML::Template, 
Static::Simple

Edited my App..

use Catalyst::Runtime 5.90;

Then fired up the devel server for the app without issues and things appear to 
be working fine.

So performed the same updates on the IIS server and it my new app 500 server 
errored.

It seems the required dependency : MooseX::Getopt was not included as a 
dependency in the Catalyst Runtime update package?

Something is screwy with the IIS production server, I try to update the 
required packages and am getting

ERROR: File conflict for 'C:/Perl/html/site/lib/Module/Runtime.html'.
The package Module-Runtime has already installed a file that package 
Alt-Module-Runtime-ButEUMM
wants to install.

My fears have been realised when trying to update the IIS7 server... never 
rains and this new app has only been live 3 days as it was launched Friday!

Regards,

Craig.

-Original Message-
From: Craig Chant [mailto:cr...@homeloanpartnership.com]
Sent: 19 January 2015 13:56
To: The elegant MVC web framework
Subject: Re: [Catalyst] Catalyst 5.90080 on CPAN!

Hi Octavian,

Sounds like a plan, I'll give it a whirl and let you know how it pans out.

Thanks.

Craig.

-Original Message-
From: Octavian Rasnita [mailto:orasn...@gmail.com]
Sent: 19 January 2015 13:42
To: The elegant MVC web framework
Subject: Re: [Catalyst] Catalyst 5.90080 on CPAN!

From: Craig Chant cr...@homeloanpartnership.com


 Thanks Chakkit,

 However, I run Active-State Perl on IIS and have done for 12 years.

 Regards,

 Craig


Catalyst works fine with ActivePerl, so you shouldn't have any problem 
upgrading it.

You can make a backup of your current Perl instalation with Control+C,
Control+V, then do the upgrade. If something horrible happends, you can
revert easy to the old Perl with previous modules you currently have.
And if you'll find problems after upgrading, it may be helpful to ask about 
them on this list.

--Octavian


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has
  the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: Pharos House, 67 High Street, Worthing, West Sussex, BN11 1DN. H L 
Partnership Limited is authorised and regulated by the Financial Conduct 
Authority.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its

Re: [Catalyst] Catalyst 5.90080 on CPAN!

2015-01-19 Thread Craig Chant
Thanks Chakkit,

However, I run Active-State Perl on IIS and have done for 12 years.

Regards,

Craig

-Original Message-
From: Chakkit Ngamsom [mailto:chak...@ibiz.co.th]
Sent: 19 January 2015 11:08
To: The elegant MVC web framework
Subject: Re: [Catalyst] Catalyst 5.90080 on CPAN!

Hi Craig,

I recommended you to use StrawberryPerl here:
http://strawberryperl.com

Once installed, you just run cmd: cpanm Catalyst StrawberryPerl works well with 
IIS.

Regards,
Chakkit

 On Jan 19, 2015, at 5:34 PM, David Schmidt davew...@gmx.at wrote:

 you could install new versions of CPAN modules into a local::lib
 directory and run your testsuite afterwards to see if the upgrade
 works for you. if it doesnt work simply delete the local::lib
 directory and you all updates are undone.

 https://metacpan.org/pod/local::lib

 another option that I like to use is to make a git repository out of
 my perl5 folder, if something breaks I roll back.

 On 19 January 2015 at 11:22, Craig Chant cr...@homeloanpartnership.com 
 wrote:
 Hi,

 Should I always update my Catalyst and if so, can someone please point me to 
 the upgrade step by step documentation.

 I remember the last time I re-installed Catalyst due to getting a new PC and 
 when firing up my dev machine it refused to run the app because it had been 
 developed on a different version of Catalyst.

 I've been reluctant to change / upgrade anything ever since and would 
 appreciate some guidance as I don't' think just replacing / upgrading the 
 Catalyst Runtime will work?

 I'm currently running ...

 Devel : Version 1.37
 Runtime: Version 5.90062

 Note: I use Perl Package Manager on Windows IIS, so anything with CLI *nix 
 is not helpful.

 Many thanks,

 Craig (SSPL)

 -Original Message-
 From: John Napiorkowski [mailto:jjn1...@yahoo.com]
 Sent: 09 January 2015 17:18
 To: The Elegant MVC Web Framework
 Subject: [Catalyst] Catalyst 5.90080 on CPAN!

 Hey All!

 We just cut 5.90080 release to stable.

 Get it =
 https://metacpan.org/release/JJNAPIORK/Catalyst-Runtime-5.90080

 Info and overview =
 http://jjnapiorkowski.typepad.com/modern-perl/2015/01/perl-catalyst-5
 90080-released-to-cpan.html

 Enjoy and shout out if you see trouble!

 jnap

 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive:
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/ This Email and any
 attachments contain confidential information and is intended solely for the 
 individual to whom it is addressed. If this Email has been misdirected, 
 please notify the author as soon as possible. If you are not the intended 
 recipient you must not disclose, distribute, copy, print or rely on any of 
 the information contained, and all copies must be deleted immediately. 
 Whilst we take reasonable steps to try to identify any software viruses, any 
 attachments to this e-mail may nevertheless contain viruses, which our 
 anti-virus software has failed to identify. You should therefore carry out 
 your own anti-virus checks before opening any documents. HomeLoan 
 Partnership will not accept any liability for damage caused by computer 
 viruses emanating from any attachment or other document supplied with this 
 e-mail. HomeLoan Partnership reserves the right to monitor and archive all 
 e-mail communications through its network. No representative or employee of 
 HomeLoan Partnership has the authority t
 o enter into any contract on behalf of HomeLoan Partnership by email. HomeLoan 
Partnership is a trading name of H L Partnership Limited, registered in England 
and Wales with Registration Number 5011722. Registered office: Pharos House, 67 
High Street, Worthing, West Sussex, BN11 1DN. H L Partnership Limited is 
authorised and regulated by the Financial Conduct Authority.

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

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

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you

Re: [Catalyst] Random thoughts on helper class generation

2014-01-30 Thread Craig Chant
I second Octavian's comments.

Though I still chose Catalyst over the other Perl frameworks, when you spend 
copious amounts of time reading docs and learning how to use the Catalyst 
framework, to then be questioned why you are doing something the way you are in 
the IIRC because it's wrong or at least outdated and not the best method, when 
all you are doing is following what the documentation tells you to do, is 
rather frustrating to say the least, and a waste of everyone's time... which 
then makes you wonder, how good other framework's documentation is and if that 
would be easier , simpler and more up-to-date.

It's not just the documentation / tutorials and how-to's either, it's even the 
error messages.

 Too bad that those people don't have the necessary time for that.

That doesn't cover the cryptic, poorly written error / warning messages!

There are clearly ridiculously clever people working on this project, but I 
feel sometimes they need to step back for a second and think... how could I 
explain this to a total idiot, verbose and verbatim documentation, error 
messages, tutorial and alike, are not the place for fiendishly clever one 
liners!

Catalyst has a big advantage over the other frameworks other than just being an 
awesome piece of software and that's the community; it's friendly , accessible 
and a pleasure to be involved in, it's littered with seriously talented 
individuals at the top of their game, working in huge corporations with a vast 
wealth of experience and technical know-how, but the documentation lets this 
down and it shouldn't.

Unless of course the goal of Catalyst isn't to make it accessible to the 
greenest of users regardless of their technical ability?


-Original Message-
From: Octavian Rasnita [mailto:octavian.rasn...@ssifbroker.ro]
Sent: 27 January 2014 09:25
To: The elegant MVC web framework
Subject: Re: [Catalyst] Random thoughts on helper class generation

From: neil.lunn n...@mylunn.id.au

 On 27/01/2014 1:27 PM, John Napiorkowski wrote:
 Neil,

 I know the problem we have here, but honestly I think the solution is going 
 to be more about having less stuff in Catalyst.pm rather than more...
 Hi John,

 Actually probably missed something in my intended context in the
 course of the rant.
 Couldn't agree more with that statement, truly less is more and I
 wasn't putting a shout out to either change 'Catalyst::Helper' or
 otherwise bloat things in 'Catalyst Core'. So I think we can agree
 that it is better to pull things out and delegate to more generic 
 add-in's.

 I have seen in some reading terms and statements such as monolithic
 catalyst application ..., which is sadly a sad misnomer and seems
 more of an indictment on the development model of the authors than an
 actual problem of Catalyst itself.

 That said, it doesn't help today much :)  Feel free to try a plugin and see 
 what people think.  Is a good way to shakeout new ideas.
 So largely a position on how many people are generally cargo culting
 the catalyst helper default files, which probably would have been a
 better title. And otherwise trying to get a feel for what other people
 were doing as typical, App, Controller, View, Model setups.

 As for the code, that was my way of saying here's one other way of
 doing it, what's yours?

 If anything, the only critique here regarding the helper templates is
 that new inductees are likely to come on board and just so things as
 they are in the manual, without much thought to what is actually
 happening. Hence the reference to getting logging set up under
 ConfigLoader, and so we show another approach. But not sure exactly
 what to do about making people think, and think differently, yet.



I think a better documentation for Catalyst *written by those who know the 
internals very well* would be very helpful to solve this problem.
Too bad that those people don't have the necessary time for that.

I think the fact that Catalyst has too much magic is a reason why most 
beginners prefer Dancer or Mojolicious.

Octavian


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any 

[Catalyst] Can't detach from root / create action object

2013-11-27 Thread Craig Chant
I seem to be going round in circles unable to understand how I create an action 
object so I can pass it to detach as the IRC has told me to pass in an action 
and not what I thought which was 'controller_name, subroutine'.

E.G.

$c-detach('my_controller_name','index');

But it seems that this signature is  ('class_name', 'subroutine')

I'm having a problem with Catalyst randomly deciding when it is OK to have a 
controller and a model called the same, as I have in the same root auto 
subroutine ,

$c-detach('splashscreen','index').

Where I have both a controller called 'SplashScreen' and a model called 
'SplashScreen', and the detach works fine.

However, for another controller / model pair called 'ComplianceUpdates',

This doesn't work

$c-detach('complianceupdates','index').

and errors with...

Couldn't forward to ComplianceUpdates. Does not implement process

Couldn't detach to command complianceupdates: Invalid action or component.
So If I am to use

$c-detach($action);

How do I create a Catalyst::Action object.

What attributes am I meant to be setting in the object before I pass it in, and 
where are the docs for this as I can't find them.

All help is appreciated.


Craig Chant
Information Technology Manager

[Description: Description: HLP_IT_Sig1]

  Direct Line: 01903 227 753   Main Line: 01903 602 664   Website: 
www.homeloanpartnership.comhttp://www.homeloanpartnership.com

[Description: Description: HLP_Sig2_variant]

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: Pharos House, 67 High Street, Worthing, West Sussex, BN11 1DN. H L 
Partnership Limited is authorised and regulated by the Financial Conduct 
Authority.
inline: image002.jpginline: image004.jpg___
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 Craig Chant
No the documentation isn't clear, if I could understand it I wouldn’t be asking 
this question.

What is $action ?  And yes I've looked at  the manual.

Chapter 3 when you search for 'detach' states..

NOTE: If you use the default template technique, you will not be able to use 
either the $c-forward or the $c-detach mechanisms (these are discussed in 
Chapter 2 and Chapter 9 of the Tutorial).

So I go back to chapter 2 and search for detach and get zero results the same 
when I search chapter 9?

Not sure why you seem to think the tutorial is clear, when I seem to be going 
round in circles?


-Original Message-
From: David Schmidt [mailto:davew...@gmx.at]
Sent: 27 November 2013 12:24
To: The elegant MVC web framework
Subject: Re: [Catalyst] Can't detach from root / create action object

You should tell us what you want to achieve.

I want to pass an action to detach() is not a proper problem description.


The documentation is pretty clear on what is expected.
https://metacpan.org/pod/Catalyst#c-detach-action-arguments

$c-detach( $action [, \@arguments ] )
$c-detach( $class, $method, [, \@arguments ] )
$c-detach()

Have you checked the Catalyst Tutorial. It should provide examples for detach() 
There is also the test suite which you can grep for detach.





On 27 November 2013 13:00, Craig Chant cr...@homeloanpartnership.com wrote:
 I seem to be going round in circles unable to understand how I create
 an action object so I can pass it to detach as the IRC has told me to
 pass in an action and not what I thought which was ‘controller_name, 
 subroutine’.



 E.G.



 $c-detach(‘my_controller_name’,’index’);



 But it seems that this signature is  (‘class_name’, ‘subroutine’)



 I’m having a problem with Catalyst randomly deciding when it is OK to
 have a controller and a model called the same, as I have in the same
 root auto subroutine ,



 $c-detach(‘splashscreen’,’index’).



 Where I have both a controller called ‘SplashScreen’ and a model
 called ‘SplashScreen’, and the detach works fine.



 However, for another controller / model pair called
 ‘ComplianceUpdates’,



 This doesn’t work



 $c-detach(‘complianceupdates’,’index’).



 and errors with…

 Couldn't forward to ComplianceUpdates. Does not implement process

 Couldn't detach to command complianceupdates: Invalid action or component.

 So If I am to use



 $c-detach($action);



 How do I create a Catalyst::Action object.



 What attributes am I meant to be setting in the object before I pass
 it in, and where are the docs for this as I can’t find them.



 All help is appreciated.





 Craig Chant

 Information Technology Manager





   Direct Line: 01903 227 753   Main Line: 01903 602 664   Website:
 www.homeloanpartnership.com





 This Email and any attachments contain confidential information and is
 intended solely for the individual to whom it is addressed. If this
 Email has been misdirected, please notify the author as soon as
 possible. If you are not the intended recipient you must not disclose,
 distribute, copy, print or rely on any of the information contained,
 and all copies must be deleted immediately. Whilst we take reasonable
 steps to try to identify any software viruses, any attachments to this
 e-mail may nevertheless contain viruses, which our anti-virus software
 has failed to identify. You should therefore carry out your own anti-virus 
 checks before opening any documents.
 HomeLoan Partnership will not accept any liability for damage caused
 by computer viruses emanating from any attachment or other document
 supplied with this e-mail. HomeLoan Partnership reserves the right to
 monitor and archive all e-mail communications through its network. No
 representative or employee of HomeLoan Partnership has the authority
 to enter into any contract on behalf of HomeLoan Partnership by email.
 HomeLoan Partnership is a trading name of H L Partnership Limited,
 registered in England and Wales with Registration Number 5011722.
 Registered office: Pharos House, 67 High Street, Worthing, West
 Sussex, BN11 1DN. H L Partnership Limited is authorised and regulated by the 
 Financial Conduct Authority.

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

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which

RE: [Catalyst] Can't detach from root / create action object

2013-11-27 Thread Craig Chant
Thanks Alexander,

I must have missed this :  
$c-detach($c-controller('ComplianceUpdate')-action_for('index'));

It's working as desired, much appreciated.

Craig.

From: Hartmaier Alexander [mailto:alexander.hartma...@t-systems.at]
Sent: 27 November 2013 12:25
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Can't detach from root / create action object

On 2013-11-27 13:00, Craig Chant wrote:

I seem to be going round in circles unable to understand how I create an action 
object so I can pass it to detach as the IRC has told me to pass in an action 
and not what I thought which was 'controller_name, subroutine'.

E.G.

$c-detach('my_controller_name','index');

But it seems that this signature is  ('class_name', 'subroutine')

I'm having a problem with Catalyst randomly deciding when it is OK to have a 
controller and a model called the same, as I have in the same root auto 
subroutine ,

$c-detach('splashscreen','index').

Where I have both a controller called 'SplashScreen' and a model called 
'SplashScreen', and the detach works fine.

However, for another controller / model pair called 'ComplianceUpdates',

This doesn't work

$c-detach('complianceupdates','index').

and errors with...

Couldn't forward to ComplianceUpdates. Does not implement process

Couldn't detach to command complianceupdates: Invalid action or component.
So If I am to use

$c-detach($action);

How do I create a Catalyst::Action object.
Exactly like I just told you on IRC: 
$c-detach($c-controller('ComplianceUpdate')-action_for('index'));

What attributes am I meant to be setting in the object before I pass it in, and 
where are the docs for this as I can't find them.

All help is appreciated.


Craig Chant
Information Technology Manager

[Description: Description: HLP_IT_Sig1]

  Direct Line: 01903 227 753   Main Line: 01903 602 664   Website: 
www.homeloanpartnership.comhttp://www.homeloanpartnership.com

[Description: Description: HLP_Sig2_variant]

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: Pharos House, 67 High Street, Worthing, West Sussex, BN11 1DN. H L 
Partnership Limited is authorised and regulated by the Financial Conduct 
Authority.


___

List: Catalyst@lists.scsys.co.ukmailto: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/



***
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
***
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
***
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail

RE: [Catalyst] Can't detach from root / create action object

2013-11-27 Thread Craig Chant
Hi Andre,

That is clearer, and Alexander provided me with a working solution, but it 
doesn't make sense with your example.

$action is an action object isn't it?

So Alexander's example has :-

$c-detach($c-controller('ComplianceUpdate')-action_for('index'));

So I assume

$c-controller('ComplianceUpdate')-action_for('index');

is returning an action object that is passed to detach.

However, your example just has a string path '/a/my_action_1' , how is that an 
action object?

Are you  saying detach (for the single argument signature) takes a URL path and 
that $action is just a string scalar with a URL path in it and not an action 
object reference as I got the impression?

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

Because I did a Data::Dumper of

die Dumper($c-controller('ComplianceUpdate')-action_for('index')) and I got 
an object!

$VAR1 = bless( {
 'namespace' = 'complianceupdates',
 'name' = 'index',
 'class' = 'HLP_Members::Controller::ComplianceUpdates',
 'attributes' = {
   'Path' = [
   'complianceupdates'
 ],
   'Args' = [
   '0'
 ]
 },
 'reverse' = 'complianceupdates/index',
 'code' = sub { DUMMY }
   }, 'Catalyst::Action' );


Having just tested with : -

$c-detach('/complianceupdates/index');

is working.

So the question now is which is better...

$c-controller('ComplianceUpdate')-action_for('index');

or

$c-detach('/complianceupdates/index');

Pass a string or a pass an object?

Thanks,

Craig.

-Original Message-
From: André Walker [mailto:an...@andrewalker.net]
Sent: 27 November 2013 13:04
To: The elegant MVC web framework
Subject: Re: [Catalyst] Can't detach from root / create action object

On Wed, Nov 27, 2013 at 12:36:54PM +, Craig Chant wrote:
 No the documentation isn't clear, if I could understand it I wouldn’t
 be asking this question.

I'm sorry you couldn't understand from the documentation. I'll try and explain 
a little more here:

# lib/MyApp/Controller/A.pm
package MyApp::Controller::A;
...

sub my_action_1 :Local {
 my ($self, $c) = @_;
 $c-res-body('in action 1');
}

sub my_action_2 :Local {
 my ($self, $c) = @_;
 $c-detach('my_action_1');
}

# lib/MyApp/Controller/B.pm
package MyApp::Controller::A;
...

sub other_action :Local {
 my ($self, $c) = @_;
 $c-detach('/a/my_action_1');
 # or
 $c-detach('MyApp::Controller::A', 'my_action_1'); }

Is it clearer now?

Cheers!
André


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: Pharos House, 67 High Street, Worthing, West Sussex, BN11 1DN. H L 
Partnership Limited is authorised and regulated by the Financial Conduct 
Authority.
___
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 Craig Chant
Awesome, thanks for demystifying this for me!

# go to a string path (/foo/bar/gorch)
# or action object
if (blessed($command)  $command-isa('Catalyst::Action')) {
$action = $command;
}
else {
$action = $self-_invoke_as_path( $c, $command, \@args );
}

I'm still at a loss why when I was using the wrong syntax, it was working for 
SplashScreen, but the same syntax for ComplianceUpdates wasn't!

And I still can't find where in the docs/tutorial any of this is explained? (a 
section and page number would be helpful!)

Regards,

Craig.


-Original Message-
From: André Walker [mailto:an...@andrewalker.net]
Sent: 27 November 2013 15:46
To: The elegant MVC web framework
Subject: Re: [Catalyst] Can't detach from root / create action object

On Wed, Nov 27, 2013 at 02:51:23PM +, Craig Chant wrote:
 So I assume

 $c-controller('ComplianceUpdate')-action_for('index');

 is returning an action object that is passed to detach.

True.

 However, your example just has a string path '/a/my_action_1' , how is
 that an action object?

It's not :) Catalyst magically converts that for you.

See this:

https://metacpan.org/source/JJNAPIORK/Catalyst-Runtime-5.90051/lib/Catalyst/Dispatcher.pm#L148

It either gets an action object, or it translates the path to an object for you.

 Having just tested with:

 $c-detach('/complianceupdates/index');

 is working.

 So the question now is which is better...

 $c-controller('ComplianceUpdate')-action_for('index');

 or

 $c-detach('/complianceupdates/index');

 Pass a string or a pass an object?

I like the string option better. It's cleaner to read. But you should be fine 
with both.

Cheers,
André


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: Pharos House, 67 High Street, Worthing, West Sussex, BN11 1DN. H L 
Partnership Limited is authorised and regulated by the Financial Conduct 
Authority.

___
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] Setting file handle as the response body generates warnings.

2013-11-26 Thread Craig Chant
I've been using this for while

# check for ok status
if($result-ok)
{

# output header
$c-response-content_type('application/vnd.ms-excel');
$c-response-content_length(length($xls));
$c-response-header(Content_Disposition = 
'attachment;filename=NBCS_Export.csv');

# create an IO::File for Catalyst
use IO::File;
my $iof = IO::File-new;

# open XLS
$iof-open(\$xls, r);

# output XLS data
$c-response-body($iof);

# close file
undef $iof;
}

It resolves the out of memory issue if you try to print direct to 
$c-response-body without putting the content in an IO::File object.


From: John Napiorkowski [mailto:jjn1...@yahoo.com]
Sent: 26 November 2013 01:54
To: The elegant MVC web framework
Subject: Re: [Catalyst] Setting file handle as the response body generates 
warnings.

We should probably document what it means by $c-response-body can accept a 
file handle.  Like plack specifies the interface it must deal with.  Anyone up 
to that?

This FH in body thing is something I've been thinking about a lot lately, in 
regards to when Catalyst is running under an event loop for example, should 
Catalyst stream the Filehandle a non blocking manner.  But it would be great to 
document this.  Also, I am thinking setting the default size when its missing 
could really belong to middleware.  Plack has some default middleware that does 
this:

https://metacpan.org/source/MIYAGAWA/Plack-1.0030/lib/Plack/Middleware/ContentLength.pm

the means it works looks like this

https://metacpan.org/source/MIYAGAWA/Plack-1.0030/lib/Plack/Util.pm#L68

There's a few things in Catalyst.pm that could profitable just use 
Plack::Middleware counterparts.

just a thought.

johnnap

On Thursday, November 21, 2013 9:20 AM, neil.lunn 
n...@mylunn.id.aumailto:n...@mylunn.id.au wrote:
On 22/11/2013 12:33 AM, Bill Moseley wrote:


On Wed, Nov 20, 2013 at 11:32 PM, neil.lunn 
n...@mylunn.id.aumailto:n...@mylunn.id.au wrote:

This approach may work for you is the compressed data is actually in a scalar 
and not too large. And not too small. YMMV.

my $z = read_file product.json.gz;

my $io = IO::Scalar-new( \$z );
$io-seek( -4, 2 );
$io-read( my $buf, 4);

my $uncompressed_size = unpack( 'V', $buf );


This indeed does work in my tests.   Thanks for all the help, Neil.   I really 
appreciate the time you spent on this.

No prob. Part of my thing on list reponses is that there is a seed for others 
to learn from what was discussed.
I do wonder if there is a sane way to test for an in memory file handle and 
give a more appropriate warning, but that is for further discussion.



--
Bill Moseley
mose...@hank.orgmailto:mose...@hank.org



___

List: Catalyst@lists.scsys.co.ukmailto: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/





[http://static.avast.com/emails/avast-mail-stamp.png]http://www.avast.com/

This email is free from viruses and malware because avast! 
Antivirushttp://www.avast.com/ protection is active.



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

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: Pharos House, 67 High Street, Worthing, West Sussex, BN11 1DN. H L 
Partnership Limited is authorised and regulated by the Financial Conduct 

RE: [Catalyst] More detailed proposal for changes related to content negotiation and REST

2013-08-13 Thread Craig Chant
Hi John / Alex

Am I missing something here?

In my model I create and return the JSON...

use JSON qw(encode_json);

   my %json_hash ;

... add some hash stuff to be made into JSON ...

# return JSON
return encode_json \%json_hash

--

In my controller I output it to the view / browser

$c-response-body( $c-model('My::Model')-my_method_JSON );

-

With an AJAX call I retrieve the JSON

//
// GET SOME JSON  VIA AJAX //
/
var myJSON;

function myAJAXFunction()
{

// call AJAX
makeRequest('/my_controller/my_method_JSON ','',set_JSON);
}

function setJSON(json)
{
// store JSON returned from AJAX call
myJSON = $.parseJSON(json);

}



This is working fine, what shift in paradigm are you trying to create and how 
would it affect / alter what I currently do, or indeed make it any easier / 
simpler, I can't see it  getting much simpler than the few lines of code I 
already have, can it?

Or am I doing something wrong?

Cheers,

Craig Chant.

-Original Message-
From: John Napiorkowski [mailto:jjn1...@yahoo.com]
Sent: 12 August 2013 21:27
To: The elegant MVC web framework
Subject: Re: [Catalyst] More detailed proposal for changes related to content 
negotiation and REST






 On Monday, August 12, 2013 2:33 PM, Alexander Hartmaier 
 alexander.hartma...@t-systems.at wrote:
  On 2013-08-12 16:58, John Napiorkowski wrote:
  Hey Bill (and the rest of you lurkers!)

  I just updated the spec over at
 https://github.com/perl-catalyst/CatalystX-Proposals-REStandContentNeg
 otiation/blob/master/README.pod

  I decided to remove regular expression matching from the body parser
 stuff,
 which I think resolves the merging questions (since now there will not
 be a possibility that more that one can match the request).  I think
 we can add this back eventually using some standard request content
 negotiation, using mime type patterns and quality settings, so that we
 can have some rules that dictate what is the best match, rather than try to 
 invent our own.  For example:


 https://metacpan.org/module/HTTP::Headers::ActionPack::ContentNegotia
 tion


  The idea would be to not reinvent.  I think we could instead of
 doing an
 equality match here we just use something like this to figure out what
 the best match is works pretty well.  Thoughts?

  jnap

 Hi John,
 I thought about it for the last few days and wonder why the, lets call
 it rendering, of the data isn't left to the view as defined by the MVC
 pattern?
 I'd expect that a different view is used depending on the negotiated
 content-type.
 How do other MVC frameworks choose the view to use?
 Should a single action be able to limit the output format or is
 controller level granular enough?

 Best regards, Alex



Alex,

I think you put your finger on one of the major uneasiness I (and others) have 
around the idea of having in the global application model all these registered 
formatters.  Yes, in theory it feels like we are cheating on the View side of 
MVC.  I have personally always thought that Catalyst doesn't exactly get it 
right the way it is (I think C and V are actually a little too detached for one 
thing) and that leads to odd code sometimes.  The commonly used 
Catalyst::Action::Renderview is a bit too detached for my taste.  And what we 
call a View tends to mostly just be a View handler (or factory I guess).  On 
the other hand the basic idea of separation of concerns is sound.

I think the main thing is that this is not intended to replace view, but for 
the simple cases where people just want to quickly serialize data (like for all 
those ajax endpoints you need to do nowadays, not full on RESTful APIs but 
quick and dirty communication between the back and front end.  Maybe that's not 
a great thing for Catalyst (and honestly I put this out there in the hopes of 
provocation some strong reactions.

Personally I prefer to use templates even for creating JSON output, I think you 
get cleaner separation that is easier to maintain over time (I really don't 
like when I see something like -body (json_encode $sql-run-get_all_rows).  
That feels fragile to me.  On the other hand I see the attraction of some of 
the more lightweight web frameworks where they make it easy to just spew out 
JSON.

This is partly why I sketched out an action/controller level alternative, with 
the proposed response-body_format thing and the proposed new action subroutine 
attributes  (just to recap)

sub myaction :Local {
  My ($self, $c) = @_;

  # ...
  # ...

  $c-response-format(
 'application/json' = sub {  json_encode $stuff },
 # ...
 # ...
  );
}

I think this approach feels similar to how some other frameworks operate.  Some 
offer more sugary syntax for the common stuff, perhaps

$c-response
  -json( sub { ... } )
  -html ( sub

RE: [Catalyst] New design

2013-07-23 Thread Craig Chant
I'm not sure what all the weird dancing space people are all about?

I'm not a graphic designer though, so what do I know!

-Original Message-
From: Mark Keating [mailto:m.keat...@shadowcat.co.uk]
Sent: 23 July 2013 09:49
To: catalyst@lists.scsys.co.uk
Subject: [Catalyst] New design

The nice chaps at Evozon have recently been making design mocks for a bunch of 
Perl sites and they have come up with a fresh look for Catalyst. Take a look 
and let me know what you guys think.

http://www.mdk.me.uk/community/mocks/Catalyst.jpg

Kind regards

Mark

--
Mark Keating BA (Hons), Writer, Photographer, Cat-Herder.
Managing Director: http://www.shadow.cat For more that I do visit: 
http://www.mdk.me


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: Pharos House, 67 High Street, Worthing, West Sussex, BN11 1DN. H L 
Partnership Limited is authorised and regulated by the Financial Conduct 
Authority.

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

2013-07-23 Thread Craig Chant
Don't get me wrong, the site looks cool for sure.

I just didn't get the dancing space people and an MVC Perl Framework connection.

Ballerina, Tap Dancing, Tango / Salsa etc..

I am struggling to relate the icon to the feature.

Break dancing = plug-in ?

Of course YMMV!


-Original Message-
From: Ferruccio Zamuner [mailto:nonsolos...@diff.org]
Sent: 23 July 2013 12:43
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] New design

On 07/23/13 10:48, Mark Keating wrote:
 Take a look and let me know what you guys think.

 http://www.mdk.me.uk/community/mocks/Catalyst.jpg


I love it.

Dancing people makes it seem amusing to use.
Space mood makes it ready for the future.

Best regards,\ferz

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: Pharos House, 67 High Street, Worthing, West Sussex, BN11 1DN. H L 
Partnership Limited is authorised and regulated by the Financial Conduct 
Authority.

___
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] CSV / UTF-8 / Unicode

2013-07-05 Thread Craig Chant
Nice one Mike spot on!

I did a bit of digging myself before trying anything and found this blog : 
http://blogs.msdn.com/b/qingsongyao/archive/2009/04/10/sql-server-and-utf-8-encoding-1-true-or-false.aspx

You learn something new every day!

It seems MS encoding is 'UCS-2' which is equivalent to 'UTF-16' (sort of, but 
not exact!)

Perhaps Win32::ODBC handles this natively whereas DBI::DBD::ODBC doesn't?

Having read the UCS-2 info at the bottom of the DBD::ODBC CPAN docs it seems 
DBD::ODBC is messy as hell trying to support UCS-2 / UTF-16.

I have tried within Perl to use decode against the string from the DBI fetch, 
but it just errors...

[error] Caught exception in My_App::Controller:: XLSExport-export Wide 
character in subroutine entry at C:/Perl/lib/Encode.pm line 176.

And that was using UTF-16 and UCS-2 / UCS-2BE encoding types, is seems as per 
the encode docs Bogus surrogates result in death.

And I guess as utf8::is_utf8 comes back as true and the fact it states on the 
DBD::ODBC docs...

 Perl scalars which are UTF-8 and are sent through the ODBC API will be 
converted to UTF-16 and passed to the ODBC wide APIs or signalled as SQL_WCHARs 
(e.g., in the case of bound columns). Retrieved data which are wide characters 
are converted from UTF-16 to UTF-8. However, you should realise most ODBC 
drivers do not support UTF-16

It seems the DBD::ODBC driver is auto converting the data from UTF-16 to UTF-8, 
and that is where the corruption must be occurring, it even states that UTF-16 
isn't really supported under ODBC?

So what I have is UTF-8, but after a conversion by the ODBC driver from UCS-2 
using UTF-16 encoding, which appears to be making a mess of things.

I have checked and I was running DBI v 1.616, so installed latest version 1.627 
plus upgraded DBD::ODBC to 1.43 but exactly the same problem!

I'm at a loss what else I can do other than throw DBI away and refactor to 
Win32::ODBC , it seems DBI::DBD::ODBC is converting the data on retrieval into 
UTF-8 and making a pigs ear of it! I can't see any simple switch or parameter 
to tell DBD::ODBC to do things differently, can you?

There is a whole bunch of Unicode maybe's and caveats on the DBD::ODBC CPAN 
docs, yet if you scan the Win32::ODBC CPAN docs for a mention of UTF-8 / UTF-16 
/ UCS-2 or the word Unicode, none of them are mentioned even once, so is that a 
significant indicator of something?

I've checked with DBD::ODBC and Win32::ODBC , that the ODBC.pm is not the same 
module being used, I can see a flag in the DBI ODBC.pm module of 
odbc_has_unicode, but it is an read only  attribute.

Can you suggest anything else that might prevent DBI from corrupting the data 
on UTF-8 conversion?

Thanks,
Craig.








-Original Message-
From: Mike Whitaker [mailto:m...@altrion.org]
Sent: 04 July 2013 10:35
To: The elegant MVC web framework
Subject: Re: [Catalyst] CSV / UTF-8 / Unicode

On 4 Jul 2013, at 10:30, Mike Whitaker m...@altrion.org wrote:
 On 4 Jul 2013, at 09:56, Craig Chant cr...@homeloanpartnership.com wrote:

 Yes it's NVARCHAR(max) , which I understood is MS's data-typing for uNicode 
 VARiable CHARacters, looking at some sample column data via the Windows SQL 
 Management GUI, it appears to display ok.

 It probably isn't UTF-8, though. UTF-8 is only one possible encoding in which 
 you can store unicode character points.

Try, on the off-chance I've read the spec right

- not bothering with mysql_encode_utf8 in the DBI connect args
- passing all data from DBI through decode(UTF-16,...) or decode(UCS-2...) 
- MS's docs aren't that clear which!
- reencoding it as utf8 on the way out.



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership

RE: [Catalyst] CSV / UTF-8 / Unicode

2013-07-04 Thread Craig Chant
Thanks Anthony,



I will try your suggestions when I'm back in the office tomorrow, I'm on a 
study day today for my OU course.



Would be good to track this down and fix without having to refactor to 
Win32::ODBC , I eventually want to look at replacing my own DBI wrapper for 
DBIC ORM but am concerned this wouldn't be possible if I cant get DBI to play 
ball with MS.



 Your data is being stored in Unicode data typed columns right?



Yes it's NVARCHAR(max) , which I understood is MS's data-typing for uNicode 
VARiable CHARacters, looking at some sample column data via the Windows SQL 
Management GUI, it appears to display ok.



I know that the data being pasted into it is coming from an MS Access front end 
application that is linked to the same backend SQL server.



I also know that this is a memo / rich text input box control on the form 
(view) bound directly to the table column via a linked table definition with 
the backend SQL server and some of what they enter they copy/paste from emails 
and MS Word documents (and possibly PDF)



I can't see any odd characters looking at a small amount of sample data on the 
SQL server, and the data comes out of Win32::ODBC looking ok too.



From what I can tell the data is in Unicode during capture and storage, it's 
just the retrieval with DBI  where it seems to be breaking down.



I have to include a longread setting when using DBI::DBD::ODBC with SQL  
already, otherwise it falls over with the data being to long, so perhaps there 
is another parameter I need?



I really appreciate all the help you guys have given so far, thank you.



Regards,



Craig






From: Anthony Lucas [anthonyjlu...@gmail.com]
Sent: 04 July 2013 01:09
To: The elegant MVC web framework
Subject: Re: [Catalyst] CSV / UTF-8 / Unicode


On 3 July 2013 11:18, Craig Chant 
cr...@homeloanpartnership.commailto:cr...@homeloanpartnership.com wrote:

 Maybe write a standalone test and take Catalyst and browser quirks out of 
 the picture.

I have already done this, I have two SQL wrapper modules one that uses 
DBI::DBD::ODBC and one that uses Win32::ODBC, I applied it to the same 
standalone script that produces CSV output, the only difference between the 
test was one test accessed SQL with the DBI SQL wrapper and one test accessed 
SQL with the Win32::ODBC SQL wrapper, DBI outputted junk chars, Win32::ODBC 
didn't. What else should I be doing to test for the culprit of the corruption?

You need to see how they are using the ODBC API underneath for handling the 
data and encoding.
Setting the trace flag on DBI (i.e. DBI-trace(n)) will expose the DBD::ODBC 
activity. I'm not sure of the debugging available for Win32::ODBC.

One thing I would check first is what they are treating the column data as. If 
DBD::ODBC is treating the columns as WCHAR but Win32::ODBC is treating them as 
CHAR and then doing extra magic decoding (or not), well then you've found a 
big clue. There has to be different handling or differing levels of ODBC 
support somewhere.

I would assume that DBD::ODBC is doing the right thing, and something else is 
amiss upstream (but well, never assume with Unicode handling, so make sure with 
the trace).



 Also, you are aware that your data will probably be coming back as UCS2 if 
 you're using SQL Server right?

No, what is UCS2 and is this handled differently in DBI::DBD::ODBC vs 
Win32::ODBC ?


From what I understand, is ultimately what you've got happening?:
Original Input Data - SQL Client - Database Driver - Database (UCS2) - 
Windows ODBC Driver - DBD::ODBC - Catalyst(?)

If so, since you're storing the data as Unicode and the database driver knows 
this (because your column type is NVARCHAR etc.), conversion to UCS2 happens at 
the driver stage on Windows. This is lossless between the different Unicodes, 
so just make sure your input is actual good Unicode up to that point and your 
data is being stored correctly.

Your data is being stored in Unicode data typed columns right?





This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network

[Catalyst] CSV / UTF-8 / Unicode

2013-07-02 Thread Craig Chant
Hi,

I seem to be having major problems getting the application devel server 
(my_app_server.pl) to accept an IO::File Handle as CSV and correctly encode as 
UTF-8.

I have  Unicode::Encoding  in my_app.pm and am using the following to wrap up 
the CSV string.

# create an IO::File for Catalyst
use IO::File;
my $iof = IO::File-new;
$iof-open(\$xls, r);
$iof-binmode(:encoding(UTF-8));

# output XLS data
$c-response-body($iof);

# close file
undef $iof;

Only this errors with :

[error] Caught exception in engine Wide character in syswrite at 
C:/Perl/lib/IO/Handle.pm line 474.

If I remove the binmode encoding line , the server doesn’t error, but I get 
funny characters in my spread sheet output….

-
File Check: ,    – Residential Remortgage –  Rated
• In the fact find you have referenced the clients rental income. Please 
ensure that on future cases a copy of the rental agreement or other proof is 
added to the compliance file.
• Suitability Letter – States that mortgage was for £180,000 rather than 
£170,000. Please reproduce this letter, making the appropriate amendments and 
send out to the client to sign. You should also check that all other figures 
are correct.
• Suitability Letter – States that the product recommended tracks another 
rate; this does not appear to be the case as it is a fixed rate. Please 
reproduce this letter, making the appropriate amendments and send out to the 
client to sign.
-

What do I need to do to fix this problem?

Thanks,

Craig Chant
Information Technology Manager

[Description: Description: HLP_IT_Sig1]

  Direct Line: 01903 227 753   Main Line: 01903 602 664   Website: 
www.homeloanpartnership.comhttp://www.homeloanpartnership.com

[Description: Description: HLP_Sig2_variant]

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Conduct Authority.
inline: image005.jpginline: image006.jpg___
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] CSV / UTF-8 / Unicode

2013-07-02 Thread Craig Chant
Hi Lars,

Thanks for the reply

 The problem is rather that Catalyst::Response::body wants octets

Sorry, you've lost me, I thought response body wanted an IO::File Handle which 
is what I have given it?

I was also under the impression that $c-response-body( 'Page not found' ); 
was acceptable and that is also a char string not octet?

I seem to be missing something here, please can you elaborate.

 encode the content again for output as UTF-8

Isn't that what $iof-binmode(:encoding(UTF-8));  does?

I thought all strings in perl were Unicode ? or at least that's what the 
Unicode::Encoding plugin is for isnt' it?

I have in my app 

use Catalyst qw/
Unicode::Encoding
/;

What's the purpose of this Catgalyst plugin if it isn't making my app Unicode?

How do I encode a string to unicode if it isn't already?

 # close file
 undef $iof;
 That's not necessary. When the reference falls out of scope, the destructor 
 that closes the file is called automatically.

Does it do any harm? Is there an issue with cleaning up your own object 
references?

I thought it was good practice to clean up your own references , even if auto 
garbage collection *might* do it for you? It's a habit I have from VBA / 
VB.NET, am I doing something bad?

 PS: IO::File does not throw exceptions when the file could not be read.
 Instead I recommend to use the `open` built-in in conjuction

Please note there is no file to be read , this is utilising Perl 5+'s ability 
to use a string as a file handle.

There will always be a string, even if it is empty so the exported XLS will be 
a blank spread sheet.

I think all I need to do is understand how I encode the string before giving it 
to IO::File

Your help is appreciated.

Regards,
Craig.



-Original Message-
From: Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 [mailto:da...@cpan.org]
Sent: 02 July 2013 10:06
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] CSV / UTF-8 / Unicode

 I seem to be having major problems getting the application devel
 server (my_app_server.pl) to accept an IO::File Handle as CSV and
 correctly encode as UTF-8.
No, the code does exactly what you said. The problem is rather that 
Catalyst::Response::body wants octets, not characters. Either pass the handle 
through in raw mode, or encode the content again for output as UTF-8. If the 
input file is not under your control, I recommend going through a manual 
decoding/encoding step instead of IO layers, and make decoding errors fatal 
(see FB_CROAK in http://p3rl.org/Encode) in order to catch malformed encoding 
before it's delivered to the client.
One can't be too careful.

 # close file
 undef $iof;
That's not necessary. When the reference falls out of scope, the destructor 
that closes the file is called automatically.

PS: IO::File does not throw exceptions when the file could not be read.
Instead I recommend to use the `open` built-in in conjuction with 
http://p3rl.org/autodie for better error checking.
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Conduct Authority.
___
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] CSV / UTF-8 / Unicode

2013-07-02 Thread Craig Chant
To follow up having looked at perldoc http://perldoc.perl.org/utf8.html 

I have just tried...
-

# encode UTF8
use utf8;
utf8::encode($xls);

# output header
$c-response-content_type('application/vnd.ms-excel');
$c-response-content_length(length($xls));
$c-response-header(Content_Disposition = 
'attachment;filename=NBCS_Export.csv');

# create an IO::File for Catalyst
use IO::File;
my $iof = IO::File-new;

$iof-open(\$xls, r);
$iof-binmode(:encoding(UTF-8));

# output XLS data
$c-response-body($iof);

# close file
undef $iof;

---

And still get exactly the same error...

[error] Caught exception in engine Wide character in syswrite at 
C:/Perl/lib/IO/Handle.pm line 474.

Do I need to use something else to encode to utf8?

Thanks,
Craig.

-Original Message-
From: Craig Chant [mailto:cr...@homeloanpartnership.com]
Sent: 02 July 2013 10:38
To: The elegant MVC web framework
Subject: RE: [Catalyst] CSV / UTF-8 / Unicode

Hi Lars,

Thanks for the reply

 The problem is rather that Catalyst::Response::body wants octets

Sorry, you've lost me, I thought response body wanted an IO::File Handle which 
is what I have given it?

I was also under the impression that $c-response-body( 'Page not found' ); 
was acceptable and that is also a char string not octet?

I seem to be missing something here, please can you elaborate.

 encode the content again for output as UTF-8

Isn't that what $iof-binmode(:encoding(UTF-8));  does?

I thought all strings in perl were Unicode ? or at least that's what the 
Unicode::Encoding plugin is for isnt' it?

I have in my app 

use Catalyst qw/
Unicode::Encoding
/;

What's the purpose of this Catgalyst plugin if it isn't making my app Unicode?

How do I encode a string to unicode if it isn't already?

 # close file
 undef $iof;
 That's not necessary. When the reference falls out of scope, the destructor 
 that closes the file is called automatically.

Does it do any harm? Is there an issue with cleaning up your own object 
references?

I thought it was good practice to clean up your own references , even if auto 
garbage collection *might* do it for you? It's a habit I have from VBA / 
VB.NET, am I doing something bad?

 PS: IO::File does not throw exceptions when the file could not be read.
 Instead I recommend to use the `open` built-in in conjuction

Please note there is no file to be read , this is utilising Perl 5+'s ability 
to use a string as a file handle.

There will always be a string, even if it is empty so the exported XLS will be 
a blank spread sheet.

I think all I need to do is understand how I encode the string before giving it 
to IO::File

Your help is appreciated.

Regards,
Craig.



-Original Message-
From: Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 [mailto:da...@cpan.org]
Sent: 02 July 2013 10:06
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] CSV / UTF-8 / Unicode

 I seem to be having major problems getting the application devel
 server (my_app_server.pl) to accept an IO::File Handle as CSV and
 correctly encode as UTF-8.
No, the code does exactly what you said. The problem is rather that 
Catalyst::Response::body wants octets, not characters. Either pass the handle 
through in raw mode, or encode the content again for output as UTF-8. If the 
input file is not under your control, I recommend going through a manual 
decoding/encoding step instead of IO layers, and make decoding errors fatal 
(see FB_CROAK in http://p3rl.org/Encode) in order to catch malformed encoding 
before it's delivered to the client.
One can't be too careful.

 # close file
 undef $iof;
That's not necessary. When the reference falls out of scope, the destructor 
that closes the file is called automatically.

PS: IO::File does not throw exceptions when the file could not be read.
Instead I recommend to use the `open` built-in in conjuction with 
http://p3rl.org/autodie for better error checking.
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor

RE: [Catalyst] CSV / UTF-8 / Unicode

2013-07-02 Thread Craig Chant
well Lars said that binmode(:encoding...) wasn't encoding.

I thought it was, I very confused here!

Anyway, I've also tried...



# encode UTF8 octet
use Encode qw(decode encode);
my $octets = encode('UTF-8', $xls);

# output header
$c-response-content_type('application/vnd.ms-excel');
$c-response-content_length(length($octets));
$c-response-header(Content_Disposition = 
'attachment;filename=NBCS_Export.csv');

# create an IO::File for Catalyst
use IO::File;
my $iof = IO::File-new;

$iof-open(\$octets, r);
#$iof-binmode(:encoding(UTF-8));

# output XLS data
$c-response-body($iof);

# close file
undef $iof;

---

But still if I use the binmode encoding line catalyst falls over with 'wide 
character' and if I don't I get a spread sheet full of junk characters?

Either way, it's not working, why would this be?

Craig.

-Original Message-
From: Mike Whitaker [mailto:m...@altrion.org]
Sent: 02 July 2013 11:47
To: The elegant MVC web framework
Subject: Re: [Catalyst] CSV / UTF-8 / Unicode

On 2 Jul 2013, at 10:59, Craig Chant cr...@homeloanpartnership.com wrote:

utf8::encode($xls);

$iof-binmode(:encoding(UTF-8));

...erm, haven't you now encoded twice?

Also? Don't use utf8::encode - if you can't use IO layers etc, use the general 
Encode module.
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Conduct Authority.

___
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] CSV / UTF-8 / Unicode

2013-07-02 Thread Craig Chant
Hi Mike,

The data is coming from MS SQL 2008 R2, I have checked the DB and the column is 
defined as data type nvarchar(max) , so is set to Unicode and when viewing data 
via SQL Studio Manager, the Unicode characters display fine.

I am accessing the DB via DBI and have set on the connection string.. 
{'RaiseError' = 1, 'mysql_enable_utf8' = 1}

Though I'm not sure if the utf8 setting has any affect when using an MS ODBC 
driver as the flag implies it's for mysql ?

I tried to apply  my $chars = decode('UTF-8', $xls); and I got an error saying 
you cannot decode a string with wide characters.

I don't know what the string is, but when you try to decode you get a wide 
character error and when you try to encode you get a wide character error.

If I don't do anything to it and just output it, no error, but the data is full 
of junk chars.

Where do I go from here?

Thanks,
Craig.



-Original Message-
From: Mike Whitaker [mailto:m...@altrion.org]
Sent: 02 July 2013 12:27
To: The elegant MVC web framework
Subject: Re: [Catalyst] CSV / UTF-8 / Unicode


   # encode UTF8 octet
use Encode qw(decode encode);
my $octets = encode('UTF-8', $xls);

OUt of curiousity, where's the data in $xls come from, and what do you know 
about its encoding and bytes vs characters status?
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Conduct Authority.

___
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] CSV / UTF-8 / Unicode

2013-07-02 Thread Craig Chant
Hi Alexander,

I have read the DBD::ODBC docs and it seems Unicode is ON by default

 Enabling and Disabling Unicode support

On Windows Unicode support is enabled by default

So do I assume the data coming from the DB is Unicode encoded already?

if so , why does decode fall over?

I don't seem able to decode or encode without the app crashing?

Do I have non-Unicode chars perhaps?

Craig.

-Original Message-
From: Alexander Hartmaier [mailto:alexander.hartma...@t-systems.at]
Sent: 02 July 2013 12:53
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] CSV / UTF-8 / Unicode

On 2013-07-02 13:45, Craig Chant wrote:
 Hi Mike,

 The data is coming from MS SQL 2008 R2, I have checked the DB and the column 
 is defined as data type nvarchar(max) , so is set to Unicode and when viewing 
 data via SQL Studio Manager, the Unicode characters display fine.

 I am accessing the DB via DBI and have set on the connection string..
 {'RaiseError' = 1, 'mysql_enable_utf8' = 1}
MSSQL != MySQL

 Though I'm not sure if the utf8 setting has any affect when using an MS ODBC 
 driver as the flag implies it's for mysql ?
No it doesn't, read your DBD's docs.

 I tried to apply  my $chars = decode('UTF-8', $xls); and I got an error 
 saying you cannot decode a string with wide characters.

 I don't know what the string is, but when you try to decode you get a wide 
 character error and when you try to encode you get a wide character error.

 If I don't do anything to it and just output it, no error, but the data is 
 full of junk chars.

 Where do I go from here?
Ensure that the data coming out from your database is properly decoded, then 
make sure it's properly encoded when outputting it.
Never mess with Perls' internal representation of the data by dis-/enabling the 
utf-8 bit.

 Thanks,
 Craig.



 -Original Message-
 From: Mike Whitaker [mailto:m...@altrion.org]
 Sent: 02 July 2013 12:27
 To: The elegant MVC web framework
 Subject: Re: [Catalyst] CSV / UTF-8 / Unicode


   # encode UTF8 octet
use Encode qw(decode encode);
my $octets = encode('UTF-8', $xls);
 OUt of curiousity, where's the data in $xls come from, and what do you know 
 about its encoding and bytes vs characters status?
 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive:
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/ This Email and any attachments
 contain confidential information and is intended solely for the individual to 
 whom it is addressed. If this Email has been misdirected, please notify the 
 author as soon as possible. If you are not the intended recipient you must 
 not disclose, distribute, copy, print or rely on any of the information 
 contained, and all copies must be deleted immediately. Whilst we take 
 reasonable steps to try to identify any software viruses, any attachments to 
 this e-mail may nevertheless contain viruses, which our anti-virus software 
 has failed to identify. You should therefore carry out your own anti-virus 
 checks before opening any documents. HomeLoan Partnership will not accept any 
 liability for damage caused by computer viruses emanating from any attachment 
 or other document supplied with this e-mail. HomeLoan Partnership reserves 
 the right to monitor and archive all e-mail communications through its 
 network. No representative or employee of HomeLoan Partnership has the 
 authority to enter into any contract on behalf of HomeLoan Partnership by 
 email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
 registered in England and Wales with Registration Number 5011722. Registered 
 office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
 authorised and regulated by the Financial Conduct Authority.

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




***
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b
***
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then delete 
this e-mail immediately.
***

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has

RE: [Catalyst] CSV / UTF-8 / Unicode

2013-07-02 Thread Craig Chant
Hi Alexander,

Well I think I found the problem... the DBI module!

I went back to my original SQL wrapper for Win32::ODBC in my original 
procedural script application before porting to Catalyst (where I moved to DBI).

All my output to XLS in the old script using Win32::ODBC works perfectly, no 
funny chars in sight!

So it has to be flaky Windows support in the DBI module to blame wouldn't you 
say?

So either I refactor my SQL model wrappers under Catalyst to use Win32::ODBC, 
or I find out why DBI is corrupting my SQL data.

No wonder I was going round in circles trying to UTF-8 my data!

DBI on Windows has always been a thorn in my side especially with the long 
read issues that occur!

I guess I need to head to the Perl forums for DBI support, though it might be 
nice if MST chimed in as I know he's an expert on all things DBI/DBIC.

Is there a switch or flag or something I am missing to make DBI work properly 
under DBD::ODBC?

Oh and I did a test with DBI in my old procedural application script and got 
the same funny characters as I did with DBI under Catalyst, so I think we can 
safely say it is DBI with the problem and not Catalyst.

Any input greatly received.

Regards,
1DMF


-Original Message-
From: Alexander Hartmaier [mailto:alexander.hartma...@t-systems.at]
Sent: 02 July 2013 13:49
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] CSV / UTF-8 / Unicode

On 2013-07-02 14:20, Craig Chant wrote:
 Hi Alexander,

 I have read the DBD::ODBC docs and it seems Unicode is ON by default

  Enabling and Disabling Unicode support

 On Windows Unicode support is enabled by default

 So do I assume the data coming from the DB is Unicode encoded already?

 if so , why does decode fall over?

 I don't seem able to decode or encode without the app crashing?

 Do I have non-Unicode chars perhaps?

 Craig.
I'd suggest to test it outside of Catalyst with a simple standalone script.
I have neither experience with Perl on Windows nor with ODBC and MSSQL.
Ask on the DBIC list or on IRC, some guys use MSSQL successfully there.

BR Alex


 -Original Message-
 From: Alexander Hartmaier [mailto:alexander.hartma...@t-systems.at]
 Sent: 02 July 2013 12:53
 To: catalyst@lists.scsys.co.uk
 Subject: Re: [Catalyst] CSV / UTF-8 / Unicode

 On 2013-07-02 13:45, Craig Chant wrote:
 Hi Mike,

 The data is coming from MS SQL 2008 R2, I have checked the DB and the column 
 is defined as data type nvarchar(max) , so is set to Unicode and when 
 viewing data via SQL Studio Manager, the Unicode characters display fine.

 I am accessing the DB via DBI and have set on the connection string..
 {'RaiseError' = 1, 'mysql_enable_utf8' = 1}
 MSSQL != MySQL
 Though I'm not sure if the utf8 setting has any affect when using an MS ODBC 
 driver as the flag implies it's for mysql ?
 No it doesn't, read your DBD's docs.
 I tried to apply  my $chars = decode('UTF-8', $xls); and I got an error 
 saying you cannot decode a string with wide characters.

 I don't know what the string is, but when you try to decode you get a wide 
 character error and when you try to encode you get a wide character error.

 If I don't do anything to it and just output it, no error, but the data is 
 full of junk chars.

 Where do I go from here?
 Ensure that the data coming out from your database is properly decoded, then 
 make sure it's properly encoded when outputting it.
 Never mess with Perls' internal representation of the data by dis-/enabling 
 the utf-8 bit.
 Thanks,
 Craig.



 -Original Message-
 From: Mike Whitaker [mailto:m...@altrion.org]
 Sent: 02 July 2013 12:27
 To: The elegant MVC web framework
 Subject: Re: [Catalyst] CSV / UTF-8 / Unicode


   # encode UTF8 octet
use Encode qw(decode encode);
my $octets = encode('UTF-8', $xls);
 OUt of curiousity, where's the data in $xls come from, and what do you know 
 about its encoding and bytes vs characters status?
 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive:
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/ This Email and any
 attachments contain confidential information and is intended solely for the 
 individual to whom it is addressed. If this Email has been misdirected, 
 please notify the author as soon as possible. If you are not the intended 
 recipient you must not disclose, distribute, copy, print or rely on any of 
 the information contained, and all copies must be deleted immediately. 
 Whilst we take reasonable steps to try to identify any software viruses, any 
 attachments to this e-mail may nevertheless contain viruses, which our 
 anti-virus software has failed to identify. You should therefore carry out 
 your own anti-virus checks before opening any documents. HomeLoan 
 Partnership will not accept any liability for damage caused by computer 
 viruses emanating

RE: [Catalyst] CSV / UTF-8 / Unicode

2013-07-02 Thread Craig Chant
 All the above seems overkill.   I suspect what you want is closer to this: 
 (but see notes below).

Tried that, didn't work, ended up in a long Catalyst discussion where it was 
worked out that I needed to wrap any XLS output to an IO:FILE handle otherwise 
Catalyst dies with an out of memory error something to do with streaming data 
support issues in Catalyst so the work round is to wrap the output into an 
IO:File object.

Second, be aware that $c-response-content_length(length($xls));

Yes, I was doing the encode then using Length (I did read on perldocs about 
requesting the length against the octet) , either way, the length was the least 
of my worries, keeping Catalyst from falling over with 'Wide Character' errors, 
or not getting garbage was my main concern.

And yes, the output is CSV not strictly XLS but I have been told and looked it 
up on the net that 'application/vnd.ms-excel'  Is the correct MIME header to 
pass for CSV that you want MS Excel to open.

Of course, if I have the wrong MIME header for CSV - MS Excel please can you 
provide the correct one, as it took me a long time to find that one, as the box 
standard 'text/csv' does not work properly when opened in MS Excel.

Though as it appears DBI is corrupting my Unicode data, it might be related to 
that rather than CSV-MS Excel per sae!


From: Bill Moseley [mailto:mose...@hank.org]
Sent: 02 July 2013 16:59
To: The elegant MVC web framework
Subject: Re: [Catalyst] CSV / UTF-8 / Unicode


On Tue, Jul 2, 2013 at 2:59 AM, Craig Chant 
cr...@homeloanpartnership.commailto:cr...@homeloanpartnership.com wrote:

# output header
$c-response-content_type('application/vnd.ms-excel');
$c-response-content_length(length($xls));
$c-response-header(Content_Disposition = 
'attachment;filename=NBCS_Export.csv');

# create an IO::File for Catalyst
use IO::File;
my $iof = IO::File-new;

$iof-open(\$xls, r);
$iof-binmode(:encoding(UTF-8));

# output XLS data
$c-response-body($iof);

All the above seems overkill.   I suspect what you want is closer to this: (but 
see notes below).

$c-response-content_type('text/csv');
$c-response-body($xls);
$c-response-header(Content_Disposition = 
'attachment;filename=NBCS_Export.csv');

Then with that content type the plugin would encode $xls as utf8 and add 
;charset=utf8 (or whatever it is configured to encode as).

Notes:

First, you are not returning Excel, so the content type is not what you first 
listed above, right?

Second, be aware that $c-response-content_length(length($xls)); could be very 
wrong.  If $xls is really CSV text AND it's decoded then length($xls) is the 
length in characters, not octets.   Don't set the content length.


Third, Catalyst::Plugin::Unicode::Encoding, IMO, has some issues.

The plugin limits to just these content types.

return $c-next::method(@_)
  unless $c-response-content_type =~ /^text|xml$|javascript$/;

Then it does this:

$c-response-body( $c-encoding-encode( $body, $CHECK ) )
if ref(\$body) eq 'SCALAR';

Personally, I think the correct approach is to only encode character data -- 
that is check to see if the utf8 flag is set before calling encode.

Maybe limit to the content types listed above, but throw an exception for other 
content types where the body is a scalar AND has the utf8 flag on.  After all, 
we can only write out octets or else we get the Wide Character error.






--
Bill Moseley
mose...@hank.orgmailto:mose...@hank.org
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Conduct Authority.
___
List

RE: [Catalyst] List of Applications using Catalyst

2013-06-10 Thread Craig Chant
 And yes, I think most people using Catalyst are building custom website 
 applications for companies, stuff that doesn't have easily broken out bits 
 like generic CMSs and so forth.  I think most people using Catalyst prefer 
 to craft code to a solution rather than take an existing tool, like a CMS or 
 generic blogging tool and bend it to fit a business case.

I agree, and is exactly how I use Catalyst. I tailor all the applications to 
the companies needs on an Ad-Hoc basis.

John - As you know I am happy to help if possible, and once I get my 
TortoiseGIT working with the catagits repository I will make any changes you 
wish me to. I don't have much time currently due to my OU studies, but if you 
think I can help, just holla!

From: John Napiorkowski [mailto:jjn1...@yahoo.com]
Sent: 10 June 2013 15:50
To: The elegant MVC web framework
Subject: Re: [Catalyst] List of Applications using Catalyst

I think there's two streams to this thread.

Are there good existing open source projects that can serve as decent examples 
of how a good Catalyst application looks?

Why is the website so out of date?

As for the former, there's not a lot of people actively maintaining the site.  
We probably have more content there then we can rationally manage given our 
current contributorship.  I do hope we can come together and find a way to have 
a smaller and more streamlined site, but right now I personally don't have time 
for it, and the time I do have I'd rather put into development of new 
capacities, such as the websockets and evented stuff we are doing for the next 
release, and so forth.  That shouldn't stop someone else from stepping up 
though and I'd be happy to help out if such a person of group did.

We have been trying to put together more examples of Catalyst code, and you if 
look at the catalyst github org (https://github.com/perl-catalyst/) things are 
starting to show up there.  It will take time to get more quality there but I 
think it will happen.

And yes, I think most people using Catalyst are building custom website 
applications for companies, stuff that doesn't have easily broken out bits like 
generic CMSs and so forth.  I think most people using Catalyst prefer to craft 
code to a solution rather than take an existing tool, like a CMS or generic 
blogging tool and bend it to fit a business case.

John


From: Ferruccio Zamuner nonsolos...@diff.orgmailto:nonsolos...@diff.org
To: catalyst@lists.scsys.co.ukmailto:catalyst@lists.scsys.co.uk
Sent: Sunday, June 9, 2013 1:05 PM
Subject: Re: [Catalyst] List of Applications using Catalyst

On 06/08/13 12:02, Denny wrote:
 On Fri, 2013-06-07 at 16:16 -0700, bill hauck wrote:
 Does anyone know of a list of applications that are using Catalyst?

 http://wiki.catalystframework.org/wiki/catalystpoweredsoftware


At least SheepWool and FileZ have broken links.
Can anyone update them if they are still alive?


Bye,\ferz

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

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Conduct Authority.
___
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] Re: mod_fastcgi binaries for Win32

2013-05-22 Thread Craig Chant
I updated the specific IIS7 / Catalyst wiki page 
http://wiki.catalystframework.org/wiki/deployment/iis7_fastcgi that had all you 
needed to know to get Catalyst running in a totally windows centric 
environment, with step by step instructions and screen shots. ActiveState Perl 
Win32 / IIS7 / Catalyst

However, once again it has been completely trashed (as it was prior to me 
updating it), all the images are missing and I wonder whether it's worth 
bothering with Wiki, it appears to be too unstable and unreliable to bother or 
even be able to be kept up-to-date, as all your hours of work are trashed 
within weeks.

From: Ross Attrill [mailto:ross.attr...@gmail.com]
Sent: 22 May 2013 07:58
To: The elegant MVC web framework
Subject: Re: [Catalyst] Re: mod_fastcgi binaries for Win32

I would be happy to update the Wiki page but can't work out how to create a 
logon to the page.   If someone can please point me to the link to create a 
logon for the Wiki I will update the page.   I can see a login link 
http://wiki.catalystframework.org/wiki/.login but no register link.

My broad requirement is to get fastCGI (or something similar) working on a 
Win32 platform - preferrably with Strawberry Perl.   Right now I am making more 
progress with IIS than Apache.  Once I get something  working well I will 
create a post on blogs.perl.orghttp://blogs.perl.org.

Thank you Dimitar.

On Wed, May 22, 2013 at 3:56 PM, Dimitar Petrov 
mita...@gmail.commailto:mita...@gmail.com wrote:

It would be nice if you can either adjust that wiki article or post a small 
summary on blogs.perl.orghttp://blogs.perl.org in case someone else has the 
same issue.

Cheers
On 22 May 2013 06:24, Ross Attrill 
ross.attr...@gmail.commailto:ross.attr...@gmail.com wrote:
Please ignore this - I found what I was looking for at the fastcgi site: 
http://www.fastcgi.com/dist/  - there was a compiled .dll there.

On Tue, May 21, 2013 at 10:48 AM, Ross Attrill 
ross.attr...@gmail.commailto:ross.attr...@gmail.com wrote:
The Catalyst community wiki has some links to mod_fastcgi builds for Apache on 
Win32 here: 
http://wiki.catalystframework.org/wiki/deployment/apache_fastcgi_win32#Install_Apache_FastCGI_module

However, the download links for those binaries don't seem to work.  Is there 
some way that I can get access to those files easily?

Thank you,

Ross Attrill.


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

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

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Conduct Authority.
___
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] Out of Memory - File delivery issue

2013-05-03 Thread Craig Chant
Hi Guys,

Just wanted to update as I have found a resolve.

Initial I wanted to try write direct to the file in the model building the CSV 
data, rather than a string scalar, but I just couldn't seem to write to the 
open 'string' file handle?

So I went back to my model outputting  the CSV data as a string scalar  and 
returning it to the controller as it was originally ...

Then rather than directly passing the $xls scalar to response-body, where it 
was falling over...

I instead wrap it up into an IO::File object and pass that to the 
response-body, and it seem to be working fine!

Here is what I now have in my controller that allows me to parse the CSV scalar 
string...

--

my ($result,$xls) = $c-model('NBCSXLSExport')-csv_export;

# check for ok status
if($result-ok)
{

# output header
$c-response-content_type('application/vnd.ms-excel');
$c-response-content_length(length($xls));
$c-response-header(Content_Disposition = 
'attachment;filename=NBCS_Export.csv');

# create an IO::File for Catalyst
use IO::File;
my $iof = IO::File-new;
$iof-open(\$xls, r);

# output XLS data
$c-response-body($iof);

# close file
undef $iof;
}
else
{
$c-response-body( $result-message );
}

$c-response-status(200);



I would like to thank all those who replied with suggestions and especially 
Lukas for his help with this final solution.

Regards,

Craig Chant.


-Original Message-
From: Craig Chant [mailto:cr...@homeloanpartnership.com]
Sent: 03 May 2013 09:49
To: The elegant MVC web framework
Subject: RE: [Catalyst] Out of Memory - File delivery issue

Why do you write:
I understand that Catalyst has a known issue with delivering authenticated 
files via the response mechanism.
?

Have you written a test proving that issue?

Yes, that's why I'm here trying to find a resolve.

Try it yourself, build a large scalar string representing CSV data and pass it 
to the response-body() after having output the relevant headers.

The devel server will fall over with 'out of memory' and reboot itself.

I hope to find a solution today with IO::File , but so far no joy!

-Original Message-
From: Ferruccio Zamuner [mailto:nonsolos...@diff.org]
Sent: 03 May 2013 09:41
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Out of Memory - File delivery issue

On 05/02/13 09:54, Craig Chant wrote:
 Hi,

 I understand that Catalyst has a known issue with delivering
 authenticated files via the response mechanism.

 What does the Catalyst community do to work around this problem?

I've delivered authenticated large files using a Catalyst web app without 
trouble using X-Sendfile response header and a front-end webserver like Apache 
or Lighttpd.

Why do you write:
I understand that Catalyst has a known issue with delivering authenticated 
files via the response mechanism.
?

Have you written a test proving that issue?


Bye,   \ferz

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Conduct Authority.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi

[Catalyst] Out of Memory - File delivery issue

2013-05-02 Thread Craig Chant
Hi,

I understand that Catalyst has a known issue with delivering authenticated 
files via the response mechanism.

What does the Catalyst community do to work around this problem?

If I want to read a large file from disk or collate a large CSV / XML file and 
deliver it direct to the browser, how do I do this?

Thanks,

Craig Chant
I.T. Manager
[Description: cid:image001.png@01CD5F4A.17E848D0]
Main Line01903 602664
Direct Line   01903 227753
Visit our website http://www.homeloanpartnership.com
HomeLoan Partnership have been named the Best Mortgage Network, 2012, at the 
myintroducer.com Industry Awards

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Conduct Authority.
inline: image001.png___
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] Out of Memory - File delivery issue

2013-05-02 Thread Craig Chant
Well binding the model with the response object is now causing the following 
error...

--

[error] Caught exception in engine Wide character in syswrite at 
C:/Perl/lib/IO/Handle.pm line 474.

---

I have   'Unicode::Encoding' set in my main app module?


-Original Message-
From: Craig Chant [mailto:cr...@homeloanpartnership.com]
Sent: 02 May 2013 13:07
To: The elegant MVC web framework
Subject: RE: [Catalyst] Out of Memory - File delivery issue

Hi Neil,

My model is already 'Catalyst::Model::Factory::PerRequest'

So I have added an attribute...

sub prepare_arguments {

my ($self,$c) = @_;
return {,
res =  $c-res
};

}

So I now have my model bound to  $c-res

How do I assign the scalar CSV data to it?

Surely if I use $self-res-body($xls) in the model it's no different than 
doing it in the  Controller and is still going to fall over with 'Out of 
memory'?

I seem to be getting no-where trying to print direct to the browser...

I've tried..

$c-response-header(
Content_Type =  'application/vnd.ms-excel',
Content_Disposition = 'attachment;filename=NBCS_Export.csv'
);
 $c-response-body(\*STDOUT);
 print $xls;

but the devel console shows an error...

Filehandle STDOUT opened only for output at C:/Perl/site/lib/Catalyst/Engine.pm 
line 68.

and all I end up with is an empty XSL file?

How do you output content direct to the browser bypassing Catalyst, I can't 
seem to get control of STDOUT?

Craig.

-Original Message-
From: neil.lunn [mailto:n...@mylunn.id.au]
Sent: 02 May 2013 12:52
To: The elegant MVC web framework
Subject: Re: [Catalyst] Out of Memory - File delivery issue

On 2/05/2013 8:47 PM, Craig Chant wrote:
 Is it possible to have the controller print direct to browser...
Which is exactly what was in my reply and also mentioned in the suggested 
thread.

 So instead of what I currently have...

 --
 # run export
 my ($result,$xls) = $c-model('NBCSXLSExport')-csv_export;
So what you can do in the model is rather than have the method return the 
scalars that it currently is, have them output to a supplied filehandle 
instead. Either as an argument to instantiating the model or as an argument to 
the method called. Whichever suits.

$c-model('NBCSXLSExport', $c-res)-csv_export;

or
  $c-model('NBCSXLSExport',)-csv_export( $c-res );

For more on the first approach look at the docs for Catalyst::Model::Factory.

In either case it's your underlying model code that needs the injected 
filehandle (or IO::Handle type object to be exact ) to be implemented as the 
output source.

Neil


 # check for ok status
  if($result-ok)
  {
  $c-response-header(
  Content_Type =  'application/vnd.ms-excel',
  Content_Disposition = 'attachment;filename=NBCS_Export.csv'
  );
  $c-response-body($xls);
  }
  else
  {
  $c-response-body( $result-message );
  }

  $c-response-status(200);

 --
 I replaced it with...
 --

  # run export
  my ($result,$xls) = $c-model('NBCSXLSExport')-csv_export;

  # check for ok status
  if($result-ok)
  {
  print Content-Disposition: attachment;filename=NBCS_Export.csv\n;
  print Content-Type: application/vnd.ms-excel\n;
  print \n;
  print $xls;
  }
  else
  {
  $c-response-body( $result-message );
  $c-response-status(200);
  }
 --

 However, the browser doesn't get delivered the file, the XLS content is 
 displayed in the devel console, but nothing is outputted to the browser?

 Plus as I have overridden the default 'RenderView' , how do I call it for 
 those methods in the controller that  want to use the 'RenderView' templating 
 mechanism?

 All help in understanding how I get this CSV string outputted to the browser 
 as a streaming XLS compatible file is appreciated.

 Regards,

 Craig.


 -Original Message-
 From: Lukas Thiemeier [mailto:spamcatc...@thiemeier.net]
 Sent: 02 May 2013 10:33
 To: catalyst@lists.scsys.co.uk
 Subject: Re: [Catalyst] Out of Memory - File delivery issue

 On 05/02/2013 09:54 AM, Craig Chant wrote:
 Hi,



 I understand that Catalyst has a known issue with delivering
 authenticated files via the response mechanism.



 What does the Catalyst community do to work around this problem?



 If I want to read a large file from disk or collate a large CSV / XML
 file and deliver it direct to the browser, how do I do this?

 Hi Craig,

 I never had problems delivering large files, but I don't know what you 
 consider large.

 About delivering large static files: I would recommend to use the web server 
 to serve static files, no matter if they are large or not. You can set up

RE: [Catalyst] Out of Memory - File delivery issue

2013-05-02 Thread Craig Chant
Thanks, I have done all that, but it just won't work?

In my controller I have

$c-response-header(
Content_Type =  'application/vnd.ms-excel',
Content_Disposition = 'attachment;filename=NBCS_Export.csv'
);
$c-response-body('');


in my model I have a Moose attribute which is the response object and print or 
write (tried both) direct to it with..

$self-res-write($xls);
$self-res-print($xls);

But all I get in the browser is the textual output?

Do you have to use..

$c-response-header(
Content_Type =  'application/vnd.ms-excel',
Content_Disposition = 'attachment;filename=NBCS_Export.csv'
);

Prior to writing to the response IO::File hande?

I have the header output once the result of the XLS output is known (have some 
or an error) in the controller, but it seems because the output being put in 
$self-res is performed first in the model before the headers are outputted in 
the controller, the headers are ignored.

Does this mean I now have to output the headers in my model as well?

And if so, why is my model outputting the view?

Help understanding this is appreciated, as I'm rather confused at the moment.

Thanks,

Craig.

-Original Message-
From: neil.lunn [mailto:n...@mylunn.id.au]
Sent: 02 May 2013 13:29
To: The elegant MVC web framework
Subject: Re: [Catalyst] Out of Memory - File delivery issue

On 2/05/2013 10:07 PM, Craig Chant wrote:
 Hi Neil,

 My model is already 'Catalyst::Model::Factory::PerRequest'

 So I have added an attribute...

 sub prepare_arguments {

  my ($self,$c) = @_;
  return {,
  res =  $c-res
  };

 }

 So I now have my model bound to  $c-res

 How do I assign the scalar CSV data to it?
Assuming now there is an accessor in the actual class you are using for the 
model, and assuming a Moose based class then rather than putting the CSV output 
into a scalar you want to use the 'response' object.
Something like:

$self-res-print( $my_line_of_csv );

At any rate it's how the CSV is being output in the model that you need to 
change.

 Surely if I use $self-res-body($xls) in the model it's no different than 
 doing it in the  Controller and is still going to fall over with 'Out of 
 memory'?
Yep. This is why the discussion says do it line by line rather than build a big 
scalar.
 I seem to be getting no-where trying to print direct to the browser...

 I've tried..

  $c-response-header(
  Content_Type =  'application/vnd.ms-excel',
  Content_Disposition = 'attachment;filename=NBCS_Export.csv'
  );

That part's okay. You need a response Content_Type.


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Conduct Authority.

___
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] Out of Memory - File delivery issue

2013-05-02 Thread Craig Chant
I can confirm if I output the view in my Model it works?

# clean due to Catalyst wide chars error
$xls =~ s/[^[:ascii:]]//gi;

# output header
$self-res-header(
Content_Type =  'application/vnd.ms-excel',
Content_Disposition = 'attachment;filename=NBCS_Export.csv'
);

# add to Catalyst response object
$self-res-write($xls);

What's the purpose of MVC in this situation?

I seem to be binding my model to a catalyst object which I was told is wrong in 
the IRC and then outputting view headers from my model as well.

Is this the only way to get Catalyst to play with simple data streaming?

I get the feeling I'm doing something wrong here and would appreciate guidance.

Regards,

Craig.

-Original Message-
From: Craig Chant [mailto:cr...@homeloanpartnership.com]
Sent: 02 May 2013 13:51
To: The elegant MVC web framework
Subject: RE: [Catalyst] Out of Memory - File delivery issue

Thanks, I have done all that, but it just won't work?

In my controller I have

$c-response-header(
Content_Type =  'application/vnd.ms-excel',
Content_Disposition = 'attachment;filename=NBCS_Export.csv'
);
$c-response-body('');


in my model I have a Moose attribute which is the response object and print or 
write (tried both) direct to it with..

$self-res-write($xls);
$self-res-print($xls);

But all I get in the browser is the textual output?

Do you have to use..

$c-response-header(
Content_Type =  'application/vnd.ms-excel',
Content_Disposition = 'attachment;filename=NBCS_Export.csv'
);

Prior to writing to the response IO::File hande?

I have the header output once the result of the XLS output is known (have some 
or an error) in the controller, but it seems because the output being put in 
$self-res is performed first in the model before the headers are outputted in 
the controller, the headers are ignored.

Does this mean I now have to output the headers in my model as well?

And if so, why is my model outputting the view?

Help understanding this is appreciated, as I'm rather confused at the moment.

Thanks,

Craig.

-Original Message-
From: neil.lunn [mailto:n...@mylunn.id.au]
Sent: 02 May 2013 13:29
To: The elegant MVC web framework
Subject: Re: [Catalyst] Out of Memory - File delivery issue

On 2/05/2013 10:07 PM, Craig Chant wrote:
 Hi Neil,

 My model is already 'Catalyst::Model::Factory::PerRequest'

 So I have added an attribute...

 sub prepare_arguments {

  my ($self,$c) = @_;
  return {,
  res =  $c-res
  };

 }

 So I now have my model bound to  $c-res

 How do I assign the scalar CSV data to it?
Assuming now there is an accessor in the actual class you are using for the 
model, and assuming a Moose based class then rather than putting the CSV output 
into a scalar you want to use the 'response' object.
Something like:

$self-res-print( $my_line_of_csv );

At any rate it's how the CSV is being output in the model that you need to 
change.

 Surely if I use $self-res-body($xls) in the model it's no different than 
 doing it in the  Controller and is still going to fall over with 'Out of 
 memory'?
Yep. This is why the discussion says do it line by line rather than build a big 
scalar.
 I seem to be getting no-where trying to print direct to the browser...

 I've tried..

  $c-response-header(
  Content_Type =  'application/vnd.ms-excel',
  Content_Disposition = 'attachment;filename=NBCS_Export.csv'
  );

That part's okay. You need a response Content_Type.


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority

RE: [Catalyst] Out of Memory - File delivery issue

2013-05-02 Thread Craig Chant
Awesome Luke, really appreciate the advice and guidance.

It didn't feel right the way I have it and I get enough boots up my behind from 
the IRC , without adding to the problem with more bad code!

I like this option (IO::Handle-style object instead of a string.) , just going 
to have to read up on how I create one!

If Catlayst is going to baulk trying to parse strings, but likes IO::Handle 
objects, I can put my header output back in the controller and not couple the 
model to the response object.

I can then pass back the IO::Handle object from my model and let catalyst 
output that!

I'll give it a whirl and let you know how I get on.

Regards,

Craig.

-Original Message-
From: Lukas Thiemeier [mailto:spamcatc...@thiemeier.net]
Sent: 02 May 2013 15:04
To: The elegant MVC web framework
Subject: Re: [Catalyst] Out of Memory - File delivery issue

Hi again,

FIRST:

Your Controller Code looks good. I would use build-in  functionality whenever 
possible. In this case, using $c-res-content_type instead of setting the 
content type by hand. But your code should work just fine.

Your are right. You  have to set the headers before using $c-res-print (or 
write). But this does not mean that you have to do this in the model.  You can 
set the headers in your Controller before running the model code.

SECOND:

IMO you are right about your concerns regarding the MVC architecture.
The Model should provide the data and not deal with HTTP responses. On the 
other hand, the data has to be provided in some format. XML is a well known 
standard format for textual data presentation. Providing the data as XML is as 
good or as bad as providing the data as DBIC objects.
(Well, not really. But close enough for this explanation).

The cleanest (most MVC conform) way to do this would be to fetch the raw data 
from your model and create your XML in a special view. There are several ways 
to do this. You can create XML using a TT view. ( I have done this before, it 
works fine). Or you can use existing XML views like 
Catalyst::View::XML::Generator or Catalyst::View::XML::Hash::LX. (I have not 
used any of them, but the names are promising). I guess there are even more 
ways to do it...

In your Case, you already have a Model which provides the XML Data (which is 
fine, as I said before). IMO, one of the great things about Catalyst is that it 
allows you to get the job done quickly. It makes reusing existing code easy. 
There is no reason to abandon your existing XML-creation code just because it 
doesn't fit the MVC layout. Doing so would be contra-productive.

So, what can be done to re-use your XML Model and still fit into the MVC 
architecture? I see two ways:

The first one would be to update your model that it writes its data to any 
IO::Handle compatible object. You can pass $c-res to your Model, which is 
IO::Handle compatible. Your model uses a Catalyst independent API to write out 
the data. Catalyst streams the data to the client. Your Model Code is still 
Catalyst independent and does not know that it is writing to a 
Catalyst::Response object. No tight coupling. You can reuse your model in 
non-catalyst applications and easily test its functionality using Test::More or 
any other test suite. ( I think this is more or less the way proposed by Neil)

The second way (which I would prefer, since it is even more MVC conform) is the 
following: Update your Model to return an IO::Handle-style object instead of a 
string. You can fetch this object from the model in your controller, and pass 
it to $c-res-body. Catalyst will take care of streaming the data to the 
client in small chunks. You don't have to pass any Catalyst related objects to 
the model anymore. Your model returns the data as a well known standard object 
which happens to be suitable for streaming large amounts data with catalyst. No 
tight coupling at all. Problem solved. Have a Tea and celebrate.

This is my opinion on this topic. I hope it helps you to find a way which fits 
your needs, and reduces your confusion about Models, Views and controllers in 
this specific case.

Lukas

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry 

RE: [Catalyst] Out of Memory - File delivery issue

2013-05-02 Thread Craig Chant
I can't work this out?

I have in my model...
--
  my $xls = col1,col2,col3\n;

# open io handle
$io_handle = IO::Handle-new();
open my ($str_fh), '', \$xls;

if ($io_handle-fdopen($str_fh,w))
{
$io_handle-print('row1,row2,row3' . \n);
   }

   return $io_handle;


in my controller...
--
# output header
$c-response-header(
Content_Type =  'application/vnd.ms-excel',
Content_Disposition = 'attachment;filename=NBCS_Export.csv'
);

# output XLS data
$c-response-body($io_handle);
--

All I get is a blank XLS file?

I can't work out how I create the IO::Handle object with the XLS data inside it?

Thanks,

Craig.

-Original Message-
From: Craig Chant [mailto:cr...@homeloanpartnership.com]
Sent: 02 May 2013 15:17
To: The elegant MVC web framework
Subject: RE: [Catalyst] Out of Memory - File delivery issue

Awesome Luke, really appreciate the advice and guidance.

It didn't feel right the way I have it and I get enough boots up my behind from 
the IRC , without adding to the problem with more bad code!

I like this option (IO::Handle-style object instead of a string.) , just going 
to have to read up on how I create one!

If Catlayst is going to baulk trying to parse strings, but likes IO::Handle 
objects, I can put my header output back in the controller and not couple the 
model to the response object.

I can then pass back the IO::Handle object from my model and let catalyst 
output that!

I'll give it a whirl and let you know how I get on.

Regards,

Craig.

-Original Message-
From: Lukas Thiemeier [mailto:spamcatc...@thiemeier.net]
Sent: 02 May 2013 15:04
To: The elegant MVC web framework
Subject: Re: [Catalyst] Out of Memory - File delivery issue

Hi again,

FIRST:

Your Controller Code looks good. I would use build-in  functionality whenever 
possible. In this case, using $c-res-content_type instead of setting the 
content type by hand. But your code should work just fine.

Your are right. You  have to set the headers before using $c-res-print (or 
write). But this does not mean that you have to do this in the model.  You can 
set the headers in your Controller before running the model code.

SECOND:

IMO you are right about your concerns regarding the MVC architecture.
The Model should provide the data and not deal with HTTP responses. On the 
other hand, the data has to be provided in some format. XML is a well known 
standard format for textual data presentation. Providing the data as XML is as 
good or as bad as providing the data as DBIC objects.
(Well, not really. But close enough for this explanation).

The cleanest (most MVC conform) way to do this would be to fetch the raw data 
from your model and create your XML in a special view. There are several ways 
to do this. You can create XML using a TT view. ( I have done this before, it 
works fine). Or you can use existing XML views like 
Catalyst::View::XML::Generator or Catalyst::View::XML::Hash::LX. (I have not 
used any of them, but the names are promising). I guess there are even more 
ways to do it...

In your Case, you already have a Model which provides the XML Data (which is 
fine, as I said before). IMO, one of the great things about Catalyst is that it 
allows you to get the job done quickly. It makes reusing existing code easy. 
There is no reason to abandon your existing XML-creation code just because it 
doesn't fit the MVC layout. Doing so would be contra-productive.

So, what can be done to re-use your XML Model and still fit into the MVC 
architecture? I see two ways:

The first one would be to update your model that it writes its data to any 
IO::Handle compatible object. You can pass $c-res to your Model, which is 
IO::Handle compatible. Your model uses a Catalyst independent API to write out 
the data. Catalyst streams the data to the client. Your Model Code is still 
Catalyst independent and does not know that it is writing to a 
Catalyst::Response object. No tight coupling. You can reuse your model in 
non-catalyst applications and easily test its functionality using Test::More or 
any other test suite. ( I think this is more or less the way proposed by Neil)

The second way (which I would prefer, since it is even more MVC conform) is the 
following: Update your Model to return an IO::Handle-style object instead of a 
string. You can fetch this object from the model in your controller, and pass 
it to $c-res-body. Catalyst will take care of streaming the data to the 
client in small chunks. You don't have to pass any Catalyst related objects to 
the model anymore. Your model returns the data as a well known standard object 
which happens to be suitable for streaming

RE: [Catalyst] How to get IP address of the interface which the request come through

2013-03-25 Thread Craig Chant
I use

$c-req-address

-Original Message-
From: N.A. [mailto:n...@u01.gate01.com]
Sent: 23 March 2013 12:13
To: The elegant MVC web framework
Subject: [Catalyst] How to get IP address of the interface which the request 
come through

I wan to get the  IP address of the interface(network device) which the request 
come through.
This information can be easily obtained by

 $c-engine-env-{ SERVER_ADDR }

with FCGI setting both on nginx/lighttpd web servers.
However SERVER_ADDR is not defined in Catalyst Test Server.

Of course the network device is usually 'eth0', but in some situation the 
network device can be 'virbr0' , 'wlan0','eth1' and so on.
Are there any simple and portable way to get the information.

I use Catalyst of version 5.90020 on linux box.

N.A.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

___
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] How to get IP address of the interface which the request come through

2013-03-25 Thread Craig Chant
ok, perhaps I should read all emails before replying :-)

Morning all ,welcome to the week!

-Original Message-
From: Peter Flanigan [mailto:p...@roxsoft.co.uk]
Sent: 23 March 2013 14:03
To: The elegant MVC web framework
Subject: Re: [Catalyst] How to get IP address of the interface which the 
request come through

On 23/03/13 12:12, N.A. wrote:
 I wan to get the  IP address of the interface(network device) which
 the request come through.

My bad.

Use $c-req-uri-host to get the hostname of the server

--

Regards

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

___
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, ExtJS and TT

2013-03-19 Thread Craig Chant
You set what the extension your templates will be within the TT View

http://search.cpan.org/~jjnapiork/Catalyst-View-TT-0.41/lib/Catalyst/View/TT.pm

Is the .js file TT that outputs HTML? Any reason you don't  load the external 
JS via the header?

Or use the templating mechanism to write the JS to the body / head within 
script tags?



-Original Message-
From: Jean-Marc Choulet [mailto:jm130...@gmail.com]
Sent: 16 March 2013 10:10
To: The elegant MVC web framework
Subject: [Catalyst] Catalyst, ExtJS and TT

Hello,

I have a javascript file named EntrepriseWindow.js in root dir. It contains 
some TT code. I must add a extension (I renamed the file
EntrepriseWindow.js) for it to work. Otherwise, it does not work :

sub EntrepriseWindow :Path('EntrepriseWindow.js') {

 my ($self, $c) = @_;

 $c-stash-{template} = 'EntrepriseWindow.js.tt';

 $c-response-content_type('application/javascript');

}

I cannot write this ?

$c-stash-{template} = 'EntrepriseWindow.js';


Thanks,

Jean-Marc




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

___
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] Windows Deployment

2013-01-02 Thread Craig Chant
Hi Tadhg,

I can assure you the wiki IIS / Catalyst page is not out of date as I 
personally updated it just before Christmas!

Were you definitely looking at the following URL? 
http://wiki.catalystframework.org/wiki/deployment/iis7_fastcgi

Please check that URL and let me know what part you are personally experiencing 
problems with and I will do my best to assist you.

I have a fully functioning Catalyst 5.9 set up under ActiveState's Active Perl 
5.18 on a Windows Server 2008 R2 using IIS7.

I have also installed on a Windows 7 machine for local devel no problems (well 
ok there were, but I got it sorted!)

Regards,

Craig.

From: Tadhg [mailto:tadhg.da...@gmail.com]
Sent: 02 January 2013 12:18
To: catalyst@lists.scsys.co.uk
Subject: [Catalyst] Windows Deployment


Hi All,

I'm trying to deploy a simple Catalyst application for internal users, so I 
don't need anything fancy load balancing or proxy servers etc.

My environment,
Server: Windows 2003 server 32 bit
Dev Client: Windows 7 64 bit
Perl: 5.14.12 32 bit
Catalyst: 5.90018

I've had a look at the deployment page on the Catalyst Wiki, which gives a good 
indication of what sould work (though I think some of it may be out of date). 
Each option I try leads to a roadblock, so I start down a new path with the 
same result.

My no doubt misguided impressions are, Nginx/Lighttpd have limited win support, 
Acache is difficult and so not recommended and IIS needs Apache and FastCGI and 
is therefore doubly complex.

What I'd like is somebody to tell me what they have working on windows, or even 
better what the best/least painful solution is?

If appropriate I'll then update/extend the wiki.

Thanks,
Tadhg
Win-Noob

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
___
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 optimal captcha

2012-12-14 Thread Craig Chant
http://www.captcha.net/

-Original Message-
From: peterp...@bk.ru [mailto:peterp...@bk.ru]
Sent: 14 December 2012 09:34
To: The elegant MVC web framework
Subject: [Catalyst] The optimal captcha

Hi!
Needed the captcha for project. May some one recommend something about?

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
___
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] Advent 2012 is launched!

2012-12-06 Thread Craig Chant
I'm at a loss here, I've visited the Calendar on several occasions now, All I 
can see is an entry for today?

It claims to be 25 days of tips, how do I access the previous 5? (ok the 
current post says it started on the 2nd, so how do I access the previous 4?)

It's be happy to contribute if it's felt I have something to give, but it seems 
I can't even work out how to access the Calendar so perhaps I'm too stupid for 
Catalyst?

From: Len Jaffe [mailto:lenja...@jaffesystems.com]
Sent: 06 December 2012 17:11
To: John Napiorkowski; The elegant MVC web framework
Subject: Re: [Catalyst] Advent 2012 is launched!

Congratulations. I've added it into the Perl Advent Planet.
On Thu, Dec 6, 2012 at 9:19 AM, John Napiorkowski 
jjn1...@yahoo.commailto:jjn1...@yahoo.com wrote:
Just FYI,

If you have a moment to reblog 
(http://jjnapiorkowski.typepad.com/modern-perl/2012/12/catalyst-advent-2012-is-live.html)
 or tweat the calendar, etc. everything helps!

http://www.catalystframework.org/calendar

John

___
List: Catalyst@lists.scsys.co.ukmailto: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/



--
lenja...@jaffesystems.commailto:lenja...@jaffesystems.com   614-404-4214   
www.lenjaffe.comhttp://www.lenjaffe.com/
Proprietor: http://www.theycomewithcheese.com/ - An Homage to Fromage
Perl Advent Planethttp://www.lenjaffe.com/PerlAdventPlanet/ - Advent 
Calendars: Perlish and otherwise.
Greenbarhttp://www.greenbartraining.org/: Grubmaster: 2012-2009, Grub Asst: 
2008, Trained: 2007.


This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
___
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] Object / Application Instantiation User Requests

2012-11-16 Thread Craig Chant
Hi,

I'm trying to understand how Catalyst auto instantiates objects in your 
application such as models.

When a worker process is triggered, and the application is loaded, does that 
one process handle requests for all users of the application.

So for example is only one instance of a model instantiated that all users 
interact with as requests come in or is a new object or even application 
created for each user (I guess based on sessionid?)

I assume the context ($c) object is created for each request, but uses already 
instantiated model objects?

Help understanding when an object is instantiated by Catalyst and it's 
lifecycle is appreciated.

Regards,

Craig.


This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
___
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] Its time for Advent again

2012-11-16 Thread Craig Chant
 Examples of applications not using Template Toolkit or DBIx::Class

Please, Please, Please!

I'll say that again - Yes PLEASE!

Did I stress how much this is needed, YES PLEASE!!

Craig.

-Original Message-
From: John Napiorkowski [mailto:jjn1...@yahoo.com]
Sent: 16 November 2012 16:39
To: The elegant MVC web framework
Subject: [Catalyst] Its time for Advent again

Hey everyone,

Here's a copy of a blog post I did announcing calls for advent articles:

=

So last year wasn't the most spectacular Perl Catalyst Advent we've ever had.  
Lets see if we can do better this go around!  In order to assist, here's a few 
thoughts on simple articles you can do:
* Take any old article and modernize it...
* ...or show an alternative approach.
* Elaborate or improve on an idea you've previously written about in a 
blog, or that you read about in some else's blog.
* Cools things you can do now that Catalyst is Plack at the core.
* Alternatives to using the stash to pass data around.
* Examples of applications not using Template Toolkit or DBIx::Class
* Examples of using Catalyst with other frameworks such as Web-Simple and 
Web-Machine
* Examples of testing, especially anything using Behavior Driven techniques 
(think rspec or cucumber).
Alternatively we don't need tech oriented articles.  I'd be really happy to see 
some people write something from a business or planning perspective.  For 
example, if you are a CTO or person in planning, something about how you used 
Catalyst effectively to rapidly meet business goals would be very helpful.  Or 
if someone wanted to look at the results of the recent poll and perform some 
interesting analysis, I think the community would love to see that.
Lets get it rolling!

=

What I didn't announce via the blog is that if we don't get enough commitment, 
it would be better to not do a catalyst only advent article, and just combine 
our submissions over the one of the general Perl Advent calendars.

Having a poor showing in our advent calendar doesn't send the right message and 
it would be better to have a one or two in a popular and full calendar than a 
bunch of empty dates on ours.

Lets here your thoughts on the matter!

John

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

___
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 IIS7 Wiki Instructions

2012-11-09 Thread Craig Chant
Hi,

Don't know if this is the correct usage of the mailing list so I apologise now 
if it isn't.

As a thank you to the Catalyst community for all the help and support I have 
thus far received and as I promised to T0m as well as to help out MST, I have 
updated the Catalyst IIS7 Wiki page.

http://wiki.catalystframework.org/wiki/deployment/iis7_fastcgi

Not only have I replaced all the missing screen shots with new ones but also 
added additional information, made it more generic rather than 'Strawberry' 
Perl centric plus added  sub categories with further configuration information.

This will hopefully help others not struggle, as I did, when first setting up 
Catalyst on IIS7 Windows 2008 R2 environment and reduce the potential of stupid 
questions being asked on the mailing list or IRC.

Should you find any errors, omissions, inaccuracies or feel it could be 
improved in some way, please feel free to let me know and I will make any 
appropriate changes necessary.

I hope this helps the Catalyst community as well as others who wish to 
implement Catalyst over Windows / IIS7.

Kind regards,

Craig Chant
I.T. Manager
[Description: cid:image001.png@01CD5F4A.17E848D0]
Main Line01903 602664
Direct Line   01903 227753
Visit our website http://www.homeloanpartnership.com
HomeLoan Partnership have been named the Best Mortgage Network, 2012, at the 
myintroducer.com Industry Awards

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
inline: image001.png___
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 get view / template to work ?

2012-10-31 Thread Craig Chant
Sorry for the missing capital, and yes that's what I ran... also I'm sorry if I 
miss ready the tutorial, I have Dyspraxia.

Why would you have two -config statements and not all the setting in one 
-config , that makes no sense?

I did provide the output from the server plus debug screen?


-Original Message-
From: David Schmidt [mailto:davew...@gmx.at]
Sent: 30 October 2012 23:07
To: The elegant MVC web framework
Subject: Re: [Catalyst] Can't get view / template to work ?

On 31 October 2012 00:00, Tomas Doran bobtf...@bobtfish.net wrote:

 On 30 Oct 2012, at 16:52, Craig Chant wrote:

 I seem stuck with implementing my first view / template.

 I have a controller Login.pm

 I ran the view helper script ‘create view HTML HTML::template’


 This can't possibly have worked? You mean create view HTML HTML::Template 
 right?

 As per the tutorial I’ve added the following to the config section of 
 MyApp.pm

 TEMPLATE_EXTENSION = '.tp',

 This needs to be inside the following block

 'View::HTML' = {
 #Set the location for templates files
 INCLUDE_PATH = [
 __PACKAGE__-path_to( 'root', 'src' ),
 ],
 },

C::M::Tutorial says otherwise

http://search.cpan.org/~zarquon/Catalyst-Manual-5.9004/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod#Create_a_Catalyst_View



 I have created a template in ‘root/src/login’  of login.tp

 In my controller I have …

 sub login :Path :Args(0) {
 my ( $self, $c) = @_;

 $c-stash(template = 'login.tp');

 }

 But all I get is…


 No idea.


 What am I doing wrong?


 Not showing us the full debug output of starting the server and making the 
 request.

 Sorry to be harsh - but it's impossible to divine what code your app is 
 running without that output…

 Cheers
 t0m


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

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
___
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 get view / template to work ?

2012-10-31 Thread Craig Chant
You're misread what I put where?

It clearly states

Edit lib/MyApp/View/HTML.pm and you should see something similar to the 
following:

__PACKAGE__-config(
TEMPLATE_EXTENSION = '.tt',
render_die = 1,
);


And that's where I put the extension setting?

-Original Message-
From: Tomas Doran [mailto:bobtf...@bobtfish.net]
Sent: 30 October 2012 23:12
To: The elegant MVC web framework
Subject: Re: [Catalyst] Can't get view / template to work ?


On 30 Oct 2012, at 23:06, David Schmidt wrote:

 On 31 October 2012 00:00, Tomas Doran bobtf...@bobtfish.net wrote:

 On 30 Oct 2012, at 16:52, Craig Chant wrote:

 I seem stuck with implementing my first view / template.

 I have a controller Login.pm

 I ran the view helper script 'create view HTML HTML::template'


 This can't possibly have worked? You mean create view HTML HTML::Template 
 right?

 As per the tutorial I've added the following to the config section of 
 MyApp.pm

TEMPLATE_EXTENSION = '.tp',

 This needs to be inside the following block

'View::HTML' = {
#Set the location for templates files
INCLUDE_PATH = [
__PACKAGE__-path_to( 'root', 'src' ),
],
},

 C::M::Tutorial says otherwise

 http://search.cpan.org/~zarquon/Catalyst-Manual-5.9004/lib/Catalyst/Manual/Tutorial/03_MoreCatalystBasics.pod#Create_a_Catalyst_View


Sorry, but you're wrong.

The tutorial says:

Edit lib/MyApp/View/HTML.pm and you should see something similar to the 
following:

The OP says: As per the tutorial I've added the following to the config 
section of MyApp.pm

So, the OP has done something totally different to what the tutorial says, and 
thus it will behave differently.

If he moves that line to inside the View (as the tutorial suggests), it'll work.

If he moves it to inside the 'View::HTML' block in MyApp.pm, thus namespacing 
it into the appropriate component, it'll work.

Where it is right now - it will be ignored.

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

___
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] I'm loosing the plot here? - Controller behaviour that makes no sense

2012-10-31 Thread Craig Chant
Sorry IRC?

I did post the debug and output , has this email not been received?

-Original Message-
From: Tomas Doran [mailto:bobtf...@bobtfish.net]
Sent: 30 October 2012 22:26
To: The elegant MVC web framework
Subject: Re: [Catalyst] I'm loosing the plot here? - Controller behaviour that 
makes no sense


On 30 Oct 2012, at 20:08, Craig Chant wrote:

 The path/controller/action is resolving correctly now, but any response-body 
 change I make in the 'index :Path' action, isn't showing  when i refresh my 
 browser?

You're not showing us the debug output of the failing request, so it's very 
hard to help debug that request.

If you want this form of interactive help, you'd be much better off dropping 
into irc for interactive help, rather than the mailing list, which by it's 
nature is more asynchronous.

Hope to see you in irc!

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

___
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] Unable to output anything in Root.pm - 'auto'

2012-10-31 Thread Craig Chant
SQL injection by whom and how?

I can't get the template to work, and you think I've got user input set up?

I give up, it was I nice idea but I'm going no-where fast.

Thanks anyway.

-Original Message-
From: Tomas Doran [mailto:bobtf...@bobtfish.net]
Sent: 30 October 2012 22:22
To: The elegant MVC web framework
Subject: Re: [Catalyst] Unable to output anything in Root.pm - 'auto'


On 30 Oct 2012, at 12:00, Craig Chant wrote:

 What was the reason for not using DBIC again?

 The non-normalised DB with a  missing schema and the fact the data is spread 
 across two SQL servers on separate DSN's.


You didn't say anything there that didn't imply DBIC is fine.

The reason for not using DBIC again?

Also, your SQL abstraction has hilarious SQL injection holes - you do know 
about this, right?

 It's just before the return of the record set or count I was wondering if I 
 need to add '$sth-finish();' or '$dbh-disconnect();' - which I have in my 
 current (non-catalyst) app version of the class (module).

You're doing something wrong with DBI here!

 I also believe that DBIC gets all columns from all tables, which I don't 
 want, dunno, perhaps I'm missing something with DBIC, but I understand my 
 data the way I retrieve it and didn't think there was anything wrong with 
 using my SQL class, it has served me well for 10 years, and powers all my 
 current apps.

That's by default, and optional.

 One thing I have found already is the app doesn't seem to see real time SQL 
 updates even if I issue$sth-finish();$dbh-disconnect(); at the end 
 of my method.

 I make a manual change to SQL (switch the 'Locked' flag between 'yes'  'no') 
 , refresh the app and it isn't registering the SQL change, so already it 
 seems something is being cached somewhere and I need to stop this, my apps 
 need to see DB changes instantly.

Again, you're doing something wrong or insane here - this is not normal, so you 
must be asking for it somehow.

Cheers
t0m



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

___
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] I'm loosing the plot here? - Controller behaviour that makes no sense

2012-10-31 Thread Craig Chant
,
 }, 
Path::Class::File),
   ],
 },
  };
  $a-{root} = $a-{Plugin::Static::Simple}{include_path}[0];
  $a-{static} = $a-{Plugin::Static::Simple};
  $a;
}
Session ID

4993316017fd62789a4f17103e2e492dc4e2c464
Session

{ __created = 1351678589, __updated = 1351680670 }

HLP_Members on Catalyst 5.90015





-Original Message-
From: David Schmidt [mailto:davew...@gmx.at]
Sent: 31 October 2012 10:23
To: The elegant MVC web framework
Subject: Re: [Catalyst] I'm loosing the plot here? - Controller behaviour that 
makes no sense

Tomas asked for the debug output of the failing response.
You pasted only the server startup debug output.

On 31 October 2012 10:46, Craig Chant cr...@homeloanpartnership.com wrote:
 Sorry IRC?

 I did post the debug and output , has this email not been received?

 -Original Message-
 From: Tomas Doran [mailto:bobtf...@bobtfish.net]
 Sent: 30 October 2012 22:26
 To: The elegant MVC web framework
 Subject: Re: [Catalyst] I'm loosing the plot here? - Controller
 behaviour that makes no sense


 On 30 Oct 2012, at 20:08, Craig Chant wrote:

 The path/controller/action is resolving correctly now, but any 
 response-body change I make in the 'index :Path' action, isn't showing  
 when i refresh my browser?

 You're not showing us the debug output of the failing request, so it's very 
 hard to help debug that request.

 If you want this form of interactive help, you'd be much better off dropping 
 into irc for interactive help, rather than the mailing list, which by it's 
 nature is more asynchronous.

 Hope to see you in irc!

 Cheers
 t0m



 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive:
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/ This Email and any attachments
 contain confidential information and is intended solely for the individual to 
 whom it is addressed. If this Email has been misdirected, please notify the 
 author as soon as possible. If you are not the intended recipient you must 
 not disclose, distribute, copy, print or rely on any of the information 
 contained, and all copies must be deleted immediately. Whilst we take 
 reasonable steps to try to identify any software viruses, any attachments to 
 this e-mail may nevertheless contain viruses, which our anti-virus software 
 has failed to identify. You should therefore carry out your own anti-virus 
 checks before opening any documents. HomeLoan Partnership will not accept any 
 liability for damage caused by computer viruses emanating from any attachment 
 or other document supplied with this e-mail. HomeLoan Partnership reserves 
 the right to monitor and archive all e-mail communications through its 
 network. No representative or employee of HomeLoan Partnership has the 
 authority to enter into any contract on behalf of HomeLoan Partnership by 
 email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
 registered in England and Wales with Registration Number 5011722. Registered 
 office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
 authorised and regulated by the Financial Services Authority.

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

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter

RE: [Catalyst] Why is $c undefined?

2012-10-30 Thread Craig Chant
Thanks Ian,

The hierarchy is something that I am finding mind-blowing at the moment,
$self-jqgrid-render($self, , you are calling methods jqgrid-render on 
$self, passing in $self, I'm sure it makes sense to you :-)

One thing I would like clarification with if possible.

Where do I put code that requires the use of more than one model?

Do I create a separate model that acts as an interface between the other models?

You see I have two SQL servers in opposite ends of the country and so I have a 
model built on Model::DBI that can access one server and another Model that can 
access the other, but I have functionality that needs data from both , do some 
calculations and output accordingly.

I assume this does not go in the controller, but I create an interface model 
with the required methods and functionality that the controller uses?

Regards,

Craig.

-Original Message-
From: Ian Docherty [mailto:catal...@iandocherty.com]
Sent: 30 October 2012 07:22
To: The elegant MVC web framework
Subject: Re: [Catalyst] Why is $c undefined?

On 29 October 2012 21:01, Craig Chant cr...@homeloanpartnership.com wrote:
...

 I have read and seen frameworks such as Mojolicious encourage a shrinkage of 
 the Model and move alot of functionality to the Controller, so there is a 
 paradigm which seems to imply it is ok to do more stuff in the Controller, 
 but I am leaning towards having the main code in the Model and then bolting 
 it together via the Controller.

I can understand why you get this impression, I think a lot of people end up 
putting code in the Controller when they first start using MVC (I did so myself 
in the past).

The Model should be external to your Catalyst app (or whatever framework you 
use) so that you can use it in things like cron jobs. It also makes testing 
easier if your Model is separate from your Catalyst app. Look at using 
something like Catalyst::Model::Adaptor as a thin shell to add your external 
Model into Catalyst.

I am moving more and more into making my Controllers as thin as possible. Logic 
that I might have previously put into the Controller, I either put into the 
Model or I create helper functions. Here is an example of a Controller (from 
Mojolicious as it happens but that is not important)

sub user_list {
my ($self) = @_;

$self-jqgrid-render($self, {
rs  = $self-schema-resultset('User')-search_rs,
filters = {},
rows= [qw(id name)],
});
}

It's not important to know what is going on here, but this Controller gets a 
list of all users, formats the data for use in the jQuery jqGrid allows for 
sorting and filtering and outputs the data in JSON format. The point being, the 
controller code is kept simple and 'thin'
and yet it does a lot of work behind the scenes.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

___
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] Unable to output anything in Root.pm - 'auto'

2012-10-30 Thread Craig Chant
What was the reason for not using DBIC again?

The non-normalised DB with a  missing schema and the fact the data is spread 
across two SQL servers on separate DSN's.

I also want my data in a way I can manipulate it, maybe you are all going to 
fall down in shock and horror, but I get my records and pass them back as an 
array of hashes (recordset), I then play with them , manipulate them, and do 
all sorts of stuff with them.

ORM / DBIC doesn't seem to give you this type of access, it wants a DB schema 
with relationship mapping to dynamically create all the 1-many / many - many 
etc Models and relationships, which won't work with our system, from what I can 
tell.

This is my SQL helper class (well two methods as an example)

# Get SQL Routine
sub getSQL {

#_0 = Self
#_1 = Table
#_2 = Columns
#_3 = Where
#_4 = Order By

my ($self,$table,$columns,$where,$order) = @_;

# Build SQL Statement
my $sel = SELECT $columns FROM $table WHERE $where;

# Check for ORDER BY
if(defined $order){$sel .=  ORDER BY $order;}

# Connect
my $dbh = $self-dbh;

# set long read because SQL requires it for ODBC
$dbh-{LongReadLen} = 9;

# Run SQL Command
my $sth = $db-prepare($sel) || $self-sql_error(Error in getSQL (Web 
Server): $sel);
$sth-execute();

# Declare recordset array
my @rs;

# Loop SQL  build recordset
while (my $ref = $sth-fetchrow_hashref()) {
# Build Array of Hashes with SQL Data
$rs[@rs] = \%$ref;
}

# Return record set
@rs;

}

# Count SQL Routine
sub cntSQL {

#_0 = Self
#_1 = Table
#_2 = Where

my ($self,$table,$where) = @_;

#Build SQL Statement
my $sel = SELECT COUNT(1) as COUNT FROM $table WHERE $where;

# Connect
my $dbh = $self-dbh;

# Run SQL Command
my $sth = $dbh-prepare($sel) || $self-sql_error(Error in getSQL (Web 
Server): $sel);
$sth-execute();

# Loop SQL Record Set
while (my $ref = $sth-fetchrow_hashref()) {
# Build Array of Hashes with SQL Data
$rs[@rs] = \%$ref;
}

# Return Count
   $rs[0]-{'COUNT'};

}

It's just before the return of the record set or count I was wondering if I 
need to add '$sth-finish();' or '$dbh-disconnect();' - which I have in my 
current (non-catalyst) app version of the class (module).

I also believe that DBIC gets all columns from all tables, which I don't want, 
dunno, perhaps I'm missing something with DBIC, but I understand my data the 
way I retrieve it and didn't think there was anything wrong with using my SQL 
class, it has served me well for 10 years, and powers all my current apps.

How would I use DBIC to get records from two separate DSN's and merge 
recordsets?

In my concrete Catalyst::Model I have...

# Check if system locked
if($self-cntSQL('IsLock',Locked='yes')){
$c-response-body('pSorry, system is currently undergoing 
maintenance./ppPlease try again later./p' );
return 1;
}

One thing I have found already is the app doesn't seem to see real time SQL 
updates even if I issue$sth-finish();$dbh-disconnect(); at the end 
of my method.

I make a manual change to SQL (switch the 'Locked' flag between 'yes'  'no') , 
refresh the app and it isn't registering the SQL change, so already it seems 
something is being cached somewhere and I need to stop this, my apps need to 
see DB changes instantly.

Your advice is appreciated.

Craig.

-Original Message-
From: Rob Brown [mailto:r...@intelcompute.com]
Sent: 29 October 2012 22:30
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Unable to output anything in Root.pm - 'auto'

basically...

$sth-finish if you've finished with the results of that statement, ie, you've 
looped through the rows and are now done.

$dbh-disconnect if you've finished with the database connection, tho now you 
start to think about working in a persistent environment, where you may never 
disconnect from the database, and/or have some connection caching setup.

This is where DBIx::Class just takes of all this for you - it does sound like 
you're re-inventing a lot here.

What was the reason for not using DBIC again?




On 10/29/2012 10:10 PM, Craig Chant wrote:
 I finally got to grips with extending my own class with the inbuilt $c-dbh.

 But am unsure whether I am mean to issue either...

  $sth-finish();

  or

 $dbh-disconnect();

 Once I have prepared / executed the SQL and fetched the records I want.

 so a little further guidance is appreciated.

 Craig

 
 From: Lukas Thiemeier [spamcatc...@thiemeier.net]
 Sent: 29 October 2012 20:16
 To: catalyst@lists.scsys.co.uk
 Subject: Re: [Catalyst] Unable to output anything in Root.pm -  'auto'

 Hi Craig,

 Using C::M::DBI is straight forward. Install it from cpan, and run

script/yourapp.pl create model DBI DBI dsn user password

 where dsn is sth like dbi:mysql:dbname

[Catalyst] Global 'helper' methods

2012-10-30 Thread Craig Chant
Hi,

Please could you advise the best way of having a global 'helper' class that has 
all commonly used methods in it accessible for any part of the catalyst app.

I found this thread 
http://stackoverflow.com/questions/11941836/catalyst-global-subroutines

With one indicating it's ok to put them in the main MyApp.pm and another saying 
to use Moose  Roles.

What is considered the correct way and could you provide an example of how I 
create this helper class and bolt it to the Catalyst application.

Many thanks,

Craig Chant
I.T. Manager
[Description: cid:image001.png@01CD5F4A.17E848D0]
Main Line01903 602664
Direct Line   01903 227753
Visit our website http://www.homeloanpartnership.com
HomeLoan Partnership have been named the Best Mortgage Network, 2012, at the 
myintroducer.com Industry Awards

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
inline: image001.png___
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] Global 'helper' methods

2012-10-30 Thread Craig Chant
Well I opted for putting my globals (methods and constants) in MyApp.pm

It's working grand with $c-myMethod or $c-MY_CONSTANT

I use to have them working as a bareword within my application , but 
$c-MY_CONSTANT is just as easy!

Many thanks for all the input and help, it really is appreciated.

-Original Message-
From: Lukas Thiemeier [mailto:spamcatc...@thiemeier.net]
Sent: 30 October 2012 13:56
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Global 'helper' methods

Hi Craig,

Writing helpers in your main App.pm and using roles is not either-or.

Roles are one possibility to modify your classes in a reusable way.

If your helpers are really global, which means that they are used by all, or 
almost all your controllers, I would put them into your main application class.

If you have more than one application which make use of the same
helpers: Put them into a role:

YourHelperRole.pm:

  package YourHelperRole;
  use Moose::Role;

  has some_attribute = ( ... ); # if you need attributes

  sub helpermethod1{
my ($self, $other, $args) = @_;
do_something();
  }

  sub helpermethod2{
my ($self, $other, $args) = @_;
do_something_different();
  }

  no Moose::Role; # or use namespace::autoclean or MooseX::MarkAsMethod
  1;

App.pm:

  use Catalyst qw( ... );
  extends Catalyst;
  with qw/YourHelperRole/;

  ...

In my opinion, extending your main App.pm with roles is only useful if you need 
the same helpers in different locations, too.
If you only need them for that single application,  avoid the overhead related 
to using roles.

If you have helpers which are only needed by some controllers, create a role 
for your controllers. You can not only implement helpers in you roles, you can 
also create method-modifiers, which change the way your methods behave.

Here is an example, which writes sth to the log, after the delete
method was called:

YourLogRole.pm:

  package YourLogRole;

  use Moose::Role;
  requires qw/delete/; #die if the consuming class has no delete

  after delete = sub{
my ($self, $c) = @_;
$c-log-debug(DELETE called);
  };

  no Moose::Role;
  1;

Controller1.pm: (has the helpers, but no logging)

  package Controller1;
  use Moose;
  extends Catalyst::Controller;
  with qw/
YourHelperRole
  /;

  sub someaction :Local {
my ($self, $c) =@_;
$self-helpermethod1();
  }

  ...

Controller2.pm: (has helpers AND logging)

  package Controller2;
  use Moose;
  extends Catalyst::Controller;
  with qw/
YourLogRole
YourHelperRole
  /;

  sub delete :Local :Args(1) { ... }

Controller3.pm (has logging, but no helpers)

  package Controller3;
  use Moose;
  extends Catalyst::Controller;
  with qw/
YourLogRole
  /;

  sub delete :Local :Args(1) { ... }

Roles are very powerful tools. I use them a lot.
Read the Moose docs for more information.

If you don't want to learn Moose, roles and so on now, just remember:

1. write sth in a role
2. consume the role in a moose class, using with
3. your roles methods and attributes will be available in the consuming class

Lukas

On 10/30/2012 02:03 PM, Craig Chant wrote:
 Hi,



 Please could you advise the best way of having a global 'helper' class
 that has all commonly used methods in it accessible for any part of
 the catalyst app.



 I found this thread
 http://stackoverflow.com/questions/11941836/catalyst-global-subroutine
 s



 With one indicating it's ok to put them in the main MyApp.pm and
 another saying to use Moose  Roles.



 What is considered the correct way and could you provide an example of
 how I create this helper class and bolt it to the Catalyst application.



 Many thanks,



 */Craig Chant/*

 I.T. Manager

 Description: cid:image001.png@01CD5F4A.17E848D0

 Main Line01903 602664

 Direct Line   01903 227753

 Visit our website http://www.homeloanpartnership.com

 *HomeLoan Partnership have been named the Best Mortgage Network, 2012,
 at the myintroducer.com Industry Awards*



 This Email and any attachments contain confidential information and is
 intended solely for the individual to whom it is addressed. If this
 Email has been misdirected, please notify the author as soon as
 possible. If you are not the intended recipient you must not disclose,
 distribute, copy, print or rely on any of the information contained,
 and all copies must be deleted immediately. Whilst we take reasonable
 steps to try to identify any software viruses, any attachments to this
 e-mail may nevertheless contain viruses, which our anti-virus software
 has failed to identify. You should therefore carry out your own
 anti-virus checks before opening any documents. HomeLoan Partnership
 will not accept any liability for damage caused by computer viruses
 emanating from any attachment or other document supplied with this e-mail.
 HomeLoan Partnership reserves the right to monitor and archive all
 e-mail communications through its

RE: [Catalyst] Global 'helper' methods

2012-10-30 Thread Craig Chant
Thanks Lukas,

I appreciate there is DateTime , though I have so much legacy code that uses my 
helper class re-writing everything will be a mammoth task.

I hand rolled a lot when I first started out with Perl, didn't know much about 
CPAN or PPM, and couldn't load any modules that weren't part of the core 
install on the original 'shared' hosting I was using.

Plus I always felt loading an entire module to re-arrange a tiny string seems a 
bit OTT?

Dunno, what's the overhead of DateTime?

Craig.

-Original Message-
From: Lukas Thiemeier [mailto:spamcatc...@thiemeier.net]
Sent: 30 October 2012 14:52
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Global 'helper' methods

You can also define your constants in YourApp/Constants.pl, and use
YourApp::Constants wherever you need them.

YourApp/Constants.pm:
  use constant { FOO = 1 };
  1;

Controller.pm:

  use YourApp::Constants;

  # and in some method
  ...
  my $global_foo = FOO;

There might be a better way, but this works...

For handling dates, I recommend DateTime, available on cpan:

Another reason to use DBIC:
DBIx::Class::Inflatecolumn::DateTime automatically transforms dates stored in a 
database into a DateTime object, which can be used like this:

my $uk_string = $datetime-dmy('/');
my $us_string = $datetime-ymd('-');

But DateTime is not related to DBIC, DBIC just makes using it easy.

Use it if you have to work with dates a lot. It has lots of methods for 
outputting dates, times or both in different formats, and it allows 
datetime-math...


On 10/30/2012 03:39 PM, Craig Chant wrote:
 Well I opted for putting my globals (methods and constants) in
 MyApp.pm

 It's working grand with $c-myMethod or $c-MY_CONSTANT

 I use to have them working as a bareword within my application , but 
 $c-MY_CONSTANT is just as easy!

 Many thanks for all the input and help, it really is appreciated.

 -Original Message-
 From: Lukas Thiemeier [mailto:spamcatc...@thiemeier.net]
 Sent: 30 October 2012 13:56
 To: catalyst@lists.scsys.co.uk
 Subject: Re: [Catalyst] Global 'helper' methods

 Hi Craig,

 Writing helpers in your main App.pm and using roles is not either-or.

 Roles are one possibility to modify your classes in a reusable way.

 If your helpers are really global, which means that they are used by all, or 
 almost all your controllers, I would put them into your main application 
 class.

 If you have more than one application which make use of the same
 helpers: Put them into a role:

 YourHelperRole.pm:

   package YourHelperRole;
   use Moose::Role;

   has some_attribute = ( ... ); # if you need attributes

   sub helpermethod1{
 my ($self, $other, $args) = @_;
 do_something();
   }

   sub helpermethod2{
 my ($self, $other, $args) = @_;
 do_something_different();
   }

   no Moose::Role; # or use namespace::autoclean or MooseX::MarkAsMethod
   1;

 App.pm:

   use Catalyst qw( ... );
   extends Catalyst;
   with qw/YourHelperRole/;

   ...

 In my opinion, extending your main App.pm with roles is only useful if you 
 need the same helpers in different locations, too.
 If you only need them for that single application,  avoid the overhead 
 related to using roles.

 If you have helpers which are only needed by some controllers, create a role 
 for your controllers. You can not only implement helpers in you roles, you 
 can also create method-modifiers, which change the way your methods behave.

 Here is an example, which writes sth to the log, after the delete
 method was called:

 YourLogRole.pm:

   package YourLogRole;

   use Moose::Role;
   requires qw/delete/; #die if the consuming class has no delete

   after delete = sub{
 my ($self, $c) = @_;
 $c-log-debug(DELETE called);
   };

   no Moose::Role;
   1;

 Controller1.pm: (has the helpers, but no logging)

   package Controller1;
   use Moose;
   extends Catalyst::Controller;
   with qw/
 YourHelperRole
   /;

   sub someaction :Local {
 my ($self, $c) =@_;
 $self-helpermethod1();
   }

   ...

 Controller2.pm: (has helpers AND logging)

   package Controller2;
   use Moose;
   extends Catalyst::Controller;
   with qw/
 YourLogRole
 YourHelperRole
   /;

   sub delete :Local :Args(1) { ... }

 Controller3.pm (has logging, but no helpers)

   package Controller3;
   use Moose;
   extends Catalyst::Controller;
   with qw/
 YourLogRole
   /;

   sub delete :Local :Args(1) { ... }

 Roles are very powerful tools. I use them a lot.
 Read the Moose docs for more information.

 If you don't want to learn Moose, roles and so on now, just remember:

 1. write sth in a role
 2. consume the role in a moose class, using with
 3. your roles methods and attributes will be available in the
 consuming class

 Lukas

 On 10/30/2012 02:03 PM, Craig Chant wrote:
 Hi,



 Please could you advise the best way of having a global 'helper'
 class that has all commonly used methods

RE: [Catalyst] Global 'helper' methods

2012-10-30 Thread Craig Chant
Hi Hugh,

I assume this is for Apache and I'm running IIS7, so I guess it isn't 
compatible?

It looks like I've been having performance problems because millions of rows 
get blessed into objects, not sure of this but it looks like a DBIC thing at 
the moment.

That's not good, and is part of the issue of ORM (so I've read),  I'm not as 
old as you, but I'm still old school, get only the columns and rows you need 
when you need them, well that's my take on it and it seems to work for me.

Regards,

Craig.

From: Hugh Barnard [mailto:hugh.barn...@gmail.com]
Sent: 30 October 2012 15:47
To: The elegant MVC web framework
Subject: Re: [Catalyst] Global 'helper' methods

Hi

On measurement in general, I'd recommend: Devel::NYTProf::Apache ; there's a 
write up here:
http://www.slideshare.net/bobcatfish/profiling-with-develnytprof

I'm dealing with a largish Catalyst/mod_perl thing at the moment and it's been 
tremendously helpful. One tip is that it is very picky about closing the files 
that it needs to compile the profiles, I write these into /tmp and then crunch 
them with the command line tools.

Incidentally, I am 62 and therefore pretty old-skool and not mad for 
ORM-everywhere. It looks like I've been having performance problems because 
millions of rows get blessed into objects, not sure of this but it looks like a 
DBIC thing at the moment. Currently I've 'cursor'-ed them:
  my $cursor = $entries-cursor;
  while ( my @row_values = $cursor-next ) {
and that seems to give some improvements in that area...

Best regards Hugh
On 30 October 2012 15:24, Lukas Thiemeier 
spamcatc...@thiemeier.netmailto:spamcatc...@thiemeier.net wrote:
Hm... how to measure the overhead of a module?

There is a XS version of the module which is used if you have a C
compiler. I don't know the exact overhead, but I know that it is fast.

I have no experience with the pure perl version of that module.

If all you have to do with the dates is the simple string transformation
you are right. As I said before: I recommend to use DT if you are
working with dates a lot. Doing math on dates and times is annoying,
because of leap years, epochs, timezones and so on. If you need this:
Using DateTime is recommended. If not: Its not :)

If you are ONLY using pure perl modules:
You can include all required modules in your distribution. It should run
on any perl installation, even in a shared host environment.

App::FatPacker helps you doing this...

But this doesn't work as soon as you use XS modules.

On 10/30/2012 04:03 PM, Craig Chant wrote:
 Thanks Lukas,

 I appreciate there is DateTime , though I have so much legacy code that uses 
 my helper class re-writing everything will be a mammoth task.

 I hand rolled a lot when I first started out with Perl, didn't know much 
 about CPAN or PPM, and couldn't load any modules that weren't part of the 
 core install on the original 'shared' hosting I was using.

 Plus I always felt loading an entire module to re-arrange a tiny string seems 
 a bit OTT?

 Dunno, what's the overhead of DateTime?

 Craig.

 -Original Message-
 From: Lukas Thiemeier 
 [mailto:spamcatc...@thiemeier.netmailto:spamcatc...@thiemeier.net]
 Sent: 30 October 2012 14:52
 To: catalyst@lists.scsys.co.ukmailto:catalyst@lists.scsys.co.uk
 Subject: Re: [Catalyst] Global 'helper' methods

 You can also define your constants in YourApp/Constants.pl, and use
 YourApp::Constants wherever you need them.

 YourApp/Constants.pm:
   use constant { FOO = 1 };
   1;

 Controller.pm:

   use YourApp::Constants;

   # and in some method
   ...
   my $global_foo = FOO;

 There might be a better way, but this works...

 For handling dates, I recommend DateTime, available on cpan:

 Another reason to use DBIC:
 DBIx::Class::Inflatecolumn::DateTime automatically transforms dates stored in 
 a database into a DateTime object, which can be used like this:

 my $uk_string = $datetime-dmy('/');
 my $us_string = $datetime-ymd('-');

 But DateTime is not related to DBIC, DBIC just makes using it easy.

 Use it if you have to work with dates a lot. It has lots of methods for 
 outputting dates, times or both in different formats, and it allows 
 datetime-math...


 On 10/30/2012 03:39 PM, Craig Chant wrote:
 Well I opted for putting my globals (methods and constants) in
 MyApp.pm

 It's working grand with $c-myMethod or $c-MY_CONSTANT

 I use to have them working as a bareword within my application , but 
 $c-MY_CONSTANT is just as easy!

 Many thanks for all the input and help, it really is appreciated.

 -Original Message-
 From: Lukas Thiemeier 
 [mailto:spamcatc...@thiemeier.netmailto:spamcatc...@thiemeier.net]
 Sent: 30 October 2012 13:56
 To: catalyst@lists.scsys.co.ukmailto:catalyst@lists.scsys.co.uk
 Subject: Re: [Catalyst] Global 'helper' methods

 Hi Craig,

 Writing helpers in your main App.pm and using roles is not either-or.

 Roles are one possibility to modify your classes in a reusable way.

 If your helpers are really

[Catalyst] Can't get view / template to work ?

2012-10-30 Thread Craig Chant
I seem stuck with implementing my first view / template.

I have a controller Login.pm

I ran the view helper script 'create view HTML HTML::template'

As per the tutorial I've added the following to the config section of MyApp.pm

TEMPLATE_EXTENSION = '.tp',
'View::HTML' = {
#Set the location for templates files
INCLUDE_PATH = [
__PACKAGE__-path_to( 'root', 'src' ),
],
},

I have created a template in 'root/src/login'  of login.tp

In my controller I have ...

sub login :Path :Args(0) {
my ( $self, $c) = @_;

$c-stash(template = 'login.tp');

}

But all I get is...

Caught exception in Members::View::HTML-process HTML::Template-new() : 
Cannot open included file login.tp : file not found. at 
C:/Perl/lib/HTML/Template.pm line 1813

I've also tried..

$c-stash(template = 'login');
$c-stash(template = 'login/login');
$c-stash(template = 'login/login.tp');

None of which seem to work?

What am I doing wrong?

Craig Chant
I.T. Manager
[Description: cid:image001.png@01CD5F4A.17E848D0]
Main Line01903 602664
Direct Line   01903 227753
Visit our website http://www.homeloanpartnership.com
HomeLoan Partnership have been named the Best Mortgage Network, 2012, at the 
myintroducer.com Industry Awards

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
inline: image001.png___
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 get view / template to work ?

2012-10-30 Thread Craig Chant
Hi Rob,

As I said, I've tried that also to no avail :-(

I thought the point of setting the template default extension is so you don't 
have to provide it?

Shouldn't 'login/login' work?

I can't even get the controller to work?

mydomain:port/login/login  just gives me a 404 not found error?

Shouldn't

 sub login :Local :Args(0) {
my ( $self, $c) = @_;

$c-stash(template = 'login');
}

Map to mydomain:port/login/login

Why do seem to be going no-where fast with Catalyst?

Craig.

-Original Message-
From: Rob Brown [mailto:r...@intelcompute.com]
Sent: 30 October 2012 16:58
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Can't get view / template to work ?

the paths are from /root/src (as per the config), so if you've created another 
folder called login and put the file in there, you'd need to say...

$c-stash(template = 'login/login.tp');


On 10/30/2012 04:52 PM, Craig Chant wrote:
 I seem stuck with implementing my first view / template.

 I have a controller Login.pm

 I ran the view helper script 'create view HTML HTML::template'

 As per the tutorial I've added the following to the config section of
 MyApp.pm

 TEMPLATE_EXTENSION = '.tp',

 'View::HTML' = {

 #Set the location for templates files

 INCLUDE_PATH = [

 __PACKAGE__-path_to( 'root', 'src' ),

 ],

 },

 I have created a template in 'root/src/login' of login.tp

 In my controller I have ...

 sub login :Path :Args(0) {

 my ( $self, $c) = @_;

 $c-stash(template = 'login.tp');

 }

 But all I get is...

 Caught exception in Members::View::HTML-process
 HTML::Template-new()
 : Cannot open included file login.tp : file not found. at
 C:/Perl/lib/HTML/Template.pm line 1813

 I've also tried..

 $c-stash(template = 'login');

 $c-stash(template = 'login/login');

 $c-stash(template = 'login/login.tp');

 None of which seem to work?

 What am I doing wrong?

 */Craig Chant/*

 I.T. Manager

 Description: cid:image001.png@01CD5F4A.17E848D0

 Main Line 01903 602664

 Direct Line 01903 227753

 Visit our website http://www.homeloanpartnership.com

 *HomeLoan Partnership have been named the Best Mortgage Network, 2012,
 at the myintroducer.com Industry Awards*

 This Email and any attachments contain confidential information and is
 intended solely for the individual to whom it is addressed. If this
 Email has been misdirected, please notify the author as soon as
 possible. If you are not the intended recipient you must not disclose,
 distribute, copy, print or rely on any of the information contained,
 and all copies must be deleted immediately. Whilst we take reasonable
 steps to try to identify any software viruses, any attachments to this
 e-mail may nevertheless contain viruses, which our anti-virus software
 has failed to identify. You should therefore carry out your own
 anti-virus checks before opening any documents. HomeLoan Partnership
 will not accept any liability for damage caused by computer viruses
 emanating from any attachment or other document supplied with this e-mail.
 HomeLoan Partnership reserves the right to monitor and archive all
 e-mail communications through its network. No representative or
 employee of HomeLoan Partnership has the authority to enter into any
 contract on behalf of HomeLoan Partnership by email. HomeLoan
 Partnership is a trading name of H L Partnership Limited, registered
 in England and Wales with Registration Number 5011722. Registered
 office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is
 authorised and regulated by the Financial Services Authority.



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

--
IntelCompute
Web Design  Online Marketing Experts

http://www.intelcompute.com

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other

RE: [Catalyst] I'm loosing the plot here? - Controller behaviour that makes no sense

2012-10-30 Thread Craig Chant
I've done the tutorial Debian VM walkthrough.



I stopped at DBIC / CRUD, and I keep referring back to the tutorial, but it's 
very hard to follow when it is using examples for a templating system / ORM / 
CRUD and OS i'm not using.



I'm also convinced there is a caching issue, how can I refresh the browser on a 
controller/action i've changed the response-body of and still get the old 
output?



Please advise if there is some form of caching in Catalyst so I can turn it off.



I'm still unable to get the template to work, regardless of what I call it!



here is the output from the server..



[debug] Debug messages enabled
[debug] Statistics enabled
[debug] Loaded plugins:
..
| Catalyst::Plugin::ConfigLoader  0.30   |
| Catalyst::Plugin::Session  0.35|
| Catalyst::Plugin::Session::State::Cookie  0.17 |
| Catalyst::Plugin::Session::Store::FastMmap  0.16   |
| Catalyst::Plugin::StackTrace  0.11 |
''

[debug] Loaded dispatcher Catalyst::Dispatcher
[debug] Loaded engine Catalyst::Engine
[debug] Found home C:\Websites\members
[debug] Loaded Config C:\Websites\members\members.conf
[debug] Session Store file: C:\Users\admin\AppData\Local\Temp\1\members\
ession_data
[debug] Loaded components:
.-+--.
| Class   | Type |
+-+--+
| Members::Controller::Login  | instance |
| Members::Controller::Root   | instance |
| Members::Model::DBI | instance |
| Members::Model::Members | instance |
| Members::Model::Sql | class|
| Members::View::HTML | instance |
'-+--'

[debug] Loaded Private actions:
.--+--+--.
| Private  | Class| Method   |
+--+--+--+
| /default | Members::Controller::Root| default  |
| /end | Members::Controller::Root| end  |
| /index   | Members::Controller::Root| index|
| /begin   | Members::Controller::Root| begin|
| /login/index | Members::Controller::Login   | index|
| /login/login | Members::Controller::Login   | login|
'--+--+--'

[debug] Loaded Path actions:
.-+--.
| Path| Private  |
+-+--+
| /   | /index   |
| /...| /default |
| /login/ | /login/index |
| /login/login/   | /login/login |
'-+--'

[info] HLP_Members powered by Catalyst 5.90015
HTTP::Server::PSGI: Accepting connections at http://0:3000/



The path/controller/action is resolving correctly now, but any response-body 
change I make in the 'index :Path' action, isn't showing  when i refresh my 
browser?



And I still cannot get the template to work?



How do I find out where it thinks the template should be?


From: Tim Anderson [tja...@gmail.com]
Sent: 30 October 2012 17:57
To: The elegant MVC web framework
Subject: Re: [Catalyst] I'm loosing the plot here? - Controller behaviour that 
makes no sense

Craig,

Might I suggest following Lukas' advice from yesterday and working through the 
tutorial before building your own site.  Catalyst is a great framework but it's 
not trivial, and I had several of the same kinds of questions when I first 
started out.

I clued in on your 'when neither output should show' statement; what are you 
expecting from 'mydomain:port/login' in your example.  It looks to me like 
/login should be matching your Login controller, and because you haven't 
specified a further path, your output is going to be 'this sucks', from the 
index function.

-Tim

snip

This Email and any 

RE: [Catalyst] I'm loosing the plot here? - Controller behaviour that makes no sense

2012-10-30 Thread Craig Chant
I had a hunch, so I uploaded the template to 'root' and bingo it found it



so this in MyApp.pm isn't working...



'View::HTML' = {
#Set the location for TT files
INCLUDE_PATH = [
__PACKAGE__-path_to( 'root', 'src' ),
],
}



So does this attribute only work for TT template tool kit?



What's the flag for HTML::Template ? (this is the problem I'm having trying to 
follow the tutorial!!!)



Also I now get the following error



Caught exception in Members::View::HTML-process HTML::Template : Attempt to 
set nonexistent parameter 'base' - this parameter name doesn't match any 
declarations in the template file : (die_on_bad_params = 1) at 
C:/Perl/site/lib/Catalyst/View/HTML/Template.pm line 99



This is what I have in my HTML View...



package Members::View::HTML;

use strict;
use base 'Catalyst::View::HTML::Template';

__PACKAGE__-config(
TEMPLATE_EXTENSION = '.tp',
render_die = 1,
);

1;

So how do I set the path for templates when using HTML::Template, why is it 
falling over with the auto generated code in the View? And why isn't the 
browser showing changed content when refreshed?




From: Craig Chant [cr...@homeloanpartnership.com]
Sent: 30 October 2012 20:08
To: The elegant MVC web framework
Subject: RE: [Catalyst] I'm loosing the plot here? - Controller behaviour that 
makes no sense


I've done the tutorial Debian VM walkthrough.



I stopped at DBIC / CRUD, and I keep referring back to the tutorial, but it's 
very hard to follow when it is using examples for a templating system / ORM / 
CRUD and OS i'm not using.



I'm also convinced there is a caching issue, how can I refresh the browser on a 
controller/action i've changed the response-body of and still get the old 
output?



Please advise if there is some form of caching in Catalyst so I can turn it off.



I'm still unable to get the template to work, regardless of what I call it!



here is the output from the server..



[debug] Debug messages enabled
[debug] Statistics enabled
[debug] Loaded plugins:
..
| Catalyst::Plugin::ConfigLoader  0.30   |
| Catalyst::Plugin::Session  0.35|
| Catalyst::Plugin::Session::State::Cookie  0.17 |
| Catalyst::Plugin::Session::Store::FastMmap  0.16   |
| Catalyst::Plugin::StackTrace  0.11 |
''

[debug] Loaded dispatcher Catalyst::Dispatcher
[debug] Loaded engine Catalyst::Engine
[debug] Found home C:\Websites\members
[debug] Loaded Config C:\Websites\members\members.conf
[debug] Session Store file: C:\Users\admin\AppData\Local\Temp\1\members\
ession_data
[debug] Loaded components:
.-+--.
| Class   | Type |
+-+--+
| Members::Controller::Login  | instance |
| Members::Controller::Root   | instance |
| Members::Model::DBI | instance |
| Members::Model::Members | instance |
| Members::Model::Sql | class|
| Members::View::HTML | instance |
'-+--'

[debug] Loaded Private actions:
.--+--+--.
| Private  | Class| Method   |
+--+--+--+
| /default | Members::Controller::Root| default  |
| /end | Members::Controller::Root| end  |
| /index   | Members::Controller::Root| index|
| /begin   | Members::Controller::Root| begin|
| /login/index | Members::Controller::Login   | index|
| /login/login | Members::Controller::Login   | login|
'--+--+--'

[debug] Loaded Path actions:
.-+--.
| Path| Private  |
+-+--+
| /   | /index   |
| /...| /default |
| /login/ | /login

[Catalyst] Unable to output anything in Root.pm - 'auto'

2012-10-29 Thread Craig Chant
Hi,

I seem to be going round in circles unable to get Catalyst to output anything 
via 'auto'?

I made a change to the Root.pm to try to add authentication via the 'auto' 
method, but it does nothing?

# always runs first!
sub auto :Private {
my ( $self, $c ) = @_;

# Authenticate
$c-response-body('Matched Members::Controller::Auto in Root.' . 
$c-sessionid);

}

This doesn't output anything and I simply get the welcome screen, plus there is 
a warning in the devel server output of

Use of uninitialized value in concatenation (.) or string

I have ..

use Catalyst qw/
-Debug
ConfigLoader
Static::Simple
StackTrace
Session
Session::Store::FastMmap
Session::State::Cookie
/;

In my main MyApp.pm

Why is $c-response-body not working and why is the sessionid empty?

Thanks

Craig Chant
I.T. Manager
[Description: cid:image001.png@01CD5F4A.17E848D0]
Main Line01903 602664
Direct Line   01903 227753
Visit our website http://www.homeloanpartnership.com
HomeLoan Partnership have been named the Best Mortgage Network, 2012, at the 
myintroducer.com Industry Awards

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
inline: image001.png___
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] Unable to output anything in Root.pm - 'auto'

2012-10-29 Thread Craig Chant
Nope, no change; same warning in the devel output and all that happens is the  
welcome screen loads?

From: Ben Vinnerd [mailto:ben+catal...@vinnerd.com]
Sent: 29 October 2012 14:48
To: The elegant MVC web framework
Subject: Re: [Catalyst] Unable to output anything in Root.pm - 'auto'

Private methods have to return a true value to continue processing.

Try adding return 1 at the end of the method.

Ben

On 29 October 2012 14:23, Craig Chant 
cr...@homeloanpartnership.commailto:cr...@homeloanpartnership.com wrote:
Hi,

I seem to be going round in circles unable to get Catalyst to output anything 
via ‘auto’?

I made a change to the Root.pm to try to add authentication via the ‘auto’ 
method, but it does nothing?

# always runs first!
sub auto :Private {
my ( $self, $c ) = @_;

# Authenticate
$c-response-body('Matched Members::Controller::Auto in Root.' . 
$c-sessionid);

}

This doesn’t output anything and I simply get the welcome screen, plus there is 
a warning in the devel server output of

“Use of uninitialized value in concatenation (.) or string”

I have ..

use Catalyst qw/
-Debug
ConfigLoader
Static::Simple
StackTrace
Session
Session::Store::FastMmap
Session::State::Cookie
/;

In my main MyApp.pm

Why is $c-response-body not working and why is the sessionid empty?

Thanks

Craig Chant
I.T. Manager
[Description: cid:image001.png@01CD5F4A.17E848D0]
Main Line01903 602664tel:01903%20602664
Direct Line   01903 227753tel:01903%20227753
Visit our website http://www.homeloanpartnership.com
HomeLoan Partnership have been named the Best Mortgage Network, 2012, at the 
myintroducer.comhttp://myintroducer.com Industry Awards

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

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

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
inline: image001.png___
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

RE: [Catalyst] Unable to output anything in Root.pm - 'auto'

2012-10-29 Thread Craig Chant
Oh I also tried changing it to ‘begin’ instead of ‘auto’, still doesn’t work?

I also thought that all calls to ANY method / sub will always be passed $self  
$c , only it doesn’t seem to be passing in $c and I’ve had to manually do it?

I’ve tried…

# always runs first!
sub begin :Private {
my ( $self, $c ) = @_;

# Authenticate
$self-AuthenticateUser($c);
return 1;

}

sub AuthenticateUser {

my ( $self, $c ) = @_;

die 'Session ID = ' . $c-sessionid;

}

But there is no session ID.

I am still getting the “Use of uninitialized value in concatenation (.) or 
string”  error.

I’ve read 
http://search.cpan.org/~mramberg/Catalyst-Plugin-Session-0.14/lib/Catalyst/Plugin/Session/Tutorial.pod


Where it states :  These plugins will automatically set $c-sessionid at the 
begining of the request, and automatically cause $c-sessionid to be saved by 
the client at the end of the request.
So why is $c-sessionid uninitialized?

Any ideas where my session info is?

Thanks,

Craig

From: Craig Chant [mailto:cr...@homeloanpartnership.com]
Sent: 29 October 2012 14:54
To: The elegant MVC web framework
Subject: RE: [Catalyst] Unable to output anything in Root.pm - 'auto'

Nope, no change; same warning in the devel output and all that happens is the  
welcome screen loads?

From: Ben Vinnerd 
[mailto:ben+catal...@vinnerd.com]mailto:[mailto:ben+catal...@vinnerd.com]
Sent: 29 October 2012 14:48
To: The elegant MVC web framework
Subject: Re: [Catalyst] Unable to output anything in Root.pm - 'auto'

Private methods have to return a true value to continue processing.

Try adding return 1 at the end of the method.

Ben
On 29 October 2012 14:23, Craig Chant 
cr...@homeloanpartnership.commailto:cr...@homeloanpartnership.com wrote:
Hi,

I seem to be going round in circles unable to get Catalyst to output anything 
via ‘auto’?

I made a change to the Root.pm to try to add authentication via the ‘auto’ 
method, but it does nothing?

# always runs first!
sub auto :Private {
my ( $self, $c ) = @_;

# Authenticate
$c-response-body('Matched Members::Controller::Auto in Root.' . 
$c-sessionid);

}

This doesn’t output anything and I simply get the welcome screen, plus there is 
a warning in the devel server output of

“Use of uninitialized value in concatenation (.) or string”

I have ..

use Catalyst qw/
-Debug
ConfigLoader
Static::Simple
StackTrace
Session
Session::Store::FastMmap
Session::State::Cookie
/;

In my main MyApp.pm

Why is $c-response-body not working and why is the sessionid empty?

Thanks

Craig Chant
I.T. Manager
[Description: cid:image001.png@01CD5F4A.17E848D0]
Main Line01903 602664tel:01903%20602664
Direct Line   01903 227753tel:01903%20227753
Visit our website http://www.homeloanpartnership.com
HomeLoan Partnership have been named the Best Mortgage Network, 2012, at the 
myintroducer.comhttp://myintroducer.com Industry Awards

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

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

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must

RE: [Catalyst] Unable to output anything in Root.pm - 'auto'

2012-10-29 Thread Craig Chant
OK, thanks.

I assume you meant 'comment' not 'uncomment' , which I did and it now outputs 
what I wanted!

Though $c-sessionid is still blank?


-Original Message-
From: Lukas Thiemeier [mailto:spamcatc...@thiemeier.net]
Sent: 29 October 2012 15:16
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Unable to output anything in Root.pm - 'auto'

Hi Craig,

Take a look at the default index method in Controller/Root.pm.
If you look at the debug output, you will see that index is called after 
auto. Index sets, and therefore overwrites $c-res-body.

If you use a template system, the default end action
(ActionClass:RenderView) will only render the template if $c-res-body is not 
set. But setting the body directly, as in index, will overwrite any 
previously added content.

Uncomment the line '$c-response-body( $c-welcome_message );' in 'sub index 
...', and you will see whatever you write to $c-res-body in auto.

Cheers, Lukas


On 10/29/2012 04:04 PM, Craig Chant wrote:
 Oh I also tried changing it to 'begin' instead of 'auto', still
 doesn't work?



 I also thought that all calls to ANY method / sub will always be
 passed $self  $c , only it doesn't seem to be passing in $c and I've
 had to manually do it?



 I've tried...



 # always runs first!

 sub begin :Private {

 my ( $self, $c ) = @_;



 # Authenticate

 $self-AuthenticateUser($c);

 return 1;



 }



 sub AuthenticateUser {



 my ( $self, $c ) = @_;



 die 'Session ID = ' . $c-sessionid;



 }



 But there is no session ID.



 I am still getting the Use of uninitialized value in concatenation
 (.) or string  error.



 I've read
 http://search.cpan.org/~mramberg/Catalyst-Plugin-Session-0.14/lib/Cata
 lyst/Plugin/Session/Tutorial.pod



 Where it states :  These plugins will automatically set
 |$c-sessionid|at the begining of the request, and automatically cause
 |$c-sessionid|to be saved by the client at the end of the request.

 So why is $c-sessionid uninitialized?



 Any ideas where my session info is?



 Thanks,



 Craig



 *From:*Craig Chant [mailto:cr...@homeloanpartnership.com]
 *Sent:* 29 October 2012 14:54
 *To:* The elegant MVC web framework
 *Subject:* RE: [Catalyst] Unable to output anything in Root.pm - 'auto'



 Nope, no change; same warning in the devel output and all that happens
 is the  welcome screen loads?



 *From:*Ben Vinnerd [mailto:ben+catal...@vinnerd.com]
 mailto:[mailto:ben+catal...@vinnerd.com]
 *Sent:* 29 October 2012 14:48
 *To:* The elegant MVC web framework
 *Subject:* Re: [Catalyst] Unable to output anything in Root.pm - 'auto'



 Private methods have to return a true value to continue processing.

 Try adding return 1 at the end of the method.

 Ben

 On 29 October 2012 14:23, Craig Chant cr...@homeloanpartnership.com
 mailto:cr...@homeloanpartnership.com wrote:

 Hi,



 I seem to be going round in circles unable to get Catalyst to output
 anything via 'auto'?



 I made a change to the Root.pm to try to add authentication via the
 'auto' method, but it does nothing?



 # always runs first!

 sub auto :Private {

 my ( $self, $c ) = @_;



 # Authenticate

 $c-response-body('Matched Members::Controller::Auto in Root.' .
 $c-sessionid);



 }



 This doesn't output anything and I simply get the welcome screen, plus
 there is a warning in the devel server output of



 Use of uninitialized value in concatenation (.) or string



 I have ..



 use Catalyst qw/

 -Debug

 ConfigLoader

 Static::Simple

 StackTrace

 Session

 Session::Store::FastMmap

 Session::State::Cookie

 /;



 In my main MyApp.pm



 Why is $c-response-body not working and why is the sessionid empty?



 Thanks



 */Craig Chant/*

 I.T. Manager

 Description: cid:image001.png@01CD5F4A.17E848D0

 Main Line01903 602664 tel:01903%20602664

 Direct Line   01903 227753 tel:01903%20227753

 Visit our website http://www.homeloanpartnership.com

 *HomeLoan Partnership have been named the Best Mortgage Network, 2012,
 at the myintroducer.com http://myintroducer.com Industry Awards*



 This Email and any attachments contain confidential information and is
 intended solely for the individual to whom it is addressed. If this
 Email has been misdirected, please notify the author as soon as
 possible. If you are not the intended recipient you must not disclose,
 distribute, copy, print or rely on any of the information contained,
 and all copies must be deleted immediately. Whilst we take reasonable
 steps to try to identify any software viruses, any attachments to this
 e-mail may nevertheless contain viruses, which our anti-virus software
 has failed to identify. You should therefore carry out your own
 anti-virus checks before opening any documents. HomeLoan Partnership
 will not accept any liability for damage caused by computer viruses
 emanating from any attachment or other document supplied with this e-mail.
 HomeLoan Partnership

RE: [Catalyst] Unable to output anything in Root.pm - 'auto'

2012-10-29 Thread Craig Chant
By the way, what do you need the session-id for? Catalyst handles sessions in 
a transparent way

To authenticate users, I don't want to store authentication in the hash and it 
seems the only other way to do this is via ORM, which I don't want to use 
either.

I find catalyst whenever I look at how it implements anything to do with DB 
access, it forces ORM upon you, so I need to write my own authentication code 
don't I ?

-Original Message-
From: Lukas Thiemeier [mailto:spamcatc...@thiemeier.net]
Sent: 29 October 2012 15:39
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Unable to output anything in Root.pm - 'auto'

Hi again,

about the missing sessionid:

I don't know much about the internals of Catalyst::Plugin::Session, but I guess 
that the session is a lazy attribute, and only created if used.
This means: unless you put something in the session, you will not have one, and 
therefore have no session-id.

This is very handy, because the overhead related to creating and restoring a 
session is only executed if the session is really needed.
If your app has a session-less interface without authentication, and extra 
functionality for authenticated users, the session will only be created for 
authenticated users.

If you touch your session object before fetching the session-id, it will
work:

$c-session;
$c-res-body(SESSIONID  . $c-sessionid);

As soon as you implemented authentication, the session will be used and the 
session-id will be set.

By the way, what do you need the session-id for? Catalyst handles sessions in a 
transparent way. In most cases, you don't need to access the session-id in your 
code. And if it is only for debugging: The session plugin writes the session-id 
to $c-log when a session is created or restored. This means: the code showed 
above will result in the session-id being printed twice :)

Lukas

On 10/29/2012 04:04 PM, Craig Chant wrote:
 Oh I also tried changing it to 'begin' instead of 'auto', still
 doesn't work?



 I also thought that all calls to ANY method / sub will always be
 passed $self  $c , only it doesn't seem to be passing in $c and I've
 had to manually do it?



 I've tried...



 # always runs first!

 sub begin :Private {

 my ( $self, $c ) = @_;



 # Authenticate

 $self-AuthenticateUser($c);

 return 1;



 }



 sub AuthenticateUser {



 my ( $self, $c ) = @_;



 die 'Session ID = ' . $c-sessionid;



 }



 But there is no session ID.



 I am still getting the Use of uninitialized value in concatenation
 (.) or string  error.



 I've read
 http://search.cpan.org/~mramberg/Catalyst-Plugin-Session-0.14/lib/Cata
 lyst/Plugin/Session/Tutorial.pod



 Where it states :  These plugins will automatically set
 |$c-sessionid|at the begining of the request, and automatically cause
 |$c-sessionid|to be saved by the client at the end of the request.

 So why is $c-sessionid uninitialized?



 Any ideas where my session info is?



 Thanks,



 Craig



 *From:*Craig Chant [mailto:cr...@homeloanpartnership.com]
 *Sent:* 29 October 2012 14:54
 *To:* The elegant MVC web framework
 *Subject:* RE: [Catalyst] Unable to output anything in Root.pm - 'auto'



 Nope, no change; same warning in the devel output and all that happens
 is the  welcome screen loads?



 *From:*Ben Vinnerd [mailto:ben+catal...@vinnerd.com]
 mailto:[mailto:ben+catal...@vinnerd.com]
 *Sent:* 29 October 2012 14:48
 *To:* The elegant MVC web framework
 *Subject:* Re: [Catalyst] Unable to output anything in Root.pm - 'auto'



 Private methods have to return a true value to continue processing.

 Try adding return 1 at the end of the method.

 Ben

 On 29 October 2012 14:23, Craig Chant cr...@homeloanpartnership.com
 mailto:cr...@homeloanpartnership.com wrote:

 Hi,



 I seem to be going round in circles unable to get Catalyst to output
 anything via 'auto'?



 I made a change to the Root.pm to try to add authentication via the
 'auto' method, but it does nothing?



 # always runs first!

 sub auto :Private {

 my ( $self, $c ) = @_;



 # Authenticate

 $c-response-body('Matched Members::Controller::Auto in Root.' .
 $c-sessionid);



 }



 This doesn't output anything and I simply get the welcome screen, plus
 there is a warning in the devel server output of



 Use of uninitialized value in concatenation (.) or string



 I have ..



 use Catalyst qw/

 -Debug

 ConfigLoader

 Static::Simple

 StackTrace

 Session

 Session::Store::FastMmap

 Session::State::Cookie

 /;



 In my main MyApp.pm



 Why is $c-response-body not working and why is the sessionid empty?



 Thanks



 */Craig Chant/*

 I.T. Manager

 Description: cid:image001.png@01CD5F4A.17E848D0

 Main Line01903 602664 tel:01903%20602664

 Direct Line   01903 227753 tel:01903%20227753

 Visit our website http://www.homeloanpartnership.com

 *HomeLoan Partnership have been named the Best Mortgage Network, 2012

RE: [Catalyst] Unable to output anything in Root.pm - 'auto'

2012-10-29 Thread Craig Chant
Yes, but I need to keep a backed DB up-to-date with current logins, where in 
the system they are etc...

So local server disk won't help in this situation.

-Original Message-
From: Denny [mailto:2...@denny.me]
Sent: 29 October 2012 15:50
To: The elegant MVC web framework
Subject: RE: [Catalyst] Unable to output anything in Root.pm - 'auto'

On Mon, 2012-10-29 at 15:43 +, Craig Chant wrote:
 By the way, what do you need the session-id for? Catalyst handles sessions 
 in a transparent way

 To authenticate users, I don't want to store authentication in the hash and 
 it seems the only other way to do this is via ORM, which I don't want to use 
 either.

 I find catalyst whenever I look at how it implements anything to do with DB 
 access, it forces ORM upon you, so I need to write my own authentication code 
 don't I ?

I'm pretty sure the default storage for session stuff is disk-based.



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
___
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] Why is $c undefined?

2012-10-29 Thread Craig Chant
Hi,

I seem to be unable to work out why $c is never automatically passed to any of 
my models or methods?

I have in root.pm

# always runs first!
sub begin :Private {

my ( $self, $c ) = @_;

# Authenticate
$self-AuthenticateUser();
return 1;

}

I then have...

sub AuthenticateUser {

my ( $self, $c ) = @_;

$c-session;
if(!$c-model('Members')-LogCheck($c)){
$c-uri_for_action('/login/login');
}

}

However, $c is undefined and errors, it only works if I pass it $c from 
'begin'..

$self-AuthenticateUser($c);


I was under the impression that $c was the context (Catalyst) default variable 
and was always passed to every method / subroutine.

is this not the case?

Thanks,

Craig .
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
___
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] Unable to output anything in Root.pm - 'auto'

2012-10-29 Thread Craig Chant
 the startup time for your application, but unless you
are using plain CGI, this doesn't really matter. (If you use
plain-old-CGI, STOP doing so. Use FastCGI instead.)

3: It sometimes generates more SQL statements than it is required to
fulfill a certain task, but this is only relevant if you are running a
high performance, high traffic site. And IF this is the case, you can
still optimize it.

If you compare it to the benefits I described above, the benefits are
dominant in most cases.

I know that this is not the universal truth (which doesn't exist
anyway). It is my personal opinion. Just think about it.

Additionally: DBIC makes moving from one database system to another very
very easy. You have a SQLite DB, and want to move to Portgresql?
no problem. With DBIC, you are already done :)

Ok. I hope I could help.

Sorry for the DBIC-praising at the end. It is just that I first didn't
want to use DBIC, too. And now I see how much easier my life is with
DBIC, and I think I should have moved to DBIC earlier.

 Lukas







On 10/29/2012 06:00 PM, Craig Chant wrote:
 Hi Luka,

 Perhaps I miss-read the info on 
 http://search.cpan.org/~janus/Catalyst-Authentication-Store-DBI-0.01/lib/Catalyst/Authentication/Store/DBI.pm

 But from what I can see it expects you to map specific fields in a table as 
 well as have a user role table with specific data mapping?

 [quote] __PACKAGE__-config-{'authentication'} = {
 'default_realm' = 'default',
 'realms' = {
   'default' = {
 'credential' = {
   'class'   = 'Password',
   'password_field'  = 'password',
   'password_type'   = 'hashed',
   'password_hash_type'  = 'SHA-1',
 },
 'store' = {
   'class'  = 'DBI',
   'user_table' = 'login',
   'user_key'   = 'id',
   'user_name'  = 'name',
   'role_table' = 'authority',
   'role_key'   = 'id',
   'role_name'  = 'name',
   'user_role_table'= 'competence',
   'user_role_user_key' = 'login',
   'user_role_role_key' = 'authority',
 },
   },
 },
   };[/quote]

 Have I read the above incorrectly?

 I have a non-normalised DB , with an application that functions in a 
 particular way, I deal with user roles and other such stuff in my own way and 
 I cannot refactor to use catalyst without ensuring all sections of the system 
 function the same along with the back end admin system, I can't rewrite both 
 parts at the same time, this is a live app in production that works 
 currently, I'm simply trying to learn Catalyst  MVC cuteness, not start from 
 scratch.

From what I can see using any of those authentication modules expects certain 
data I don't have or use nor want.

 Please correct  me if I'm reading the CPAN documentation incorrectly.

 I want to refactor my app to be MVC using Catalyst without being forced to do 
 any other than MVC cuteness and work the way I want to with the a database 
 that already exists, I got the feeling Catalyst allows this unlike ROR or 
 other MVC frameworks.

 Again, have I got this wrong?

 If to use Catalyst I have to have a normalised DB, use specific modules with 
 data in a particular format, then I will just refactor our systems myself 
 using my own modules and such, best to find this out now before I spend any 
 more time on something that isn't suitable.

 Thanks,

 Craig.


 -Original Message-
 From: Lukas Thiemeier [mailto:spamcatc...@thiemeier.net]
 Sent: 29 October 2012 16:42
 To: catalyst@lists.scsys.co.uk
 Subject: Re: [Catalyst] Unable to output anything in Root.pm - 'auto'


 Hey Craig,

 I got it. You want to store your credentials in a database, but you don't 
 want to use DBIx::Class?

 What about Catalyst::Authentication::Storage::DBI?

 If this doesn't help, you might me right. Maybe you have to write your own 
 authentication module. In that case, consider making it a 
 Catalyst::Authentication::Store module, and publish it on cpan. It might be 
 useful for others, too...

 By the way: Catalyst::Model::DBI is a ORM-less, raw DBI model for catalyst. 
 So ... whenever I look at how it implements anything to do with DB access, 
 it forces ORM upon you ... is not correct. There are very few things which 
 are really forced by catalyst. Using DBIx::Class is just considered good 
 practice. A lot of people use it, thats why it is used in most tutorials and 
 examples.

 Lukas



 On 10/29/2012 05:09 PM, Craig Chant wrote:
 Yes, but I need to keep a backed DB up-to-date with current logins, where in 
 the system they are etc...

 So local server disk won't help in this situation.

 -Original Message-
 From: Denny [mailto:2...@denny.me]
 Sent: 29 October 2012 15:50
 To: The elegant MVC web framework
 Subject: RE: [Catalyst] Unable to output anything in Root.pm - 'auto'

 On Mon, 2012-10-29 at 15:43 +, Craig Chant wrote

RE: [Catalyst] Why is $c undefined?

2012-10-29 Thread Craig Chant
Cool, thanks.

Reading the tutorial I got the impression $c was always passed.

Thanks for clearing that up, which is why I guess $c-dbh doesn't exist.

hmm, much for me to get my head round for sure!

Regards,

Craig.


From: Rob Brown [r...@intelcompute.com]
Sent: 29 October 2012 19:11
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Why is $c undefined?

There's no black-magic going on, so your AuthenticateUser() sub never
magically gets $c.

In short, you'll only get $c when using the method attributes, such as
:Private, :Chained, etc.




On 10/29/2012 07:07 PM, Craig Chant wrote:
 Hi,

 I seem to be unable to work out why $c is never automatically passed to
 any of my models or methods?

 I have in root.pm

 # always runs first!

 sub begin :Private {

 my ( $self, $c ) = @_;

 # Authenticate

 $self-AuthenticateUser();

 return 1;

 }

 I then have...

 sub AuthenticateUser {

 my ( $self, $c ) = @_;

 $c-session;

 if(!$c-model('Members')-LogCheck($c)){

 $c-uri_for_action('/login/login');

 }

 }

 However, $c is undefined and errors, it only works if I pass it $c from
 'begin'..

 $self-AuthenticateUser($c);

 I was under the impression that $c was the context (Catalyst) default
 variable and was always passed to every method / subroutine.

 is this not the case?

 Thanks,

 Craig .

 This Email and any attachments contain confidential information and is
 intended solely for the individual to whom it is addressed. If this
 Email has been misdirected, please notify the author as soon as
 possible. If you are not the intended recipient you must not disclose,
 distribute, copy, print or rely on any of the information contained, and
 all copies must be deleted immediately. Whilst we take reasonable steps
 to try to identify any software viruses, any attachments to this e-mail
 may nevertheless contain viruses, which our anti-virus software has
 failed to identify. You should therefore carry out your own anti-virus
 checks before opening any documents. HomeLoan Partnership will not
 accept any liability for damage caused by computer viruses emanating
 from any attachment or other document supplied with this e-mail.
 HomeLoan Partnership reserves the right to monitor and archive all
 e-mail communications through its network. No representative or employee
 of HomeLoan Partnership has the authority to enter into any contract on
 behalf of HomeLoan Partnership by email. HomeLoan Partnership is a
 trading name of H L Partnership Limited, registered in England and Wales
 with Registration Number 5011722. Registered office: 26-34 Old Street,
 London, EC1V 9QQ. H L Partnership Limited is authorised and regulated by
 the Financial Services Authority.



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

--
IntelCompute
Web Design  Online Marketing Experts

http://www.intelcompute.com

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

___
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

RE: [Catalyst] Why is $c undefined?

2012-10-29 Thread Craig Chant
Thanks Will,



Appreciate you clarifying this for me.



CRaig.


From: will trillich [will.trill...@serensoft.com]
Sent: 29 October 2012 19:16
To: The elegant MVC web framework
Subject: Re: [Catalyst] Why is $c undefined?

On Mon, Oct 29, 2012 at 2:07 PM, Craig Chant 
cr...@homeloanpartnership.commailto:cr...@homeloanpartnership.com wrote:
sub begin :Private {

my ( $self, $c ) = @_;

# Authenticate
$self-AuthenticateUser();

Note, you don't pass $c to AuthenticateUser here!


return 1;

}

I then have...

sub AuthenticateUser {

my ( $self, $c ) = @_;

$c-session;
if(!$c-model('Members')-LogCheck($c)){
$c-uri_for_action('/login/login');
}

}

However, $c is undefined and errors, it only works if I pass it $c from 
'begin'..

$self-AuthenticateUser($c);


I was under the impression that $c was the context (Catalyst) default variable 
and was always passed to every method / subroutine.

is this not the case?

Right, that's not the case. It only passes to the :Chained or :Args or 
:CaptureArgs methods. This leaves you free to create your own internal methods 
that don't get extra $c args interfering with your logic.


--
[http://www.serensoft.com/sites/all/themes/marinelli/img/serensoft_logo_screen.gif]
 Will Trillich :: 812.454.6431

“Grading takes away all the fun from failing. And a huge part of education is 
about failure.”  -- Shimon Schocken
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
___
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] Why is $c undefined?

2012-10-29 Thread Craig Chant
I'm not sure you'd really want $c-dbh anyway, since that's doesn't
sound like you would be encapsulating the Model very well, and sounds
like you'd have SQL in your controller code?

This was what I thought and am trying to avoid, I am doing my best to keep 
concern with SQL trot he Model and any action/method that requires data to use 
the Model and have the business logic kept in the Model, so that only 
actions-routes and the additional application helper methods are in the 
controller.

I have read and seen frameworks such as Mojolicious encourage a shrinkage of 
the Model and move alot of functionality to the Controller, so there is a 
paradigm which seems to imply it is ok to do more stuff in the Controller, but 
I am leaning towards having the main code in the Model and then bolting it 
together via the Controller.

So for example the authentication for the user is in the Controller but it 
simply utilises the Model

EG.

sub AuthenticateUser {

my ( $self, $c ) = @_;

$c-session;
if(!$c-model('Members')-LogCheck($c)){
$c-forward('/login/login');
}

}

Dunno, this is all new to me and I'm refactoring as I go, so I doubt I'll get 
it right first time! Does anyone?



From: Rob Brown [r...@intelcompute.com]
Sent: 29 October 2012 19:39
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Why is $c undefined?

Just a small FYI more than anything, which might help fill in a few gaps...

$c-dbh would need you to modify MyApp.pm, this is useful at times for
creating little helper methods that you want accessible via $c, or to
override existing $c methods.

The session plugin does this too, that's why $c-sessionid is available,
etc. or $c-check_user_roles() when using the Authorization::Roles plugin.

I'm not sure you'd really want $c-dbh anyway, since that's doesn't
sound like you would be encapsulating the Model very well, and sounds
like you'd have SQL in your controller code?



On 10/29/2012 07:28 PM, Craig Chant wrote:
 Cool, thanks.

 Reading the tutorial I got the impression $c was always passed.

 Thanks for clearing that up, which is why I guess $c-dbh doesn't exist.

 hmm, much for me to get my head round for sure!

 Regards,

 Craig.

 
 From: Rob Brown [r...@intelcompute.com]
 Sent: 29 October 2012 19:11
 To: catalyst@lists.scsys.co.uk
 Subject: Re: [Catalyst] Why is $c undefined?

 There's no black-magic going on, so your AuthenticateUser() sub never
 magically gets $c.

 In short, you'll only get $c when using the method attributes, such as
 :Private, :Chained, etc.




 On 10/29/2012 07:07 PM, Craig Chant wrote:
 Hi,

 I seem to be unable to work out why $c is never automatically passed to
 any of my models or methods?

 I have in root.pm

 # always runs first!

 sub begin :Private {

 my ( $self, $c ) = @_;

 # Authenticate

 $self-AuthenticateUser();

 return 1;

 }

 I then have...

 sub AuthenticateUser {

 my ( $self, $c ) = @_;

 $c-session;

 if(!$c-model('Members')-LogCheck($c)){

 $c-uri_for_action('/login/login');

 }

 }

 However, $c is undefined and errors, it only works if I pass it $c from
 'begin'..

 $self-AuthenticateUser($c);

 I was under the impression that $c was the context (Catalyst) default
 variable and was always passed to every method / subroutine.

 is this not the case?

 Thanks,

 Craig .

 This Email and any attachments contain confidential information and is
 intended solely for the individual to whom it is addressed. If this
 Email has been misdirected, please notify the author as soon as
 possible. If you are not the intended recipient you must not disclose,
 distribute, copy, print or rely on any of the information contained, and
 all copies must be deleted immediately. Whilst we take reasonable steps
 to try to identify any software viruses, any attachments to this e-mail
 may nevertheless contain viruses, which our anti-virus software has
 failed to identify. You should therefore carry out your own anti-virus
 checks before opening any documents. HomeLoan Partnership will not
 accept any liability for damage caused by computer viruses emanating
 from any attachment or other document supplied with this e-mail.
 HomeLoan Partnership reserves the right to monitor and archive all
 e-mail communications through its network. No representative or employee
 of HomeLoan Partnership has the authority to enter into any contract on
 behalf of HomeLoan Partnership by email. HomeLoan Partnership is a
 trading name of H L Partnership Limited, registered in England and Wales
 with Registration Number 5011722. Registered office: 26-34 Old Street,
 London, EC1V 9QQ. H L Partnership Limited is authorised and regulated by
 the Financial Services Authority.



 ___
 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

RE: [Catalyst] Progress bar

2012-10-24 Thread Craig Chant
Or a plethora of other methods using PHP/Perl/JQuery/Flash/HTML5

https://github.com/blueimp/jQuery-File-Upload

http://www.uploadify.com/

http://sourceforge.net/projects/uber-uploader/



From: Lorn [mailto:l...@lornlab.org]
Sent: 24 October 2012 13:45
To: The elegant MVC web framework
Subject: Re: [Catalyst] Progress bar

I'm not following the thread but, did you guys know about
http://wiki.nginx.org/HttpUploadProgressModule. ?

They work together with upload module, and dont overload your backend with 
upload files, nginx handle that and just pass the file path to the backend.

--
Lorn


On Wednesday, 24 de October de 2012 at 02:33, Toby Corkindale wrote:
I was just investigating why the upload progress bar was broken on one
of my apps.. came here to make a post and discovered this thread.
Well, at least that's the first question answered!

Given the caveats around Starman and WebKit browsers, are there any
other suggestions for how to do upload progress indicators?
Is this something we can do via HTML5 neater? Are there any
open-source Flash implementations?

Cheers,
Toby

On 22 October 2012 09:42, Bill Moseley 
mose...@hank.orgmailto:mose...@hank.org wrote:

On Sat, Oct 20, 2012 at 1:51 PM, Tomas Doran 
bobtf...@bobtfish.netmailto:bobtf...@bobtfish.net wrote:

And UploadProgress is shipped, should be available once it's reindexed
(permissions cock up), which should be shortly :)


So, when running under Starman the uploads are buffered before chunked to
Catalyst, which means the progress bar data isn't updated until the upload
has completed. This renders the upload progress bar pretty useless with
Starman.

The progress bar works fine running the app under mod_perl.

I suppose using something like Nginx or Perlbal in front of the app would
work (because those do cache uploads but also provide a hook for reading
upload progress). But, we already have hardware load balancers in front of
the app, so don't really need an extra proxy in front of every web server.

Any other options? Using a upload/request caching proxy is probably THE
correct answer since don't really want to tie up the app with slow uploads.

I guess I should test, but I wonder if there's a limit on what Starman will
buffer -- I assume it's buffering in memory.




--
Bill Moseley
mose...@hank.orgmailto:mose...@hank.org

___
List: Catalyst@lists.scsys.co.ukmailto: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/



--
Turning and turning in the widening gyre
The falcon cannot hear the falconer
Things fall apart; the center cannot hold
Mere anarchy is loosed upon the world

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

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
___
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] Canot get application working on IIS7 via FastCGI

2012-10-23 Thread Craig Chant
Bingo - You are a genius Tom!

Thank you so, so much, I would never have found that switch buried in the 
documentation for a long, long time!

I cannot thank the Catalyst community enough for bearing with me and taking the 
time to provide all the suggestions and support I have received!

I was getting very frustrated and disheartened and even popped over to the 
Mojolicious mailing list to see what they had to offer, but I must confess, the 
reply I got was obnoxious and rude and am so glad I stuck with Catalyst, I 
can't stand people who thinks a good reply to anyone's thread is 'Google is 
your friend', Google is no-one's friend especially not mine as trawling through 
countless threads with contradicting suggestions does not equate to support or 
a solution, especially for someone who has a disability and finds reading very 
difficult!

I know I've got a long way to go and I'm sure the framework has a lot of 
frustration and hurt waiting in the wings for me, but at least I can now start 
to develop and see where it takes me.

Oh, I would like to point out for clarity that the '500 Server Error', I 
reported yesterday after once more reconfiguring the IIS mapping, was due to a 
keying error on my part and nothing to do with the problem I was experiencing. 
So apologies if I sent anyone in the wrong direction!

Again, thank you for your support, it really is appreciated.

Regards,

Craig.


-Original Message-
From: Tomas Doran [mailto:bobtf...@bobtfish.net]
Sent: 22 October 2012 19:49
To: The elegant MVC web framework
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI


On 18 Oct 2012, at 14:15, Craig Chant wrote:
 Here is the output for the /librarydocs path.


 *** $env

 $VAR1 = {
  'psgi.multiprocess' = 1,
  'SCRIPT_NAME' = '',
  'PATH_INFO' = '/',

snip

  'REQUEST_URI' = '/librarydocs'

Actually, do you you have the 'use_request_uri_for_path' config variable set, 
or not?

(https://metacpan.org/module/Catalyst#CONFIGURATION)

As setting that to true may fix your issues..

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

___
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] Canot get application working on IIS7 via FastCGI

2012-10-23 Thread Craig Chant
Hey Lyle,

Thanks for the heads up, at least I'm now aware of potential issues for file 
handling, though I usually wrap it in a Perl module for authentication and 
deliver them that way, though I believe Catalyst has built in functionality for 
this.

Still a lot to get my head round for sure.

Regards,

Craig.

-Original Message-
From: Lyle [mailto:webmas...@cosmicperl.com]
Sent: 23 October 2012 12:05
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI

On 23/10/2012 11:37, Craig Chant wrote:
 Bingo - You are a genius Tom!

 Thank you so, so much, I would never have found that switch buried in the 
 documentation for a long, long time!

As this is standard behaviour for IIS, Catalyst really should be setting this 
by default when it's running under IIS. I didn't realise Catalyst had missed 
this, otherwise I probably could have answered the op's question from the start.

if ( $ENV{'SERVER_SOFTWARE'} =~ /IIS/ ) {
   ...
}

IIS also doesn't have the pwd as the folder where the script is running.
So you usually need to do:

use FindBin qw ($RealBin $RealScript);
use lib $FindBin::RealBin;
chdir $RealBin;

Otherwise you get issues when people try to open files with a relative path.


Lyle


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

___
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] Canot get application working on IIS7 via FastCGI

2012-10-22 Thread Craig Chant
Well  I've provided everything you requested, but not had a reply from you, 
shall I assume Catalyst doesn't work on IIS until I hear to the contrary?

-Original Message-
From: Tomas Doran [mailto:bobtf...@bobtfish.net]
Sent: 17 October 2012 21:24
To: The elegant MVC web framework
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI


On 17 Oct 2012, at 16:49, Craig Chant wrote:

 Hi,

 I've been going round in circles unable to find any help on why my catalyst 
 application won't work on IIS7 Windows Server 2008 R2

 I find all the documentation to be incorrect,, such as setting the path to 
 '*' stops all static content being served from the root/static directory , I 
 had to put '*.' For images etc to show.


Patch please?

 Now I cannot get any path to be recognised, 
 http://mydomain/mycontroller/mymethod does nothing, and all that will load is 
 the Root.pm - sub index :Path :Args(0) method.


Loading the wrong URI is significantly different to doing nothing, no?

 It doesn't matter what URL I point my browser to all I ever get is the 
 welcome screen from the Root.pm index method.

 If I use localhost for the devel server the app resolves the URL path 
 correctly and the associated action runs from the correct controller.

 However, over IIS7 it will not work and I cannot find any resources to 
 explain why.

 Please help!


You haven't given us anything to help try to explain why!

Please can you give us the debug output from startup of the app + the debug 
logs of asking for /, and asking for /a/uri/which/does/not/work ? Also, please 
add a Data::Dumper::Dumper to the Catalyst::Engine::prepare_path method - one 
at the start to dump $env, and two near the bottom to dump $c-request-uri and 
$c-request-base just after they've been assigned to...

Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

___
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] Canot get application working on IIS7 via FastCGI

2012-10-22 Thread Craig Chant
Hi Tony,

There was no move to IIS, there is only one app and it is on IIS, the devel 
server works fine though when the mysapp_server.pl script is run.

You've lost me with the mapping I'm afraid.

What am I mapping to create the StaticFile entry? What's 'Static File Module' 
and what's the other entry as the screen shot is chopped off?

Is it a module mapping, managed handler, script, wildcard?

Please can you advise what part of the Catalyst FastCGI Wiki instructions that 
is on http://wiki.catalystframework.org/wiki/deployment/iis7_fastcgi

I can't find any mention of this additional mapping, there only seems to be one 
entry plus the page is missing all the images so is a nightmare to follow.

Thanks,

Craig.


From: anthony.okusa...@usbank.com [mailto:anthony.okusa...@usbank.com]
Sent: 22 October 2012 16:34
To: The elegant MVC web framework
Subject: RE: [Catalyst] Canot get application working on IIS7 via FastCGI

Craig
I assume your application works using the built in development server 
prior to moving it over to IIS
Can you check your IIS 7 servers Handler mappings for your catalyst App (click 
on your app under sites in IIS manager and double click on Handler mappings)
below is what I have mine setup to use. This ensures that files are handled by 
the staticFileModule (the order is important)

Hope this helps.


[cid:image001.jpg@01CDB076.6FA905F0]

Thanks

Tony B. Okusanya
Midrange Automation




From:Craig Chant 
cr...@homeloanpartnership.commailto:cr...@homeloanpartnership.com
To:The elegant MVC web framework 
catalyst@lists.scsys.co.ukmailto:catalyst@lists.scsys.co.uk
Date:10/22/2012 03:38 AM
Subject:RE: [Catalyst] Canot get application working on IIS7 via FastCGI




Well  I've provided everything you requested, but not had a reply from you, 
shall I assume Catalyst doesn't work on IIS until I hear to the contrary?

-Original Message-
From: Tomas Doran [mailto:bobtf...@bobtfish.net]
Sent: 17 October 2012 21:24
To: The elegant MVC web framework
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI


On 17 Oct 2012, at 16:49, Craig Chant wrote:

 Hi,

 I've been going round in circles unable to find any help on why my catalyst 
 application won't work on IIS7 Windows Server 2008 R2

 I find all the documentation to be incorrect,, such as setting the path to 
 '*' stops all static content being served from the root/static directory , I 
 had to put '*.' For images etc to show.


Patch please?

 Now I cannot get any path to be recognised, 
 http://mydomain/mycontroller/mymethod does nothing, and all that will load is 
 the Root.pm - sub index :Path :Args(0) method.


Loading the wrong URI is significantly different to doing nothing, no?

 It doesn't matter what URL I point my browser to all I ever get is the 
 welcome screen from the Root.pm index method.

 If I use localhost for the devel server the app resolves the URL path 
 correctly and the associated action runs from the correct controller.

 However, over IIS7 it will not work and I cannot find any resources to 
 explain why.

 Please help!


You haven't given us anything to help try to explain why!

Please can you give us the debug output from startup of the app + the debug 
logs of asking for /, and asking for /a/uri/which/does/not/work ? Also, please 
add a Data::Dumper::Dumper to the Catalyst::Engine::prepare_path method - one 
at the start to dump $env, and two near the bottom to dump $c-request-uri and 
$c-request-base just after they've been assigned to...

Cheers
t0m


___
List: Catalyst@lists.scsys.co.ukmailto:Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership

RE: [Catalyst] Canot get application working on IIS7 via FastCGI

2012-10-18 Thread Craig Chant
Hi David,

Ah gotcha, thanks found what I believe to be the culprit.

Though I think the code was auto generated when using the helper script to 
create the base application?

static  = {dirs = ['static', qr/^(images|css)/,]}

Replaced with...

'Plugin::Static::Simple'  = {dirs = ['static', qr/^(images|css)/,]}

The warning has now gone when firing up the devel server.

Much obliged

Craig.

-Original Message-
From: David Schmidt [mailto:davew...@gmx.at]
Sent: 18 October 2012 07:48
To: The elegant MVC web framework
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI

 Though while we are on the subject of  Catalyst plug-ins, I do get this 
 message in the devel server output when it's started.

 [warn] Deprecated 'static' config key used, please use the key 
 'Plugin::Static::Simple' instead

 I've looked at the main application MyApp.pm in the lib folder and the 
 plug-ins loaded are :-

 use Catalyst qw/
 -Debug
 ConfigLoader
 Static::Simple
 StackTrace
 Session
 Session::Store::FastMmap
 Session::State::Cookie
 /;

 I've tried putting Plugin::Static::Simple insted but that falls over because 
 it can't locate the plug-in module, I've checked PPM and I have 
 'Plugin::Static::Simple' Catalyst CPAN module installed so am little stumped 
 especially with the limited beginners knowledge I have of your framework so 
 perhaps you could advise.



Doesnt really matter in this case. It just warns you to use

MyApp-config(
'Plugin::Static::Simple' = {
...
}
);

instead of

MyApp-config(
static = {
...
}
);

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
___
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] Canot get application working on IIS7 via FastCGI

2012-10-18 Thread Craig Chant
Hi David,

OIC, sorry I thought you were talking about some logs to do with Catalyst other 
than the standard inetpub W3SVCxxx server logs.

Here is what IIS logs show when I access the application.. (IP's have been 
obfuscated)

#Software: Microsoft Internet Information Services 7.5
#Version: 1.0
#Date: 2012-10-18 09:44:38
#Fields: date time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username 
c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
2012-10-18 09:44:38 xxx.xxx.xxx.xxx GET /static/images/catalyst_logo.png - 80 - 
xxx.xxx.xxx.xxx 
Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 200 0 0 
125
2012-10-18 09:44:38 xxx.xxx.xxx.xxx GET / - 80 - xxx.xxx.xxx.xxx 
Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 200 0 0 
2937
2012-10-18 09:44:38 xxx.xx.xxx.xxx GET /favicon.ico - 80 - xxx.xxx.xxx.xxx 
Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 200 0 0 
46
2012-10-18 09:45:04 xxx.xxx.xxx.xxx GET /librarydocs - 80 - xxx.xxx.xxx.xxx 
Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 200 0 0 
46

The first 3 GET entries are when I visit the root application URL (which 
displays the Catalyst welcome page) the 4th is the entry when navigating to the 
path for the LibraryDocs.pm controller.

As for the Data::Dumper information you requested, you will need to give me 
more guidance because I can't get it to output anything?

Firstly I cannot find the context variable '$c' , there is a '$ctx' , I assume 
this is what was meant?

I added

dump($env);
dump($ctx-request-uri);
dump($ctx-request-base);

After each assignment but nothing was displayed in the browser , nor were there 
any entries in the IIS logs.

I have tried 'print' , in front of those commands, nothing is outputted and 
nothing appears in the logs.

I've also tried 'die' but all I then get in the browser is a 400 error 'Bad 
Request'.

I've even outputted a header first with :- print Content-type: text/html\n\n;

Before trying to output the variables, but again all I get is a 'Bad Request' 
error in my browser.

In fact I have now removed all added code by myself, the devel server fires up 
and I can use localhost:3000 to navigate to my application and it works fine.

However, using IE to navigate to the production IIS7 URL, all I get now is 400 
Bad Request, so now saying 'nothing works' is an accurate statement?

You really need to give me more guidance if I am to provide any of the 
information you request.

Kind regards,

Craig.

-Original Message-
From: David Schmidt [mailto:davew...@gmx.at]
Sent: 18 October 2012 07:44
To: The elegant MVC web framework
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI

 Sorry again for not providing enough information, I will try to give
 you what you need but I will need a little help doing that also, can
 you advise where the logs for the app when running over IIS7- FastCGI
 are? Is there a file somewhere that gets written to each time the fastcgi.pl 
 script gets executed with this information in it?

I am pretty sure that you have to look where your webserver logs to.
With Apache it is possible to configure the log and errorlog location.
I suppose the same is possible for IIS7
Google it.

 Also can you guide me to where this change needs to be made
 'Catalyst::Engine::prepare_path method ' for Data::Dumper:Dumper,
 where is the file that needs editing located? , Also is there a
 Catalyst method to spit out the data via Data::Dumper already integrated into 
 the framework, or do I need to import it myself?

Look for the file Catalyst/Engine.pm. then search for prepare_path

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any 

RE: [Catalyst] Canot get application working on IIS7 via FastCGI

2012-10-18 Thread Craig Chant
Thanks Lyle / Hugh,

I've checked the following folders:-

c:\inetpub\logs\LogFiles
C:\Windows\System32\LogFiles\HTTPERR

Plus :- Turn Windows features on or off

But there isn't any options for :- Internet Information Services\World Wide Web 
Services\Health and Diagnostics\HTTP Logging

Though It seems logging is on as there are files in HTTPERR folder, but none 
containing any of the information wanted regarding :- debug or print STDERR

Like you suggested Lyle, I created the files myself for output!

Usually my perl apps run using :-

use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;

So I get errors outputted to the browser. Though I would point out that 
whatever Active State did to the latest perl release for IIS, 'die' no longer 
outputs a header first so a lot of my scripts now give '500 Internal Server 
Error' and I'm having to fix them as I go, which is one of the reasons I want 
to refactor the app to use Catalyst, apart from gaining MVC cuteness and a 
better architecture I was hoping for better error handling being sent to the 
browser which it seems 'die' coupled with ' StackTrace' gives, so I'm moving in 
the right direction. :-)

Anyways, I got the required info in the end, so let's hope someone can advise 
on a solution as to why the path mapping isn't working?

Kind regards,

Craig.

-Original Message-
From: Lyle [mailto:webmas...@cosmicperl.com]
Sent: 18 October 2012 14:54
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI

On 18/10/2012 14:15, Craig Chant wrote:
 Hi David / Adam,

 In the end I gave up with any of the so far provided suggestion, I've wasted 
 hours hunting for logs that just don't seem to exist.

 I'm not sure where you believe any of this output is going, but I've searched 
 every IIS log, windows event viewer, searched any file ending in .log and 
 even searched the entire server for any file modified with today's date. I 
 cannot find any file with the data you seem to think should exist. Where do 
 you believe STDERR goes on Windows IIS7?

In my experience, IIS will push STDERR to STDOUT which causes a number of 
problems. The best thing it to open STDERR to a file of your choice asap:

open( STDERR, /path/to/log/file.log );


Lyle


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.

___
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] Canot get application working on IIS7 via FastCGI

2012-10-17 Thread Craig Chant
Hi,

I've been going round in circles unable to find any help on why my catalyst 
application won't work on IIS7 Windows Server 2008 R2

I find all the documentation to be incorrect,, such as setting the path to '*' 
stops all static content being served from the root/static directory , I had to 
put '*.' For images etc to show.

Now I cannot get any path to be recognised, 
http://mydomain/mycontroller/mymethod does nothing, and all that will load is 
the Root.pm - sub index :Path :Args(0) method.

It doesn't matter what URL I point my browser to all I ever get is the welcome 
screen from the Root.pm index method.

If I use localhost for the devel server the app resolves the URL path correctly 
and the associated action runs from the correct controller.

However, over IIS7 it will not work and I cannot find any resources to explain 
why.

Please help!

Regards,

Craig Chant
I.T. Manager
[Description: cid:image001.png@01CD5F4A.17E848D0]
Main Line01903 602664
Direct Line   01903 227753
Visit our website http://www.homeloanpartnership.com
HomeLoan Partnership have been named the Best Mortgage Network, 2012, at the 
myintroducer.com Industry Awards

This Email and any attachments contain confidential information and is intended 
solely for the individual to whom it is addressed. If this Email has been 
misdirected, please notify the author as soon as possible. If you are not the 
intended recipient you must not disclose, distribute, copy, print or rely on 
any of the information contained, and all copies must be deleted immediately. 
Whilst we take reasonable steps to try to identify any software viruses, any 
attachments to this e-mail may nevertheless contain viruses, which our 
anti-virus software has failed to identify. You should therefore carry out your 
own anti-virus checks before opening any documents. HomeLoan Partnership will 
not accept any liability for damage caused by computer viruses emanating from 
any attachment or other document supplied with this e-mail. HomeLoan 
Partnership reserves the right to monitor and archive all e-mail communications 
through its network. No representative or employee of HomeLoan Partnership has 
the authority to enter into any contract on behalf of HomeLoan Partnership by 
email. HomeLoan Partnership is a trading name of H L Partnership Limited, 
registered in England and Wales with Registration Number 5011722. Registered 
office: 26-34 Old Street, London, EC1V 9QQ. H L Partnership Limited is 
authorised and regulated by the Financial Services Authority.
inline: image001.png___
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] Canot get application working on IIS7 via FastCGI

2012-10-17 Thread Craig Chant
Hello Tomas,

Many thanks for the quick reply, it really is appreciated.

I'll try to answer your comments as best I can and sorry if I haven't provided 
enough information or conveyed myself coherently enough.

 Patch please?

Do you mean there is a patch to address the path issue? '*.' vs '*'

Is this for Catalyst, perl, a CPAN module, IIS7?

Or do you mean what patch have I installed, if so, none to my knowledge, though 
I have installed a few CPAN Catalyst:: modules via perl PPM for DBI, Sessions 
and the dependencies.

Though while we are on the subject of  Catalyst plug-ins, I do get this message 
in the devel server output when it's started.

[warn] Deprecated 'static' config key used, please use the key 
'Plugin::Static::Simple' instead

I've looked at the main application MyApp.pm in the lib folder and the plug-ins 
loaded are :-

use Catalyst qw/
-Debug
ConfigLoader
Static::Simple
StackTrace
Session
Session::Store::FastMmap
Session::State::Cookie
/;

I've tried putting Plugin::Static::Simple insted but that falls over because it 
can't locate the plug-in module, I've checked PPM and I have 
'Plugin::Static::Simple' Catalyst CPAN module installed so am little stumped 
especially with the limited beginners knowledge I have of your framework so 
perhaps you could advise.

 Loading the wrong URI is significantly different to doing nothing, no?

Yes sorry if I gave the wrong impression, perhaps I should have worded it 
differently as I thought I had implied 'other than', maybe this would have been 
a better statement...

 Now I cannot get any path to be recognised, 
http://mydomain/mycontroller/mymethod does nothing, *other than* load the 
Root.pm - sub index :Path :Args(0) method.

Which is what is happening and I hope I've made things clearer as to exactly 
what I'm experiencing.

You haven't given us anything to help try to explain why!
Please can you give us the debug output from startup of the app + the debug 
logs of asking for /, and asking for /a/uri/which/does/not/work ? Also, please 
add a Data::Dumper::Dumper to the Catalyst::Engine::prepare_path method - one 
at the start to dump $env, and two near the bottom to dump $c-request-uri 
and $c-request-base just after they've been assigned to…

Sorry again for not providing enough information, I will try to give you what 
you need but I will need a little help doing that also, can you advise where 
the logs for the app when running over IIS7- FastCGI are? Is there a file 
somewhere that gets written to each time the fastcgi.pl script gets executed 
with this information in it?

Also can you guide me to where this change needs to be made 
'Catalyst::Engine::prepare_path method ' for Data::Dumper:Dumper, where is the 
file that needs editing located? , Also is there a Catalyst method to spit out 
the data via Data::Dumper already integrated into the framework, or do I need 
to import it myself?

I hope you can assist as I've been looking forward to building my next app 
using your framework.

Many thanks,

Craig.



From: Tomas Doran [bobtf...@bobtfish.net]
Sent: 17 October 2012 21:24
To: The elegant MVC web framework
Subject: Re: [Catalyst] Canot get application working on IIS7 via FastCGI

On 17 Oct 2012, at 16:49, Craig Chant wrote:

 Hi,

 I’ve been going round in circles unable to find any help on why my catalyst 
 application won’t work on IIS7 Windows Server 2008 R2

 I find all the documentation to be incorrect,, such as setting the path to 
 ‘*’ stops all static content being served from the root/static directory , I 
 had to put ‘*.’ For images etc to show.


Patch please?

 Now I cannot get any path to be recognised, 
 http://mydomain/mycontroller/mymethod does nothing, and all that will load is 
 the Root.pm - sub index :Path :Args(0) method.


Loading the wrong URI is significantly different to doing nothing, no?

 It doesn’t matter what URL I point my browser to all I ever get is the 
 welcome screen from the Root.pm index method.

 If I use localhost for the devel server the app resolves the URL path 
 correctly and the associated action runs from the correct controller.

 However, over IIS7 it will not work and I cannot find any resources to 
 explain why.

 Please help!


You haven't given us anything to help try to explain why!

Please can you give us the debug output from startup of the app + the debug 
logs of asking for /, and asking for /a/uri/which/does/not/work ? Also, please 
add a Data::Dumper::Dumper to the Catalyst::Engine::prepare_path method - one 
at the start to dump $env, and two near the bottom to dump $c-request-uri and 
$c-request-base just after they've been assigned to…

Cheers
t0m


___
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