EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #09727


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

Re: [EP-tech] Coversheets Plugin/DocumentConverter.py script


Hi Lee,

I think basically the only line you need to add to a configuration file is:

$c->{executables}->{uno_converter} = "/usr/bin/unoconv";

There should already be a config file under lib/cfg.d/ and/or archives/orca/cfg/cfg.d/ called openoffice.pl.  This is the one you want to update.  There should already be a line similar to the one above that is using DocumentConverter.py.  Just comment that out (for clarity) and add the line above.

The openoffice ingredient [1] for EPrints 3.4+ has already made these changes [2].  So if you are running 3.4, you may be better off with this and the coversheets ingredient [3] than using the old Bazaar plugins.

Regards

David Newman

[1] https://github.com/eprints/openoffice
[2] https://github.com/eprints/openoffice/blob/main/cfg.d/openoffice.pl
[3] https://github.com/eprints/coversheets


On 10/06/2024 14:07, David R Newman wrote:

Hi Lee,

I would recommend installing the RHEL package unoconv and then updating your executables.pl and invocations.pl files to use this instead of the Python script DocumentConverter.py.  That will likely be Python 2 and RHEL 8 will only have Python 3 installed.

It is also with taking a look at:

https://wiki.eprints.org/w/Coversheets

Regards

David Newman

On 10/06/2024 13:28, Lee Paton wrote:
CAUTION: This e-mail originated outside the University of Southampton.
CAUTION: This e-mail originated outside the University of Southampton.

Hi

 

I’m migrating our eprints repository from a CentOS 7 VM to a RHEL 8 VM and have hit some issues with the coversheets plugin. The DocumentConvert.py script is failing to run due to

 

Traceback (most recent call last):

  File "/usr/share/eprints/archives/orca/bin/DocumentConverter.py", line 227, in <module>

    converter.convert(argv[1], argv[2])

  File "/usr/share/eprints/archives/orca/bin/DocumentConverter.py", line 152, in convert

    family = self._detectFamily(document)

  File "/usr/share/eprints/archives/orca/bin/DocumentConverter.py", line 184, in _detectFamily

    if document.supportsService("com.sun.star.text.WebDocument"):

AttributeError: 'NoneType' object has no attribute 'supportsService'

 

It’s failing to see any of the following attributes on the document object:

 

    def _detectFamily(self, document):

        if document.supportsService("com.sun.star.text.WebDocument"):

            return FAMILY_WEB

        if document.supportsService("com.sun.star.text.GenericTextDocument"):

            # must be TextDocument or GlobalDocument

            return FAMILY_TEXT

        if document.supportsService("com.sun.star.sheet.SpreadsheetDocument"):

            return FAMILY_SPREADSHEET

        if document.supportsService("com.sun.star.presentation.PresentationDocument"):

            return FAMILY_PRESENTATION

        if document.supportsService("com.sun.star.drawing.DrawingDocument"):

            return FAMILY_DRAWING

        raise DocumentConversionException("unknown document family: %s" % document)

 

I’m not familiar with Python so have hit a bit of a dead end with googling

 

I’m currently using OpenOffice 4.1, is it worth changing to using LibreOffice?

 

Any help much appreciated

 

Thanks

 

Lee


*** Options: https://wiki.eprints.org/w/Eprints-tech_Mailing_List
*** Archive: https://www.eprints.org/tech.php/
*** EPrints community wiki: https://wiki.eprints.org/


*** Options: https://wiki.eprints.org/w/Eprints-tech_Mailing_List
*** Archive: https://www.eprints.org/tech.php/
*** EPrints community wiki: https://wiki.eprints.org/