view release on metacpan or search on metacpan
{
"abstract" : "a framework to build intrusive high order proxies",
"author" : [
"Nuno Carvalho <smash@cpan.org>"
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112621",
"license" : [
"unknown"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
---
abstract: 'a framework to build intrusive high order proxies'
author:
- 'Nuno Carvalho <smash@cpan.org>'
build_requires:
ExtUtils::MakeMaker: 0
configure_requires:
ExtUtils::MakeMaker: 0
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112621'
license: unknown
meta-spec:
App-Navegante
App::Navegante is a framework to build intrusive high order proxies. Please
see the App::Navegante documentation for the complete set of instructions
on using this framework. For example:
$ perldoc App::Navegante
You can also read examples/README for a list of examples distributed in
this module.
PREREQUISTES
You need the following modules installed in your system:
bin/navegante view on Meta::CPAN
"formtitle" => 7,
"desc" => 9,
"livefeedback" => 10,
"proctags" => 11,
"iform" => 12,
"init" => 14,
"mail" => 13,
"annotate" => 15,
"quit" => 16,
'FIM' => 17,
"iframe" => 18,
"filename" => 19
},
DEFAULT => -3,
GOTOS => {
'fop' => 8
}
},
{#State 2
ACTIONS => {
'' => 20
bin/navegante view on Meta::CPAN
[#Rule 13
'actions', 3,
sub
#line 15 "lib/App/Navegante.yp"
{+{ %{$_[1]}, iform => $_[3]}}
],
[#Rule 14
'actions', 3,
sub
#line 16 "lib/App/Navegante.yp"
{+{ %{$_[1]}, iframe => $_[3]}}
],
[#Rule 15
'actions', 3,
sub
#line 17 "lib/App/Navegante.yp"
{+{ %{$_[1]}, quit => $_[3]}}
],
[#Rule 16
'actions', 3,
sub
bin/navegante view on Meta::CPAN
sub lex{
for($File){
s!^\s+!!;
if($_ eq "") { return ("","") }
s!^\(([^)]+)\)!! and return("STRING",$1);
s!^([\{\}\[\];+*/,:])!! and return($1,$1);
s!^\((.*?)\)!! and return("ARG",$1);
s!^##(.*)$!!s and return("FIM",$1);
s!^(init|desc|formtitle|save|mail|filename|feedback|proc|proctags|livefeedback|annotate|iform|iframe|quit|protect)\b!!
and return($1,$1);
s!^(\w+)!! and return("ID",$1);
print STDERR "Simbolos desconhecidos '$File'\n" ;
}
}
1;
lib/App/Navegante.pm view on Meta::CPAN
package App::Navegante;
use warnings;
use strict;
=encoding utf-8
=head1 NAME
App::Navegante - a framework to build intrusive high order proxies
=head1 VERSION
Version 0.02
=cut
our $VERSION = '0.02';
lib/App/Navegante.pm view on Meta::CPAN
The fucntion that is called when the form user data, in the application's
banner is submitted.
=item C<iform(STRING)>
Used to used the form that is going to be rendered in the application's
banner. For example:
C<iform(name=>text,"Set name!"=>submit)>
Would render a iframe with a two elements form: a text box named C<name>
and a submit button. See also C<iframe> for a more elaborate method
to define this form.
=item C<iframe(STRING)>
If defining the form that is used in the banner is not enough, you can
use C<iframe> to define the name of a function that returns the entire
iframe content. Note that C<iframe> always takes precedence over
C<iform> in case you define both.
=item C<quit(STRING)>
The function that is called when the appliccation's banner quit button
is followed.
=back
=head2 Generic Definitions
lib/App/Navegante.yp view on Meta::CPAN
actions : actions 'save' actarg {+{ %{$_[1]}, save => $_[3]}}
| actions 'mail' actarg {+{ %{$_[1]}, mail => $_[3]}}
| actions 'init' STRING {+{ %{$_[1]}, init => $_[3]}}
| actions 'desc' STRING {+{ %{$_[1]}, desc => $_[3]}}
| actions 'proc' STRING {+{ %{$_[1]}, proc => $_[3]}}
| actions 'proctags' STRING {+{ %{$_[1]}, proctags => $_[3]}}
| actions 'livefeedback' STRING {+{ %{$_[1]}, livefeedback => $_[3]}}
| actions 'feedback' STRING {+{ %{$_[1]}, feedback => $_[3]}}
| actions 'annotate' STRING {+{ %{$_[1]}, annotate => $_[3]}}
| actions 'iform' STRING {+{ %{$_[1]}, iform => $_[3]}}
| actions 'iframe' STRING {+{ %{$_[1]}, iframe => $_[3]}}
| actions 'quit' STRING {+{ %{$_[1]}, quit => $_[3]}}
| actions 'formtitle' STRING {+{ %{$_[1]}, formtitle => $_[3]}}
| actions 'filename' STRING {+{ %{$_[1]}, filename => $_[3]}}
| actions 'protect' STRING {+{ %{$_[1]}, protect => $_[3]}}
| {+{}}
;
actarg : STRING { +{arg=>$_[1]}}
| STRING ':' ID { +{arg=>$_[1], feedback => $_[3] }}
;
lib/App/Navegante.yp view on Meta::CPAN
sub lex{
for($File){
s!^\s+!!;
if($_ eq "") { return ("","") }
s!^\(([^)]+)\)!! and return("STRING",$1);
s!^([\{\}\[\];+*/,:])!! and return($1,$1);
s!^\((.*?)\)!! and return("ARG",$1);
s!^##(.*)$!!s and return("FIM",$1);
s!^(init|desc|formtitle|save|mail|filename|feedback|proc|proctags|livefeedback|annotate|iform|iframe|quit|protect)\b!!
and return($1,$1);
s!^(\w+)!! and return("ID",$1);
print STDERR "Simbolos desconhecidos '$File'\n" ;
}
}
lib/App/Navegante/CGI.pm view on Meta::CPAN
=head1 VERSION
Version 0.02
=cut
our $VERSION = '0.02';
=head1 SYNOPSIS
Build CGI applications in Navegante framework...
use App::Navegante::CGI;
my $app = App::Navegante::CGI->new(%args);
...
my $app = $foo->createCGI();
where %args is an hash containig the result of parsing the DSL section
of the program.
lib/App/Navegante/CGI.pm view on Meta::CPAN
my $ENCOD = "ISO-8859-1";
my ($pag,$URL,$MES,$CON);
if( param() ){
if( param('action') eq 'quit' ) {
# TODO
print "Content-type: text/html\n\n";
print ####quit####();
}
elsif( param('action') eq 'iframe' ) {
$U=_fixurl(param('x'));
my $iform = ####IFORM####;
if (param('user_data')) {
####annotate####();
$iform = "<body onload=\"alert('[$U] successfully annotated!');\">$iform</body>";
}
print header(cook(),-charset => 'UTF-8'), $iform;
}
elsif( $Navegante->{monadic} && param(action) eq "monadicend"){
$Navegante->{end}()
lib/App/Navegante/CGI.pm view on Meta::CPAN
-html => 1,
-pcdata => sub{ $c =~ s/&/&/g; $c =~ s/</</g ; $c =~ s/>/>/g ;
wrapper_proc($c) },
img => sub{ $v{src} = _abs($v{src}); toxml},
($Navegante->{monadic}
? (body => sub{ $c = ####TOOLBAR#### . $c; toxml } )
: ()),
link => sub{ $v{href} = _abs($v{href}); toxml},
# form => sub{ $v{action} = compoe($v{action}) if $v{action}; toxml},
a => sub{ $v{href} = compoe($v{href}) if $v{href}; toxml},
frame => sub{ $v{src} = compoe($v{src}); toxml},
iframe => sub{ $v{src} = compoe($v{src}); toxml},
meta => sub{
if($v{content} =~ /utf[_-]?8/i) {$ENCOD='UTF-8'}
elsif($v{content} =~ /iso[_-]?8859[_-]?1/i){$ENCOD='ISO-8859-1'}
toxml()},
);
print header(cook(), -charset => param('e') || $ENCOD ),$pag; }
else { errorpage($MES) }
}
}
else {
lib/App/Navegante/CGI.pm view on Meta::CPAN
foreach (keys %args) {
$nav->{$_} = $args{$_};
}
# translate proctag definition to perl code
if (defined($args{'proctags'})) {
$args{'proctags'} =~ s/=\>(\w+)/=\>\'$1\'/g;
$nav->{'proctags'} = $args{'proctags'};
}
# decide how to build the iframe if needed
if (defined($args{'iframe'})) {
$nav->{'IFORM'} = $args{'iframe'} . "()";
}
elsif (defined($args{'iform'})) {
$nav->{'IFORM'} = "\"" . createIframe($nav->{'iform'}) . "\"";
}
$nav->{'TOOLBAR'} = createToolbar();
return $self;
}
=head2 createCGI
This function creates a file that is basically a CGI. This function
returns the complete file, so you can do simething like this:
lib/App/Navegante/CGI.pm view on Meta::CPAN
else {
$h .= "img({src=>'http://nrc.homelinux.org/navegante/imagens/nav_logo.gif',border=>'0'}),";
}
$h .=<<'END_TOOLBAR';
"</td>",
"<td>",a({href=>'http://natura.di.uminho.pt/navegante/'}, img({src=>'http://nrc.homelinux.org/navegante/imagens/nav_title.gif',border=>'0'})),"</td>",
"<td>", $Navegante->{g}() , "</td>",
END_TOOLBAR
if ( $nav->{'iform'} or $nav->{'iframe'} ) {
$h .= "\"<td align='right'><iframe frameborder='0' scrolling='no' height='65' width='95' src='?action=iframe&x=\$U'></iframe></td>\",";
}
if ($nav->{'quit'}) {
$h .= "\"<td align='right' style='vertical-align: top;'><a href='?action=quit'><img width='15' height='15' border='0' src='http://nrc.homelinux.org/navegante/imagens/nav_quit.gif'</a>\",";
}
$h .=<<'END_TOOLBAR';
"</td></tr></table>",
div( {style=>"background-image: url(http://nrc.homelinux.org/navegante/imagens/nav_line.gif); background-repeat: repeat-x; width: 100%; height: 2px;"})
)
END_TOOLBAR
return $h;
}
=head2 createIframe
This function creates the code needed to render the application's
frame in the banner. This function is used in the constructor.
TODO
* use info defined in the DSL to render the form
=cut
sub createIframe {
my $iform = shift;
my $h =<<'END_IFORM';
<div style='margin-left: 0px;'>
<form> <center>
<input type='hidden' name='action' value='iframe'>
<input type='hidden' name='x' value=$U>
END_IFORM
my @list = split /\s*,\s*/, $iform;
@list = reverse @list;
my %hash = ();
foreach (@list) {
$_ =~ m/\s*(.*?)\s*=>\s*(.*)/;
$hash{$1} = $2;
}