Re: [Catalyst] Componentised actions.

2007-03-30 Thread Oleg Pronin

These actions (like /schema/list) is processed by default handler in root
controller so there are no such actions.
See previous post


2007/3/30, Bill Moseley [EMAIL PROTECTED]:


On Fri, Mar 30, 2007 at 12:46:48AM -0300, Nilson Santos Figueiredo Junior
wrote:
 On 3/29/07, Oleg Pronin [EMAIL PROTECTED] wrote:
 I cannot forward to the list actions because they are not private
actions
 (they have its own URLs). In docs 'forward' is for private actions.

 If the docs state that, they're wrong. It's perfectly possible to
 forward to public actions.

When you start up the server in debug mode you can see the private
names for the public paths.  So, you forward to the action using its
private name.

--
Bill Moseley
[EMAIL PROTECTED]


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

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


Re: [Catalyst] Componentised actions.

2007-03-30 Thread Oleg Pronin

I have

The problem is that i have no physical /shema/list action:

::Controller::Root

sub default : Private {
    load template by path,
i.e. for /schema/list url it processes root/src/schema/list.tt
(this is because i have many actions which doesn't neet perl work.
Only TT  DBIx::Class)
}



::Controller::Configure

sub index : Private {

$c-forward('/schema/list');
}


and i got error
Couldn't forward to command /schema/list: Invalid action or component.

likely i need to fall in standart dispatch process to do that.
But plugin subrequest executes again auto actions etc. The code is executed
twice.
I need to execute only action i want but i need catalyst to look for it with
all dispatch rules.



2007/3/30, Nilson Santos Figueiredo Junior [EMAIL PROTECTED]:


On 3/29/07, Oleg Pronin [EMAIL PROTECTED] wrote:
 I cannot forward to the list actions because they are not private
actions
 (they have its own URLs). In docs 'forward' is for private actions.

If the docs state that, they're wrong. It's perfectly possible to
forward to public actions.

 For example you can create url-action which edits some objects and
include
 it in many templates. This is not like
 ordinary template toolkit's include - this component can show itself,
modify
 data, receive request params etc, like
 any web page. And this doesnt depend on whether this action is directly
 called from browser or included in some template.

You could have some thing like this:

sub nice_page : Local {
   my ($self, $c) = @_;
   $c-forward('object1');
   $c-forward('object2');
}

Then, inside nice_page.tt:

[% INCLUDE object1.tt %]
[% INCLUDE object2.tt %]

Should do exactly what you want. And, well, if it doesn't you can
always use Catalyst::Plugin::SubRequest.

-Nilson Santos F. Jr.

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

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


Re: [Catalyst] Componentised actions.

2007-03-30 Thread Thomas Wittek
Oleg Pronin schrieb:
 This might be useful for including completed components (with logic,
 view and model inside) in any website place.
 For example you can create url-action which edits some objects and
 include it in many templates. This is not like
 ordinary template toolkit's include - this component can show itself,
 modify data, receive request params etc, like
 any web page.

Interestingly this is very much, what I'm doing in my Konstrukt
Framework[1][2] (which of course is not even near as powerful as
Catalyst): Each component will be inserted as a tag in a webpage. You
can put multiple components into one page as well as combine (nest)
them, if possible.

A I started to develop this framework some years ago, I thought this
concept is a good idea, and in some cases it's really nice: For example
you can put the hit statistics component into the master template and
_every_ web page now runs that component and fills the statistics. Each
component completely handles its logic, model and view. It's a bit like
a widget, that you can put inside your page.

Now the disadvantages of my framework:
- No REST by default. You cannot call a component by URL. This is what
I'm missing most. The components have to be integrated in a web page, to
which the URL points to.
- Views/controllers get mixed up a bit: The client requests a page. This
page contains markup that determines the general layout (view) and the
components (kind of controller), which in turn return the output (view)
for themselves.

So I'm able to compose components easily, but only at the cost of a less
clear separation of views and controllers. This design flaw might cause
problems in bigger projects.

Unfortunately I've not yet come up with an idea to combine the
advantages of a clear separation between views and controllers with a
_simple_ approach to compose several components and use them like
widgets inside your page. Although the suggestion of Nilson Santos F.
Jr., who also replied to your mail, seems to come close to that.

[1] http://search.cpan.org/~twittek/Konstrukt-0.5-beta7/
[2]
http://search.cpan.org/~twittek/Konstrukt-0.5-beta7/lib/Konstrukt/Doc.pod
-- 
Thomas Wittek
http://gedankenkonstrukt.de/
Jabber: [EMAIL PROTECTED]

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


RE: [Catalyst] Session problems with IE and cookies - workaround

2007-03-30 Thread Marc Logghe
Hey Dmitry !
Calling $c-reset_session_expires did the trick indeed ! Now
authentication works both for IE and Opera.
Thanks a million.
Regards,
Marc 
 

 -Original Message-
 From: Dmitry [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, March 29, 2007 5:51 PM
 To: catalyst@lists.rawmode.org
 Subject: Re: [Catalyst] Session problems with IE and cookies 
 - workaround
 
  VT My workaround will:
  VT 1) Delete the old session
  VT 2) Create a new session
  VT 3) Return a dummy page, along with a new cookie and a 
 redirect to  VT site's main page There is easier workaround 
 - just call $c-reset_session_expires on login.
 Why nor reset_session_expires neither extend_session_expires 
 are not documented if they are public?
 
 
 ___
 List: Catalyst@lists.rawmode.org
 Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
 Searchable archive: 
 http://www.mail-archive.com/catalyst@lists.rawmode.org/
 Dev site: http://dev.catalyst.perl.org/
 
 

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


[Catalyst] When using multiple controllers as base

2007-03-30 Thread Tomohiro Teranishi

Hi,

I was looking at source code for C::C::FormBuilder to know how to
write Controller extention module. Then I thought using new() method
is nice idea to run only once.

But I realize when I want to use two controller extention modules same
time, it may cause problem because of NEXT specification.

e.x.

Let's say , I want to use C::C::FormBuilder and C::C::BindLex same time.

# Below case is OK
use base qw/Catalyst::Controller::FormBuilder Catalyst::Controller::BindLex/;

# In this case,  C::C::FormBuilder-new will not called.
use base qw/Catalyst::Controller::BindLex Catalyst::Controller::FormBuilder/;

I think only first base module run NEXT but not the others.

Am I doing something wrong??
or should not use new() ??
or should not use multiple controllers??

thanks,

Tomohiro Teranishi

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


Re: [Catalyst] Componentised actions.

2007-03-30 Thread Robert 'phaylon' Sedlacek
Oleg Pronin wrote:
 The problem is that i have no physical /shema/list action:

Then I'd try to solve _this_ problem, and not work around it. Why don't
you have one or more physical action(s) for list?

.phaylon

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


Re: [Catalyst] Componentised actions.

2007-03-30 Thread John Napiorkowski


- Original Message 
From: Nilson Santos Figueiredo Junior [EMAIL PROTECTED]
To: The elegant MVC web framework catalyst@lists.rawmode.org
Sent: Thursday, March 29, 2007 11:46:48 PM
Subject: Re: [Catalyst] Componentised actions.

On 3/29/07, Oleg Pronin [EMAIL PROTECTED] wrote:
 I cannot forward to the list actions because they are not private actions
 (they have its own URLs). In docs 'forward' is for private actions.

If the docs state that, they're wrong. It's perfectly possible to
forward to public actions.

 For example you can create url-action which edits some objects and include
 it in many templates. This is not like
 ordinary template toolkit's include - this component can show itself, modify
 data, receive request params etc, like
 any web page. And this doesnt depend on whether this action is directly
 called from browser or included in some template.

You could have some thing like this:

  sub nice_page : Local {
my ($self, $c) = @_;
$c-forward('object1');
$c-forward('object2');
  }

I was always nervous about doing this because of my fear about Stash namespace 
collision.  To be honest I have a love hate relationship with the stash because 
I like the idea of  having a ready made messaging system but because it's hash 
based I feared the feeling I was making a very tightly coupled application.  
You need to know the base stash key for your stuff, right?  And then it needs 
to be different for each action that you think might be in an action chain or 
forwarded to as in the example above.

Have you run into this problem, found ways around it or just don't feel 
paranoid about it?

--John

Then, inside nice_page.tt:

  [% INCLUDE object1.tt %]
  [% INCLUDE object2.tt %]

Should do exactly what you want. And, well, if it doesn't you can
always use Catalyst::Plugin::SubRequest.

-Nilson Santos F. Jr.

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





 

No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail 

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