Re: [cgi-prototype-users] CGI::Prototype::PathInfo resource tokenizing

2005-09-09 Thread A. Pagaltzis
* Terrence Brannon <[EMAIL PROTECTED]> [2005-09-09 21:05]: > I think the resource id should be a reference to an anonymous > array > [ 283188, 43 ] Then split the string into an array and save it in a slot in `app_enter`? It might be a good thing if this were the default behaviour, but I have no

Re: [cgi-prototype-users] CGI::Prototype::PathInfo resource tokenizing

2005-09-09 Thread Terrence Brannon
"A. Pagaltzis" <[EMAIL PROTECTED]> writes: > * Terrence Brannon <[EMAIL PROTECTED]> [2005-09-09 14:30]: >> Thing is, can't a path have more than just 2 components? There >> is no reason it can't have much more is there? > > Sure. You can include `'thread/post'` in your valid pages and > invoke `fo

Re: [cgi-prototype-users] CGI::Prototype::PathInfo resource tokenizing

2005-09-09 Thread A. Pagaltzis
* Terrence Brannon <[EMAIL PROTECTED]> [2005-09-09 14:30]: > Thing is, can't a path have more than just 2 components? There > is no reason it can't have much more is there? Sure. You can include `'thread/post'` in your valid pages and invoke `forum.cgi/thread/post/283188/43`, in which case the obj

[cgi-prototype-users] CGI::Prototype::PathInfo resource tokenizing

2005-09-09 Thread Terrence Brannon
>From Aristotle's CGIP::PathInfo, we have this: sub prototype_enter { my $self = shift; $self->SUPER::prototype_enter(); my ( $resource, $id ) = $self->parse_path( $self->CGI->path_info() ); $self->reflect->addSlot( resource_type => $resource, resource_id => $id

[cgi-prototype-users] CGI::Prototype::PathInfo unified diff

2005-09-05 Thread Terrence Brannon
Here is my unified diff of the attachment you emailed earlier. I like this module a lot and will be retooling my simple guestbook app to use it. This is our first step towards a CGI::Prototype on Rails type thing. Maybe we could publish a Perl Review article if everything is clean and easy to foll

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-15 Thread A. Pagaltzis
* Randal L. Schwartz [2005-08-15 20:00]: > To further this, let's say I had a $big_client that needs to > show a login page if the user isn't logged in, regardless of > whatever "state" the ->get_state returns. They can override > ->get_class to simply return the login page if not logged in, > re

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-15 Thread A. Pagaltzis
* Randal L. Schwartz [2005-08-15 19:50]: > Ewww. I'd never use code like that. At the HTTP level, it is cleaner design. Nobody on the other side of the app interface will care whether it requires uglier scaffolding under the hood, nor should they. Thus, neither do I. > Yeah, hadn't envisioned t

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-15 Thread Randal L. Schwartz
> "Randal" == Randal L Schwartz writes: Randal> Consider also something like Slashdot, where the templates are loaded Randal> from a database... I can also see that here. Maybe state-to-class is Randal> dynamic based on current user ID or other security parameter? Really, Randal> there's po

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-15 Thread Randal L. Schwartz
> "A" == A Pagaltzis <[EMAIL PROTECTED]> writes: A> Looks sensible enough, but the mapper must be more abstract than A> you propose. Abstraction on the level you have in mind is not A> tenable because ::State::Pathinfo needs knowledge from A> ::Mapper::StrictLookup to be able to tell that A>

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-15 Thread A. Pagaltzis
* Randal L. Schwartz [2005-08-15 18:40]: > Then, I wanna refactor the current Hidden into its pieces: > > a mixin for ->get_state (call it CGI::Prototype::State::Hidden) > - uses the hidden param to get a state name, or a default state > a mixin for ->get_class (call it CGI::Prototype::Mapper::

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-15 Thread Randal L. Schwartz
> "A" == A Pagaltzis <[EMAIL PROTECTED]> writes: A> could you please give an answer to these questions? See, that's the problem when I try to take a weekend off, like normal people. :) First, I hate ::Simple. On any module. If the interface was so complicated that it needed a "simple" thin

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-15 Thread A. Pagaltzis
Randal, * A. Pagaltzis <[EMAIL PROTECTED]> [2005-08-11 17:40]: > I was hoping to start refactoring ::Hidden into bits that can > be reused in ::PathInfo and others and those which can’t. > ::PathInfo could then be separate or be part of the distro, but > that’s a different issue. > > Do you agree

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-11 Thread A. Pagaltzis
* Randal L. Schwartz [2005-08-11 17:20]: > If you are thinking that the release currently called > CGI-Prototype should be altered, we can talk about making the > changes directly there. Well, kinda; I was hoping to start refactoring ::Hidden into bits that can be reused in ::PathInfo and others

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-11 Thread Randal L. Schwartz
> "A" == A Pagaltzis <[EMAIL PROTECTED]> writes: A> Ok, so I’d like to dive in there and get the bits moving right A> now, but I don’t want to step on any toes, particularly with A> architectural (more or less) decisions like this one. How are we A> going to be handling issues like this one?

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-11 Thread A. Pagaltzis
* A. Pagaltzis <[EMAIL PROTECTED]> [2005-08-11 01:40]: > So I think that rather than attempting to separate state > deduction and mapping entirely, it would be enough to factor > out the mapping into a common base and reuse that. As always, > loads of slots make the job pretty smooth. Ok, so I’d l

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-10 Thread A. Pagaltzis
* Randal L. Schwartz [2005-08-07 18:15]: > Cool. Ok, great, then I’ll keep working on it. > Right now, my thoughts are that Hidden is actually doing two > different things: > > 1) Figuring out the state (from hidden fields, as named) > 2) Mapping the state to classes (autoloading based on a pre

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-07 Thread Randal L. Schwartz
> "A" == A Pagaltzis <[EMAIL PROTECTED]> writes: A> I just don’t want to step on Randalls’s toes in case he’s already A> done this – but I also have very specific ideas about how to do A> this and a CPAN directory longing for something to put in it. :-) And no, I have the idea to do it, but n

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-07 Thread Randal L. Schwartz
> "A" == A Pagaltzis <[EMAIL PROTECTED]> writes: A> and hi Randall in particular. I have a working version of this, A> largely derived from ::Hidden for consistency in slot names. (It A> also let me copy 95% of the POD verbatim. Writing documentation A> is easy when it’s already done for you.

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-03 Thread Terrence Brannon
"A. Pagaltzis" <[EMAIL PROTECTED]> writes: > * Terrence Brannon <[EMAIL PROTECTED]> [2005-08-03 20:15]: >> If you put it on CPAN and it is based on hidden, then perhaps >> it should be CGI::Prototype::Hidden::PathInfo? >> >> I never could figure out Hidden, I use the vanilla >> CGI::Prototype for

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-03 Thread A. Pagaltzis
* Terrence Brannon <[EMAIL PROTECTED]> [2005-08-03 20:15]: > If you put it on CPAN and it is based on hidden, then perhaps > it should be CGI::Prototype::Hidden::PathInfo? > > I never could figure out Hidden, I use the vanilla > CGI::Prototype for everything. Hmm, I found it extremely straightfo

Re: [cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-03 Thread Terrence Brannon
"A. Pagaltzis" <[EMAIL PROTECTED]> writes: > I have a working version of this, > largely derived from ::Hidden for consistency in slot names. > Now my question is: should I put this on CPAN, or should I leave > the space to an “official” version? If you put it on CPAN and it is based on hid

[cgi-prototype-users] CGI::Prototype::PathInfo

2005-08-02 Thread A. Pagaltzis
Hi all, and hi Randall in particular. I have a working version of this, largely derived from ::Hidden for consistency in slot names. (It also let me copy 95% of the POD verbatim. Writing documentation is easy when it’s already done for you. *g*) It has a somewhat distinct personality in that it w