[Catalyst-commits] r8657 - in trunk/Catalyst-View-XSLT: . lib/Catalyst/Helper/View lib/Catalyst/View lib/Catalyst/View/XSLT/XML

janus at dev.catalyst.perl.org janus at dev.catalyst.perl.org
Tue Nov 25 23:51:01 GMT 2008


Author: janus
Date: 2008-11-25 23:51:00 +0000 (Tue, 25 Nov 2008)
New Revision: 8657

Added:
   trunk/Catalyst-View-XSLT/MANIFEST
   trunk/Catalyst-View-XSLT/MANIFEST.SKIP
   trunk/Catalyst-View-XSLT/META.yml
   trunk/Catalyst-View-XSLT/Makefile.PL
   trunk/Catalyst-View-XSLT/README
Modified:
   trunk/Catalyst-View-XSLT/Changes
   trunk/Catalyst-View-XSLT/lib/Catalyst/Helper/View/XSLT.pm
   trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT.pm
   trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT/XML/LibXSLT.pm
Log:
add distribution related files, set release time in changes, bump version to 0.05 and add myself to the authors section

Modified: trunk/Catalyst-View-XSLT/Changes
===================================================================
--- trunk/Catalyst-View-XSLT/Changes	2008-11-25 22:38:13 UTC (rev 8656)
+++ trunk/Catalyst-View-XSLT/Changes	2008-11-25 23:51:00 UTC (rev 8657)
@@ -1,4 +1,4 @@
-0.05  
+0.05  Tue Nov 25 23:38:40 2008
         - POD enhancements
         - just utilize require and get rid of UNIVERSAL::require dependency
         - drop redundant $VERSIONs

Added: trunk/Catalyst-View-XSLT/MANIFEST
===================================================================
--- trunk/Catalyst-View-XSLT/MANIFEST	                        (rev 0)
+++ trunk/Catalyst-View-XSLT/MANIFEST	2008-11-25 23:51:00 UTC (rev 8657)
@@ -0,0 +1,24 @@
+Build.PL
+Changes
+lib/Catalyst/Helper/View/XSLT.pm
+lib/Catalyst/View/XSLT.pm
+lib/Catalyst/View/XSLT/XML/LibXSLT.pm
+MANIFEST			This list of files
+t/01use.t
+t/02pod.t
+t/03podcoverage.t
+t/04testParams.t
+t/05includepath.tt
+t/06noXsl.t
+t/07testRegisterFunction.t
+t/08testRender.t
+t/lib/TestApp.pm
+t/lib/TestApp/root/additional/testIncludePath.xsl
+t/lib/TestApp/root/testNoXSLT.xsl
+t/lib/TestApp/root/testParams.xsl
+t/lib/TestApp/root/testRegisterFunction.xsl
+t/lib/TestApp/root/testRender.xsl
+t/lib/TestApp/View/XSLT/XML/LibXSLT.pm
+Makefile.PL
+README
+META.yml

Added: trunk/Catalyst-View-XSLT/MANIFEST.SKIP
===================================================================
--- trunk/Catalyst-View-XSLT/MANIFEST.SKIP	                        (rev 0)
+++ trunk/Catalyst-View-XSLT/MANIFEST.SKIP	2008-11-25 23:51:00 UTC (rev 8657)
@@ -0,0 +1,39 @@
+# Avoid version control files.
+\bRCS\b
+\bCVS\b
+,v$
+\B\.svn\b
+\B\.cvsignore$
+
+# Avoid Makemaker generated and utility files.
+\bMakefile$
+\bblib
+\bMakeMaker-\d
+\bpm_to_blib$
+\bblibdirs$
+^MANIFEST\.SKIP$
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\bBuild.bat$
+\b_build
+
+# Avoid Devel::Cover generated files
+\bcover_db
+
+# Avoid temp and backup files.
+~$
+\.tmp$
+\.old$
+\.bak$
+\#$
+\.#
+\.rej$
+
+# Avoid OS-specific files/dirs
+#   Mac OSX metadata
+\B\.DS_Store
+#   Mac OSX SMB mount metadata files
+\B\._
+# Avoid archives of this distribution
+\bCatalyst-View-XSLT-[\d\.\_]+

Added: trunk/Catalyst-View-XSLT/META.yml
===================================================================
--- trunk/Catalyst-View-XSLT/META.yml	                        (rev 0)
+++ trunk/Catalyst-View-XSLT/META.yml	2008-11-25 23:51:00 UTC (rev 8657)
@@ -0,0 +1,30 @@
+---
+name: Catalyst-View-XSLT
+version: 0.04
+author:
+  - 'Simon Bertrang, E<lt>simon.bertrang at puzzworks.comE<gt>'
+abstract: XSLT View Class
+license: perl
+resources:
+  license: http://dev.perl.org/licenses/
+requires:
+  Catalyst: 5.7
+  Data::Dumper: 2
+  File::Spec: 3.1
+  Path::Class: 0.12
+  XML::LibXSLT: 1.52
+build_requires:
+  FindBin: 1.4
+  Test::More: 0.6
+provides:
+  Catalyst::Helper::View::XSLT:
+    file: lib/Catalyst/Helper/View/XSLT.pm
+  Catalyst::View::XSLT:
+    file: lib/Catalyst/View/XSLT.pm
+    version: 0.04
+  Catalyst::View::XSLT::XML::LibXSLT:
+    file: lib/Catalyst/View/XSLT/XML/LibXSLT.pm
+generated_by: Module::Build version 0.280801
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.2.html
+  version: 1.2

Added: trunk/Catalyst-View-XSLT/Makefile.PL
===================================================================
--- trunk/Catalyst-View-XSLT/Makefile.PL	                        (rev 0)
+++ trunk/Catalyst-View-XSLT/Makefile.PL	2008-11-25 23:51:00 UTC (rev 8657)
@@ -0,0 +1,31 @@
+# Note: this file was auto-generated by Module::Build::Compat version 0.2808_01
+    
+    unless (eval "use Module::Build::Compat 0.02; 1" ) {
+      print "This module requires Module::Build to install itself.\n";
+      
+      require ExtUtils::MakeMaker;
+      my $yn = ExtUtils::MakeMaker::prompt
+	('  Install Module::Build now from CPAN?', 'y');
+      
+      unless ($yn =~ /^y/i) {
+	die " *** Cannot install without Module::Build.  Exiting ...\n";
+      }
+      
+      require Cwd;
+      require File::Spec;
+      require CPAN;
+      
+      # Save this 'cause CPAN will chdir all over the place.
+      my $cwd = Cwd::cwd();
+      
+      CPAN::Shell->install('Module::Build::Compat');
+      CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
+	or die "Couldn't install Module::Build, giving up.\n";
+      
+      chdir $cwd or die "Cannot chdir() back to $cwd: $!";
+    }
+    eval "use Module::Build::Compat 0.02; 1" or die $@;
+    
+    Module::Build::Compat->run_build_pl(args => \@ARGV);
+    require Module::Build;
+    Module::Build::Compat->write_makefile(build_class => 'Module::Build');

Added: trunk/Catalyst-View-XSLT/README
===================================================================
--- trunk/Catalyst-View-XSLT/README	                        (rev 0)
+++ trunk/Catalyst-View-XSLT/README	2008-11-25 23:51:00 UTC (rev 8657)
@@ -0,0 +1,142 @@
+NAME
+    Catalyst::View::XSLT - XSLT View Class
+
+SYNOPSIS
+        # use the helper to create your view
+        myapp_create.pl view XSLT XSLT
+
+        # configure in lib/MyApp/View/XSLT.pm (can be done from a config file too)
+        package MyApp::View::XSLT;
+
+        use base 'Catalyst::View::XSLT';
+
+        __PACKAGE__->config(
+            # paths to the directories with templates
+            INCLUDE_PATH => [
+              MyApp->path_to( 'root', 'xslt' ),
+              MyApp->path_to( 'templates', 'xsl' ),
+            ],
+
+            # default template extension to use
+            # when you don't provide template name
+            TEMPLATE_EXTENSION => '.xsl',
+
+            # use this for debug purposes
+            # it will dump the the final (merged) config
+            DUMP_CONFIG => 1,
+
+            # XML::LibXSLT specific configuration 
+            LibXSLT => {
+                register_function => [
+                  {
+                    uri    => 'urn:catalyst',
+                    name   => 'add',
+                    subref => sub { return $_[0] + $_[1] },
+                  },
+                  {
+                    uri    => 'urn:foo',
+                    name   => 'Hello',
+                    subref => sub { return 'Hello, Catalyst\'s user.' },
+                  },
+                ],
+            },
+        );
+
+        # don't need nothing more
+
+        1;
+
+        # in your controller(s) :
+        sub someAction : Local {
+
+            # 'template' could be string or path to file
+            # see 'xml' for more info about string version 
+
+            # path to the template could be absolute
+            $c->stash->{template} = $c->config->{home} . 'root/some.xsl';
+
+            # or relative
+            $c->stash->{template} = 'some.xsl'; # this file will be searched in include paths
+
+            # or if you didn't provide any template name 
+            # then the last chance is 'someAction.xsl' ($c->action . $config->{TEMPLATE_EXTENSION})
+
+            # 'xml' could be string
+            $c->stash->{xml} =<<XML;
+    <root>
+      <level1>data</level>
+    </root>
+    XML
+            # or a relative path which will se searched in include paths
+            # $c->stash->{xml} = 'my.xml';
+
+            # or an absolute path 
+            # $c->stash->{xml} = '/some/where/around.xml';
+
+            # add more subrefs (these will predefine config ones if they overlap)
+            $c->stash->{additional_register_function} = [
+              {
+                uri => 'urn:catalyst',
+                name => 'doIt',
+                subref => sub { return $obj->method(@_) },
+              }
+            ];
+
+            # everything else in the stash will be used for parameters (<xsl:param name="param1" />)
+            $c->stash->{param1} = 'Param1 value';'
+            $c->stash->{param2} = 'Param2 value';
+        }
+
+        # Meanwhile, maybe in an 'end' action
+
+        $c->forward('MyApp::View::XSLT');
+
+        # to use your registered functions in some.xsl:
+        <xsl:stylesheet 
+          xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+          xmlns:catalyst="urn:catalyst"
+          xmlns:foo="urn:foo"
+          version="1.0">
+          ...
+          <xsl:value-of select="catalyst:add(4, 5)" />
+          <xsl:value-of select="foo:Hello()" />
+          <xsl:value-of select="catalyst:doIt($param1, 3)" />
+          ...
+        </xsl:stylesheet>
+
+DESCRIPTION
+    This is a "XSLT" view class for Catalyst. Your application should
+    defined a view class which is a subclass of this module. The easiest way
+    to achieve this is using the myapp_create.pl script (where myapp should
+    be replaced with whatever your application is called). This script is
+    created as part of the Catalyst setup.
+
+METHODS
+    new The constructor for the XSLT view. Reads the application config.
+
+    render
+        Renders the template specified via $template. The template
+        parameters are set to %$args if $args is a hashref, or "$c->stash"
+        otherwise.
+
+    process
+        Renders the template specified in "$c->stash->{template}" or
+        "$c->action". Calls "render" to perform actual rendering. Template
+        params are set up from the contents of "$c->stash". Output is stored
+        in "$c->response->body".
+
+NOTE
+    This version works only with XML::LibXSLT.
+
+SEE ALSO
+    Catalyst, Catalyst::Base, XML::LibXSLT
+
+AUTHORS
+    Martin Grigorov, <mcgregory {at} e-card {dot} bg>
+
+    Simon Bertrang, <simon.bertrang at puzzworks.com>
+
+COPYRIGHT
+    This program is free software, you can redistribute it and/or modify it
+    under the same terms as Perl itself.
+

Modified: trunk/Catalyst-View-XSLT/lib/Catalyst/Helper/View/XSLT.pm
===================================================================
--- trunk/Catalyst-View-XSLT/lib/Catalyst/Helper/View/XSLT.pm	2008-11-25 22:38:13 UTC (rev 8656)
+++ trunk/Catalyst-View-XSLT/lib/Catalyst/Helper/View/XSLT.pm	2008-11-25 23:51:00 UTC (rev 8657)
@@ -32,10 +32,12 @@
 L<Catalyst::Manual>, L<Catalyst::Test>, L<Catalyst::Request>,
 L<Catalyst::Response>, L<Catalyst::Helper>
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Martin Grigorov, C<mcgregory {at} e-card {dot} bg>
+Martin Grigorov, E<lt>mcgregory {at} e-card {dot} bgE<gt>
 
+Simon Bertrang, E<lt>simon.bertrang at puzzworks.comE<gt>
+
 =head1 LICENSE
 
 This library is free software . You can redistribute it and/or modify it under

Modified: trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT/XML/LibXSLT.pm
===================================================================
--- trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT/XML/LibXSLT.pm	2008-11-25 22:38:13 UTC (rev 8656)
+++ trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT/XML/LibXSLT.pm	2008-11-25 23:51:00 UTC (rev 8657)
@@ -115,10 +115,12 @@
 
 L<Catalyst>, L<Catalyst::Base>, L<XML::LibXSLT>
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Martin Grigorov, C<mcgregory {at} e-card {dot} bg>
+Martin Grigorov, E<lt>mcgregory {at} e-card {dot} bgE<gt>
 
+Simon Bertrang, E<lt>simon.bertrang at puzzworks.comE<gt>
+
 =head1 COPYRIGHT
 
 This program is free software, you can redistribute it and/or modify it

Modified: trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT.pm
===================================================================
--- trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT.pm	2008-11-25 22:38:13 UTC (rev 8656)
+++ trunk/Catalyst-View-XSLT/lib/Catalyst/View/XSLT.pm	2008-11-25 23:51:00 UTC (rev 8657)
@@ -7,7 +7,7 @@
 use Data::Dumper;
 use File::Spec;
 
-our $VERSION = '0.04';
+our $VERSION = '0.05';
 
 # check if this is a MS Windows 
 my $isMS = $^O eq 'MSWin32';
@@ -390,10 +390,12 @@
 
 L<Catalyst>, L<Catalyst::Base>, L<XML::LibXSLT>
 
-=head1 AUTHOR
+=head1 AUTHORS
 
-Martin Grigorov, C<mcgregory {at} e-card {dot} bg>
+Martin Grigorov, E<lt>mcgregory {at} e-card {dot} bgE<gt>
 
+Simon Bertrang, E<lt>simon.bertrang at puzzworks.comE<gt>
+
 =head1 COPYRIGHT
 
 This program is free software, you can redistribute it and/or modify it




More information about the Catalyst-commits mailing list