Re: [Catalyst] Beginner question: View directory

2007-11-08 Thread Kieren Diment


On 8 Nov 2007, at 20:22, Ash Berlin wrote:

Similarly, I setup subs that I always want available in the TT  
stash, such as format_datetime (which formats a DateTime object  
according do the currently logged in user's preference.) I also  
accessing VMethods to $Template::Whatever::SCALAR_OPS here, since  
this seems like the place that such code belongs.




a ha!  which is the kind of issue where I was conflating with setting  
stash and 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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Beginner question: View directory

2007-11-08 Thread Ash Berlin

Dave Rolsky wrote:

On Thu, 8 Nov 2007, Kieren Diment wrote:

Good call, my mistake.  Goes to show that there's not usually much 
(or any) extra stuff that needs to be done in the View class.  I was 
actually struggling to think of code related things  (rather than 
config) which  you might want to put in there.   Personally I've 
always munged headers in the sub end : ActionClass(’RenderView’) {} 
subs (see perldoc Catalyst::Action::RenderView for details).


I have a few bits of code in my view class, but not much.

For the Mason view, I had subclass new() and chown() all the files 
created by the Mason Interp object to make things happy under 
mod_perl. Mason has this built-in to its mod_perl integration, but 
that doesn't get used with Catalyst.


I also have a method has_template_for_path() which does what it says. 
I call this from some controller auto() methods where the URI in 
question is basically static content that doesn't need a separate 
controller method.



-dave

Similarly, I setup subs that I always want aviabale in the TT stash, 
such as format_datetime (which formats a DateTime object according do 
the currently logged in user's prefernce.) I also assing VMethods to 
$Template::Whatever::SCALAR_OPS here, since this seems like the place 
that such code belonds.


-ash


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


Re: [Catalyst] [OT] Search Solution

2007-11-08 Thread Pedro Melo

Hi,

On Nov 8, 2007, at 8:23 AM, Fayland Lam wrote:


Sorry for a bit off topic.

I just wonder how to build a search engine for a heavy traffic site?
use KinoSearch or Plunce? or just get result from MySQL?


If you are using MySQL, checkout Sphinx also.

They have some interesting numbers on their site. Also check the  
http://www.mysqlperformanceblog.com/ site for Sphinx-related posts.


Best regards,
--
Pedro Melo
Blog: http://www.simplicidade.org/notes/
XMPP ID: [EMAIL PROTECTED]
Use XMPP!



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


Re: [Catalyst] [OT] Search Solution

2007-11-08 Thread Felix Antonius Wilhelm Ostmann

Other solution is Xapian

Catalyst::Model::Xapian



Pedro Melo schrieb:

Hi,

On Nov 8, 2007, at 8:23 AM, Fayland Lam wrote:


Sorry for a bit off topic.

I just wonder how to build a search engine for a heavy traffic site?
use KinoSearch or Plunce? or just get result from MySQL?


If you are using MySQL, checkout Sphinx also.

They have some interesting numbers on their site. Also check the 
http://www.mysqlperformanceblog.com/ site for Sphinx-related posts.


Best regards,



--
Mit freundlichen Grüßen

Felix Antonius Wilhelm Ostmann
--
Websuche   Search   Technology   GmbH  Co. KG
Martinistraße 3  -  D-49080  Osnabrück  -  Germany
Tel.:   +49 541 40666-0 - Fax:+49 541 40666-22
Email: [EMAIL PROTECTED] - Website: www.websuche.de
--
AG Osnabrück - HRA 200252 - Ust-Ident: DE814737310
Komplementärin: Websuche   Search   Technology
Verwaltungs GmbH   -  AG Osnabrück  -   HRB 200359
Geschäftsführer:  Diplom Kaufmann Martin Steinkamp
--


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


[Catalyst] [OT] Search Solution

2007-11-08 Thread Fayland Lam

Sorry for a bit off topic.

I just wonder how to build a search engine for a heavy traffic site?
use KinoSearch or Plunce? or just get result from MySQL?

how those big sites build their search engine? like facebook, hi5, digg? 
use SQL to get results instead of build a file index like KinoSearch?


anyone have any idea? Thanks.

--
Fayland Lam // http://www.fayland.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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] [OT] Search Solution

2007-11-08 Thread David Morel


Le 8 nov. 07 à 10:25, Felix Antonius Wilhelm Ostmann a écrit :


Other solution is Xapian

Catalyst::Model::Xapian


There was a discussion on this topic not so long ago. I suggest to  
have a look at the list archive, some interesting discussion went on  
at that time


David Morel




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


[Catalyst] Directory layout

2007-11-08 Thread Gerda Shank
Thanks for the responses to my question about the View Directory. I'm 
still trying to figure out the reasons for the rest of the directory layout.


The templates are not in the View directory, because the lib hierarchy 
is just for Perl code. Is that right?


Is root kind of the equivalent of htdocs?  What else would go in the 
static subdirectory besides images? Would you put css files in here? 
Does javascript go in static, or does it get a directory underneath root?


Are any parts of the layout created by catalyst.pl changeable, or 
would it break Catalyst to rename them? If, for example, root was 
changed to htdocs, or you didn't use the static directory?


Sorry for all the questions. I've been studying the documentation, but 
haven't had much like finding explanations for these things, and I'm not 
sure where to look in the code.


Thanks,
Gerda Shank






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


Re: [Catalyst] Directory layout

2007-11-08 Thread Cory Watson


On Nov 8, 2007, at 8:47 AM, Gerda Shank wrote:

The templates are not in the View directory, because the lib  
hierarchy is just for Perl code. Is that right?


Yes.  The Model, Controller and View directories house the respective  
perl classes that handle those functions.


Is root kind of the equivalent of htdocs?  What else would go in  
the static subdirectory besides images? Would you put css files in  
here? Does javascript go in static, or does it get a directory  
underneath root?


Before I say anything, let me say: The short answer is that you can  
set things up however you want.


The 'static' directory is  similar to htdocs.  The TT view is  
configured by default to use the 'root' directory as it's path for  
templates.  The static directory is a best practice, I usually put  
'css', 'javascript' and 'images' in there.  It's a good idea to put  
all your static files under a common directory when using mod_perl  
because then you can tell apache to use the default handler for all  
files under that path.  Using mod_perl to serve images is Bad Mojo.   
It's probably also a good idea for a bunch of other reasons.


Are any parts of the layout created by catalyst.pl changeable, or  
would it break Catalyst to rename them? If, for example, root was  
changed to htdocs, or you didn't use the static directory?


You probably could to this, but the default layouts are sort of a best  
practice.  I'd use the defaults until you understand them better.


Sorry for all the questions. I've been studying the documentation,  
but haven't had much like finding explanations for these things, and  
I'm not sure where to look in the code.



No worries.  It's better than doing things wrong and then  
complaining. ;)


--
Cory 'G Watson
http://www.onemogin.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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Beginner question: View directory

2007-11-08 Thread Dave Rolsky

On Thu, 8 Nov 2007, Ash Berlin wrote:

Similarly, I setup subs that I always want aviabale in the TT stash, such as 
format_datetime (which formats a DateTime object according do the currently 
logged in user's prefernce.) I also assing VMethods to 
$Template::Whatever::SCALAR_OPS here, since this seems like the place that 
such code belonds.


For Mason, this just involves importing subs that I want into the relevant 
package, but it's a similar thing. Yes, this obviously belongs in the view 
as well. Of course, if you had enough of this for TT you might want to put 
it in separate modules.



-dave

/*===
VegGuide.Orgwww.BookIRead.com
Your guide to all that's veg.   My book 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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Directory layout

2007-11-08 Thread Jonas Alves
On 11/8/07, Gerda Shank [EMAIL PROTECTED] wrote:
 Thanks for the responses to my question about the View Directory. I'm
 still trying to figure out the reasons for the rest of the directory layout.

 The templates are not in the View directory, because the lib hierarchy
 is just for Perl code. Is that right?

 Is root kind of the equivalent of htdocs?  What else would go in the
 static subdirectory besides images? Would you put css files in here?
 Does javascript go in static, or does it get a directory underneath root?

 Are any parts of the layout created by catalyst.pl changeable, or
 would it break Catalyst to rename them? If, for example, root was
 changed to htdocs, or you didn't use the static directory?

 Sorry for all the questions. I've been studying the documentation, but
 haven't had much like finding explanations for these things, and I'm not
 sure where to look in the code.

 Thanks,
 Gerda Shank


I put all my static files under static. Usually I have a directory
structure like this:

root/static/
root/static/js
root/static/css
root/static/images

-- 
Jonas

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


Re: [Catalyst] loading modules before the server forks

2007-11-08 Thread Octavian Rasnita
Ok, thank you. I know how to load the modules, but I just wanted to know if 
all dependencies are loaded before server fork.


Octavian

- Original Message - 
From: Andy Grundman [EMAIL PROTECTED]

To: The elegant MVC web framework catalyst@lists.scsys.co.uk
Sent: Thursday, November 08, 2007 9:39 PM
Subject: Re: [Catalyst] loading modules before the server forks




On Nov 8, 2007, at 2:32 PM, Octavian Rasnita wrote:


Hi,

If I have a Catalyst application and I use

PerlResponseHandler Application::Name

in httpd.conf

and I load that module in a startup.pl file, what happends with the 
modules that might be loaded by that Catalyst app?
Are they also loaded before the server forks? Or I will need to load 
them manually one by one in the startup.pl?


All you have to load is your application, i.e.:

PerlModule MyApp

Everything is then loaded before Apache forks any children.

See the config example here:

http://search.cpan.org/~agrundma/Catalyst-Engine-Apache-1.11/lib/Catalyst/Engine/Apache2/MP20.pm

-Andy

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



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


[Catalyst] Anybody in socal fancy doing some perl pimping?

2007-11-08 Thread Matt S Trout
http://www.socallinuxexpo.org/blog/2007/11/08/calling-all-free-open-source-projects/

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

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


Re: [Catalyst] loading modules before the server forks

2007-11-08 Thread Andy Grundman


On Nov 8, 2007, at 2:32 PM, Octavian Rasnita wrote:


Hi,

If I have a Catalyst application and I use

PerlResponseHandler Application::Name

in httpd.conf

and I load that module in a startup.pl file, what happends with the  
modules that might be loaded by that Catalyst app?
Are they also loaded before the server forks? Or I will need to load  
them manually one by one in the startup.pl?


All you have to load is your application, i.e.:

PerlModule MyApp

Everything is then loaded before Apache forks any children.

See the config example here:

http://search.cpan.org/~agrundma/Catalyst-Engine-Apache-1.11/lib/Catalyst/Engine/Apache2/MP20.pm

-Andy

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


[Catalyst] loading modules before the server forks

2007-11-08 Thread Octavian Rasnita

Hi,

If I have a Catalyst application and I use

PerlResponseHandler Application::Name

in httpd.conf

and I load that module in a startup.pl file, what happends with the modules 
that might be loaded by that Catalyst app?
Are they also loaded before the server forks? Or I will need to load them 
manually one by one in the startup.pl?


Thanks.

Octavian


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


Re: [Catalyst] loading modules before the server forks

2007-11-08 Thread Andy Grundman


On Nov 8, 2007, at 4:21 PM, Octavian Rasnita wrote:

Ok, thank you. I know how to load the modules, but I just wanted to  
know if all dependencies are loaded before server fork.


Yeah, they are.  Catalyst will load all your controllers, models, etc,  
and those will load all their modules, and so on.


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


Re: [Catalyst] Directory layout

2007-11-08 Thread Kieren Diment

On 9 Nov 2007, at 01:47, Gerda Shank wrote:

Thanks for the responses to my question about the View Directory.  
I'm still trying to figure out the reasons for the rest of the  
directory layout.


The templates are not in the View directory, because the lib  
hierarchy is just for Perl code. Is that right?


Is root kind of the equivalent of htdocs?  What else would go  
in the static subdirectory besides images? Would you put css  
files in here? Does javascript go in static, or does it get a  
directory underneath root?


Are any parts of the layout created by catalyst.pl changeable, or  
would it break Catalyst to rename them? If, for example, root was  
changed to htdocs, or you didn't use the static directory?


Sorry for all the questions. I've been studying the documentation,  
but haven't had much like finding explanations for these things,  
and I'm not sure where to look in the code.




One slightly more exotic thing I've done is:

in Controller::Root

sub index : Private { my ($self, $c) = @_; $c-res-redirect('/static/ 
index.html');}


sub ajax_method : Local {
# do stuff for handling ajax calls from the static page above
}

So the answer is whatever you like :-)

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


[Catalyst] Re: [OT] Search Solution

2007-11-08 Thread Fayland Lam

David Morel wrote:


Le 8 nov. 07 à 10:25, Felix Antonius Wilhelm Ostmann a écrit :


Other solution is Xapian

Catalyst::Model::Xapian


There was a discussion on this topic not so long ago. I suggest to have 
a look at the list archive, some interesting discussion went on at that 
time



I searched http://lists.scsys.co.uk/pipermail/catalyst/, but don't find 
anything. could u tell me which month is it talked?


Thanks.





David Morel




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




--
Fayland Lam // http://www.fayland.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/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/