Navigation Menu

Skip to content

Commit

Permalink
Item14239: upgrade to fop-2.1
Browse files Browse the repository at this point in the history
- added bogus bin/fop to run it from the cmdline as well as under cgi
  • Loading branch information
MichaelDaum committed Nov 30, 2016
1 parent 4c456c9 commit c920ea7
Show file tree
Hide file tree
Showing 61 changed files with 4,877 additions and 41 deletions.
53 changes: 53 additions & 0 deletions bin/fop
@@ -0,0 +1,53 @@
#! /usr/bin/env perl
# See bottom of file for license and copyright information
use strict;
use warnings;

use File::Spec;

BEGIN {
if ( defined $ENV{GATEWAY_INTERFACE} || defined $ENV{MOD_PERL} ) {
$Foswiki::cfg{Engine} = 'Foswiki::Engine::CGI';
use CGI::Carp qw(fatalsToBrowser);
$SIG{__DIE__} = \&CGI::Carp::confess;
}
else {
$Foswiki::cfg{Engine} = 'Foswiki::Engine::CLI';
require Carp;
$SIG{__DIE__} = \&Carp::confess;
}
my ( $volume, $binDir, $action ) = File::Spec->splitpath(__FILE__);
my $setlib = File::Spec->catpath( $volume, $binDir, 'setlib.cfg' );
@INC = ( '.', grep { $_ ne '.' } @INC ) unless $binDir;
require $setlib;
$ENV{FOSWIKI_ACTION} = 'fop';
}

use Foswiki ();
use Foswiki::UI ();
$Foswiki::engine->run();
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Copyright (C) 2008-2010 Foswiki Contributors. Foswiki Contributors
are listed in the AUTHORS file in the root of this distribution.
NOTE: Please extend that file, not this notice.
Additional copyrights apply to some or all of the code in this
file as follows:
Copyright (C) 1999-2007 Peter Thoeny, peter@thoeny.org
and TWiki Contributors. All Rights Reserved. TWiki Contributors
are listed in the AUTHORS file in the root of this distribution.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. For
more details read LICENSE in the root of this distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
As per the GPL, removal of this notice is prohibited.
34 changes: 19 additions & 15 deletions data/System/XslFoContrib.txt
@@ -1,6 +1,6 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1409331028" format="1.1" version="1"}%
---+!! %TOPIC%
%SHORTDESCRIPTION%
%FORMFIELD{"Description"}%

%TOC%

Expand Down Expand Up @@ -145,19 +145,23 @@ The fop renderer itself is triggered by calling the =fop= service which then wil

%$INSTALL_INSTRUCTIONS%

---++ Info
<!--
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION%
-->

| Author(s): | Michael Daum|
| Copyright: | &copy; 2013-2014 Michael Daum http://michaeldaumconsulting.com |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
---++ Dependencies
%$DEPENDENCIES%

---++ Change History
%TABLE{columnwidths="7em" tablewidth="100%"}%
| 30 Nov 2016: | bundling latest fop-2.1; fixed encoding of content returned inline |
| 02 Jul 2013: | fixed url rewrite rules to use the current url host instead of the default url host |
| 24 Jun 2013: | initial release |
| Dependencies: | %$DEPENDENCIES% |
| Home page: | Foswiki:Extensions/%TOPIC% |
| Support: | Foswiki:Support/%TOPIC% |


%META:FORM{name="PackageForm"}%
%META:FIELD{name="Author" title="Author" value="Michael Daum"}%
%META:FIELD{name="Copyright" title="Copyright" value="&copy; 2013-2016 Michael Daum http://michaeldaumconsulting.com"}%
%META:FIELD{name="Description" title="Description" value="%25$SHORTDESCRIPTION%25"}%
%META:FIELD{name="Home" title="Home" value="Foswiki:Extensions/%TOPIC%"}%
%META:FIELD{name="License" title="License" value="[[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]]"}%
%META:FIELD{name="Release" title="Release" value="%$RELEASE%"}%
%META:FIELD{name="Repository" title="Repository" value="https://github.com/foswiki/%TOPIC%"}%
%META:FIELD{name="Support" title="Support" value="Foswiki:Support/%TOPIC%"}%
%META:FIELD{name="Version" title="Version" value="%$VERSION%"}%
11 changes: 7 additions & 4 deletions lib/Foswiki/Contrib/XslFoContrib.pm
Expand Up @@ -4,8 +4,8 @@ package Foswiki::Contrib::XslFoContrib;
use strict;
use warnings;

our $VERSION = '1.02';
our $RELEASE = '1.02';
our $VERSION = '1.10';
our $RELEASE = '30 Nov 2016';
our $SHORTDESCRIPTION = 'FOP print formatter';

use Foswiki ();
Expand Down Expand Up @@ -177,7 +177,10 @@ sub fop {
-type => $mimeType,
-content_disposition => "inline; filename=\"$fileName\"",
);
$response->print($stdout);
$response->body($stdout);
# SMELL: prevent compression
$ENV{'HTTP_ACCEPT_ENCODING'} = '';
$ENV{'HTTP2'} = '';
}

return;
Expand Down Expand Up @@ -250,7 +253,7 @@ sub toFileUrl {
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Copyright (C) 2013-2014 Michael Daum http://michaeldaumconsulting.com
Copyright (C) 2013-2016 Michael Daum http://michaeldaumconsulting.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Expand Down
55 changes: 49 additions & 6 deletions lib/Foswiki/Contrib/XslFoContrib/MANIFEST
@@ -1,17 +1,60 @@
bin/fop 0755
data/System/XslFoContrib.txt 0644
lib/Foswiki/Contrib/XslFoContrib/Config.spec 0644
lib/Foswiki/Contrib/XslFoContrib/DEPENDENCIES 0644
lib/Foswiki/Contrib/XslFoContrib.pm 0644
tools/fop/build/fop-hyph.jar 0755
tools/fop/build/fop.jar 0755
tools/fop/conf/fop.conf 0755
tools/fop/conf/fop.xconf 0755
tools/fop/fop 0755
tools/fop/fop.bat 0755
tools/fop/lib/avalon-framework-4.2.0.jar 0755
tools/fop/lib/batik-all-1.7.jar 0755
tools/fop/fop.cmd 0755
tools/fop/fop.js 0755
tools/fop/KEYS 0755
tools/fop/lib/avalon-framework-api-4.3.1.jar 0755
tools/fop/lib/avalon-framework-impl-4.3.1.jar 0755
tools/fop/lib/avalon-framework.LICENSE.txt 0755
tools/fop/lib/avalon-framework.NOTICE.TXT 0755
tools/fop/lib/batik-all-1.8.jar 0755
tools/fop/lib/batik.LICENSE.txt 0755
tools/fop/lib/batik.NOTICE.txt 0755
tools/fop/lib/commons-io-1.3.1.jar 0755
tools/fop/lib/commons-io.LICENSE.txt 0755
tools/fop/lib/commons-io.NOTICE.txt 0755
tools/fop/lib/commons-logging-1.0.4.jar 0755
tools/fop/lib/commons-logging.LICENSE.txt 0755
tools/fop/lib/commons-logging.NOTICE.txt 0755
tools/fop/lib/fontbox-1.8.5.jar 0755
tools/fop/lib/README.txt 0755
tools/fop/lib/serializer-2.7.0.jar 0755
tools/fop/lib/xalan-2.7.0.jar 0755
tools/fop/lib/xercesImpl-2.7.1.jar 0755
tools/fop/lib/serializer.LICENSE.txt 0755
tools/fop/lib/serializer.NOTICE.txt 0755
tools/fop/lib/xalan-2.7.2.jar 0755
tools/fop/lib/xalan.BCEL.LICENSE.txt 0755
tools/fop/lib/xalan.LICENSE.txt 0755
tools/fop/lib/xalan.NOTICE.txt 0755
tools/fop/lib/xalan.regexp.LICENSE.txt 0755
tools/fop/lib/xalan.runtime.LICENSE.txt 0755
tools/fop/lib/xercesImpl-2.9.1.jar 0755
tools/fop/lib/xercesImpl.LICENSE.txt 0755
tools/fop/lib/xercesImpl.NOTICE.txt 0755
tools/fop/lib/xerces.LICENSE.txt 0755
tools/fop/lib/xml-apis-1.3.04.jar 0755
tools/fop/lib/xml-apis-ext-1.3.04.jar 0755
tools/fop/lib/xmlgraphics-commons-1.5.jar 0755
tools/fop/lib/xml-apis-ext.LICENSE.dom-documentation.txt 0755
tools/fop/lib/xml-apis-ext.LICENSE.dom-software.txt 0755
tools/fop/lib/xml-apis-ext.LICENSE.sac.html 0755
tools/fop/lib/xml-apis-ext.LICENSE.txt 0755
tools/fop/lib/xml-apis-ext.NOTICE.txt 0755
tools/fop/lib/xml-apis-ext.README.dom.txt 0755
tools/fop/lib/xml-apis.LICENSE.DOM-documentation.html 0755
tools/fop/lib/xml-apis.LICENSE.DOM-software.html 0755
tools/fop/lib/xml-apis.LICENSE-SAX.html 0755
tools/fop/lib/xml-apis.LICENSE.txt 0755
tools/fop/lib/xml-apis.NOTICE.txt 0755
tools/fop/lib/xmlgraphics-commons-2.1.jar 0755
tools/fop/lib/xmlgraphics-commons.LICENSE.txt 0755
tools/fop/lib/xmlgraphics-commons.NOTICE.txt 0755
tools/fop/LICENSE 0755
tools/fop/NOTICE 0755
tools/fop/README 0755
2 changes: 1 addition & 1 deletion lib/Foswiki/Contrib/XslFoContrib/build.pl
@@ -1,4 +1,4 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl

use strict;
use warnings;
Expand Down

0 comments on commit c920ea7

Please sign in to comment.