Re: [Catalyst] GSOC Flyer for participation

2011-03-21 Thread Julien Sobrier
BTW, does anybody have any contact at perlfoundation.org? Their
website is used for spam. For example:
http://www.perlfoundation.org/data/workspaces/perl6/attachments/credy:20110321123553-19-10773/files/log21.html

Julien

On Mon, Mar 21, 2011 at 6:33 AM, Mark Keating  wrote:
> Further to my previous email, there is a flyer available as a pdf at:
>
> http://www.community.markkeating.me.uk/promotion/GSOC-2011-Flyer.pdf
>
> This can be printed out and displayed on notice boards or handed to students
> in your area, if you have a couple of hours to print these out and
> distribute them in appropriate locations it would be much appreciated.
>
> Kind regards
>
> Mark
>
> --
> Mark Keating BA (Hons)          |  Writer, Photographer, Cat-Herder
> Managing Director               |  Shadowcat Systems Limited
> Director/Secretary              |  Enlightened Perl Organisation
> co-Leader                       |  North West England Perl Mongers
> http://www.shadowcat.co.uk      |  http://www.enlightenedperl.org
> http://northwestengland.pm.org  |  http://linkedin.com/in/markkeating
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/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: How to get uri_for something with a fragment?

2011-03-08 Thread Julien Sobrier
The fragment is not sent to the server by the client:
http://tools.ietf.org/html/rfc3986#section-3.5
http://en.wikipedia.org/wiki/URL_fragment
"The fragment identifier functions differently than the rest of the
URI: namely, its processing is exclusively client-side with no
participation from the server."

So any server-side property/method will not be able to show the
fragment. This is not specific to Catalyst.

Julien

On Tue, Mar 8, 2011 at 10:11 PM, will trillich
 wrote:
> I can't see that the original question has been answered. I'm interested as
> well...
> The manpage for $c->uri_for()
> at http://search.cpan.org/~bobtfish/Catalyst-Runtime-5.80032/lib/Catalyst.pm) talks
> about ?query=values but not about #anchors. Is there any facility via e.g.
> $c->uri_for() to generate a url-with-anchor? Or is it just a matter of
> tacking on a "#anchor" using perl concatenation?
>
>
>
> On Tue, Mar 8, 2011 at 8:37 PM, John M. Dlugosz 
> wrote:
>>
>> On 3/8/2011 10:27 AM, Ashley Pond V apv-at-sedition.com |Catalyst/Allow to
>> home| wrote:
>>>
>>> Well, the original message was:
>>>
> How do I call uri_for_action and pass it the '#id' part? It's not an
> arg and it's not part of the query string. This is called the fragment
> identifier in the final URL.
>>>
>>> uri_for_action makes it implicit that he was seeking a server side use
>>> of the fragment.
>>>
>>> -Ashley
>>
>> I just wanted the page that contained the item I knew was on it, without
>> hard-coding the URL like the good people on this list taught me.  I know the
>> browser takes care of jumping to that spot on the page.
>>
>> --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/
>
>
>
> --
> The first step towards getting somewhere is to decide that you are not going
> to stay where you are.  -- J.P.Morgan
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/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] Best prcatice: same back-end, different UI

2011-03-08 Thread Julien Sobrier
Hello,
I have multiple domain names tight to the same back-end. I'd like to
be able to present different templates based on:
* the domain name
* the language (not just a translation)
* user agent (mobile version)

I am wondering what is the best way to achieve this.

Thanks
Julien

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

2010-08-01 Thread Julien Sobrier
Hello,
I've started to translate my website using Catalyst::Plugin::I18N. It
works fine for static text. Bu I can't make it work for variables. For
example, I need to a translation for [% foo %] where for can take a
set of values defined in a database.

I'm sot sure what is the best way to translate such variables, and
what is possible:
* add a msgid for each possible value in messages.po => those gets
removed every time I run xgettext.pl
* Make the translation in my Database layer => unfortunately I use the
old Class::DBI, and could not find a plugin for it
* any other option?

Also, writing [% c.loc(foo) %] does not create an entry in messages.po
when running xgettext.pl, like [% c.loc('foo') %] does.

Thanks
Julien

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/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 extend authentication to use other DB fields?

2010-03-25 Thread Julien Sobrier
Actually, I found the reason:  password_type   => 'self_check',

To fix my issue, I added a second real with password_type   => 'clear',



__PACKAGE__->config->{'Plugin::Authentication'} = {
default => {
class   => 'SimpleDB',
user_model  => 'DB::User',
password_type   => 'self_check',
},
free => {
class   => 'SimpleDB',
user_model  => 'DB::User',
password_type   => 'clear',
},
};


There might be a better way to do it.

Julien

On Thu, Mar 25, 2010 at 8:16 PM, Julien Sobrier  wrote:
> Hello,
> I am not really sure what you mean. I have tried this, but
> authentication always fails:
>
> $c->authenticate({ facebook_id => $uid, active => 1 })
>
> I have triple checked that the parameters are correct, and the user
> exists in the database.
>
>
> On Wed, Mar 24, 2010 at 10:59 PM, Evan Carroll  wrote:
>>> I would like to extend my autentication to accept other fields:
>>> with $c->authenticate({ fileld1 => [..], field2 => [...], fieldd => [...] 
>>> });
>>
>> ...
>>
>>> Do I have to create my own Catalyst::Authentication::Credential plugin?
>>
>> No, it already does that... per the docs:
>>
>>    The first, and most common, method is simple retrieval. As its
>> name implies simple
>>    retrieval allows you to simply to provide the column => value
>> pairs that should be
>>    used to locate the user in question. An example of this usage is below:
>>
>> --
>> Evan Carroll
>> System Lord of the Internets
>>
>> ___
>> List: Catalyst@lists.scsys.co.uk
>> Listinfo: http://lists.scsys.co.uk/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 extend authentication to use other DB fields?

2010-03-25 Thread Julien Sobrier
Hello,
I am not really sure what you mean. I have tried this, but
authentication always fails:

$c->authenticate({ facebook_id => $uid, active => 1 })

I have triple checked that the parameters are correct, and the user
exists in the database.


On Wed, Mar 24, 2010 at 10:59 PM, Evan Carroll  wrote:
>> I would like to extend my autentication to accept other fields:
>> with $c->authenticate({ fileld1 => [..], field2 => [...], fieldd => [...] });
>
> ...
>
>> Do I have to create my own Catalyst::Authentication::Credential plugin?
>
> No, it already does that... per the docs:
>
>    The first, and most common, method is simple retrieval. As its
> name implies simple
>    retrieval allows you to simply to provide the column => value
> pairs that should be
>    used to locate the user in question. An example of this usage is below:
>
> --
> Evan Carroll
> System Lord of the Internets
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/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] How to extend authentication to use other DB fields?

2010-03-24 Thread Julien Sobrier
Hello,
I am currently using the simple password authentnication:
__PACKAGE__->config->{'Plugin::Authentication'} = {
default => {
class   => 'DBIx::SimpleDB', #
user_model  => 'DB::User',
password_type   => 'self_check',
},
};

with $c->authenticate({ username => [..], password => [...] });

I would like to extend my autentication to accept other fields:
with $c->authenticate({ fileld1 => [..], field2 => [...], fieldd => [...] });


Do I have to create my own Catalyst::Authentication::Credential plugin?

Thank you
Julien

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/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 PHP framework is the most similar to Catalyst?

2010-03-21 Thread Julien Sobrier
Thank you all, Kohana PHP + Doctrine looks like what I was looking for.

Julien

On Sun, Mar 21, 2010 at 2:07 PM, David Silva  wrote:
> If you allready checked the Code Igniter, take another look to Kohana PHP
> Framework, is based on Code Igniter, but is supported by the comunity istead
> of a company.
>
>
>
> 2010/3/21 Peter Karman 
>>
>> Julien Sobrier wrote on 3/21/10 12:18 AM:
>> > Hello,
>> > I need to help a project that will be developed with PHP. I really
>> > love Catalyst, and I am looking for a similar framework in PHP.
>> > Symphony seems to be the closed to Catalyst. Do you have any
>> > suggestion?
>>
>> I found myself in a similar situation several months ago and have ended up
>> using
>> CodeIgniter http://codeigniter.com/ plus Doctrine
>> http://www.doctrine-project.org/ as the ORM.
>>
>>
>> --
>> Peter Karman  .  http://peknet.com/  .  pe...@peknet.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/
>
>
>
> --
> David Silva - http://davidslv.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/


[Catalyst] Which PHP framework is the most similar to Catalyst?

2010-03-20 Thread Julien Sobrier
Hello,
I need to help a project that will be developed with PHP. I really
love Catalyst, and I am looking for a similar framework in PHP.
Symphony seems to be the closed to Catalyst. Do you have any
suggestion?

Thank you
Julien

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/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: How to read the performance information

2010-02-21 Thread Julien Sobrier
Hello,
I don't have any DNS lookup in my application. Does catalyst make any
reverse DNS lookup in debug mode?

Thank you
Julien

On Fri, Feb 19, 2010 at 9:01 PM, Aristotle Pagaltzis wrote:

> * Andrew Rodland  [2010-02-19 07:35]:
> > On Thursday 18 February 2010 11:14:46 pm Julien Sobrier wrote:
> > > The time don't add up. Form the timing under Action. it took
> > > less than 1 second. But the line before says 8.27s. Does it
> > > mean 7+ seconds were spend doing something else? Doing what?
> > >
> > There are two things that spring to mind:
> >
> > 1. Time spent reading the request from the user (after the
> > connection is made but before the full request is received) is
> > accounted to the "Request took" time but not to any action.
> > Normally this should be a very small amount of time for a GET,
> > but in case of very bad network conditions it could be longer.
> > This wouldn't be any indication of the performance of your app.
> >
> > 2. Your system could have had a major I/O stall between the
> > beginning of request handling and the beginning of action
> > dispatch, or between the end of action dispatch and the end of
> > request handling. You would probably know if this was
> > happening. :)
>
> Or something that qualifies as both. My immediate first suspicion
> in such cases: check your DNS lookup machinery.
>
> Regards,
> --
> Aristotle Pagaltzis // <http://plasmasturm.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/


[Catalyst] How to read the performance information

2010-02-18 Thread Julien Sobrier
Hello,
I'm triyng to understand waht make some pages slow at some points of the
day. I am gathering the server side loading time. For example, I get:

[2010/02/18 17:08:18] "GET" request for
"latest/383192/euro-pro-shark-multi-vac" from "207.111.235.33"
[2010/02/18 17:08:18] Request took 8.274028s (0.121/s)
.+---.
| Action | Time  |
++---+
| /begin | 0.001262s |
|  my begin  | 0.000213s |
|   - user info  | 0.000583s |
|   - facebook api parsing   | 0.000245s |
|| 0.93s |
|   /latest/bargain  | 0.227671s |
|-> /bargains/bargain| 0.227286s |
| mysub  | 0.226919s |
|  - processed arguments | 0.000202s |
|  - Get item| 0.002293s |
|  - Modify description  | 0.000122s |
|  - Get votes   | 0.100351s |
|  - Find similar items  | 0.006513s |
|  - Items from same store   | 0.001060s |
|  - Added to favorites? | 0.108573s |
|  - Ads | 0.007552s |
|  - fill out template   | 0.000162s |
|   /end | 0.007238s |
|-> Bargain::View::TT->process   | 0.006157s |
'+---'

The time don't add up. Form the timing under Action. it took less than 1
second. But the line before says 8.27s. Does it mean 7+ seconds were spend
doing something else? Doing what?

Thank you
Julien
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/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] Multiple path for the same action

2010-02-18 Thread Julien Sobrier
Thank you for pointing me to the right direction.

It looks like I could associates a new path with existing actions by
accessing $c->dispatcher

Julien

On Wed, Feb 17, 2010 at 10:47 PM, Eden Cardim  wrote:

>
>Julien> I want to let users decide how to name their URL.  For
>Julien> example, by default, the url looks like this: /home/Julien
>
>Julien> But people can decide to change /home with anything they
> Julien> want through an administration panel: /name/Julien
> Julien> /first-name/Julien /my-website/Julien etc.
>
> The politically correct way to do it would be to create your own
> dispatch type. See Catalyst::DispatchType and the built-in dispatch
> types (Catalyst::DispatchType::*) for that.
>
> Or, a simpler way to hack it in would be:
>
> sub foo :Chained('/') PathPart('') Args(2) {
>my($self, $c, $prefix, $username) = @_;
>$c->user->check_prefix($prefix) or $c->detach('/error_404');
> }
>
> Also, make sure you store the old prefixes and redirect to the new ones
> adequately as to not break the web.
>
> --
>   Eden Cardim   Need help with your Catalyst or DBIx::Class project?
>  Code Monkeyhttp://www.shadowcat.co.uk/catalyst/
>  Shadowcat Systems Ltd.  Want a managed development or deployment platform?
> http://edenc.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/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] Multiple path for the same action

2010-02-17 Thread Julien Sobrier
I want to let users decide how to name their URL.


For example, by default, the url looks like this:
/home/Julien

But people can decide to change /home with anything they want through an
administration panel:
/name/Julien
/first-name/Julien
/my-website/Julien
etc.

Thank you
Julien

On Wed, Feb 17, 2010 at 6:15 PM, J. Shirley  wrote:

> On Wed, Feb 17, 2010 at 5:34 PM, Julien Sobrier 
> wrote:
> > Thank you
> >
> > But I cannot create these aliases at run-time, right?
>
>
> They're not aliases, they're methods and dispatchable actions.
>
> How about explaining what you are trying to achieve :)
>
> -J
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/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] Multiple path for the same action

2010-02-17 Thread Julien Sobrier
Thank you

But I cannot create these aliases at run-time, right?

Julien

On Wed, Feb 17, 2010 at 4:56 PM, J. Shirley  wrote:

> On Wed, Feb 17, 2010 at 4:18 PM, Julien Sobrier 
> wrote:
> > Hello,
> > I'd like to assign multiple pass, at run-time, to the same action. For
> > example:
> >
> > package MyApp::Controller::Foo;
> >
> > sub foo :Path {...}
> >
> > Then, have /foo, /bar, /other associated with MyApp::Controller::Foo->foo
> >
> > One way to do it woould be to catch /bar and /other in the "default"
> action,
> > and forward it it to /foo. But this does not look like a clean solution.
> Any
> > better way do achieve this?
> >
> > Thank you
> > Julien
>
>
> Sounds like you may want to use Chained, but your description isn't
> really clear enough to answer for sure.
>
> sub bar : Chained('/') PathPart('') CaptureArgs(0) { }
> sub other : Chained('bar') PathPart('') CaptureArgs(0) { }
> sub foo : Chained("other') PathPart(''foo) Args(0) { }
>
> Calling /foo would call bar, then other and finally foo.
>
> -J
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/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] Multiple path for the same action

2010-02-17 Thread Julien Sobrier
Hello,
I'd like to assign multiple pass, at run-time, to the same action. For
example:

package MyApp::Controller::Foo;

sub foo :Path {...}

Then, have /foo, /bar, /other associated with MyApp::Controller::Foo->foo

One way to do it woould be to catch /bar and /other in the "default" action,
and forward it it to /foo. But this does not look like a clean solution. Any
better way do achieve this?

Thank you
Julien
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/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: How to forward to a specific path

2010-01-25 Thread Julien Sobrier
Thanks.

I have pages in /page//

I created a couple of categories: /ca1, /cat2, etc. Each of them map to a
/page//

/page/1/some-title
/cat1/page/1/some-title
/cat2/page/1/some-title

For cat1 and cat2, I wanted to set some variables. So I intercept the page
in /cat1 and send it back to /page/1/some-title

/cat1, /cat2 and /page reside in different controller.

I'm just starting with Catalyst, so there might be a better way to do it.


Julien


On Sat, Jan 2, 2010 at 4:09 AM, Aristotle Pagaltzis wrote:

> Hi Julien,
>
> * Julien Sobrier  [2010-01-01 23:30]:
> > I'm try to do a forward to a path rather than a controller. For
> > example, if I get the url /foo/my/path, I want to redirect it
> > to /my/path which belongs to a different controller.
>
> this sounds like there may be a way to achieve the goal you are
> trying to achieve. What is your goal here?
>
> Regards,
> --
> Aristotle Pagaltzis // <http://plasmasturm.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 to forward to a specific path

2010-01-01 Thread Julien Sobrier
Exactly what I needed, thanks a lot.

On Fri, Jan 1, 2010 at 8:19 PM, Larry Leszczynski wrote:

> Hi Julien -
>
> On Fri, 01 Jan 2010 14:26 -0800, "Julien Sobrier" 
> wrote:
>
> > Hello, I'm try to do a forward to a path rather than a controller. For
> > example, if I get the url /foo/my/path, I want to redirect it to
> > /my/path which belongs to a different controller.
>
> In general you should be able to forward() to a path, not sure what is
> going on in your case without seeing the error message.  But forwarding
> to a path can get confused if that path is handled by a default action,
> if that is the case then this might help:
>
>   http://dev.catalyst.perl.org/wiki/wikicookbook/safedispatchusingpath
>
>
> HTH,
> Larry
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/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 forward to a specific path

2010-01-01 Thread Julien Sobrier
Right,
but this mapping is stored somewhere since it is displayed by Catalyst in
debug mode:

.-+--.
| Path| Private   |
+-+--+
| / | /index
|
| / | /default
|
| /admin| /admin/admin   |


2010/1/1 Eisenberger Tamás 

>  Hy!
>
> I think your problem is that there is a difference between how an url
> dispatched to an action, and how forward finds the action to forward to...
>
> so for example, if you have a controller (YourApp::Controller::Foo) with an
> index method you can access it with the url path /foo, but you should use
> /foo/index in forward... so the 'private' path to the action is different
> from the 'public' path in many times!
>
>
> On 01/01/2010 11:26 PM, Julien Sobrier wrote:
>
> Hello,
> I'm try to do a forward to a path rather than a controller. For example, if
> I get the url /foo/my/path, I want to redirect it to /my/path which belongs
> to a different controller. In the controllfer Foo, I tried something like
> this:
>
> sub foo :Path :Args {
> my ($self, $c) = @_
>
>$c->forward("/" . join("/", @{$c->req->args}); #
> $c->forward("/my/path");
> }
>
>
> I cannot fin the righrt command to forward to any path.
>
> Thank you
> Julien
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/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/


[Catalyst] How to forward to a specific path

2010-01-01 Thread Julien Sobrier
Hello,
I'm try to do a forward to a path rather than a controller. For example, if
I get the url /foo/my/path, I want to redirect it to /my/path which belongs
to a different controller. In the controllfer Foo, I tried something like
this:

sub foo :Path :Args {
my ($self, $c) = @_

   $c->forward("/" . join("/", @{$c->req->args}); # $c->forward("/my/path");
}


I cannot fin the righrt command to forward to any path.

Thank you
Julien
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/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] Partial page cache plugin

2009-12-06 Thread Julien Sobrier
Thank you, I will lokk in this direction.

Julien

On Sun, Dec 6, 2009 at 2:56 AM, Octavian Râsnita  wrote:

> From: "Julien Sobrier" 
>
>  Hello,
>> there is a plugin for caching an entire page.  I am looking for the same
>> type of plugin to cache part of the page, but did not find one. Waht is
>> the
>> best way to achieve this in Catalyst?
>>
>
> You can use Catalyst::Plugin::Cache. You can do:
>
> use Digest::SHA1 'sha1_hex';
> use base 'Catalyst::Controller';
>
> sub foo : Local {
>  my ($self, $c) = @_;
>
> my $name = $c->req->params->{name};
> my $age = $c->req->params->{age};
> my $page = $c->req->params->{page};
>
>  my $hash = sha1_hex('foo', $name, $age, $page);
>  my $cache = $c->cache;
>  my $page_part = $cache->get($hash);
>
> unless ($page_part) {
> #Here make the selection from the database, get the data from somewhere
> else...
> my $object = $c->model("DB::Table")->search({
> name => {-like => "%$name%"},
> age => $age,
> },{
> order_by => 'name',
> rows => 20,
> page => $page,
> });
>
> $c->stash(obj => $obj);
> $page_part = $c->view('TT')->render($c, 'template/for/that/part/of/the/
> page.tt');
>
> $cache->set($hash, $page_part, 600);
> }
>
> $c->stash(page_part => $page_part);
> }
>
> This way it works fine, although if someone has an easier and/or nicer
> solution, please tell us.
>
> PageCache has some conflicts with another plugin, if I remember well is
> Catalyst::Plugin::Unicode.
>
> Template::Plugin::Cache that can be used for page parts caching very easy
> doesn't work well with templates that contain special UTF-8 chars (I was
> informed that this is because the FileCache module and I heard that it could
> work with a CHI object).
>
> Anyway, if somebody has some recommendations for speed improvements with
> Catalyst, please tell us if there are (I have checked a PHP page with many
> dynamic types of data that have a 44 requests/second, but I wasn't able to
> create a much simpler page with Catalyst that displays so fast).
> Yes, I know, the PHP page is low level, harder to create and to maintain,
> gives bad errors, but I can't convince that Catalyst is good if it is not
> fast enough, so any tips for using caches or other ways of improving the
> speed are welcome.
>
> Thank you.
>
> Octavian
>
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/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: Partial page cache plugin

2009-12-06 Thread Julien Sobrier
I certainly use it for caching objects, but there is a lot more work
involved for caching the final output (HTML) like
Catalyst::Plugin::PageCache does.

On Sun, Dec 6, 2009 at 12:28 AM, Aristotle Pagaltzis wrote:

> Hi Julien,
>
> * Julien Sobrier  [2009-12-06 09:10]:
> > there is a plugin for caching an entire page.  I am looking for
> > the same type of plugin to cache part of the page, but did not
> > find one.
>
> uhm… Catalyst::Plugin::Cache?
>
> Regards,
> --
> Aristotle Pagaltzis // <http://plasmasturm.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/


[Catalyst] Partial page cache plugin

2009-12-06 Thread Julien Sobrier
Hello,
there is a plugin for caching an entire page.  I am looking for the same
type of plugin to cache part of the page, but did not find one. Waht is the
best way to achieve this in Catalyst?

Thank you
Julien
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/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 reduce the memory footprint?

2009-11-23 Thread Julien Sobrier
Right, nprocs=5

I thought 100M RES/300M VIRT meanst 100M per process, and 300M shard among
perl processes.

I don't have many other processes running on the box. If I turn off
catalyst, I use less than 250MB or memory. With Catalyst, I'm over 800MB
with some occasional swapping.


On Mon, Nov 23, 2009 at 1:00 PM, Tomas Doran  wrote:

>
> On 23 Nov 2009, at 18:18, Julien Sobrier wrote:
>
>  Hello,
>> I have quite a small Catalyst application that runs with FastCGI +
>>  FCGI::ProcManager::MaxRequests
>>
>> I run 5 instances of FastCGI. Each instance was taking about 90MB of
>> memory. I tried to reduce the memory fooprint by reducing the number of
>> libraries I used. The memory usage is now 120MB per instance! The memory
>> increase is probably due to other changes.
>>
>
> When you say '5 instances', you mean you have nprocs = 5, right?
>
> This _isn't_ using 100Mb per instance - all of the application is loaded
> into memory before fork() is called, so it will mostly be shared (by copy on
> write) memory.
>
> 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] How to reduce the memory footprint?

2009-11-23 Thread Julien Sobrier
Hello,
I have quite a small Catalyst application that runs with FastCGI +
FCGI::ProcManager::MaxRequests

I run 5 instances of FastCGI. Each instance was taking about 90MB of memory.
I tried to reduce the memory fooprint by reducing the number of libraries I
used. The memory usage is now 120MB per instance! The memory increase is
probably due to other changes.

I am wondering how to profile the memory usage, and how to reduce it:
* how can I figure out what is talking how much memory?
* is there a list of common things to do do to reduce the memory usage?
* is 100+MB per instance for  small application usual? I hope not...
* any tip to reduce or profile my memory usage?

Thank you
Julien
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/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 Julien Sobrier
Thank you, it works fine now.

On Sun, Nov 1, 2009 at 6:18 PM, Peter Karman  wrote:

> Julien Sobrier wrote on 11/1/09 8:07 PM:
> > Thank you
> >
> > Shoudl It put __PACKAGE__->config->{namespace} = ''root;, or simply
> > remove this line?
> >
>
> You should leave it as-is in the Root.pm and remove the line altogether in
> the
> Admin.pm.
>
>
>
> --
> Peter Karman  .  http://peknet.com/  .  pe...@peknet.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] auto method never triggered

2009-11-01 Thread Julien Sobrier
Thank you

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

Thank you

Julien


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/


Re: [Catalyst] auto method never triggered

2009-10-31 Thread Julien Sobrier
BTW, both Root.pm and Admin.pm have this line:

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

Not sure if it makes a difference.

Julien

On Sat, Oct 31, 2009 at 10:00 AM, Julien Sobrier  wrote:

> After adding an action, and return 1; in each auto and begin, it looks
> better:
>
> [info] *** Request 2 (0.000/s) [9579] [Sat Oct 31 09:58:48 2009] ***
> [debug] "GET" request for "/" from "192.168.1.100"
> [debug] Path is "/"
> [debug] Found sessionid "e1262ec64fecc849f31af4e61fbb38cb66a414e9" in
> cookie
> [debug] Restored session "e1262ec64fecc849f31af4e61fbb38cb66a414e9"
> [debug] root begin: http://test.bargain-notify.me/
> [debug] root auto: http://test.bargain-notify.me/
> [debug] Rendering template "index.tt"
> [info] Request took 0.077143s (12.963/s)
> .+---.
> | Action | Time  |
> ++---+
> | /begin | 0.000410s |
> | /auto  | 0.000197s |
> | /index | 0.008401s |
> |  -> /process_index | 0.001785s |
> | /end   | 0.048556s |
> |  -> Bargain::View::TT->process | 0.047238s |
> '+---'
>
>
> [info] *** Request 12 (0.000/s) [9579] [Sat Oct 31 09:59:51 2009] ***
> [debug] "GET" request for "admin" from "192.168.1.100"
> [debug] Path is "admin"
> [debug] Found sessionid "e1262ec64fecc849f31af4e61fbb38cb66a414e9" in
> cookie
> [debug] Restored session "e1262ec64fecc849f31af4e61fbb38cb66a414e9"
> [debug] root begin: http://test.bargain-notify.me/admin
> [debug] root auto: http://test.bargain-notify.me/admin
> [debug] Role granted: Administrator
> [debug] Rendering template "admin.tt"
> [info] Request took 0.230871s (4.331/s)
> .+---.
> | Action | Time  |
> ++---+
> | /begin | 0.000415s |
> | /auto  | 0.000198s |
> | /admin | 0.032198s |
> | /end   | 0.179180s |
> |  -> Bargain::View::TT->process     | 0.178188s |
> '+---'
>
>
> As you ca see, auto in Admin.pm does not fire.
>
> Thank you for the help.
>
> Julien
>
>
>
> On Sat, Oct 31, 2009 at 7:42 AM, Tomas Doran wrote:
>
>>
>> On 31 Oct 2009, at 05:10, Julien Sobrier wrote:
>>
>>>
>>>
>>> Whether I access / or /admin, I don't see any log from any of the auto
>>> functions, but I do see it from the begin fuctions. I am wondering what I am
>>> missing.
>>>
>>
>> Unsure.
>>
>> Can you attach the debug log of your application startup and the debug log
>> generated when you hit /admin ?
>>
>> 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/


Re: [Catalyst] auto method never triggered

2009-10-31 Thread Julien Sobrier
After adding an action, and return 1; in each auto and begin, it looks
better:

[info] *** Request 2 (0.000/s) [9579] [Sat Oct 31 09:58:48 2009] ***
[debug] "GET" request for "/" from "192.168.1.100"
[debug] Path is "/"
[debug] Found sessionid "e1262ec64fecc849f31af4e61fbb38cb66a414e9" in cookie
[debug] Restored session "e1262ec64fecc849f31af4e61fbb38cb66a414e9"
[debug] root begin: http://test.bargain-notify.me/
[debug] root auto: http://test.bargain-notify.me/
[debug] Rendering template "index.tt"
[info] Request took 0.077143s (12.963/s)
.+---.
| Action | Time  |
++---+
| /begin | 0.000410s |
| /auto  | 0.000197s |
| /index | 0.008401s |
|  -> /process_index | 0.001785s |
| /end   | 0.048556s |
|  -> Bargain::View::TT->process | 0.047238s |
'+---'


[info] *** Request 12 (0.000/s) [9579] [Sat Oct 31 09:59:51 2009] ***
[debug] "GET" request for "admin" from "192.168.1.100"
[debug] Path is "admin"
[debug] Found sessionid "e1262ec64fecc849f31af4e61fbb38cb66a414e9" in cookie
[debug] Restored session "e1262ec64fecc849f31af4e61fbb38cb66a414e9"
[debug] root begin: http://test.bargain-notify.me/admin
[debug] root auto: http://test.bargain-notify.me/admin
[debug] Role granted: Administrator
[debug] Rendering template "admin.tt"
[info] Request took 0.230871s (4.331/s)
.+---.
| Action | Time  |
++---+
| /begin | 0.000415s |
| /auto  | 0.000198s |
| /admin | 0.032198s |
| /end   | 0.179180s |
|  -> Bargain::View::TT->process | 0.178188s |
'+---'


As you ca see, auto in Admin.pm does not fire.

Thank you for the help.

Julien


On Sat, Oct 31, 2009 at 7:42 AM, Tomas Doran  wrote:

>
> On 31 Oct 2009, at 05:10, Julien Sobrier wrote:
>
>>
>>
>> Whether I access / or /admin, I don't see any log from any of the auto
>> functions, but I do see it from the begin fuctions. I am wondering what I am
>> missing.
>>
>
> Unsure.
>
> Can you attach the debug log of your application startup and the debug log
> generated when you hit /admin ?
>
> 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] auto method never triggered

2009-10-30 Thread Julien Sobrier
Hello,
I was trying to use auto and begin in 2 Controllers, Root.pm and Admin.pm:

package MyApp::Controller::Root;

sub begin :Private {
my ($self, $c) = @_;

$c->log->debug('root begin');
}

sub auto :Private {
my ($self, $c) = @_;

$c->log->debug('root auto');
}

[...]

package MyApp::Controller::Admin;

sub begin :Private {
my ($self, $c) = @_;

$c->log->debug('admin begin');
}

sub auto :Private {
my ($self, $c) = @_;

$c->log->debug('admin auto');
}


Whether I access / or /admin, I don't see any log from any of the auto
functions, but I do see it from the begin fuctions. I am wondering
what I am missing.

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