Re: [Catalyst] Using Komodo to edit/debug Catalyst

2016-12-10 Thread Kieren Diment
I just use perl -d from the console.

perl -d script/myapp.pl (or more modernly perl -d `which plackup`
myapp.psgi) and set breakpoints in the code with $DB::single=1 as
required.  See also LWP::Protocol::PSGI for serverless psgi deployment
mainly for use in test scripts.

On Sun, Dec 11, 2016 at 7:45 AM, Ken Beal  wrote:

> Hi,
>
> Years ago I used the ActiveState IDE Komodo to work with Catalyst.  I'd
> like to do this again, but am no longer at that employer so can't check the
> settings.
>
> I asked at the ActiveState Komodo forums but haven't gotten a good answer
> (last was "compare the env vars" which I did but didn't see any real
> differences, other than x86/x64, as Komodo appears to be an x86 app).
> http://community.komodoide.com/t/how-to-edit-catalyst-
> source-files-with-proper-syntax-checking/3204/7
>
> I figure asking here might provide a better answer since people here are
> "debugging Catalyst apps" so should be able to provide pointers to how to
> do so.  (Versus Komodo being used to debug a whole bunch of other stuff,
> i.e., I might have better luck with the domain knowledge here.)
>
> Thanks,
> Ken
> --
> "Look at what's happened to me;
> I can't believe it myself!"
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/
> catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] New view: ICal?

2016-03-04 Thread Kieren Diment
looks to me like you'd want Catalyst::Model::Adaptor + Data::iCal + an
optional very thin view that did something like:

$c->res->content_type($ical_content_type);
$c->res->body($c->stash->{calendar});

in the process method, and not much else.

The reason you don't see views for stuff like this much in catalyst land is
that this kind of thing is usually pretty simple.

On Fri, Mar 4, 2016 at 8:22 PM, Chris Welch  wrote:

> Thanks for the reply - may I ask what the model would be doing, given that
> presumably it would have to go through a view in the end anyway?  Because
> the data itself already exists in a model, all I'm wanting to do
> effectively is extract that and display it in a slightly different format,
> so I'm surprised that another model is the way to go - but then I've sort
> of been learning as I go with this stuff, so I may well be missing
> something fundamental!
>
> Thanks
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
___
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] From Development to Production.

2016-03-02 Thread Kieren Diment
As far as managing your perl/cpan version goes here's one low friction
solution:

1.  Make sure your dev box and production box are the same architecture.
2.  Use perlbrew or similar to install a perl to /opt/perl
3.  Copy the /opt/perl directory  between development and production
(rsync, make a deb and dpkg -i or whatever).
4.  Make sure your PATH environment variables are set correctly.

On Thu, Mar 3, 2016 at 7:23 AM, James Leu  wrote:

> It all comes down to the apps 'environment`.
>
> Do you remember when you started developing your catalyst app you had to
> install a bunch of perl modules?
>
> Those same modules (preferabbly the EXACT same versions as you installed
> on your development machine) need to be installed on your
> production machine.  Once you have the same 'environment'
> between dev and prod, then yeah, you can just 'copy' your
> app's source tree to prod, and it will "just work".
>
> The problem we run into is that CPAN is a moving target.
> Install Catalyst today might result in different versions
> of modules, then when you install catalyst to start you development.
> Those differences in versions of modules can result in complete
> failure of the app or small subtle changes in the way it runs, or even
> worse, exposes a new exploitable bug in your app.
>
> So consistency of you apps 'environment' between dev, production,
> and production a year from now, it one of the biggest challenges
> to your approach.
>
> You can look into things like Carton, PAR, FatPacker which will
> bundle up the perl environment for an App so you can
> deploy it.
>
> If you like to be 'ahead of the curve', start looking at using docker
> or atomic for each of you web apps.
>
> Best of luck
>
> On Wed, Mar 02, 2016 at 07:04:53PM -, Andrew wrote:
> > ---> Really looking to keep it simple stupid, to be fair.
> >
> > ---> Looks like a lot to learn atm, so am likely to just copy and paste
> > folders for the time being.
> >
> > ---> I got a bit confused here:
> >
> > As a baby-step prior to doing builds and auto deployment, you can
> > checkout your code from your production server(s).  While this is still
> > a manual step, it's probably better than copying folders and files.
> >
> > ---> If you're not doing an auto deployment, and you're not copying
> folders
> > and files, how are you checking out your code from the production server?
> >
> > Grateful for all the insights,
> >
> > Yours,
> > Andrew.
> >
> >
> >
> > - Original Message -
> > From: "Trevor Leffler" 
> > To: "The elegant MVC web framework" 
> > Sent: Wednesday, March 02, 2016 6:54 PM
> > Subject: Re: [Catalyst] From Development to Production.
> >
> >
> > Yes, that.  But to be a tad verbose about it...
> >
> > Use version control and branches (or whatever your VCS prefers).  Cut a
> > new branch whenever you want to create a new "release" for production.
> > This will let you switch from one branch to the next (upgrade) or back
> > again if things blow up.
> >
> > As a baby-step prior to doing builds and auto deployment, you can
> > checkout your code from your production server(s).  While this is still
> > a manual step, it's probably better than copying folders and files.
> >
> > Once you're there, start looking into "builds."  Generally folks use
> > some kind of Continuous Integration (CI) software that polls your VCS
> > for recent commits and then "kicks off a build."  The simplest thing it
> > might do is checkout the latest code revision and tar it up.  This
> > tarfile is a "build artifact" ready for you to deploy (i.e. copy into
> > production and untar).  Your work after this point is to figure out what
> > else you'd like to happen during a build -- run tests? create
> > documentation? do code inspections? -- and research how your build
> > artifacts could be automatically deployed.
> >
> > I'll echo Toomas in that there's a lot to learn here and keep you busy
> > depending on how far you want/can take it.
> >
> > Cheers,
> > --Trevor
> >
> >
> > On 03/02/2016 10:32 AM, Toomas Pelberg wrote:
> > > Go learn about version control and deployment automation, you can
> google
> > > these keywords and will likely be busy for the next few weeks ;-) it's
> a
> > > pretty wide and interesting reading
> > >
> 
> > > From: Andrew 
> > > Sent: ‎3/‎2/‎2016 20:17
> > > To: The elegant MVC web framework 
> > > Subject: [Catalyst] From Development to Production.
> > >
> > > So, I'm trying to learn Modern Perl workflows,
> > > and I heard it's best to do all your development on a development
> server,
> > > rather than mess around with code live, on the production server.
> > > So let's say I've coded my Catalyst app on a dev server, and it's in a
> > > folder called MyApp
> > > Do I just copy the MyApp folder to the Production Server?
> > > [Am likely to copy and paste the folder using Cyb

Re: [Catalyst] Keep Plack -r working when commandline closed...?

2015-10-27 Thread Kieren Diment
I would say having HUPONEXIT false would be the more exotic feature set in
this case.  tmux is actually a very good low rent low traffic short
lifespan application deployment strategy ;).

On Tue, Oct 27, 2015 at 6:21 PM, Octavian Rasnita 
wrote:

> Thanks. The conclusion is that if huponexit is set to false we can simply
> run processes in background appending & at the end of the command line.
> So we don't need tmux nor screen unless we need other features offered by
> them.
>
> --Octavian
>
> - Original Message -
> *From:* Lasse Makholm 
> *To:* The elegant MVC web framework 
> *Sent:* Monday, October 26, 2015 11:37 PM
> *Subject:* Re: [Catalyst] Keep Plack -r working when commandline
> closed...?
>
>
>
> On Mon, Oct 26, 2015 at 9:55 AM, Octavian Rasnita 
> wrote:
>
>> When I connect to Linux servers using SSH and run the programs using
>> perl program.pl > something.log 2>&1 &
>> then I can use the command exit to close the SSH console but the program
>> continues to run.
>> I remember that in past I needed to use nohup, but in last years I didn't
>> need it anymore.
>>
>> Is the SSH connection a special case but it doesn't work when using a
>> real bash console directly?
>>
>
> Sounds like the huponexit is not set in your shell:
>
> http://stackoverflow.com/questions/21294283/when-did-hup-stop-getting-sent-and-what-can-i-do-about-it
>
> /L
>
>
>>
>> --Octavian
>>
>> - Original Message -
>> *From:* Len Jaffe 
>> *To:* kie...@diment.org ; The elegant MVC web framework
>> 
>> *Sent:* Monday, October 26, 2015 5:13 AM
>> *Subject:* Re: [Catalyst] Keep Plack -r working when commandline
>> closed...?
>>
>> & just backgrounds a job. If you close the terminal, you lose job
>> control.
>> If you use tmux, you can close the terminal, but leave the session
>> running, and reattach to the session later.
>>
>> It is well work looking into.
>>
>> On Sat, Oct 24, 2015 at 1:29 AM, Kieren Diment  wrote:
>>
>>> Tmux is the poor man's deployment pathway ;).  I use it to keep long
>>> running jobs going between logins a lot too, as well as for having an
>>> editor in the right place from where I last left off.  All round a primo
>>> useful tool.  Also handy for persistent IRC connections etc.
>>>
>>> On Sat, Oct 24, 2015 at 3:24 PM, Andrew >> > wrote:
>>>
>>>> A further search online,
>>>> throws up that screen and tmux can be useful if the app you want to run
>>>> in the background needs input now and again.
>>>>
>>>>
>>>> - Original Message -
>>>> *From:* Andrew 
>>>> *To:* The elegant MVC web framework 
>>>> *Sent:* Saturday, October 24, 2015 5:06 AM
>>>> *Subject:* Re: [Catalyst] Keep Plack -r working when commandline
>>>> closed...?
>>>>
>>>>
>>>> Why is it better to use these over using an "&"?
>>>>
>>>> Or are you simply recommending them generally, due to their usefulness
>>>> all round?
>>>>
>>>> Yours,
>>>> Andrew.
>>>>
>>>>
>>>> - Original Message -
>>>> *From:* Kieren Diment 
>>>> *To:* The elegant MVC web framework 
>>>> *Sent:* Friday, October 23, 2015 10:48 PM
>>>> *Subject:* Re: [Catalyst] Keep Plack -r working when commandline
>>>> closed...?
>>>>
>>>> Tmux is generally newer and easier to use than screen, highly
>>>> recommended.
>>>>
>>>> On Sat, Oct 24, 2015 at 7:41 AM, Len Jaffe 
>>>> wrote:
>>>>
>>>>> I'd still consider using screen or tmux...
>>>>>
>>>>> On Fri, Oct 23, 2015 at 1:48 PM, Andrew <
>>>>> catalystgr...@unitedgames.co.uk> wrote:
>>>>>
>>>>>> Turns out it's super easy to run it in the background, =).
>>>>>>
>>>>>> You just add "&" to the end of the commandline, =D.
>>>>>>
>>>>>> ^_^ Am learning these little server tricks, ;-).
>>>>>>
>>>>>> [Tweeted Tatsuhiko Miyagawa of Plack fame, who was kind enough to
>>>>>> promptly
>>>>>> respond, with this little gem, =D. Yay!]
>>>>>>
>>>>>> Yours,
>>>>>> Andrew.
>>>>>>
>>>>

Re: [Catalyst] Keep Plack -r working when commandline closed...?

2015-10-23 Thread Kieren Diment
Tmux is the poor man's deployment pathway ;).  I use it to keep long
running jobs going between logins a lot too, as well as for having an
editor in the right place from where I last left off.  All round a primo
useful tool.  Also handy for persistent IRC connections etc.

On Sat, Oct 24, 2015 at 3:24 PM, Andrew 
wrote:

> A further search online,
> throws up that screen and tmux can be useful if the app you want to run in
> the background needs input now and again.
>
>
> - Original Message -
> *From:* Andrew 
> *To:* The elegant MVC web framework 
> *Sent:* Saturday, October 24, 2015 5:06 AM
> *Subject:* Re: [Catalyst] Keep Plack -r working when commandline
> closed...?
>
>
> Why is it better to use these over using an "&"?
>
> Or are you simply recommending them generally, due to their usefulness all
> round?
>
> Yours,
> Andrew.
>
>
> - Original Message -
> *From:* Kieren Diment 
> *To:* The elegant MVC web framework 
> *Sent:* Friday, October 23, 2015 10:48 PM
> *Subject:* Re: [Catalyst] Keep Plack -r working when commandline
> closed...?
>
> Tmux is generally newer and easier to use than screen, highly recommended.
>
> On Sat, Oct 24, 2015 at 7:41 AM, Len Jaffe 
> wrote:
>
>> I'd still consider using screen or tmux...
>>
>> On Fri, Oct 23, 2015 at 1:48 PM, Andrew 
>> wrote:
>>
>>> Turns out it's super easy to run it in the background, =).
>>>
>>> You just add "&" to the end of the commandline, =D.
>>>
>>> ^_^ Am learning these little server tricks, ;-).
>>>
>>> [Tweeted Tatsuhiko Miyagawa of Plack fame, who was kind enough to
>>> promptly
>>> respond, with this little gem, =D. Yay!]
>>>
>>> Yours,
>>> Andrew.
>>>
>>>
>>> - Original Message -
>>> From: "Trevor Leffler" 
>>> To: "The elegant MVC web framework" 
>>> Sent: Friday, October 23, 2015 4:28 PM
>>> Subject: Re: [Catalyst] Keep Plack -r working when commandline closed...?
>>>
>>>
>>> What about wrapping your shell session with screen?
>>>
>>> $ man screen
>>>
>>> --Trevor
>>>
>>> On 10/23/2015 08:21 AM, Andrew wrote:
>>> >
>>> > I've ended up using Plackup to start the catalyst app's psgi script
>>> (still
>>> > via fast cgi),
>>> > and I'm using -r to indicate it should watch for changes, and reload
>>> the
>>> > server when changes are detected.
>>> >
>>> > It does this fine, as long as my commandline terminal is still open.
>>> > The moment I close it, the server continues to run, yet any watching
>>> for
>>> > changes, killing, and restarting no longer happens (as far as I can
>>> tell).
>>> >
>>> > Is there any way to get Plack's scripts that watch and reload (i.e.
>>> > Restarter.pm, etc), to continue to run after I close OSX's terminal
>>> window
>>> /
>>> > end the SSH session?
>>> >
>>> >
>>> > Many thanks for any insights offered,
>>> >
>>> > Yours,
>>> > Andrew.
>>> >
>>> >
>>> > ___
>>> > 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/
>>>
>>
>>
>>
>> --
>> Len Jaffe - Information Technology Smoke Jumper -
>> lenja...@jaffesystems.com
>> 614-404-4214@LenJaffe <https://www.twitter.com/lenJaffe>
>> www.lenjaffe.com
>> Host of Code Jam 

Re: [Catalyst] Keep Plack -r working when commandline closed...?

2015-10-23 Thread Kieren Diment
Tmux is generally newer and easier to use than screen, highly recommended.

On Sat, Oct 24, 2015 at 7:41 AM, Len Jaffe 
wrote:

> I'd still consider using screen or tmux...
>
> On Fri, Oct 23, 2015 at 1:48 PM, Andrew 
> wrote:
>
>> Turns out it's super easy to run it in the background, =).
>>
>> You just add "&" to the end of the commandline, =D.
>>
>> ^_^ Am learning these little server tricks, ;-).
>>
>> [Tweeted Tatsuhiko Miyagawa of Plack fame, who was kind enough to promptly
>> respond, with this little gem, =D. Yay!]
>>
>> Yours,
>> Andrew.
>>
>>
>> - Original Message -
>> From: "Trevor Leffler" 
>> To: "The elegant MVC web framework" 
>> Sent: Friday, October 23, 2015 4:28 PM
>> Subject: Re: [Catalyst] Keep Plack -r working when commandline closed...?
>>
>>
>> What about wrapping your shell session with screen?
>>
>> $ man screen
>>
>> --Trevor
>>
>> On 10/23/2015 08:21 AM, Andrew wrote:
>> >
>> > I've ended up using Plackup to start the catalyst app's psgi script
>> (still
>> > via fast cgi),
>> > and I'm using -r to indicate it should watch for changes, and reload the
>> > server when changes are detected.
>> >
>> > It does this fine, as long as my commandline terminal is still open.
>> > The moment I close it, the server continues to run, yet any watching for
>> > changes, killing, and restarting no longer happens (as far as I can
>> tell).
>> >
>> > Is there any way to get Plack's scripts that watch and reload (i.e.
>> > Restarter.pm, etc), to continue to run after I close OSX's terminal
>> window
>> /
>> > end the SSH session?
>> >
>> >
>> > Many thanks for any insights offered,
>> >
>> > Yours,
>> > Andrew.
>> >
>> >
>> > ___
>> > 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/
>>
>
>
>
> --
> Len Jaffe - Information Technology Smoke Jumper -
> lenja...@jaffesystems.com
> 614-404-4214@LenJaffe 
> www.lenjaffe.com
> Host of Code Jam Columbus   -
> @CodeJamCMH 
> Curator of Advent Planet  - An
> Aggregation of Online Advent Calendars.
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Rackspace Ubuntu 14.04

2015-05-13 Thread Kieren Diment
On Thu, May 14, 2015 at 7:08 AM, Robert Brown  wrote:

>  One of my previous employers deployed with RPMs.
>
> And I never understood why.
>

RPMs work for us at the moment but that's because it's what our sysadmin
likes.  In previous jobs I've had a system wide perl compiled into
/opt/perl.  Haven't used the system perl for years, disk space is cheap and
the system perl is for system tasks.
___
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 Calendar... Grant proposal...

2015-01-18 Thread Kieren Diment
Installation is basically a one shot (especially if you have a
transportable perl compiled with perlbrew of Perl::Build).  A framework is
for life not just for a 5 minute "write a blog engine" demo.

On Sun, Jan 4, 2015 at 9:44 AM, Lance A. Brown  wrote:

> Robert Brown wrote on 1/3/2015 5:36 PM:
> > Is this something we can resolve, or simply make better as its install
> > process, that maybe needs explaining better?
>
> I don't think it can be resolved unless Catalyst wants to move in the
> same direction Mojolicious has taken, which I don't agree with.
>
> I hesitate to call it a warning, but some kind of note in the
> documentation and or at the beginning of the Catalyst install process to
> let the user know it will take some time would be useful.
>
> --[Lance]
>
> --
>  GPG Fingerprint: 409B A409 A38D 92BF 15D9 6EEE 9A82 F2AC 69AC 07B9
>  CACert.org Assurer
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Advent Calendar... Grant proposal...

2015-01-03 Thread Kieren Diment
umm from something they're *more* familiar with.

On Sun, Jan 4, 2015 at 7:43 AM, Kieren Diment  wrote:

> The catalyst docs could do with a substantial review, they haven't had
> much attention lately.  In particular there could do with being a good
> index.
>
> I think the issue with people thinking catalyst is too big/complex is that
> lots and lots of developers are used to a procedural approach to dealing
> with web applications, and have troulble with a couple of things. These are:
>
> 1.  Lots of people are in the habit of writing procedural web apps, and
> don't feel that they want to shift over to a more OO style.
>
> 2.  Some aspects of the dispatcher freak people out until they learn it
> (and especially until they get comfortable with chained) and this is a bit
> of a point of resistance.
>
> 3.  Catalyst used to be hard to install (and catalyst had a lot of
> influence on improving the cpan toolchain during the relatively early
> days), but this isn't the case any more, but the perception lingers in
> places.
>
> Maybe the solution is in part for someone to write a
> Catalyst::Manual::Unsweetened in the same sprit as
> Moose::Manual::Unsweetened in order to gently guide people towards catalyst
> from something they're less familiar with.
>
___
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 Calendar... Grant proposal...

2015-01-03 Thread Kieren Diment
The catalyst docs could do with a substantial review, they haven't had much
attention lately.  In particular there could do with being a good index.

I think the issue with people thinking catalyst is too big/complex is that
lots and lots of developers are used to a procedural approach to dealing
with web applications, and have troulble with a couple of things. These are:

1.  Lots of people are in the habit of writing procedural web apps, and
don't feel that they want to shift over to a more OO style.

2.  Some aspects of the dispatcher freak people out until they learn it
(and especially until they get comfortable with chained) and this is a bit
of a point of resistance.

3.  Catalyst used to be hard to install (and catalyst had a lot of
influence on improving the cpan toolchain during the relatively early
days), but this isn't the case any more, but the perception lingers in
places.

Maybe the solution is in part for someone to write a
Catalyst::Manual::Unsweetened in the same sprit as
Moose::Manual::Unsweetened in order to gently guide people towards catalyst
from something they're less familiar with.
___
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] Random thoughts on helper class generation

2014-01-30 Thread Kieren Diment
one of the problems is that once you have your chops, catalyst just gets out of 
your way, and you spend so little time in it compared to the real business 
logic and front end that most of the other problems you described vanish.  In 
my opinion that is.  But I tend to ignore the new great things until well after 
they're considered new.  It's basically my main coping strategy :)

On 30/01/2014, at 11:32 PM, Craig Chant wrote:

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


___
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] CLI execution

2013-12-12 Thread Kieren Diment
we use system calls for quite a few operations.  It works well in the context 
of our application.  Just be sure to use IPC::System::Simple for proper error 
handling.  I'm fond of using File::Temp and JSON or YAML encoding for shuttling 
data around different processes, but others may have different ideas.

On 13/12/2013, at 8:49 AM, Tadhg  wrote:

> Hi,
> 
>  
> I’m working on an information site for my company using Catalyst, MySQL and 
> am Windows. I’m looking for guidance on how to produce some reports. I have a 
> DB which I’m querying for general content/data, but for some reports the 
> information is only available via a CLI, so the question is how should I 
> query the command line?
> 
>  
> I’m guessing this should be done as part the model layer but I’m unsure of 
> what module to use, google just directs me to how to start the dev server and 
> I didn’t see anything on CPAN’s list of Catalyst Models. Any help would be 
> appreciated.
> 
>  
> This is all assuming I don’t just use back ticks or system, which I assume is 
> a bad idea as I don’t want the user waiting 30 seconds for a page to load.
> 
> Or I could just load the page and execute the report via a AJAX call back to 
> Catalyst using the a basic system call…
> 
>  
> -- 
> Regards,
> Tadhg
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/

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


Re: [Catalyst] Mocking PSGI layers in Test WWW Mechanize Catalyst

2013-10-31 Thread Kieren Diment


On 01/11/2013, at 12:26 PM, Toby Corkindale wrote:

> On 1 November 2013 12:01, Kieren Diment  wrote:
>> You mean you want two apps interacting with each other in the same script 
>> using WWW::MEchanize?  Eden and I were working some docs up on that topic 
>> until real life intervened.
>> 
>> This was the start of it:
>> 
>> http://paste.scsys.co.uk/273844
> 
> Not exactly -- in this case I have a PSGI layer that is supposed to
> inject some extra information into the env for consumption by the
> application.
> 
> A simple example would be if you had a PSGI layer providing, say,
> Basic HTTP auth, and setting the REMOTE_USER variable.
> Although in my case, there's a bit more to it than that.
> 
> T

Does the paste set you in the right direction?
___
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] Mocking PSGI layers in Test WWW Mechanize Catalyst

2013-10-31 Thread Kieren Diment
You mean you want two apps interacting with each other in the same script using 
WWW::MEchanize?  Eden and I were working some docs up on that topic until real 
life intervened.

This was the start of it:

http://paste.scsys.co.uk/273844

On 01/11/2013, at 11:39 AM, Toby Corkindale wrote:

> Umm, not that I know of.
> 
> I suppose another way to phrase the question is: Is there a way to
> manipulate the $c->engine->env in the Catalyst application, from
> within unit tests neatly?
> 
> On 1 November 2013 08:35, John Napiorkowski  wrote:
>> Not sure what you mean, is there an example in another framework you can
>> point to?
>> 
>> johnn
>> 
>> 
>> On Thursday, October 31, 2013 12:55 AM, Toby Corkindale 
>> wrote:
>> Hi,
>> I wondered if there's any prior art around on inserting (mocked) PSGI
>> layers into Test::WWW::Mechanize:Catalyst?
>> 
>> Cheers,
>> Toby
>> 
>> --
>> 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.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/
>> 
> 
> 
> 
> -- 
> 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.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


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


Re: [Catalyst] RE: change_session_id

2013-10-18 Thread Kieren Diment

On 19/10/2013, at 3:25 AM, Duncan Garland  wrote:

> Hi Russell,
> 
> That works in the simple case of a single process webserver. I'll report back 
> if there are any side-effects when we move it on to a multi-process 
> webserver. I don't see why there should be. I think you done me a big favour.
> 
> Looks like it's just an omission in the pod.
> 

Its not really an omission, its a bug - calling a pseudo private method 
($c->_something) from external code is naughty.

> Many thanks
> 
> Duncan
> 
> 
> From: Russell Jenkins [russell.jenk...@strategicdata.com.au]
> Sent: 18 October 2013 10:53
> To: The elegant MVC web framework
> Subject: Re: [Catalyst] RE: change_session_id
> 
> On 18/10/13 7:05 PM, Duncan Garland wrote:
>> Has anybody used this successfully?
> 
> We do use it in one project; the code in production looks like this:
> 
>   # New session id on successful auth.
>   $c->change_session_id;
>   $c->_session_store_delegate( undef ); # delete any cached delegate
> 
> Unfortunately I don't remember why the call to the
> "_session_store_delegate" was required. I'd go digging further if I
> wasn't madly packing for OSDC in a few hours :(  Just hope it helps!
> 
> Regards,
>   Russell.
> --
> Programmer,
> Strategic Data
> www.strategicdata.com.au
> 
> ___
> 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/


Re: [Catalyst] RE: change_session_id

2013-10-18 Thread Kieren Diment
If its a bug it would benefit from a minimal test case. If its not explained 
well in the docs it would benefit from an improvement there. Sorry, haven't 
used the feature myself. 

Sent from my phone, so please excuse spelling mistakes, brevity etc. 

On 18/10/2013, at 19:05, Duncan Garland  wrote:

> Has anybody used this successfully?
>  
> From: Duncan Garland [duncan.garl...@motortrak.com]
> Sent: 17 October 2013 10:05
> To: The elegant MVC web framework
> Subject: [Catalyst] change_session_id
> 
> Hi,
>  
> Is there a trick to using change_session_id to change the session id on a 
> successful logon?
>  
> It seems to correctly change everything. You can successfully print the old 
> session id and the new session id, and view the contents of the new session. 
> However, DBIC trips up when writing the final session data. It tries to use 
> the old session id. 
>  
> DELETE FROM mbfl2_sessions WHERE ( id = ? ): 
> 'session:bc58aff5ce5e8ba3a90402c0b57a9d5bcba8b532'
> DELETE FROM mbfl2_sessions WHERE ( id = ? ): 
> 'flash:bc58aff5ce5e8ba3a90402c0b57a9d5bcba8b532'
> UPDATE mbfl2_sessions SET expires = ?, session_data = ? WHERE ( id = ? ): 
> '1382007089', 
> 'BQgDCwoHZGVmYXVsdAxfX3VzZXJfcmVhbG0Ifwhub19jb3VudAoRMjY4NTk5XzEz
> ODE5OTk4NzENdGVtcF9xdW90ZV9pZAQDAApqYXZhc2NyaXB0BAMKBAMB
> CgdaNDI5MzkzFXJlZ2lzdGVydXNlci9yZWdpc3RlcgAAAB9tYmZsMjo6Q29udHJvbGxlcjo6
> UmVnaXN0ZXJVc2VyBAMBCgdaOTM2NjM1FWRpYWdub3N0aWNzL3Nob3dfZm9ybQAAAB5t
> YmZsMjo6Q29udHJvbGxlcjo6RGlhZ25vc3RpY3MEAwEKB1oxMTM1ODgMbG9naW4vaW5k
> ZXh4GG1iZmwyOjpDb250cm9sbGVyOjpMb2dpbgQDAwoHWjM3MTg1OQAAABFkZWFsZXIv
> Y29udGFjdF91cwoHWjA3NjA1OBlkZWFsZXIvb2ZmaWNpYWxfd29ya3Nob3BzCgdaODU5ODEw
> FmRlYWxlci9zZXJ2aWNlX29wdGlvbnMZbWJmbDI6OkNvbnRyb2xsZXI6OkRlYWxlcgQD
> AgoHWjE3NDE4NQZpbmRleHgKB1oyMDQ1MjAEaG9tZQAAABdtYmZsMjo6Q29udHJv
> bGxlcjo6Um9vdAQDAQoHWjM2MjcyMQAAABRubHB2ZWhpY2xlL2NhbGN1bGF0ZQAAAB1tYmZs
> Mjo6Q29udHJvbGxlcjo6TmxwVmVoaWNsZQQDAQoHWjc0MzU4MgAAABNyZWZyZXNoZGF0YS9y
> ZWZyZXNoHm1iZmwyOjpDb250cm9sbGVyOjpSZWZyZXNoRGF0YQQDAgoHWjY4MDgwNwAA
> ABpqYXZhc2NyaXB0L2dlbmVyYWxfd2l0aF9pZAoHWjE5MTQ2OQAAABFqYXZhc2NyaXB0L3NpZ25p
> bgAAAB1tYmZsMjo6Q29udHJvbGxlcjo6SmF2YXNjcmlwdAQDAQoHWjg4Mjc4MQAAABlsYW5k
> aW5ncGFnZS9sYW5kaW5nX3BhZ2UyHm1iZmwyOjpDb250cm9sbGVyOjpMYW5kaW5nUGFnZQQD
> BAoHWjA1MjQ1NQxubHAvcmVtaW5kZXIKB1oyMTc4NjYKbmxwL3NpZ25pbgoHWjgz
> MTY4Ng1ubHAvZ2V0X3ZhbHVlCgdaNjAwMDYxDW5scC9zZXRfdmFsdWUWbWJmbDI6
> OkNvbnRyb2xsZXI6Ok5scAtjc3JmX3Rva2VucwUTcGFzc3dvcmRfaXNfaW52YWxpZAoK
> MTM4MTk5OTg4OQlfX3VwZGF0ZWQEAwMKCDExNjE4MDc4C3RyYWNraW5nX2lkBAIA
> AAABBAMCChEyNjg1OTlfMTM4MTk5OTg3MQV2YWx1ZQoNdGVtcF9xdW90ZV9pZAtn
> bG9iYWxfbmFtZQdnbG9iYWxzChEyNjg1OTlfMTM4MTk5OTg3MQ10ZW1wX3F1b3RlX2lk
> CnRlbXBfcXVvdGUKCjEzODE5OTk4NzEJX19jcmVhdGVkBQAAACFpbmRpdmlkdWFsX2Rl
> YWxlcl9ncm91cF9wYXJhbWV0ZXIEAwAAABkKAUEGc3RhdHVzCgVBZG1pbghmb3JlbmFt
> ZQoTMjAxMC0xMi0wMiAxMToyMDo1MgxkYXRlX2NyZWF0ZWQFBGhlYXIFCWRhc2hf
> b25seQodZHVuY2FuLmdhcmxhbmRAbW90b3J0cmFrMi5jb20FZW1haWwFC25vdGJ5X3Bo
> b25lCitlckVGR1J4QVRhSE1XQWpwZEg5bTVjczYxdEZGTGZoNkpVZXJ5NjRpMnZvCHBhc3N3
> b3JkCgMxMjECaWQFD2FkcF9jdXN0b21lcl9pZAoBTgdpc19wb29sBQpub3Ri
> eV9wb3N0CgMxMjEKY2hhbmdlZF9ieQoTMjAxMy0xMC0xNCAxMzoxMTo1MwxkYXRlX3Vw
> ZGF0ZWQFC25vdGJ5X2VtYWlsCgFZD2p1c3RfY2hhbmdlZF95bgoFYWRtaW4IdXNl
> cm5hbWUKBUFkbWluB3N1cm5hbWUKAU4KZGVsZXRlZF95bgUSYWRwX3N0YXR1c19t
> ZXNzYWdlCgExEWhhc19oYXNoX3Bhc3N3b3JkBQlub3RieV9zbXMKAVkWYWRwX2N1
> c3RvbWVyX3RlbXBfZmxhZwoCTXIFdGl0bGUKAVMEdHlwZQZfX3VzZXI=
> ', 'session:bc58aff5ce5e8ba3a90402c0b57a9d5bcba8b532'
> [17/Oct/2013:09:51:29] ERROR Catalyst::__ANON__ 1968 - Caught exception in 
> engine "Can't update mbfl2::Model::DB::Mbfl2Session=HASH(0xb6f6948): row not 
> found at /usr/share/perl5/DBIx/Class/Schema.pm line 1088
> DBIx::Class::Schema::throw_exception('MBFL2SCHEMA=HASH(0x9ba66c0)', 
> 'Can\'t update mbfl2::Model::DB::Mbfl2Session=HASH(0xb6f6948):...') called at 
> /usr/share/perl5/DBIx/Class/ResultSource.pm line 1982
> 
> DBIx::Class::ResultSource::throw_exception('DBIx::Class::ResultSource::Table=HASH(0x9cade90)',
>  'Can\'t update mbfl2::Model::DB::Mbfl2Session=HASH(0xb6f6948):...') called 
> at /usr/share/perl5/DBIx/Class/Row.pm line 1460
> 
> DBIx::Class::Row::throw_exception('mbfl2::Model::DB::Mbfl2Session=HASH(0xb6f6948)',
>  'Can\'t update mbfl2::Model::DB::Mbfl2Session=HASH(0xb6f6948):...') called 
> at /usr/share/perl5/DBIx/Class/Row.pm line 506
> Is there something I need to set immediately after calling change_session_id?
>  
> Thanks
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.

Re: [Catalyst] Working a Solr Model -- Follow Up

2013-10-06 Thread Kieren Diment

On 06/10/2013, at 6:27 PM, John Karr  wrote:

> Rejected: Apache::Solr
> Returned a resultset that didn't work in Template::Toolkit, had write ugly 
> code to convert to array of hashrefs.
> I could not figure out how to use a filter query (they are absolutely 
> required for how I intend to use Solr).

Probably could have sorted this by passing the Solr resultset to a subref set 
to $c->stash.  so you end up with something like [% SET data =  
handle_stupid_resultset(data); WHILE (x = data.iterate); 'do stuff with ' _ x ; 
END;  %] in your template. It's the poor man's approach to putting new object 
models in the template rendering engine. ___
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 starter template

2013-08-20 Thread Kieren Diment
I agree, if perl isn't good for mangling text then what is?

The Catalsyt Devel code should be in a reasonable state for a volunteer to take 
it on should the itch need to be scratched badly enough.

On 20/08/2013, at 8:45 PM, Ynon Perek wrote:

> Hi John and All,
> 
> I like the templates idea - however I think chef is an overkill (not everyone 
> using catalyst know chef, and there's already a learning curve. Adding a new 
> technology may only make things harder on new users).
> 
> IMHO the best option would be to have several project templates on github, 
> and a user can just git clone a starter.  
> 
> Problem here is the application name needs to be modified in the process 
> (which really appears everywhere).
> 
> If we can work around that anyone will be able to write their own template  
> 
> --  
> כותב הרצאות ? מדבר מול קהל ? הבלוג שלי לומד לדבר 
> (http://publicspeakr.blogspot.co.il) כתוב במיוחד בשבילך
> 
> 
> On Monday, August 19, 2013 at 15:43, John Napiorkowski wrote:
> 
>> Ynon,
>> 
>> Yeah, the skeleton builder is showing its age a bit.  I personally never use 
>> it, but I see the need for something like this.
>> 
>> I've come to the conclusion that 'one starter to rule them all' isn't going 
>> to be very forward looking no matter what it looks like.  I was pondering 
>> something were people could easily make templates and skel on say github and 
>> people could point some sort of cmd line tool at it and just use their 
>> favorite authors way of doing it.  That way people could fork their favorite 
>> and tweak it a bit.  We could even have a repo on github with a list of all 
>> the know templates that the commandline tools would read and make it 
>> straight up to generate a new project.
>> 
>> On the other hand... maybe its silly to reinvent the wheel here.  Isn't this 
>> just what Chef and Puppet do?  Maybe we should just use that instead?  I 
>> personally have no issue using Python or Ruby for something as simple as a 
>> project builder, and it would solve some issues.  We'd even be able to make 
>> chef scripts to do stuff like set up common tables and all that (how many 
>> user/role tables have you made).
>> 
>> Of course Puppet/Chef might seem like terrible overkill as well.  Again, It 
>> would be nice to have a way for people to be able to easily create basic 
>> project templates and a little more, like setup mysql, etc.
>> 
>> Thoughts?
>> 
>> John
>> 
>>> From: Ynon Perek mailto:ynonpe...@gmail.com)>
>>> To: catalyst@lists.scsys.co.uk (mailto:catalyst@lists.scsys.co.uk)  
>>> Sent: Saturday, August 17, 2013 3:21 PM
>>> Subject: [Catalyst] Catalyst starter template
>>> 
>>> Hi All,  
>>> 
>>> After working with catalyst for some time, I found catalyst.pl 
>>> (http://catalyst.pl) too minimalistic for my needs.  
>>> 
>>> So I created a small script called ctstarter.pl (http://ctstarter.pl) that 
>>> adds some features to the base template you get for a new project. 
>>> Currently it adds:
>>> 
>>> 1. A starter DB and migrations (using DBIx::Class::Migration)
>>> 2. Code and DB tables for managing users and roles (using 
>>> CatalystX::SimpleLogin)
>>> 3. A Twitter Bootstrap web view with templates (using 
>>> Catalyst::Helper::View::Bootstrap)
>>> 4. Two helper scripts: one to upgrade the DB and the other to reset admin 
>>> password.
>>> 
>>> You can find the source and usage instructions here:
>>> https://github.com/ynonp/ctstarter.pl
>>> 
>>> Any feedbacks is appreciated.
>>> 
>>> Cheers,
>>>  Ynon
>>> 
>>> 
>>> 
>>> ___
>>> List: Catalyst@lists.scsys.co.uk (mailto: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 (mailto: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/


Re: [Catalyst] List of Applications using Catalyst

2013-06-08 Thread Kieren Diment

On 09/06/2013, at 4:33, Denny <2...@denny.me> wrote:

> I think people are building plenty of applications inside commercial
> environments, but not many that are publicly released.  People seem to
> use Catalyst to solve big and quite company-specific problems, rather
> than medium-sized generic problems.

Yes. This is absolutely correct. Catalyst apps service hundreds of millions of 
end users. 
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Slash character in argument of request URL

2013-04-08 Thread Kieren Diment
Slashes in urls that aren't path separators are a pain.  Avoid by adjusting 
your implementation.


On 08/04/2013, at 9:32 PM, Jaro Zajonc  wrote:

> I am currently testing it on a build-in development server. 
> So possibly its implementation is escaping it.
> 
> br,
> jaro
> 
> 
> 
> On 8 April 2013 12:52, Charlie Garrison  wrote:
> Good evening,
> 
> 
> On 8/04/13 at 12:28 PM +0200, Jaro Zajonc  wrote:
> 
> I'd expect that Catalyst would create 3 arguments out of it, however it
> will unescape last argument, and so I will have 4 arguments in reality.
> 
> Are you sure Catalyst is unescaping the argument and not the web server 
> itself? We had that problem with apache, so double-encoded the arg. But then 
> we switched to lighttpd and then double-encoding was a problem. Plus the dev 
> boxes handling it differently again we just made sure to avoid having slash 
> in the args (we encoded the whole arg to be free of any 'special' characters).
> 
> I'm interested in how others have handled this though since the encoding 
> we're doing makes for a very long arg.
> 
> Charlie
> 
> -- 
>Ꮚ Charlie Garrison ♊ 
> 
> O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
> 〠  http://www.ietf.org/rfc/rfc1855.txt
> 
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/

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


Re: [Catalyst] How Can I get online Catalyst web example project

2013-03-24 Thread Kieren Diment
via IRC:

05:21  catalyst examples
05:21  catalyst examples is 
http://dev.catalystframework.org/svnweb/Catalyst/browse/trunk/examples or svn 
checkout 
 http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/


On 25/03/2013, at 2:26 PM, Alejandro Imass wrote:

> On Tue, Mar 19, 2013 at 4:59 AM, 疾驰者 <78778...@qq.com> wrote:
>> 
>> Dear friends:
>>I have study catalyst framework for a long time. I read the book about
>> Perl DBI TT Catalyst and so on, and I can create a simple catalyst web
>> application.
>>Is there example application for learning catalyst more efficency?
>> Such as Musiczbrain for postgres.
>> 
>>thanks for any response!
>> 
> 
> You might fond something here:
> 
> http://wiki.catalystframework.org/wiki/resources/catalystexamples
> 
> or here:
> 
> http://wiki.catalystframework.org/wiki/catalystpoweredsoftware
> 
> I think if you follow Catalyst::Manual::Tutorial it guides you
> creating a complete application.
> 
> perldoc Catalyst::Manual::Tutorial
> 
> or click here:
> 
> http://search.cpan.org/~hkclark/Catalyst-Manual-5.9006/lib/Catalyst/Manual/Tutorial.pod
> 
>> 
>> Thai Heng from China
>> 
>> ___
>> 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/


Re: [Catalyst] Catalyst Actions precedence

2013-02-28 Thread Kieren Diment



On 28/02/2013, at 21:43, Nick Anderson  wrote:

> 
> 
>>> I presume then, that having a /*/... wildcard action to catch everything 
>>> else is not advisable? Is using the default action the preferred method 
>>> then to allow for unknown/dynamic URLs where an application defined action 
>>> is unavailable?
>> 
>> The usual thing to do with default is to catch 404 errors.
>> 
>> 
> 
> If the default action should only really be used for 404 errors, how should 
> one cater for URLs where the full path is dynamic and no part of it matches a 
> controller (chained) action? Is this inadvisable?
> 

No, I said the usual thing. If you want to do something else, that's probably 
fine too. 


> For example, I started having:
> 
> /pages/mypage1
> 
> with the controller/action match on "pages". But then I decided that it would 
> be nicer to eliminate the "pages" part (indeed one of my clients expressly 
> requested it be removed!):


You could alter the controller namespace, or the path part the chain matches, 
or make a base controller to remap specific controllers. 

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

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


Re: [Catalyst] Catalyst Actions precedence

2013-02-28 Thread Kieren Diment


On 28/02/2013, at 8:25 PM, Nick Anderson wrote:

> 
> Hi Trevor,
> 
> Many thanks for clarifying that. I guess I was hoping for some reliable and 
> predictable outcome for ambiguous requests but it seems the statement "Don't 
> do this" in the URL Path handling section does indeed sum it up! And although 
> it does not explicitly mention chained actions, I presume any URL path 
> ambiguity should/must be avoided.
> 

I think making it clear(er?) in the docs that if you're using Chained in a 
controller you shouldn't use any other dispatch type would be useful.  Where is 
the correct place for that to go?

> What I was trying to achieve was a catch-all facility for requests other than 
> application defined actions, up to root level (i.e. for user-specified URLs 
> which are then looked up in a database). For the life of me I can't remember 
> why I avoided using the "default" action to achieve this, probably because I 
> thought being more specific (even just by using a wildcard chain) was the 
> most appropriate way to approach it and more structured.


My preference is to keep Controller::Root very bare, but keep a default (i.e. 
404)  handler in there, and an index type action.  


> 
> I presume then, that having a /*/... wildcard action to catch everything else 
> is not advisable? Is using the default action the preferred method then to 
> allow for unknown/dynamic URLs where an application defined action is 
> unavailable?


The usual thing to do with default is to catch 404 errors.


___
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 Actions precedence

2013-02-27 Thread Kieren Diment

On 28/02/2013, at 8:20 AM, Nick Anderson  wrote:

> Hi,
> 
> please could someone explain how Catalyst determines the precedence of 
> actions, specifically in relation to the following simple chained example. It 
> doesn't behave in the way I would expect for requests numbered 4 and 6:
> 
> 1. http://127.0.0.1:3001/action0 => Matched action 0
> 2. http://127.0.0.1:3001/action0/abc => Matched XPages / pages
> 3. http://127.0.0.1:3001/action1 => Matched XPages / pages
> 4. http://127.0.0.1:3001/action1/abc => Matched XPages / pages
> 5. http://127.0.0.1:3001/actionx => Matched action x
> 6. http://127.0.0.1:3001/actionx/abc => Matched XPages / pages
> 
> The controllers are detailed below:
> 
> package TestApp::Controller::Root;
> use Moose;
> use namespace::autoclean;
> 
> BEGIN { extends 'Catalyst::Controller' }
> 
> __PACKAGE__->config(namespace => '');
> 
> sub site_base :Chained :PathPart('') :CaptureArgs(0) {
>my ($self,$c ) = @_;
> }
> 

You seem to have missed :Chained('site_base') from all the sub attributes below.

Check the DwarfChains app in the catalyst book code (chapter 7 available from - 
http://www.apress.com/downloadable/download/sample/sample_id/205/ ) for an 
example along the same lines of yours that works.

> sub action0 :Path('action0') :Args(0) {
>my ($self,$c ) = @_;
>$c->response->body( "Matched action 0" );
> }
> 
> sub action1 :Path('action1') :Args(1) {
>my ($self,$c ) = @_;
>$c->response->body( "Matched action 1" );
> }
> 
> sub actionx :Path('actionx') :Args() {
>my ($self,$c ) = @_;
>$c->response->body( "Matched action x" );
> }
> 
> sub end : ActionClass('RenderView') {}
> 
> __PACKAGE__->meta->make_immutable;
> 
> 1;
> 
> package TestApp::Controller::XPages;
> use Moose;
> use namespace::autoclean;
> 
> BEGIN {extends 'Catalyst::Controller'; }
> 
> sub base : Chained( '/site_base' ) : PathPart('') : CaptureArgs( 1 ) {
>my ( $self, $c ) = @_;
> }
> 
> sub pages : Chained( 'base' ) : PathPart('') : Args() {
>my ( $self, $c ) = @_;
>$c->response->body('Matched XPages  / pages');
> }
> 
> __PACKAGE__->meta->make_immutable;
> 
> 1;
> 
> 
> Thanks for any help you can give
> 
> Nick Anderson
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


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


Re: [Catalyst] Newbie questions regarding nginx/fastcgi configuration

2012-12-16 Thread Kieren Diment


On 17/12/2012, at 9:09 AM, Victor Cassen wrote:

> Hi,
> 
> I am trying to deploy my first Catalyst application using nginx, and I am
> confused by various sources of documentation as to whether or not I'm
> required to run a separate fastcgi wrapper, or whether script/
> myapp_fastcgi.pl *is* my wrapper.  If I do need a separate wrapper, is
> there one that is preferred?
> 

The *fastcgi.pl is your wrapper.

The source of your confusion is that you probably want a way to stop and start 
it cleanly.  I've heard people like daemontools for that, although the wrong 
and filthy way to do it is to run the fastcgi script in a screen session.


___
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-21 Thread Kieren Diment
Typically the deadline is the day that the article is due.

Commits go into 
http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/CatalystAdvent (into 
the dir root/2012/pen)

Couldn't get momentum for the monthly this year, but I do have a couple of 
things that could be used for the advent that never got the required polish.  

On 22/11/2012, at 4:17 AM, Duncan Garland wrote:

> What was the decision? Is this going ahead?
> 
> How do you submit articles? When is the deadline?
> 
> -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/
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


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


Re: [Catalyst] Unable to output anything in Root.pm -> 'auto'

2012-10-30 Thread Kieren Diment


On 30/10/2012, at 11:00 PM, 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.
> 

Be sure to use DBIx::Connector for connection management 
(https://metacpan.org/search?q=DBIx%3A%3AConnector), thus you get one of the 
compelling DBIC features but still get to use DBI.

> 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('Sorry, system is currently undergoing 
> maintenance.Please try again later.' );
>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();
>>

Re: [Catalyst] I'm loosing the plot here? - Controller behaviour that makes no sense

2012-10-30 Thread Kieren Diment
So it doesn't really matter that you eventually don't intend to use TT, you 
still need a solid grounding in the core concepts which the tutorial will give 
you.  Right now you're trying to pay attention to too many things at once.  Go 
through the tutorial.  Investment of 2-3 hours in that will save you many hours 
of head scratching down the track.

Meanwhile a quick search on cpan for Catalyst::View::HTML::Template will find 
you what you need.

On 31/10/2012, at 7:27 AM, Craig Chant wrote:

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

Re: [Catalyst] Trapping added errors with the correct caller

2012-10-15 Thread Kieren Diment
I've had a lot of luck with Log::Contextual recently.  It's nice for easily 
getting logging into model classes.

On 16/10/2012, at 1:21 AM, Alexander Hartmaier wrote:

> I recommend to use a logging module like Log::Log4perl::Catalyst and do
> all your app logging there.
> 
> My log package for NAC::Web:NAC looks like this:
> 
> package NAC::Web::NAC::Log;
> use Moose;
> use Catalyst::Log;
> use namespace::autoclean;
> 
> BEGIN { extends 'Log::Log4perl::Catalyst'; }
> 
> =head1 NAME
> 
> NAC::Web::NAC::Log - Logger for NAC::Web::NAC
> 
> =cut
> 
> # import _dump method from Catalyst::Log
> *_dump = \&Catalyst::Log::_dump;
> 
> 1;
> 
> My app uses it with:
> 
> =item finalize_config
> 
> Initializes the logger after the config file merging and loading is done.
> 
> =cut
> 
> sub finalize_config {
>my $class = shift;
>$class->next::method(@_);
>$class->log(NAC::Web::NAC::Log->new($class->config->{log}));
> }
> 
> # Start the application
> __PACKAGE__->setup();
> 
> around 'prepare' => sub {
>my $orig = shift;
>my $self = shift;
> 
>Log::Log4perl::MDC->remove();
> 
>my $c = $self->$orig(@_);
> 
>Log::Log4perl::MDC->put( "username", $c->user->username )
>if $c->user_exists;
> 
>return $c;
> };
> 
> And this is how the app's prod config file looks like:
> 
> 
>log4perl.logger "WARN, FILE, MAIL"
>log4perl.appender.FILE
> "Log::Log4perl::Appender::File"
>log4perl.appender.FILE.filename
> "/home/nac/log/nac-web-nac.log"
>log4perl.appender.FILE.utf8 1
>log4perl.appender.FILE.syswrite 1
>log4perl.appender.FILE.layout
> "Log::Log4perl::Layout::PatternLayout"
>log4perl.appender.FILE.layout.ConversionPattern "%d{-MM-dd
> HH:mm:ss} %-5p %X{username} %m%n"
>log4perl.appender.MAIL
> "Log::Dispatch::Email::MailSend"
>log4perl.appender.MAIL.ThresholdERROR
>log4perl.appender.MAIL.from "n...@domain.com"
>log4perl.appender.MAIL.to
> "app-err...@domain.com"
>log4perl.appender.MAIL.subject  "[NAC::Web::NAC]
> errors"
>log4perl.appender.MAIL.buffered 0
>log4perl.appender.MAIL.layout   "PatternLayout"
>log4perl.appender.MAIL.layout.ConversionPattern "%d{-MM-dd
> HH:mm:ss} %-5p %X{username} %m%n"
> 
> 
> Best regards, Alex (abraxxa)
> 
> On 2012-10-11 14:38, Robert Rothenberg wrote:
>> I would like to trap every error added to $c->error() and log it, noting the
>> caller (filename, line number) in the logs.
>> 
>> I've not gotten Catalyst::Plugin::ErrorCatcher to work, so I wrote my own
>> plugin that overrides $c->error with the following method:
>> 
>>  use MRO::Compat;
>>  use namespace::autoclean;
>> 
>>  sub error {
>>my ($c, @args) = @_;
>> 
>>foreach my $arg (@args) {
>>if ($arg) {
>> 
>>$c->log->error($arg);
>>}
>>}
>> 
>>return $c->next::method(@args);
>> }
>> 
>> But this only logs errors as coming from my plugin.
>> 
>> Using Sub::Uplevel or fiddling with $Log::Dispatch::CallerDepth or
>> $Catalyst::Plugin::Log::Dispatch::CallerDepth doesn't seem to work.
>> 
>> I also tried writing the plugin as a Moose::Role that adds my trap before
>> error, but then it claims to be from one of the internal Moose classes in my
>> logs.
>> 
>> I can manually get the caller using caller(0) and add them to the log
>> messages, but that's a bit clumsy (and overrides log formats that don't
>> include the information).
>> 
>> So... what is the best practice for trapping errors in a way that preserves
>> caller information?
>> 
>> 
>> ___
>> 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/


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

Re: [Catalyst] Using Catalyst on MS SQL DB that has tables with no primary keys

2012-09-15 Thread Kieren Diment
And this answer demonstrates perfectly to your managers that their conception 
of 'database' is broken. 

--
Sent from my phone, so apologies for any spelling errors, brevity, etc. 

On 15/09/2012, at 12:38, Darren Duncan  wrote:

> Brian Katzung wrote:
>> If I recall correctly, I read in a cookbook somewhere (can't seem to find it 
>> now) that for rows with no primary key, you can use:
>> __PACKAGE__->set_primary_key(__PACKAGE__->columns);
>> (making the entire row be a multi-column primary key).
> 
> Well that is indeed how things should work; when there is no primary or 
> unique key explicitly defined, there should be an implicit one ranging over 
> all the columns.  However, SQL doesn't work that way and would allow 
> duplicate rows, and so then the question is what behavior do you expect your 
> Perl layer to have?  If you edit a duplicate row, is it supposed to change 
> all copies or just one? -- Darren Duncan
> 
>> On 2012-09-14 14:53, Derek W wrote:
>>> Ah, you meant just on Catalyst side, to tell it that the id column is
>>> the primary.  I didn't think of that.  Thanks!  I'll give that a shot.
>>> 
>>> On Fri, Sep 14, 2012 at 11:40 AM, Robert Wohlfarth
>>>  wrote:
 On Fri, Sep 14, 2012 at 1:31 PM, Derek W  wrote:
> Thanks, I figured that would probably fix it, but the problem is I am
> not allowed to make any changes to the DB structure itself.  I suppose
> I need to convince them why it's in the best interest to have a
> primary key...
> 
 You can set the primary key in the schema file. For example, add a line 
 like
 __PACKAGE__->set_primary_key( "id" ); to 
 lib/MyApp/Schema/Result/MyTable.pm.
 You do not need to change the database. DBIx::Class will then use id
 whenever it wants a primary key.
 
 -- 
 Robert Wohlfarth
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/

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


[Catalyst] Catalyst Monthly: Plack tips and tricks please

2012-05-03 Thread Kieren Diment
HI everybody,

As you will no doubt have noticed, the April Catalyst Monthly is late.  To help 
rememdy this situation, I'd really appreciate your tips and tricks for using 
Plack and Catalyst together.  I'm particularly interested in smart things that 
can be done to streamline development, but any suggestions/examples you have 
would be more than welcome (and I'll credit where it's due).  Reply to the 
list, to me personally or grab me (kd) on #catal...@irc.perl.org


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


Re: [Catalyst] All actions marked as Private and are being ignored

2012-04-02 Thread Kieren Diment
As Tom says, that's expected behaviour.  Auto is for bailing (e.g. if auth 
fails).

On 02/04/2012, at 7:43 PM, abhishek jain wrote:

> Hi Kieren,
> 
> I just found if in auto action I add 
> 1;
> Add end of code, the code works fine and the requested action is executed
> If i don't return  a value , the code ignores the requested action and end
> action is called.
> 
> Don't know why, any suggestions,
> So
> sub auto : Private {
> #...
> 
> 1;
> }
> Works fine
> 
> And 
> 
> sub auto : Private {
> ...
> }
> Fails.
> 
> Thanks
> Abhi 
> 
> 
> -Original Message-
> From: Kieren Diment [mailto:dim...@gmail.com] 
> Sent: 02 April 2012 11:55
> To: The elegant MVC web framework
> Subject: Re: [Catalyst] All actions marked as Private and are being ignored
> 
> 
> 
> On 02/04/2012, at 4:18 PM, abhishek jain wrote:
> 
>> Hi,
>> 
>> I am finding a strange situation. 
>> 
>> If i restart my catalyst application,i find in debug messages, all of 
>> my actions are marked as Private.
>> 
>> Also if i execute the code, then it will execute the auto and end 
>> functions and bypasses the called action.
>> 
>> 
>> 
>> Ie. If i call /search . It will run auto, end and will ignore search
> action.
>> 
>> 
>> 
>> Dont know why,
>> 
>> What info will you guys need from me to help me?
> 
> 
> Why don't you try to write a minimal test case demonstrating your problem?
> Is this with the dev server?  Is it with some front end deployment?
> ___
> 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/


Re: [Catalyst] All actions marked as Private and are being ignored

2012-04-01 Thread Kieren Diment


On 02/04/2012, at 4:18 PM, abhishek jain wrote:

> Hi,
> 
> I am finding a strange situation. 
> 
> If i restart my catalyst application,i find in debug messages, all of my
> actions are marked as Private.
> 
> Also if i execute the code, then it will execute the auto and end functions
> and bypasses the called action.
> 
> 
> 
> Ie. If i call /search . It will run auto, end and will ignore search action.
> 
> 
> 
> Dont know why,
> 
> What info will you guys need from me to help me?


Why don't you try to write a minimal test case demonstrating your problem?  Is 
this with the dev server?  Is it with some front end deployment?
___
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] Questions If You Please

2012-03-02 Thread Kieren Diment
It's difficult to answer this without more details on your use case, but here 
goes.

On 03/03/2012, at 7:50 AM, James D Bearden wrote:

> Hello All, 
> 
> My definitive guide to Catalyst should arrive on my doorstep shortly,
> but until then if somebody could answer a few questions for me it would
> be greatly appreciated:
> 
> 2) I am evaluating catalyst to replace our current perl server written
>from scratch. By that I mean we wrote a lot of code in order to
>implement libraries that didn't exist on CPAN at the time.
>Our server code that is dedicated to talking to the client is a
>small subset of our total perl code. Therefore the "server" will be
>merely part of that greater code base, but the default catalyst
>structure seems to assume other code will fall underneath *it*. For
>example, with us the test scripts and static web content are checked
>into a separate spots, and a lot of our scripts expect stuff to be
>in a specific spot. My question is, how can I muck with the default
>catalyst directory structure? In other words, can I tweak 
>myapp.psgi or something to define the lib, root, and test
>directories to be named something else and be somewhere else? 

I'm not sure what you're trying to achieve here.  Do you have dispatch stuff 
you want to preserve? If keep it separate during the porting process with 
clever web server configuration.  Do you have non-cpan libraries that you want 
to use?  use lib '/path/to/where/they/live' in MyApp.pm.   Is there some more 
exotic use case that you haven't explained?  Would it be solvable by 
Catalyst::Controller::WrapCGI or Catalyst::Controller::CGIBin, or could you 
look at Catalyst::Controller::MovableType and get some ideas from that?

Overriding the template location is usually done through configuration.

> 3) Also, the automatic restart of the developer server is a great
>feature I plan to have to do without because I can't figure out how
>to modify myapp_server.pl to let it know where I will have moved all
>the various bits to. So unless somebody can tell me how to do that I
>plan on just using plackup or starman for development, and
>restarting manually. Which is what we are used to doing right now.

I've never found the restarter terribly useful.  Once you work out the 
structure of your app as per question 1 this should all come out in the wash 
though if you do find it useful.


> 4) Finally, our current system relies on a more or less stock SSL over
>TCP socket for secure transport. I already have the conversion from
>a TCP socket connection to stateless HTTP working with minimal
>impact to our current codebase, but not the SSL to HTTPS. I see
>there is a module to require a secure connection, but is there no
>module to actually provide the secure connection? In other words, to
>use HTTPS do I need to proxy through a web server because there is
>no way for something like starman to do that by itself? What is
>complicating matters is our client is a thick Java application, so
>if there is no way then I would rather just build in some sort of
>mechanism to disable HTTPS for development rather than set up a
>HTTPS capable development web server.

I think you would want some custom plack middleware for this.

> 
> I also have a bajillion questions about deployment, but hopefully the
> book will shed some light on that. In case you are wondering, I am
> hoping to be able to use Catalyst because we plan to transition to a
> light client, and using Catalyst would make that less painful.



___
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 edition of The Definitive Guide to Catalyst?

2012-03-01 Thread Kieren Diment


On 01/03/2012, at 8:54 PM, Willi Schiegel wrote:

> Hello,
> 
> does anybody know whether there will be a new edition of this book with all 
> the new things 5.9 has? Since I am new to all this Perl web framework stuff 
> and especially PSGI it would be very helpful to have one source to start 
> learning.
> 

Basically the book is fine for 5.9.  I'm not aware of any overt bad practice 
advertised in the book that would have been exposed by 5.9.  The PSGI stuff is 
mostly internal, and the book is basically not about internals.  I guess the 
deployment chapter could do with a bit of an update from that perspective, but 
that's a small part of what the book covers, and the deployment recipes in the 
book will still work fine.

I was thining about a 2nd edition in 2013 depending on what else I've got on by 
then.  I can rule one out for this year, unless the publisher agitates to get 
one going ASAP and manages to find someone else to take over (which I think is 
unlikely right now).



___
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] (no subject)

2012-02-28 Thread Kieren Diment


On 29/02/2012, at 12:03 AM, Johannes Kilian wrote:

> Hi,
> 
> I've got following question concerning views: I want to provide an XML-View 
> which provides "standard" XML-Files using XML::Simple in almost any case. 
> Just in some cases I want to provide specialized XML-Files.
> 
> In other words: I want to use XML::Simple as default handler - which is 
> overriden by a specialized XML Generator in some cases ...
> 
> Within my controller I do have something like this:
> 
> __PACKAGE__->config(
>  'default'   => 'text/html',
>  'stash_key' => 'rest',
>  'map'   => {
>'text/html' => [ 'View', 'TT', ],
>'text/xml'  => [ 'View', 'XML', ],
>#'text/xml'   => 'XML::Simple',
>  }
> );
> -
> 
> I cannot figure out how to set XML::Simple as default handler and override 
> this for certain URLs within the same controller whilst for other URLs within 
> the same controller the default XML-Handler is used 
> 
> Is this possible at all?
> How can I do this?

I'd either use Catalyst::View;:Download::XML, or steal from it to create your 
own view: https://metacpan.org/module/Catalyst::View::Download::XML
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst 5.90010 server must be in CWD to run?

2012-02-22 Thread Kieren Diment


On 23/02/2012, at 12:30 PM, Charlie Garrison wrote:

> Good afternoon,
> 
> On 22/02/12 at 10:48 AM -0800, Louis Erickson  wrote:
> 
>> Which suggests there is, indeed a bug, as there's a Makefile.PL in the same 
>> directory as lib, right where catalyst.pl put it.
>> 
>> Given the additional information you provided, it's possible for someone 
>> else to debug this and maybe help solve the problem.
> 
> I'm far from understanding the internals in this case, but I think it's the 
> Makefile that's wanted, not Makefile.PL. Try running `perl Makefile.PL` to 
> create the Makefile.
> 
> Of course, those who understand better might want to clarify/correct that.
> 

Nope it's the Makefile.PL that's required.

My understanding was that a recent release of catalyst had a bug that meant 
that the scripts couldn't infer the location of the app's lib directory.  It 
seems to be fixed in version 5.90010 as per this changes file:

https://metacpan.org/source/MSTROUT/Catalyst-Runtime-5.90010/Changes
___
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] nginx/FastCGI configuration issues

2012-02-16 Thread Kieren Diment


On 16/02/2012, at 4:02 AM, Jesse Sheidlower wrote:

> 
> Executive summary: new deployment on nginx 1.0.5 and FastCGI; my
> Catalyst apps are in non-root locations. When I go to the base, e.g.
> http://mysite.com/incomings, $c->req->uri thinks I'm at
> http://mysite.com/incomings//incomings. This is causing problems with
> redirects.
> 
> I'm in the process of moving a physical server to a VM in EC2, and have
> taken the opportunity to move my Cat apps from Apache/mod_perl to
> nginx/FastCGI. The latter combination is proving to be vastly faster.
> The server is running Ubuntu 11.10, and nginx 1.0.5.
> 
> I am having one issue that I can't resolve, however. When I first visit
> an app at its root, e.g. http://mysite.com/incomings, I get redirected
> over SSH to https://mysite.com/incomings/login. After successful login I
> am then returned to http://mysite.com/incomings//incomings. A bunch of
> testing and logging has revealed that when I first hit the site,
> $c->req->uri thinks that I'm at http://mysite.com/incomings//incomings,
> so the redirect is indeed going to where it thinks it originally was.


Can you provide a minimal test app?  Something that followed the pattern of 
t/optional-lighttpd|apache*t tests in Catalyst-Runtime would be useful (to 
polish and fold into Catalyst--Runtime in due course), but not essential.  As a 
minimum, a minimal app exposing the problem with a documented way to run a 
self-contained nginx/fastcgi instance would be useful.

Having said that I found the following two things about django online that 
suggest a similar problem over there:

http://serverfault.com/questions/134863/nginx-fastcgi-problems-with-django-double-slashes-in-url
http://stackoverflow.com/questions/4056967/django-double-slash-in-urls-issue-multiple-webservers-apache-and-nginx



___
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] Using Test::WWW::Mechanize::Catalyst on a test database

2012-02-15 Thread Kieren Diment


On 16/02/2012, at 9:45 AM, Robert Rothenberg wrote:

> On 15/02/12 16:03 Jesse Sheidlower wrote:
>> On Wed, Feb 15, 2012 at 03:25:51PM +, Robert Rothenberg wrote:
>>> I would like to use Test::WWW::Mechanize::Catalyst with an alternative
>>> database schema (since I want to test reading and writing on a database with
>>> the same schema but known data that is not the live database), but it's not
>>> clear to me from reading the documentation on how to do this, or even if
>>> it's possible.
>> 
>> Very much so. Have you looked at
>> 
>> http://search.cpan.org/~hkclark/Catalyst-Manual-5.9002/lib/Catalyst/Manual/Tutorial/08_Testing.pod#SUPPORTING_BOTH_PRODUCTION_AND_TEST_DATABASES
> 
> This isn't working. It's clearly trying to load the myapp_testing.conf file
> (because it complains if I put in syntax errors), but the database
> connection info is not being overridden, and it's wiping the production
> database.

Can you produce a minimal test case demonstrating this and put it on the RT 
queue for Catalyst::Manual please?

Meanwhile read the email I sent to you privately for a comprehensive rock solid 
solution which I will finally write up for public consumption :)
___
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] Using Test::WWW::Mechanize::Catalyst on a test database

2012-02-15 Thread Kieren Diment


On 16/02/2012, at 3:29 AM, Robert Rothenberg wrote:

> On 15/02/12 16:03 Jesse Sheidlower wrote:
>> On Wed, Feb 15, 2012 at 03:25:51PM +, Robert Rothenberg wrote:
>>> I would like to use Test::WWW::Mechanize::Catalyst with an alternative
>>> database schema (since I want to test reading and writing on a database with
>>> the same schema but known data that is not the live database), but it's not
>>> clear to me from reading the documentation on how to do this, or even if
>>> it's possible.
>> 
>> Very much so. Have you looked at
>> 
>> http://search.cpan.org/~hkclark/Catalyst-Manual-5.9002/lib/Catalyst/Manual/Tutorial/08_Testing.pod#SUPPORTING_BOTH_PRODUCTION_AND_TEST_DATABASES
> 
> So this requires maintaining two database schemas?
> 
> (I guess I could have the script deploy to the test schema, though.)

I'm planning on writing up a fairly neat solution to this problem shortly (it's 
supposed to be the first article in the catalyst advent replacement).

But I'll note here that you can get DBIC Schema deployments (rather than SQL 
file deploys) working so long as enough metadata gets shoved into the Result 
classes.  Of course this requires up front effort, and is unlikely to be 
worthwhile for a brown field project with a complex existing database.
___
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] Best way to install upgrade to FC12 (or how to get by a failing CPAN upgrade)

2012-02-13 Thread Kieren Diment


On 13/02/2012, at 11:56 PM, Evan Carew wrote:

> Thanks for the suggestion. Compiling my own perl build was really a last
> ditch option I regarded as admitting defeat, i.e., fixing / finding the
> actual problem wa deemed to difficult.
> 

I used to think that too.  Now (given I strongly prefer the relocatable perl 
approach) I find that I very rarely need to build a new perl.  And it saves me 
many headaches with worrying about, and fighting with the system perl.  
Especially with cpanminus.  But I am me and you are you.  I take the blame[1] 
for local perl infrastructure on debian, ubuntu, os x, windows and solaris 
systems, and this approach works well for me (I use strawberry relocatable for 
windows, which means I find solaris a bigger headache than windows for the most 
part - the others are pretty much incident free).  Now that we have cpanminus I 
would never go back to OS package manager based systems if I could help it.

[1] Blame is not the same as responsibility.

> Late last night, after going through the build logs in much greater detail,
> I noticed that a number of packages were asking for module builder of a
> recent vintage. Turns out that this was the root of the problem. Module
> builder needed to update itself, however, somewhere along the line, module
> builder broke its ability to update itself more than one point release at a
> time. Once I fixed this, Catalyst updated just fine.

> On Feb 13, 2012 1:48 AM, "Kieren Diment"  wrote:
> 
>> On 13/02/2012, at 1:32 PM, Evan Carew wrote:
>> 
>>> I have the older Catalyst packages for my stock FC12 laptop installed,
>> and
>>> I've failed to upgrade them twice already. The question I have is what's
>>> the best way to get the latest Catalyst installed on my linux box. Do I
>>> need to clear out perl entirely, and start from scratch, or is there some
>>> not-so-well-known procedure besides CPAN to upgrade to the latest.
>> 
>> 1. Compile your own perl to /usr/local/bin or a relocatable perl
>> 
>> 1a If relocatable also install and configure local::lib (mainly because of
>> shebang issues and relocatable perl) (optionally install and configure
>> local::lib anyway).
>> 
>> 2. Update your PATH variable if necessary.
>> 
>> 3. Install App::Cpanminus.
>> 
>> 4.  Leave the system perl alone for system utilities.
>> ___
>> 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/


Re: [Catalyst] Best way to install upgrade to FC12 (or how to get by a failing CPAN upgrade)

2012-02-12 Thread Kieren Diment
On 13/02/2012, at 1:32 PM, Evan Carew wrote:

> I have the older Catalyst packages for my stock FC12 laptop installed, and
> I've failed to upgrade them twice already. The question I have is what's
> the best way to get the latest Catalyst installed on my linux box. Do I
> need to clear out perl entirely, and start from scratch, or is there some
> not-so-well-known procedure besides CPAN to upgrade to the latest.

1. Compile your own perl to /usr/local/bin or a relocatable perl

1a If relocatable also install and configure local::lib (mainly because of 
shebang issues and relocatable perl) (optionally install and configure 
local::lib anyway).

2. Update your PATH variable if necessary.

3. Install App::Cpanminus.

4.  Leave the system perl alone for system utilities.
___
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] Single-domain multi-shop, multi-gateway; linked to the one shopping-cart

2011-12-06 Thread Kieren Diment


On 06/12/2011, at 22:44, Tomas Doran  wrote:

> 
> On 6 Dec 2011, at 11:06, Alec Taylor wrote:
> 
>> On Tue, Dec 6, 2011 at 9:21 PM, Kieren Diment  wrote:
>>> 
>>> 
>>> On 06/12/2011, at 9:06 PM, Tomas Doran wrote:
>>> 
>>>> If you're making the technology choice, and you haven't got production 
>>>> experience building and maintaining large scale web apps on one of the 
>>>> platforms you're picking from - then you're the wrong person to be making 
>>>> that choice.
>>> 
>>> I'd be less absolute than that.  I'd say *probably* the wrong person.
>> 
>> I am building this project with one other person. Neither off us have
>> experience with web-frameworks.
>> 
>> I've done some work with CGI Python in the past (building a minuscule
>> social-network with video-conferencing), but mostly my talent lies in
>> C++.
> 
> I'd recommend going with Python then, if that's the language you both know 
> best.
> 
> Having to learn both the language and the framework(s) at the same time is 
> going to be massive pain ;)
> 

On the other hand i think it's all about the libraries. If you're going to have 
to carve more home grown hand made wheels/libraries with python, then that's 
going to be a massive pain too.  Ymmv. 
___
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] Single-domain multi-shop, multi-gateway; linked to the one shopping-cart

2011-12-06 Thread Kieren Diment


On 06/12/2011, at 9:06 PM, Tomas Doran wrote:

> If you're making the technology choice, and you haven't got production 
> experience building and maintaining large scale web apps on one of the 
> platforms you're picking from - then you're the wrong person to be making 
> that choice.

I'd be less absolute than that.  I'd say *probably* the wrong person.
___
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] Single-domain multi-shop, multi-gateway; linked to the one shopping-cart

2011-12-06 Thread Kieren Diment


On 06/12/2011, at 7:07 PM, Alec Taylor wrote:

> On Tue, Dec 6, 2011 at 6:15 AM, Denny <2...@denny.me> wrote:
>> On Mon, 2011-10-31 at 02:38 +1100, Alec Taylor wrote:
>>> Good morning,
>>> 
>>> How would I go about integrating/developing a multi-levelled
>>> meta-shopping-cart using Catalyst?
>>> 
>>> [ ... ]
>>> 
>>> Thanks for all suggestions,
>> 

Disclaimer:  My total experience with web shopping is having looked into the 
turnkey php solutions for an abortive project some time ago.

As denny says, it's a matter of spending the time to figure out what you want 
in terms of planning and then spending more time writing the code.  Catalyst 
buys you flexibility, although the learning curve is probably steeper than 
other web frameworks.  However, as any emacs user will tell you, a steep 
learning curve is often a benefit.

Once you've spent the setup time, what you're asking for is pretty easy, given 
that you have the programmer resources to actually achieve your specification 
(that's up to you to figure out)

The bulk of the work in Catalyst apps is setting up and maintaining the 
business logic, and resisting the temptation to shove all of your business 
logic into controllers.  So what you probably want is a nice pluggable 
architecture to handle the payment stuff (chapter 4 of The Definitive Guide to 
Catalyst gives an implementation for this).

So for your use-case you can probably extend the sql schema for an existing 
shopping cart app to make it multi-gateway, and then get DBIx::Class to 
understand it via DBIx::Class::Schema::Loader (you'll probably have to do this 
iteratively with a dummy payment gateway model in the early stages).  That will 
provide you with the model for your user/order system.  You'll need to evaluate 
the quality of the payment gateway  models to do that.  At this point you need 
to start thinking about integrating existing CPAN modules  into your app, 
preferably using a pluggable architecture, probably  using 
Catayst::Model::Adaptor or it's variants (although writing your own model from 
scratch is pretty trivial as well).  CPAN has a lot of payment gateway stuff on 
it.  Have a look here for details: 
https://metacpan.org/search?q=business+payment

Then there's the writing templates, and Controllers to provide the front-end.   
This is pretty routine work.  If you end up using one of the turnkey solutions, 
you'll spend lots of time bending their existing html to your will.  Writing 
your own templates (and stealing appropriately from elsewhere) will buy you 
more flexibility, and in the long run will cost you little or no extra time.  
If you have no existing preferences for a templating language Template Toolkit 
(https://metacpan.org/module/Template) works well.  My other prefrerence is to 
use CSS frameworks to do the clean-design stuff for me.  At the moment my 
preference is for the Elastic framework.

The overriding philosophy of Catalyst is that building a web app is for life, 
not just for making a blog engine in 5 minutes.  To my understanding Catalyst's 
major advantages are that it scales better than its competition (without using 
unreasonable hardware requirements or having programmers hack on it's core), 
and it's more flexible than its competition as well.



>> 
>> On Mon, 2011-12-05 at 15:53 +1100, Alec Taylor wrote:
>>> Good afternoon,
>>> 
>>> How would I go about building a single-domain multi-shop with
>>> multiple-gateways; linked to the one shopping-cart; using Catalyst?
>>> 
>>> Thanks for all suggestions,
>> 
>> 
>> Hi Alec,
>> 
>> My suggestion is that you should probably take the following approach:
>> 1. Design the software architecture.
>> 2. Implement the system as designed.
>> 3. Test it thoroughly.
>> 
>> If you're not sure how to proceed with any of those steps, then given
>> that you seem to be talking about building a very large-scale commercial
>> application, and you haven't mentioned it being open source, I would
>> suggest that you should probably hire someone who does know how to do it
>> and pay them appropriately.
>> 
>> If you get stuck at specific technical points in step 2 or 3 then I'm
>> sure people on this list will be very happy to give you some guidance,
>> but if you've not even made a start on step 1 then I think you have some
>> work to do for yourself first - or some hiring to do.
>> 
>> Regards,
>> Denny
>> 
> 
> Thanks for the suggestion Denny.
> 
> We definitely support open-source, but haven't yet discussed which
> components we'll open-source.
> 
> Currently we are looking for a good starting base, with a lot of the
> development already done for us; then we'll build up from that
> foundation.
> 
> Research includes: Ruby on Rails (spree), DJango (satchmo) and Catalyst.
> 
> Could you recommend some libraries on CPAN (or other places) which
> will provide a strong foundation for this project?
> 
> Thanks for all suggestions,
> 
> Alec Taylor
> 
> ___
> List: Cata

[Catalyst] Annoyance with Static::Simple and Log4Perl on Catalyst 5.9

2011-11-03 Thread Kieren Diment
I came across this bug after a recent upgrade to Catalyst 5.9.  Static content 
served by Static::Simple is logged in apps which use Log4Perl for logging.

There was a suggestion that using $c->log->_flush would prevent this (which 
leaves the question of how to detect a development environment to automate this 
in development).

To confirm this I wrote a minimal test case, but I'm not sure where to take it 
from here.  Any ideas?

The minimal test case is below:


package StaticTest::Controller::Root;
use Moose;
use namespace::autoclean;
BEGIN { extends 'Catalyst::Controller' }
__PACKAGE__->config(namespace => '');
sub default :Path {
my ( $self, $c ) = @_;
$c->response->body( $c->welcome_message );
}
sub end : ActionClass('RenderView') {
my ($self, $c) = @_;
$c->log->_flush; # doesn't suppress static logging
}
__PACKAGE__->meta->make_immutable;
1;


package StaticTest;
use Moose;
use namespace::autoclean;
use Log::Log4perl::Catalyst;
use Catalyst::Runtime 5.80;
use Catalyst qw/
-Debug
ConfigLoader
Static::Simple
/;
extends 'Catalyst';
our $VERSION = '0.01';
# doesn't suppress logging of static content
after 'finalize' => sub {
my ($self) = @_;
$self->log->_flush;
};
__PACKAGE__->log(Log::Log4perl::Catalyst->new());
__PACKAGE__->config(
name => 'StaticTest',
disable_component_resolution_regex_fallback => 1,
);
__PACKAGE__->setup();
1;



Kieren Diment
PhD Candidate
Health Informatics Research Lab,
Faculty of Informatics,
University of Wollongong
Tel:  +61 4221 3952





___
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] Database access benchmarks for use in web-frameworks - How does Perl compare?

2011-11-03 Thread Kieren Diment

On 03/11/2011, at 10:00 PM, Tobias Kremer wrote:

> Hi Alec,
> 
> On Thu, Nov 3, 2011 at 11:42 AM, Alec Taylor  wrote:
>> Are there recent accessible statistics available, comparing these
>> metrics across the most popular web-frameworks? (i.e. Symfony, DJango,
>> Rails, ASP.NET &etc)
> 

There's one catalyst site in the adult industry sector which has an alexia rank 
of 81.  To the best of my knowledge they don't have to use excessive hardware, 
or use baroque framework customisations to serve pages effectively.  The BBC 
iplayer is another very high traffic site that achieves similar scale (it might 
even have more traffic than the adult site).

On the other end, I have a single user data analysis app that is quite fast and 
responsive, even though its data model does some potentially inefficient stuff 
with the file system, but this hasn't been an issue for me to date.  You'll 
note there again that it's the model that's the bottleneck not the framework.

And in terms of development process, right now my team are having to do some 
fairly heavy repurposing parts of an existing app without breaking backwards 
compatibility with other bits, under fairly tight deadlines.  While this type 
of work is never going to be especially easy (in terms of accumulating cruft 
and introducing architectural complexity), a tool like catalyst really helps 
achieve the deliverables and keep the customer happy.

> I don't have any statistics, but I can tell you that Catalyst handles
> 50 million pageviews a month for us with just two
> web-/application-servers and there's still a lot of room (CPU-load
> peaks at around 2 on a quad-core). Your bottleneck will almost always
> be your database, most certainly not Catalyst. Comparing Catalyst to
> other frameworks in a "Hello world"-style benchmark (as has been done
> by some people in the past) really proves absolutely nothing because
> your app will probably spend 80% of its time waiting for the database.
> 
> Catalyst has a lot of pre-built components/plugins that will help you
> with almost every aspect you'll have to deal with:
> https://metacpan.org/search?q=catalyst%3A%3Aplugin
> 



These days you should be looking in the Catalyst::Controller, and 
Catalyst::TraitFor namespaces for extensions, except for the few that really 
need to mess with the request cycle.  Which are still plugins.There's also a 
whole bunch of Catalyst::Models on CPAN too, as well as the 
Catalyst::Model::Adaptor family of modules for gluing other arbitrary things 
into catalyst.

> If you're looking for complete, ready-to-use applications (like
> Magento) I guess you need to start looking in the direction of PHP
> because neither Perl nor Python or Ruby offer that much variety there.
> But if what you want is a custom solution, I can whole-heartedly
> recommend Catalyst and its ecosystem!
> 

Yes, PHP owns the ready to roll 
one-size-fits-all-for-one-click-deployment-on-shared-hosting space.  I don't 
see that changing any time soon.



___
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] Dealing with timestamps from Postgres

2011-11-03 Thread Kieren Diment
On 03/11/2011, at 9:40 PM, Adam Jimerson wrote:

> The problem I see with doing it this way: $formatted_date_string =
> $c->model('DB::TableName')->find($row_index)->date_field->mdy('/'); is
> that It looks like I would
> have to do this every time I grab a date from the database.  That is fine
> but there are times in my app where I pull everything from the database to
> display like so:
> 
> my $things = $c->stash->{mydata_rs}->search(
>   undef,
>   {
>   order_by => { -asc => 'uniq' },
>   },
> );
> 


One option is to define a method in whatever Result class mydata_rs produces:

sub my_date_format {
my $self = shift;
return $self->date_field->mdy('/');
}   


then in your template:

[% WHILE (row = mydata_rs.next); row.my_date_format ; END %]

or you can just call the datetime methods in the template:

[% WHILE (row = mydata_rs.next); row.my_date_field.ymd('/') ; END %]



> where each item has a timestamp of when it was created and when it was last
> modified, would I have to do another search to get the datetime formatted
> or worse pull them one by one building a hash_ref or array?
> 
> On Thu, Nov 3, 2011 at 6:04 AM, Tomas Doran  wrote:
> 
>> 
>> On 3 Nov 2011, at 02:05, Adam Jimerson wrote:
>> 
>> but in my Catalyst app the
>>> date looks like this 2011-05-07T13:53:41.  The "T" instead of the space
>>> is driving me crazy, I think it is coming from DateTime::Format:Pg
>>> 
>> 
>> As other people have noted, what's happening is that DateTime::Format:Pg
>> is parsing the dates you get out of Postgres, and handing you a DateTime
>> object back.
>> 
>> You're then printing that with no formatting, as you're basically getting
>> an ISO8601 timestamp out.
>> 
>> Have a look at the docs for DateTime and the associated
>> DateTime::Format::XX things :)
>> 
>> 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/


___
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 for large-scale e-commerce: A good or bad choice?

2011-10-23 Thread Kieren Diment




On 23/10/2011, at 21:54, Alec Taylor  wrote:

> Good afternoon,
> 
> I'm looking at all the notable CMSs and web-frameworks across any
> language (C++, Ruby, Python, Perl, .NET, PHP), for an e-commerce
> solution which suits my project.
> 
> Basically I'm creating an e-commerce store of e-commerce stores. So
> for all e-commerce stores integrated with this system, there is a
> shared user database and shopping cart integrated with PayPal (but
> preferably multiple payment gateways).

Your explanation lacks clarity.  However catalyst is extraordinarily useful for 
systems integration, and has been used extensively for such in business, 
education, media and government sectors. 

> 
> Would Catalyst be a good choice for developing this project?
> 
> i.e. are there many predone components for this kind of thing which
> can be utilised to speedup development time?

If you want something like oscommerce or zencart then no. If you want libraries 
which you glue together by hand for your own specialist purposes, then yes. 

> 
> Also, is Catalyst scalable enough for a system of this sort, or should
> I pick a competitor?

Catalyst is designed to scale. Your bottleneck here will not be catalyst, or 
hardware. It will be your access to good programmers. 

> 
> Thanks for all suggestions,
> 
> Alec Taylor
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/

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


Re: [Catalyst] Re: Recommended caching back-ends

2011-10-13 Thread Kieren Diment
On 14/10/2011, at 5:12 PM, Toby Corkindale wrote:

> On 7 October 2011 18:22, Stephen Clouse  wrote:
>> On Fri, Oct 7, 2011 at 12:05 AM, Toby Corkindale  wrote:
>>> 
>>> Is there a Plugin::CHI or a CHI driver for Plugin::Cache anywhere?
>> 
>> CHI works fine with C::P::Cache out of the box, nothing extra required.
>> 
>> Just specify class => 'CHI' in the backend config and pass CHI configuration
>> as documented.
> 
> Oh! Right.
> Thanks.
> 
> Out of interest, how was I supposed to know I could do that?
> 
> I thought I needed to pick modules which had existing
> catalyst::plugin::cache::store::X modules. (where X is the backend
> name)

Can you put that to the RT queue for Catalyst::Plugin::Cache and/or 
Catalyst::Manual::Cookbook please, ideally with a patch please.





___
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] View for graphs

2011-10-08 Thread Kieren Diment
Chart::Clicker was a good bet back when I was writing the book. You might also 
consider an external API solution, or shelling out to an R binary as well. 


On 08/10/2011, at 17:52, Alex Povolotsky  wrote:

> Hello,
> 
> what C::V  would you recommend for graph drawing? It should not be abandoned 
> by author a year ago at version 0.02 and be more or less working and stable.
> 
> Alex
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/

___
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] Using URL for /search/parameters: bad idea?

2011-09-26 Thread Kieren Diment

Kieren Diment
PhD Candidate
Health Informatics Research Lab,
Faculty of Informatics,
University of Wollongong
Tel:  +61 4221 3952




On 27/09/2011, at 10:47 AM, Andrew Rodland wrote:

> On Mon, Sep 26, 2011 at 5:29 PM, Marius Olsthoorn  wrote:
> 
>> Hi,
>> 
>> Consider using the query part of the URI to represent the search.
>> Browsers are very good at bookmarking these :)
>> 
> 
> What in the world is that supposed to mean? Are browsers *bad* at saving
> bookmarks for other kinds of URLs?

What he means is a GET request can be bookmarked and have it's state recalled.  
A POST request on the other hand hides the state required to make the request 
from teh URL.


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


Re: [Catalyst] Tutorial woes.

2011-08-10 Thread Kieren Diment

On 11/08/2011, at 12:20 PM, John Napiorkowski wrote:

> From: Roderick A. Anderson 
>> To: The elegant MVC web framework 
>> Sent: Wednesday, August 10, 2011 7:06 PM
>> Subject: [Catalyst] Tutorial woes.
>> 
>> I can't find where my error is while doing the tutorial.
>> 
>> I make it all the way to end of 06 Authorization and suddenly I get errors 
>> starting with:

Did you check that to see if reference implementation for the tutorial  works 
for the stage you're up to of if that's getting the same error?  You can get it 
from:

svn co 
http://dev.catalystframework.org/repos/Catalyst/trunk/examples/Tutorial/MyApp_Chapter6
___
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] TT2 multiple subtemplates

2011-08-10 Thread Kieren Diment

On 11/08/2011, at 5:13 AM, Francisco Obispo wrote:

> Look at the INCLUDE directive in perldoc Template::Manual::Directives
> 
>   INCLUDE
>   The "INCLUDE" directive is used to process and include the output of 
> another template file or block.
> 
>   [% INCLUDE header %]
> 
> 

You should usually PROCESS not INCLUDE as there's no copying of variables 
during processing, so it's faster: 
https://metacpan.org/module/Template::Manual::Directives#PROCESS


> 
> 
> On Aug 10, 2011, at 12:00 PM, Stefan wrote:
> 
>> Hi,
>> I’m new at the catalyst framework and using Template Toolkit.
>> 
>> What is the best practice to load a template like the following:
>> 
>> 
>> 
>> 
>>[% content %]
>> 
>> 
>>[% right_content %]
>> 
>> 
>> 
>> 
>> ‚content‘ should be replaced with left_content.tt2
>> ‚right_content‘ with right_content.tt2
>> 
>> If I use a Wrapper, only content is automatically replaced. How can I also 
>> replace right_content?
>> 
>> Thanks for your Help!!
>> Stefan
>> ___
>> 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/
> 
> Francisco Obispo 
> email: fobi...@isc.org
> Phone: +1 650 423 1374 || INOC-DBA *3557* NOC
> Key fingerprint = 532F 84EB 06B4 3806 D5FA  09C6 463E 614E B38D B1BE
> 
> 
> 
> 
> 
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


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


Re: [Catalyst] Moose Upgrade

2011-04-18 Thread Kieren Diment

On 19/04/2011, at 6:35 AM, Dave Rolsky wrote:

> On Mon, 18 Apr 2011, John M. Dlugosz wrote:
> 
>> 
>> On 4/17/2011 9:55 PM, Dave Rolsky autarch-at-urth.org |Catalyst/Allow to 
>> home| wrote:
>>> Running "moose-outdated | cpanm" should upgrade everything that needs 
>>> upgrading.
>> 
>> I don't have cpanm, but moose-outdated is good to know about!  Thanks.
> 
> cpan App::cpanminus
> 

or even from http://cpanmin.us:

#!/usr/bin/env perl
#
# You want to install cpanminus? Run the following command and it will
# install itself for you. You might want to run it as a root with sudo
# if you want to install to places like /usr/local/bin.
#
#   % curl -L http://cpanmin.us | perl - --self-upgrade
#
# If you don't have curl but wget, replace `curl -L` with `wget -O -`.


___
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] Force the session to be saved.

2011-03-30 Thread Kieren Diment
You can mess with the metaclass to do what you want, but I don't know how to do 
it myself I'm afraid.

On 30/03/2011, at 7:40 PM, Duncan Garland wrote:

> Thanks. That's very useful and a bit depressing.
> 
> -Original Message-
> From: Andrew Rodland [mailto:and...@cleverdomain.org] 
> Sent: 29 March 2011 19:33
> To: The elegant MVC web framework
> Subject: Re: [Catalyst] Force the session to be saved.
> 
> On Tuesday, March 29, 2011 12:46:32 PM Duncan Garland wrote:
>> Hi,
>> 
>> We've been having some peculiar behaviour from our system. I think it's
>> because the controller which produces the HTML page stores data in the
>> session for retrieval by the controller which produces the associated
>> javascript file.
>> 
>> The client begins processing the HTML page as soon as it starts to arrive.
>> When it reaches the script tag it requests the javascript page.
>> Occasionally the first controller hasn't written the session to the
>> database when the javascript controller tries to retrieve it.
>> (Catalyst::Plugin::Session::Store::DBIC).
>> 
>> I can move the script tag down the page a bit, but what I really need is a
>> way to force the session to be written before the HTML template is
>> rendered.
>> 
>> Something like:
>> 
>> $c->session->{javascript}->{$template}  = { one = 1, two => 2};
>> $c->session->save;
>> 
>> Is there such a method?
>> 
>> Regards
>> 
>> Duncan
> 
> finalize_session (which writes the session to the DB) runs before 
> finalize_body (which writes the response to the client), so Catalyst already 
> does what you would like it to, and forcing a session write before running 
> the 
> view is unlikely to help anything. I suspect either your database isn't 
> guaranteeing ordering, or the problem is somewhere other than where you're 
> looking.
> 
> Andrew
> 
> ___
> 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/


Re: [Catalyst] Sending Email from Page?

2011-03-29 Thread Kieren Diment
On 29/03/2011, at 8:23 PM, Dave Howorth wrote:

> John M. Dlugosz wrote:
>> On 3/27/2011 12:22 PM, Tomas Doran bobtfish-at-bobtfish.net
>> |Catalyst/Allow to home| wrote:
>>> 
>>> And I would say that sending an email is a state change, and behavior
>>> of the application domain here.
>> That's a stretch, because you can argue that any side-effect is a change
>> of state to the universe at large and there happens to be no accessor to
>> read the results of the change.  It clearly matches "side effect", not
>> "state", unless you stretch the definition to make all side effects into
>> state and lose all distinction.
> 
>  Sending an email isn't a side-effect or a state change, it's an
> output. And the thing that sends it isn't a controller or a model or an
> accessory, it's a View. Of course there may be specialized methods in
> the model as well. 
> 

MVC doesn't work particularly well with the web compared to other application 
development stacks.   But like democracy for political systems, all the other 
alternatives seem worse.




___
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] Wiki: How To vs. Cookbook, and general change requests

2011-03-26 Thread Kieren Diment
> 
> The issues address in this post:
> http://blog.urth.org/2009/07/what-is-catalyst-really.html
> 
> Creating the foundations of a Catalyst-based blogging application to rival 
> Movable Type and Wordpress would be nice... :-)
> 
> The obvious caveat is that I am by no means an expert, so my work would need 
> to be checked by those who actually know what they are talking about...  I 
> also seem to be very busy all of the time, which doesn't help.
> 
> 

It's be nice to have a fresh face curating the docs.  Hop on to #catalyst-dev 
on irc.perl.org for a commit bit.  We have a good doc review process.




___
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 do you make your favicon file?

2011-03-23 Thread Kieren Diment
If you're a free software purist, the imagemagick tools will probably also do 
the trick.

On 23/03/2011, at 7:18 PM, Simon Wilcox wrote:

> On 23/03/2011 04:26, John M. Dlugosz wrote:
>> 
>> So, given a PNG file, is there a tool that will spit out a ICO that
>> works as well as can be expected, aimed at XP compatibility but with an
>> older compatibility image in there (Windows 2000) as well?
>> 
>> This is something every web site needs.  So where do you get yours?
> 
> You've tried these ?
> 
> http://www.google.com/search?q=png+to+ico+converter
> 
> I've used converticon.com and it seems to do the trick.
> 
> S.
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


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


Re: [Catalyst] What are these files?

2011-03-15 Thread Kieren Diment
They're used by the build system, and are safe to remove / put in .gitignore etc


On 16/03/2011, at 4:59 PM, John M. Dlugosz wrote:

> When I generate a makefile, I also get directories called inc and blib.  What 
> are those for?  They are not used by the app.
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


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


Re: [Catalyst] What text editor to use?

2011-03-02 Thread Kieren Diment

On 02/03/2011, at 10:10 PM, John M. Dlugosz wrote:

> What's a good text editor to use for Catalyst/TT development?
> 
> The editor I really like for C++ doesn't handle XML well.  I've been using 
> "Notepad++" for windows, but the syntax highlighting doesn't understand 
> mixing TT inside the base language, and it has tabs only instead of multiple 
> visible windows.
> 
> I would entertain both Windows and Linux solutions.
> 

Padre: http://padre.perlide.org/ is rated by some.  Works everywhere Wx does.

> TIA,
> --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/


___
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] Auto-remove POD

2011-03-02 Thread Kieren Diment
On 02/03/2011, at 12:42 PM, gvim wrote:

> I've just started with Catalyst and am working through the tutorials but find 
> I need to remove the POD from all the auto-generated helper files. Is there 
> any option to turn off the POD generation or a quick way to remove it?


A patch to Catalyst::Helper would be more than welcome.  Talk to dhoss on IRC 
about how you'd get started on that.  I couldn't see it being more than a dozen 
lines of code.

But personally I find that apart from catalyst.pl MyApp (mostly for the 
Makefile.PL),  its just as easy to do everything else by hand.  
___
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-Manual now on git

2011-02-16 Thread Kieren Diment

On 16/02/2011, at 8:38 PM, Andrew Rodland wrote:

> On Wednesday, February 16, 2011 03:03:43 AM Kieren Diment wrote:
>> Thanks to frew++, Catalyst-Manual is now no longer on svn and has moved to
>> shadowcat's[1]  git hosting.  You can get a copy of the manual with the
>> tutorial attached.
>> 
>> Grab a fork with:
>> 
>> git clone catag...@git.shadowcat.co.uk:Catalyst-Manual
>> 
>> If you have patches, please contact this list with patches, or join
>> #catalyst-dev on irc.perl.org for further instructions.
> 
> The publicly-accessible read-only URL for the repository is actually:
> 
> git  clone git://git.shadowcat.co.uk/catagits/Catalyst-Manual.git
> 
> The URL in Kieren's email only works for those with commit bits on catagits. 

Or more specifically you'll only be able to submit patches via interacting with 
a person on irc or the mailing list until you get a proper commit bit.  Our 
policy is to hand out commit bits after one sane patch.
___
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-Manual now on git

2011-02-16 Thread Kieren Diment

On 16/02/2011, at 8:28 PM, Matthias Dietrich wrote:

> Hi Kieren,
> 
> 
> you may have missed the [1] link in your mail...

[1] no commercial interest

___
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-Manual now on git

2011-02-16 Thread Kieren Diment
Thanks to frew++, Catalyst-Manual is now no longer on svn and has moved to 
shadowcat's[1]  git hosting.  You can get a copy of the manual with the 
tutorial attached.

Grab a fork with:

git clone catag...@git.shadowcat.co.uk:Catalyst-Manual

If you have patches, please contact this list with patches, or join 
#catalyst-dev on irc.perl.org for further instructions.

If this is not practical for you you can also grab a copy from 
http://search.cpan.org/perldoc?Catalyst::Manual then it's a mater of 
downloading and untarring the source, then:

$ git init
$ git add *
$ git commit -m 'initial import'

# time passes ... stuff gets edited

$ git diff > patch.diff

and send the patch.diff file to this list or talk to us on IRC as above (IRC is 
preferred in general).
___
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 Git Conversion

2011-02-15 Thread Kieren Diment

On 16/02/2011, at 7:14 AM, Christiaan Kras wrote:

> Just a small suggestion, but if the Git repositories for Catalyst are
> going to be hosted on GitHub wouldn't a single Organization on GitHub be
> neater to keep the repositories centralized?

They'll be hosted by Shadowcat when the time comes to switch off/deprecate the 
svn hosting as far as I know.


___
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] source of 'Definitive Guide To Catalyst' code mentioned in the Apress book itself

2011-02-01 Thread Kieren Diment

On 02/02/2011, at 6:18 AM, Anne Wainwright wrote:

> Hi,
> 
> I can't find on the Apress site the code referred to in the sidebar on
> p.84 of the book.
> 
> " All the code in this chapter is available in a git repository
> downloadable from the Source Code area of the Apress website"
> 
> Well, there is a zip file of code but this is not what I was expecting.
> Did this not materialise or did it get put somewhere else?
> 
> Thanks for a pointer.
> 

$ cd /tmp
$ wget http://www.apress.com/resource/bookfile/4439
--2011-02-02 06:52:11--  http://www.apress.com/resource/bookfile/4439
Resolving www.apress.com (www.apress.com)... 66.211.109.45
Connecting to www.apress.com (www.apress.com)|66.211.109.45|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3434114 (3.3M) [application/zip]
Saving to: `4439'

100%[==>] 3,434,114   87.5K/s   in 55s 

2011-02-02 06:53:08 (61.1 KB/s) - `4439' saved [3434114/3434114]

$ unzip 4439 

$ cd catalyst-book-code/Chapter_4/LolCatalyst-Lite/
$ git status
# On branch controller_base_classes
nothing to commit (working directory clean)
$ gitx # or gitk on linux or tortoisegit on windows for gui

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


Re: [Catalyst] Ajax Problem.

2011-01-05 Thread Kieren Diment

On 05/01/2011, at 10:51 PM, Mahmoud Mehyar wrote:

> Well, I don't see why you put results in stash, can you send your controller
> code snippet, it has to send a response but let's look at that first
> 
> I also recommend you to use a javascript framework maybe jQuery, like
> catalyst, it will make your life easier
> 
> 

Unless you have a very well defined reason not to use a javascript framework 
(e.g. very exotic client side platform) there's no reason not to use your 
javascript framework of choice.  If you have to roll your own ajax stuff then 
you ought to be being paid properly for doing so.  Once you work out the basics 
of jquery (my recommendation, but there are similar alternatives), then all 
this stuff becomes trivial, as does the catalyst back end.

> 
> On Wed, Jan 5, 2011 at 2:07 PM, Rohan M  wrote:
> 
>> Dear All,
>> 
>> I want to use Ajax in my Catalyst application.
>> 
>> Thing's that I've done till now :
>> 
>> 1) Created a Javascript function on an event (onblur event) in my view (tt
>> page).
>> 2) Created xmlhttp object in that Javascript function.
>> 3) Called the '/controller/action' path with parameters.
>> 4) The Action subroutine searches database and puts results in the *stash*
>> *
>> *
>> *I could see, the things are working till the fourth step correctly.*
>> 
>> Now, how can I render the stash variables in the current tt page?
>> 
>> Or Will I need to parse the entire content?
>> 
>> Is there a better solution for this problem?
>> 
>> Any help or similar (simple) example will be appreciable.
>> 
>> CODE SNIPPET
>> ===
>> 
>> function getDetails(id)
>> {
>> var param = "id="+id;
>> if (window.XMLHttpRequest)
>> {
>> xmlhttp=new XMLHttpRequest();
>> }
>> else
>> {
>> xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
>> }
>> 
>> xmlhttp.open("GET","/indexer/getid/"+"?"+param,true);
>>// /controller/action url
>> xmlhttp.send();
>> xmlhttp.onreadystatechange=function()
>> {
>> if (xmlhttp.readyState==4 && xmlhttp.status==200)
>> {
>> document.getElementById("data").innerHTML=xmlhttp.responseText;
>>// the element to render output
>> }
>> }
>> show();
>> 
>> }
>> 
>> ===
>> 
>> 
>> Thanks and regards,
>> Rohan
>> 
>> 
>> ___
>> 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/


Re: [Catalyst] Suggestions on how to handle 12 page form

2010-11-16 Thread Kieren Diment

On 17/11/2010, at 9:50 AM, Victor Churchill wrote:

> Put it all on one page and use JS in the template to toggle different divs?

Having dealt with some large forms recently(and depending on how heavy the JS 
is on the page), this can result in browser slowdowns in some environments.  
Probably the simplest approach is to incrementally update the database, and 
keep the current primary key for the record somewhere in the form (in a hidden 
field) or in the url.  If you don't want to insert until everything is 
finished, then storing everything previously entered in hidden fields is also a 
reasonable approach in some situations.
___
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] Download a file - Catalyst Docs 'Cookbook' example doesn't work

2010-11-10 Thread Kieren Diment
I'd be inclined to do set $c->stash( served_file => 1) if one of these files is 
served

then avoid forwarding to the view if this stash key is set in MyApp.pm with the 
following:

sub end : ActionClass('RenderView') {
my ($self, $c); 
return 1 if $c->stash(served_file);
}

See the docs for Catalyst::Action::RenderView for details.

On 11/11/2010, at 5:33 PM, Matthew Braid wrote:

> Hi all,
> 
> Part of the site I'm writing includes the ability to download certain
> files. These files can be large, so going from the cookbook method at
> http://search.cpan.org/~zarquon/Catalyst-Manual-5.8005/lib/Catalyst/Manual/Cookbook.pod#Forcing_the_browser_to_download_content,
> I modified it so that the download code was (chopped down code ahead):
> 
>my $fh = handle_of_file_content(); # Pseudo
>my $filename = $c->stash->{file}->fname;
>$c->res->header('Content-Disposition', qq[attachment;
> filename="$filename"]);
>$c->res->body($fh);
> 
> According to the docs, this should download the file (the filehandle
> should be read chunk by chunk and all will be well). Unfortunately
> instead the following happens:
> 
>  1) The browser always identifies the content as a "HTML File"
>  2) Only a small chunk of the file is actually downloaded.
> 
> So I made another change and decided to use the response object's
> write method like so:
> 
>  my $fh = handle_of_file_content(); # Pseudo
>  my $filename = $c->stash->{file}->fname;
>  $c->res->header('Content-Disposition', qq[attachment; filename="$filename"]);
>  while (defined(my $line = <$fh>)) {
>$c->res->write($line);
>  }
>  close($fh);
> 
> This almost works as well - the browser identifies the file type
> correctly, and the whole file is downloaded.
> 
> Unfortunately the file has a Catalyst error page appended (the error
> is it can't find the default template). I'm assuming this is because
> once the action is handled it still goes to the default View and tries
> to render a page.
> 
> So, am I doing something horribly wrong, or do I just need the magic
> words that say "Do not forward to the default view"? I'm hoping the
> latter, and I'm hoping it's something blindingly obvious and my brain
> is just running slow today.
> 
> TIA,
> MB
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


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


Re: [Catalyst] Has anyone read the book "Catalyst 5.8 : The Perl MVC Framework" yet?

2010-10-25 Thread Kieren Diment
Wrong book.  The discussion was about the new edition of the Packt book.  You 
appear to be referring to the Apress book "The Definitive Guide to Catalyst"

With the Apress book, we assumed that you could read the freely available 
tutorial already, so our aim wasn't to duplicate that.  

Should we ever go to second edition I'd like to significantly expand the 
cookbook chapter (which I must respectfully disagree is of great usefulness to 
the beginner - I'm also strongly of the opinion that the Chained dispatch type 
chapter is also of great use to the beginner, although the point may not be 
immediately apparent until you start designing your own application's dispatch 
structure).  

On 25/10/2010, at 11:23 AM, John Karr wrote:

> It came out just as I was trying to learn catalyst. From a beginner
> perspective it wasn't of any value -- thankfully Kennedy Clark has been
> doing an excellent job with the Tutorial on CPAN, because that's how I
> figured most things out. I was severely disappointed with the book, and not
> the least concerned with LOLCats and Kitty Pidgin. The people who wrote the
> book are a very knowledgeable group and sometimes their book works as a
> reference, but overall doesn't seem add a lot to what's already in the
> documentation, while being of no value to beginners whatsoever. 
> 
> 
> 
> It would be nice to have a good beginner book and a more advanced book. If
> any of the more advanced programmers on this list would like someone to help
> with writing the beginner book, don't hesitate to get in touch! 
> 
> 
> 
> 
> From: Philip Medes [mailto:pmedes_2...@yahoo.com] 
> Sent: Friday, October 01, 2010 5:33 PM
> To: The elegant MVC web framework
> Subject: Re: [Catalyst] Has anyone read the book "Catalyst 5.8 : The Perl
> MVC Framework" yet?
> 
> 
> 
> I actually read the first 2 chapters and tried the examples.   I haven't had
> time to finish the book. 
> I haven't read any other books on Catalyst, but I do like the Sitepoint
> books better ("Build Your Own Ruby On Rails Web Applications").
> 
>  _  
> 
> From: Kiffin Gish 
> To: catalyst@lists.scsys.co.uk
> Sent: Fri, October 1, 2010 3:15:47 PM
> Subject: [Catalyst] Has anyone read the book "Catalyst 5.8 : The Perl MVC
> Framework" yet?
> 
> I recently received a copy of the book "Catalyst 5.8 : The Perl MVC
> Framework" for review, have read it and tried out the examples.
> 
> Before I make my judgments public, I'd first be curious to hear from
> others in the Catalyst Community about what their views are on the
> book. 
> 
> Those that have "actually read" the book, that is. I've already seen a
> couple blog entries and they tend to be fairly negative (we sure prefer
> to rant).
> 
> -- 
> Kiffin Gish 
> Gouda, The Netherlands
> 
> 
> 
> ___
> 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/


Re: [Catalyst] I18N

2010-10-13 Thread Kieren Diment

On 14/10/2010, at 8:25 AM, Ekki Plicht (DF4OR) wrote:

> Am Dienstag 12 Oktober 2010, 22:04:23 schrieb Stuart Watt:
>>  Quick question: I'm currently using Catalyst::Plugin::I18N. Should I
>> be planning to move to CatalystX::I18N? Any thoughts...?
> 
> Stuart, I am in no way a Catalyst expert, just a mere beginner. And facing 
> the 
> same question :-)
> 
> I played around with C::P::I18N, and it does perfectly what is says it does - 
> l10n. But I want (need) more, like localized paths, for example. So I looked 
> at C::P::I18N::Request which is perfect for that, but decides only on the 
> browser header setting of accept-language, AFAICS. Which renders it useless 
> for me.
> 
> Then there is C::P::I18N::PathPrefix, which is a helpful and different 
> approach. It comes in handy when path names are the same even for different 
> languages, a situation which I have here in my current project. 

Localised paths can be done though configuration.  See Chapter 7 of the 
Definitive Guide to Catalyst for details (p 187 - relevant snippet of code 
below, downloadable source for the book available from 
http://www.apress.com/book/view/1430223650) where I translated the uri paths 
into Indonesian:


 
  PathPart nama
 
 

 
 
  PathPart siapa
 
 
  PathPart lagi
 
 
  PathPart mengusir
 
 


___
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] [Beginner] Understanding actions and controllers - not!

2010-08-26 Thread Kieren Diment

On 27/08/2010, at 7:50 AM, Ekki Plicht (DF4OR) wrote:

> Am Montag 23 August 2010, 23:17:40 schrieb Ben van Staveren:
>> try using /static/css/main.css ;)
> 
> Yup, that did the trick.
> $c.uri_for() would have worked as well, as I have learned now (tnx Stuart).


$c->uri_for('/static/wherever') is the correct solution.  Giving it an absolute 
path will most likely break if you end up deploying your application somewhere 
other than the server root.
___
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: AW: [Catalyst] User management with Catalyst (with email and URLs)

2010-08-26 Thread Kieren Diment

On 26/08/2010, at 10:23 PM,  
 wrote:

> Thanks, Denny, for making clear what my original intention was.
> 
> Thanks, Kieren, for giving an explanation why my web search failed.
> 
> So, I guess I will implement my own procedure for registration (and 
> confirmation).
> 
>>> Nope, there doesn't seem to be a Catalyst::Controller::Registration
>>> on CPAN.  Maybe there should be.
> I wish there was and I definitely think there should be, because in my 
> opinion this is a pretty common task.

Have a look at the source to Catalyst::Controller::reCAPTCHA to get an idea of 
how you would go about keeping the implementation reasonably abstract.
___
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] User management with Catalyst (with email and URLs)

2010-08-26 Thread Kieren Diment

On 26/08/2010, at 9:25 PM, Denny wrote:

> On Thu, 2010-08-26 at 13:10 +0200, David Schmidt wrote:
>> Anyways, what you want can be done with Catalyst.
>> 
>> 1) user enters mailaddress and hits submit
>> 2) you generate a digest
>> 3) store digest + mailaddress in model
>> 4) send digest in URL to mailaddress
>> 5) user klicks the link
>> 6) validate digest and request password
>> 7) store pw in db
>> 
>> catalyst makes all this very easy.
> 
> You're completely missing the point of the original message - he very
> clearly enquired about pre-rolled solutions for this sort of thing.  Of
> course he could write his own, but he'd rather not if there's a
> neatly-packaged community-managed solution already available.

Nope, there doesn't seem to be a Catalyst::Controller::Registration on CPAN.  
Maybe there should be.


___
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] auth_bootstrap.pl question

2010-08-02 Thread Kieren Diment
I checked the recent version bump (for windows compat) for problems.  I can't 
replicate the problem on my system using a clean app.
The error is with DBIx::Class::Schema::Loader, but it's difficult to tell what 
the origin of the problem might be from here.

$ perl -MDBIx::Class::Schema::Loader\ 
DBIx::Class::Schema::Loader version  required--this is only version 0.06000.
BEGIN failed--compilation aborted.

I also tried with the latest version of Schema::Loader (0.070001) without 
incident.


On 02/08/2010, at 5:51 PM, Nicolas Voss wrote:

> hi Kieren,
> 
> tests were ok for DBIx::Class::Schema::Loader (test=pass after installation). 
> What's wrong here?
> 
> thank you in advance,
> marc
> 
> 
> Le 31 juil. 2010 à 01:16, Kieren Diment  a écrit :
> 
>> At a guess I think that there's something wrong with your installation of 
>> DBIx::Class;:Schema::Loader
>> 
>> 
>> On 31/07/2010, at 12:35 AM, Marc Gamontini wrote:
>> 
>>> Hi,
>>> 
>>> Could you explain the error below (LolCatalyst example, Chapter 3, p74) ? We
>>> installed Catalyst::Helper::AuthDBIC and DBIx::Class::Schema::Loader (tests
>>> are ok).
>>> 
>>> [...@localhost LolCatalyst-Lite]# auth_bootstrap.pl -credential http
>>> Use of uninitialized value in concatenation (.) or string at
>>> /root/perl5/lib/perl5/Catalyst/Helper/AuthDBIC.pm line 95.
>>> Can't call method "loader_options" without a package or object reference at
>>> /root/perl5/lib/perl5/DBIx/Class/Schema/Loader.pm line 390.
>>> Thank you in advance,
>>> 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/
>> 
>> 
>> ___
>> 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/


Re: [Catalyst] Catalyst 5.8: the Perl MVC Framework - Packt Publishing

2010-08-01 Thread Kieren Diment

On 02/08/2010, at 4:04 AM, kevin montuori wrote:

> If you're looking for a good -- but becoming outdated -- book, the
> Apress book is a better choice.

To be fair the only think I can think of that's becoming outdated about the 
Apress book is a lack of discussion of Moose Roles.  And probably that the 
Reaction chapter should be replaced with a discussion of the form processor 
libraries available.
___
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] auth_bootstrap.pl question

2010-07-30 Thread Kieren Diment
At a guess I think that there's something wrong with your installation of 
DBIx::Class;:Schema::Loader


On 31/07/2010, at 12:35 AM, Marc Gamontini wrote:

> Hi,
> 
> Could you explain the error below (LolCatalyst example, Chapter 3, p74) ? We
> installed Catalyst::Helper::AuthDBIC and DBIx::Class::Schema::Loader (tests
> are ok).
> 
> [...@localhost LolCatalyst-Lite]# auth_bootstrap.pl -credential http
> Use of uninitialized value in concatenation (.) or string at
> /root/perl5/lib/perl5/Catalyst/Helper/AuthDBIC.pm line 95.
> Can't call method "loader_options" without a package or object reference at
> /root/perl5/lib/perl5/DBIx/Class/Schema/Loader.pm line 390.
> Thank you in advance,
> 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/


___
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] Contributing code

2010-06-21 Thread Kieren Diment

On 21/06/2010, at 11:48 PM, Sir Robert Burbridge wrote:

> Out of a discussion last week, I have some code to contribute (largely to 
> Catalyst::Helper).
> 
> Two quick questions:
> [snip q 1 ]
> 2)  I've noticed many times in the CPAN modules I've looked through tend to 
> be very sparsely commented (disregarding POD).  I tend to do a fair bit of 
> inline comments (maybe about 1:2 comments:code).  Is there some reason I 
> should keep comments sparse in contributed code?
> 

If you're contributing a to CPAN, then you're almost certainly contributing a 
reusable library.  As a potential user of your library, I as a rule will want 
to avoid reading your source code if at all possible (there are people who 
don't feel this way, and code where this  approach can be an exception, but for 
widest use, make this assumption).  Given this, please ensure the POD you 
contribute is reasonably complete.

However, I can see a role for comments in a Catalyst::Helper extension to 
provide educational information for other people wanting to contribute to the 
helper modules, so if you want to take this approach, then by all means give it 
a go.
___
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::Model::DBIC::Schema and ACCEPT_CONTEXT -- current user in model

2010-05-13 Thread Kieren Diment

On 14/05/2010, at 7:37 AM, Bill Moseley wrote:

> I've managed to keep context related items  (e.g. current user) out of my
> DBIC model up until now.  Now finding it would be very helpful to be able to
> call a method on a row object and have access to the current user.
> 
> So, I'm trying to hunt down an example of how to make a current user
> available to row objects.  Seems this has come up many times but not having
> much Google luck.
> 
> Anyone have a link or an example?
> 
> Thanks,
> 
> -- 
> Bill Moseley
> mose...@hank.org
> ___


From the book:

=head2 Catalyst::Model::Factory and Catalyst::Model::Factory::PerRequest

Thanks to Johnathan Rockway for assistance.

We've used Catalyst::Model::Adaptor elsewhere in this book to set up a plain
class as a Catalyst model at application startup time.  This helps us to write
Models that will work equally well outside of Catalyst as inside Catalyst. If
you need more flexbility than this you should use
Catalyst::Model::Factory::PerRequest to instantiate your class once per
Catalyst request, or Catalyst::Model::Factory if you need a new object every
time you call a particular C<<$c->model>>.  Setup for either is the same as
Catalyst::Model::Factory.

Here's a simple Class that uses Catalyst::Model::Factory:

 package MyApp::Model::Something;
 use strict;
 use warnings;
 use parent 'Catalyst::Model::Adaptor';

 __PACKAGE__->config(
 class => 'Some::Plain::Class',
 args => { arg =>  $self->arg},
 );

 1;

=begin comment

JAR - It doesn't look like it uses Catalyst::Model::Factory.  Is there a missing
use line?

=end comment

Say we needed access to Catalyt's C method in our Model.  We could
easily set this up within a Catalyst::Model::Adaptor model with the following
inside our MyApp::Model::FromAdaptor class:

 use Moose;
 use namespace::autoclean;
 sub ACCEPT_CONTEXT {
 my ($self, $c ) = @_;
 my $new = $self->meta->clone_object($self, arg => $c->path_to(''));
 return $new;
 }

However, if we needed information from the current Catalyst request object for
our model to work, then we'd want to use C in the last para.

=end comment

 use Moose;
 use namespace::autoclean;
 sub ACCEPT_CONTEXT {
 my ($self, $c ) = @_;
 my $new = $self->meta->clone_object($self, arg => $c->req->path);
 return $new;
 }

=begin comment

JAR - Is this example (above) still giving us access to Catalyst's C
method?  Or would we not need that?  I'm a bit confused.

=end comment

This is because models inheriting from Catalyst::Model::Factory are
instantiated at run time, and so don't have access to the current request path.

Finally if our model depended on something to do with the current application
state, we'd want to C and our
ACCEPT_CONTEXT subroutine might be as follows:

 use Moose;
 use namespace::autoclean;
 sub ACCEPT_CONTEXT {
 my ($self, $c ) = @_;
 my $new = $self->meta->clone_object($self, arg => $c->stash->{something});
 return $new;
 }



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


Re: [Catalyst] Alternatives to Catalyst ?

2010-04-29 Thread Kieren Diment
On 29/04/2010, at 7:06 PM, Oleg Pronin wrote:

> [...]
>Maybe it is not the bottleneck, but how many places do we have
> like this that are "not a bottleneck" ? maybe the sum of all these
> "mini" mistakes is the bottleneck ?

I've done some research on this topic, not from a computer science POV, but 
from the business end.  Of the popular web frameworks, Catalyst clearly runs 
some extremely popular websites, in a variety of sectors.  If the 
micro-bottlenecks were a problem for achieving scale, then Catalyst would not 
be usable for these entities.  Catalyst hits the sweet spot for lone coders 
like me, who use it to manage some kinds of messy research data (e.g. 
http://github.com/singingfish/Text-TranscriptMiner-Web) to mainstream content 
providers like the BBC, entities in the adult industry (always bandwidth hogs) 
and social media providers. In both cases it's the speed of the development 
cycle, and the ease with which it's possible to optimise around pain points on 
a case by case basis that is the main benefit.

So I'm really don't think your argument has substance.
___
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] Picking template type based on input

2010-03-26 Thread Kieren Diment
[reposting something that accidentally went off list]

> 
> On 26 Mar 2010, at 22:50, Kieren Diment wrote:
> 
>> On 26/03/2010, at 11:50 PM, Tomas Doran wrote:
>>> 
>>> How is generating JSON in template toolkit not 100% insane?
>>> 
>>> Please use something like Catalyst::View::JSON instead?
>>> 
>> 
>> 
>> Only 99.9% insane.
>> 
>> e.g.:
>> 
>> 
>> 
>> Which works OK if you need some kind of data structure in the URL, but amost 
>> all the time this is obviously completely mad.
> 
> Good exception which proves the rule :_)
> 
> You know that was off list, right?
> 
> 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/


Re: [Catalyst] Which C::View::PDF should I use?

2010-03-05 Thread Kieren Diment

On 06/03/2010, at 2:13 PM, Charlie Garrison wrote:
> 
> On 5/03/10 at 11:15 AM +0100, Felix Antonius Wilhelm Ostmann 
>  wrote:
> 
>> We use simple View::TT and then a Filter:
>> [%- USE Latex; FILTER latex("pdf") -%]
> 
> Can anyone advise how long the learning curve is for latex (for basic usage)? 
> Would I be better off spending my time learning that?
> 
> 


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

http://stp.lingfil.uu.se/~zrajm/nerd/LaTeX/quickguide.html is a good enough 
start.  You don't need to know all of that.
___
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] using XML files to configure Catalyst

2010-03-04 Thread Kieren Diment
aye aye capn' 

http://dev.catalystframework.org/svnweb/Catalyst/revision?rev=13008

On 05/03/2010, at 3:29 AM, Aaron Trevena wrote:

> On 4 March 2010 10:16, Kieren Diment  wrote:
>> done
>> 
>> http://dev.catalystframework.org/svnweb/Catalyst/revision?rev=13006
> 
> Can you amend to change it to reflect using variable substitution?
> 
>  /path/to/site//templates
>  __path_to(root,templates)__
> 
> I now have global shared templates (what we called factory templates
> in maypole) that are part of the application and available to any site
> using the application, but used as a fallback (mostly for macros and
> such) when a template doesn't exist in the site.
> 
> very happy with the solution :)
> 
> A.
> 
> -- 
> Aaron J Trevena, BSc Hons
> http://www.aarontrevena.co.uk
> LAMP System Integration, Development and Consulting
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/


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


Re: [Catalyst] using XML files to configure Catalyst

2010-03-04 Thread Kieren Diment
done

http://dev.catalystframework.org/svnweb/Catalyst/revision?rev=13006

On 04/03/2010, at 8:57 PM, Aaron Trevena wrote:

> Hi all,
> 
> I couldn't find a full/complete example of configuring Catalyst with
> XML in the docs for ConfigLoader, Catalyst or anywhere..
> 
> eventually after reading through peoples' blogs and trial and error I
> managed to get the following working - would be nice if somebody
> familiar with the documentation style/layout/organisation can work it
> in somewhere, or as future reference for people who get stuck in the
> same way as me:
> 
> 
>MyApp::CMS
>
>  /var/www/docs/myapp-cms/uploads
>
>
>  dbi:mysql:cmsdb
>  user
>  password
>
>
>  /var/www/docs/myapp-cms/templates
>  UTF-8
>  1
>  2
>  2
>
> 
> 
> 
> note :
> 
> 
>  dbi:mysql:cmsdb
>  user
>  password
> 
> 
> doesn't work
> 
> Cheers,
> 
> A.
> 
> -- 
> Aaron J Trevena, BSc Hons
> http://www.aarontrevena.co.uk
> LAMP System Integration, Development and Consulting
> 
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/



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


Re: [Catalyst] How to get the name of the subroutine accessed?

2009-12-08 Thread Kieren Diment
On Wed, Dec 9, 2009 at 6:39 AM, Brian Cassidy  wrote:
> 2009/12/8 Octavian Râşniţă :
>> Is there a similar method for $c->action that can be used for getting the
>> name of the subroutine which is accessed?
[...]
> If the information from my post from long ago [1] still holds true,
> you should be able to use $c->stack->[ -1 ] to get the most "recent"
> action.

$c->stack->[ -1 ] is what I used in the Dispatcher chapter of the book
for this very purpose.

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


Re: [Catalyst] Catalyst::Plugin::Email not working

2009-12-03 Thread Kieren Diment
On Thu, Dec 3, 2009 at 9:02 PM, Alexander Hartmaier
 wrote:
> You shouldn't use C::P::Email any more, there is no need for that
> function to be a Catalyst plugin.
>
> Take a look at Catalyst::View::Email(::Template) instead!
>

I agree.  There's a working example with
Catalyst::View::Email::Template in chapter 11 of the book (source code
available from here:  http://www.apress.com/book/view/1430223650 )

___
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] Advent calendar 2009

2009-11-20 Thread Kieren Diment

Hi all

It's advent calendar time again.

Having dedicated a very large chunk of the first half of the year to  
writing a book about Catalyst, I don't have masses of time to run the  
editorial for the advent calendar this year, so I need some volunteers  
to ensure that we get one reasonably grammatical, reasonably well  
spelled entry per day, each day of December up until Christmas day.   
I'll be offline for some of the time at the end of the month too, so  
please if you think you can step up to help, grab me on irc (I'm KD  
there).


Meanwhile, I'd like volunteers to write an article.  Ideally we'd have  
25 people writing one article each.  I'd especially like articles  
about things that you use Catalyst for in-house that you might not  
think are terribly relevant to the outside world but in reality are  
probably really important.  Articles need to be between 500 and 2000  
words each.  If English is not your first language, don't worry, there  
are people (with professional editorial skills) who can fix things up  
for you.


I especially want a volunteer to write 500-1000 words on "How to write  
your own Moose Role for Catalyst".


Please step up and volunteer now.  Don't reply to the list, reply to  
me at dim...@gmail.com (header set but your client may be retarded).


I'm grabing the CSS frameworks article, and if we run out of copy,  
another article plugging the new-ish book (http://xrl.us/bgcztu).




___
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] auto method never triggered

2009-11-01 Thread Kieren Diment

On 02/11/2009, at 1:07 PM, Julien Sobrier wrote:


Thank you

Shoudl It put __PACKAGE__->config->{namespace} = ''root;, or simply  
remove

this line?

Thank you

Julien





If you want Root to hit at '/' on your app you remove it from the  
Admin controller, which will then hit at '/admin'





On Sun, Nov 1, 2009 at 1:29 AM, Kieren Diment   
wrote:




On 01/11/2009, at 3:36 PM, Julien Sobrier wrote:

BTW, both Root.pm and Admin.pm have this line:


__PACKAGE__->config->{namespace} = '';

Not sure if it makes a difference.




Yes it does.  This line stops the Root controller matching /root in  
the

public namespace.  Having this in two different controllers will have
unpredictable consequences.


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


Re: [Catalyst] auto method never triggered

2009-11-01 Thread Kieren Diment


On 01/11/2009, at 3:36 PM, Julien Sobrier wrote:


BTW, both Root.pm and Admin.pm have this line:

__PACKAGE__->config->{namespace} = '';

Not sure if it makes a difference.



Yes it does.  This line stops the Root controller matching /root in  
the public namespace.  Having this in two different controllers will  
have unpredictable consequences.


___
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] Serving a static document

2009-10-02 Thread Kieren Diment


On 02/10/2009, at 9:13 PM, matthew couchman (JIC) wrote:


Hello,

I'm quite new to Catalyst so apologies if this is a naive question.  
I'm trying to create a KML document within catalyst and then  
redirect the server to that document. The problem I'm having is that  
Catalyst seems to be interpreting the URL of the document (e.g. http://localhost:3000/root/src/test.kml) 
 as a call to a script which it doesn't recognise and so it reverts  
to the default page. How do I override this behaviour?




Something like this (untested):

sub thing :Path('test.kml') {
  my ($self, $c) = @_;
  $c->serve_static_file('relative/path/from/app/root/to/test.kml');
}   

or similar.  Catalyst::Plugin::Static::Simple does the dirty work for  
you.



___
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 and UTF8 Chained URLs

2009-09-08 Thread Kieren Diment


I think you need to write a  test for the behaviour to get that  
patched into the core.  Also you're probably better to send the patch  
to Catalyst::Runtime's RT queue: http://rt.cpan.org/Public/Bug/Report.html?Queue=Catalyst-Runtime



On 09/09/2009, at 11:45 AM, Rod Taylor wrote:


I have a URL which includes UTF8 components which are in the chained
(CaptureArgs) position. The escape mechanism is supposed encode each  
byte of
the UTF8 sequence individually when creating the URL (which Catalyst  
seems

to do) and reverse this on the way in.

The below adjustment appears to fix the issue I'm having with URL  
arguments

not being decoded on the way in.
 [snip]


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

2009-08-28 Thread Kieren Diment


On 28/08/2009, at 10:17 PM, Dami Laurent (PJ) wrote:

Hi, I just started reading the book, I can do a review. Let me know  
where/when/how long.


Cheers,

Laurent Dami



Well in this case I specifically want to see it reviewed on slashdot,  
because it's a big popular website (still) and slashcode is in a way  
one of Catalyst's ancestors.


But in general the more reviews the better in any case (e.g.  
Amazon.com, or on your blog).


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

2009-08-28 Thread Kieren Diment

Who wants to write a review of the book for slashdot?

___
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 Apress book on Safari Books Online

2009-07-23 Thread Kieren Diment


On 24/07/2009, at 5:05 AM, John Napiorkowski wrote:






If I may I recommend the Ebook, you will receive it instantenously,
its searchable and printable
and 10 to 15 dollars cheaper!

Plus you save a tree, so its greener too!

Regards,
Ali


Does the mst and all get the same payment if we buy it as an ebook?

john



I think it's less because the royalty is based on the retail price.  I  
have no idea how things like Safari work ...


___
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 Apress book on Safari Books Online

2009-07-22 Thread Kieren Diment

On 22/07/2009, at 8:58 PM, Gavin Henry wrote:


Amazon uk keep delaying my order. It's definitely out right?




It sure is, I have my copies in this far and distant land.  Rocket up  
the bum time for them I would say.


And at this stage we'd be surprised if it didn't appear on Safari.



Thanks.

On 21/07/2009, Kieren Diment  wrote:


On 22/07/2009, at 7:49 AM, Meeko wrote:


Does anyone know if/whether the new Apress book "The Definitive
Guide to
Catalyst" will appear on O'Reilly Safari Books Online?  I have a
Safari
subscription, and prefer reading my tech books there.  I would
really like
to read the new book, and I keep checking every few days to see if
it has
appeared but so far it hasn't.
I was just wondering if anyone knows how long it usually takes books
to
appear there, and if or when the new Catalyst book will appear.  I
see lots
of Apress books on Safari, so I know their books do appear, so I'm
hoping
the new Catalyst books makes it soon.




I asked the boss, and will get back to you when he replies!




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



--
Sent from my mobile device

http://www.suretecsystems.com/services/openldap/
http://www.suretectelecom.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/




___
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 Apress book on Safari Books Online

2009-07-21 Thread Kieren Diment


On 22/07/2009, at 7:49 AM, Meeko wrote:

Does anyone know if/whether the new Apress book "The Definitive  
Guide to
Catalyst" will appear on O'Reilly Safari Books Online?  I have a  
Safari
subscription, and prefer reading my tech books there.  I would  
really like
to read the new book, and I keep checking every few days to see if  
it has

appeared but so far it hasn't.
I was just wondering if anyone knows how long it usually takes books  
to
appear there, and if or when the new Catalyst book will appear.  I  
see lots
of Apress books on Safari, so I know their books do appear, so I'm  
hoping

the new Catalyst books makes it soon.




I asked the boss, and will get back to you when he replies!




___
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] more description for FAST CGI deployment in catalyst cookbook?

2009-07-15 Thread Kieren Diment


On 15/07/2009, at 10:19 PM, kakim...@tpg.com.au wrote:


Hello Kieren


1) I was just asking where do I put the configuration as per the
article. Here's an extract from my prev email.
For example, there's a bunch of configuration in step 2 of FAST CGI
deployment (title of "2. Configure your application").
The problem I am having here is that there is no mention of WHERE  
should

the configuration should be put in.



You didn't say where you put the configuration, and for completeness  
it's a very good idea to post the complete config that you've put  
together anyway.




2) No, I m not in sydney but yes, i am going to look into placing an
order through Amazon. Can you suggest a faster way (aside Sydney.pm)  
to

get a copy ? PDF purchase maybe?



You can buy a pdf through Apress' site: http://www.apress.com/book/view/1430223650 
 , but honestly I'd wait a paper copy.  I'm finding my pdf copy  
(which I really can't redistribute as it would get me in a lot of  
trouble) very annoying and I can't wait for a real paper one to arrive.





___
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] more description for FAST CGI deployment in catalyst cookbook?

2009-07-15 Thread Kieren Diment


On 15/07/2009, at 9:45 PM, kakim...@tpg.com.au wrote:


hi guys

i am trying to figure out how to bring my app for production.

Looked at
http://search.cpan.org/dist/Catalyst-Manual/lib/Catalyst/Manual/Cookbook.pod#FastCGI_Deployment
and i am just wondering if anyone can add more description for FAST  
CGI

deployment in catalyst cookbook?

For example, there's a bunch of configuration in step 2 of FAST CGI
deployment (title of "2. Configure your application").
The problem I am having here is that there is no mention of WHERE  
should

the configuration should be put in.




You need to show us explicitly what you have tried so far for anyone  
to be able to point out the error of your ways.


At the risk of seeming facetious, I suggest that you obtain the new  
Catalyst book (http://www.amazon.com/gp/product/1430223650 disclaimer:  
I am the primary author), read chapter 5 on deployment, and once you  
understand that you can patch the documentation for the benefit of  
others.  This is how I got started writing docs for Catalyst, because  
I was frustrated that the instructions were not easy and obvious to  
me, and I needed something I knew I could follow.  The book follows  
the same principle, which is why about a third of it is written by  
other people.  Firstly it means I can safely forget what I already  
know and look it up instead, and secondly I can stand on the shoulders  
of people who are taller than me :) and look up what they have to say  
as well.


If you're close to Sydney,  Sydney.pm will be  having a book launch  
(where there is a chance of winning a copy), probably on Tuesday the  
28th of July.  I'll be sure to announce it on this list.





___
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] Configuration based on hostname

2009-07-12 Thread Kieren Diment


On 12/07/2009, at 5:29 PM, Mihai Bazon wrote:


Kieren Diment  wrote:


On 12/07/2009, at 4:35 PM, Mihai Bazon wrote:


Hi folks,

I think this was raised before but I don't remember to have seen a
satisfactory answer.  Someone please point me into the right
direction.

I want to deploy a Catalyst app that will be used to serve multiple
websites.  The platform will be Apache2 (prefork) + mod_perl2.  I  
want

Catalyst to read a different configuration file, based on the host
name.
Each virtual host will have its own database (configured in .conf)  
and

its own "root" directory, but other than this, all the Perl modules
are
the same.

I know this can be done with FastCGI by launching a different  
process

for each host, but I'm interested in a mod_perl solution.  Is it
feasible?



One of the limitations of mod_perl is that you can't run the same app
more than once on the same server.  Sorry.


Let me clarify that.  I don't want to run the app more than once.  I
just want the application to switch configuration file and database
depending on the hostname that each particular request targets.

I've done this a zillion times with plain mod_perl, I just don't know
what's the proper route with Catalyst.


Possibly to pick up some particular config that's chosen on the basis  
of the value of $c->req->host?


$c->config( host_config => {example.com => [qw/foo bar/],
  superbad.com => [qw/ 
fred wilma/}


Or if you need something more dynamic, put some configuration grabbing  
routine in auto in Controller::Root.






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


  1   2   3   >