EPrints Technical Mailing List Archive

Message: #08254


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

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"
action="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmadoc-dev.bib.uni-mannheim.de%2Fcgi%2Fexportview&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2d6d4379623c4d6865e208d8296bfa9d%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=u30LWvCQ22RTorHGqVgYxW92lZY1GwlRtEp%2FsJXhea0%3D&amp;reserved=0";>

These are the called urls I see in the Firefox console:
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmadoc-dev.bib.uni-mannheim.de%2Fcgi%2Fexportview%3Fformat%3DOffice%26_action_export_redir%3DExportieren%26view%3Dpeople%26values%3DMueller%253D3ADennis%253D3A%253D3A&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2d6d4379623c4d6865e208d8296bfa9d%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=NMYYi9GIvkb0P7ublwdG24nfBqwKotej%2FmZ6f9PMgpE%3D&amp;reserved=0
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmadoc-dev.bib.uni-mannheim.de%2Fcgi%2Fexportview%2Fpeople%2FMueller%3D3ADennis%3D3A%3D3A%2FOffice%2FMueller%3D3ADennis%3D3A%3D3A.odt&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2d6d4379623c4d6865e208d8296bfa9d%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=6DgHa0bga18eiNUbrldTk8MWcydvm7DubMj8eGU4RDw%3D&amp;reserved=0

Many thanks and best regards
Dennis

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 plugin?
> 
> Does the 'MultilineExcel' export plugin provide a useful example?
> - Setting up either the supplied filehandle, or a filehandle to a variable:
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprintsug%2Fmultiline_excel%2Fblob%2Fmaster%2Flib%2Fplugins%2FEPrints%2FPlugin%2FExport%2FMultilineExcel.pm%23L44-L58&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2d6d4379623c4d6865e208d8296bfa9d%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=ydma%2F8tx2JqJv2gPvuJG5Dv7OgK8Yr6%2FobRHdR9aWRQ%3D&amp;reserved=0
> - returning - either undef (if a filehandle was supplied) - or the variable:
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprintsug%2Fmultiline_excel%2Fblob%2Fmaster%2Flib%2Fplugins%2FEPrints%2FPlugin%2FExport%2FMultilineExcel.pm%23L93-L98&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2d6d4379623c4d6865e208d8296bfa9d%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=EOfbNXjfI2%2BeHXKcNW6PA2VvFSzjL5H2sKvGd%2BhN7f4%3D&amp;reserved=0
> 
> If that doesn't help, let me know and I'll do some more thinking!
> 
> Cheers,
> John
> 
> -----Original Message-----
> From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Dennis Müller via Eprints-tech
> Sent: 14 July 2020 16:49
> To: John Salter <J.Salter@leeds.ac.uk>; eprints-tech@ecs.soton.ac.uk
> 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 the
> 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:
>> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprintsug%2Fcoversheets%2Fblob%2Fmaster%2Fcfg%2Fcfg.d%2Fz_coversheet_tags.pl&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2d6d4379623c4d6865e208d8296bfa9d%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=Lidhm9n1inJmREhjCw02m8HDSiTna4M9UDDybMhbf4s%3D&amp;reserved=0
>> and this adds them to the OpenOffice document:
>> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprintsug%2Fcoversheets%2Fblob%2Fmaster%2Flib%2Fplugins%2FEPrints%2FPlugin%2FConvert%2FAddCoversheet.pm%23L114-L127&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2d6d4379623c4d6865e208d8296bfa9d%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=FoxWeWA0rkxbfVadLISgQZTMbT4%2FInUPL7zmPK5nxQU%3D&amp;reserved=0 
>>
>> 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@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Dennis Müller via Eprints-tech
>> Sent: 10 July 2020 14:15
>> To: eprints-tech@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 similar?
>>
>> 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 way.
>>
>> I'd be glad to hear from your experiences. :)
>>
>> Best regards
>> Dennis
>>
> 

-- 
Dennis Müller, B.A.


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

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

Web: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.bib.uni-mannheim.de%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2d6d4379623c4d6865e208d8296bfa9d%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=yg12mHKDyPO8fZl8E17LGksgfhVaYSo2pWDwT1q3dDY%3D&amp;reserved=0

Attachment: Office.pm
Description: Perl program