[index] [prev] [next] [options] [help]

eprints_tech messages

Re: [EP-tech] .docx Export

From: John Salter via Eprints-tech <eprints-tech AT ecs.soton.ac.uk>
Date: Thu, 16 Jul 2020 16:25:18 +0000

Threading: Re: [EP-tech] .docx Export from eprints-tech AT ecs.soton.ac.uk
      • This Message

Hi Dennis,
I think what's getting returned currently isn't any form of OODoc - it's a text 
file with an odt extension - which when opened defaults to OpenOffice and looks 
like an ODF document.
Changing the filename at the end of the exportview URL supports this e.g.:

Looking at the OODoc->save method:
there is some logic to handle a few different situations.

Possibly something like:
my $tmp;
open(my $TMP,'>',\$tmp);
$container->save( $TMP );
return $tmp;

would work?
I don't have a way to test this right now - if that doesn't help, I'll take a 
look over the weekend!


-----Original Message-----
From: Dennis Müller [mailto:dennis.mueller AT bib.uni-mannheim.de] 
Sent: 16 July 2020 10:38
To: John Salter <J.Salter AT leeds.ac.uk>; eprints-tech AT 
Subject: Re: [EP-tech] .docx Export

Dear John,

thanks again for assisting. I played around with ideas from the links
you provided and the ooffice documentation, but it seems I misunderstood
something fundamentally. Please see my simplified testing code attached.

As previously mentioned, the file saved on the server under $output
looks correct; I just can't get it handed over to the browser.

The export is called via the cgi/exportview url:
<form method="get" accept-charset="utf-8"

These are the called urls I see in the Firefox console:

Many thanks and best regards

Am 14.07.20 um 18:50 schrieb John Salter:
> Hi Dennis,
> Glad you made this work - hopefully the last part isn't too difficult to 
sort out!
> How are you calling the Export? Is it via the normal /cgi/export url, or 
another means?
> Have you got a 'mimetype' and a 'suffix' parameter set in your export 
> Does the 'MultilineExcel' export plugin provide a useful example?
> - Setting up either the supplied filehandle, or a filehandle to a 
> - returning - either undef (if a filehandle was supplied) - or the 
> If that doesn't help, let me know and I'll do some more thinking!
> Cheers,
> John
> -----Original Message-----
> From: eprints-tech-bounces AT ecs.soton.ac.uk [mailto:eprints-tech-bounces 
AT ecs.soton.ac.uk] On Behalf Of Dennis Müller via Eprints-tech
> Sent: 14 July 2020 16:49
> To: John Salter <J.Salter AT leeds.ac.uk>; eprints-tech AT 
> Subject: Re: [EP-tech] .docx Export
> Hi John,
> thanks for your quick answer. With your help, I could more or less do
> what I want with the document saving it to some path on the server.
> However, I'm struggling to find out how to return the actual document in
> my export plugin's "output_list" subroutine. Returning $oodoc or 
> file path doesn't work, obviously. Can you help me out once more, please?
> Cheers,
> Dennis
> Am 10.07.20 um 15:33 schrieb John Salter:
>> Hi Dennis,
>> I think you should be able to achieve this.
>> It's similar to the way the OpenOffice / Coversheets works.
>> That's normally configured to export as a PDF, but it first takes an 
OpenOffice document (your branded template), and replaces tags (like 
'##TITLE##') with rendered content.
>> These are the tags:
>> and this adds them to the OpenOffice document:
>> Does that help?
>> There are probably other ways - possibly other perl modules that would 
allow a more direct approach - but the above stuff seems to work OK.
>> I'm using it with LibreOffice rather than OpenOffice if that's useful 
to know too.
>> Cheers,
>> John
>> -----Original Message-----
>> From: eprints-tech-bounces AT ecs.soton.ac.uk 
[mailto:eprints-tech-bounces AT ecs.soton.ac.uk] On Behalf Of Dennis Müller 
via Eprints-tech
>> Sent: 10 July 2020 14:15
>> To: eprints-tech AT ecs.soton.ac.uk
>> Subject: [EP-tech] .docx Export
>> Hi everyone,
>> we've had a user request for exporting views/searches as a .docx file
>> styled in our corporate design. Has anyone ever done something 
>> Just for the file format, it might work to "wrap" a simple 
text export
>> in an exporter that has a
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" mimetype,
>> but I don't see where I could slip in the design template along the 
>> I'd be glad to hear from your experiences. :)
>> Best regards
>> Dennis

Dennis Müller, B.A.

Universität Mannheim
Digitale Bibliotheksdienste | Schloss Schneckenhof West | 68131 Mannheim

Tel: +49 621 181-3023
E-Mail: dennis.mueller AT bib.uni-mannheim.de


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/

[index] [prev] [next] [options] [help]