List Info

Thread: OpenDocument::OODoc




OpenDocument::OODoc
user name
2007-04-17 11:52:35
I attempting to create a template that will generate Open
Document format
files using OpenDocument::OODoc; I'm getting the following
error:

Undefined subroutine &XML::Twig::isa called at
/usr/local/share/perl/5.8.8/XML/Twig.pm line 1356.

Stack:
  [/usr/local/share/perl/5.8.8/XML/Twig.pm:1356]
  [/usr/local/share/perl/5.8.8/XML/Twig.pm:444]
 
[/usr/local/share/perl/5.8.8/OpenOffice/OODoc/XPath.pm:391]
 
[/usr/local/share/perl/5.8.8/OpenOffice/OODoc/Text.pm:152]
 
[/usr/local/share/perl/5.8.8/OpenOffice/OODoc/Document.pm:37
]
  [/usr/local/bricolage/data/burn/comp/oc_1026/story.mc:7]
  [/usr/local/share/perl/5.8.8/HTML/Mason/Component.pm:135]

I am able to run a similar script with the same perl from
the command line
with no problem. My guess is there is something in the
Bricolage/Apache
environment causing this not to work.

My template looks like this:

<%perl>
use OpenOffice::OODoc;

$OpenOffice::OODoc::File::WORKING_DIRECTORY = '/tmp';

my $path = "/tmp/OO_$$.odt";
my $d = OpenOffice::OODoc:ocument-
>new( file => $path, create => 'text' );
$d->save;

$d->appendHeading( text => $story->get_title, level
=> 1, style =>
'Heading 1' );
$d->appendHeading( text =>
$element->get_value('deck'), level => 2,
style => 'Subtitle' );
$d->save;

for my $e ($element->get_elements) {
    if ($e->has_name('paragraph')) {
        $d->appendParagraph( text => $e->get_value,
style => 'Text body' );
    }
}
$d->save;

open FOO, $path;
do{ local $/; $m->out( <FOO> ); };
close FOO;
unlink $path;
</%perl>


Does anyone have any suggestions for fixing this? Thanks in
advance.

-- 
http://glassbrian.com
http://cooking.glassbri
an.com
Re: OpenDocument::OODoc
user name
2007-04-17 14:21:02
On Apr 17, 2007, at 09:52, Brian Glass wrote:

> I attempting to create a template that will generate
Open Document  
> format
> files using OpenDocument::OODoc; I'm getting the
following error:
>
> Undefined subroutine &XML::Twig::isa called at
> /usr/local/share/perl/5.8.8/XML/Twig.pm line 1356.

Probably something has horked isa. Try installing
UNIVERSAL::isa from  
CPAN, load it in the PERL_LOADER bricolage.conf directive,
and see if  
it helps any.

That's my best guess.

Best,

David

Re: OpenDocument::OODoc
user name
2007-04-18 03:18:00
On Tue, 17 Apr 2007, David E. Wheeler wrote:
> On Apr 17, 2007, at 09:52, Brian Glass wrote:
>> I attempting to create a template that will
generate Open Document format
>> files using OpenDocument::OODoc; I'm getting the
following error:
>> 
>> Undefined subroutine &XML::Twig::isa called at
>> /usr/local/share/perl/5.8.8/XML/Twig.pm line 1356.
>
> Probably something has horked isa.

Line 27 of XML::Twig is:

*isa = &UNIVERSAL::isa;

Re: OpenDocument::OODoc
user name
2007-04-18 12:23:33
On Apr 18, 2007, at 01:18, Scott Lanning wrote:

> Line 27 of XML::Twig is:
>
> *isa = &UNIVERSAL::isa;

WTF? There's no reason for that!

Best,

David

Re: OpenDocument::OODoc
user name
2007-04-18 14:17:30
Incidentally, I got this working. I made the changes David
suggested, though
they didn't seem to solve the problem. I applied the patch
mentioned in
another thread for bug 1227 and that seems to solve the
problem. Maybe I
forgot to restart the server or something. I don't know.

Anyway, Now that I have this working I'm finding that the
output of this
template is getting corrupted somehow. I looked at the temp
file it creates
and compared it with the output from Bricolage and they are
not the same
size. I diffed the files and it doesn't seem to be caused by
extra white
space at the beginning of the file as I would have expected,
but by
characters in the file that have been modified, perhaps
"escaped" in some
way.

Is there some setting I can change somewhere that will turn
this off? Is
there a binary mode or something?

BTW, I just started using Bricolage a month ago or so and am
really
impressed not only with the software, but the community.
David, you do an
amazing amount of excellent support with never a complaint
and you're never
rude. That's almost unheard of in OS communities. Bravo.

-- 
http://glassbrian.com
http://cooking.glassbri
an.com
Re: OpenDocument::OODoc
user name
2007-04-18 14:45:40
Hi Brian.

When we make PDFs with Bricolage, we always put this in the
autohandler 
for our PDF output channel:

	$burner->set_encoding('raw');

I'm afraid I don't know anything about OpenDocument, but
maybe it'll help.


All the best,

Bret


Brian Glass wrote:
> Incidentally, I got this working. I made the changes
David suggested, 
> though
> they didn't seem to solve the problem. I applied the
patch mentioned in
> another thread for bug 1227 and that seems to solve the
problem. Maybe I
> forgot to restart the server or something. I don't
know.
> 
> Anyway, Now that I have this working I'm finding that
the output of this
> template is getting corrupted somehow. I looked at the
temp file it creates
> and compared it with the output from Bricolage and they
are not the same
> size. I diffed the files and it doesn't seem to be
caused by extra white
> space at the beginning of the file as I would have
expected, but by
> characters in the file that have been modified, perhaps
"escaped" in some
> way.
> 
> Is there some setting I can change somewhere that will
turn this off? Is
> there a binary mode or something?
> 
> BTW, I just started using Bricolage a month ago or so
and am really
> impressed not only with the software, but the
community. David, you do an
> amazing amount of excellent support with never a
complaint and you're never
> rude. That's almost unheard of in OS communities.
Bravo.
> 


-- 
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bretpectopah.com
www.pectopah.com

Re: OpenDocument::OODoc
user name
2007-04-18 14:53:25
On 4/18/07, Bret Dawson <bretpectopah.com> wrote:
>
> Hi Brian.
>
> When we make PDFs with Bricolage, we always put this in
the autohandler
> for our PDF output channel:
>
>         $burner->set_encoding('raw');
>
> I'm afraid I don't know anything about OpenDocument,
but maybe it'll help.
>

Thanks. That did the trick.

-- 
http://glassbrian.com
http://cooking.glassbri
an.com
[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )