Code Monkey home page Code Monkey logo

moodle-mod_collabora's Introduction

moodle-mod_collabora Activity Module: Collabora Online integration for Moodle

Build Status

This activity module enables Moodle users to create documents (simple text files, word, spreadsheet and presentation documents or upload a document) via a selfhosted Collabora Online Server i.e. CODE using the so called WOPI protocol and work collaboratively on this documents.

This plugin is originally written by Davo Smith from Synergy Learning in 2019 and maintained by Michael Wuttke from the Beuth University of Applied Sciences in Berlin and Andreas Grabs from Grabs EDV-Beratung.

Requirements

  • Collabora Online Server (Version 4.0.1 or later) and Moodle Server (Version 3.5 or later) with PHP 7.0 or later.

Tested Versions

  • Collabora Online Server: 6.4.0
  • Moodle: 3.7.9
  • Moodle: 3.8.6
  • Moodle: 3.9.3
  • Moodle: 3.10

Installation

This plugin should go into mod/collabora. Upon installation, several default settings need to be defined for this activity (see Settings).

Administrative Settings of the activity module

collabora_admin_settings

  • the Collabora URL (the URL of the Collabora Online Server)
  • the default format (File upload, Specified text, Spreadsheet, Wordprocessor document or Presentation)
  • the default display (current tab or new tab)
  • the default display name
  • the default display description

Choose the activity Collaborative Document

collabora_add_activity

Define the settings of the Collaborative Document

collabora_settings

View of a word document

collabora_doc

View of a spreedsheet document

collabora_spreadsheet

View of a presentation document

collabora_presentation

Testing the plugin

If you want to test the collabora activity plugin on a local Moodle installation and a local Collabora Online Server via docker then you may find the Collabora-Config.md file helpful.

Use of other Online Editors as Collabora Online, such as LibreOffice Online

This plugin should also work with the use of LibreOffice Online (LOOL) - which is the base product of Collabora Online - if you set up an LibreOffice Onliner server as described in the documentation of the Document Foundation.

Use of Collabora trademarks

The name "Collabora" is used to indicate that the plugin provides an integration facility for use of Collabora Online from within Moodle. The name does not imply an endorsement by Collabora, nor does it indicate who develops and provides the plugin. This plugin was created and is offered by members of the community.

Note that the plugin also makes use of icons that, some of which are trademarks of Collabora. The icons are made available to you under conditions that differ from the rest of the plugin; see pix/LICENSE.

moodle-mod_collabora's People

Contributors

dagefoerde avatar grabs avatar jojoob avatar justusdieckmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

moodle-mod_collabora's Issues

Not working with Collabora/LOOL 7.x

Currently testing with version 7.0 and apparently not working.

That's the log from Docker:

wsd-00006-00036 2020-09-04 10:29:35.888793 [ websrv_poll ] ERR  Unknown resource: /lool/https%3A%2F%2Fmoodle.domain.tld%2Fmod%2Fcollabora%2Fcallback.php%2Fwopi%2Ffiles%2F69_0%3Faccess_token%3D902cd64bdc99%26access_token_ttl%3D0%26permission%3Dedit/ws?WOPISrc=https://moodle.domain.tld/mod/collabora/callback.php/wopi/files/69_0&compat=/ws GWebSocket path: 10 'lool' 'https%3A%2F%2Fmoodle.domain.tld%2Fmod%2Fcollabora%2Fcallback.php%2Fwopi%2Ffiles%2F69_0%3Faccess_token%3D902cd64bdc99%26access_token_ttl%3D0%26permission%3Dedit/ws?WOPISrc=https:' 'moodle.domain.tld' 'mod' 'collabora' 'callback.php' 'wopi' 'files' '69_0&compat=' 'ws'| wsd/LOOLWSD.cpp:2412
wsd-00006-00036 2020-09-04 10:29:36.763142 [ websrv_poll ] ERR  Unknown resource: /lool/https%3A%2F%2Fmoodle.domain.tld%2Fmod%2Fcollabora%2Fcallback.php%2Fwopi%2Ffiles%2F69_0%3Faccess_token%3D902cd64bdc99%26access_token_ttl%3D0%26permission%3Dedit/ws?WOPISrc=https://moodle.domain.tld/mod/collabora/callback.php/wopi/files/69_0&compat=/ws GWebSocket path: 10 'lool' 'https%3A%2F%2Fmoodle.domain.tld%2Fmod%2Fcollabora%2Fcallback.php%2Fwopi%2Ffiles%2F69_0%3Faccess_token%3D902cd64bdc99%26access_token_ttl%3D0%26permission%3Dedit/ws?WOPISrc=https:' 'moodle.domain.tld' 'mod' 'collabora' 'callback.php' 'wopi' 'files' '69_0&compat=' 'ws'| wsd/LOOLWSD.cpp:2412
wsd-00006-00036 2020-09-04 10:29:52.081939 [ websrv_poll ] ERR  Unknown resource: /lool/https%3A%2F%2Fmoodle.domain.tld%2Fmod%2Fcollabora%2Fcallback.php%2Fwopi%2Ffiles%2F69_0%3Faccess_token%3D902cd64bdc99%26access_token_ttl%3D0%26permission%3Dedit/ws?WOPISrc=https://moodle.domain.tld/mod/collabora/callback.php/wopi/files/69_0&compat=/ws GWebSocket path: 10 'lool' 'https%3A%2F%2Fmoodle.domain.tld%2Fmod%2Fcollabora%2Fcallback.php%2Fwopi%2Ffiles%2F69_0%3Faccess_token%3D902cd64bdc99%26access_token_ttl%3D0%26permission%3Dedit/ws?WOPISrc=https:' 'moodle.domain.tld' 'mod' 'collabora' 'callback.php' 'wopi' 'files' '69_0&compat=' 'ws'| wsd/LOOLWSD.cpp:2412
wsd-00006-00036 2020-09-04 10:30:46.153221 [ websrv_poll ] ERR  Unknown resource: /lool/https%3A%2F%2Fmoodle.domain.tld%2Fmod%2Fcollabora%2Fcallback.php%2Fwopi%2Ffiles%2F69_0%3Faccess_token%3D902cd64bdc99%26access_token_ttl%3D0%26permission%3Dedit/ws?WOPISrc=https://moodle.domain.tld/mod/collabora/callback.php/wopi/files/69_0&compat=/ws GWebSocket path: 10 'lool' 'https%3A%2F%2Fmoodle.domain.tld%2Fmod%2Fcollabora%2Fcallback.php%2Fwopi%2Ffiles%2F69_0%3Faccess_token%3D902cd64bdc99%26access_token_ttl%3D0%26permission%3Dedit/ws?WOPISrc=https:' 'moodle.domain.tld' 'mod' 'collabora' 'callback.php' 'wopi' 'files' '69_0&compat=' 'ws'| wsd/LOOLWSD.cpp:2412

Document not accessible after multiple edits

Hi,
Not sure if it is a CODE-bug or a mod_collabora-bug and hard to narrow down the problem
We are facing the following problem:
A ods spreadsheet (uploaded - prefilled with data) is edited on a Moodle (latest) server using the moodle-mod_collabora plugin. Both Moodle and collabora run on Ubuntu 18.04 and collabora is installed using .deb packages. The collabora serves a Moodle and a Nextcloud.

We have problems reported from our users, showing a screen where they are offered the option to overwrite, reject or save the file as new document. Neither of them do anything and the user is stuck.
image

Other users have reported an ever reloading screen saying that the document has has changed in the repository, again they are stuck. I can't see how the document can be changed in the repository by something else then collabora.

What solves the issue is to restart the loolwsd service on the collabora server.

I notice in the loolwsd journal following warning (lots of them) that might be related:
[ docbroker_00e ] WRN LastModifiedTime [2020-03-30T20:26:29+02:00] is in invalid format.. Returning 1585599989000000000| common/Util.cpp:894
[ docbroker_00f ] WRN Invalid or missing JSON in WOPI::PutFile HTTP_OK response.| wsd/Storage.cpp:1079

And occacionally things go completely wrong:
broker_012 ] WRN LastModifiedTime [2020-03-31T08:54:25+02:00] is in invalid format.. Returning 1585644865000000000| common/Util.cpp:894
broker_012 ] WRN Client session [155] not found to forward message: o217464 status: type=spreadsheet parts=1 current=0 width=18105 height=111150 viewid=3...| wsd/DocumentBroker.cpp:2073
broker_012 ] WRN Client session [155] not found to forward message: o217467 editor: -1| wsd/DocumentBroker.cpp:2073
broker_012 ] WRN Client session [155] not found to forward message: o217470 curpart: part=0| wsd/DocumentBroker.cpp:2073
broker_012 ] WRN Client session [155] not found to forward message: o217471 setpart: part=0| wsd/DocumentBroker.cpp:2073
broker_012 ] WRN Client session [155] not found to forward message: o217472 disconnected:| wsd/DocumentBroker.cpp:2073
broker_012 ] ERR No socket associated with WebSocketHandler 0x564bbcd9cd30| ./net/WebSocketHandler.hpp:131
broker_013 ] WRN Invalid or missing JSON in WOPI::PutFile HTTP_OK response.| wsd/Storage.cpp:1079
broker_012 ] WRN LastModifiedTime [2020-03-31T08:54:25+02:00] is in invalid format.. Returning 1585644865000000000| common/Util.cpp:894
broker_012 ] WRN Client session [156] not found to forward message: o217550 status: type=spreadsheet parts=1 current=0 width=18105 height=111150 viewid=4...| wsd/DocumentBroker.cpp:2073
broker_012 ] WRN Client session [156] not found to forward message: o217553 editor: -1| wsd/DocumentBroker.cpp:2073
broker_012 ] WRN Client session [156] not found to forward message: o217556 curpart: part=0| wsd/DocumentBroker.cpp:2073
broker_012 ] WRN Client session [156] not found to forward message: o217557 setpart: part=0| wsd/DocumentBroker.cpp:2073
broker_012 ] WRN Client session [156] not found to forward message: o217584 disconnected:| wsd/DocumentBroker.cpp:2073
broker_012 ] ERR No socket associated with WebSocketHandler 0x564bbc9717b0| ./net/WebSocketHandler.hpp:131
lwsd ] SIG frk-13029-13029 2020-03-31 07:14:33.602701 [ forkit ] SIG Shutdown signal received: SIGTERM

_spare_014 ] SIG Shutdown signal received: SIGTERM

Name of this module

Hi,

just a question: why is this module named as Collabora if not endorsed by them? I think it could be better to name it as LibreOffice Online which is the base product of Collabora Online and many others.
FYI i tested this plugin with LOOL 6.4 and works just fine.
I'm asking this rename just to indicate a wider compatibility of this module.

Thanks

Bundle.js Error in Moodle frame.

I always get the
Uncaught TypeError: Cannot set property 'permission' of undefined
at NewClass.connect (bundle.js:41)
at NewClass.loadDocument (bundle.js:42)
at bundle.js:63
at bundle.js:63

in the console in both in Firefox and Chrome - Moodle 3.5.4 and Collabora 4.0.6. Any ideas? The documents fail to load for editing or viewing - only the menu shows.

Notwendiger Parameter "sesskey" fehlt

Hello,

after upgrading to v4.0-r3 (2022-11-06, 2022041902) it shows the following error (in German) when opening a "mod_collabora" activity (view.php):

Notwendiger Parameter "sesskey" fehlt (error/moodle/missingparam)

Debug-Info: 
Error code: missingparam

Stack trace: 
line 497 of /lib/setuplib.php: moodle_exception thrown
line 595 of /lib/moodlelib.php: call to print_error()
line 73 of /lib/sessionlib.php: call to required_param()
line 84 of /lib/sessionlib.php: call to confirm_sesskey()
line 267 of /mod/collabora/classes/collabora.php: call to require_sesskey()
line 77 of /mod/collabora/view.php: call to mod_collabora\collabora->process_lock_unlock()

Best regards
Andreas

Implement Privacy API

We need to add an implementation of the Privacy API that

  • declares what data is shared with external systems,
  • retrieves or deletes the associated file(s) in case of data requests or deletion.

Collabora appears in English with child language packs

Dear developers,

the Collabora document appears in English even the Moodle is set to de_du or de_kids. In the bottom line I get the setting "English (USA)" when my course language is de_du or de_kids. The Collabora menus are in German but I can’t say if the server admin only allows the German menus. It could happen that the language setting also changes the country specific settings in a Collabora Calc document as default date and time format, currency, thousands delimiter (German: point), or decimal separator (German: comma).

Yes,  when I set the course language to de then I get "Deutsch (Deutschland)" in the bottom line but not with the language packs de_du and de_kids. The German tool menu must also work with the child packages de_du, de_kids, de_ch, de_comm, de_wp. 

I am a maintainer for the German language packs. I hope you will fix this problem as soon as possible because the packages de_du and de_kids are used in Moodle for students in primary schools who do not speak English.

It seems to be the same problem as I found for the modules H5P and TinyMCE 6 in Moodle.
https://tracker.moodle.org/browse/MDL-71050
https://tracker.moodle.org/browse/MDL-77361

Best regards,
Ralf

Ralf Krause
moodleSCHULE e.V.

Adding deleting several activities causes errors

Dear developers,

if "mod_collabora" is enabled in Moodle 4.1.4 several activities e.g. "Feedback" cause an error after clicking on "Save and display":

Fehler in der Kodierung gefunden, den nur Programmierer/innen korrigieren können: The theme has already been set up for this page ready for output. Therefore, you can no longer change the theme, or anything that might affect what the current theme is, for example, the course.

Weitere Informationen über diesen Fehler

Debug-Info:  Stack trace when the theme was set up: <ul style="text-align: left" data-rel="backtrace"><li>line 1972 of /lib/setuplib.php: call to moodle_page->initialise_theme_and_output()</li><li>line 214 of /mod/collabora/lib.php: call to bootstrap_renderer->__call()</li><li>line 861 of /lib/modinfolib.php: call to collabora_get_coursemodule_info()</li><li>line 683 of /lib/modinfolib.php: call to course_modinfo::get_array_of_activities()</li><li>line 652 of /lib/modinfolib.php: call to course_modinfo::inner_build_course_cache()</li><li>line 478 of /lib/modinfolib.php: call to course_modinfo::build_course_cache()</li><li>line 436 of /lib/modinfolib.php: call to course_modinfo->__construct()</li><li>line 2556 of /lib/modinfolib.php: call to course_modinfo::instance()</li><li>line 2630 of /lib/modinfolib.php: call to get_fast_modinfo()</li><li>line 32 of /mod/feedback/view.php: call to get_course_and_cm_from_cmid()</li></ul>
Error code: codingerror×Diese Systemnachricht ablehnen
Stack trace: 
line 2076 of /lib/pagelib.php: coding_exception thrown
line 1145 of /lib/pagelib.php: call to moodle_page->ensure_theme_not_set()
line 1228 of /lib/pagelib.php: call to moodle_page->set_course()
line 2860 of /lib/moodlelib.php: call to moodle_page->set_cm()
line 3206 of /lib/moodlelib.php: call to require_login()
line 33 of /mod/feedback/view.php: call to require_course_login()
×Diese Systemnachricht ablehnen
Ausgabepuffer:  <div class="notifytiny debuggingmessage" data-rel="debugging">Coding problem: $PAGE->context was not set. You may have forgotten to call require_login() or $PAGE->set_context(). The page may not display correctly as a result<ul style="text-align: left" data-rel="backtrace"><li>line 567 of /lib/pagelib.php: call to debugging()</li><li>line 1696 of /lib/pagelib.php: call to moodle_page->magic_get_context()</li><li>line 1972 of /lib/setuplib.php: call to moodle_page->initialise_theme_and_output()</li><li>line 214 of /mod/collabora/lib.php: call to bootstrap_renderer->__call()</li><li>line 861 of /lib/modinfolib.php: call to collabora_get_coursemodule_info()</li><li>line 683 of /lib/modinfolib.php: call to course_modinfo::get_array_of_activities()</li><li>line 652 of /lib/modinfolib.php: call to course_modinfo::inner_build_course_cache()</li><li>line 478 of /lib/modinfolib.php: call to course_modinfo::build_course_cache()</li><li>line 436 of /lib/modinfolib.php: call to course_modinfo->__construct()</li><li>line 2556 of /lib/modinfolib.php: call to course_modinfo::instance()</li><li>line 2630 of /lib/modinfolib.php: call to get_fast_modinfo()</li><li>line 32 of /mod/feedback/view.php: call to get_course_and_cm_from_cmid()</li></ul></div>

When deleting an activity the following error occurs from time to tome:

codingerror
Fehler in der Kodierung gefunden, den nur Programmierer/innen korrigieren können: $PAGE-&gt;context was not set. You may have forgotten to call require_login() or $PAGE-&gt;set_context()
Datei:  /lib/pagelib.php
Zeile:  562
Stack trace: 
Error code: codingerror
* line 562 of /lib/pagelib.php: coding_exception thrown
* line 1696 of /lib/pagelib.php: call to moodle_page->magic_get_context()
* line 1972 of /lib/setuplib.php: call to moodle_page->initialise_theme_and_output()
* line 214 of /mod/collabora/lib.php: call to bootstrap_renderer->__call()
* line 861 of /lib/modinfolib.php: call to collabora_get_coursemodule_info()
* line 683 of /lib/modinfolib.php: call to course_modinfo::get_array_of_activities()
* line 652 of /lib/modinfolib.php: call to course_modinfo::inner_build_course_cache()
* line 478 of /lib/modinfolib.php: call to course_modinfo::build_course_cache()
* line 436 of /lib/modinfolib.php: call to course_modinfo->__construct()
* line 2556 of /lib/modinfolib.php: call to course_modinfo::instance()
* line 2630 of /lib/modinfolib.php: call to get_fast_modinfo()
* line 3537 of /course/externallib.php: call to get_course_and_cm_from_cmid()
* line 261 of /lib/externallib.php: call to core_course_external::edit_module()
* line 81 of /lib/ajax/service.php: call to external_api::call_external_function()

If "mod_collabora" is disabled the errors don't occur.

Best regards
Andreas

Very long loading time for document uplaod

Hello,
I have been using Collabora - Collaborative document editing for quite a while.
Today I upgraded Collabora Online Server (CODE) to the latest version.
Everything works so far. Except for one thing: When I upload a document template, the refresh takes an extremely long time. When I can finally access moodle again, the document is there and I can edit it.
Note: if I select a blank document, the duration is not measurable.
What could be the reason that it takes so long until the server is running normally again?
Many thanks for the suggestions and best regards
Remo

prohibit download

Hello,
how can I make the button/function "download" invisible for certain course roles or disallow the function "download" for certain course roles?
I did not find anything about this in the rights management of the course roles.
Best regards
Remo

Option "open in new window" doesn't work

Hello,

the option "open in new window" doesn't work.

Moodle 4.0.4 (Build: 20220912)
mod_collabora 4.0-beta-3 (2022-04-04) - 2022030602

Changing the browser makes no difference.

Best regards
Andreas

Missing feature of document versioning

Collabora supports document versioning. Working with Collabora from Moodle don't show this option. Is there a reason to hide it or is this a feature request.

Change activity icon depending on file type

The module now uses the module icon to illustrate an activity on course overview pages. Instead, choose an icon depending on the file that is being edited in that activity; i.e., use specialised icons that help distinguish between word processor documents, spreadsheets, and presentations. Fall back to the module icon as a default.

Last modification time offset when PHP time zone not UTC

We noticed a time offset for the "Last modification time". It relates to the time zone set on the Moodle server. In our case UTC+2 (CEST) = -7200 seconds. Before the time change (UTC+1 (CET)) we experienced an offset of -3600 seconds.

mod_collabora_negative_time

prohibit download

Hello Andreas,
we now have moodle 4.0 and I was able to test.
The direct download via the button is now no longer possible (if I have defined the permission for the corresponding role that way), but the download as .odt, .doc, .docx or .rtf is still possible via the "File" menu.
Is there a possibility to disable this as well?
Best regards
Remo

I am introduced a new capability for the direct download.
The new version is online.
Best regards
Andreas

Originally posted by @grabs in #34 (comment)

Unable to access documents as guest user

Hi,
I have multiple collabora documents in my course and want guest users to access them.
Also I already enabled the mod/collabora:view permission for guests in the admin settings.

When accessing the course as guest the documents (independent from type) do not show up at all.

Am I missing something?

Connection refused

Hello,

i am not sure if it is a bug, but I have no idea anymore ...

I get in the Logs:

[Sat Jul 18 21:01:09.368623 2020] [proxy_fcgi:error] [pid 13704:tid 140056627209984] [client 89.245.XXX.XX:5796] AH01071: Got error 'PHP message: PHP Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found in /var/customers/webs/webXX/moodle/mod/collabora/classes/collabora.php on line 302PHP message: PHP Warning: SimpleXMLElement::__construct(): Failed to connect to libreoffice.my.site port 9980: Connection refused in /var/customers/webs/webXX/moodle/mod/collabora/classes/collabora.php on line 302PHP message: PHP Warning: SimpleXMLElement::__construct(): ^ in /var/customers/webs/webXX/moodle/mod/collabora/classes/collabora.php on line 302PHP message: Default exception handler: Fehler: String could not be parsed as XML Debug: \nError code: generalexceptionmessage\n* line 302 of /mod/collabora/classes/collabora.php: Exception thrown\n* line 302 of /mod/collabora/classes/collabora.php: call to SimpleXMLElement->__construct()\n* line 322 of /mod/collabora/classes/collabora.php: call to mod_collabora\\collabora->get_url_from_mimetype()\n* line 338 of /mod/collabora/classes/collabora.php: call to mod_collabora\\collabora->get_collabora_url()\n* line 113 of /mod/collabora/view.php: call to mod_collabora\\collabora->get_view_url()\n', referer: https://moodle.my.site/course/view.php?id=2

Collabora Online is reachable, i dont know why I get the connection refused.

If I try to add the Collabora URL like the IP: https://123.123.123.123:8890/ I get the SSL do not match error, that is right.

Can be a problem with newtld Domains, like .berlin, .shop?

unable to save activity collaborative document

hello
I installed a collabora code server in a Docker container and we integrated it into Moodle (a production and a test environment) using the mod_collabora plugin. Everything was working without problems until the day when some users (for now only 2) can no longer save and create the Moodle activity. The "Adding a collaborative document" page loops as if there were missing fields to fill in.

I deleted one of these Moodle accounts (test environment) and I recreated it and the problem disappeared. I'm tearing out the little hair I have left. do you have any advice?

moodle 3.11
plugin 3.11.r4

Thanks for your help.
Karim

Refused to display XXX iframe because an ancestor violates the following Content Security Policy directive

I am trying to test my local development Moodle system with a remote (and public) nextcloud+collabora install. that works fine.
(Followed these install instruction: https://nextcloud.com/collaboraonline/)

Refused to display 'https://collabora.my-public-domain/loleaflet/a96fdaa/loleaflet.html?WOPISrc=http://localhost/moodle-org/moodle_38_stable/mod/collabora/callback.php/wopi/files/651_0&access_token=2c042782c5f9&closebutton=1' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors collabora.my-public-domain:* localhost:*".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.