You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2002/02/27 16:42:51 UTC

cvs commit: embperl/test/conf httpd.conf.src startup.pl

richter     02/02/27 07:42:51

  Modified:    .        Tag: Embperl2c INSTALL.pod
               Embperl/Recipe Tag: Embperl2c Embperl.pm
               eg/web   Tag: Embperl2c config.pl epwebapp.pl pod.xsl
               eg/web/db Tag: Embperl2c addsel.epl
               test/conf Tag: Embperl2c httpd.conf.src startup.pl
  Added:       Embperl/Form Tag: Embperl2c Validate.pm
               Embperl/Form/Validate Tag: Embperl2c Messages.pm Rules.pm
               Embperl/Form/Validate/Messages Tag: Embperl2c Default.pm
                        Test.pm
               Embperl/Form/Validate/Rules Tag: Embperl2c Default.pm
                        Float.pm Integer.pm String.pm
  Log:
  Form validation
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.12.4.9  +1 -4      embperl/INSTALL.pod
  
  Index: INSTALL.pod
  ===================================================================
  RCS file: /home/cvs/embperl/INSTALL.pod,v
  retrieving revision 1.12.4.8
  retrieving revision 1.12.4.9
  diff -u -r1.12.4.8 -r1.12.4.9
  --- INSTALL.pod	31 Oct 2001 08:24:57 -0000	1.12.4.8
  +++ INSTALL.pod	27 Feb 2002 15:42:50 -0000	1.12.4.9
  @@ -357,7 +357,7 @@
   
       export XERCESCROOT=/path/to/xerces-c-src1_5_1
       export XALANCROOT=/path/to/xml-xalan/c
  - 
  +
   =item * Compile XERCES
   
       cd xerces-c-src1_5_1/src
  @@ -368,7 +368,6 @@
   
   There must be one typecast inserted in the following three files:
   
  -    
       "c/src/XSLT/ExtensionFunctionHandler.cpp", line 156
       156c156
       < 	return m_functions.find(function) != m_functions.end();
  @@ -386,8 +385,6 @@
       < 			|| m_extensionNamespaceURIs.find(theURI) != m_extensionNamespaceURIs.end()
       ---
       > 			|| ExtensionNamespaceURISetType::const_iterator(m_extensionNamespaceURIs.find(theURI)) != m_extensionNamespaceURIs.end()
  -
  -
   
   =item * Compile XALAN
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +1232 -0   embperl/Embperl/Form/Attic/Validate.pm
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +72 -0     embperl/Embperl/Form/Validate/Attic/Messages.pm
  
  
  
  
  1.1.2.1   +211 -0    embperl/Embperl/Form/Validate/Attic/Rules.pm
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +34 -0     embperl/Embperl/Form/Validate/Messages/Attic/Default.pm
  
  
  
  
  1.1.2.1   +33 -0     embperl/Embperl/Form/Validate/Messages/Attic/Test.pm
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +133 -0    embperl/Embperl/Form/Validate/Rules/Attic/Default.pm
  
  
  
  
  1.1.2.1   +25 -0     embperl/Embperl/Form/Validate/Rules/Attic/Float.pm
  
  
  
  
  1.1.2.1   +106 -0    embperl/Embperl/Form/Validate/Rules/Attic/Integer.pm
  
  
  
  
  1.1.2.1   +324 -0    embperl/Embperl/Form/Validate/Rules/Attic/String.pm
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.18  +3 -4      embperl/Embperl/Recipe/Attic/Embperl.pm
  
  Index: Embperl.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Recipe/Attic/Embperl.pm,v
  retrieving revision 1.1.2.17
  retrieving revision 1.1.2.18
  diff -u -r1.1.2.17 -r1.1.2.18
  --- Embperl.pm	25 Feb 2002 11:20:28 -0000	1.1.2.17
  +++ Embperl.pm	27 Feb 2002 15:42:50 -0000	1.1.2.18
  @@ -1,19 +1,18 @@
   
   ###################################################################################
   #
  -#   Embperl - Copyright (c) 1997-2001 Gerald Richter / ECOS
  +#   Embperl - Copyright (c) 1997-2002 Gerald Richter / ecos gmbh   www.ecos.de
   #
   #   You may distribute under the terms of either the GNU General Public
   #   License or the Artistic License, as specified in the Perl README file.
   #
  -#   THIS PACKAGE IS PROVIDED 'AS IS' AND WITHOUT ANY EXPRESS OR
  +#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: Embperl.pm,v 1.1.2.17 2002/02/25 11:20:28 richter Exp $
  +#   $Id: Embperl.pm,v 1.1.2.18 2002/02/27 15:42:50 richter Exp $
   #
   ###################################################################################
  - 
   
   
   package Embperl::Recipe::Embperl ;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +1 -0      embperl/eg/web/Attic/config.pl
  
  Index: config.pl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/Attic/config.pl,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- config.pl	16 Feb 2002 18:00:48 -0000	1.1.2.5
  +++ config.pl	27 Feb 2002 15:42:50 -0000	1.1.2.6
  @@ -27,6 +27,7 @@
               [
               { menu => 'Embperl',            uri => 'Embperl.htm',               file => { en => 'Embperl.pod', de => 'EmbperlD.pod'}},
               { menu => 'Embperl::Object',    uri => 'EmbperlObject.htm',         file => 'Embperl/Object.pm'},
  +            { menu => 'Embperl::Form::Validate',  uri => 'EmbperlFormValidate.htm',         file => 'Embperl/Form/Validate.pm' },
               { menu => 'Embperl::Syntax',    uri => 'EmbperlSyntax.htm',         file => 'Embperl/Syntax.pm', sub =>
                   [
                   { menu => 'Embperl',        uri => 'Embperl.htm',               file => 'Embperl/Syntax/Embperl.pm'},
  
  
  
  1.1.2.4   +86 -2     embperl/eg/web/Attic/epwebapp.pl
  
  Index: epwebapp.pl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/Attic/epwebapp.pl,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- epwebapp.pl	12 Feb 2002 16:55:01 -0000	1.1.2.3
  +++ epwebapp.pl	27 Feb 2002 15:42:50 -0000	1.1.2.4
  @@ -1,4 +1,10 @@
   
  +use Embperl::Recipe::XSLT ;
  +use Embperl::Recipe::Embperl  ;
  +use Embperl::Recipe::EmbperlXSLT  ;
  +use Embperl::Recipe::EmbperlPODXSLT  ;
  +use Embperl::Constant ;
  +
      
   sub fill_menu 
   
  @@ -52,8 +58,14 @@
   
       my $m ;
       $uri =~ /^(.*)\./ ;
  -    print STDERR "map_file\n" ;
  -    if (($m = $config -> {map1}{$uri} || $config -> {map2}{$1}))
  +    print STDERR "map_file uri=$uri 1=$1\n" ;
  +    if (!($m = $config -> {map1}{$uri} || $config -> {map2}{$1}))
  +        {
  +        $m = $config -> {map1}{$1} if ($uri =~ m#^(.*?/)index\..*$#) ;
  +        print STDERR "map_file uri=$uri 1=$1\n" ;
  +        }    
  +
  +    if ($m)
           {
           my @menuitems = ($m) ;
           my $item = $m ;
  @@ -110,3 +122,75 @@
   
   
   
  +
  +sub get_recipe
  +
  +    {
  +    my ($class, $r, $recipe) = @_ ;
  +
  +    my $self ;
  +    my $param  = $r -> component -> param  ;
  +    my $config = $r -> component -> config  ;
  +    my ($src)  = $param -> inputfile =~ /^.*\.(.*?)$/ ;
  +    my ($dest) = $r -> param -> uri =~ /^.*\.(.*?)$/ ;
  +
  +   
  +
  +    if ($src eq 'pl')
  +        {
  +        $config -> syntax('Perl') ;
  +        return Embperl::Recipe::Embperl -> get_recipe ($r, $recipe) ;
  +        }
  +
  +    if ($src eq 'pod' || $src eq 'pm')
  +        {
  +        $config -> escmode(0) ;
  +        if ($dest eq 'pod')
  +            {
  +            $config -> syntax('Text') ;
  +            return Embperl::Recipe::Embperl -> get_recipe ($r, $recipe) ;
  +            }
  +
  +        $config -> syntax('POD') ;
  +        if ($dest eq 'xml')
  +            {
  +            return Embperl::Recipe::Embperl -> get_recipe ($r, $recipe) ;
  +            }
  +
  +        $config -> xsltstylesheet('pod.xsl') ;
  +        #$config -> xsltstylesheet($r -> {root} . $r -> {baseuri} . 'xml/pod.xsl') ;
  +        $r -> param -> uri =~ /^.*\/(.*)(\..*?)$/ ;
  +        $param -> xsltparam({page => $r -> thread -> form_hash -> {page} || 0, basename => "'$1'", extension => "'$2'"}) ;
  +        return Embperl::Recipe::EmbperlXSLT -> get_recipe ($r, $recipe) ;
  +        }
  +    
  +    if ($src eq 'epd')
  +        {
  +        $config -> escmode(0) ;
  +        $config -> options($config -> options | &Embperl::Constant::optKeepSpaces) ;
  +
  +        if ($dest eq 'pod')
  +            {
  +            $config -> syntax('EmbperlBlocks') ;
  +            return Embperl::Recipe::Embperl -> get_recipe ($r, $recipe) ;
  +            }
  +
  +
  +        $config -> xsltstylesheet('pod.xsl') ;
  +        $r -> param -> uri =~ /^.*\/(.*)(\..*?)$/ ;
  +        my $fdat = $r -> thread -> form_hash ;
  +        $fdat->{page} ||= 0 ;
  +        $fdat->{basename} = "'$1'" ;
  +        $fdat->{extension} = "'$2'" ;
  +        return Embperl::Recipe::EmbperlPODXSLT -> get_recipe ($r, $recipe) ;
  +        }
  +    
  +    if ($src eq 'epl' || $src eq 'htm')
  +        {
  +        $config -> syntax('Embperl') ;
  +        return Embperl::Recipe::Embperl -> get_recipe ($r, $recipe) ;
  +        }
  +
  +    $config -> syntax('Text') ;
  +    return Embperl::Recipe::Embperl -> get_recipe ($r, $recipe) ;
  +    }
  
  
  
  1.1.2.2   +23 -25    embperl/eg/web/Attic/pod.xsl
  
  Index: pod.xsl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/Attic/pod.xsl,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- pod.xsl	12 Feb 2002 07:20:35 -0000	1.1.2.1
  +++ pod.xsl	27 Feb 2002 15:42:50 -0000	1.1.2.2
  @@ -58,11 +58,11 @@
               <xsl:choose>
                   <xsl:when test="not(pod/sect1)">
                       <xsl:variable name="nextpage">
  -                        <xsl:apply-templates select="following-sibling::sect1[para][position()=1]" mode="number"/>
  +                        <xsl:apply-templates select="following-sibling::sect1[para|verbatim|sect2][position()=1]" mode="number"/>
                       </xsl:variable>
   
                       <xsl:variable name="prevpage">
  -                        <xsl:apply-templates select="preceding-sibling::sect1[para][position()=1]" mode="number"/>
  +                        <xsl:apply-templates select="preceding-sibling::sect1[para|verbatim|sect2][position()=1]" mode="number"/>
                       </xsl:variable>
               
                       <table width="100%"><tr><td align="left" valign="top" width="35%">
  @@ -71,14 +71,14 @@
                               <xsl:when test="$pageinname != 0">
                                   <a href="{$basename}.{$prevpage}{$extension}">
                                       <font size="2" face="Verdana, Arial, Helvetica, sans-serif">
  -                                        &lt;&lt; Prev: <xsl:value-of select="preceding-sibling::sect1[para][position()=1]/title"/>
  +                                        &lt;&lt; Prev: <xsl:value-of select="preceding-sibling::sect1[para|verbatim|sect2][position()=1]/title"/>
                                       </font>
                                   </a>
                               </xsl:when>
                               <xsl:otherwise>
                                   <a href="{$basename}{$extension}?page={$prevpage}">
                                       <font size="2" face="Verdana, Arial, Helvetica, sans-serif">
  -                                        &lt;&lt; Prev: <xsl:value-of select="preceding-sibling::sect1[para][position()=1]/title"/>
  +                                        &lt;&lt; Prev: <xsl:value-of select="preceding-sibling::sect1[para|verbatim|sect2][position()=1]/title"/>
                                       </font>
                                   </a>
                               </xsl:otherwise>
  @@ -108,7 +108,7 @@
                                   <xsl:attribute name="href"><xsl:value-of select="concat($basename,$extension)"/>?page=<xsl:value-of select="$nextpage"/></xsl:attribute>
                               </xsl:if>
                               <font size="2" face="Verdana, Arial, Helvetica, sans-serif">
  -                                Next: <xsl:value-of select="following-sibling::sect1[para]/title"/> &gt;&gt;
  +                                Next: <xsl:value-of select="following-sibling::sect1[para|verbatim|sect2]/title"/> &gt;&gt;
                               </font>
                           </xsl:element>
                       </xsl:if>
  @@ -117,7 +117,7 @@
                   </xsl:when>
                   <xsl:otherwise>
                       <xsl:variable name="nextpage">
  -                        <xsl:apply-templates select="/pod/sect1[para][position()=1]" mode="number"/>
  +                        <xsl:apply-templates select="/pod/sect1[para|verbatim|sect2][position()=1]" mode="number"/>
                       </xsl:variable>
                       <table width="100%"><tr><td align="right">
                       <xsl:element name="a">
  @@ -128,7 +128,7 @@
                               <xsl:attribute name="href"><xsl:value-of select="concat ($basename, $extension)"/>?page=<xsl:value-of select="$nextpage"/></xsl:attribute>
                           </xsl:if>
                           <font size="2" face="Verdana, Arial, Helvetica, sans-serif">
  -                            Next: <xsl:value-of select="/pod/sect1[para]/title"/> &gt;&gt;
  +                            Next: <xsl:value-of select="/pod/sect1[para|verbatim|sect2]/title"/> &gt;&gt;
                           </font>
                       </xsl:element>
                       </td>
  @@ -173,7 +173,7 @@
       <!-- - - - - table of content - - - - -->
   
       <xsl:template match="sect1" mode="toc_short">                         
  -        <xsl:if test="para|verbatim|sect2">
  +        <xsl:if test="para|verbatim|sect2|list">
                 <li><b>
                 <xsl:element name="a">
                       <xsl:if test="$pageinname != 0">
  @@ -189,7 +189,7 @@
       </xsl:template>
   
       <xsl:template match="sect1" mode="toc">                         
  -        <xsl:if test="para|verbatim|sect2">
  +        <xsl:if test="para|verbatim|sect2|list">
               <xsl:variable name="pagehref">
                   <xsl:if test="$pageinname != 0">
                       <xsl:value-of select="$basename"/>.<xsl:number/><xsl:value-of select="$extension"/>
  @@ -233,7 +233,7 @@
   
           <xsl:call-template name="headernav"/>
   
  -        <xsl:if test="para|verbatim|sect2">
  +        <xsl:if test="para|verbatim|sect2|list">
               <xsl:if test="sect2">
                   <ul>
                       <xsl:apply-templates select="sect2" mode="toc1"/> 
  @@ -247,22 +247,20 @@
   
   
       <xsl:template match="sect2">                         
  -        <xsl:if test="para|verbatim|sect3">
  -            <br/>
  -            <xsl:element name="a">
  -                <xsl:attribute name="name">sect_<xsl:number level="any"/></xsl:attribute>
  -              <table width="100%" border="0" cellspacing="0" cellpadding="6">
  -                <tr bgcolor="#D2E9F5"> 
  -                  <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>
  -                    <font color="0"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
  -                        <xsl:value-of select="title"/>    
  -                    </font></b></font></td>
  -                   <td align="right"><a href="#top"><font size="1">top</font></a></td> 
  -                </tr>
  -                </table>
  -            </xsl:element>
  +        <br/>
  +        <xsl:element name="a">
  +            <xsl:attribute name="name">sect_<xsl:number level="any"/></xsl:attribute>
  +          <table width="100%" border="0" cellspacing="0" cellpadding="6">
  +            <tr bgcolor="#D2E9F5"> 
  +              <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>
  +                <font color="0"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
  +                    <xsl:value-of select="title"/>    
  +                </font></b></font></td>
  +               <td align="right"><a href="#top"><font size="1">top</font></a></td> 
  +            </tr>
  +            </table>
  +        </xsl:element>
           <xsl:apply-templates select="*[name()!='title']"/> 
  -        </xsl:if>
       </xsl:template>
   
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +24 -2     embperl/eg/web/db/Attic/addsel.epl
  
  Index: addsel.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/db/Attic/addsel.epl,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- addsel.epl	12 Feb 2002 07:20:36 -0000	1.1.2.1
  +++ addsel.epl	27 Feb 2002 15:42:50 -0000	1.1.2.2
  @@ -1,5 +1,25 @@
  -[- $r = shift -]
  +[- 
  +$r = shift ;
   
  +    my $langset = $r -> {language_set} ;
  +    $$langset -> Reset ;
  +    while ($rec = $$langset -> Next)
  +        {
  +        $rules{"category_$rec->{id}"} = {type => 'String', length_min => 5, emptyok => 1} ;
  +        }
  +
  +use Embperl::Form::Validate ;
  +$epf = Embperl::Form::Validate -> new (\%rules) ; 
  +
  +-]
  +<script>
  +[- ($a, $b) = $epf->sprint_scripting_code({Language => $r -> param -> language}) -]
  +[+ do { local $escmode = 0 ; $a } +]
  +function on_submit()
  +{
  +[+ do { local $escmode = 0 ; $b } +]
  +}
  +</script>
   
   [= addsel1 =]
   
  @@ -11,7 +31,9 @@
   </ul>
   
   
  -<form action="[+ $r -> param -> uri +]">
  +<form action="[+ $r -> param -> uri +]"  OnSubmit="[+ do { local $escmode = 0 ; $b } +]">
  +
  +<input type="button" onclick="on_submit()">
   
   [= addsel2 =]<br> 
   [= addsel3 =]<br><br>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.24.4.43 +0 -1      embperl/test/conf/httpd.conf.src
  
  Index: httpd.conf.src
  ===================================================================
  RCS file: /home/cvs/embperl/test/conf/httpd.conf.src,v
  retrieving revision 1.24.4.42
  retrieving revision 1.24.4.43
  diff -u -r1.24.4.42 -r1.24.4.43
  --- httpd.conf.src	27 Feb 2002 11:58:25 -0000	1.24.4.42
  +++ httpd.conf.src	27 Feb 2002 15:42:51 -0000	1.24.4.43
  @@ -513,7 +513,6 @@
   <Location /eg/web>
   
   SetEnv EMBPERL_APPNAME EmbperlWeb
  -SetEnv EMBPERL_RECIPE EmbperlWeb
   SetEnv EMBPERL_OPTIONS 16
   SetEnv EMBPERL_ALLOW .
   PerlSetEnv EMBPERL_OBJECT_BASE base.epl
  
  
  
  1.9.6.11  +0 -9      embperl/test/conf/startup.pl
  
  Index: startup.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test/conf/startup.pl,v
  retrieving revision 1.9.6.10
  retrieving revision 1.9.6.11
  diff -u -r1.9.6.10 -r1.9.6.11
  --- startup.pl	26 Feb 2002 20:14:44 -0000	1.9.6.10
  +++ startup.pl	27 Feb 2002 15:42:51 -0000	1.9.6.11
  @@ -4,13 +4,6 @@
       use ExtUtils::testlib ;
       use Cwd ;
       
  -    if ($EPSESSIONCLASS = $ENV{EMBPERL_SESSION_CLASS})
  -        {
  -        eval " use Apache\:\:Session; " ;
  -        die $@ if ($@) ;
  -        eval " use Apache\:\:Session\:\:$EPSESSIONCLASS; " ;
  -        }
  -
       my $cwd       = $ENV{EMBPERL_SRC} ;
       my $i = 0 ;
       foreach (@INC)
  @@ -22,7 +15,6 @@
   
       } ;
   
  -use Apache::SessionX ;
   use Apache ;
   use Apache::Registry ;
   use Embperl ;
  @@ -35,6 +27,5 @@
   $cp -> share ('$testshare') ;  
   
   
  -require "$ENV{EMBPERL_SRC}/eg/webutil/EmbperlWebRecipe.pm" ;
   
   1 ;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org