Date: Sunday May 19, 2002 @ 18:15
Author: matt
Update of /home/cvs/AxKit-Provider-OpenOffice
In directory ted.sergeant.org:/home/matt/Perl/AxKit-Provider-OpenOffice
Modified Files:
OpenOffice.pm
Log Message:
More fixes and back-compat
Index: OpenOffice.pm
===================================================================
RCS file: /home/cvs/AxKit-Provider-OpenOffice/OpenOffice.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -u -r1.4 -r1.5
--- OpenOffice.pm 2002/05/19 17:07:13 1.4
+++ OpenOffice.pm 2002/05/19 17:15:34 1.5
@@ -30,7 +30,7 @@
if ($zip->read($self->{file}) != AZ_OK) {
return $self->SUPER::get_fh;
}
- my $member = $zip->memberNamed('content.xml');
+ my $member = $zip->memberNamed('content.xml') || $zip->memberNamed('Content.xml');
my $fh = IO::File->new_tmpfile;
$member->extractToFileHandle($fh);
seek($fh, 0, 0);
@@ -43,7 +43,7 @@
if ($zip->read($self->{file}) != AZ_OK) {
return $self->SUPER::get_strref;
}
- my $member = $zip->memberNamed('content.xml');
+ my $member = $zip->memberNamed('content.xml') || $zip->memberNamed('Content.xml');
my ($data, $status) = $member->contents();
if ($status != AZ_OK) {
throw Apache::AxKit::Exception::Error(
@@ -52,6 +52,26 @@
}
return \$data;
}
+
+sub process {
+ my $self = shift;
+
+ my $xmlfile = $self->key;
+
+ unless ($self->exists()) {
+ AxKit::Debug(5, "file '$xmlfile' does not exist or is not readable");
+ return 0;
+ }
+
+ if ( $self->_is_dir ) {
+ # else
+ AxKit::Debug(5, "'$xmlfile' is a directory");
+ return 0;
+ }
+
+ return 1;
+}
+
1;
__END__
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]