Re: [Catalyst] Initialization

2011-03-05 Thread Tomas Doran


On 5 Mar 2011, at 07:15, John M. Dlugosz wrote:

I want to do something once ahead of time, not every time my Model  
is used by a page.  Where is the correct place to put code that will  
execute once during app set-up, and how can it know what the  
configured root directory is?


The scope of a model is (if you don't change it) per application  
lifetime.


Ergo you can just do your work in the BUILD method for your model.

Just pass in the root you want the model to see as config, add an  
attribute, and the value will be there for you..


Something like:

package MyApp::Model::Foo;
use Moose;
use namespace::autoclean;

has root = (
is = 'ro',
required = 1,
);

sub BUILD {
my $self = shift;
... your code here, and you can call $self-root  ...
}

and then in MyApp.pm:

__PACKAGE__-config(
'Model::Foo' = {
root = __PACKAGE__-path_to('root'),
  },
);

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] Catalyst::Plugin::RunAfterRequest and Catalyst::View::Email?

2011-03-05 Thread Tomas Doran


On 3 Mar 2011, at 09:14, Chakkit Ngamsom wrote:


Thanks Steve, problem solved now.



From: Matt S Trout m...@shadowcat.co.uk
Date: May 2, 2010 12:49:32 PM PDT

Proposal: first you try the -process-by-hand approach to confirm  
that I'm
an idiot the way I think I am. Second we discuss how to either (a)  
fix this

or (b) make sure it produces a non-awful error.


As mst proposed almost 12 months ago, can we do something to make this  
more obvious / easy?


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

2011-03-05 Thread John M. Dlugosz

 On 3/5/2011 3:01 AM, Tomas Doran bobtfish-at-bobtfish.net |Catalyst/Allow to 
home| wrote:


Ergo you can just do your work in the BUILD method for your model.


Thanks for that, and the example.


Just pass in the root you want the model to see as config, add an attribute, and the 
value will be there for you..
The root is already being set up somehow.  That's what path_to('root') in the example is 
finding?  Why does this need to be set again on Model's config?  Is the model not seeing 
that information at BUILD time?




Something like:

package MyApp::Model::Foo;
use Moose;
use namespace::autoclean;

has root = (
is = 'ro',
required = 1,
);

sub BUILD {
my $self = shift;
... your code here, and you can call $self-root  ...
}

and then in MyApp.pm:

__PACKAGE__-config(
'Model::Foo' = {
root = __PACKAGE__-path_to('root'),
  },
);

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/


[Catalyst] debug prints

2011-03-05 Thread John M. Dlugosz
 How do I send stuff to the console running the script/Appname_server.pl -d from a 
component method?


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/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] debug prints

2011-03-05 Thread Nicholas Wehr
use the log method of $c:

$c-log-debug(my message);


cheers,
-nw

On Sat, Mar 5, 2011 at 2:21 PM, John M. Dlugosz wxju46g...@snkmail.comwrote:

  How do I send stuff to the console running the script/Appname_server.pl -d
 from a component method?

 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/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] SOAP WSDL client

2011-03-05 Thread linuxsupport
Hi,

Can any one provide me an example of using SOAP from Catalyst? basically I
want to access a web web service.

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