~ubuntu-branches/ubuntu/karmic/lire/karmic

« back to all changes in this revision

Viewing changes to all/lib/Lire/OutputFormats/XML.pm

  • Committer: Bazaar Package Importer
  • Author(s): Wolfgang Sourdeau
  • Date: 2005-04-25 23:10:41 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050425231041-8h3y0jyvmj0pe05o
Tags: 2:2.0.1-4
debian/control: build-depend an depend on libdbd-sqlite2-perl (>=
2:0.33-4) instead of libdbd-sqlite-perl.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package Lire::OutputFormats::XML;
 
2
 
 
3
use strict;
 
4
 
 
5
use base qw/Lire::OutputFormat/;
 
6
 
 
7
use Locale::TextDomain 'lire';
 
8
 
 
9
use File::Copy qw/copy/;
 
10
eval "use MIME::Entity";
 
11
 
 
12
=pod
 
13
 
 
14
=head1 NAME
 
15
 
 
16
Lire::OutputFormats::XML - XML output format.
 
17
 
 
18
=head1 SYNOPSIS
 
19
 
 
20
  my $format = Lire::PluginManager->get_plugin( 'output_format', 'xml' );
 
21
  $format->format_report( $xml_file, $xml_file );
 
22
 
 
23
=head1 DESCRIPTION
 
24
 
 
25
Lire::OutputFormat implementation which saves the report as LRML XML.
 
26
 
 
27
=cut
 
28
 
 
29
sub name {
 
30
    return 'xml';
 
31
}
 
32
 
 
33
sub title {
 
34
    return __( 'XML' );
 
35
}
 
36
 
 
37
sub description {
 
38
    return '<para>' . __( 'Native XML format. This keeps the report in Lire Report Markup Language.' ) . '</para>';
 
39
}
 
40
 
 
41
sub format_report {
 
42
    my ( $self, $report_file, $output_file ) = @_;
 
43
 
 
44
    copy( $report_file, $output_file );
 
45
 
 
46
    return;
 
47
}
 
48
 
 
49
sub mime_report {
 
50
    my ( $self, $report_file, $cfg ) = @_;
 
51
 
 
52
    return MIME::Entity->build( 'Type' => 'text/xml',
 
53
                                'Charset' => 'utf-8',
 
54
                                'Encoding' => 'quoted-printable',
 
55
                                'Path' => $report_file
 
56
                              );
 
57
}
 
58
 
 
59
1;
 
60
 
 
61
__END__
 
62
 
 
63
=pod
 
64
 
 
65
=head1 SEE ALSO
 
66
 
 
67
 Lire::PluginManager(3pm) Lire::OutputFormat(3pm)
 
68
 
 
69
=head1 AUTHOR
 
70
 
 
71
Francis J. Lacoste <flacoste@logreport.org>
 
72
 
 
73
=head1 VERSION
 
74
 
 
75
$Id: XML.pm,v 1.1 2004/08/28 03:41:08 flacoste Exp $
 
76
 
 
77
=head1 COPYRIGHT
 
78
 
 
79
Copyright (C) 2004 Stichting LogReport Foundation LogReport@LogReport.org
 
80
 
 
81
This file is part of Lire.
 
82
 
 
83
Lire is free software; you can redistribute it and/or modify
 
84
it under the terms of the GNU General Public License as published by
 
85
the Free Software Foundation; either version 2 of the License, or
 
86
(at your option) any later version.
 
87
 
 
88
This program is distributed in the hope that it will be useful,
 
89
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
90
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
91
GNU General Public License for more details.
 
92
 
 
93
You should have received a copy of the GNU General Public License
 
94
along with this program (see COPYING); if not, check with
 
95
http://www.gnu.org/copyleft/gpl.html or write to the Free Software
 
96
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
 
97
 
 
98
=cut
 
99