richter     2002/07/29 22:15:10

  Modified:    .        Tag: Embperl2c epcfg.h
               Embperl  Tag: Embperl2c Object.pm
               Embperl/Recipe Tag: Embperl2c EmbperlXSLT.pm
               eg/web   Tag: Embperl2c base.epl footer.htm messages.pl
                        podbase.xsl
               eg/web/db Tag: Embperl2c add.epl content.epl epwebapp.pl
               eg/webutil Tag: Embperl2c db.schema
               podsrc   Tag: Embperl2c Config.spod
               test/conf Tag: Embperl2c httpd.conf.src
               xsbuilder/maps Tag: Embperl2c ep_structure.map
  Log:
  site & docs improvments
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.14  +1 -0      embperl/Attic/epcfg.h
  
  Index: epcfg.h
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epcfg.h,v
  retrieving revision 1.1.2.13
  retrieving revision 1.1.2.14
  diff -u -r1.1.2.13 -r1.1.2.14
  --- epcfg.h   10 Mar 2002 20:27:17 -0000      1.1.2.13
  +++ epcfg.h   30 Jul 2002 05:15:09 -0000      1.1.2.14
  @@ -19,6 +19,7 @@
   EPCFG_CV  (ComponentConfig,     CV *  ,      pExpiredFunc,  EXPIRES_FUNC) 
   EPCFG_CV  (ComponentConfig,     CV *  ,      pCacheKeyFunc, CACHE_KEY_FUNC)
   EPCFG_INT (ComponentConfig,     int   ,      nExpiresIn,    EXPIRES_IN) 
  +EPCFG_STR (ComponentConfig,     char *,      sExpiresFilename, EXPIRES_FILENAME) 
   EPCFG_STR (ComponentConfig,     char *,      sSyntax,       SYNTAX) 
   EPCFG_SV  (ComponentConfig,     SV *,        pRecipe,       RECIPE) 
   EPCFG_STR (ComponentConfig,     char *,      sXsltstylesheet, XSLTSTYLESHEET) 
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.26  +4 -3      embperl/Embperl/Attic/Object.pm
  
  Index: Object.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Attic/Object.pm,v
  retrieving revision 1.1.2.25
  retrieving revision 1.1.2.26
  diff -u -r1.1.2.25 -r1.1.2.26
  --- Object.pm 20 Jun 2002 07:05:20 -0000      1.1.2.25
  +++ Object.pm 30 Jul 2002 05:15:09 -0000      1.1.2.26
  @@ -373,8 +373,9 @@
   
   
       <Location /foo>
  -        PerlSetEnv EMBPERL_OBJECT_BASE base.htm
  -        PerlSetEnv EMBPERL_FILESMATCH "\.htm.?|\.epl$"
  +        EMBPERL_APPNAME     unique-name
  +        EMBPERL_OBJECT_BASE base.htm
  +        EMBPERL_URIMATCH "\.htm.?|\.epl$"
           SetHandler perl-script
           PerlHandler Embperl::Object 
           Options ExecCGI
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.11  +2 -2      embperl/Embperl/Recipe/Attic/EmbperlXSLT.pm
  
  Index: EmbperlXSLT.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Recipe/Attic/EmbperlXSLT.pm,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- EmbperlXSLT.pm    25 Feb 2002 11:20:28 -0000      1.1.2.10
  +++ EmbperlXSLT.pm    30 Jul 2002 05:15:09 -0000      1.1.2.11
  @@ -53,7 +53,7 @@
   
       push @$ep, {'type'   =>  'eptostring' } ;
       push @$ep, {'type'   =>  $xsltproc . '-parse-xml', } ;
  -    push @$ep, {'type'   =>  $xsltproc, stylesheet => \@stylesheet } ;
  +    push @$ep, {'type'   =>  $xsltproc, stylesheet => \@stylesheet, $param -> 
xsltparam?():(param => \%Embperl::fdat) } ;
   
       return $ep ;
       }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.11  +6 -4      embperl/eg/web/Attic/base.epl
  
  Index: base.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/Attic/base.epl,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- base.epl  5 Jul 2002 07:58:35 -0000       1.1.2.10
  +++ base.epl  30 Jul 2002 05:15:09 -0000      1.1.2.11
  @@ -17,10 +17,10 @@
               $base18 = $base . ' font-size: 18px;' ; 
               -]
   
  -           .cInput              {background: #DDDDDD; }
  -           .cText               {background: #AFBDCA; }
  -           .cSectionInput       {background: #ddaaaa; }
  -           .cSectionText        {background: #ddaaaa; }
  +           .cInput              {[+ $base12 +] background: #DDDDDD; }
  +           .cText               {[+ $base12 +] background: #AFBDCA; }
  +           .cSectionInput       {[+ $base12 +] background: #ddaaaa; }
  +           .cSectionText        {[+ $base12 +] background: #ddaaaa; }
              .cTabsOn             {[+ $base14 +] background: #ddaaaa; }
              .cTabsOff            {[+ $base14 +] background: #DDDDDD; }
              .cMenu               {[+ $base10 +] color: #000000 ; text-align: left ;}
  @@ -40,6 +40,8 @@
              .cPodVerbatim        {font-family: monospace; font-size: 12px; 
background: #eeeeee; 
                                    border-left: solid 1px black; border-right: solid 
1px black;
                                    padding-top: 3px}
  +
  +           .cFoot               {[+ $base10 +]}
   
              body                 {[+ $base12 +]}
              table                {[+ $base12 +]}
  
  
  
  1.1.2.4   +7 -1      embperl/eg/web/Attic/footer.htm
  
  Index: footer.htm
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/Attic/footer.htm,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- footer.htm        20 Jun 2002 07:05:20 -0000      1.1.2.3
  +++ footer.htm        30 Jul 2002 05:15:09 -0000      1.1.2.4
  @@ -1 +1,7 @@
  -<hr><font size="1">&copy; 1997-2002 Gerald Richter / <a 
href="http://www.ecos.de/";>ecos gmbh</a></font>
  \ No newline at end of file
  +<hr>
  +<table width="100%" border=0 cellspacing=0 cellpadding=0><tr>
  +<td align=left class="cFoot">&copy; 1997-2002 Gerald Richter / <a 
href="http://www.ecos.de/";>ecos gmbh</a></td>
  +[$if $udat{user_id} $]
  +<td align=right class="cFoot">[= logged_in_as =] [+ $udat{user_email} +]</td>
  +[$endif$]
  +</tr></table>
  \ No newline at end of file
  
  
  
  1.1.2.9   +31 -0     embperl/eg/web/Attic/messages.pl
  
  Index: messages.pl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/Attic/messages.pl,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- messages.pl       1 Jul 2002 06:57:13 -0000       1.1.2.8
  +++ messages.pl       30 Jul 2002 05:15:09 -0000      1.1.2.9
  @@ -21,6 +21,22 @@
           'under_construction' => 'Hinweis: Dieser Teil der Website befindet sich 
noch im Aufbau.',
           'more_news' => 'Weitere News...',
           'add_news' => 'News hinzuf�gen...',
  +        'display'  => 'anzeigen',
  +        'hide'     => 'nicht anzeigen',
  +        'logged_in_as'  => 'Angemeldet als',
  +        'need_login'    => q{
  +             Sie m�ssen sich erst anmelden um diesen Bereich zu nutzen.
  +             Bitte geben Sie Ihre E-Mail Adresse und Ihr Kennwort ein und klicken 
Sie auf 'Anmelden'.
  +             Wenn Sie sich das erste Mal anmelden, geben Sie lediglich Ihre E-Mail 
Adresse an und
  +             klicken auf "Neuen Benutzer-Account einrichten".
  +             Sie bekommen dann ein neues Kennwort zugeschickt.
  +             Haben Sie Ihr Kennwort vergessen, klicken Sie auf "Neues Kennwort". 
Sie bekommen
  +             dann ein neues Kennwort zugesandt.},
  +        'email'     => 'E-Mail Adresse',
  +        'password'  => 'Kennwort',
  +        'login'     => 'Anmelden',
  +        'newuser'   => 'Neuen Benutzer-Account einrichten',
  +        'newpassword'   => 'Neues Kennwort',
           },
       'en' =>
           {
  @@ -40,6 +56,21 @@
           'under_construction' => 'NOTE: This part of the site is still under 
contruction.',
           'more_news' => 'more news...',
           'add_news' => 'add news...',
  +        'display'  => 'display',
  +        'hide'     => 'hide',
  +        'logged_in_as'  => 'logged in as',
  +        'need_login'    => q{
  +             You must be logged in to access this area. 
  +             Please enter your email address and password and click on 'Login'. 
  +             If you not already have a user account, just enter your email and 
click on 'Create new account'.
  +             A new account will be created and the password will be imediately 
mailed to address you entered.
  +             In case you have forgotten your password, click on 'New password', a 
new password will be mailed
  +             to your email address.},
  +        'email'     => 'E-Mail address',
  +        'password'  => 'Password',
  +        'login'     => 'Login',
  +        'newuser'   => 'Create new account',
  +        'newpassword'   => 'New password',
           },
       ) ;
   
  
  
  
  1.1.2.2   +10 -2     embperl/eg/web/Attic/podbase.xsl
  
  Index: podbase.xsl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/Attic/podbase.xsl,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- podbase.xsl       1 Jul 2002 06:57:13 -0000       1.1.2.1
  +++ podbase.xsl       30 Jul 2002 05:15:09 -0000      1.1.2.2
  @@ -20,8 +20,8 @@
       <xsl:param name="page" select="0"/>
       <xsl:param name="basename">default</xsl:param>
       <xsl:param name="extension">html???</xsl:param>
  -    <xsl:param name="baseuri"></xsl:param>
  -    <xsl:param name="imageuri">/eg/images</xsl:param>
  +    <xsl:param name="baseuri">/eg/web/</xsl:param>
  +    <xsl:param name="imageuri">/eg/images/</xsl:param>
   
   
       <!-- - - - - list - - - - -->
  @@ -218,6 +218,14 @@
   
       <xsl:template match="underline">                         
           <u><xsl:value-of select="."/></u>
  +    </xsl:template>
  +
  +    <xsl:template match="pic">                         
  +        <p class="cPic">
  +        <xsl:element name="img">
  +            <xsl:attribute name="src"><xsl:value-of select="."/></xsl:attribute>
  +        </xsl:element>
  +        </p>
       </xsl:template>
   
   </xsl:stylesheet> 
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.7   +21 -6     embperl/eg/web/db/Attic/add.epl
  
  Index: add.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/db/Attic/add.epl,v
  retrieving revision 1.1.2.6
  retrieving revision 1.1.2.7
  diff -u -r1.1.2.6 -r1.1.2.7
  --- add.epl   1 Jul 2002 06:57:13 -0000       1.1.2.6
  +++ add.epl   30 Jul 2002 05:15:09 -0000      1.1.2.7
  @@ -16,14 +16,22 @@
   
   [= add2a =]<br>
   [= add2b =]<br><br>
  +[$if $r -> {category_set}{add_info}$]
  +<B>[+ $r -> {category_set}{add_info} +]</b><br><br>
  +[$endif$]
   
  -[#
  +
  +[$if $r -> {user_admin} $]
   <table>
       <tr>
  -        <td>URL:</td><td><input type="text" name="url" size=80></td>
  +        <td class="cText">[= state =]<td><td class="cInput"><input type="radio" 
name="state" value="0"> [= display =]</td>
  +    </tr>
  +    <tr>
  +        <td class="cText">[= state =]<td><td class="cInput"><input type="radio" 
name="state" value="1"> [= hide =]</td>
       </tr>
   </table>
  -#]
  +[$endif$]
  +
   
   <table width="100%">
       <tr bgcolor="#fefcad"><font size="3">
  @@ -37,23 +45,30 @@
                       [$ if $txt = $r -> {category_set}{$type . '_text'} $]
                           <tr>
                               [$if $type ne 'description' $]
  -                                <td>[+ $txt +]:</td><td><input type="text" name="[+ 
$type +]_[+ $rec -> {id} +]" size=80></td>
  +                                <td class="cText">[+ $txt +]:</td><td 
class="cInput"><input type="text" name="[+ $type +]_[+ $rec -> {id} +]" size=80></td>
                               [$else$]
  -                                <td>[+ $txt +]:</td><td><textarea name="[+ $type 
+]_[+ $rec -> {id} +]" cols=60 rows=10></textarea></td>
  +                                <td class="cText">[+ $txt +]:</td><td 
class="cInput"><textarea name="[+ $type +]_[+ $rec -> {id} +]" cols=60 
rows=10></textarea></td>
                               [$endif$]
                           </tr>
                       [$endif$]
                   [$endforeach$]
  -
  +                <input type="hidden" name="id_[+ $rec -> {id} +]">
               </table>
           </td>
       </tr>
   </table>
   
   <br><br>
  +[$ if $r -> {edit} $]
  +&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="-update_item" value="[= update3 
=]">
  +&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="-delete_item" value="[= delete3 
=]">
  +[$else$]
   &nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="-add_item" value="[= add3 =] [+ 
$r -> {category_set}{category} +]">
  +[$endif$]
  +
   
   <input type="hidden" name="category_id">
  +<input type="hidden" name="item_id">
   
   </form>
                
  
  
  
  1.1.2.5   +28 -3     embperl/eg/web/db/Attic/content.epl
  
  Index: content.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/db/Attic/content.epl,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- content.epl       24 Jun 2002 09:22:47 -0000      1.1.2.4
  +++ content.epl       30 Jul 2002 05:15:09 -0000      1.1.2.5
  @@ -3,8 +3,33 @@
   <hr>
   
   [- $r = shift -]
  -[$if $r -> param -> uri !~ /html?$|epl$/ $]<pre>[$endif$]
  -[- Execute ({inputfile => '*'})  -] 
  -[$if $r -> param -> uri !~ /html?$|epl$/ $]</pre>[$endif$]
   
  +[$if $r -> {error} $]
  +<center><font color="red" size=3>[+ $r -> gettext($r -> {error}) 
+]</font><br></center>
  +[$endif$]
   
  +[$if $r -> {need_login} $]
  +    [= need_login =]
  +
  +    <form action="[+ $r -> param -> uri +]" method="POST">
  +        <table>
  +            <tr>
  +                <td class="cText">[= email =]</td>
  +                <td class="cInput"><input type="text" name="user_email"></td>
  +            </tr>
  +            <tr>
  +                <td class="cText">[= password =]</td>
  +                <td class="cInput"><input type="text" name="user_password"></td>
  +            </tr>
  +        </table>
  +        <input type="submit" name="-login" value="[= login =]">
  +        <input type="submit" name="-newuser" value="[= newuser =]">
  +        <input type="submit" name="-newpassword" value="[= newpassword =]">
  +        [$ hidden $]
  +    </form>
  +[$else$]
  +    [$if $r -> param -> uri !~ /html?$|epl$/ $]<pre>[$endif$]
  +
  +    [- Execute ({inputfile => '*'})  -] 
  +    [$if $r -> param -> uri !~ /html?$|epl$/ $]</pre>[$endif$]
  +[$endif$]
  
  
  
  1.1.2.11  +288 -7    embperl/eg/web/db/Attic/epwebapp.pl
  
  Index: epwebapp.pl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/db/Attic/epwebapp.pl,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- epwebapp.pl       30 Jun 2002 13:33:09 -0000      1.1.2.10
  +++ epwebapp.pl       30 Jul 2002 05:15:09 -0000      1.1.2.11
  @@ -17,6 +17,8 @@
   
       my $db = $r -> {db} ;
   
  +    $self -> checkuser ($r) ;
  +
       $r -> {language_set} = DBIx::Recordset -> Search ({'!DataSource' => $db, 
                                                          '!Table' => 'language'}) ;
       
  @@ -31,6 +33,22 @@
           $self -> get_category($r) ;
           $self -> get_item_lang($r) ;
           }
  +    elsif ($fdat{-update_item})
  +        {
  +        $self -> update_item ($r) ;
  +        $self -> get_category($r) ;
  +        $self -> get_item_lang($r) ;
  +        }
  +    elsif ($fdat{-delete_item})
  +        {
  +        $self -> delete_item ($r) ;
  +        }
  +    elsif ($fdat{-edit_item})
  +        {
  +        $self -> get_category($r) ;
  +        $self -> get_item_lang($r) ;
  +        $self -> setup_edit_item($r) ;
  +        }
       elsif ($fdat{-show_item})
           {
           $self -> get_category($r) ;
  @@ -89,12 +107,132 @@
   
   
   # ----------------------------------------------------------------------------
  +#
  +# check if user is loged in, handle login/out and createing of new users
  +#
  +# allowed actions parameters:
  +#   -login
  +#   -logout
  +#   -newuser
  +#   -newpassword
  +# formfields expected:
  +#   user_email
  +#   user_password
  +#
  +# returns:
  +#   undef   not logged in
  +#   1       user logged in
  +#   2       admin logged in
  +#
  +
  +sub checkuser
  +    {
  +    my $self     = shift ;
  +    my $r        = shift ;
  +
  +    if ($udat{user_id} && $udat{user_email})
  +        {
  +        $r -> {user_id}    = $udat{user_id} ;
  +        $r -> {user_email} = $udat{user_email} ;
  +        $r -> {user_admin} = $udat{user_admin} ;
  +        return $r -> {user_admin}?2:1 ;
  +        }
  +
  +    if (($fdat{-login} || $fdat{-newuser}) && !$fdat{user_email})
  +        {
  +        $r -> {error} = 'err_email_needed' ;
  +        return ;
  +        }
  +
  +    my $user ;
  +
  +    if ($fdat{user_email})
  +        {
  +        $user = DBIx::Recordset -> Search ({'!DataSource' => $r -> {db}, 
  +                                              '!Table' => 'user', 
  +                                              'email'  => $fdat{user_email}}) ;
  +        }
  +
  +    if ($fdat{-login} && $fdat{user_email})
  +        {
  +        if ($user -> {id} && $user -> {password} eq $fdat{user_password})
  +            {
  +            $r -> {user_id}    = $udat{user_id}    = $user -> {id} ;
  +            $r -> {user_email} = $udat{user_email} = $user -> {email} ;
  +            $r -> {user_admin} = $udat{user_admin} = $user -> {admim} ;
  +            return $r -> {user_admin}?2:1 ;
  +            }
  +            
  +        $r -> {error} = 'err_access_denied' ;
  +        return ;
  +        }
  +
  +    if ($fdat{-logout})
  +        {
  +        $r -> {user_id}    = $udat{user_id}    = undef ;
  +        $r -> {user_email} = $udat{user_email} = undef ;
  +        $r -> {user_admin} = $udat{user_admin} = undef ;
  +        return ;
  +        }
  +            
  +    if ($fdat{-newuser} && $user -> {id})
  +        {
  +        $r -> {error} = 'err_user_exists' ;
  +        return ;
  +        }
  +
  +    if ($fdat{-newpassword} && !$user -> {id})
  +        {
  +        $r -> {error} = 'err_user_not_exists' ;
  +        return ;
  +        }
  +
  +    if ($fdat{-newuser} || $fdat{-newpassword})
  +        {
  +        my $chars = 
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-+$!#*=@1234567890-+$!#*=@'
 ;
  +        $fdat{user_password} = '' ;
  +        for (my $i = 0; $i < 6; $i++)
  +            {
  +            $fdat{user_password} .= substr($chars, rand(length($chars)), 1) ;
  +            }
  +        }
  +
  +    if ($fdat{-newuser} && $fdat{user_email})
  +        {
  +        my $set = DBIx::Recordset -> Insert ({'!DataSource' => $r -> {db}, 
  +                                              '!Table'      => 'user', 
  +                                              'password'    => $fdat{user_password},
  +                                              'email'       => $fdat{user_email}}) ;
  +        #Embperl::Mail::Execute ({inputfile => 'newuser.admin.mail',  to => $self 
-> {config} -> {adminemail}) ;
  +        #Embperl::Mail::Execute ({inputfile => 'newuser.mail', to => 
$fdat{user_email}) and $r -> {error} = 'err_mail' ;
  +        return ;
  +        }
  +
  +    if ($fdat{-newpasswd} && $fdat{user_email})
  +        {
  +        my $set = DBIx::Recordset -> Update ({'!DataSource' => $r -> {db}, 
  +                                              '!Table'      => 'user', 
  +                                              'password'    => $fdat{user_password},
  +                                              'email'       => $fdat{user_email}}) ;
  +        #Embperl::Mail::Execute ({inputfile => 'newpassword.mail', to => 
$fdat{user_email}) and $r -> {error} = 'err_mail' ;
  +        return ;
  +        }
  +    
  +    }
  +
  +# ----------------------------------------------------------------------------
   
   sub add_category
       {
       my $self     = shift ;
       my $r        = shift ;
   
  +    if ($self -> checkuser($r) < 2)
  +        {
  +        $r -> {need_login} = 1 ;
  +        return ;
  +        }
  +    
       my $set = DBIx::Recordset -> Insert ({'!DataSource' => $r -> {db}, 
                                             '!Table'      => 'category',
                                             '!Serial'     => 'id',
  @@ -122,12 +260,19 @@
       my $self     = shift ;
       my $r        = shift ;
   
  +    if (!$self -> checkuser($r))
  +        {
  +        $r -> {need_login} = 1 ;
  +        return ;
  +        }
  +
       my $set = DBIx::Recordset -> Insert ({'!DataSource' => $r -> {db}, 
                                             '!Table'      => 'item',
                                             '!Serial'     => 'id',
                                              url          => $fdat{url},
                                              category_id  => $fdat{category_id},
  -                                           state        => 0}) ;
  +                                           user_id      => $r -> {user_id},
  +                                           state        => $r ->{user_admin} && 
$fdat{state}?1:0}) ;
       my $id = $$set -> LastSerial ;
       my $langset = $r -> {language_set} ;
       my $txtset = DBIx::Recordset -> Setup ({'!DataSource' => $r -> {db}, 
  @@ -147,6 +292,85 @@
       }
   
   
  +# ----------------------------------------------------------------------------
  +
  +sub update_item
  +    {
  +    my $self     = shift ;
  +    my $r        = shift ;
  +
  +    if (!$self -> checkuser($r))
  +        {
  +        $r -> {need_login} = 1 ;
  +        return ;
  +        }
  +
  +    my $set = DBIx::Recordset -> Update ({'!DataSource' => $r -> {db}, 
  +                                          '!Table'      => 'item',
  +                                           url          => $fdat{url},
  +                                           category_id  => $fdat{category_id},
  +                                           $r ->{user_admin}?(state  => 
$fdat{state}):()},
  +                                          {item_id     => $fdat{item_id},
  +                                           $r ->{user_admin}?():(user_id      => $r 
-> {user_id})}) ;
  +    if ($set -> StHdl -> {NUMROWS} == 0)
  +        {
  +        $r -> {error} = 'err_cannot_update' ;
  +        return ;
  +        }
  +
  +    my $id = $fdat{item_id} ;
  +    my $langset = $r -> {language_set} ;
  +    my $txtset = DBIx::Recordset -> Setup ({'!DataSource' => $r -> {db}, 
  +                                            '!Table'      => 'itemtext'}) ;
  +    
  +    $$langset -> Reset ;
  +    while ($rec = $$langset -> Next)
  +        {
  +        $$txtset -> Update ({
  +                             language_id => $rec->{id},
  +                             description => $fdat{"description_$rec->{id}"},
  +                             url         => $fdat{"url_$rec->{id}"} || $fdat{url},
  +                             heading     => $fdat{"heading_$rec->{id}"}}) if 
($fdat{"heading_$rec->{id}"} || $fdat{"description_$rec->{id}"},
  +                             { item_id => $id, id => $fdat{"id_$rec->{id}"}}) ;
  +        }
  +    }
  +
  +
  +# ----------------------------------------------------------------------------
  +
  +sub delete_item
  +    {
  +    my $self     = shift ;
  +    my $r        = shift ;
  +
  +    if (!$self -> checkuser($r))
  +        {
  +        $r -> {need_login} = 1 ;
  +        return ;
  +        }
  +
  +    return if (!$fdat{item_id}) ;
  +    my $set = DBIx::Recordset -> Delete ({'!DataSource' => $r -> {db}, 
  +                                          '!Table'      => 'item',
  +                                            item_id     => $fdat{item_id},
  +                                            $r ->{user_admin}?():(user_id      => 
$r -> {user_id})}) ;
  +    if ($set -> StHdl -> {NUMROWS} == 0)
  +        {
  +        $r -> {error} = 'err_cannot_update' ;
  +        return ;
  +        }
  +
  +    my $id = $fdat{item_id} ;
  +    my $langset = $r -> {language_set} ;
  +    my $txtset = DBIx::Recordset -> Setup ({'!DataSource' => $r -> {db}, 
  +                                            '!Table'      => 'itemtext'}) ;
  +    
  +    $$langset -> Reset ;
  +    while ($rec = $$langset -> Next)
  +        {
  +        $$txtset -> Delete ({ item_id => $id, id => $fdat{"id_$rec->{id}"}}) if 
($fdat{"id_$rec->{id}"}}) ;
  +        }
  +    }
   
   
   # ----------------------------------------------------------------------------
  @@ -160,8 +384,9 @@
                                                          '!Table' => 'category, 
categorytext', 
                                                          '!TabRelation' => 
'category_id = category.id',
                                                          'language_id'  => $r -> 
param -> language,
  -                                                       
$fdat{category_id}?(category_id => $fdat{category_id}):()}) ;
  -
  +                                                       
$fdat{category_id}?(category_id => $fdat{category_id}):(),
  +                                                       $r -> {user_admin}?():(state 
=> 1)}) ;
  +                                                        
       }
   
   
  @@ -171,6 +396,20 @@
       {
       my $self     = shift ;
       my $r        = shift ;
  +    my %state ;
  +
  +    if (!$r -> {user_admin})
  +        {
  +        if ($r -> {user_id})
  +            {
  +            %state = ('$expr' => { '$conj' => 'or', state => 1, user_id => $r -> 
{user_id} } ) ;
  +            }
  +        else
  +            {
  +            %state = (state => 1) ;
  +            }
  +        }
  +
   
       $r -> {item_set} = DBIx::Recordset -> Search ({'!DataSource' => $r -> {db}, 
                                                          '!Table' => 'item, 
itemtext', 
  @@ -178,7 +417,8 @@
                                                          'language_id'  => $r -> 
param -> language,
                                                          '!Order'         => 
'creationtime desc',
                                                          
$fdat{category_id}?(category_id => $fdat{category_id}):(),
  -                                                       $fdat{item_id}?(item_id => 
$fdat{item_id}):()}) ;
  +                                                       $fdat{item_id}?(item_id => 
$fdat{item_id}):(), 
  +                                                       %state}) ;
       }
   
   
  @@ -189,10 +429,51 @@
       my $self     = shift ;
       my $r        = shift ;
   
  +    my %state ;
  +
  +    if (!$r -> {user_admin})
  +        {
  +        if ($r -> {user_id})
  +            {
  +            %state = ('$expr' => { '$conj' => 'or', state => 1, user_id => $r -> 
{user_id} } ) ;
  +            }
  +        else
  +            {
  +            %state = (state => 1) ;
  +            }
  +        }
  +
       $r -> {item_set} = DBIx::Recordset -> Search ({'!DataSource' => $r -> {db}, 
  -                                                       '!Table' => 'item, itemtext, 
language', 
  +                                                       '!Table' => 'item, language, 
itemtext', # itemtext must be last to get it's id 
                                                          '!TabRelation' => 'item_id = 
item.id and language_id = language.id',
                                                          '!Order'         => 
'creationtime desc',
                                                          
$fdat{category_id}?(category_id => $fdat{category_id}):(),
  -                                                       $fdat{item_id}?(item_id => 
$fdat{item_id}):()}) ;
  -    }
  \ No newline at end of file
  +                                                       $fdat{item_id}?(item_id => 
$fdat{item_id}):(),
  +                                                       %state}) ;
  +    }
  +
  +# ----------------------------------------------------------------------------
  +
  +sub setup_edit_item
  +    {
  +    my $self     = shift ;
  +    my $r        = shift ;
  +
  +    my $set = $r -> {item_set} ;
  +    $fdat{'item_id'} = $rec -> {item_id} ;
  +    
  +    $$set -> Reset ;
  +    while ($rec = $$set -> Next)
  +        {
  +        my $lang = $rec -> {language_id} ;
  +        $fdat{'id_' . $lang} = $rec -> {id} ;
  +        foreach my $type ('heading', 'url', 'description', 'keywords')
  +            {
  +            $fdat{$type . '_' . $lang} = $rec -> {$type} ;
  +            }
  +        }
  +    
  +    $r -> {edit} = 1 ;
  +    }
  +
  +
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.8   +7 -3      embperl/eg/webutil/Attic/db.schema
  
  Index: db.schema
  ===================================================================
  RCS file: /home/cvs/embperl/eg/webutil/Attic/db.schema,v
  retrieving revision 1.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- db.schema 30 Jun 2002 13:33:09 -0000      1.1.2.7
  +++ db.schema 30 Jul 2002 05:15:10 -0000      1.1.2.8
  @@ -159,6 +159,7 @@
           'keywords_text'                      => 'tinytext',
           'description_text'           => 'tinytext',
           'url_text'                   => 'tinytext',
  +        'add_info'                      => 'text',
        ],
       '!PrimKey' => 'id',
       '!Init' =>
  @@ -169,9 +170,11 @@
                           heading_text => '', keywords_text => '', description_text 
=> 'News', url_text => '' } ,
   
               { id =>  3, category_id => 2, language_id => 'de', 'category' => 
'Websites die Embperl nutzen',
  -                        heading_text => '�berschrift', keywords_text => '', 
description_text => 'Beschreibung', url_text => 'URL' } ,
  +                        heading_text => '�berschrift', keywords_text => '', 
description_text => 'Beschreibung', url_text => 'URL',
  +                        add_info     => 'Bitte geben Sie eine Kurzbeschreibung der 
Site, sowie Informationen zu deren Realisierung ein.' } ,
               { id =>  4, category_id => 2, language_id => 'en', 'category' => 'Sites 
using Embperl',
  -                        heading_text => 'Heading', keywords_text => '', 
description_text => 'Description', url_text => 'URL' } ,
  +                        heading_text => 'Heading', keywords_text => '', 
description_text => 'Description', url_text => 'URL',
  +                        add_info     => 'Please enter a short description of the 
Site and some informations how it has been setup.' } ,
   
               { id =>  5, category_id => 3, language_id => 'de', 'category' => 
'B�cher die Embperl behandeln',
                           heading_text => 'Titel', keywords_text => '', 
description_text => 'Beschreibung', url_text => 'URL' } ,
  @@ -208,6 +211,7 @@
           'name'                      => 'tinytext',
           'email'                     => 'tinytext',
           'password'                  => 'tinytext',
  +        'admin'                     => 'bit',
           ],
       '!PrimKey' => 'id',
       },
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +375 -53   embperl/podsrc/Attic/Config.spod
  
  Index: Config.spod
  ===================================================================
  RCS file: /home/cvs/embperl/podsrc/Attic/Config.spod,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- Config.spod       24 Jun 2002 09:22:48 -0000      1.1.2.2
  +++ Config.spod       30 Jul 2002 05:15:10 -0000      1.1.2.3
  @@ -26,7 +26,7 @@
   =item Offline
   
   You can use Embperl also on the command line. This is usefull for generating
  -static content out of dynamic pages and can sometime helpfull for testing.
  +static content out of dynamic pages and can sometime be helpfull for testing.
   
   =item Call it from other Perl programms
   
  @@ -37,10 +37,10 @@
   =back
   
   
  -=head2 mod_perl
  +=head2 mod_perl 
   
   To use Embperl under mod_perl you must have installed Apache and mod_perl on your 
system.
  -Then you add some directieves to your F<httpd.conf> to load Embperl and add 
C<Embperl>
  +Then you add some directives to your F<httpd.conf> to load Embperl and add 
C<Embperl>
   as the C<PerlHandler>. The following directives will cause all file with extetion 
F<epl>
   to be handled by Embperl:
   
  @@ -55,7 +55,7 @@
       </files>
   
   
  -Another possibility is to have all file under a special location processed by 
Embperl:
  +Another possibility is to have all files under a special location processed by 
Embperl:
   
       PerlModule Embperl
   
  @@ -70,8 +70,33 @@
   In this setup you should make sure that non Embperl files like images doesn't 
served 
   from this directory.
   
  -B<See also>: L<"perldoc Embperl::Object"|"EmbperlObject.pod"> to see how to setup 
I<Embperl> so as to  
  -create your site out of small overwriteable objects.
  +For B<mod_perl 2.0> you need addtionaly to load the dynamic object library of 
Embperl. This is
  +necessary so Embperl is loaded early enough to register the configuration directives
  +with Apache. After installing, search underneath your Perl site directory for the
  +library. On Unix it is mostly called F<Embperl.so> on Windows it is called 
C<Embperl.dll>.
  +Now add the following line to your httpd.conf B<before> any of the Embperl 
configuration
  +directives, but B<after> F<mod_perl.so> is loaded:
  +
  +    LoadModule  embperl_module  /path/to/perl/site/lib/Embperl/Embperl.so
  +
  +To use I<Embperl::Object> you use the C<Embperl::Object> as C<PerlHandler>:
  +
  +    <Location /foo>
  +        Embperl_AppName     unique-name
  +        Embperl_Object_Base base.htm
  +        Embperl_UriMatch    "\.htm.?|\.epl$"
  +        SetHandler          perl-script
  +        PerlHandler         Embperl::Object 
  +        Options             ExecCGI
  +    </Location>
  +
  +Addtionaly you can setup other parameters for I<Embperl::Object>. If you do so
  +inside a container (like C<<Location>, <Directory>, <Files>>) you need to
  +set C<Embperl_AppName> to a unique-name (the actual value doesn't matter). 
  +The C<Embperl_UriMatch> makes sure that only files of the requested type are
  +served by I<Embperl::Object>, while all others are served by Apache as usual.
  +
  +For more information see: L<"perldoc Embperl::Object"|"EmbperlObject.pod">. 
   
   Embperl accepts a lot of configuration directives to customize it's behaviour. See 
the next
   section for a description.
  @@ -97,8 +122,10 @@
       </Directory>
   
   
  -B<NOTE>: Via CGI Scripts it maybe possible to bypass some of the Apache setup. 
avoid this
  -use L<EMBPERL_ALLOW> to restrict access to the files, which should be processed by 
Embperl.
  +B<NOTE>: Via CGI Scripts it maybe possible to bypass some of the Apache setup. To 
avoid this
  +use L<Embperl_Allow> to restrict access to the files, which should be processed by 
Embperl.
  +
  +For I<Embperl::Object> you have to use F<epocgi.pl> instead of F<embpcgi.pl>.
   
   You can also run Embperl with B<FastCGI>, in this case use embpfastcgi.pl
   as cgi script. You must have FCGI.pm installed.
  @@ -167,21 +194,19 @@
   Embperl pages (for example to store a common header or
   footer in a different file). 
   
  -There are two forms you can use for calling Execute. A short form which only takes a
  -filename and optional additional parameters or a long form which
  -takes a hash reference as its argument. This gives it the chance to
  -vary the parameters according to the job that should be done.
  -
   (See B<eg/x/Excute.pl> for more detailed examples)
   
  -B<See also>: L<"perldoc Embperl::Object"|"EmbperlObject.pod"> to see how to setup 
I<Embperl> so as to
  -create your site out of small overwriteable objects and L<"perldoc 
Embperl::Mail"|"Mail.pod"> on how
  -to use I<Embperl> to send email.
  +When you want to use I<Embperl::Object> call C<Embperl::Object::Execute>, when you
  +want I<Embperl::Mail>, call C<Embperl::Mail::Execute>.
  +
  +There are two forms you can use for calling Execute. A short form which only takes a
  +filename and optional additional parameters or a long form which
  +takes a hash reference as its argument. 
   
     Execute($filename, $p1, $p2, $pn) ;
   
  -This will cause Embperl to interpret the file with the name $filename and, if 
specified, pass
  -any additional parameters in the array @param (just like @_ in a perl subroutine).
  +This will cause Embperl to interpret the file with the name C<$filename> and, if 
specified, pass
  +any additional parameters in the array C<@param> (just like C<@_> in a Perl 
subroutine).
   The above example could also be written in the long form:
   
     Execute ({inputfile => $filename,
  @@ -266,6 +291,16 @@
   as argument when you call the component via C<Execute>.
   
   
  +=head2 *CFG $application / Embperl_UseEnv / use_env / 2.0b6 / no / off unless 
runing as CGI script
  +
  +Tells Embperl to scan the enviromemt for configuration settings.
  +
  +=head2 *CFG $application / / use_redirect_env / 2.0b6 / no / off unless runing as 
CGI script
  +
  +Tells Embperl to scan the enviromemt for configuration settings which has the
  +prefix C<REDIRECT_>. This is normaly the case when the request is not the main 
request,
  +but a subrequest.
  +
   =head2 *CFG $application / Embperl_AppName / app_name / 2.0b6 / no
   
   Specifies the name for an application. The name is basicly used to refer to this 
application
  @@ -534,8 +569,8 @@
   
   Filename of the application object that Embperl::Object searches for. 
   The file should contain the Perl code for 
  -the application object. The must be no package name given (as the package is set
  -by Embperl::Object), but the @ISA should point to Embperl::App.
  +the application object. There must be no package name given (as the package is set
  +by Embperl::Object) inside the file, but the @ISA should point to Embperl::App.
   If set this file is searched throught the same search path as any content file.
   After a successfull load the init method is called with the Embperl request object
   as parameter. The init method can change the parameters inside the request object
  @@ -544,8 +579,11 @@
   
   =head2 *CFG $application / Embperl_OBJECT_ADDPATH / object_addpath / 1.3b1 / no 
   
  -Additional directories where Embperl::Object searches for pages. Directories are
  -separated by C<;> (on Unix C<:> works also). This path is
  +Additional directories where Embperl::Object searches for pages. 
  +In F<httpd.conf> or as evironment variable directories are
  +separated by C<;> (on Unix C<:> works also). The parameter for C<Execute> and
  +the application object method expects/returns an array reference.
  +This path is
   B<always> appended to the searchpath.
   
   
  @@ -571,8 +609,15 @@
   
   
   
  +=head2 *CFG $request / Embperl_UseEnv / use_env / 2.0b6 / no / off unless runing as 
CGI script
   
  +Tells Embperl to scan the enviromemt for configuration settings.
   
  +=head2 *CFG $request / / use_redirect_env / 2.0b6 / no / off unless runing as CGI 
script
  +
  +Tells Embperl to scan the enviromemt for configuration settings which has the
  +prefix C<REDIRECT_>. This is normaly the case when the request is not the main 
request,
  +but a subrequest.
   
   =head2 *CFG $request / Embperl_ALLOW / allow / 1.2b10 / no / no restrictions
   
  @@ -603,12 +648,20 @@
   Can contain a semicolon (also colon under Unix) separated file search path.
   When a file is processed and the filename isn't an absolute path or
   does not start with ./ (or .\ under windows), I<Embperl> searches all
  -the specified directories for that file. Directories must end with a
  -slash (C</>), otherwise the entry is treated as a fileprefix. 
  +the specified directories for that file. 
  +
  +=cut
  +
  +Directories must end with a
  +slash (C</>), otherwise the entry is treated as a file prefix. 
  +
  +=pod
  +
   A special handling is done if the filename starts with any number
   of C<../> i.e. refers to an upper directory. Then I<Embperl> strips
   the same number of entries at the start of the searchpath as the filename
   contains C<../>.
  +C<Execute> and the method of the request object expects/returns a array ref.
   
   =head2 *CFG $request / Embperl_DEBUG / debug / yes
   
  @@ -660,7 +713,7 @@
   
   =head2 *CFG $request / Embperl_SESSION_MODE / session_mode / no / 2.0b6 / 
smodeUDatCookie = 1
   
  -Specifies how Embperl the id for the session data is passed between requests.
  +Specifies how the id for the session data is passed between requests.
   Possible values are:
   
   =over
  @@ -697,6 +750,15 @@
   
   
   
  +=head2 *CFG $component / Embperl_UseEnv / use_env / 2.0b6 / no / off unless runing 
as CGI script
  +
  +Tells Embperl to scan the enviromemt for configuration settings.
  +
  +=head2 *CFG $component / / use_redirect_env / 2.0b6 / no / off unless runing as CGI 
script
  +
  +Tells Embperl to scan the enviromemt for configuration settings which has the
  +prefix C<REDIRECT_>. This is normaly the case when the request is not the main 
request,
  +but a subrequest.
   
   =head2 *CFG $component / Embperl_PACKAGE /package / / no 
   
  @@ -891,6 +953,7 @@
   an html editor insert html tags like <br> inside your Perl code.
   
   Set EMBPERL_INPUT_ESCMODE to 7 to get the old default of Embperl < 2.0b6
  +
   Set EMBPERL_INPUT_ESCMODE to 0 to get the old behaviour when optRawInput was set.
   
   
  @@ -952,6 +1015,10 @@
   NOTE: If C<$EXPIRES> is set inside the page, it get evaluated before 
   the excecution of the page
   
  +=head2 *CFG $component / Embperl_EXPIRES_FILENAME / expires_filename  / 2.0b8 / no
  +
  +Cache should be expired when the given file is modified.
  +
   =head2 *CFG $component / Embperl_SYNTAX / syntax / 2.0b1 / yes / Embperl
   
   Used to tell Embperl which syntax to use inside a page. Embperl comes with
  @@ -1043,7 +1110,7 @@
   
   Tell the xslt processor which stylsheet to use.
   
  -=head2 *CFG $component / Embperl_XSLTPROC / xsltproc / 2.0b5 / no
  +=head2 *CFG $component / Embperl_XSLTPROC / xsltproc / 2.0b5 / no / depends on 
compiltime options
   
   Tells Embperl which xslt processor to use. Current C<libxslt> and C<xalan>
   are supported by Embperl, but they must be compiled in to be available.
  @@ -1052,34 +1119,289 @@
   
    head2 *CFG $component /  / cleanup
   
  +=pod
  +
  +=head1 Parameters
  +
  +Parameters gives addtionaly information about the current request
  +or the execution of the current component. So we have two sorts of
  +parameters I<Request> and I<Component> parameters. Request
  +parameters are automaticly setup by Embperl with information
  +Embperl takes from the current running enviroment. When
  +Embperl is invoked via the C<Execute> function, you can pass any of
  +the parameters to Execute. Component parameters mainly reflect
  +the parameters given to C<Execute>.
  +
  +=head2 *PARAM $request / / filename / 2.0b6 / during init
  +
  +Gives the filename of the file that was actualy requested.
  +Inside of the applications C<init> function it can be changed
  +to force Embperl to serve a different file.
  +
  +
  +=head2 *PARAM $request / / unparsed_uri / 2.0b6 / yes
  +
  +The full unparsed_uri, includeing the query_string and the path_info.
  +
  +=head2 *PARAM $request / / uri / 2.0b6 / yes
  +
  +The decoded path of the unparsed_uri.
  +
  +=head2 *PARAM $request / / path_info / 2.0b6 / yes
  +
  +The path_info, that is anything in the path after the file the is currently served.
  +
  +=head2 *PARAM $request / / query_info  / 2.0b6 / yes, but will not change %fdat
  +
  +Any parameters passed in a GET request after the question mark. The hash
  +C<%fdat> will contain these values in a already decoded and easy to use way.
  +So it's normly more convenient to use C<%fdat> instead.
  +
  +=head2 *PARAM $request / / language  / 2.0b6 / yes
  +
  +The primary langange found in the browser C<Accept-Language> HTTP header.
  +This value is used for all language dependend functions inside Embperl.
  +You can set it change the selection of message returned by C<$request -&gt; gettext>
  +and C<[= =]>.
  +
  +=head2 *PARAM $request / / cookies  / 2.0b6 / yes
  +
  +A hashref that contains all cookies send by the browser to the server.
  +
  +=head2 *PARAM $component / / inputfile / 1.0.0 / no
  +
  +Give the name of the file that should be processed, e.g.
  +
  +    Execute({inputfile => 'mysource.epl'}) ;
  +
  +There is a shortcut when you only need to give the input file
  +and no other parameters. The above is will do the same as:
  +
  +    Execute('mysource.epl') ;
  +
  +=head2 *PARAM $component / / outputfile / 1.0.0 / no / STDOUT
  +
  +Specify a file to which the output should be written. Example:
  +
  +    Execute({inputfile  => 'mysource.epl',
  +             outputfile => 'myoutput.htm'}) ;
  +
  +
  +=head2 *PARAM $component / / input / 1.0.0 / no
  +
  +This parameter is used, when you have the source already in memory.
  +You should pass a reference to a scalar that contains the source.
  +Addtionaly you should give the L<inputfile> parameter, to allow
  +Embperl caching to keep track of different in memory sources.
  +The L<mtime> parameter is used to tell Embperl's cache if
  +the source has change since the last call or not. If C<mtime>
  +if C<undef> or of a different value as it was during the last
  +call, the source is considered to be changed and everything 
  +is recompiled. Example:
  +
  +    # Get source from scalar
  +    # Don't forget to modify mtime if $src changes
  +
  +    $src = '<html><head><title>Page [+ $no +]</title></head>' ;
  +
  +    Embperl::Execute ({ inputfile  => 'some name',
  +                     input      => \$src,
  +                     mtime      => 1 }) ;
  +  
  +
  +=head2 *PARAM $component / / output / 1.0.0 / no
  +
  +Gives the possibility to write the output into a scalar
  +instead of sending it to stdout or a file. You should give
  +a reference to a scalar. Example:
  +
  +    Execute({inputfile  => 'mysource.epl',
  +             output     => \$out}) ;
  +
  +
  +=head2 *PARAM $component / / sub / 1.2.0 / no
  +
  +Call the given Embperl subroutine defined with C<[$sub$]> inside the page.
  +A shortcut for this is to append the name of the subroutine after the
  +filename with a hash sign, so the following calls are doing the same thing:
  +
  +    Execute('mysource.epl#mysub') ;
  +
  +    Execute({inputfile  => 'mysource.epl',
  +             sub        => 'mysub'}) ;
  +
  +If you leave out the filename, the sub is called in the current file, so
  +this can only be used inside a file that is already processed by Embperl.
  +
  +=head2 *PARAM $component / / subreq / 2.0b8, Apache 2.x / no   
  +
  +This utilizies Apache 2.0 filters to retrieve the output of a sub-request
  +and uses it as input for the current component. For example if you have
  +a CGI-Script and you need to post process it via Embperl or simply
  +want to include it's output in another Embperl/Embperl::Object document
  +you can write:
  +
  +    [- Execute ({subreq => '/cgi-bin/script.cgi'}) -]
  +
  +B<NOTE:> You have to specify a URI and not a filename!
  +
  +=head2 *PARAM $component / / import / 1.3.0 / no
  +
  +A value of one tells Embperl to define the subrountines inside the file (if not 
already
  +done) and to import them as perl subroutines into the current namespace.
  +
  +See B<[$ sub $]> metacommand and section about subroutines for more info.
  +
  +A value of zero tells Embperl to simply precompile all code found in the page.
  +(With 2.0 it is B<not> necessary anymore to do it before using the C<sub> parameter
  +on a different file).
  +
  +=head2 *PARAM $component / / firstline / 1.2.0 / no / 1
  +
  +Specifies the first linenumber of the sourcefile.
  +
  +=head2 *PARAM $component / / mtime / 1.0.0 / no / undef
  +
  +Last modification time of parameter L<input>. If undef the code passed
  +by input is always recompiled, else the code is only recompiled if
  +mtime changes.
  +
  +=head2 *PARAM $component / / param / 1.0.0 / no
  +
  +Can be used to pass parameters to the Embperl document and back. Must contain
  +a reference to an array. Example:
  +
  +    Execute({inputfile  => 'mysource.epl',
  +             param      => [1, 2, 3]}) ;
  +    Execute({inputfile  => 'mysource.epl',
  +             param      => \@parameters}) ;
  +
  +There is a shortcut, so the following code the aquivalent (NOTE: Don't use a
  +array ref here):
  +
  +    Execute('mysource.epl', 1, 2, 3) ;
  +    Execute('mysource.epl', @parameters) ;
  +
  +
  +The array C<@param> in the Embperl document is setup as an alias to the array.
  +See F<eg/x/Excute.pl> for a more detailed example.
  +
  +=head2 *PARAM $component / / fdat / 1.0.0 / no
  +
  +Pass a hash reference to customly set %fdat. If C<ffld> is not given, C<ffld> will
  +be set to C<keys %fdat>.
  +
  +=head2 *PARAM $component / / ffld / 1.0.0 / no
  +
  +Pass a array reference to customly set @fdat. Does not affect C<%fdat>.
  +
  +=head2 *PARAM $component / / object / 1.3.2 / no
  +
  +Takes a filename and returns an hashref that is blessed into the package of 
  +the given file. That's usefull, if you want to call the subs inside the 
  +given file, as methods. By using the C<isa> parameter (see below) you
  +are able to provide an inherence tree. Additionaly you can use the returned
  +hashref to store data for that object. Example:
  +
  +  [# the file eposubs.htm defines two subs: txt1 and txt2 #]
  +  [# first we create a new object #]
  +  [- $subs = Execute ({'object' => 'eposubs.htm'}) -]
  +
  +  [# then we call methods inside the object #]
  +  txt1: [+ $subs -> txt1 +] <br>
  +
  +  txt2: [+ $subs -> txt2 +] <br>
  +
  +
  +=head2 *PARAM $component / / isa / 1.3.2 / no
  +
  +Takes a name of a file and pushes the package of that file into the @ISA
  +array of the current file. By using this you can setup an inherence tree
  +between Embperl documents. Is is also usefull within I<Embperl::Object>.
  +Example:
  +
  +    [! Execute ({'isa' => '../eposubs.htm'}) !]
  +
  +=head2 *PARAM $component / / errors / 1.3.0 / no
  +
  +Takes a reference to an array. Upon return, the array will contain a copy of
  +all errormessages, if any.
  +
  +=head2 *PARAM $component / / xsltparam  / 2.0b6 / yes,  before the xslt 
transformation / %fdat
  +
  +Takes a reference to hash which contains key/value pair that are accessable inside
  +the stylesheet via <xsl:param>.
  +
  +
  +
  +=head1 Embperl's Objects
  +
  +There are three major objects in Embperl: I<application>, I<request> and 
I<component>.
  +Each of these objects can be used to get information about the processing and
  +control the execution. Each of these objects has a config sub-object, which makes
  +the configuration accessable and where possible changeable at runtime. The C<config>
  +method of these three objects returns a reference to the configuation object. The 
methods
  +of these configurations objects are decribed in the section L<Configuration>.
  +The request and the component object have addtionaly a parameter sub-object, which 
holds
  +parameters passed to the current request/component. The C<param> method of these two
  +objects returns the parameter sub-object. The methods of these parameter objects
  +can be found in the section L<Parameters>.
  +Addtionaly each of the three major objects has a set of own methods, which are 
described
  +here.
  +
  +
  +=head2 *METHOD $application / / thread / 2.0b6 / no
  +
  +=head2 *METHOD $application / / curr_req / 2.0b6 / no
  +
  +=head2 *METHOD $application / / config / 2.0b6 / no
  +
  +=head2 *METHOD $application / / user_session / 2.0b6 / no
  +
  +=head2 *METHOD $application / / state_session / 2.0b6 / no
  +
  +=head2 *METHOD $application / / app_session / 2.0b6 / no
  +
  +=head2 *METHOD $application / / udat / 2.0b6 / no
  +
  +=head2 *METHOD $application / / sdat / 2.0b6 / no
  +
  +=head2 *METHOD $application / / mdat / 2.0b6 / no
  +
  +=head2 *METHOD $application / / debug / 2.0b6 / yes
  +
  +=head2 *METHOD $application / / errors_count / 2.0b6 / yes
  +
  +=head2 *METHOD $application / / errors_last_time / 2.0b6 / yes 
  +
  +=head2 *METHOD $application / / errors_last_send_time / 2.0b6 / yes
  +
   
   
  - * Request parameter
  +=head2 *METHOD $request / / errors_last_send_time / 2.0b6 / yes
   
  -   filename
  -   unparsed_uri
  -   uri
  -   path_info
  -   query_info
  -   language
  -   cookies
  -
  -
  - * Component Parameter
  -
  -   inputfile
  -   outputfile
  -   input
  -   output
  -   sub
  -   import
  -   firstline
  -   mtime
  -   param
  -   fdat
  -   ffld
  -   object
  -   isa
  -   errors
  -   xsltparam 
   
  +apache_req
  +config
  +param
  +component
  +app
  +thread
  +request_count
  +request_time
  +session_mgnt ???
  +session_id
  +session_state_id
  +session_user_id
  +had_exit
  +log_file_start_pos
  +error
  +errors
  +errdat1
  +errdat2
  +lastwarn
  +cleanup_vars
  +cleanup_packages
  +initial_cwd
  +messages
  +default_messages
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.24.4.70 +14 -6     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.69
  retrieving revision 1.24.4.70
  diff -u -r1.24.4.69 -r1.24.4.70
  --- httpd.conf.src    25 Jun 2002 06:22:18 -0000      1.24.4.69
  +++ httpd.conf.src    30 Jul 2002 05:15:10 -0000      1.24.4.70
  @@ -39,7 +39,7 @@
   print OFH "$EPMODPERL\n" ;
   
   print OFH "LoadModule embperl_module 
\"$EPPATH/blib/arch/auto/Embperl/Embperl.so\"\n" if ($MP2) ;
  -
  +print OFH "LoadModule dav_module \"$EPAPACHESRC/modules/mod_dav.dll\"\n"  ;
   ##print OFH "LoadModule info_module 
\"/usr/src/packages/apache_1.3.24_mp561_so/src/modules/standard/mod_info.so\"\n"  ;
   
   print OFH "PassEnv ACTION_PREFIX\n" ;
  @@ -555,6 +555,7 @@
   
   </Location>
   
  +
   <Location /eg/web>
   EMBPERL_APPNAME EmbperlWeb
   EMBPERL_OPTIONS 16
  @@ -574,6 +575,8 @@
   EMBPERL_RECIPE EmbperlLibXSLT
   EMBPERL_XSLTSTYLESHEET \"$EPPATH/eg/web/conf/pod.xsl\"
   EMBPERL_SYNTAX POD
  +EMBPERL_URIMATCH \"\\.htm.?\$|\\.epl\$|\\.xml\$|\\.pod\$|/$\"
  +EMBPERL_PATH \"$EPPATH/eg/web/conf;$EPPATH/eg/web\"
   sethandler perl-script
   perlhandler Embperl
   </Location>
  @@ -587,10 +590,6 @@
   EMBPERL_RECIPE XSLT
   </Location>
   
  -<Files NEWS.xml>
  -EMBPERL_XSLTSTYLESHEET \"$EPPATH/eg/xml/NEWS.xsl\"
  -</Files>
  -
   
   <Location /eg/images/aim>
   
  @@ -619,6 +618,15 @@
   ApJServSecretKey DISABLED
   ApJServLogFile /dev/null
   </IfModule>
  +
  +<IfModule mod_dav.c>
  +DavLockDB tmp/DAVLockDB
  +<Location /dav>
  +DAV on
  +</Location>
  +
  +</IfModule>
  +
   
   EOD
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.29  +3 -1      embperl/xsbuilder/maps/Attic/ep_structure.map
  
  Index: ep_structure.map
  ===================================================================
  RCS file: /home/cvs/embperl/xsbuilder/maps/Attic/ep_structure.map,v
  retrieving revision 1.1.2.28
  retrieving revision 1.1.2.29
  diff -u -r1.1.2.28 -r1.1.2.29
  --- ep_structure.map  1 Jun 2002 23:44:26 -0000       1.1.2.28
  +++ ep_structure.map  30 Jul 2002 05:15:10 -0000      1.1.2.29
  @@ -184,6 +184,7 @@
      pExpiredFunc | expires_func
      pCacheKeyFunc | cache_key_func
      nExpiresIn | expires_in
  +   sExpiresFilename | expires_filename
      sSyntax | syntax
      pRecipe | recipe
      sXsltstylesheet | xsltstylesheet
  @@ -199,7 +200,8 @@
    <tComponentParam>
   !   _perlsv
      sInputfile   | inputfile
  -   sOutputfile  | outputfile
  +   sOutputfile  | outputfile
  +
      sSubreq      | subreq
      pInput       | input
      pOutput      | output
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to