Document converters: Microsoft OneDrive document converter

fileconverter_onedrive
Maintained by Picture of Neill Magill Neill Magill, University of Nottingham The University of Nottingham
Converts files to pdf using Microsoft OneDrive.
23 sites
45 downloads
1 fans

Converts files to pdf using Microsoft OneDrive.

You will need a Microsoft account to use this plugin.

Installation

The Microsoft OneDrive document converter follows the standard installation procedure.

  1.  Create folder <path to your moodle dir>/files/converter/onedrive.
  2. Extract files from folder inside archive to created folder.
  3. Visit page Site administration ► Notifications to complete installation.

Enabling the converter

Visit Site administration ► Plugins ► Document converters ► Manage document converters to enable the plugin

You will need to ensure that it is:

  1. Configured to use a Microsoft OAuth 2 service.
  2. Working by using the 'Test this converter is working properly' link on the settings page.

Screenshots

Screenshot #0
Screenshot #1

Contributors

Picture of Neill Magill
Neill Magill (Lead maintainer)
University of Nottingham
The University of Nottingham: Lead maintainer
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Plugins bot
    Fri, 29 Jun 2018, 10:00 PM
    Approval issue created: CONTRIB-7366
  • Picture of Tony Butler
    Wed, 4 Jul 2018, 5:19 PM
    Hi Neill, thanks for this plugin, it looks good but I'm struggling to get it working at the moment.

    I've set up the MS OAuth2 service and configured the converter to use it. The test page reports that the document converter is configured properly but when I attempt the test conversion I get the exception "accessDenied: Access Denied" in the JSON response. The new OneDrive repo plugin works fine so I guess that means the MS OAuth2 service is configured correctly (for the repo at least), but does this converter require any special permissions to be granted in the MS OAuth2 config?

    Thanks, Tony
  • Picture of Neill Magill
    Wed, 4 Jul 2018, 6:37 PM
    Hi Tony,

    It should require the Files.ReadWrite.All capability, which I believe is the same as the OneDrive repository.

    We tested it with an institutional Microsoft account. Are you using a personal one?

    You could try to use the 'Connect to a system account' button of the OAuth2 service if it already existed before installing the plugin.
  • Picture of Tony Butler
    Thu, 5 Jul 2018, 7:30 PM
    Thanks Neill. None of the permissions seem to work so we're going to try a different account.
  • Picture of Neill Magill
    Thu, 5 Jul 2018, 8:36 PM
    Hi Tony,

    In case it helps the plugin makes 3 API calls:

    * https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/driveitem_get_content_format (this one didn't document the capabilities it required, I guess it might require more than just OneDrive access)
    * https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/driveitem_delete
    * https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/driveitem_put_content

    If you do work out what is missing it will be great to know so we can add it to the documentation or plugin as needed.
  • Picture of Harry Dickinson
    Thu, 12 Jul 2018, 11:38 PM
    Hi Neill,

    Delighted to see a One Drive addition to the converters. Unfortunately I am having difficulties in getting it to work.

    I've set up the Microsoft OAuth2 service and configured the converter to use it. The test page reports that the document converter is configured and all seems fine but when tested it throws up the following debug message:



    fileconverter_onedrive/conversionfailed

    More information about this error

    ×Debug info:
    Error code: conversionfailed
    $a contents: Array
    (
    )
    ×Stack trace:
    line 482 of /lib/setuplib.php: moodle_exception thrown
    line 186 of /files/converter/onedrive/classes/converter.php: call to print_error()
    line 52 of /files/converter/onedrive/test.php: call to fileconverter_onedrive\converter->serve_test_document()

    Cannot find anything obviously wrong with the setup. Using an institutional account on Moodle Ver 3.4.

    Any insight would be appreciated.

    Regards

    Harry
  • Picture of Neill Magill
    Fri, 13 Jul 2018, 5:17 PM
    Hi Harry,

    Based on all the checks passing it should only be possible for it to fail at two points:

    * The call to the conversion call is not returning a download URL
    * for some reason your Moodle server could not download the converted file from Microsoft

    I have a new version of the plugin going through an internal review that should give some extra information that will help debug it. I will release it as soon as I can.
  • Picture of Neill Magill
    Fri, 13 Jul 2018, 8:39 PM
    Hi Harry,

    The new version of the plugin adds a statusmessage entry to the contents array that should help you understand where it is failing.
  • Picture of Harry Dickinson
    Sat, 14 Jul 2018, 12:41 AM
    Thanks Neill for the valuable info. I will put a bit of time into next week to see if I can trace the reason for failing to return the document. I will let you know how it works out.

    Cheers

    Harry
  • Picture of Harry Dickinson
    Wed, 18 Jul 2018, 9:36 PM
    Hi Neill,

    The statusmessage indicates an issue with MS Graph. Everything seems to be okay with respect to permissions etc. so am at a bit of a loss. Cannot see what changes I can make from within the API or Azure to sort this. Below is the new error message.

    fileconverter_onedrive/conversionfailed

    More information about this error

    ×Debug info:
    Error code: conversionfailed
    $a contents: Array
    (
    [statusmessage] => The Microsoft Graph conversion API did not send a URL to the converted document
    )
    ×Stack trace:
    line 482 of /lib/setuplib.php: moodle_exception thrown
    line 191 of /files/converter/onedrive/classes/converter.php: call to print_error()
    line 52 of /files/converter/onedrive/test.php: call to fileconverter_onedrive\converter->serve_test_document()

    Regards

    Harry
  • Picture of Neill Magill
    Wed, 18 Jul 2018, 11:05 PM
    Hi Harry,

    I have verified the plugin worked with a personal Microsoft account, it might be worth trying with one on your server.

    If it works with one it would suggest it could be something to do with your institutional account setup, if it still fails do you have anything between your Moodle server and the internet that could be modifying the response? I think some caches or firewalls sometimes can.
Please login to post comments