[cgi-prototype-users] primer message

2005-04-03 Thread Terrence Brannon
package Message::Primer;

use CGI::Prototype;

__PACKAGE__->reflect->activate; 

1;

# Welcome!



---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
cgi-prototype-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] CGI::Prototype::Info to CPAN?

2005-04-03 Thread Terrence Brannon
I want to create an information file for CGI::Prototype called
CGI::Prototype::Info and upload it to CPAN. I want to have the
following sections:

=head1 Perlmonks CGI::Protoytpe Posts
=head1 Other Links 

  Introduction to CGI::Prototype
  http://www.ourmedia.org/node/1644

  the Linux Journal Article

=head1 The Mailing List

   
So is it OK to upload such a file? The Perlmonks links are already
mined and listed below.
  

=head1 Perlmonks CGI::Protoytpe Posts

=over

=item * Seeking enlightenment on CGI::Prototype

L

=item * Mixins (problem with CGI::Prototype and Class::Protototyped with 
subtemplates)

L

=item * Trying to understand how CGI::Prototype::Hidden,
Template Toolkit and CGI.pm work together.

L

=item * CGI::Prototype - let me clarify the response phase for you

L

=item * A CGI::Prototype respond() subroutine for
Data::FormValidator users

L

=item * CGI::Prototype and use base
L

=item * CGI::Prototype: questions and feedback

L

=item * basic CGI::Prototype::Hidden

L

=item * Try CGI::Prototype

L

=item * Review: CGI::Prototype

L

=back



---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
cgi-prototype-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] admin - now only list members can post.

2005-04-08 Thread Terrence Brannon
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:

> 

I'm sorry, but sourceforge had "Restrict posting privilege to list
members? (member_posting_only)" set to "No" by default. I have
switched it so that only list-members can post.




---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] [ann] CGI::Prototype::Docs::Resources uploaded to CPAN

2005-04-11 Thread Terrence Brannon
NAME
CGI::Prototype::Docs::Resources - links to CGI::Prototype resources

Mailing list
CGI::Prototype Mailing List
There is now a mailing list for discussing the use of CGI::Prototype, a
Perl module which allows for class and prototype-based object-oriented
development of CGI applications.

  SUBSCRIBING
   Via Mailman/Sourceforge
Visit <http://lists.sourceforge.net/lists/listinfo/cgi-prototype-users>
and enter your subscription information.

   Via Gmane
You can join the newsgroup
gmane.comp.lang.perl.modules.cgi-prototype.user

If you are a Gnus user, here's the subscription string for you:
nntp+news.gmane.org:gmane.comp.lang.perl.modules.cgi-prototype.user

  ARCHIVES
* <http://dir.gmane.org/gmane.comp.lang.perl.modules.cgi-prototype.user>
*
<http://sourceforge.net/mailarchive/forum.php?forum=cgi-prototype-users>
*
<http://www.mail-archive.com/cgi-prototype-users%40lists.sourceforge.net
/>
This last one should work. I am still waiting for my primer message
to show in the archive.

Tutorials / Overviews
  Ourmedia's "Introduction to CGI::Prototype"
<http://sourceforge.net/project/showfiles.php?group_id=135173&package_id
=149434>

  "Prototype Programming for Classless Classes"
<http://www.stonehenge.com/merlyn/LinuxMag/col56.html>

Perlmonks CGI::Protoytpe Posts
  "Seeking enlightenment on CGI::Prototype"
<http://perlmonks.org/?node_id=442480>

  "Mixins (problem with CGI::Prototype and Class::Protototyped with 
subtemplates)"
<http://perlmonks.org/?node_id=439974>

  "Trying to understand how CGI::Prototype::Hidden, Template Toolkit and CGI.pm 
work together."
<http://perlmonks.org/?node_id=438026>

  "CGI::Prototype - let me clarify the response phase for you"
<http://perlmonks.org/?node_id=428222>

  "A CGI::Prototype respond() subroutine for Data::FormValidator users"
<http://perlmonks.org/?node_id=428151>

  "CGI::Prototype and use base"
<http://perlmonks.org/?node_id=426381>

  "CGI::Prototype: questions and feedback"
<http://perlmonks.org/?node_id=426162>

  "Basic CGI::Prototype::Hidden"
    <http://perlmonks.org/?node_id=423071>

  "Try CGI::Prototype"
    <http://perlmonks.org/?node_id=410803>

  "Review: CGI::Prototype"
<http://perlmonks.org/?node_id=411760>

AUTHOR
Terrence Brannon, 

COPYRIGHT AND LICENSE
Copyright (C) 2005 by Terrence Brannon

This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself, either Perl version 5.8.4 or, at
your option, any later version of Perl 5 you may have available.


-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] Re: Package name output

2005-05-02 Thread Terrence Brannon
LD <[EMAIL PROTECTED]> writes:

> Hi there,

Hi LD,

> >
> If I have the following as part of a template definition (in a file):
>   [% self.CGI.h1(self.reflect.package) %]

[% self.reflect.package %]

looks cleaner to my personal taste.

> >
> ...it returns the proper name as expected. If I however do:
>   sub someTemplate { \ <<'EOT'; }
>   [% self.CGI.header %]
>   [% self.CGI.h1(self.reflect.package) %]
>   EOT

I don't have an answer to your question, but would like to make a
comment. 

One of my initial criticisms of the CGI::Prototype docs was what you
are doing here. The call to $self->CGI->header is more general and
will apply to many more pages/objects than the current page. It does
not belong in the same method as a page-local call such as
$self->reflect->package: it is application-wide not page-local.

I think it belongs in render_enter in a base class... then, if a
particular page needs to send a certain content type, it can override
the method.


-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] path info?

2005-06-21 Thread Terrence Brannon

Forgive me if I'm hallucinating, but I could've sworn that there was a
CGI::Prototype::PathInfo module or method in one of the earlier
releases. 

Does anyone know of any such resource? I'm going to be doing some
stuff which is mainly just wrapping static paths with common look and
feel, and such support would be useful.

-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


Re: [cgi-prototype-users] Using multiple base classes for an app

2005-07-01 Thread Terrence Brannon
Andrew Gianni <[EMAIL PROTECTED]> writes:

>  can you suggest a better way to share
> pages and functionality between applications?
>

This is not a sarcastic response, but it is really what I think about
this situation. Sharing *functionality* should be the province of
vanilla Perl. Perl has a wealth of re-use/sharing mechanisms within
itself, with require and use being the most obvious ones...

It does not matter what one is doing in Perl - functionality re-use
occurs via subroutines and modules. I don't think that CGI/mod_perl
should be any different and for me, it is not. Neither Mason nor tt2
nor CGI::Prototype nor anything else can do a better job than vanilla
Perl at re-using *functionality*.

Now by re-using part of the display output (what you refer to as
"pages") depends critically on what you are doing to render HTML. For
me, as an HTML::Seamstress proponent, it would be a simple matter of
having the HTML somewhere it can be opened and processed and popped
inline in a larger document. But all the dynamic HTML toolkits have
means of re-using page data - tt2 has INCLUDE, WRAPPER (I think those
are right, I dont use tt2), and mason has components.

Cheers,
Terrence Brannon



---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


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 hidden, then perhaps it
should be CGI::Prototype::Hidden::PathInfo?

I never could figure out Hidden, I use the vanilla CGI::Prototype for
everything. 

If the decision is to post at sf.net, just tell me what I need to do
on the sourceforge site to set you up since I admin this list and
sf.net site. 




---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


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 everything. 
>
>
> In any case, ::Hidden::PathInfo is not the right name. I don’t
> inherit from ::Hidden and the code has nothing to do with any
> state parameter.

good point.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


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

2005-08-07 Thread Terrence Brannon
merlyn@stonehenge.com (Randal L. Schwartz) writes:

>> "A" == A Pagaltzis <[EMAIL PROTECTED]> writes:
>
> A> Now my question is: should I put this on CPAN, or should I leave
> A> the space to an “official” version? Or should I just post it
> A> here, maybe? If I put this on CPAN myself, what should I put in
> A> the AUTHOR and COPYRIGHT & LICENSE sections of the POD? There is
> A> so little code in there that the notion of authorship is a bit
> A> ridiculous either way, but I also copied several pages of POD
> A> that I can hardly claim authorship of.
>
> Well, if we create the SF archive, this can stay one or two distros.
> I'd actually like to see separate distros like:

I have added Aristotle (sf.net id: apag) as a developer with plenty of
liberal admin rights to the whole project - let me know if you need
more. I couldn't find Randal Schwartz in the sf.net user list and
someone has the name merlyn already.

Right now, it looks like Aristotle needs the privs more than Randal,
but as soon as I get his name, I will heap on lots of privs for him as
well.

Yes, as soon as this PathInfo baby gets uploaded, I can de-Mason-ize a
site of mine with the greatest of ease :)

-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


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

2005-08-07 Thread Terrence Brannon
merlyn@stonehenge.com (Randal L. Schwartz) writes:

>>>>>> "Terrence" == Terrence Brannon <[EMAIL PROTECTED]> writes:
>
> Terrence> I have added Aristotle (sf.net id: apag) as a developer with
> Terrence> plenty of liberal admin rights to the whole project - let me
> Terrence> know if you need more. I couldn't find Randal Schwartz in
> Terrence> the sf.net user list and someone has the name merlyn
> Terrence> already.
>
> I'm "sourcemerlyn" there.

added:

https://sourceforge.net/projects/cgi-prototype/



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


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

2005-08-10 Thread Terrence Brannon
"A. Pagaltzis" <[EMAIL PROTECTED]> writes:

> * Terrence Brannon <[EMAIL PROTECTED]> [2005-08-07 23:30]:
>> I have added Aristotle (sf.net id: apag) as a developer with
>> plenty of liberal admin rights to the whole project – let me
>> know if you need more.
>
> Okay, I’ve gone in and put up a plain homepage 

Plain nothing! That's a very nice page. I use CGIP without Template
Toolkit, so I dont like that part of the description.

> cribbed together from the Randall’s and your POD, and corrected
> the project description (CGIP is not a template system and it does
> not use a database).

OMG. I hope I didnt write something that off-base.

-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] dispatch and rendering with HTML::Seamstress under CGIP

2005-08-29 Thread Terrence Brannon
This is more of an FYI post than anything. I've had the website
http://www.gimblerus.com under the control of CGIP for about 6-8
months now and it is great. This note explains the things I do because
(a) I don't under CGIP::Hidden and (b) because I use HTML::Seamstress
instead of tt as my rendering engine.

First, let's look at a finished page:

  http://www.gimblerus.com/cgi-bin/x?task=show_rules

Ok, the first thing is notice the query parameter "task" with value
"show_rules"? That allows the CGIP script named "x" to figure out what
page we are on via module called Gimble::Dispatch. Gimble::Dispatch is
just a hash from this query parameter to a Gimble::Page::* class.

package Gimble::Dispatch;

use strict;

use base qw(CGI::Prototype);
#use Class::Autouse;

our %task = (

  home   => 'Gimble::Page::Home::Base',

  signup => 'Gimble::Page::Signup::Base',
  signup_redo => 'Gimble::Page::Signup::Redo',
  signup_confirm => 'Gimble::Page::Signup::Confirm',
  signup_commit   => 'Gimble::Page::Signup::Commit',

  add_clan   => 'Gimble::Page::AddClan::Base',
  add_clan_confirm   => 'Gimble::Page::AddClan::Confirm',
  add_clan_commit   => 'Gimble::Page::AddClan::Commit',

  report_match => 'Gimble::Page::ReportMatch::Base',
  report_match_confirm => 'Gimble::Page::ReportMatch::Confirm',
  report_match_commit => 'Gimble::Page::ReportMatch::Commit',

  show_rules   => 'Gimble::Page::ShowRules::Base',
  players   => 'Gimble::Page::Players::Base',

  login   => 'Gimble::Page::Login::Base',
  login_process   => 'Gimble::Page::Login::Process',

  player_stats   => 'Gimble::Page::PlayerStats::Base',

  viewsrc => 'Gimble::Page::ViewSrc::Base',

);

our %next = (
  
  'Gimble::Page::Login::Base'=> 'login_process',
  'Gimble::Page::Login::Redo'=> 'login_process',
  'Gimble::Page::Login::Failed'  => 'login_process',

  'Gimble::Page::Signup::Base' => 'signup_confirm',
  'Gimble::Page::Signup::Redo' => 'signup_confirm',
  'Gimble::Page::Signup::Confirm' => 'signup_commit',



  'Gimble::Page::AddClan::Base' => 'add_clan_confirm',
  'Gimble::Page::AddClan::Redo' => 'add_clan_confirm',
  'Gimble::Page::AddClan::Confirm' => 'add_clan_commit',

  'Gimble::Page::ReportMatch::Base' => 'report_match_confirm',
  'Gimble::Page::ReportMatch::Confirm' => 'report_match_commit',


);

sub view_player_url {

  sprintf "/cgi-bin/x?task=player_stats&player_id=%d", shift() ;

}

sub dispatch {
  my $self = shift;

  my $taski = $self->param('task') || 'home' ;



  my $dispatch = $task{$taski};

  warn "$taski dispatched to => $dispatch";
  eval "require $dispatch";
  die $@ if $@;
  return $dispatch;

}


1;

The full file is attached for reference.

Next, let's look at the page that was dispatch to. It is very simple
and clean, thanks to CGIP:

package Gimble::Page::ShowRules::Base;

use base qw(Gimble::Page::Base);

use Gimble::Model::player_t;

sub template {  require html::rules;  html::rules->new }

sub engine {

  my ($self, $tree) = @_;

  $tree->content_handler(
inactive_days => $Gimble::Model::player_t::inactive_days
   );

  $tree->content_handler(
provisional_days => $Gimble::Model::player_t::provisional_shelf
   );

}

1;

Finally, we simply need look at my custom render_enter() method way up
in Gimble::Page::Base which all webpages in the site subclass from:

sub render_enter {
  my $self = shift;

  my $tree = $self->template;

  # pass the HTML::Seamstress tree to engine()
  $self->engine($tree); 

  # set the hidden parameter in the HTML file 
  $self->set_next_task($tree); 

  # pass manipulated tree to render() so it can send it to STDOUT
  $self->reflect->addSlot(render_out => $tree); 
}

And the HTML template for this page is here:

  http://www.gimblerus.com/html/rules.html

It is pure HTML, just like the output page except it lacks css other
boilerplate that ->render() puts on it and you can see "blah blah"
where there should be actual numbers... the dynamic rendering
templates those out at runtime. 


Regards,
Terrence Brannon


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

2005-09-02 Thread Terrence Brannon
"A. Pagaltzis" <[EMAIL PROTECTED]> writes:

> I suppose that I’ll stick with the current monolithic design and
> mind my own business for the time being, then.

I'm also in need of using PathInfo to render pages on a dynamic
site. Can you make the PathInfo stuff you are doing available on
sourceforge or elsewhere?

-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


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

2005-09-02 Thread Terrence Brannon
"A. Pagaltzis" <[EMAIL PROTECTED]> writes:

> PS.: merlyn, your mailer is misconfigured. It’s sending UTF-8,

Aristotle, what sort of control characters are in your mail? I see
little boxes and hex characters every so often, making the messages
harder to read... I read mail with plain text Xemacs/Gnus under Debian.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] content-type and content: do they deserve separation / methods

2005-09-03 Thread Terrence Brannon

CGI::Prototype is remarkably flexible, scaleable and practical. That
being the case, this is more of a philsophical question than any.

However, it is a fact that for most websites, the content-type will be
text/html for most of the pages and that the actual content will vary
on each page.

This being the case, should these two aspects of the CGI response be
two different methods, with $self->content_type existing in a base
class and re-used for most of the app and $self->content (which is
known as $self->render) be variant on each page?


-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] each page is really an operation

2005-09-03 Thread Terrence Brannon

While I'm having my philosophical catharsis, I thought I would mention
that CGI::Prototype is actually not a page-based approach to site
development. It is an operation-based approach. An operation consists
of several phases which are broken down by CGIP nicely. We have model
phases and view phases. The view phases create a page based on the
requested *operation*.

A user requests *operations* - login, add user, view user which are
materialized by model actions and feedback on success failure via the
view/page. 

If you take a look at Zanas:

  http://search.cpan.org/~dmow/Zanas-5.5.16/Zanas.pm

he says a similar thing.

-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


Re: [cgi-prototype-users] each page is really an operation

2005-09-03 Thread Terrence Brannon
"A. Pagaltzis" <[EMAIL PROTECTED]> writes:

> * Terrence Brannon <[EMAIL PROTECTED]> [2005-09-03 19:15]:
>> A user requests *operations* - login, add user, view user which
>> are materialized by model actions and feedback on success
>> failure via the view/page. 
>
> I model my applications as a set of resources, à la REST.

I googled for REST and found this:
   http://www.xfront.com/REST-Web-Services.html

> Resources,
> obviously, are only created or updated assuming credentials with
> sufficient permissions; otherwise, the result is a 401 when not
> logged in or a 403 when logged in, but lacking permission.

Do you use cookies? The paper I read stated this:

Stateless: each request from client to server must contain all the
information necessary to understand the request, and cannot take
advantage of any stored context on the server.


To me, that means "no cookies". But your discussion of 401 and 403
would imply such a mechanism for recognizing who made the request?





---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


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

2005-09-04 Thread Terrence Brannon
"A. Pagaltzis" <[EMAIL PROTECTED]> writes:

> * Terrence Brannon <[EMAIL PROTECTED]> [2005-09-02 16:20]:
>> Can you make the PathInfo stuff you are doing available on
>> sourceforge or elsewhere?
>
> Yes, I shall, though it might take me a few days.

I really need this now, even if it's just a tarfile emailed to
[EMAIL PROTECTED] 

Will your module work with plain CGI? I have avoided using REST
vocabulary in my URLs for something I'm working on because I don't
have your module:

   Sign Guestbook   
   View Guestbook   
  Guestbook Stats  

I want to be jet-set like you and use paths:

   Sign Guestbook   
   View Guestbook   
  Guestbook Stats  

So much cleaner


>
> Regards,
> -- 
> Aristotle Pagaltzis // <http://plasmasturm.org/>

What a cute use of icons!

-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] Re: each page is really an operation

2005-09-05 Thread Terrence Brannon
"A. Pagaltzis" <[EMAIL PROTECTED]> writes:

> * Terrence Brannon <[EMAIL PROTECTED]> [2005-09-03 19:15]:
>> A user requests *operations* - login, add user, view user which
>> are materialized by model actions and feedback on success
>> failure via the view/page. 
>
> I model my applications as a set of resources, à la REST.
>
> A GET request for `/user/12` brings up that user’s data.

This is what Paul Prescod lists as Common Design Mistake #3 when
building a REST website:

   http://www.prescod.net/rest/mistakes/


  Do not depend on URI's internal structure. Some people think about
  REST design in terms of setting up a bunch of URIs. "I'll put
  purchase orders in /purchases and I'll give them all numbers like
  /purchases/12132 and customer records will be in /customers..."
  That can be a helpful way to think while you are whiteboarding and
  chatting, but should not be your final public interface to the
  service. According to Web Architectural principles, most URIs are
  opaque to client software most of the time. In other words, your
  public API should not depend on the structure of your URIs. Instead
  there would typically be a single XML file that points to the
  components of your service. Those components would have hyperlinks
  that point to other components and so forth. Then you can introduce
  people to your service with a single URI and you can distribute the
  actual components across computers and domains however you want.
  My rule of thumb is that clients only construct URIs when they are
  building queries (and thus using query strings). Those queries return
  references to objects with opaque URIs. 



-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] Re: each page is really an operation

2005-09-05 Thread Terrence Brannon
"A. Pagaltzis" <[EMAIL PROTECTED]> writes:

> * Terrence Brannon <[EMAIL PROTECTED]> [2005-09-04 03:15]:
>> To me, that means "no cookies". But your discussion of 401 and
>> 403 would imply such a mechanism for recognizing who made the
>> request?
>
> I do (still?) use cookies.

You are using a REST-inspired approach to web design, not pure REST:

http://www.prescod.net/rest/state_transition.html";>

REST basically advises you choose between these two strategies: send
all of the state back and forth (in this case using GET and URIs) or
capture parts of the state as resources with URIs and transmit links
to that state back and forth. What REST advises against is state
without a URI name. COOKIES ARE AN EXAMPLE OF UN-REST-LIKE DATA. Cookes
are implicit, so third parties have no access to them and even the
client application will not typically have any way to know what
cookies were in effect when a particular message was created hours
ago. REST stands for REpresentational State Transfer - the constant
transfer of state (or references to state) back and forth as
representations are key to its design.



-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] Re: each page is really an operation

2005-09-05 Thread Terrence Brannon
"A. Pagaltzis" <[EMAIL PROTECTED]> writes:

> * Terrence Brannon <[EMAIL PROTECTED]> [2005-09-04 03:15]:
>> To me, that means "no cookies". But your discussion of 401 and
>> 403 would imply such a mechanism for recognizing who made the
>> request?
>
> I do (still?) use cookies.

I think it is pragmatic that the first hit to a website be
cookie-based if possible.

What if you had to visit aristotle.perlmonks.org instead of simply
visiting perlmonks.org and having it authenticate you based on a
cookie? 

Nothing but cookie-based recognition will ever fly in the corporate
world for the first hit.

-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] REST architecture for a guestbook application

2005-09-05 Thread Terrence Brannon

I have been trying to figure out how to model the resources of a
guestbook cgi program using REST. My CGI program is named guestbook
and my domain name is metaperl.org

GET /guestbook
  returns the first 10 entries of the guestbook with links to page
  forward to 11-20. REST supposedly works without cookies, so if a
  user had a preference for entry listings per page, what to do?
GET /guestbook?o=xml
  returns the entire guestbook in XML format
POST /guestbook
  adds an entry to the guestbook. But here is my problem, I need a URL
  which returns a page that the user can fill in and hit submit. What
  would such a URL look like?
GET /guestbook/stats
  returns a page showing the stats on the guestbook.



-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


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

2005-09-05 Thread Terrence Brannon
n email list
+
+L<http://groups.yahoo.com/group/rest-discuss/>
+
+
+=back
+
+
+
 =head1 BUG REPORTS
 
-Please report any bugs or feature requests to
-L<mailto:[EMAIL PROTECTED]>, or through the web interface
-at L<http://rt.cpan.org/>. I will be notified, and then you'll automatically
-be notified of progress on your bug as I make changes.
+Please report any bugs or feature requests to the CGI::Prototype users mailing
+list on Sourceforge (L<http://cgi-prototype.sf.net)
+so that all 3 authors of the package (sourcemerlyn, apag, metaperl) can 
+be notified.
 
 =head1 AUTHOR
 
 Aristote Pagaltzis, L<mailto:[EMAIL PROTECTED]>
 
+contributions from Terrence Brannon and Randal Schwartz.
+
 =head1 COPYRIGHT AND LICENSE
 
 Copyright (C) 2005 by Aristotle Pagaltzis
[EMAIL PROTECTED]:~/perl/dl$ 



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] require DBIx::SQLEngine::Criteria fails from CGI::Prototype::PathInfo

2005-09-08 Thread Terrence Brannon
I have an issue with import and inheritance that I cannot figure
out. When a certain module of mine is loaded at runtime, it forces a
chain of requires through the DBIx::SQLEngine distribution, leading to
this error:

"new_group_from_values" is not exported by the
DBIx::SQLEngine::Criteria module
Can't continue after import errors at
/home/terry/perl/share/perl/5.8.7/DBIx/SQLEngine/RecordSet/Set.pm
line 318
BEGIN failed--compilation aborted at
/home/terry/perl/share/perl/5.8.7/DBIx/SQLEngine/RecordSet/Set.pm
line 318.
Compilation failed in require at
/home/terry/perl/share/perl/5.8.7/DBIx/SQLEngine/Record/Table.pm line
64.
Compilation failed in require at
/home/terry/perl/share/perl/5.8.7/Class/MixinFactory/Factory.pm line
55.
Compilation failed in require at
/var/www/terry/metaperl.org/Guestbook/App/sign_commit.pm line 7.
BEGIN failed--compilation aborted at
/var/www/terry/metaperl.org/Guestbook/App/sign_commit.pm line 7.
Compilation failed in require at
/var/www/terry/metaperl.org/Guestbook/App.pm line 17.
BEGIN failed--compilation aborted at
/var/www/terry/metaperl.org/Guestbook/App.pm line 17.
Compilation failed in require at Guestbook.cgi line 32.
BEGIN failed--compilation aborted at Guestbook.cgi line 32.
[Fri Sep  9 01:25:56 2005] [error] [client 24.130.176.67] Premature
end of script headers:
/var/www/terry/metaperl.org/cgi-bin/Guestbook.cgi


... and if you look at the file Criteria.pm you would not be surprised
to see this import error because no such sub exists in this file:

http://hcoop.net/~terry/perl/share/perl/5.8.7/DBIx/SQLEngine/Criteria.pm

However, I can run 2 separate static small scripts which emulate what
is happening during the above chain of failed requires and they all
work. 

First, a script which loads Guestbook::Model::entry (the module whose
require from Guestbook::App::sign_commit creates the error chain)
and does a commit to database... it does the commit perfectly.

entry.pl and entry.pm are here:

http://www.metaperl.org/Guestbook/Model/

In other words, even though it loads Guestbook::Model::entry, it does
not fail when loading the other modules in the DBIx::SQLEngine
distribution. 

Now, the last thing that happens before the "not exported" error is
that Record/Table.pm does a require  DBIx::SQLEngine::RecordSet::Set,
so I wrote a script which only does that and it runs just fine:

http://hcoop.net/~terry/perl/share/perl/5.8.7/DBIx/SQLEngine/RecordSet/Set.pl


So, the question becomes: why is it when CGI::Prototype::PathInfo does
a dynamic require of Guestbook::App::sign_commit and then
Guestbook::App::sign_commit does a use Guestbook::Model::entry that
the above chain of errors is thrown?

You can view PathInfo.pm here:

http://hcoop.net/~terry/perl/lib/CGI/Prototype/PathInfo.pm


-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[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 
);
}

Thing is, can't a path have more than just 2 components? There is no
reason it can't have much more is there?

-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


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 `forum.cgi/thread/post/283188/43`, in which case the
> object Forum::thread::post will be loaded with `resource_id`
> being `'283188/43'`.

I think the resource id should be a reference to an anonymous array
 [ 283188, 43 ]



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] $this_page and $next_page lack access to $self...

2005-09-09 Thread Terrence Brannon

I have most of a guestbook program implemented using
CGI::Prototype::PathInfo. You can play around with everything but the
"view source for this page" button here:

  http://www.metaperl.org/Guestbook

I used Rose::DB::Object for the database stuff, HTML::Seamstress for
"templating" and CGI::Protoytpe::Pathinfo as my controller.

So anyway, when I got ready to do the "view source for this page", I
needed access to resource_type for the current request but $this_page
and $next_page (in CGPI::activate()) are not given these values from
the self that starts activate().

$this_page and $that_page also lack access to $self->CGI as a result.

What this means is that I cannot rewrite the "View source for this
page" to be $self->resource_type in this module:

   http://www.metaperl.org/Guestbook/App/welcome.pm

Of course, this is perplexing given that Guestbook::App::welcome
inherits from Guestbook::App which inherits from
CGI::Prototype::PathInfo and CGIP::PathInfo does reflect and add the
resource->type slot and have a CGI slot with data from the initial
resource->request.

So, given that my render methods in $this_page or $next_page could
take advantage of such a method, should there be some way of them
being granted this info?

-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] Guestbook app in Rose::DB, CGI::Prototype::PathInfo, and Seamstress

2005-09-09 Thread Terrence Brannon
Since I could not beat Darren Duncan to first post, I had to beat him
to first complete app in Rose::DB::Object :). Other technologies were
Data::FormValidator, CGI::Prototype::PathInfo, and HTML::Seamstress.

I have implemented a cgi guestbook using Rose::DB::Object. Play with
it here:

  http://www.metaperl.org/Guestbook

You can look at the Rose-based code here:
  
   # db setup classes ...
   http://www.metaperl.org/Guestbook/DB.pm
   http://www.metaperl.org/Guestbook/Model.pm

   # The row-class for the entry table
   http://www.metaperl.org/Guestbook/Model/entry.pm

   # The Manager-class for the entry table
   http://www.metaperl.org/Guestbook/Model/entry/Manager.pm

   # A class which uses the row and manager to unroll a table
   http://www.metaperl.org/Guestbook/viewsrc/view
  
   # A class which uses the row and manager to count a rowset
   http://www.metaperl.org/Guestbook/viewsrc/stats

If you want to get the entire Guestbook app, then install darcs and
type:

  darcs get http://www.metaperl.org

The thing I enjoyed about using Rose is that Class::DBI
*requires* that you give the primary key column when creating row
objects. With Rose, I just left it out and it formulated the right
SQL. DBIx::SQLEngine tried to put a NULL for the primary key column
when I left it out and I could not supply either DEFAULT or
nextval('seq_name') to it without it munging it in someway that
DBD::Pg would not accept.

I built the database schema using the excellent Alzabo schema
editor. Here is the schema (all one table of it):

  
http://www.metaperl.com/alzabo/schema/view_table.html?table=entry&schema=terry_guestbook


I'm sorry about how ugly the web app is: I'm reading my first book on
css and xhtml right now, so I expect that part to get prettier and
prettier the more I read :)

-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] please patch PathInfo with this

2005-09-10 Thread Terrence Brannon
I am using this in my version of PathInfo. There could be some
refactoring to share code with name_to_page, but that's not done right
now.

=item name_to_pm

Called with a page name, translates it to a .pm file name, and returns it.

This module expects page names to look like relative URLs and will translate to
package names like you'd expect, ie assuming the default
C, C will translate to C.

=cut

sub name_to_pm {
  my $self = shift;
  my ( $name ) = @_;

my $pkg = join '::', (
  $self->config_class_prefix,
  split( m{/}, $self->validate_name( $name ) ),
 );

  $pkg =~ s!::!/!g;

  "$pkg.pm";
}



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] Re: $this_page and $next_page lack access to $self...

2005-09-10 Thread Terrence Brannon
Totally bogus bug report. Ignore. I don't know how I futzed up
CGIP::PathInfo so bad as to wreck the 5-level inheritance chain, but
everything went away, when I replaced my hackery with Aristotle's
original file.

> I have most of a guestbook program implemented using
> CGI::Prototype::PathInfo. You can play around with everything but the
> "view source for this page" button here:
>
>   http://www.metaperl.org/Guestbook
>
> I used Rose::DB::Object for the database stuff, HTML::Seamstress for
> "templating" and CGI::Protoytpe::Pathinfo as my controller.
>
> So anyway, when I got ready to do the "view source for this page", I
> needed access to resource_type for the current request but $this_page
> and $next_page (in CGPI::activate()) are not given these values from
> the self that starts activate().
>
> $this_page and $that_page also lack access to $self->CGI as a result.
>
> What this means is that I cannot rewrite the "View source for this
> page" to be $self->resource_type in this module:
>
>http://www.metaperl.org/Guestbook/App/welcome.pm
>
> Of course, this is perplexing given that Guestbook::App::welcome
> inherits from Guestbook::App which inherits from
> CGI::Prototype::PathInfo and CGIP::PathInfo does reflect and add the
> resource->type slot and have a CGI slot with data from the initial
> resource->request.
>
> So, given that my render methods in $this_page or $next_page could
> take advantage of such a method, should there be some way of them
> being granted this info?
>
> -- 
>   Carter's Compass: I know I'm on the right track when,
>  by deleting something, I'm adding functionality.
>
>
>
> ---
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] a fascinating little bug "Bad header=" bug from Apache

2005-09-10 Thread Terrence Brannon
I added a little more functionality to my guestbook to have it tar up
the whole site and send it. For some reason, I kept getting this error
in the Apache log

[Sat Sep 10 15:00:05 2005] [error] [client 24.130.176.67] malformed
header from script. Bad header=metaperl.org/:
/var/www/terry/metaperl.org/cgi-bin/Guestbook.cgi

and I googled and googled. At first I thought I need autoflush on but
that was not it. Then I looked at exactly when the error was occurring
and reazlied that it was right when I started to tar the file. 

What was happening was that tar was issuing output to STDOUT and
apache was trying to interpret it as an HTTP header!

So my fix would be to silence tar or redirect the system command
output elswhere or use Archive::Tar from CPAN.

What a great way to spend 1.5 hours on a Sunday morn...

-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


Re: [cgi-prototype-users] please patch PathInfo with this

2005-09-12 Thread Terrence Brannon
"A. Pagaltzis" <[EMAIL PROTECTED]> writes:

> * Terrence Brannon <[EMAIL PROTECTED]> [2005-09-10 14:35]:
>> I am using this in my version of PathInfo.
>
> What for?

it would be nice for you to preserve a bit more context... but anyway,
I am needing the name of the .pm file for each resource_type so that I
an execute the "view source for this page" link that is on each page.

E.g, this link:

http://www.metaperl.org/Guestbook/viewsrc/welcome

Shows the source that was used for this page:

http://www.metaperl.org/Guestbook/welcome



---
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] Re: please patch PathInfo with this

2005-09-14 Thread Terrence Brannon
Aristotle, any feedback on my requested patch?

> I am using this in my version of PathInfo. There could be some
> refactoring to share code with name_to_page, but that's not done right
> now.
>
> =item name_to_pm
>
> Called with a page name, translates it to a .pm file name, and returns it.
>
> This module expects page names to look like relative URLs and will translate 
> to
> package names like you'd expect, ie assuming the default
> C, C will translate to C.
>
> =cut
>
> sub name_to_pm {
>   my $self = shift;
>   my ( $name ) = @_;
>
>   my $pkg = join '::', (
> $self->config_class_prefix,
> split( m{/}, $self->validate_name( $name ) ),
>);
>
>   $pkg =~ s!::!/!g;
>
>   "$pkg.pm";
> }
>
>
>
> ---
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf

-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] Notes of moving a site from HTML::Mason to CGI::Prototype

2005-09-15 Thread Terrence Brannon

I'm happy to say that HTML::Mason has been completely removed from my
personal website:

   http://www.livingcosmos.org/

It was fairly easy to write a subclass of CGIP whose render phase took
an HTML file and templated it. I just needed a RewriteRule to push all
html files to the CGIP subclass:

RewriteRule ^/(.+)[.]s?html$   /cgi-bin/lc.cgi/$1.html   [PT]

and then I used PATH_TRANSLATED to serve the HTML file:

sub dispatch {
  my $self = shift;
  my $p = $ENV{PATH_TRANSLATED};
  $p =~ s!cgi-bin.+lc.cgi/!!;

  $self->reflect->addSlot(file_path => $p);

  $self->pkg_for_path($p) ;
}


sub pkg_for_path {
  my ($self, $path) = @_;

  my $M = Tie::RegexpHash->new;

  $M->add( qr,vots/index.html, => 'App::vots' ) ;

  if (my $new_page = $M->match($path)) {
eval "require $new_page";
die $@ if $@;

warn 'NP', $new_page;
$new_page;
  } else {
return $self;
  }

}



-- 
Carter's Compass: I know I'm on the right track when,
   by deleting something, I'm adding functionality.



---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] CGIP Q/A link added

2005-09-23 Thread Terrence Brannon
I moved the CSS out of index.html and into site.css so that this new
QA page could have the same look and feel:

http://cgi-prototype.sourceforge.net/qa/

I saw a recent question on Perlmonks and decided that it was best to
keep links to these questions somewhere.


---
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


Re: [cgi-prototype-users] Tried to use My/App, unable to make it work

2005-10-12 Thread Terrence Brannon
On 10/11/05, Kai Andresen <[EMAIL PROTECTED]> wrote:
> Hello,

Hi Kai!

> >
> I copied the My/App test application from the CGI-Prototype
> distribution,

There's a fully functioning CGI::Prototype app here:

http://www.metaperl.org/Guestbook

You can download the tarfile and look through it. I can explain
it to you step-by-step if you have questions.

> and added a app.cgi like: use strict; use warnings; use lib qw(
> /real/path/here );
>
> use My::App;
> My::App->activate;
>
> 
> Now, directing the browser to the application brings up the welcome
> page, and the source of the page seems ok, form, action, fields and
> submit-button and all.

Cool...

> >
> But filling out the form and submitting it, only yields the same page.

What did the FORM action attribute action have?

> > The only way to get to the thanks-page is to add the parameters into
> the url, like http:://localhost/app.cgi?first=john&last=doe   -> then
> I get the nice thank-you-page.

Cool...

> >
> I use this under a recent Cygwin installation, Perl 5.8.7, and lighthttpd
>
> I obviously miss something fundamental here, but I can't figure it
> out, can anyone point me in the right direction?

Yes, I think what you are missing is the concept of dispatch. If you look
at the activate method in package CGI::Prototype (the easiest way to learn
CGIP is to look at the source code), it calls dispatch early on in the
activate method. The default dispatch method looks like this:

 sub dispatch {
  my $self = shift;
  return $self; # do nothing, stay here
 }

And so the same page object returning itself is no surprise. In fact,
unless you subclass the default dispatch method and specializing it
to do certain things with a certain query string parameter (such as
rm for runmode), you should never get a different page.

If you dont want to handle dispatch yourself, you can use Aristotle's
CGI::Prototype::PathInfo, which you can get here:

  http://prdownloads.sourceforge.net/cgi-prototype/PathInfo.pm?download

The dispatch logic is documented in the code.

I've also uploaded it to our Sourceforge CVS project  but there is a
5-hour delay between anonymous and developer access to cvs updates.


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


Re: [cgi-prototype-users] Re: Tried to use My/App, unable to make it work

2005-10-13 Thread Terrence Brannon
On 13 Oct 2005 04:58:39 -0700, Randal L. Schwartz  wrote:


>
> For a better "tiny" app, see my Linux Magazine articles (google
> site:stonehenge.com CGI::Prototype for the location).

That location is:

http://www.stonehenge.com/merlyn/LinuxMag/col70.html
and also 7[12].html


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] chmod of public_html

2005-10-13 Thread Terrence Brannon
On 10/13/05, A. Pagaltzis <[EMAIL PROTECTED]> wrote:


> Terrence: would you please `chmod -R g+w *` the web site? You
> have created a directory and a bunch of files that I can't do
> anything with because they only have owner write permission.

I did this to the best of my ability - index.html in root is owned by
you and I could not chmod it --- it seems that sf.net needs a umask
that allows the developers with access to work without these
conflicts...

I would edit my .bashrc to such a umask if you can tell me what it is


---
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] CGIP and eager loading of Template and CGI in mod_perl-like environments

2005-10-29 Thread Terrence Brannon
I just wanted to start a discussion about usage of CGIP in mod_perl
environments. I am happy with CGIP's setup for my webhosting stuff,
because we use plain CGI. However, for corporate work (should that day
come), the fact that the engine slot and the prototype_enter method use
autoloads to load Template and CGI would compromise performance: one
would prefer that both of these be loaded eagerly.

So, since there is no class supplied with the CGIP distro by default
which handles this (should there be?), I think the approach is obvious:

In the startup.pl or whatever pre-loaded handler you will use simply do 
use Template; 
use CGI;

use base qw(CGI::Prototype);

BEGIN {  

# _reset_globals is discussed here: http://use.perl.org/~merlyn/journal/24641
CGI::_reset_globals(); 
my $cgi = CGI->new 

}

sub engine {
 my $self = shift;
 # no longer needed: require Template;
 Template->new($self->engine_config)
   or die "Creating tt: $Template::ERROR\n";
   });

sub CGI {
 $cgi
 });



Re: [cgi-prototype-users] CGIP and eager loading of Template and CGI in mod_perl-like environments

2005-10-29 Thread Terrence Brannon
On 10/29/05, A. Pagaltzis <[EMAIL PROTECTED]> wrote:
* Randal L. Schwartz  [2005-10-29 16:50]:> You can probably automate that if you wanted.  I'm sure you can> come up with a BEGIN block that reads the directory and loads
> all the plugins.Cf. Module::Pluggable.
Yes, also:

http://search.cpan.org/~drolsky/Class-Factory-Util-1.6/lib/Class/Factory/Util.pm 





[cgi-prototype-users] the future of CGI::Prototype

2009-08-07 Thread Terrence Brannon
Merlyn is pretty much following other paths in CGI development


I personally am interested in a Moose upgrade of CGI::Prototype.

There are a lot of articles out on CGI::Prototype so I think we should
simply augment the current distro.

I'm a github fan and would like to put up a repo for CGIP ASAP.

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] Moose implementation of CGI::Prototype

2009-08-23 Thread Terrence Brannon
Randal wants to maintain prototype-based OOP for a Moose-based version 
of CGI::Prototype. I'm wondering if such a Moose class could be as 
simple as:


package CGI::Prototype::Moose;

use Moose;
extends 'Class::Prototyped';

...

1;

Links:
--
* There is a sample prototype OO moose in this test example:
http://github.com/nothingmuch/moose/blob/0bb2cc8a6a2e4b967b5d8efbcf1ab27f5d95e990/t/200_examples/006_example_Protomoose.t

but I dont fancy breaking with the Class::Prototyped API.

* My current fork of CGI::Prototype which uses Moose:
http://github.com/metaperl/perl-module-cgi-prototype/blob/f3c71299cd98de7b4c4d2b291d95623a761db548/lib/CGI/Prototype/Moose.pm


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


[cgi-prototype-users] Prototyping CGI versus CGI::Prototype

2009-08-30 Thread Terrence Brannon

Randal L. Schwartz wrote:

Not really.  The prototype stuff of Moose is where you want to start, and it
has a different interface.  If you just pulled in Class::Prototyped, you'd
have a lot of potential conflicts, especially around anonymous classes.

  
I see. I'm not trying to anger you, but I would like to re-join our IRC 
conversation. If you read the CGIP docs, it speaks of 'the prototypical 
cgi application' -


   * Analyze the incoming parameters, cookies, and URLs to determine
 the state of the application (let's call this "dispatch").
   * Based on the current state, analyze the incoming parameters to
 respond to any form submitted ("respond").
   *  From there, decide what response page should be generated, and
 produce it ("render").

And while this core exists in all Perl CGI modules, my experience is 
that the controller of CGIP has captured it best. It prototypes the CGI 
response cycle quite well.


On the other hand, I've never had a need for prototyped objects when 
using CGIP - all my usage has basically been class-based and standard OO 
and I've been pleased with the results.

.

I'd like to petition for a distinct module in the CGIP distro which uses 
plain moose 
.
If someone wants to implement something like that protomoose.t, then 
that could be another module.



Further, I think CGIP would have been better received by the community 
if the articles had pointed out exactly what prototype objects offer the 
CGI application development process. Nothing I've seen in the standard  
CGIP docs or Linux Magazine article 
 points to 
something I could not do easily and cleanly with standard Moose (or 
plain Perl) classes.


For instance my recent perlmonks praise of CGIP 
 showed an example. But that 
example benefitted from the controller cycle and standard OO dispatch.







--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users


Re: [cgi-prototype-users] Prototyping CGI versus CGI::Prototype

2009-08-30 Thread Terrence Brannon


Randal L. Schwartz wrote:
> The heir apparent to the CGI::Prototype namespace should support
> Class::Prototype-styled objects. 
Right. I'm not suggesting an heir apparent. I'm suggesting an additional 
module in the distribution, along with associated test suite.
This module would extend on the other concept of "CGI Prototype" - 
prototyping the CGI process. Not using CGI with prototyped objects.
Also, people tend to look down on modules whose release date is more 
than 6 months old. It starts to look unmaintained.

I dont want to fork and start a separate distro, just add 
CGI::Prototype::Moose to the CGIP distro.
> I have customers that are making use of the
> Class::Prototyped features that are not classical class-instance structures,
> so any "replacement" of CGIP with something new must be carefully considered.
>
>   
right and a toy example exemplifying the need for non classical 
class-instance structures in the standard docs or a magazine article would
help greatly. I did talk to Jason Purdy above his negative CPAN ratings 
review of CGIP .

He wrote his 'review' after skimming the docs. Now, I dont think that 
what he did was fair or thoroughly researched, but I think a section in 
the docs like "Why Another Framework" or "How is CGIP Different" would 
go a long way towards stamping out superficial inspection of the module.


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
cgi-prototype-users mailing list
cgi-prototype-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cgi-prototype-users