pressbooks / excalibur

Excalibur is a SWORD protocol client for Pressbooks.
GNU General Public License v3.0
3 stars 1 forks source link

Not all file types are Submitted #13

Closed steven1350 closed 5 years ago

steven1350 commented 6 years ago

Prerequisites

Check the boxes below by changing them from [ ] to [x].

Description

Upon successful submission of an item to DSpace, not all of the file formats created in Pressbooks are submitted to DSpace.

Notably absent are formats such as "Pressbooks XML" and "Wordpress XML" (which are labeled as WXR files in the list of exported files in Pressbooks)

Sidenote: This request is from Ryerson University

Steps to Reproduce

  1. In Pressbooks, export a Book into desired formats, being sure to check Pressbooks XML and/or WordPress XML
  2. Submit the item to DSpace

Expected behavior: All formats are exported to DSpace

Actual behavior: WXR formats are not submitted to DSpace

dac514 commented 6 years ago

In my tests with Dspace not all the file types worked.

The code in excalibur/inc/dspace/class-deposit.php defines that this plugin only supports:

    static public $supportedExportTypes = [
        'pdf',
        'print-pdf',
        'epub',
        'epub3',
        'mobi',
        'xhtml',
    ];

Where supportedExportTypes are array keys from the following filter in In \Pressbooks\Utility\latest_exports:

    $filetypes = apply_filters(
        'pb_latest_export_filetypes', [
            'epub3' => '._3.epub',
            'epub' => '.epub',
            'pdf' => '.pdf',
            'print-pdf' => '._print.pdf',
            'mobi' => '.mobi',
            'icml' => '.icml',
            'htmlbook' => '.-htmlbook.html',
            'xhtml' => '.html',
            'wxr' => '.xml',
            'vanillawxr' => '._vanilla.xml',
            'mpdf' => '._oss.pdf',
            'odf' => '.odt',
        ]
    );

Can you modify $supportedExportTypes, add 'wxr', 'vanillawxr', and tell me if it works for you?

If yes, are you recommending we support all files?

SteelWagstaff commented 5 years ago

@steven1350 -- we just got an email request from one of your colleague at eCampus Ontario on this issue. Some clarification would help me as I work on a response, namely, were you able to modify the array as suggested by @connerbw above? If so, do you have answers to the two questions posed?

steven1350 commented 5 years ago

I have modified the file as requested, and I can confirm that the XML files are now successfully transferring as expected