richter     01/11/16 05:15:18

  Modified:    .        Tag: Embperl2c README.v2 test.pl
               Embperl  Tag: Embperl2c Recipe.pm
  Log:
  Embperl 2 - fix path in test
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.4.19  +5 -1      embperl/Attic/README.v2
  
  Index: README.v2
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/README.v2,v
  retrieving revision 1.1.4.18
  retrieving revision 1.1.4.19
  diff -u -r1.1.4.18 -r1.1.4.19
  --- README.v2 2001/11/16 12:43:37     1.1.4.18
  +++ README.v2 2001/11/16 13:15:18     1.1.4.19
  @@ -9,13 +9,13 @@
   WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 
   MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   
  -$Id: README.v2,v 1.1.4.18 2001/11/16 12:43:37 richter Exp $
  +$Id: README.v2,v 1.1.4.19 2001/11/16 13:15:18 richter Exp $
   
   
   ### !! IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !! IMPORTANT !! 
   ###
   ###
  -### This is the third BETA release of Embperl 2.0, before installing
  +### This is the fours BETA release of Embperl 2.0, before installing
   ### please read the README.v2. Documentation is not yet updated to
   ### reflect the changes in 2.0, everything that has changed is
   ### documented in README.v2. Since the first and second beta I have fixed a lot
  @@ -216,6 +216,10 @@
   expires_in / EMBPERL_EXPIRES_IN / $EXPIRES
   
   Time in seconds that the output schould be cached. (0 = never, -1 = forever)
  +
  +expires_in / EMBPERL_EXPIRES_FILENAME / $EXPIRES_FILENAME
  +
  +Expires when the given file has changed
   
   
   Syntax switching
  
  
  
  1.70.4.95 +10 -10    embperl/test.pl
  
  Index: test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test.pl,v
  retrieving revision 1.70.4.94
  retrieving revision 1.70.4.95
  diff -u -r1.70.4.94 -r1.70.4.95
  --- test.pl   2001/11/16 11:55:32     1.70.4.94
  +++ test.pl   2001/11/16 13:15:18     1.70.4.95
  @@ -11,7 +11,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: test.pl,v 1.70.4.94 2001/11/16 11:55:32 richter Exp $
  +#   $Id: test.pl,v 1.70.4.95 2001/11/16 13:15:18 richter Exp $
   #
   ###################################################################################
   
  @@ -733,7 +733,7 @@
       'xml/pod.xml' => { 
           'version'    => 2,
           'recipe'     => 'EmbperlLibXSLT',
  -        'xsltstylesheet'     => 'xml/pod.xsl',
  +        'xsltstylesheet'     => "$inpath/xml/pod.xsl",
           'offline'    => 1,
           'condition'  => '$LIBXSLTVERSION', 
           'msg'        => ' embperl -> libxslt',
  @@ -741,7 +741,7 @@
       'xml/pod.xml' => { 
           'version'    => 2,
           'recipe'     => 'EmbperlXalanXSLT',
  -        'xsltstylesheet'     => 'xml/pod.xsl',
  +        'xsltstylesheet'     => "$inpath/xml/pod.xsl",
           'offline'    => 1,
           'condition'  => '$XALANPATH', 
           'cmpext'     => '.xalan',
  @@ -750,7 +750,7 @@
       'xml/pod.xml' => { 
           'version'    => 2,
           'recipe'     => 'EmbperlXSLT',
  -        'xsltstylesheet'     => 'xml/pod.xsl',
  +        'xsltstylesheet'     => "$inpath/xml/pod.xsl",
           'xsltproc'   => 'libxslt',
           'offline'    => 1,
           'condition'  => '$LIBXSLTVERSION', 
  @@ -759,7 +759,7 @@
       'xml/pod.xml' => { 
           'version'    => 2,
           'recipe'     => 'EmbperlXSLT',
  -        'xsltstylesheet'     => 'xml/pod.xsl',
  +        'xsltstylesheet'     => "$inpath/xml/pod.xsl",
           'offline'    => 1,
           'xsltproc'   => 'xalan',
           'condition'  => '$XALANPATH', 
  @@ -769,7 +769,7 @@
       'xml/pod.xml' => { 
           'version'    => 2,
           'recipe'     => 'LibXSLT',
  -        'xsltstylesheet'     => 'xml/pod.xsl',
  +        'xsltstylesheet'     => "$inpath/xml/pod.xsl",
           'offline'    => 1,
           'condition'  => '$LIBXSLTVERSION', 
           'msg'        => ' libxslt',
  @@ -777,7 +777,7 @@
       'xml/pod.xml' => { 
           'version'    => 2,
           'recipe'     => 'XalanXSLT',
  -        'xsltstylesheet'     => 'xml/pod.xsl',
  +        'xsltstylesheet'     => "$inpath/xml/pod.xsl",
           'offline'    => 1,
           'condition'  => '$XALANPATH', 
           'cmpext'     => '.xalan',
  @@ -786,7 +786,7 @@
       'xml/pod.xml' => { 
           'version'    => 2,
           'recipe'     => 'XSLT',
  -        'xsltstylesheet'     => 'xml/pod.xsl',
  +        'xsltstylesheet'     => "$inpath/xml/pod.xsl",
           'xsltproc'   => 'libxslt',
           'offline'    => 1,
           'condition'  => '$LIBXSLTVERSION', 
  @@ -795,7 +795,7 @@
       'xml/pod.xml' => { 
           'version'    => 2,
           'recipe'     => 'XSLT',
  -        'xsltstylesheet'     => 'xml/pod.xsl',
  +        'xsltstylesheet'     => "$inpath/xml/pod.xsl",
           'offline'    => 1,
           'xsltproc'   => 'xalan',
           'condition'  => '$XALANPATH', 
  @@ -806,7 +806,7 @@
           'version'    => 2,
           'syntax'     => 'POD',
           'recipe'     => 'EmbperlLibXSLT',
  -        'xsltstylesheet'     => 'xml/pod.xsl',
  +        'xsltstylesheet'     => "$inpath/xml/pod.xsl",
           'cmpext'     => '.htm',
           'offline'    => 1,
           'msg'        => ' libxslt',
  @@ -816,7 +816,7 @@
           'version'    => 2,
           'syntax'     => 'POD',
           'recipe'     => 'EmbperlXalanXSLT',
  -        'xsltstylesheet'     => 'xml/pod.xsl',
  +        'xsltstylesheet'     => "$inpath/xml/pod.xsl",
           'cmpext'     => '.xalan.htm',
           'offline'    => 1,
           'msg'        => ' xalan',
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +354 -2    embperl/Embperl/Attic/Recipe.pm
  
  Index: Recipe.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Attic/Recipe.pm,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- Recipe.pm 2001/11/16 08:08:08     1.1.2.5
  +++ Recipe.pm 2001/11/16 13:15:18     1.1.2.6
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: Recipe.pm,v 1.1.2.5 2001/11/16 08:08:08 richter Exp $
  +#   $Id: Recipe.pm,v 1.1.2.6 2001/11/16 13:15:18 richter Exp $
   #
   ###################################################################################
    
  @@ -81,4 +81,356 @@
       }
   
   
  -1;
  \ No newline at end of file
  +1;
  +
  +
  +__END__        
  +
  +
  +=pod
  +
  +=head1 NAME
  +
  +Embperl base class for defining custom recipes
  +
  +=head1 SYNOPSIS
  +
  +PerlSetEnv EMBPERL_RECIPE "XSLT Embperl"
  +
  +=head1 DESCRIPTION
  +
  +HTML::Embperl::Recipe provides basic feature for createing your own recipes.
  +To do so you have to create a class that provides a new method which returns
  +a hash that provides the description what to do as hash.
  +
  +=head2 new ($class, $r, $recipe, $param)
  +
  +=over 4
  +
  +=item $class
  +
  +The class name
  +
  +=item $r
  +
  +The Embperl request record object (HTML::Embperl::Req), maybe a derived
  +object when running under EmbperlObject.
  +
  +=item $recipe
  +
  +The name of the recipe
  +
  +=item $param
  +
  +The parameters the user passed to Execute.
  +
  +=back
  +
  +The function must return a hash that describes the desired action.
  +The hash contains a tree structure of providers. 
  +
  +=head2 Providers
  +
  +=over 4
  +
  +
  +=item file
  +
  +read file data
  +
  +Parameter:
  +
  +=over 4
  +
  +=item filename
  +
  +Gives the file to read
  +
  +=back
  +
  +
  +=item memory
  +
  +get data from a scalar
  +
  +Parameter:
  +
  +=over 4
  +
  +=item source
  +
  +Gives the source as a scalar reference
  +
  +=item name
  +
  +Gives the name under which this item should be cache
  +
  +=back
  +
  +
  +=item epparse
  +
  +parse file into a Embperl tree structure
  +
  +Parameter:
  +
  +=over 4
  +
  +=item source
  +
  +Gives the source 
  +
  +=item syntax
  +
  +Syntax to use
  +
  +=back
  +
  +
  +=item epcompile
  +
  +compile Embperl tree structure
  +
  +Parameter:
  +
  +=over 4
  +
  +=item source
  +
  +Gives the source 
  +
  +=back
  +
  +
  +=item eprun
  +
  +execute Embperl tree structure
  +
  +Parameter:
  +
  +=over 4
  +
  +=item source
  +
  +Gives the source 
  +
  +=item cache_key
  +
  +See description of cacheing
  +
  +=item cache_key_options
  +
  +See description of cacheing
  +
  +=item cache_key_func
  +
  +See description of cacheing
  +
  +=back
  +
  +
  +=item eptostring
  +
  +convert Embperl tree structure to string
  +
  +Parameter:
  +
  +=over 4
  +
  +=item source
  +
  +Gives the source 
  +
  +=back
  +
  +
  +=item libxslt-parse-xml
  +
  +parse xml source for libxslt
  +
  +Parameter:
  +
  +=over 4
  +
  +=item source
  +
  +Gives the xml source 
  +
  +=back
  +
  +
  +=item libxslt-compile-xsl   
  +
  +parse and compile stylesheet for libxslt
  +
  +Parameter:
  +
  +=over 4
  +
  +=item stylesheet
  +
  +Gives the stylesheet source 
  +
  +=back
  +
  +
  +=item libxslt
  +
  +do a xsl transformation via libxslt
  +
  +Parameter:
  +
  +=over 4
  +
  +=item source
  +
  +Gives the parsed xml source 
  +
  +=item stylesheet
  +
  +Gives the compiled stylesheet source 
  +
  +=back
  +
  +
  +=item xalan-parse-xml
  +
  +parse xml source for xalan
  +
  +Parameter:
  +
  +=over 4
  +
  +=item source
  +
  +Gives the xml source 
  +
  +=back
  +
  +
  +
  +=item xalan-compile-xsl
  +
  +parse and compile stylesheet for xalan
  +
  +Parameter:
  +
  +=over 4
  +
  +=item stylesheet
  +
  +Gives the stylesheet source 
  +
  +=back
  +
  +
  +=item xalan
  +
  +do a xsl transformation via xalan
  +
  +Parameter:
  +
  +=over 4
  +
  +=item source
  +
  +Gives the parsed xml source 
  +
  +=item stylesheet
  +
  +Gives the compiled stylesheet source 
  +
  +=back
  +
  +
  +=back
  +
  +=head2 Cache parameter
  +
  +=over 4
  +
  +=item expires_in
  +
  +=item expires_func
  +
  +=item expires_filename
  +
  +=item cache
  +
  +=back
  +
  +
  +=head2 Format
  +
  +Heres an example that show how the hash must be build:
  +
  +  sub new
  +    {
  +    my ($class, $r, $recipe, $param) = @_ ;
  +
  +    my $self =
  +        {
  +        'provider' => 
  +            {
  +            'type' => 'xalan',
  +            'source' => 
  +                {
  +                'cache'    => 0,
  +                provider =>
  +                    {
  +                    'type'      =>  'xalan-parse-xml',
  +                    'source' =>
  +                        {
  +                       'cache' => 0,
  +                        provider => 
  +                            {
  +                            'type'      =>  'file',
  +                            'filename'  => $param -> {inputfile},
  +                            }
  +                        },
  +                    },
  +                },
  +            'stylesheet' => 
  +                {
  +                'cache'    => 1,
  +                provider =>
  +                    {
  +                    'type'      =>  'xalan-compile-xsl',
  +                    'stylesheet' =>
  +                        {
  +                        'cache'    => 0,
  +                        provider =>
  +                            {
  +                            'type'      =>  'file',
  +                            'filename'  => $param -> {xsltstylesheet},
  +                            }
  +                        },
  +                    },
  +                }
  +            }
  +        } ;
  +
  +    return $self ;
  +    }
  +
  +This corresponds to the following diagramm:
  +
  +
  +
  +    +-------------------+   +--------------------+           
  +    + file {inputfile}  +   +file{xsltstylesheet}+           
  +    +-------------------+   +--------------------+           
  +          |                         |                         
  +          v                         v                         
  +    +-------------------+   +-------------------+           
  +    + xalan-parse-xml   +   + xalan-compile-xsl +           
  +    +-------------------+   +-------------------+           
  +          |                         | 
  +          |                         |
  +          |         +-----------+   |
  +          +-------> + xalan     + <-+
  +                    +-----------+
  +
  +Take a look at the recipes that comes with Embperl to get more
  +ideas what can be done.
  +
  
  
  

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

Reply via email to